From d263a01e833a824a0851f9fdb05abc54b38e5e20 Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Sun, 15 Nov 2026 12:10:17 +1000 Subject: [PATCH 1/3] fix(admin): space the search and first-run form controls On current WordPress (7.x) the core form controls have no bottom margin. The search settings, the search page form and the first-run credentials form stacked their fields, checkboxes and toggles with no space between them, and the next label sat on the last row. A FormStack component (core Flex, column) now sets the block editor spacing: 16px between fields, 12px between the rows of a group and 24px around a group. Checkbox and toggle groups are fieldsets whose legend looks like a core control label. The Edit and Delete links in the search pages table get a gap. The Settings page already spaced its controls and the block sidebar is spaced by core, so both are unchanged. --- plugins/quant/assets/build/index-rtl.css | 2 +- plugins/quant/assets/build/index.asset.php | 2 +- plugins/quant/assets/build/index.css | 2 +- plugins/quant/assets/build/index.js | 36 +-- .../src/components/FormStack/FormStack.jsx | 45 +++ .../SearchPageEditor/SearchPageEditor.jsx | 139 ++++---- plugins/quant/assets/src/index.scss | 54 +++- plugins/quant/assets/src/pages/Onboarding.jsx | 267 ++++++++-------- plugins/quant/assets/src/pages/Search.jsx | 297 +++++++++--------- 9 files changed, 494 insertions(+), 350 deletions(-) create mode 100644 plugins/quant/assets/src/components/FormStack/FormStack.jsx diff --git a/plugins/quant/assets/build/index-rtl.css b/plugins/quant/assets/build/index-rtl.css index 1e33c08..4ff1d8c 100644 --- a/plugins/quant/assets/build/index-rtl.css +++ b/plugins/quant/assets/build/index-rtl.css @@ -1,4 +1,4 @@ .quant-admin{background:#f0f0f1;margin-right:-20px;min-height:100vh}.quant-admin__header{align-items:center;background:#1e1e1e;display:flex;justify-content:space-between;padding:12px 24px}.quant-admin__logo{align-items:center;color:#fff;display:flex;font-size:18px;font-weight:600;gap:12px}.quant-admin__version{color:#999;font-size:12px}.quant-admin__body{display:flex;min-height:calc(100vh - 56px)}.quant-admin__sidebar{background:#fff;border-left:1px solid #ddd;flex-shrink:0;padding:16px 0;width:200px}.quant-admin__sidebar ul{list-style:none;margin:0;padding:0}.quant-admin__sidebar li{margin:0}.quant-admin__sidebar a{align-items:center;color:#1e1e1e;display:flex;font-size:14px;gap:10px;padding:12px 24px;text-decoration:none;transition:background-color .15s ease}.quant-admin__sidebar a .dashicons{font-size:18px;height:18px;width:18px}.quant-admin__sidebar a:hover{background:#f6f7f7}.quant-admin__sidebar a.active{background:#5c40ff;color:#fff}.quant-admin__sidebar a.active .dashicons{color:#fff}.quant-admin__content{flex:1;max-width:1200px;padding:24px} .quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:right}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:left!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}} .quant-progress{border-right:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(-90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-right:18px} -.quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:right}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:left!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}}.quant-progress{border-right:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(-90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-right:18px}.quant-status--success{color:#00a32a;font-weight:500}.quant-status--error{color:#d63638;font-weight:500}.quant-dashboard__cards{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));margin-top:16px}.quant-cache,.quant-settings{max-width:800px}.quant-cache .components-card,.quant-cache .components-notice,.quant-settings .components-card,.quant-settings .components-notice{margin-bottom:16px}.quant-dashboard h1{margin-bottom:24px}.quant-content{max-width:1200px}.quant-content h1{margin-bottom:24px}.quant-content .components-notice,.quant-content__header-card{margin-bottom:16px}.quant-content__actions{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between}.quant-content__mode-indicator{align-items:center;display:flex;gap:12px}.quant-content__mode-badge{border-radius:16px;display:inline-block;font-size:12px;font-weight:600;letter-spacing:.5px;padding:6px 12px;text-transform:uppercase}.quant-content__mode-badge--static{background:#e7e4ff;color:#5c40ff}.quant-content__mode-badge--cdn-only{background:#e7f5ea;color:#00a32a}.quant-content__mode-description{color:#666;font-size:13px}.quant-content__batch-actions{display:flex;gap:12px}.quant-content__browser-card .components-tab-panel__tabs{border-bottom:1px solid #e2e4e7;margin-bottom:0;padding:0 16px}.quant-content__browser-card .components-tab-panel__tabs-item{font-size:13px;font-weight:500;padding:12px 16px}.quant-content__browser-card .components-tab-panel__tabs-item.is-active{box-shadow:inset 0 -3px 0 0 #5c40ff}.quant-content__browser-card .components-tab-panel__tab-content{padding:0}@media(max-width:768px){.quant-content__actions{align-items:stretch;flex-direction:column}.quant-content__mode-indicator{align-items:flex-start;flex-direction:column}.quant-content__batch-actions{flex-direction:column}.quant-content__batch-actions .components-button{justify-content:center}}.quant-connected-badge{align-items:center;background:#d4edda;border-radius:4px;color:#155724;display:inline-flex;gap:6px;padding:4px 12px}.quant-inline-test{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px;padding:12px}.quant-inline-test__detail{color:#757575;flex-basis:100%;font-size:12px}.quant-stats{display:flex;flex-wrap:wrap;gap:24px}.quant-stat{min-width:90px;text-align:center}.quant-stat__value{font-size:24px;font-weight:600}.quant-stat__label{color:#666;font-size:12px}.quant-stat--info .quant-stat__value{color:#0073aa}.quant-stat--warning .quant-stat__value{color:#b26200}.quant-stat--error .quant-stat__value{color:#d63638}.quant-stat--success .quant-stat__value{color:#00a32a}.quant-kv-table th{text-align:right;width:160px}.quant-facet-row{align-items:end;background:#fafafa;border:1px solid #ddd;border-radius:4px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));margin-bottom:12px;padding:12px}.quant-onboarding__oauth{border-bottom:1px solid #ddd;margin:8px 0 24px;padding-bottom:16px}.quant-onboarding__oauth p{margin:8px 0 0}.quant-settings .components-base-control+.components-base-control{margin-top:16px} +.quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:right}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:left!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}}.quant-progress{border-right:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(-90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-right:18px}.quant-status--success{color:#00a32a;font-weight:500}.quant-status--error{color:#d63638;font-weight:500}.quant-dashboard__cards{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));margin-top:16px}.quant-cache,.quant-settings{max-width:800px}.quant-cache .components-card,.quant-cache .components-notice,.quant-settings .components-card,.quant-settings .components-notice{margin-bottom:16px}.quant-dashboard h1{margin-bottom:24px}.quant-content{max-width:1200px}.quant-content h1{margin-bottom:24px}.quant-content .components-notice,.quant-content__header-card{margin-bottom:16px}.quant-content__actions{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between}.quant-content__mode-indicator{align-items:center;display:flex;gap:12px}.quant-content__mode-badge{border-radius:16px;display:inline-block;font-size:12px;font-weight:600;letter-spacing:.5px;padding:6px 12px;text-transform:uppercase}.quant-content__mode-badge--static{background:#e7e4ff;color:#5c40ff}.quant-content__mode-badge--cdn-only{background:#e7f5ea;color:#00a32a}.quant-content__mode-description{color:#666;font-size:13px}.quant-content__batch-actions{display:flex;gap:12px}.quant-content__browser-card .components-tab-panel__tabs{border-bottom:1px solid #e2e4e7;margin-bottom:0;padding:0 16px}.quant-content__browser-card .components-tab-panel__tabs-item{font-size:13px;font-weight:500;padding:12px 16px}.quant-content__browser-card .components-tab-panel__tabs-item.is-active{box-shadow:inset 0 -3px 0 0 #5c40ff}.quant-content__browser-card .components-tab-panel__tab-content{padding:0}@media(max-width:768px){.quant-content__actions{align-items:stretch;flex-direction:column}.quant-content__mode-indicator{align-items:flex-start;flex-direction:column}.quant-content__batch-actions{flex-direction:column}.quant-content__batch-actions .components-button{justify-content:center}}.quant-connected-badge{align-items:center;background:#d4edda;border-radius:4px;color:#155724;display:inline-flex;gap:6px;padding:4px 12px}.quant-inline-test{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px;padding:12px}.quant-inline-test__detail{color:#757575;flex-basis:100%;font-size:12px}.quant-stats{display:flex;flex-wrap:wrap;gap:24px}.quant-stat{min-width:90px;text-align:center}.quant-stat__value{font-size:24px;font-weight:600}.quant-stat__label{color:#666;font-size:12px}.quant-stat--info .quant-stat__value{color:#0073aa}.quant-stat--warning .quant-stat__value{color:#b26200}.quant-stat--error .quant-stat__value{color:#d63638}.quant-stat--success .quant-stat__value{color:#00a32a}.quant-kv-table th{text-align:right;width:160px}.quant-facet-row{align-items:end;background:#fafafa;border:1px solid #ddd;border-radius:4px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));padding:12px}.quant-facet-row>.components-button.is-link{justify-self:start;min-height:40px}.quant-field-group{border:0;margin:0;min-width:0;padding:0}.quant-field-group__label{display:block;font-size:11px;font-weight:500;line-height:1.4;margin:0 0 8px;padding:0;text-transform:uppercase}.quant-field-group__help{color:#757575;font-size:12px;line-height:1.4;margin:-4px 0 12px}.quant-onboarding__oauth{border-bottom:1px solid #ddd;margin:0;padding-bottom:16px}.quant-onboarding__oauth p{margin:8px 0 0}.quant-settings .components-base-control+.components-base-control{margin-top:16px}.quant-form-stack>h3,.quant-form-stack>h4,.quant-form-stack>p{margin:0}.quant-form-stack>.quant-field-group{margin-block:8px}.quant-form-stack>.quant-form-stack__actions{margin-top:8px} diff --git a/plugins/quant/assets/build/index.asset.php b/plugins/quant/assets/build/index.asset.php index 28f74ee..761173b 100644 --- a/plugins/quant/assets/build/index.asset.php +++ b/plugins/quant/assets/build/index.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '37c410a9a5fa831cbd42'); + array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '8039e1392598e54e4aad'); diff --git a/plugins/quant/assets/build/index.css b/plugins/quant/assets/build/index.css index 15c31a5..8a51476 100644 --- a/plugins/quant/assets/build/index.css +++ b/plugins/quant/assets/build/index.css @@ -1,4 +1,4 @@ .quant-admin{background:#f0f0f1;margin-left:-20px;min-height:100vh}.quant-admin__header{align-items:center;background:#1e1e1e;display:flex;justify-content:space-between;padding:12px 24px}.quant-admin__logo{align-items:center;color:#fff;display:flex;font-size:18px;font-weight:600;gap:12px}.quant-admin__version{color:#999;font-size:12px}.quant-admin__body{display:flex;min-height:calc(100vh - 56px)}.quant-admin__sidebar{background:#fff;border-right:1px solid #ddd;flex-shrink:0;padding:16px 0;width:200px}.quant-admin__sidebar ul{list-style:none;margin:0;padding:0}.quant-admin__sidebar li{margin:0}.quant-admin__sidebar a{align-items:center;color:#1e1e1e;display:flex;font-size:14px;gap:10px;padding:12px 24px;text-decoration:none;transition:background-color .15s ease}.quant-admin__sidebar a .dashicons{font-size:18px;height:18px;width:18px}.quant-admin__sidebar a:hover{background:#f6f7f7}.quant-admin__sidebar a.active{background:#5c40ff;color:#fff}.quant-admin__sidebar a.active .dashicons{color:#fff}.quant-admin__content{flex:1;max-width:1200px;padding:24px} .quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:left}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:right!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}} .quant-progress{border-left:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-left:18px} -.quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:left}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:right!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}}.quant-progress{border-left:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-left:18px}.quant-status--success{color:#00a32a;font-weight:500}.quant-status--error{color:#d63638;font-weight:500}.quant-dashboard__cards{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));margin-top:16px}.quant-cache,.quant-settings{max-width:800px}.quant-cache .components-card,.quant-cache .components-notice,.quant-settings .components-card,.quant-settings .components-notice{margin-bottom:16px}.quant-dashboard h1{margin-bottom:24px}.quant-content{max-width:1200px}.quant-content h1{margin-bottom:24px}.quant-content .components-notice,.quant-content__header-card{margin-bottom:16px}.quant-content__actions{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between}.quant-content__mode-indicator{align-items:center;display:flex;gap:12px}.quant-content__mode-badge{border-radius:16px;display:inline-block;font-size:12px;font-weight:600;letter-spacing:.5px;padding:6px 12px;text-transform:uppercase}.quant-content__mode-badge--static{background:#e7e4ff;color:#5c40ff}.quant-content__mode-badge--cdn-only{background:#e7f5ea;color:#00a32a}.quant-content__mode-description{color:#666;font-size:13px}.quant-content__batch-actions{display:flex;gap:12px}.quant-content__browser-card .components-tab-panel__tabs{border-bottom:1px solid #e2e4e7;margin-bottom:0;padding:0 16px}.quant-content__browser-card .components-tab-panel__tabs-item{font-size:13px;font-weight:500;padding:12px 16px}.quant-content__browser-card .components-tab-panel__tabs-item.is-active{box-shadow:inset 0 -3px 0 0 #5c40ff}.quant-content__browser-card .components-tab-panel__tab-content{padding:0}@media(max-width:768px){.quant-content__actions{align-items:stretch;flex-direction:column}.quant-content__mode-indicator{align-items:flex-start;flex-direction:column}.quant-content__batch-actions{flex-direction:column}.quant-content__batch-actions .components-button{justify-content:center}}.quant-connected-badge{align-items:center;background:#d4edda;border-radius:4px;color:#155724;display:inline-flex;gap:6px;padding:4px 12px}.quant-inline-test{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px;padding:12px}.quant-inline-test__detail{color:#757575;flex-basis:100%;font-size:12px}.quant-stats{display:flex;flex-wrap:wrap;gap:24px}.quant-stat{min-width:90px;text-align:center}.quant-stat__value{font-size:24px;font-weight:600}.quant-stat__label{color:#666;font-size:12px}.quant-stat--info .quant-stat__value{color:#0073aa}.quant-stat--warning .quant-stat__value{color:#b26200}.quant-stat--error .quant-stat__value{color:#d63638}.quant-stat--success .quant-stat__value{color:#00a32a}.quant-kv-table th{text-align:left;width:160px}.quant-facet-row{align-items:end;background:#fafafa;border:1px solid #ddd;border-radius:4px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));margin-bottom:12px;padding:12px}.quant-onboarding__oauth{border-bottom:1px solid #ddd;margin:8px 0 24px;padding-bottom:16px}.quant-onboarding__oauth p{margin:8px 0 0}.quant-settings .components-base-control+.components-base-control{margin-top:16px} +.quant-content-browser{padding:16px}.quant-content-browser--loading{align-items:center;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:200px}.quant-content-browser__taxonomy-selector{margin-bottom:16px;max-width:300px}.quant-content-browser__footer,.quant-content-browser__header{align-items:center;display:flex;justify-content:space-between;padding:8px 0}.quant-content-browser__count{color:#666;font-size:13px}.quant-content-browser__empty{color:#666;padding:40px 20px;text-align:center}.quant-content-browser__empty p{margin:0}.quant-content-browser__table{border-collapse:collapse;margin:8px 0;width:100%}.quant-content-browser__table td,.quant-content-browser__table th{border-bottom:1px solid #e2e4e7;padding:12px 8px;text-align:left}.quant-content-browser__table th{background:#f6f7f7;color:#1e1e1e;font-size:13px;font-weight:600}.quant-content-browser__table td{font-size:13px;vertical-align:middle}.quant-content-browser__table tbody tr:hover{background:#f9f9f9}.quant-content-browser__table tbody tr.is-selected{background:#f0f0ff}.quant-content-browser__col-checkbox{text-align:center!important;width:40px}.quant-content-browser__col-checkbox .components-checkbox-control__input-container{margin:0 auto}.quant-content-browser__col-title{min-width:200px}.quant-content-browser__col-title strong{color:#1e1e1e;display:block}.quant-content-browser__subtype{background:#f0f0f1;border-radius:3px;color:#666;display:inline-block;font-size:11px;margin-top:4px;padding:2px 6px}.quant-content-browser__col-url{max-width:250px}.quant-content-browser__col-url code{background:#f6f7f7;border-radius:3px;color:#666;display:block;font-size:12px;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.quant-content-browser__col-status{width:100px}.quant-content-browser__col-synced{color:#666;font-size:12px;width:160px}.quant-content-browser__col-actions{text-align:right!important;width:100px}.quant-status-badge{border-radius:12px;display:inline-block;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 10px;text-transform:uppercase}.quant-status-badge--synced{background:#d4edda;color:#155724}.quant-status-badge--pending{background:#fff3cd;color:#856404}.quant-status-badge--never{background:#e2e3e5;color:#6c757d}.quant-status-badge--failed{background:#f8d7da;color:#721c24}.quant-pagination{align-items:center;display:flex;gap:12px}.quant-pagination__info{color:#666;font-size:13px}@media(max-width:1200px){.quant-content-browser__col-url{display:none}}@media(max-width:900px){.quant-content-browser__col-synced{display:none}.quant-content-browser__footer,.quant-content-browser__header{flex-direction:column;gap:12px}}.quant-progress{border-left:4px solid #5c40ff;margin-bottom:16px}.quant-progress__content{padding:4px 0}.quant-progress__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.quant-progress__title{color:#1e1e1e;font-size:14px;font-weight:600;margin:0}.quant-progress__processing{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;padding:4px 8px}.quant-progress__bar-container{background:#e2e4e7;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden}.quant-progress__bar{border-radius:4px;height:100%;transition:width .3s ease}.quant-progress__bar--active{animation:pulse 1.5s ease-in-out infinite;background:linear-gradient(90deg,#5c40ff,#7b5cff)}.quant-progress__bar--complete{background:#00a32a}.quant-progress__bar--error,.quant-progress__bar--failed{background:#d63638}.quant-progress__stats{display:flex;gap:16px;margin-bottom:12px}.quant-progress__stat{color:#666;font-size:13px}.quant-progress__stat--completed{color:#00a32a}.quant-progress__stat--pending{color:#996800}.quant-progress__stat--failed{color:#d63638}.quant-progress__error{background:#fcf0f1;border-radius:4px;color:#d63638;font-size:13px;margin:0 0 12px;padding:8px 12px}.quant-progress__actions{display:flex;gap:12px}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.quant-progress__errors{color:#8a2424;font-size:12px;margin:0 0 12px;padding-left:18px}.quant-status--success{color:#00a32a;font-weight:500}.quant-status--error{color:#d63638;font-weight:500}.quant-dashboard__cards{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));margin-top:16px}.quant-cache,.quant-settings{max-width:800px}.quant-cache .components-card,.quant-cache .components-notice,.quant-settings .components-card,.quant-settings .components-notice{margin-bottom:16px}.quant-dashboard h1{margin-bottom:24px}.quant-content{max-width:1200px}.quant-content h1{margin-bottom:24px}.quant-content .components-notice,.quant-content__header-card{margin-bottom:16px}.quant-content__actions{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between}.quant-content__mode-indicator{align-items:center;display:flex;gap:12px}.quant-content__mode-badge{border-radius:16px;display:inline-block;font-size:12px;font-weight:600;letter-spacing:.5px;padding:6px 12px;text-transform:uppercase}.quant-content__mode-badge--static{background:#e7e4ff;color:#5c40ff}.quant-content__mode-badge--cdn-only{background:#e7f5ea;color:#00a32a}.quant-content__mode-description{color:#666;font-size:13px}.quant-content__batch-actions{display:flex;gap:12px}.quant-content__browser-card .components-tab-panel__tabs{border-bottom:1px solid #e2e4e7;margin-bottom:0;padding:0 16px}.quant-content__browser-card .components-tab-panel__tabs-item{font-size:13px;font-weight:500;padding:12px 16px}.quant-content__browser-card .components-tab-panel__tabs-item.is-active{box-shadow:inset 0 -3px 0 0 #5c40ff}.quant-content__browser-card .components-tab-panel__tab-content{padding:0}@media(max-width:768px){.quant-content__actions{align-items:stretch;flex-direction:column}.quant-content__mode-indicator{align-items:flex-start;flex-direction:column}.quant-content__batch-actions{flex-direction:column}.quant-content__batch-actions .components-button{justify-content:center}}.quant-connected-badge{align-items:center;background:#d4edda;border-radius:4px;color:#155724;display:inline-flex;gap:6px;padding:4px 12px}.quant-inline-test{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-wrap:wrap;gap:12px;margin-bottom:16px;padding:12px}.quant-inline-test__detail{color:#757575;flex-basis:100%;font-size:12px}.quant-stats{display:flex;flex-wrap:wrap;gap:24px}.quant-stat{min-width:90px;text-align:center}.quant-stat__value{font-size:24px;font-weight:600}.quant-stat__label{color:#666;font-size:12px}.quant-stat--info .quant-stat__value{color:#0073aa}.quant-stat--warning .quant-stat__value{color:#b26200}.quant-stat--error .quant-stat__value{color:#d63638}.quant-stat--success .quant-stat__value{color:#00a32a}.quant-kv-table th{text-align:left;width:160px}.quant-facet-row{align-items:end;background:#fafafa;border:1px solid #ddd;border-radius:4px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));padding:12px}.quant-facet-row>.components-button.is-link{justify-self:start;min-height:40px}.quant-field-group{border:0;margin:0;min-width:0;padding:0}.quant-field-group__label{display:block;font-size:11px;font-weight:500;line-height:1.4;margin:0 0 8px;padding:0;text-transform:uppercase}.quant-field-group__help{color:#757575;font-size:12px;line-height:1.4;margin:-4px 0 12px}.quant-onboarding__oauth{border-bottom:1px solid #ddd;margin:0;padding-bottom:16px}.quant-onboarding__oauth p{margin:8px 0 0}.quant-settings .components-base-control+.components-base-control{margin-top:16px}.quant-form-stack>h3,.quant-form-stack>h4,.quant-form-stack>p{margin:0}.quant-form-stack>.quant-field-group{margin-block:8px}.quant-form-stack>.quant-form-stack__actions{margin-top:8px} diff --git a/plugins/quant/assets/build/index.js b/plugins/quant/assets/build/index.js index f0c2d05..684bb53 100644 --- a/plugins/quant/assets/build/index.js +++ b/plugins/quant/assets/build/index.js @@ -1,18 +1,18 @@ -(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,n=window.wp.element,a=window.ReactDOM;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}var p;function _(e,t,n){return void 0===n&&(n="/"),function(e,t,n,a){let l=k(("string"==typeof t?m(t):t).pathname||"/",n);if(null==l)return null;let r=h(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(r);let s=null,o=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return i(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}(l);for(let e=0;null==s&&e{let s={relativePath:void 0===r?e.path||"":r,caseSensitive:!0===e.caseSensitive,childrenIndex:l,route:e};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(a),'Absolute route path "'+s.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(a.length));let i=R([a,s.relativePath]),c=n.concat(s);e.children&&e.children.length>0&&(o(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+i+'".'),h(e.children,t,c,i)),(null!=e.path||e.index)&&t.push({path:i,score:x(i,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of g(e.path))l(e,t,n);else l(e,t)}),t}function g(e){let t=e.split("/");if(0===t.length)return[];let[n,...a]=t,l=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===a.length)return l?[r,""]:[r];let s=g(a.join("/")),o=[];return o.push(...s.map(e=>""===e?r:[r,e].join("/"))),l&&o.push(...s),o.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const E=/^:[\w-]+$/,y=3,f=2,v=1,q=10,b=-2,C=e=>"*"===e;function x(e,t){let n=e.split("/"),a=n.length;return n.some(C)&&(a+=b),t&&(a+=f),n.filter(e=>!C(e)).reduce((e,t)=>e+(E.test(t)?y:""===t?v:q),a)}function w(e,t,n){void 0===n&&(n=!1);let{routesMeta:a}=e,l={},r="/",s=[];for(let e=0;e(a.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),l+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":""!==e&&"/"!==e&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let r=l[0],s=r.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:a.reduce((e,t,n)=>{let{paramName:a,isOptional:l}=t;if("*"===a){let e=o[n]||"";s=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}const i=o[n];return e[a]=l&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:r,pathnameBase:s,pattern:e}}function k(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&"/"!==a?null:e.slice(n)||"/"}function N(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function T(e,t,n,a){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(a)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function P(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function B(e,t,n,a){let r;void 0===a&&(a=!1),"string"==typeof e?r=m(e):(r=l({},e),o(!r.pathname||!r.pathname.includes("?"),T("?","pathname","search",r)),o(!r.pathname||!r.pathname.includes("#"),T("#","pathname","hash",r)),o(!r.search||!r.search.includes("#"),T("#","search","hash",r)));let s,i=""===e||""===r.pathname,c=i?"/":r.pathname;if(null==c)s=n;else{let e=t.length-1;if(!a&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let n,{pathname:a,search:l="",hash:r=""}="string"==typeof e?m(e):e;return a?(a=D(a),n=a.startsWith("/")?N(a.substring(1),"/"):N(a,t)):n=t,{pathname:n,search:j(l),hash:O(r)}}(r,s),d=c&&"/"!==c&&c.endsWith("/"),p=(i||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const D=e=>e.replace(/\/\/+/g,"/"),R=e=>D(e.join("/")),A=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const F=["post","put","patch","delete"],M=(new Set(F),["get",...F]);function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),t.useCallback(function(t,l){void 0===l&&(l={}),a.current&&("number"==typeof t?e.navigate(t):e.navigate(t,$({fromRouteId:n},l)))},[e,n])}():function(){W()||o(!1);let e=t.useContext(z),{basename:n,future:a,navigator:l}=t.useContext(Q),{matches:r}=t.useContext(U),{pathname:s}=Y(),i=JSON.stringify(P(r,a.v7_relativeSplatPath)),c=t.useRef(!1);return V(()=>{c.current=!0}),t.useCallback(function(t,a){if(void 0===a&&(a={}),!c.current)return;if("number"==typeof t)return void l.go(t);let r=B(t,JSON.parse(i),s,"path"===a.relative);null==e&&"/"!==n&&(r.pathname="/"===r.pathname?n:R([n,r.pathname])),(a.replace?l.replace:l.push)(r,a.state,a)},[n,l,i,s,e])}()}function J(e,n){let{relative:a}=void 0===n?{}:n,{future:l}=t.useContext(Q),{matches:r}=t.useContext(U),{pathname:s}=Y(),o=JSON.stringify(P(r,l.v7_relativeSplatPath));return t.useMemo(()=>B(e,JSON.parse(o),s,"path"===a),[e,o,s,a])}function K(e,n,a,l){W()||o(!1);let{navigator:s}=t.useContext(Q),{matches:i}=t.useContext(U),c=i[i.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let p,h=Y();if(n){var g;let e="string"==typeof n?m(n):n;"/"===d||(null==(g=e.pathname)?void 0:g.startsWith(d))||o(!1),p=e}else p=h;let E=p.pathname||"/",y=E;if("/"!==d){let e=d.replace(/^\//,"").split("/");y="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let f=_(e,{pathname:y}),v=function(e,n,a,l){var r;if(void 0===n&&(n=[]),void 0===a&&(a=null),void 0===l&&(l=null),null==e){var s;if(!a)return null;if(a.errors)e=a.matches;else{if(!(null!=(s=l)&&s.v7_partialHydration&&0===n.length&&!a.initialized&&a.matches.length>0))return null;e=a.matches}}let i=e,c=null==(r=a)?void 0:r.errors;if(null!=c){let e=i.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||o(!1),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,d=-1;if(a&&l&&l.v7_partialHydration)for(let e=0;e=0?i.slice(0,d+1):[i[0]];break}}}return i.reduceRight((e,l,r)=>{let s,o=!1,m=null,p=null;var _;a&&(s=c&&l.route.id?c[l.route.id]:void 0,m=l.route.errorElement||Z,u&&(d<0&&0===r?(re[_="route-fallback"]||(re[_]=!0),o=!0,p=null):d===r&&(o=!0,p=l.route.hydrateFallbackElement||null)));let h=n.concat(i.slice(0,r+1)),g=()=>{let n;return n=s?m:o?p:l.route.Component?t.createElement(l.route.Component,null):l.route.element?l.route.element:e,t.createElement(te,{match:l,routeContext:{outlet:e,matches:h,isDataRoute:null!=a},children:n})};return a&&(l.route.ErrorBoundary||l.route.errorElement||0===r)?t.createElement(ee,{location:a.location,revalidation:a.revalidation,component:m,error:s,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:R([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:R([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,a,l);return n&&v?t.createElement(L.Provider,{value:{location:$({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:r.Pop}},v):v}function X(){let e=function(){var e;let n=t.useContext(H),a=function(){let e=t.useContext(I);return e||o(!1),e}(ae.UseRouteError),l=le(ae.UseRouteError);return void 0!==n?n:null==(e=a.errors)?void 0:e[l]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),a?t.createElement("pre",{style:l},a):null,null)}const Z=t.createElement(X,null);class ee extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(U.Provider,{value:this.props.routeContext},t.createElement(H.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function te(e){let{routeContext:n,match:a,children:l}=e,r=t.useContext(z);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),t.createElement(U.Provider,{value:n},l)}var ne=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ne||{}),ae=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ae||{});function le(e){let n=function(){let e=t.useContext(U);return e||o(!1),e}(),a=n.matches[n.matches.length-1];return a.route.id||o(!1),a.route.id}const re={};function se(e){let{to:n,replace:a,state:l,relative:r}=e;W()||o(!1);let{future:s,static:i}=t.useContext(Q),{matches:c}=t.useContext(U),{pathname:u}=Y(),d=G(),m=B(n,P(c,s.v7_relativeSplatPath),u,"path"===r),p=JSON.stringify(m);return t.useEffect(()=>d(JSON.parse(p),{replace:a,state:l,relative:r}),[d,p,r,a,l]),null}function oe(e){o(!1)}function ie(e){let{basename:n="/",children:a=null,location:l,navigationType:s=r.Pop,navigator:i,static:c=!1,future:u}=e;W()&&o(!1);let d=n.replace(/^\/*/,"/"),p=t.useMemo(()=>({basename:d,navigator:i,static:c,future:$({v7_relativeSplatPath:!1},u)}),[d,u,i,c]);"string"==typeof l&&(l=m(l));let{pathname:_="/",search:h="",hash:g="",state:E=null,key:y="default"}=l,f=t.useMemo(()=>{let e=k(_,d);return null==e?null:{location:{pathname:e,search:h,hash:g,state:E,key:y},navigationType:s}},[d,_,h,g,E,y,s]);return null==f?null:t.createElement(Q.Provider,{value:p},t.createElement(L.Provider,{children:a,value:f}))}function ce(e){let{children:t,location:n}=e;return K(ue(t),n)}function ue(e,n){void 0===n&&(n=[]);let a=[];return t.Children.forEach(e,(e,l)=>{if(!t.isValidElement(e))return;let r=[...n,l];if(e.type===t.Fragment)return void a.push.apply(a,ue(e.props.children,r));e.type!==oe&&o(!1),e.props.index&&e.props.children&&o(!1);let s={id:e.props.id||r.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=ue(e.props.children,r)),a.push(s)}),a}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t{}),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const pe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_e=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const he=t.createContext({isTransitioning:!1});new Map;const ge=t.startTransition;function Ee(e){let{basename:n,children:a,future:p,window:_}=e,h=t.useRef();var g;null==h.current&&(h.current=(void 0===(g={window:_,v5Compat:!0})&&(g={}),function(e,t,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:m=!1}=a,p=i.history,_=r.Pop,h=null,g=E();function E(){return(p.state||{idx:null}).idx}function y(){_=r.Pop;let e=E(),t=null==e?null:e-g;g=e,h&&h({action:_,location:v.location,delta:t})}function f(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:d(e);return n=n.replace(/ $/,"%20"),o(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,p.replaceState(l({},p.state,{idx:g}),""));let v={get action(){return _},get location(){return e(i,p)},listen(e){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(s,y),h=e,()=>{i.removeEventListener(s,y),h=null}},createHref:e=>t(i,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){_=r.Push;let a=u(v.location,e,t);n&&n(a,e),g=E()+1;let l=c(a,g),s=v.createHref(a);try{p.pushState(l,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(s)}m&&h&&h({action:_,location:v.location,delta:1})},replace:function(e,t){_=r.Replace;let a=u(v.location,e,t);n&&n(a,e),g=E();let l=c(a,g),s=v.createHref(a);p.replaceState(l,"",s),m&&h&&h({action:_,location:v.location,delta:0})},go:e=>p.go(e)};return v}(function(e,t){let{pathname:n="/",search:a="",hash:l=""}=m(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),u("",{pathname:n,search:a,hash:l},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),a="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");a=-1===n?t:t.slice(0,n)}return a+"#"+("string"==typeof t?t:d(t))},function(e,t){i("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},g)));let E=h.current,[y,f]=t.useState({action:E.action,location:E.location}),{v7_startTransition:v}=p||{},q=t.useCallback(e=>{v&&ge?ge(()=>f(e)):f(e)},[f,v]);return t.useLayoutEffect(()=>E.listen(q),[E,q]),t.useEffect(()=>{return null==(e=p)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[p]),t.createElement(ie,{basename:n,children:a,location:y.location,navigationType:y.action,navigator:E,future:p})}a.flushSync,t.useId;const ye="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ve=t.forwardRef(function(e,n){let a,{onClick:l,relative:r,reloadDocument:s,replace:i,state:c,target:u,to:m,preventScrollReset:p,viewTransition:_}=e,h=me(e,pe),{basename:g}=t.useContext(Q),E=!1;if("string"==typeof m&&fe.test(m)&&(a=m,ye))try{let e=new URL(window.location.href),t=m.startsWith("//")?new URL(e.protocol+m):new URL(m),n=k(t.pathname,g);t.origin===e.origin&&null!=n?m=n+t.search+t.hash:E=!0}catch(e){}let y=function(e,n){let{relative:a}=void 0===n?{}:n;W()||o(!1);let{basename:l,navigator:r}=t.useContext(Q),{hash:s,pathname:i,search:c}=J(e,{relative:a}),u=i;return"/"!==l&&(u="/"===i?l:R([l,i])),r.createHref({pathname:u,search:c,hash:s})}(m,{relative:r}),f=function(e,n){let{target:a,replace:l,state:r,preventScrollReset:s,relative:o,viewTransition:i}=void 0===n?{}:n,c=G(),u=Y(),m=J(e,{relative:o});return t.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,a)){t.preventDefault();let n=void 0!==l?l:d(u)===d(m);c(e,{replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,c,m,l,r,a,e,s,o,i])}(m,{replace:i,state:c,target:u,preventScrollReset:p,relative:r,viewTransition:_});return t.createElement("a",de({},h,{href:a||y,onClick:E||s?l:function(e){l&&l(e),e.defaultPrevented||f(e)},ref:n,target:u}))}),qe=t.forwardRef(function(e,n){let{"aria-current":a="page",caseSensitive:l=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:d}=e,m=me(e,_e),p=J(c,{relative:m.relative}),_=Y(),h=t.useContext(I),{navigator:g,basename:E}=t.useContext(Q),y=null!=h&&function(e,n){void 0===n&&(n={});let a=t.useContext(he);null==a&&o(!1);let{basename:l}=function(){let e=t.useContext(z);return e||o(!1),e}(be.useViewTransitionState),r=J(e,{relative:n.relative});if(!a.isTransitioning)return!1;let s=k(a.currentLocation.pathname,l)||a.currentLocation.pathname,i=k(a.nextLocation.pathname,l)||a.nextLocation.pathname;return null!=S(r.pathname,i)||null!=S(r.pathname,s)}(p)&&!0===u,f=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,v=_.pathname,q=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;l||(v=v.toLowerCase(),q=q?q.toLowerCase():null,f=f.toLowerCase()),q&&E&&(q=k(q,E)||q);const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let C,x=v===f||!s&&v.startsWith(f)&&"/"===v.charAt(b),w=null!=q&&(q===f||!s&&q.startsWith(f)&&"/"===q.charAt(f.length)),N={isActive:x,isPending:w,isTransitioning:y},T=x?a:void 0;C="function"==typeof r?r(N):[r,x?"active":null,w?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof i?i(N):i;return t.createElement(ve,de({},m,{"aria-current":T,className:C,ref:n,style:P,to:c,viewTransition:u}),"function"==typeof d?d(N):d)});var be,Ce;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(be||(be={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ce||(Ce={}));const xe=window.wp.i18n;function we({children:e}){return(0,t.createElement)("div",{className:"quant-admin"},(0,t.createElement)("header",{className:"quant-admin__header"},(0,t.createElement)("div",{className:"quant-admin__logo"},(0,t.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},(0,t.createElement)("rect",{width:"32",height:"32",rx:"6",fill:"#5c40ff"}),(0,t.createElement)("text",{x:"50%",y:"55%",dominantBaseline:"middle",textAnchor:"middle",fill:"white",fontSize:"16",fontWeight:"bold"},"Q")),(0,t.createElement)("span",null,"QuantCDN")),(0,t.createElement)("div",{className:"quant-admin__version"},"v",window.quantAdmin?.version||"2.0.0")),(0,t.createElement)("div",{className:"quant-admin__body"},(0,t.createElement)("nav",{className:"quant-admin__sidebar"},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/dashboard"},(0,t.createElement)("span",{className:"dashicons dashicons-dashboard"}),(0,xe.__)("Dashboard","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/content"},(0,t.createElement)("span",{className:"dashicons dashicons-media-text"}),(0,xe.__)("Content","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/search"},(0,t.createElement)("span",{className:"dashicons dashicons-search"}),(0,xe.__)("Search","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/cache"},(0,t.createElement)("span",{className:"dashicons dashicons-trash"}),(0,xe.__)("Cache","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/settings"},(0,t.createElement)("span",{className:"dashicons dashicons-admin-settings"}),(0,xe.__)("Settings","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/diagnostics"},(0,t.createElement)("span",{className:"dashicons dashicons-info-outline"}),(0,xe.__)("Diagnostics","quant"))))),(0,t.createElement)("main",{className:"quant-admin__content"},e)))}const Se=window.wp.components,ke=window.wp.apiFetch;var Ne=e.n(ke);function Te({label:e,value:n,tone:a}){return(0,t.createElement)("div",{className:`quant-stat quant-stat--${a||"neutral"}`},(0,t.createElement)("div",{className:"quant-stat__value"},n),(0,t.createElement)("div",{className:"quant-stat__label"},e))}function Pe(){var e,a,l,r;const s=G(),[o,i]=(0,n.useState)(null),[c,u]=(0,n.useState)([]),[d,m]=(0,n.useState)(!1),[p,_]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),E=(0,n.useCallback)(async()=>{try{const[e,t]=await Promise.all([Ne()({path:"/quant/v1/status"}),Ne()({path:"/quant/v1/queue/errors"})]);i(e),u(t),g(null)}catch(e){g(e.message||(0,xe.__)("Failed to load the plugin status.","quant")),i({connected:!1,configured:!1,mode:"static",queue:{}})}},[]);if((0,n.useEffect)(()=>{E()},[E]),(0,n.useEffect)(()=>{!1===o?.configured&&Ne()({path:"/quant/v1/onboarding/status"}).then(e=>{"onboarding"===e.state?s("/onboarding"):"migration"===e.state&&s("/migration")}).catch(()=>{})},[o,s]),!o)return(0,t.createElement)("div",{className:"quant-dashboard"},(0,t.createElement)("h1",null,(0,xe.__)("Dashboard","quant")),(0,t.createElement)(Se.Spinner,null));const y=o.queue||{},f="static"===o.mode;return(0,t.createElement)("div",{className:"quant-dashboard"},(0,t.createElement)("h1",null,(0,xe.__)("Dashboard","quant")),h&&(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},h),p&&(0,t.createElement)(Se.Notice,{status:p.status,onRemove:()=>_(null),isDismissible:!0},p.message),o.cron_disabled&&y.pending>0&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)('WP-Cron is disabled on this site. Pending items are only processed by "Process Queue", a system cron that calls wp-cron.php, or WP-CLI.',"quant")),(0,t.createElement)("div",{className:"quant-dashboard__cards"},(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Connection","quant"))),(0,t.createElement)(Se.CardBody,null,o.connected?(0,t.createElement)("p",{className:"quant-status--success"},(0,xe.__)("Connected to Quant","quant"),o.search_enabled?" · "+(0,xe.__)("Search enabled","quant"):""):(0,t.createElement)("p",{className:"quant-status--error"},o.configured?(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ -(0,xe.__)("Not connected: %s","quant"),o.error||""):(0,xe.__)("Not configured yet.","quant")),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/settings")},(0,xe.__)("Settings","quant")))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Mode","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,t.createElement)("strong",null,f?(0,xe.__)("Static Site","quant"):(0,xe.__)("CDN Only","quant")),(0,t.createElement)("br",null),(0,t.createElement)("span",{style:{color:"#666",fontSize:"13px"}},f?(0,xe.__)("Pages are published to the Quant edge.","quant"):(0,xe.__)("Quant caches WordPress and purges on change.","quant"))))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Quick Actions","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,f&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/content")},(0,xe.__)("Push content","quant")),(0,t.createElement)("br",null)),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/cache")},(0,xe.__)("Purge cache","quant")),(0,t.createElement)("br",null),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/diagnostics")},(0,xe.__)("Diagnostics","quant")))))),f&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Sync Queue","quant")),(0,t.createElement)("div",null,(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",onClick:async()=>{m(!0),_(null);try{const e=await Ne()({path:"/quant/v1/queue/process",method:"POST",data:{limit:20}});_({status:e.failed>0?"warning":"success",message:(0,xe.sprintf)(/* translators: 1: processed items, 2: failed items, 3: items still pending */ /* translators: 1: processed items, 2: failed items, 3: items still pending */ -(0,xe.__)("Processed %1$d items, %2$d failed, %3$d still pending.","quant"),e.processed||0,e.failed||0,e.remaining||0)})}catch(e){_({status:"error",message:e.message||(0,xe.__)("Failed to process the queue.","quant")})}finally{m(!1),await E()}},disabled:d||!y.pending,isBusy:d},(0,xe.__)("Process now","quant"))," ",y.failed>0&&(0,t.createElement)(Se.Button,{variant:"tertiary",size:"small",onClick:async()=>{_(null);try{const e=await Ne()({path:"/quant/v1/queue/retry",method:"POST"});_({status:"info",message:(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ -(0,xe.__)("%d failed items were queued again.","quant"),e.queued||0)})}catch(e){_({status:"error",message:e.message||(0,xe.__)("Failed to retry.","quant")})}await E()}},(0,xe.__)("Retry failed","quant")))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-stats"},(0,t.createElement)(Te,{label:(0,xe.__)("Pending","quant"),value:null!==(e=y.pending)&&void 0!==e?e:0,tone:"info"}),(0,t.createElement)(Te,{label:(0,xe.__)("Processing","quant"),value:null!==(a=y.processing)&&void 0!==a?a:0,tone:"warning"}),(0,t.createElement)(Te,{label:(0,xe.__)("Failed","quant"),value:null!==(l=y.failed)&&void 0!==l?l:0,tone:"error"}),(0,t.createElement)(Te,{label:(0,xe.__)("Completed","quant"),value:null!==(r=y.completed)&&void 0!==r?r:0,tone:"success"})),o.next_cron&&(0,t.createElement)("p",{style:{color:"#666",fontSize:"13px"}},(0,xe.sprintf)(/* translators: %s: time of the next cron run */ /* translators: %s: time of the next cron run */ -(0,xe.__)("Next background run: %s","quant"),o.next_cron_label||new Date(1e3*o.next_cron).toLocaleTimeString())),c.length>0&&(0,t.createElement)("table",{className:"widefat striped",style:{marginTop:"12px"}},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Type","quant")),(0,t.createElement)("th",null,(0,xe.__)("Item","quant")),(0,t.createElement)("th",null,(0,xe.__)("Error","quant")))),(0,t.createElement)("tbody",null,c.slice(0,5).map((e,n)=>(0,t.createElement)("tr",{key:n},(0,t.createElement)("td",null,e.type),(0,t.createElement)("td",null,(0,t.createElement)("code",null,e.object_id)),(0,t.createElement)("td",{style:{color:"#721c24"}},e.error_message))))))))}function Be({status:e}){const n={synced:(0,xe.__)("Synced","quant"),pending:(0,xe.__)("Pending","quant"),never:(0,xe.__)("Never","quant"),failed:(0,xe.__)("Failed","quant")};return(0,t.createElement)("span",{className:`quant-status-badge quant-status-badge--${e}`},n[e]||e)}function De({page:e,pages:n,onPageChange:a}){return n<=1?null:(0,t.createElement)("div",{className:"quant-pagination"},(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",disabled:e<=1,onClick:()=>a(e-1)},(0,xe.__)("Previous","quant")),(0,t.createElement)("span",{className:"quant-pagination__info"},(0,xe.__)("Page","quant")," ",e," ",(0,xe.__)("of","quant")," ",n),(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",disabled:e>=n,onClick:()=>a(e+1)},(0,xe.__)("Next","quant")))}function Re({contentType:e,contentTypes:a,specialType:l,onSelectionChange:r,refreshToken:s=0}){const[o,i]=(0,n.useState)([]),[c,u]=(0,n.useState)(!0),[d,m]=(0,n.useState)(null),[p,_]=(0,n.useState)(1),[h,g]=(0,n.useState)(1),[E,y]=(0,n.useState)(0),[f,v]=(0,n.useState)(new Set),[q,b]=(0,n.useState)(!1),C=Array.isArray(a)&&a.length>0,[x,w]=(0,n.useState)(()=>C?a[0].subtype||"category":""),S=e&&e.type,k=e&&e.subtype||"";(0,n.useEffect)(()=>{let e=!1;return u(!0),m(null),Ne()({path:"theme_assets"===l?`/quant/v1/theme-assets?page=${p}&per_page=50`:"redirects"===l?`/quant/v1/redirects?page=${p}&per_page=50`:`/quant/v1/content?type=${C?"taxonomy":S||"post"}&subtype=${encodeURIComponent(C?x:k)}&page=${p}&per_page=20`}).then(t=>{e||(i(t.items||[]),g(t.pages||1),y(t.total||0))}).catch(t=>{e||(i([]),g(1),y(0),m(t.message||(0,xe.__)("Failed to load content.","quant")))}).finally(()=>{e||u(!1)}),()=>{e=!0}},[p,x,s,l,C,S,k]);const N=e=>{w(e),_(1),v(new Set),b(!1)};(0,n.useEffect)(()=>{v(new Set),b(!1)},[e,a,l]),(0,n.useEffect)(()=>{if(r){const e=o.filter(e=>f.has(e.id)).map(e=>({type:e.type,id:e.id,subtype:e.subtype,url:e.url}));r(e)}},[f,o,r]);const T=e=>{_(e),v(new Set),b(!1)},P=e=>e.url;return c&&0===o.length?(0,t.createElement)("div",{className:"quant-content-browser quant-content-browser--loading"},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("p",null,(0,xe.__)("Loading content…","quant"))):(0,t.createElement)("div",{className:"quant-content-browser"},(()=>{if(!a||a.length<=1)return null;const e=a.map(e=>({label:`${e.label} (${e.count})`,value:e.subtype}));return(0,t.createElement)("div",{className:"quant-content-browser__taxonomy-selector"},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Taxonomy","quant"),value:x,options:e,onChange:N,__nextHasNoMarginBottom:!0}))})(),(0,t.createElement)("div",{className:"quant-content-browser__header"},(0,t.createElement)("span",{className:"quant-content-browser__count"},E," ",(0,xe.__)("items","quant"),f.size>0&&` (${f.size} ${(0,xe.__)("selected","quant")})`),(0,t.createElement)(De,{page:p,pages:h,onPageChange:T})),d&&(0,t.createElement)("div",{className:"quant-content-browser__empty"},(0,t.createElement)("p",{className:"quant-status--error"},d)),!d&&0===o.length&&(0,t.createElement)("div",{className:"quant-content-browser__empty"},(0,t.createElement)("p",null,(0,xe.__)("No content found.","quant"))),o.length>0&&(0,t.createElement)("table",{className:"quant-content-browser__table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"quant-content-browser__col-checkbox"},(0,t.createElement)(Se.CheckboxControl,{label:(0,t.createElement)("span",{className:"screen-reader-text"},(0,xe.__)("Select all","quant")),checked:q,onChange:e=>{b(e),v(e?new Set(o.map(e=>e.id)):new Set)},__nextHasNoMarginBottom:!0})),(0,t.createElement)("th",{className:"quant-content-browser__col-title"},"redirects"===l?(0,xe.__)("Source","quant"):(0,xe.__)("Title","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-url"},"redirects"===l?(0,xe.__)("Destination","quant"):(0,xe.__)("URL","quant")),"redirects"===l&&(0,t.createElement)("th",{className:"quant-content-browser__col-code"},(0,xe.__)("Code","quant")),"theme_assets"===l&&(0,t.createElement)("th",{className:"quant-content-browser__col-type"},(0,xe.__)("Type","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-status"},(0,xe.__)("Status","quant")),!l&&(0,t.createElement)("th",{className:"quant-content-browser__col-synced"},(0,xe.__)("Last Synced","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-actions"},(0,xe.__)("Actions","quant")))),(0,t.createElement)("tbody",null,o.map(e=>{return(0,t.createElement)("tr",{key:e.id,className:f.has(e.id)?"is-selected":""},(0,t.createElement)("td",{className:"quant-content-browser__col-checkbox"},(0,t.createElement)(Se.CheckboxControl,{label:(0,t.createElement)("span",{className:"screen-reader-text"},(0,xe.sprintf)(/* translators: %s: item title or URL */ /* translators: %s: item title or URL */ -(0,xe.__)("Select %s","quant"),e.title||e.url)),checked:f.has(e.id),onChange:t=>((e,t)=>{const n=new Set(f);t?n.add(e):n.delete(e),v(n),b(n.size===o.length)})(e.id,t),__nextHasNoMarginBottom:!0})),(0,t.createElement)("td",{className:"quant-content-browser__col-title"},"redirects"===l?(0,t.createElement)("code",null,e.url):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,e.title||(0,xe.__)("(No title)","quant")),e.subtype&&(0,t.createElement)("span",{className:"quant-content-browser__subtype"},e.subtype))),(0,t.createElement)("td",{className:"quant-content-browser__col-url"},(0,t.createElement)("code",null,"redirects"===l?e.destination:e.url)),"redirects"===l&&(0,t.createElement)("td",{className:"quant-content-browser__col-code"},(0,t.createElement)("span",{className:`quant-redirect-code quant-redirect-code--${e.code}`},e.code)),"theme_assets"===l&&(0,t.createElement)("td",{className:"quant-content-browser__col-type"},(0,t.createElement)("span",{className:`quant-asset-type quant-asset-type--${e.file_type}`},e.file_type)),(0,t.createElement)("td",{className:"quant-content-browser__col-status"},(0,t.createElement)(Be,{status:e.sync_status})),!l&&(0,t.createElement)("td",{className:"quant-content-browser__col-synced"},e.last_synced_label||((n=e.last_synced)?new Date(n).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-")),(0,t.createElement)("td",{className:"quant-content-browser__col-actions"},(0,t.createElement)(Se.Button,{variant:"link",size:"small",href:P(e),target:"_blank",rel:"noopener noreferrer"},(0,xe.__)("View","quant"))));var n}))),(0,t.createElement)("div",{className:"quant-content-browser__footer"},(0,t.createElement)(De,{page:p,pages:h,onPageChange:T})))}const Ae=["fetch_error","invalid_json","internal_server_error"];function je({onComplete:e,onFinished:a,pollInterval:l=2e3,autoProcess:r=!1}){const[s,o]=(0,n.useState)(null),[i,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(0),[m,p]=(0,n.useState)(0),[_,h]=(0,n.useState)([]),[g,E]=(0,n.useState)("active"),[y,f]=(0,n.useState)(null),[v,q]=(0,n.useState)(0),[b,C]=(0,n.useState)(!1),x=(0,n.useRef)(!1),w=(0,n.useRef)(e),S=(0,n.useRef)(a);(0,n.useEffect)(()=>{w.current=e,S.current=a},[e,a]);const k=(0,n.useCallback)(e=>{E(e),S.current&&S.current()},[]);(0,n.useEffect)(()=>{let e=!1,t=null,n=!1,a=0;const s=async()=>{var i;if(!x.current)try{if(r){const t=await Ne()({path:"/quant/v1/queue/process",method:"POST",data:{limit:5}});if(e)return;d(e=>e+(t.processed||0)),p(e=>e+(t.failed||0)),t.errors&&t.errors.length&&h(e=>e.concat(t.errors).slice(-10))}const i=await Ne()({path:"/quant/v1/queue/status"});if(e||x.current)return;if(a=0,C(!1),o(i),n||(n=!0,c((i.pending||0)+(i.processing||0))),0===i.pending&&0===i.processing)return void k("done");t=setTimeout(s,l)}catch(n){if(e||x.current)return;if(a+=1,function(e,t){return t<=4&&function(e){if(!e||"object"!=typeof e)return!1;const t=Number(e.data?.status||e.status||0);return 429===t||t>=500||Ae.includes(e.code)}(e)}(n,a))return C(!0),void(t=setTimeout(s,(i=a,Math.min(15e3,2e3*2**Math.max(0,i-1)))));C(!1),f(n.message||(0,xe.__)("Failed to process the queue","quant")),k("error")}};return x.current=!1,E("active"),f(null),s(),()=>{e=!0,t&&clearTimeout(t)}},[r,l,v,k]);const N=s?s.pending+s.processing:0,T=i||0,P=Math.max(0,Math.min(T,T-N)),B="done"===g||0===T?100:Math.round(P/T*100);let D=g;"done"===g&&m>0?D="failed":"done"===g&&(D="complete");const R={active:(0,xe.__)("Syncing content…","quant"),complete:(0,xe.__)("Sync complete","quant"),failed:(0,xe.__)("Sync completed with errors","quant"),stopped:(0,xe.__)("Stopped. Pending items stay in the queue.","quant"),error:(0,xe.__)("Processing stopped","quant")};return(0,t.createElement)(Se.Card,{className:"quant-progress"},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-progress__content"},(0,t.createElement)("div",{className:"quant-progress__header"},(0,t.createElement)("h3",{className:"quant-progress__title"},R[D]),"active"===g&&b&&(0,t.createElement)("span",{className:"quant-progress__processing"},(0,xe.__)("The server did not answer. Trying again…","quant")),"active"===g&&!b&&s&&(0,t.createElement)("span",{className:"quant-progress__processing"},(0,xe.sprintf)(/* translators: %d: number of pending items */ /* translators: %d: number of pending items */ -(0,xe.__)("%d remaining","quant"),N))),(0,t.createElement)("div",{className:"quant-progress__bar-container",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":B},(0,t.createElement)("div",{className:`quant-progress__bar quant-progress__bar--${D}`,style:{width:`${B}%`}})),(0,t.createElement)("div",{className:"quant-progress__stats"},(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--completed"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ -(0,xe.__)("%d completed","quant"),r?u:P)),N>0&&(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--pending"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ -(0,xe.__)("%d pending","quant"),N)),m>0&&(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--failed"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ -(0,xe.__)("%d failed","quant"),m))),y&&(0,t.createElement)("p",{className:"quant-progress__error"},y),_.length>0&&"active"!==g&&(0,t.createElement)("ul",{className:"quant-progress__errors"},_.map((e,n)=>(0,t.createElement)("li",{key:n},e))),(0,t.createElement)("div",{className:"quant-progress__actions"},"active"===g&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>{x.current=!0,k("stopped")}},(0,xe.__)("Stop","quant")),"active"!==g&&m>0&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{try{await Ne()({path:"/quant/v1/queue/retry",method:"POST"}),o(null),c(null),d(0),p(0),h([]),q(e=>e+1)}catch(e){f(e.message||(0,xe.__)("Failed to retry","quant"))}}},(0,xe.__)("Retry Failed","quant")),"active"!==g&&(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>{w.current&&w.current()}},(0,xe.__)("Dismiss","quant"))))))}function Oe(){const[e,a]=(0,n.useState)({loading:!0,mode:"static",connected:!1}),[l,r]=(0,n.useState)([]),[s,o]=(0,n.useState)([]),[i,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(!1),[m,p]=(0,n.useState)(null),[_,h]=(0,n.useState)(null),[g,E]=(0,n.useState)(!1),[y,f]=(0,n.useState)(0);(0,n.useEffect)(()=>{Promise.all([Ne()({path:"/quant/v1/status"}),Ne()({path:"/quant/v1/content-types"})]).then(([e,t])=>{a({loading:!1,...e}),r(t)}).catch(e=>{p(e.message||(0,xe.__)("Failed to load the content overview.","quant")),a({loading:!1,mode:"static",connected:!1})})},[]);const v=e=>{c({status:"success",message:e}),E(!0),h(e=>e?e+1:1)},q=(0,n.useCallback)(()=>{E(!1),f(e=>e+1)},[]),b=(0,n.useCallback)(()=>{h(null),c(null)},[]),C=async(e,t)=>{if(!t||window.confirm(t)){d(!0),c(null);try{const t=await Ne()({path:"/quant/v1/seed",method:"POST",data:{types:e}});v((0,xe.sprintf)(/* translators: %d: number of queued items */ /* translators: %d: number of queued items */ -(0,xe.__)("Queued %d items. Processing…","quant"),t.queued))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to queue content","quant")})}finally{d(!1)}}},x=async e=>{if(0!==s.length){d(!0),c(null);try{const t=await Ne()({path:"/quant/v1/sync",method:"POST",data:{items:s,action:e}});o([]);const n="unpublish"===e?/* translators: %d: number of items */ /* translators: %d: number of items */(0,xe.__)("Queued %d items to unpublish. Processing…","quant"):/* translators: %d: number of items */ /* translators: %d: number of items */(0,xe.__)("Queued %d items. Processing…","quant");v((0,xe.sprintf)(n,t.queued))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to queue items","quant")})}finally{d(!1)}}},w=(0,n.useCallback)(e=>o(e),[]),S=(0,n.useMemo)(()=>{const e=[],t=e=>l.find(t=>t.type===e);for(const n of["post","page"]){const a=t(n);a&&e.push({name:n,title:`${a.label} (${a.count})`,contentType:a})}for(const t of l.filter(e=>"cpt"===e.type))e.push({name:`cpt_${t.subtype}`,title:`${t.label} (${t.count})`,contentType:t});const n=l.filter(e=>"taxonomy"===e.type);n.length>0&&e.push({name:"taxonomies",title:`${(0,xe.__)("Taxonomies","quant")} (${n.reduce((e,t)=>e+t.count,0)})`,contentTypes:n});const a=t("media");a&&e.push({name:"media",title:`${a.label} (${a.count})`,contentType:a});const r=t("theme_assets");r&&e.push({name:"theme_assets",title:`${r.label} (${r.count})`,contentType:r,specialType:"theme_assets"});const s=t("redirects");return s&&s.count>0&&e.push({name:"redirects",title:`${s.label} (${s.count})`,contentType:s,specialType:"redirects"}),e},[l]),k=l.filter(e=>"special"===e.category);return e.loading?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Spinner,null)):m?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},m)):"static"!==e.mode?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("Content publishing is available in Static Site mode. In CDN Only mode the plugin purges the Quant cache when content changes.","quant"))):(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),!e.connected&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Not connected to the Quant API. Check the settings before you push content.","quant")),i&&(0,t.createElement)(Se.Notice,{status:i.status,onRemove:()=>c(null),isDismissible:!0},i.message),_&&(0,t.createElement)(je,{key:_,autoProcess:!0,onFinished:q,onComplete:b}),(0,t.createElement)(Se.Card,{className:"quant-content__header-card"},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-content__actions"},(0,t.createElement)("div",{className:"quant-content__mode-indicator"},(0,t.createElement)("span",{className:"quant-content__mode-badge quant-content__mode-badge--static"},(0,xe.__)("Static Mode","quant")),(0,t.createElement)("span",{className:"quant-content__mode-description"},(0,xe.__)("Pages, files and redirects are published to the Quant edge.","quant"))),(0,t.createElement)("div",{className:"quant-content__batch-actions"},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>C(["all"],(0,xe.__)("Queue the whole site for publishing: posts, pages, custom post types, terms, media, home, archives, author pages, theme assets, custom routes, sitemaps and redirects. Continue?","quant")),disabled:u||g,isBusy:u},(0,xe.__)("Push everything","quant")),(0,t.createElement)(Se.DropdownMenu,{icon:"arrow-down-alt2",label:(0,xe.__)("Push one type","quant"),toggleProps:{variant:"secondary",children:(0,xe.__)("Push…","quant")}},()=>(0,t.createElement)(Se.MenuGroup,null,k.map(e=>(0,t.createElement)(Se.MenuItem,{key:e.type,onClick:()=>C([e.type])},`${e.label} (${e.count})`)),(0,t.createElement)(Se.MenuItem,{onClick:()=>C(["taxonomy"])},(0,xe.__)("All taxonomy terms","quant")),(0,t.createElement)(Se.MenuItem,{onClick:()=>C(["media"])},(0,xe.__)("All media","quant")))),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>x("sync"),disabled:u||0===s.length||g},(0,xe.__)("Push selected","quant"),s.length>0&&` (${s.length})`),(0,t.createElement)(Se.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>x("unpublish"),disabled:u||0===s.length||g},(0,xe.__)("Unpublish selected","quant")),(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:async()=>{try{const e=await Ne()({path:"/quant/v1/queue/status"});if(0===e.pending&&0===e.processing)return void c({status:"info",message:(0,xe.__)('The queue is empty. Use "Push everything" or select items to push.',"quant")});v((0,xe.sprintf)(/* translators: %d: number of pending items */ /* translators: %d: number of pending items */ -(0,xe.__)("Processing %d pending items…","quant"),e.pending))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to read the queue","quant")})}},disabled:g,isBusy:g},g?(0,xe.__)("Processing…","quant"):(0,xe.__)("Process queue","quant")))))),S.length>0&&(0,t.createElement)(Se.Card,{className:"quant-content__browser-card"},(0,t.createElement)(Se.TabPanel,{tabs:S,onSelect:()=>o([])},e=>(0,t.createElement)(Re,{contentType:e.contentType,contentTypes:e.contentTypes,specialType:e.specialType,onSelectionChange:w,refreshToken:y,key:e.name}))))}function Fe(){const[e,a]=(0,n.useState)(""),[l,r]=(0,n.useState)(!1),[s,o]=(0,n.useState)(null);return(0,t.createElement)("div",{className:"quant-cache"},(0,t.createElement)("h1",null,(0,xe.__)("Cache Management","quant")),s&&(0,t.createElement)(Se.Notice,{status:s.status,onRemove:()=>o(null),isDismissible:!0},s.message),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Purge Cache","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Enter paths to purge from the CDN cache. One path per line.","quant")),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Paths to purge","quant"),value:e,onChange:a,placeholder:"/blog/my-post\n/about\n/contact",rows:8,help:(0,xe.__)("Use /* to purge all paths under a directory","quant")}),(0,t.createElement)("div",{style:{display:"flex",gap:"12px",marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{if(e.trim()){r(!0),o(null);try{const t=e.split("\n").filter(e=>e.trim());await Ne()({path:"/quant/v1/purge",method:"POST",data:{paths:t}}),o({status:"success",message:(0,xe.__)("Cache purged successfully","quant")}),a("")}catch(e){o({status:"error",message:e.message||(0,xe.__)("Failed to purge cache","quant")})}finally{r(!1)}}},disabled:l||!e.trim(),isBusy:l},(0,xe.__)("Purge Selected Paths","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:async()=>{if(window.confirm((0,xe.__)("Purge entire cache? This cannot be undone.","quant"))){r(!0),o(null);try{await Ne()({path:"/quant/v1/purge",method:"POST",data:{paths:["/*"]}}),o({status:"success",message:(0,xe.__)("Entire cache purged","quant")})}catch(e){o({status:"error",message:e.message||(0,xe.__)("Failed to purge cache","quant")})}finally{r(!1)}}},disabled:l},(0,xe.__)("Purge All Cache","quant"))))))}const Me={facet_type:"taxonomy",taxonomy:"category",custom_key:"",facet_display:"checkbox",facet_heading:"",facet_limit:10},$e={id:"",label:"",status:!0,route:"/search",title:"Search",description:"",post_types:[],languages:[],manual_filters:"",display:{display_search:!0,display_stats:!0,show_clear_refinements:!0,pagination_enabled:!0,per_page:10},facets:[]};function ze({facet:e,taxonomies:n,onChange:a,onRemove:l}){return(0,t.createElement)("div",{className:"quant-facet-row"},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Type","quant"),value:e.facet_type,options:[{label:(0,xe.__)("Taxonomy","quant"),value:"taxonomy"},{label:(0,xe.__)("Content type","quant"),value:"content_type"},{label:(0,xe.__)("Language","quant"),value:"language"},{label:(0,xe.__)("Custom attribute","quant"),value:"custom"}],onChange:t=>a({...e,facet_type:t}),__nextHasNoMarginBottom:!0}),"taxonomy"===e.facet_type&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Taxonomy","quant"),value:e.taxonomy,options:n.map(e=>({label:e.label,value:e.name})),onChange:t=>a({...e,taxonomy:t}),__nextHasNoMarginBottom:!0}),"custom"===e.facet_type&&(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Attribute key","quant"),value:e.custom_key,onChange:t=>a({...e,custom_key:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Heading","quant"),value:e.facet_heading,onChange:t=>a({...e,facet_heading:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Display","quant"),value:e.facet_display,options:[{label:(0,xe.__)("Checkboxes","quant"),value:"checkbox"},{label:(0,xe.__)("Menu","quant"),value:"menu"},{label:(0,xe.__)("Select","quant"),value:"select"}],onChange:t=>a({...e,facet_display:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Limit","quant"),type:"number",value:e.facet_limit,onChange:t=>a({...e,facet_limit:parseInt(t,10)||10}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.Button,{variant:"link",isDestructive:!0,onClick:l},(0,xe.__)("Remove","quant")))}function Ie({page:e,postTypes:a,taxonomies:l,onSave:r,onCancel:s,saving:o}){const[i,c]=(0,n.useState)({...$e,...e||{},display:{...$e.display,...e?.display||{}}}),u=(e,t)=>c(n=>({...n,[e]:t})),d=(e,t)=>c(n=>({...n,display:{...n.display,[e]:t}}));return(0,t.createElement)("div",{className:"quant-search-page-editor"},(0,t.createElement)("h3",{style:{marginTop:0}},e?.id?(0,xe.__)("Edit search page","quant"):(0,xe.__)("New search page","quant")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Label","quant"),value:i.label,onChange:e=>u("label",e),help:(0,xe.__)("Shown in the admin only.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Enabled","quant"),checked:!!i.status,onChange:e=>u("status",e),help:(0,xe.__)("A disabled page is kept as a draft and removed from Quant.","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Route","quant"),value:i.route,onChange:e=>u("route",e),placeholder:"/search",help:(0,xe.__)("The plugin creates a WordPress page at this path that renders the search.","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Page title","quant"),value:i.title,onChange:e=>u("title",e)}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Description","quant"),value:i.description,onChange:e=>u("description",e),rows:2}),(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,xe.__)("Content types to search","quant"))," ",(0,t.createElement)("span",{style:{color:"#666"}},(0,xe.__)("(none selected = all indexed types)","quant"))),a.map(e=>(0,t.createElement)(Se.CheckboxControl,{key:e.name,label:e.label,checked:i.post_types.includes(e.name),onChange:t=>((e,t)=>u("post_types",t?[...i.post_types,e]:i.post_types.filter(t=>t!==e)))(e.name,t)})),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Manual filters","quant"),value:i.manual_filters,onChange:e=>u("manual_filters",e),placeholder:"category_en:'News'",help:(0,xe.__)("Appended to the page filters as written. Use the project's search syntax: Algolia on QuantCDN (category_en:'News'), Typesense on QuantGov (category_en:=`News`).","quant")}),(0,t.createElement)("h4",null,(0,xe.__)("Display","quant")),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Show the search box","quant"),checked:!!i.display.display_search,onChange:e=>d("display_search",e)}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Show the result count","quant"),checked:!!i.display.display_stats,onChange:e=>d("display_stats",e)}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)('Show "Clear refinements"',"quant"),checked:!!i.display.show_clear_refinements,onChange:e=>d("show_clear_refinements",e)}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Pagination","quant"),checked:!!i.display.pagination_enabled,onChange:e=>d("pagination_enabled",e)}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Results per page","quant"),type:"number",value:i.display.per_page,onChange:e=>d("per_page",parseInt(e,10)||10)}),(0,t.createElement)("h4",null,(0,xe.__)("Facets","quant")),i.facets.map((e,n)=>(0,t.createElement)(ze,{key:n,facet:e,taxonomies:l,onChange:e=>((e,t)=>c(n=>({...n,facets:n.facets.map((n,a)=>a===e?t:n)})))(n,e),onRemove:()=>(e=>c(t=>({...t,facets:t.facets.filter((t,n)=>n!==e)})))(n)})),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>u("facets",[...i.facets,{...Me}])},(0,xe.__)("Add facet","quant")),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"24px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>r(i),disabled:o||!i.label.trim(),isBusy:o},(0,xe.__)("Save search page","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:s,disabled:o},(0,xe.__)("Cancel","quant")))))}const Qe=[0,3e3,7e3,2e4];function Le({status:e,onRefresh:n}){var a,l;return e?(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Quant Search","quant")),(0,t.createElement)(Se.Button,{variant:"tertiary",size:"small",onClick:n},(0,xe.__)("Refresh","quant"))),(0,t.createElement)(Se.CardBody,null,!e.configured&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Configure the project credentials first.","quant")),e.configured&&!e.connected&&(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ -(0,xe.__)("Cannot reach the Quant API: %s","quant"),e.error||"")),e.connected&&!e.enabled&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Search is not enabled for this project. Enable it in the Quant dashboard under the project settings.","quant")),e.enabled&&(0,t.createElement)("table",{className:"widefat quant-kv-table"},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Index","quant")),(0,t.createElement)("td",null,e.index?.algolia_index||e.stats?.name||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Search engine","quant")),(0,t.createElement)("td",null,"typesense"===e.backend?"Typesense":"Algolia")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Records","quant")),(0,t.createElement)("td",null,null!==(a=e.stats?.entries)&&void 0!==a?a:"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Pending tasks","quant")),(0,t.createElement)("td",null,null!==(l=e.stats?.numberOfPendingTasks)&&void 0!==l?l:"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Last updated","quant")),(0,t.createElement)("td",null,e.stats?.updatedAt||"-")))))):(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)(Se.Spinner,null)))}function Ue({pages:e,onEdit:n,onDelete:a}){return 0===e.length?(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.__)('No search pages yet. A search page is a WordPress page that shows Quant Search results with facets. You can also place the "Quant Search" block or the [quant_search] shortcode on any page.',"quant")):(0,t.createElement)("table",{className:"widefat striped"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Label","quant")),(0,t.createElement)("th",null,(0,xe.__)("Route","quant")),(0,t.createElement)("th",null,(0,xe.__)("Status","quant")),(0,t.createElement)("th",null,(0,xe.__)("Facets","quant")),(0,t.createElement)("th",null))),(0,t.createElement)("tbody",null,e.map(e=>(0,t.createElement)("tr",{key:e.id},(0,t.createElement)("td",null,(0,t.createElement)("strong",null,e.label),(0,t.createElement)("br",null),(0,t.createElement)("code",null,`[quant_search page="${e.id}"]`)),(0,t.createElement)("td",null,e.url?(0,t.createElement)("a",{href:e.url,target:"_blank",rel:"noreferrer"},e.route):e.route),(0,t.createElement)("td",null,e.status?(0,xe.__)("Enabled","quant"):(0,xe.__)("Disabled","quant")),(0,t.createElement)("td",null,e.facets.length),(0,t.createElement)("td",{style:{textAlign:"right"}},(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>n(e)},(0,xe.__)("Edit","quant"))," ",(0,t.createElement)(Se.Button,{variant:"link",isDestructive:!0,onClick:()=>a(e)},(0,xe.__)("Delete","quant")))))))}function He(){const[e,a]=(0,n.useState)(null),[l,r]=(0,n.useState)(null),[s,o]=(0,n.useState)([]),[i,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[_,h]=(0,n.useState)(!1),[g,E]=(0,n.useState)(0),[y,f]=(0,n.useState)(!1),v=(e,t)=>d({status:e,message:t}),q=(e,t)=>e?.push_needed?v("warning",(0,xe.sprintf)(/* translators: %s: what was saved, for example "Search settings saved." */ /* translators: %s: what was saved, for example "Search settings saved." */ -(0,xe.__)("%s The search form is part of every page, so pages on the edge keep the old form until you push them again. On the Content page, select Push everything.","quant"),t)):v("success",t),b=(0,n.useCallback)(()=>E(0),[]),C=(0,n.useRef)(!0),x=(0,n.useRef)(null);(0,n.useEffect)(()=>(C.current=!0,()=>{C.current=!1,clearTimeout(x.current)}),[]);const w=(0,n.useCallback)(()=>Ne()({path:"/quant/v1/search/status"}).catch(()=>({configured:!1})).then(e=>(C.current&&a(e),e)),[]),S=(0,n.useRef)(null),k=(0,n.useCallback)(()=>{clearTimeout(x.current);const e=(t,n)=>{w().then(a=>{const l=t+1;C.current&&l0||null===e||a.entries===e||null!==t&&a.entries!==t}(S.current,n,a)&&(x.current=setTimeout(()=>{var t;return e(l,null!==(t=a?.stats?.entries)&&void 0!==t?t:null)},Qe[l]))})};e(0,S.current)},[w]);(0,n.useEffect)(()=>{w(),Ne()({path:"/quant/v1/search/settings"}).then(e=>{r(e),f(!!e?.settings?.enabled)}).catch(e=>v("error",e.message)),Ne()({path:"/quant/v1/search/pages"}).then(o).catch(()=>o([]))},[w]);const N=l?.settings,T=(e,t)=>r(n=>({...n,settings:{...n.settings,[e]:t}}));return(0,t.createElement)("div",{className:"quant-search-admin"},(0,t.createElement)("h1",null,(0,xe.__)("Search","quant")),u&&(0,t.createElement)(Se.Notice,{status:u.status,onRemove:()=>d(null),isDismissible:!0},u.message),g>0&&(0,t.createElement)(je,{key:g,autoProcess:!0,onFinished:k,onComplete:b}),(0,t.createElement)(Le,{status:e,onRefresh:w}),N&&(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Search Records","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Keep search records updated","quant"),checked:!!N.enabled,onChange:e=>T("enabled",e),help:(0,xe.__)("Send a search record with every page push so the index follows your content.","quant")}),(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,xe.__)("Indexed content types","quant"))),l.post_types.map(e=>(0,t.createElement)(Se.CheckboxControl,{key:e.name,label:e.label,checked:N.post_types.includes(e.name),onChange:t=>((e,t)=>T("post_types",t?[...N.post_types,e]:N.post_types.filter(t=>t!==e)))(e.name,t)})),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Summary source","quant"),value:N.summary_source,options:[{label:(0,xe.__)("Excerpt, or the first words of the content","quant"),value:"excerpt"},{label:(0,xe.__)("First words of the content","quant"),value:"content"}],onChange:e=>T("summary_source",e)}),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Image size","quant"),value:N.image_size,options:(l.image_sizes||[]).map(e=>({label:e,value:e})),onChange:e=>T("image_size",e),help:(0,xe.__)("Featured image size stored in the record.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Send the WordPress search form to a Quant Search page","quant"),checked:!!N.replace_wp_search,onChange:e=>T("replace_wp_search",e),help:(0,xe.__)("The theme search form and ?s= searches use the default search page below, so search works on the static site.","quant")}),N.replace_wp_search&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Default search page","quant"),value:N.default_page,options:[{label:(0,xe.__)("First enabled page","quant"),value:""}].concat(s.map(e=>({label:e.label,value:e.id}))),onChange:e=>T("default_page",e)}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{p(!0);try{const e=await Ne()({path:"/quant/v1/search/settings",method:"POST",data:N});r(t=>({...t,settings:e.settings})),f(!!e.settings?.enabled),q(e,(0,xe.__)("Search settings saved.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Failed to save","quant"))}finally{p(!1)}},disabled:m,isBusy:m},(0,xe.__)("Save","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{var t;h(!0),S.current=null!==(t=e?.stats?.entries)&&void 0!==t?t:null;try{const e=await Ne()({path:"/quant/v1/search/reindex",method:"POST"});v("success",(0,xe.sprintf)(/* translators: %d: number of records */ /* translators: %d: number of records */ -(0,xe.__)("Queued %d records. Processing…","quant"),e.queued)),E(e=>e+1)}catch(e){v("error",e.message||(0,xe.__)("Reindex failed","quant"))}finally{h(!1)}},disabled:_||!y||!e?.enabled},(0,xe.__)("Rebuild index","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:async()=>{const e=(0,xe.__)("Remove every record from the search index?","quant");if(window.confirm(e)){h(!0);try{await Ne()({path:"/quant/v1/search/clear",method:"POST"}),v("success",(0,xe.__)("Search index cleared.","quant")),w()}catch(e){v("error",e.message||(0,xe.__)("Clear failed","quant"))}finally{h(!1)}}},disabled:_||!e?.enabled},(0,xe.__)("Clear index","quant")))))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Search Pages","quant")),!i&&(0,t.createElement)(Se.Button,{variant:"primary",size:"small",onClick:()=>c({})},(0,xe.__)("Add search page","quant"))),(0,t.createElement)(Se.CardBody,null,i?(0,t.createElement)(Ie,{page:i.id?i:null,postTypes:l?.post_types||[],taxonomies:l?.taxonomies||[],onSave:async e=>{p(!0);try{const t=await Ne()({path:"/quant/v1/search/pages",method:"POST",data:e});o(e=>[...e.filter(e=>e.id!==t.id),t]),c(null),q(t,(0,xe.__)("Search page saved. Its WordPress page was queued for publishing.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Failed to save the search page","quant"))}finally{p(!1)}},onCancel:()=>c(null),saving:m}):(0,t.createElement)(Ue,{pages:s,onEdit:c,onDelete:async e=>{const t=(0,xe.sprintf)(/* translators: %s: search page label */ /* translators: %s: search page label */ -(0,xe.__)('Delete the search page "%s"? Its WordPress page is moved to the trash.',"quant"),e.label);if(window.confirm(t))try{const t=await Ne()({path:`/quant/v1/search/pages/${e.id}`,method:"DELETE"});o(t=>t.filter(t=>t.id!==e.id)),q(t,(0,xe.__)("Search page deleted.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Delete failed","quant"))}}}))))}const We=[["home",(0,xe.__)("Home page","quant")],["post",(0,xe.__)("Posts","quant")],["page",(0,xe.__)("Pages","quant")],["taxonomy",(0,xe.__)("Categories and tags","quant")],["archives",(0,xe.__)("Archives","quant")],["authors",(0,xe.__)("Author pages","quant")],["sitemaps",(0,xe.__)("Sitemaps","quant")]],Ye=e=>Array.isArray(e)?e.join("\n"):e||"",Ve=e=>e.split("\n").map(e=>e.trim()).filter(Boolean);function Ge({title:e,children:n,description:a}){return(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},e)),(0,t.createElement)(Se.CardBody,null,a&&(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},a),n))}const Je=(0,xe.__)("Set by a QUANT_* environment variable or constant. Change it there.","quant");function Ke({oauthStatus:e,setOauthStatus:a,onProjectSelected:l,notify:r,showManual:s,manualConfigured:o,setShowManual:i}){const[c,u]=(0,n.useState)([]),[d,m]=(0,n.useState)(!1),[p,_]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),[E,y]=(0,n.useState)(""),[f,v]=(0,n.useState)(""),[q,b]=(0,n.useState)(!1),[C,x]=(0,n.useState)(!1),w=(0,n.useCallback)(async()=>{m(!0),g(null);try{const e=await Ne()({path:"/quant/v1/oauth/projects"});u(Array.isArray(e)?e:[])}catch(e){u([]),g(e.message||(0,xe.__)("Failed to load projects","quant"))}finally{m(!1),_(!0)}},[]);(0,n.useEffect)(()=>{e?.connected&&!e.has_project&&w()},[e,w]);const S=async()=>{try{const e=await Ne()({path:"/quant/v1/oauth/connect"});e.redirect_url&&(window.location.href=e.redirect_url)}catch(e){r("error",e.message||(0,xe.__)("Failed to start the login","quant"))}},k=async()=>{try{await Ne()({path:"/quant/v1/oauth/disconnect",method:"POST"}),a({connected:!1}),u([]),l(),r("success",(0,xe.__)("Disconnected from Quant","quant"))}catch(e){r("error",e.message||(0,xe.__)("Failed to disconnect","quant"))}},N=[{label:(0,xe.__)("Select an organization…","quant"),value:""}].concat(c.map(e=>({label:e.organization.name,value:e.organization.machine_name||e.organization.name}))),T=c.find(e=>(e.organization.machine_name||e.organization.name)===E),P=[{label:(0,xe.__)("Select a project…","quant"),value:""}].concat((T?.projects||[]).map(e=>({label:e.name||e.machine_name,value:e.machine_name||e.name})));if(!e?.connected)return(0,t.createElement)(Ge,{title:(0,xe.__)("Connect to Quant","quant"),description:(0,xe.__)("Sign in to Quant and pick the project this site publishes to. You can also enter the project credentials by hand.","quant")},(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:4},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:S,icon:"admin-users"},(0,xe.__)("Login to Quant","quant"))),!o&&(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>i(!s)},s?(0,xe.__)("Hide manual credentials","quant"):(0,xe.__)("Use manual credentials instead","quant")))));const B=function({loading:e,loaded:t,error:n,count:a}){return e||!t?"loading":n||0===a?"empty":"list"}({loading:d,loaded:p,error:h,count:c.length});return e.has_project&&!C?(0,t.createElement)(Ge,{title:(0,xe.__)("Connect to Quant","quant")},(0,t.createElement)("p",{className:"quant-connected-badge"},(0,t.createElement)(Se.Icon,{icon:"yes-alt"})," ",(0,xe.__)("Connected","quant"),e.user?.email&&(0,t.createElement)("span",{style:{color:"#666",marginLeft:"8px"}},e.user.email)),(0,t.createElement)("p",{style:{margin:"8px 0"}},(0,t.createElement)("strong",null,(0,xe.__)("Organization:","quant"))," ",e.organization),(0,t.createElement)("p",{style:{margin:"8px 0"}},(0,t.createElement)("strong",null,(0,xe.__)("Project:","quant"))," ",e.project),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>{e.project_limited?(async()=>{try{await Ne()({path:"/quant/v1/oauth/disconnect",method:"POST"})}catch(e){}await S()})():(x(!0),w())}},(0,xe.__)("Change Project","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:k},(0,xe.__)("Disconnect","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>i(!s)},s?(0,xe.__)("Hide manual credentials","quant"):(0,xe.__)("Show manual credentials","quant"))))):"empty"===B?(0,t.createElement)(Ge,{title:(0,xe.__)("Connect to Quant","quant")},(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},h||(0,xe.__)("No organizations or projects are available to this Quant account. Check the account in the Quant dashboard, or log in again.","quant")),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:S},(0,xe.__)("Reconnect","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:w},(0,xe.__)("Try again","quant"))),(0,t.createElement)(Se.FlexItem,null,C?(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:()=>x(!1)},(0,xe.__)("Cancel","quant")):(0,t.createElement)(Se.Button,{variant:"tertiary",isDestructive:!0,onClick:k},(0,xe.__)("Disconnect","quant"))))):(0,t.createElement)(Ge,{title:(0,xe.__)("Connect to Quant","quant"),description:C?(0,xe.__)("Select a different project for this site.","quant"):(0,xe.__)("Connected. Select the project to use with this site.","quant")},"loading"===B?(0,t.createElement)(Se.Spinner,null):(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Organization","quant"),value:E,options:N,onChange:e=>{y(e),v("")}}),E&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Project","quant"),value:f,options:P,onChange:v}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{b(!0);try{await Ne()({path:"/quant/v1/oauth/select-project",method:"POST",data:{organization:E,project:f}}),a(await Ne()({path:"/quant/v1/oauth/status"})),x(!1),l(),r("success",(0,xe.__)("Project selected.","quant"))}catch(e){r("error",e.message||(0,xe.__)("Failed to select the project","quant"))}finally{b(!1)}},disabled:!E||!f||q,isBusy:q},C?(0,xe.__)("Switch to This Project","quant"):(0,xe.__)("Use This Project","quant"))),(0,t.createElement)(Se.FlexItem,null,C?(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>x(!1)},(0,xe.__)("Cancel","quant")):(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:k},(0,xe.__)("Disconnect","quant"))))))}function Xe(){const[e,a]=(0,n.useState)(null),[l,r]=(0,n.useState)(""),[s,o]=(0,n.useState)(""),[i,c]=(0,n.useState)(""),[u,d]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[_,h]=(0,n.useState)(!1),[g,E]=(0,n.useState)(!1),[y,f]=(0,n.useState)(!1),[v,q]=(0,n.useState)(null),[b,C]=(0,n.useState)(null),x=(0,n.useCallback)((e,t)=>C({status:e,message:t}),[]),w=(0,n.useCallback)(async()=>{const[e,t]=await Promise.all([Ne()({path:"/quant/v1/settings"}),Ne()({path:"/quant/v1/oauth/status"})]);a(e),d(t),r(Ye(e.custom_routes)),o(Ye(e.domain_rewrites)),c(Ye(e.schedule?.custom_routes))},[]);(0,n.useEffect)(()=>{"success"===new URLSearchParams(window.location.search).get("oauth")&&(x("success",(0,xe.__)("Connected to Quant. Now select a project below.","quant")),window.history.replaceState({},"",window.location.pathname+"?page=quant#/settings")),w().catch(e=>x("error",e.message||(0,xe.__)("Failed to load settings","quant")))},[w,x]);const S=(e,t)=>a(n=>({...n,[e]:t})),k=(e,t)=>a(n=>({...n,schedule:{...n.schedule,[e]:t}})),N=async()=>{h(!0),C(null);try{const t={...e,custom_routes:Ve(l),domain_rewrites:Ve(s),schedule:{...e.schedule,custom_routes:Ve(i)}};delete t.overridden,delete t.schedules,delete t.has_token,t.token||delete t.token;const n=await Ne()({path:"/quant/v1/settings",method:"POST",data:t});a({...n,token:""}),x("success",(0,xe.__)("Settings saved.","quant"))}catch(e){x("error",e.message||(0,xe.__)("Failed to save settings","quant"))}finally{h(!1)}};if(!e)return(0,t.createElement)("div",{className:"quant-settings"},(0,t.createElement)("h1",null,(0,xe.__)("Settings","quant")),(0,t.createElement)(Se.Spinner,null));const T=e.overridden||{},P=!!(e.organization&&e.project&&e.has_token),B=(e,t)=>!(!T[e]||!T[e].includes(t)),D=(e,t,n)=>B(e,t)?Je:n,R=Object.entries(e.schedules||{}).map(([e,t])=>({value:e,label:t}));return(0,t.createElement)("div",{className:"quant-settings"},(0,t.createElement)("h1",null,(0,xe.__)("Settings","quant")),b&&(0,t.createElement)(Se.Notice,{status:b.status,onRemove:()=>C(null),isDismissible:!0},b.message),(0,t.createElement)(Ke,{oauthStatus:u,setOauthStatus:d,onProjectSelected:()=>w().catch(()=>{}),notify:x,showManual:m,manualConfigured:P,setShowManual:p}),(m||!u?.connected&&P)&&(0,t.createElement)(Ge,{title:(0,xe.__)("Project Credentials","quant"),description:(0,xe.__)("Copy these from the Integrations page of the Quant dashboard.","quant")},(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Endpoint","quant"),value:e.endpoint,onChange:e=>S("endpoint",e),disabled:B("credentials","endpoint"),help:D("credentials","endpoint",(0,xe.__)("https://api.quantcdn.io for QuantCDN, https://api.quantgov.cloud for QuantGov. Without /v1.","quant"))}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Organization (API Customer)","quant"),value:e.organization,onChange:e=>S("organization",e),disabled:B("credentials","organization"),help:D("credentials","organization")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Project","quant"),value:e.project,onChange:e=>S("project",e),disabled:B("credentials","project"),help:D("credentials","project")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Token","quant"),type:"password",value:e.token,onChange:e=>S("token",e),disabled:B("credentials","token"),placeholder:e.has_token?(0,xe.__)("Token saved. Enter a new one to replace it.","quant"):(0,xe.__)("Project token","quant"),help:D("credentials","token")}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:N,disabled:_,isBusy:_},(0,xe.__)("Save Credentials","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{E(!0);try{const e=await Ne()({path:"/quant/v1/status"});x(e.connected?"success":"error",e.connected?(0,xe.__)("Connected to the Quant API.","quant"):(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ -(0,xe.__)("Connection failed: %s","quant"),e.error||(0,xe.__)("check your credentials","quant")))}catch(e){x("error",e.message||(0,xe.__)("Connection test failed","quant"))}finally{E(!1)}},disabled:g,isBusy:g},(0,xe.__)("Test Connection","quant"))))),(0,t.createElement)(Ge,{title:(0,xe.__)("API Connection","quant"),description:(0,xe.__)("Applies to every request the plugin makes, in both modes.","quant")},(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("HTTP request timeout (seconds)","quant"),type:"number",value:e.http_request_timeout,onChange:e=>S("http_request_timeout",parseInt(e,10)||30),disabled:B("credentials","http_request_timeout")})),(0,t.createElement)(Ge,{title:(0,xe.__)("Mode","quant")},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Plugin mode","quant"),value:e.mode,disabled:B("mode","mode"),options:[{label:(0,xe.__)("Static Site: publish the whole site to the Quant edge","quant"),value:"static"},{label:(0,xe.__)("CDN Only: WordPress serves pages, Quant caches and purges them","quant"),value:"cdn_only"}],onChange:e=>S("mode",e)}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Automatic static push","quant"),checked:!!e.auto_sync,onChange:e=>S("auto_sync",e),disabled:"static"!==e.mode||B("sync","auto_sync"),help:(0,xe.__)("Push pages, terms and media to Quant when they change (Static mode).","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Also push related pages","quant"),checked:!1!==e.sync_related,onChange:e=>S("sync_related",e),disabled:"static"!==e.mode||!e.auto_sync,help:(0,xe.__)("When a post changes, also push the home page, its categories, tags, author and archive pages.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Cache purge on save","quant"),checked:!!e.auto_purge,onChange:e=>S("auto_purge",e),disabled:B("sync","auto_purge"),help:(0,xe.__)("Purge the edge cache when content changes. Used in CDN Only mode, or in Static mode when automatic push is off.","quant")})),"static"===e.mode&&(0,t.createElement)(Ge,{title:(0,xe.__)("Static Site Rendering","quant"),description:(0,xe.__)("How the plugin fetches pages from this server before it pushes them.","quant")},(0,t.createElement)("div",{className:"quant-inline-test"},(0,t.createElement)("strong",null,(0,xe.__)("Internal connectivity","quant")),null===v?(0,t.createElement)("span",{style:{color:"#757575"}},(0,xe.__)("Not tested","quant")):(0,t.createElement)("span",{style:{color:v.success?"#00a32a":"#d63638"}},v.success?"✓ "+(0,xe.__)("Working","quant"):"✗ "+v.message),(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",onClick:async()=>{f(!0),q(null);try{q(await Ne()({path:"/quant/v1/test-internal",method:"POST"}))}catch(e){q({success:!1,message:e.message||(0,xe.__)("Test failed","quant")})}finally{f(!1)}},disabled:y,isBusy:y},(0,xe.__)("Test","quant")),v?.adjusted_url&&(0,t.createElement)("div",{className:"quant-inline-test__detail"},v.adjusted_url,v.host_header?` (Host: ${v.host_header})`:"")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Webserver URL","quant"),value:e.webserver_url,onChange:e=>S("webserver_url",e),placeholder:"http://localhost",disabled:B("static","webserver_url"),help:D("static","webserver_url",(0,xe.__)("Where the plugin can reach this site from the server, for example http://localhost. Leave empty to use the site URL.","quant"))}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Hostname (Host header)","quant"),value:e.webserver_host,onChange:e=>S("webserver_host",e),placeholder:"www.example.com",disabled:B("static","webserver_host"),help:D("static","webserver_host",(0,xe.__)("The public hostname WordPress expects, so rendered links use the public domain.","quant"))}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Disable SSL verification for the local webserver","quant"),checked:!!e.disable_tls_verify,onChange:e=>S("disable_tls_verify",e),disabled:B("credentials","disable_tls_verify"),help:D("credentials","disable_tls_verify",(0,xe.__)("Only for a local webserver with a self-signed certificate. Calls to the Quant API always verify TLS.","quant"))}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Strip host domain from content","quant"),checked:!!e.strip_host,onChange:e=>S("strip_host",e),help:(0,xe.__)("Rewrite absolute links to this site as relative links, and upgrade http:// links to https://.","quant")}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Additional domains to make relative","quant"),value:s,onChange:o,rows:3,placeholder:"cdn.example.com",help:(0,xe.__)("One per line. Useful for staging or editorial domains.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Follow pagination links","quant"),checked:!!e.follow_links,onChange:e=>S("follow_links",e),help:(0,xe.__)("Queue the next pages of listings found in rendered markup.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Override existing proxies","quant"),checked:!!e.proxy_override,onChange:e=>S("proxy_override",e),help:(0,xe.__)("Tell Quant that pushed pages replace proxy rules at the same path.","quant")})),"static"===e.mode&&(0,t.createElement)(Ge,{title:(0,xe.__)("Seed Content","quant"),description:(0,xe.__)("What a full push includes besides posts, pages, terms and media.","quant")},(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Theme assets","quant"),checked:!!e.theme_assets,onChange:e=>S("theme_assets",e),help:(0,xe.__)("CSS, JavaScript, images and fonts of the active theme and its parent.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Sitemaps","quant"),checked:!!e.sitemap,onChange:e=>S("sitemap",e),help:(0,xe.__)("WordPress core sitemaps, Yoast SEO and Rank Math sitemaps with their stylesheets.","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("404 page path","quant"),value:e.route_404,onChange:e=>S("route_404",e),placeholder:"/404",help:(0,xe.__)("A path that returns your 404 page. It is published as the Quant 404 page.","quant")}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Custom routes","quant"),value:l,onChange:r,rows:4,placeholder:"/robots.txt\n/custom-page",help:(0,xe.__)("One per line. Content routes are rendered; paths that match a file on disk are uploaded.","quant")})),"static"===e.mode&&(0,t.createElement)(Ge,{title:(0,xe.__)("Scheduled Push","quant"),description:(0,xe.__)("Re-push chosen content on a schedule, for example for listings that change without a save.","quant")},(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Enable scheduled push","quant"),checked:!!e.schedule?.enabled,onChange:e=>k("enabled",e)}),e.schedule?.enabled&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Schedule","quant"),value:e.schedule.interval,options:R,onChange:e=>k("interval",e)}),We.map(([n,a])=>(0,t.createElement)(Se.CheckboxControl,{key:n,label:a,checked:(e.schedule.types||[]).includes(n),onChange:t=>k("types",t?[...e.schedule.types||[],n]:(e.schedule.types||[]).filter(e=>e!==n))})),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Custom routes","quant"),value:i,onChange:c,rows:3,placeholder:"/robots.txt"}))),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:N,disabled:_,isBusy:_},(0,xe.__)("Save Settings","quant"))))}function Ze(){const e=G(),[a,l]=(0,n.useState)(null),[r,s]=(0,n.useState)(!0),[o,i]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),[p,_]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),[E,y]=(0,n.useState)(null),[f,v]=(0,n.useState)("detect");(0,n.useEffect)(()=>{q()},[]);const q=async()=>{s(!0),y(null);try{const e=await Ne()({path:"/quant/v1/migration/status"});l(e),e.migration_complete?v("complete"):e.needs_migration?v("preview"):e.has_v1_settings||v("no-migration")}catch(e){y(e.message||(0,xe.__)("Failed to check migration status","quant"))}finally{s(!1)}},b=async()=>{m(!0),u(null);try{await Ne()({path:"/quant/v1/migration/cleanup",method:"POST"}),u({status:"success",message:(0,xe.__)("The 1.x settings were removed.","quant")});const e=await Ne()({path:"/quant/v1/migration/status"});l(e)}catch(e){u({status:"error",message:e.message||(0,xe.__)("The 1.x settings could not be removed.","quant")})}finally{m(!1)}};return r?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration","quant")),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("span",null,(0,xe.__)("Checking for v1 settings…","quant")))))):"no-migration"===f?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration","quant")),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("No v1 settings found. Nothing to migrate.","quant")),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/settings")},(0,xe.__)("Go to Settings","quant")))):"complete"===f?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration Complete","quant")),c&&(0,t.createElement)(Se.Notice,{status:c.status,onRemove:()=>u(null),isDismissible:!0},c.message),(0,t.createElement)(Se.Notice,{status:"success",isDismissible:!1},(0,xe.__)("Your settings have been successfully migrated to v2!","quant")),h&&h.migrated&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Migration Summary","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("ul",{style:{margin:0,paddingLeft:"20px"}},h.migrated.credentials&&(0,t.createElement)("li",null,(0,xe.__)("Credentials migrated:","quant")," ",h.migrated.credentials.organization," ","/"," ",h.migrated.credentials.project),h.migrated.mode&&(0,t.createElement)("li",null,(0,xe.__)("Mode set to:","quant")," ",h.migrated.mode),h.migrated.migration_date&&(0,t.createElement)("li",null,(0,xe.__)("Migrated at:","quant")," ",h.migrated.migration_date)))),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Next Steps","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,xe.__)("Your migration is complete. Here are some recommended next steps:","quant")),(0,t.createElement)("ul",{style:{paddingLeft:"20px"}},(0,t.createElement)("li",null,(0,xe.__)("Verify your connection in Settings","quant")),(0,t.createElement)("li",null,(0,xe.__)("Review your content sync status","quant")),(0,t.createElement)("li",null,(0,xe.__)("Run a full site sync if needed","quant"))),(0,t.createElement)("div",{style:{display:"flex",gap:"10px",marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/dashboard")},(0,xe.__)("Go to Dashboard","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/settings")},(0,xe.__)("Review Settings","quant"))))),a&&a.has_v1_settings&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Cleanup","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,xe.__)("Old v1 data still exists. You can clean it up now or later.","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:b,disabled:d,isBusy:d},d?(0,xe.__)("Cleaning up…","quant"):(0,xe.__)("Clean Up v1 Data","quant"))))):(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migrate from v1","quant")),E&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>y(null),isDismissible:!0},E),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("We detected settings from v1 of the QuantCDN plugin. Let's migrate them to v2.","quant")),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Settings to Migrate","quant"))),(0,t.createElement)(Se.CardBody,null,a&&a.v1_settings&&(0,t.createElement)("table",{className:"widefat",style:{marginBottom:"16px"}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Organization","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},a.v1_settings.organization||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Project","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},a.v1_settings.project||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("API Token","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},a.v1_settings.token||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Endpoint","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},a.v1_settings.endpoint||"https://api.quantcdn.io")))),a&&a.v1_queue_count>0&&(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.sprintf)(/* translators: %d: number of v1 batch rows */ /* translators: %d: number of v1 batch rows */ -(0,xe.__)("Note: %d rows of 1.x batch state are still in wp_options. Cleanup removes them.","quant"),a.v1_queue_count)),(0,t.createElement)(Se.CheckboxControl,{label:(0,xe.__)("Remove old v1 data after migration","quant"),checked:p,onChange:_,help:(0,xe.__)("This will delete old options and tables after successful migration","quant")}))),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("What will happen","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("ul",{style:{margin:0,paddingLeft:"20px"}},(0,t.createElement)("li",null,(0,xe.__)("Your API credentials will be copied to the new format","quant")),(0,t.createElement)("li",null,(0,xe.__)('Plugin mode will be set to "Static" (default)',"quant")),(0,t.createElement)("li",null,(0,xe.__)("Auto-sync and auto-purge will be enabled","quant")),(0,t.createElement)("li",null,(0,xe.__)("A new sync queue table will be used","quant"))))),(0,t.createElement)("div",{style:{marginTop:"16px",display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{i(!0),y(null);try{const e=await Ne()({path:"/quant/v1/migration/run",method:"POST"});g(e),p&&e.success&&await b(),v("complete")}catch(e){y(e.message||(0,xe.__)("Migration failed","quant"))}finally{i(!1)}},disabled:o,isBusy:o},o?(0,xe.__)("Migrating…","quant"):(0,xe.__)("Start Migration","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/settings"),disabled:o},(0,xe.__)("Skip & Configure Manually","quant"))))}function et({result:e}){return"success"===e?(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt",style:{fontSize:"48px",color:"#00a32a",display:"block",marginBottom:"15px"}}),(0,t.createElement)("p",{style:{fontSize:"18px",color:"#00a32a",margin:0}},(0,xe.__)("Connection successful!","quant"))):"error"===e?(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("span",{className:"dashicons dashicons-dismiss",style:{fontSize:"48px",color:"#d63638",display:"block",marginBottom:"15px"}}),(0,t.createElement)("p",{style:{fontSize:"18px",color:"#d63638",margin:0}},(0,xe.__)("Connection failed","quant"))):(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Let's verify your connection to QuantCDN.","quant")))}const tt=[{label:"QuantCDN",value:"https://api.quantcdn.io"},{label:"QuantGov",value:"https://api.quantgov.cloud"}];function nt(){const e=G(),[a,l]=(0,n.useState)(1),[r,s]=(0,n.useState)(!0),[o,i]=(0,n.useState)(!1),[c,u]=(0,n.useState)(!1),[d,m]=(0,n.useState)(null),[p,_]=(0,n.useState)(null),[h,g]=(0,n.useState)({organization:"",project:"",token:"",endpoint:"https://api.quantcdn.io",mode:"static"});(0,n.useEffect)(()=>{E()},[]);const E=async()=>{try{const t=await Ne()({path:"/quant/v1/onboarding/status"});if("migration"===t.state)return void e("/migration");"configured"===t.state&&e("/dashboard")}catch(e){}finally{s(!1)}},y=(e,t)=>{g(n=>({...n,[e]:t}))},f=async()=>{i(!0),m(null);try{await Ne()({path:"/quant/v1/settings",method:"POST",data:h}),l(3)}catch(e){m(e.message||(0,xe.__)("Failed to save credentials","quant"))}finally{i(!1)}},v=async()=>{i(!0),m(null);try{await Ne()({path:"/quant/v1/settings",method:"POST",data:{endpoint:h.endpoint,mode:h.mode}});const e=await Ne()({path:"/quant/v1/oauth/connect"});if(e.redirect_url)return void(window.location.href=e.redirect_url);m((0,xe.__)("The login could not be started.","quant"))}catch(e){m(e.message||(0,xe.__)("The login could not be started.","quant"))}i(!1)},q=tt.find(e=>e.value===h.endpoint)?h.endpoint:"custom",b=async()=>{i(!0),m(null);try{await Ne()({path:"/quant/v1/settings",method:"POST",data:{mode:h.mode}}),l(4)}catch(e){m(e.message||(0,xe.__)("Failed to save mode","quant"))}finally{i(!1)}},C=async()=>{u(!0),m(null),_(null);try{(await Ne()({path:"/quant/v1/status"})).connected?(_("success"),setTimeout(()=>l(5),1500)):(_("error"),m((0,xe.__)("Connection failed. Please check your credentials.","quant")))}catch(e){_("error"),m(e.message||(0,xe.__)("Connection test failed","quant"))}finally{u(!1)}};return r?(0,t.createElement)("div",{className:"quant-onboarding"},(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"200px"}},(0,t.createElement)(Se.Spinner,null))):(0,t.createElement)("div",{className:"quant-onboarding",style:{maxWidth:"700px",margin:"0 auto"}},a>=2&&a<=4&&(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px",marginBottom:"30px"}},[2,3,4].map(e=>(0,t.createElement)("div",{key:e,style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a>=e?"#5c40ff":"#ddd"}}))),(()=>{switch(a){case 1:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardBody,{style:{textAlign:"center",padding:"40px"}},(0,t.createElement)("svg",{width:"64",height:"64",viewBox:"0 0 32 32",fill:"none",style:{marginBottom:"20px"}},(0,t.createElement)("rect",{width:"32",height:"32",rx:"6",fill:"#5c40ff"}),(0,t.createElement)("text",{x:"50%",y:"55%",dominantBaseline:"middle",textAnchor:"middle",fill:"white",fontSize:"16",fontWeight:"bold"},"Q")),(0,t.createElement)("h1",{style:{marginBottom:"10px"}},(0,xe.__)("Welcome to QuantCDN","quant")),(0,t.createElement)("p",{style:{color:"#666",fontSize:"16px",maxWidth:"500px",margin:"0 auto 30px"}},(0,xe.__)("Let's get your WordPress site connected to QuantCDN. This wizard will guide you through the setup process.","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>l(2),style:{padding:"10px 30px"}},(0,xe.__)("Get Started","quant"))));case 2:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 1: API Credentials","quant"))),(0,t.createElement)(Se.CardBody,null,d&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>m(null),isDismissible:!0},d),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Platform","quant"),value:q,options:tt.concat([{label:(0,xe.__)("Other endpoint","quant"),value:"custom"}]),onChange:e=>{"custom"!==e&&y("endpoint",e)},help:(0,xe.__)("Choose the dashboard you sign in to.","quant")}),(0,t.createElement)("div",{className:"quant-onboarding__oauth"},(0,t.createElement)(Se.Button,{variant:"primary",icon:"admin-users",onClick:v,disabled:o,isBusy:o},(0,xe.__)("Login to Quant","quant")),(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.__)("Sign in and pick the project, or enter the project credentials below.","quant"))),(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Or enter the project credentials. You can find them in the","quant")," ",(0,t.createElement)("a",{href:"https://api.quantgov.cloud"===q?"https://dash.quantgov.cloud":"https://dashboard.quantcdn.io",target:"_blank",rel:"noopener noreferrer"},(0,xe.__)("Quant dashboard","quant"))," ",(0,xe.__)("on the Integrations page of the project.","quant")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Organization","quant"),value:h.organization,onChange:e=>y("organization",e),help:(0,xe.__)("Your QuantCDN organization identifier","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Project","quant"),value:h.project,onChange:e=>y("project",e),help:(0,xe.__)("Your QuantCDN project name","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Token","quant"),type:"password",value:h.token,onChange:e=>y("token",e),help:(0,xe.__)("Your project API token","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Endpoint","quant"),value:h.endpoint,onChange:e=>y("endpoint",e),help:(0,xe.__)("https://api.quantcdn.io for QuantCDN, https://api.quantgov.cloud for QuantGov. Without /v1.","quant")}),(0,t.createElement)("div",{style:{marginTop:"20px",display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:f,disabled:o||!h.organization||!h.project||!h.token,isBusy:o},o?(0,xe.__)("Saving…","quant"):(0,xe.__)("Continue","quant")))));case 3:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 2: Choose Mode","quant"))),(0,t.createElement)(Se.CardBody,null,d&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>m(null),isDismissible:!0},d),(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Choose how you want to use QuantCDN with your WordPress site.","quant")),(0,t.createElement)("div",{style:{marginBottom:"20px"}},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Plugin Mode","quant"),value:h.mode,options:[{label:(0,xe.__)("Static Site (Recommended)","quant"),value:"static"},{label:(0,xe.__)("CDN Only","quant"),value:"cdn_only"}],onChange:e=>y("mode",e)})),(0,t.createElement)("div",{style:{backgroundColor:"#f0f0f0",padding:"15px",borderRadius:"4px",marginBottom:"20px"}},"static"===h.mode?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,(0,xe.__)("Static Site Mode","quant")),(0,t.createElement)("p",{style:{margin:"10px 0 0",color:"#666"}},(0,xe.__)("Your entire site is rendered and served from QuantCDN's edge. Pages are synced automatically when you publish or update content. Ideal for maximum performance and security.","quant"))):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,(0,xe.__)("CDN Only Mode","quant")),(0,t.createElement)("p",{style:{margin:"10px 0 0",color:"#666"}},(0,xe.__)("WordPress serves dynamic content while QuantCDN handles caching. Cache is automatically purged when content changes. Good for sites that need dynamic features.","quant")))),(0,t.createElement)("div",{style:{display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>l(2)},(0,xe.__)("Back","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:b,disabled:o,isBusy:o},o?(0,xe.__)("Saving…","quant"):(0,xe.__)("Continue","quant")))));case 4:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 3: Test Connection","quant"))),(0,t.createElement)(Se.CardBody,{style:{textAlign:"center"}},d&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>m(null),isDismissible:!0},d),(0,t.createElement)(et,{result:p}),(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px",marginTop:"20px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>l(2),disabled:c},(0,xe.__)("Back to Credentials","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:C,disabled:c,isBusy:c},c?(0,xe.__)("Testing…","quant"):(0,xe.__)("Test Connection","quant")))));case 5:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardBody,{style:{textAlign:"center",padding:"40px"}},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt",style:{fontSize:"64px",color:"#00a32a",display:"block",marginBottom:"20px"}}),(0,t.createElement)("h1",{style:{marginBottom:"10px"}},(0,xe.__)("You're All Set!","quant")),(0,t.createElement)("p",{style:{color:"#666",fontSize:"16px",maxWidth:"500px",margin:"0 auto 30px"}},"static"===h.mode?(0,xe.__)("Your site is now connected to QuantCDN. Head to the Content page to sync your first pages.","quant"):(0,xe.__)("Your site is now connected to QuantCDN. Cache will be automatically purged when you update content.","quant")),(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/dashboard")},(0,xe.__)("Go to Dashboard","quant")),"static"===h.mode&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/content")},(0,xe.__)("Sync Content","quant")))));default:return null}})())}function at(){var e,a,l,r;const[s,o]=(0,n.useState)(null),[i,c]=(0,n.useState)(!0),[u,d]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{_()},[]);const _=async()=>{c(!0),d(null);try{const e=await Ne()({path:"/quant/v1/diagnostics"});o(e)}catch(e){d(e.message||(0,xe.__)("Failed to load diagnostics","quant"))}finally{c(!1)}},h=({success:e,successText:n,failText:a})=>(0,t.createElement)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"3px",fontSize:"12px",fontWeight:"500",backgroundColor:e?"#d4edda":"#f8d7da",color:e?"#155724":"#721c24"}},e?n:a);return i?(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("h1",null,(0,xe.__)("Diagnostics","quant")),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("span",null,(0,xe.__)("Loading diagnostic information…","quant")))))):u?(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("h1",null,(0,xe.__)("Diagnostics","quant")),(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},u),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:_},(0,xe.__)("Retry","quant")))):(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},(0,t.createElement)("h1",{style:{margin:0}},(0,xe.__)("Diagnostics","quant")),(0,t.createElement)("div",{style:{display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:_},(0,xe.__)("Refresh","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>{if(!s)return;p(!0);const e=(e=>{var t,n,a,l;const r=["=".repeat(60),"QuantCDN Diagnostic Report",`Generated: ${(new Date).toISOString()}`,"=".repeat(60),"","## Environment",`PHP Version: ${e.environment?.php_version||"Unknown"}`,`WordPress Version: ${e.environment?.wordpress_version||"Unknown"}`,`Plugin Version: ${e.environment?.plugin_version||"Unknown"}`,`PHP Memory Limit: ${e.environment?.php_memory_limit||"Unknown"}`,`PHP Max Execution Time: ${e.environment?.php_max_execution_time||"Unknown"}`,"Multisite: "+(e.environment?.is_multisite?"Yes":"No"),"","## Plugin Configuration",`Mode: ${e.plugin?.mode||"Unknown"}`,"Has Credentials: "+(e.plugin?.has_credentials?"Yes":"No"),`Organization: ${e.plugin?.organization||"Not set"}`,`Project: ${e.plugin?.project||"Not set"}`,`Endpoint: ${e.plugin?.endpoint||"Not set"}`,"","## API Connection","Connected: "+(e.api?.connected?"Yes":"No"),e.api?.error?`Error: ${e.api.error}`:"","","## Database","V2 Table Exists: "+(e.database?.v2_table_exists?"Yes":"No"),"V1 Table Exists: "+(e.database?.v1_table_exists?"Yes":"No"),"","## Queue Status",`Pending: ${null!==(t=e.queue?.pending)&&void 0!==t?t:"Unknown"}`,`Processing: ${null!==(n=e.queue?.processing)&&void 0!==n?n:"Unknown"}`,`Failed: ${null!==(a=e.queue?.failed)&&void 0!==a?a:"Unknown"}`,`Total: ${null!==(l=e.queue?.total)&&void 0!==l?l:"Unknown"}`,"","## Migration Status","Needs Migration: "+(e.migration?.needs_migration?"Yes":"No"),"Migration Complete: "+(e.migration?.migration_complete?"Yes":"No"),e.migration?.migration_date?`Migration Date: ${e.migration.migration_date}`:"",""];return e.recent_errors&&e.recent_errors.length>0&&(r.push("## Recent Errors"),e.recent_errors.forEach((e,t)=>{r.push(`${t+1}. [${e.type}:${e.object_id}] ${e.error_message}`),r.push(` At: ${e.processed_at}`)}),r.push("")),r.push("=".repeat(60)),r.push("End of Report"),r.filter(e=>null!==e).join("\n")})(s),t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),a=document.createElement("a");a.href=n,a.download=`quant-diagnostics-${(new Date).toISOString().split("T")[0]}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),p(!1)},disabled:m,isBusy:m},m?(0,xe.__)("Downloading…","quant"):(0,xe.__)("Download Report","quant")))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Environment","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("PHP Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("WordPress Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.wordpress_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Plugin Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.plugin_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("PHP Memory Limit","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_memory_limit||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("PHP Max Execution Time","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_max_execution_time||"-"," ","seconds")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Multisite","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.is_multisite?(0,xe.__)("Yes","quant"):(0,xe.__)("No","quant"))))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Plugin Configuration","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("Mode","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},"static"===s?.plugin?.mode?(0,xe.__)("Static Site","quant"):(0,xe.__)("CDN Only","quant"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Credentials","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},(0,t.createElement)(h,{success:s?.plugin?.has_credentials,successText:(0,xe.__)("Configured","quant"),failText:(0,xe.__)("Not Configured","quant")}))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Organization","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.organization||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Project","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.project||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Endpoint","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.endpoint||"-")))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("API Connection","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(h,{success:s?.api?.connected,successText:(0,xe.__)("Connected","quant"),failText:(0,xe.__)("Not Connected","quant")}),s?.api?.error&&(0,t.createElement)("span",{style:{color:"#721c24"}},s.api.error)))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Database","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("V2 Sync Queue Table","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},(0,t.createElement)(h,{success:s?.database?.v2_table_exists,successText:(0,xe.__)("Exists","quant"),failText:(0,xe.__)("Missing","quant")}))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("V1 Queue Table","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.database?.v1_table_exists?(0,t.createElement)("span",{style:{color:"#856404"}},(0,xe.__)("Exists (can be cleaned up)","quant")):(0,t.createElement)("span",{style:{color:"#666"}},(0,xe.__)("Not present","quant")))))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Queue Status","quant"))),(0,t.createElement)(Se.CardBody,null,s?.queue?.error?(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},s.queue.error):(0,t.createElement)("div",{style:{display:"flex",gap:"30px"}},(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#0073aa"}},null!==(e=s?.queue?.pending)&&void 0!==e?e:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Pending","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#f0b849"}},null!==(a=s?.queue?.processing)&&void 0!==a?a:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Processing","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#d63638"}},null!==(l=s?.queue?.failed)&&void 0!==l?l:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Failed","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#666"}},null!==(r=s?.queue?.total)&&void 0!==r?r:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Total","quant")))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Migration Status","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("Needs Migration","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.migration?.needs_migration?(0,t.createElement)("a",{href:"#/migration"},(0,xe.__)("Yes - Click to migrate","quant")):(0,xe.__)("No","quant"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Migration Complete","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.migration?.migration_complete?(0,xe.__)("Yes","quant"):(0,xe.__)("No","quant"))),s?.migration?.migration_date&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Migration Date","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s.migration.migration_date)))))),s?.recent_errors&&s.recent_errors.length>0&&(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Recent Errors","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Type","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("ID","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Error","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Time","quant")))),(0,t.createElement)("tbody",null,s.recent_errors.map((e,n)=>(0,t.createElement)("tr",{key:n},(0,t.createElement)("td",{style:{padding:"8px"}},e.type),(0,t.createElement)("td",{style:{padding:"8px"}},e.object_id),(0,t.createElement)("td",{style:{padding:"8px",color:"#721c24"}},e.error_message),(0,t.createElement)("td",{style:{padding:"8px",whiteSpace:"nowrap"}},e.processed_at))))))))}function lt(){return(0,t.createElement)(Ee,null,(0,t.createElement)(we,null,(0,t.createElement)(ce,null,(0,t.createElement)(oe,{path:"/",element:(0,t.createElement)(se,{to:"/dashboard",replace:!0})}),(0,t.createElement)(oe,{path:"/dashboard",element:(0,t.createElement)(Pe,null)}),(0,t.createElement)(oe,{path:"/content",element:(0,t.createElement)(Oe,null)}),(0,t.createElement)(oe,{path:"/cache",element:(0,t.createElement)(Fe,null)}),(0,t.createElement)(oe,{path:"/search",element:(0,t.createElement)(He,null)}),(0,t.createElement)(oe,{path:"/settings",element:(0,t.createElement)(Xe,null)}),(0,t.createElement)(oe,{path:"/migration",element:(0,t.createElement)(Ze,null)}),(0,t.createElement)(oe,{path:"/onboarding",element:(0,t.createElement)(nt,null)}),(0,t.createElement)(oe,{path:"/diagnostics",element:(0,t.createElement)(at,null)}))))}const rt=document.getElementById("quant-admin-root");rt&&("function"==typeof n.createRoot?n.createRoot(rt).render((0,t.createElement)(lt,null)):n.render((0,t.createElement)(lt,null),rt))})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,n=window.ReactDOM;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(a),e=e.substr(0,a));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var p;function _(e,t,a){return void 0===a&&(a="/"),function(e,t,a,n){let l=N(("string"==typeof t?d(t):t).pathname||"/",a);if(null==l)return null;let r=h(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,a)=>e===t[a])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(r);let s=null,o=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return i(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}(l);for(let e=0;null==s&&e{let s={relativePath:void 0===r?e.path||"":r,caseSensitive:!0===e.caseSensitive,childrenIndex:l,route:e};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(n.length));let i=R([n,s.relativePath]),c=a.concat(s);e.children&&e.children.length>0&&(o(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+i+'".'),h(e.children,t,c,i)),(null!=e.path||e.index)&&t.push({path:i,score:x(i,e.index),routesMeta:c})};return e.forEach((e,t)=>{var a;if(""!==e.path&&null!=(a=e.path)&&a.includes("?"))for(let a of g(e.path))l(e,t,a);else l(e,t)}),t}function g(e){let t=e.split("/");if(0===t.length)return[];let[a,...n]=t,l=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return l?[r,""]:[r];let s=g(n.join("/")),o=[];return o.push(...s.map(e=>""===e?r:[r,e].join("/"))),l&&o.push(...s),o.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const E=/^:[\w-]+$/,y=3,f=2,v=1,q=10,b=-2,C=e=>"*"===e;function x(e,t){let a=e.split("/"),n=a.length;return a.some(C)&&(n+=b),t&&(n+=f),a.filter(e=>!C(e)).reduce((e,t)=>e+(E.test(t)?y:""===t?v:q),n)}function w(e,t,a){void 0===a&&(a=!1);let{routesMeta:n}=e,l={},r="/",s=[];for(let e=0;e(n.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),l+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":""!==e&&"/"!==e&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),l=t.match(a);if(!l)return null;let r=l[0],s=r.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:n.reduce((e,t,a)=>{let{paramName:n,isOptional:l}=t;if("*"===n){let e=o[a]||"";s=r.slice(0,r.length-e.length).replace(/(.)\/+$/,"$1")}const i=o[a];return e[n]=l&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:r,pathnameBase:s,pattern:e}}function N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,n=e.charAt(a);return n&&"/"!==n?null:e.slice(a)||"/"}function k(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)}),a.length>1?a.join("/"):"/"}function T(e,t,a,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function B(e,t){let a=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?a.map((e,t)=>t===a.length-1?e.pathname:e.pathnameBase):a.map(e=>e.pathnameBase)}function P(e,t,a,n){let r;void 0===n&&(n=!1),"string"==typeof e?r=d(e):(r=l({},e),o(!r.pathname||!r.pathname.includes("?"),T("?","pathname","search",r)),o(!r.pathname||!r.pathname.includes("#"),T("#","pathname","hash",r)),o(!r.search||!r.search.includes("#"),T("#","search","hash",r)));let s,i=""===e||""===r.pathname,c=i?"/":r.pathname;if(null==c)s=a;else{let e=t.length-1;if(!n&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}s=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let a,{pathname:n,search:l="",hash:r=""}="string"==typeof e?d(e):e;return n?(n=D(n),a=n.startsWith("/")?k(n.substring(1),"/"):k(n,t)):a=t,{pathname:a,search:j(l),hash:A(r)}}(r,s),m=c&&"/"!==c&&c.endsWith("/"),p=(i||"."===c)&&a.endsWith("/");return u.pathname.endsWith("/")||!m&&!p||(u.pathname+="/"),u}const D=e=>e.replace(/\/\/+/g,"/"),R=e=>D(e.join("/")),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",A=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const F=["post","put","patch","delete"],O=(new Set(F),["get",...F]);function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0}),t.useCallback(function(t,l){void 0===l&&(l={}),n.current&&("number"==typeof t?e.navigate(t):e.navigate(t,H({fromRouteId:a},l)))},[e,a])}():function(){W()||o(!1);let e=t.useContext($),{basename:a,future:n,navigator:l}=t.useContext(I),{matches:r}=t.useContext(L),{pathname:s}=Y(),i=JSON.stringify(B(r,n.v7_relativeSplatPath)),c=t.useRef(!1);return V(()=>{c.current=!0}),t.useCallback(function(t,n){if(void 0===n&&(n={}),!c.current)return;if("number"==typeof t)return void l.go(t);let r=P(t,JSON.parse(i),s,"path"===n.relative);null==e&&"/"!==a&&(r.pathname="/"===r.pathname?a:R([a,r.pathname])),(n.replace?l.replace:l.push)(r,n.state,n)},[a,l,i,s,e])}()}function J(e,a){let{relative:n}=void 0===a?{}:a,{future:l}=t.useContext(I),{matches:r}=t.useContext(L),{pathname:s}=Y(),o=JSON.stringify(B(r,l.v7_relativeSplatPath));return t.useMemo(()=>P(e,JSON.parse(o),s,"path"===n),[e,o,s,n])}function K(e,a,n,l){W()||o(!1);let{navigator:s}=t.useContext(I),{matches:i}=t.useContext(L),c=i[i.length-1],u=c?c.params:{},m=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let p,h=Y();if(a){var g;let e="string"==typeof a?d(a):a;"/"===m||(null==(g=e.pathname)?void 0:g.startsWith(m))||o(!1),p=e}else p=h;let E=p.pathname||"/",y=E;if("/"!==m){let e=m.replace(/^\//,"").split("/");y="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let f=_(e,{pathname:y}),v=function(e,a,n,l){var r;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===l&&(l=null),null==e){var s;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(s=l)&&s.v7_partialHydration&&0===a.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let i=e,c=null==(r=n)?void 0:r.errors;if(null!=c){let e=i.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||o(!1),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,m=-1;if(n&&l&&l.v7_partialHydration)for(let e=0;e=0?i.slice(0,m+1):[i[0]];break}}}return i.reduceRight((e,l,r)=>{let s,o=!1,d=null,p=null;var _;n&&(s=c&&l.route.id?c[l.route.id]:void 0,d=l.route.errorElement||Z,u&&(m<0&&0===r?(re[_="route-fallback"]||(re[_]=!0),o=!0,p=null):m===r&&(o=!0,p=l.route.hydrateFallbackElement||null)));let h=a.concat(i.slice(0,r+1)),g=()=>{let a;return a=s?d:o?p:l.route.Component?t.createElement(l.route.Component,null):l.route.element?l.route.element:e,t.createElement(te,{match:l,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:a})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===r)?t.createElement(ee,{location:n.location,revalidation:n.revalidation,component:d,error:s,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:R([m,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:R([m,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,n,l);return a&&v?t.createElement(Q.Provider,{value:{location:H({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:r.Pop}},v):v}function X(){let e=function(){var e;let a=t.useContext(U),n=function(){let e=t.useContext(z);return e||o(!1),e}(ne.UseRouteError),l=le(ne.UseRouteError);return void 0!==a?a:null==(e=n.errors)?void 0:e[l]}(),a=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},a),n?t.createElement("pre",{style:l},n):null,null)}const Z=t.createElement(X,null);class ee extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(L.Provider,{value:this.props.routeContext},t.createElement(U.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function te(e){let{routeContext:a,match:n,children:l}=e,r=t.useContext($);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),t.createElement(L.Provider,{value:a},l)}var ae=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ae||{}),ne=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ne||{});function le(e){let a=function(){let e=t.useContext(L);return e||o(!1),e}(),n=a.matches[a.matches.length-1];return n.route.id||o(!1),n.route.id}const re={};function se(e){let{to:a,replace:n,state:l,relative:r}=e;W()||o(!1);let{future:s,static:i}=t.useContext(I),{matches:c}=t.useContext(L),{pathname:u}=Y(),m=G(),d=P(a,B(c,s.v7_relativeSplatPath),u,"path"===r),p=JSON.stringify(d);return t.useEffect(()=>m(JSON.parse(p),{replace:n,state:l,relative:r}),[m,p,r,n,l]),null}function oe(e){o(!1)}function ie(e){let{basename:a="/",children:n=null,location:l,navigationType:s=r.Pop,navigator:i,static:c=!1,future:u}=e;W()&&o(!1);let m=a.replace(/^\/*/,"/"),p=t.useMemo(()=>({basename:m,navigator:i,static:c,future:H({v7_relativeSplatPath:!1},u)}),[m,u,i,c]);"string"==typeof l&&(l=d(l));let{pathname:_="/",search:h="",hash:g="",state:E=null,key:y="default"}=l,f=t.useMemo(()=>{let e=N(_,m);return null==e?null:{location:{pathname:e,search:h,hash:g,state:E,key:y},navigationType:s}},[m,_,h,g,E,y,s]);return null==f?null:t.createElement(I.Provider,{value:p},t.createElement(Q.Provider,{children:n,value:f}))}function ce(e){let{children:t,location:a}=e;return K(ue(t),a)}function ue(e,a){void 0===a&&(a=[]);let n=[];return t.Children.forEach(e,(e,l)=>{if(!t.isValidElement(e))return;let r=[...a,l];if(e.type===t.Fragment)return void n.push.apply(n,ue(e.props.children,r));e.type!==oe&&o(!1),e.props.index&&e.props.children&&o(!1);let s={id:e.props.id||r.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=ue(e.props.children,r)),n.push(s)}),n}function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t{}),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const pe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_e=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const he=t.createContext({isTransitioning:!1});new Map;const ge=t.startTransition;function Ee(e){let{basename:a,children:n,future:p,window:_}=e,h=t.useRef();var g;null==h.current&&(h.current=(void 0===(g={window:_,v5Compat:!0})&&(g={}),function(e,t,a,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:d=!1}=n,p=i.history,_=r.Pop,h=null,g=E();function E(){return(p.state||{idx:null}).idx}function y(){_=r.Pop;let e=E(),t=null==e?null:e-g;g=e,h&&h({action:_,location:v.location,delta:t})}function f(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,a="string"==typeof e?e:m(e);return a=a.replace(/ $/,"%20"),o(t,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,t)}null==g&&(g=0,p.replaceState(l({},p.state,{idx:g}),""));let v={get action(){return _},get location(){return e(i,p)},listen(e){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(s,y),h=e,()=>{i.removeEventListener(s,y),h=null}},createHref:e=>t(i,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){_=r.Push;let n=u(v.location,e,t);a&&a(n,e),g=E()+1;let l=c(n,g),s=v.createHref(n);try{p.pushState(l,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(s)}d&&h&&h({action:_,location:v.location,delta:1})},replace:function(e,t){_=r.Replace;let n=u(v.location,e,t);a&&a(n,e),g=E();let l=c(n,g),s=v.createHref(n);p.replaceState(l,"",s),d&&h&&h({action:_,location:v.location,delta:0})},go:e=>p.go(e)};return v}(function(e,t){let{pathname:a="/",search:n="",hash:l=""}=d(e.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),u("",{pathname:a,search:n,hash:l},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let a=e.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");n=-1===a?t:t.slice(0,a)}return n+"#"+("string"==typeof t?t:m(t))},function(e,t){i("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},g)));let E=h.current,[y,f]=t.useState({action:E.action,location:E.location}),{v7_startTransition:v}=p||{},q=t.useCallback(e=>{v&&ge?ge(()=>f(e)):f(e)},[f,v]);return t.useLayoutEffect(()=>E.listen(q),[E,q]),t.useEffect(()=>{return null==(e=p)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[p]),t.createElement(ie,{basename:a,children:n,location:y.location,navigationType:y.action,navigator:E,future:p})}n.flushSync,t.useId;const ye="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ve=t.forwardRef(function(e,a){let n,{onClick:l,relative:r,reloadDocument:s,replace:i,state:c,target:u,to:d,preventScrollReset:p,viewTransition:_}=e,h=de(e,pe),{basename:g}=t.useContext(I),E=!1;if("string"==typeof d&&fe.test(d)&&(n=d,ye))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),a=N(t.pathname,g);t.origin===e.origin&&null!=a?d=a+t.search+t.hash:E=!0}catch(e){}let y=function(e,a){let{relative:n}=void 0===a?{}:a;W()||o(!1);let{basename:l,navigator:r}=t.useContext(I),{hash:s,pathname:i,search:c}=J(e,{relative:n}),u=i;return"/"!==l&&(u="/"===i?l:R([l,i])),r.createHref({pathname:u,search:c,hash:s})}(d,{relative:r}),f=function(e,a){let{target:n,replace:l,state:r,preventScrollReset:s,relative:o,viewTransition:i}=void 0===a?{}:a,c=G(),u=Y(),d=J(e,{relative:o});return t.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let a=void 0!==l?l:m(u)===m(d);c(e,{replace:a,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,c,d,l,r,n,e,s,o,i])}(d,{replace:i,state:c,target:u,preventScrollReset:p,relative:r,viewTransition:_});return t.createElement("a",me({},h,{href:n||y,onClick:E||s?l:function(e){l&&l(e),e.defaultPrevented||f(e)},ref:a,target:u}))}),qe=t.forwardRef(function(e,a){let{"aria-current":n="page",caseSensitive:l=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:m}=e,d=de(e,_e),p=J(c,{relative:d.relative}),_=Y(),h=t.useContext(z),{navigator:g,basename:E}=t.useContext(I),y=null!=h&&function(e,a){void 0===a&&(a={});let n=t.useContext(he);null==n&&o(!1);let{basename:l}=function(){let e=t.useContext($);return e||o(!1),e}(be.useViewTransitionState),r=J(e,{relative:a.relative});if(!n.isTransitioning)return!1;let s=N(n.currentLocation.pathname,l)||n.currentLocation.pathname,i=N(n.nextLocation.pathname,l)||n.nextLocation.pathname;return null!=S(r.pathname,i)||null!=S(r.pathname,s)}(p)&&!0===u,f=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,v=_.pathname,q=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;l||(v=v.toLowerCase(),q=q?q.toLowerCase():null,f=f.toLowerCase()),q&&E&&(q=N(q,E)||q);const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let C,x=v===f||!s&&v.startsWith(f)&&"/"===v.charAt(b),w=null!=q&&(q===f||!s&&q.startsWith(f)&&"/"===q.charAt(f.length)),k={isActive:x,isPending:w,isTransitioning:y},T=x?n:void 0;C="function"==typeof r?r(k):[r,x?"active":null,w?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let B="function"==typeof i?i(k):i;return t.createElement(ve,me({},d,{"aria-current":T,className:C,ref:a,style:B,to:c,viewTransition:u}),"function"==typeof m?m(k):m)});var be,Ce;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(be||(be={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ce||(Ce={}));const xe=window.wp.i18n;function we({children:e}){return(0,t.createElement)("div",{className:"quant-admin"},(0,t.createElement)("header",{className:"quant-admin__header"},(0,t.createElement)("div",{className:"quant-admin__logo"},(0,t.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},(0,t.createElement)("rect",{width:"32",height:"32",rx:"6",fill:"#5c40ff"}),(0,t.createElement)("text",{x:"50%",y:"55%",dominantBaseline:"middle",textAnchor:"middle",fill:"white",fontSize:"16",fontWeight:"bold"},"Q")),(0,t.createElement)("span",null,"QuantCDN")),(0,t.createElement)("div",{className:"quant-admin__version"},"v",window.quantAdmin?.version||"2.0.0")),(0,t.createElement)("div",{className:"quant-admin__body"},(0,t.createElement)("nav",{className:"quant-admin__sidebar"},(0,t.createElement)("ul",null,(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/dashboard"},(0,t.createElement)("span",{className:"dashicons dashicons-dashboard"}),(0,xe.__)("Dashboard","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/content"},(0,t.createElement)("span",{className:"dashicons dashicons-media-text"}),(0,xe.__)("Content","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/search"},(0,t.createElement)("span",{className:"dashicons dashicons-search"}),(0,xe.__)("Search","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/cache"},(0,t.createElement)("span",{className:"dashicons dashicons-trash"}),(0,xe.__)("Cache","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/settings"},(0,t.createElement)("span",{className:"dashicons dashicons-admin-settings"}),(0,xe.__)("Settings","quant"))),(0,t.createElement)("li",null,(0,t.createElement)(qe,{to:"/diagnostics"},(0,t.createElement)("span",{className:"dashicons dashicons-info-outline"}),(0,xe.__)("Diagnostics","quant"))))),(0,t.createElement)("main",{className:"quant-admin__content"},e)))}const Se=window.wp.components,Ne=window.wp.apiFetch;var ke=e.n(Ne);function Te({label:e,value:a,tone:n}){return(0,t.createElement)("div",{className:`quant-stat quant-stat--${n||"neutral"}`},(0,t.createElement)("div",{className:"quant-stat__value"},a),(0,t.createElement)("div",{className:"quant-stat__label"},e))}function Be(){var e,n,l,r;const s=G(),[o,i]=(0,a.useState)(null),[c,u]=(0,a.useState)([]),[m,d]=(0,a.useState)(!1),[p,_]=(0,a.useState)(null),[h,g]=(0,a.useState)(null),E=(0,a.useCallback)(async()=>{try{const[e,t]=await Promise.all([ke()({path:"/quant/v1/status"}),ke()({path:"/quant/v1/queue/errors"})]);i(e),u(t),g(null)}catch(e){g(e.message||(0,xe.__)("Failed to load the plugin status.","quant")),i({connected:!1,configured:!1,mode:"static",queue:{}})}},[]);if((0,a.useEffect)(()=>{E()},[E]),(0,a.useEffect)(()=>{!1===o?.configured&&ke()({path:"/quant/v1/onboarding/status"}).then(e=>{"onboarding"===e.state?s("/onboarding"):"migration"===e.state&&s("/migration")}).catch(()=>{})},[o,s]),!o)return(0,t.createElement)("div",{className:"quant-dashboard"},(0,t.createElement)("h1",null,(0,xe.__)("Dashboard","quant")),(0,t.createElement)(Se.Spinner,null));const y=o.queue||{},f="static"===o.mode;return(0,t.createElement)("div",{className:"quant-dashboard"},(0,t.createElement)("h1",null,(0,xe.__)("Dashboard","quant")),h&&(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},h),p&&(0,t.createElement)(Se.Notice,{status:p.status,onRemove:()=>_(null),isDismissible:!0},p.message),o.cron_disabled&&y.pending>0&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)('WP-Cron is disabled on this site. Pending items are only processed by "Process Queue", a system cron that calls wp-cron.php, or WP-CLI.',"quant")),(0,t.createElement)("div",{className:"quant-dashboard__cards"},(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Connection","quant"))),(0,t.createElement)(Se.CardBody,null,o.connected?(0,t.createElement)("p",{className:"quant-status--success"},(0,xe.__)("Connected to Quant","quant"),o.search_enabled?" · "+(0,xe.__)("Search enabled","quant"):""):(0,t.createElement)("p",{className:"quant-status--error"},o.configured?(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ +(0,xe.__)("Not connected: %s","quant"),o.error||""):(0,xe.__)("Not configured yet.","quant")),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/settings")},(0,xe.__)("Settings","quant")))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Mode","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,t.createElement)("strong",null,f?(0,xe.__)("Static Site","quant"):(0,xe.__)("CDN Only","quant")),(0,t.createElement)("br",null),(0,t.createElement)("span",{style:{color:"#666",fontSize:"13px"}},f?(0,xe.__)("Pages are published to the Quant edge.","quant"):(0,xe.__)("Quant caches WordPress and purges on change.","quant"))))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Quick Actions","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,f&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/content")},(0,xe.__)("Push content","quant")),(0,t.createElement)("br",null)),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/cache")},(0,xe.__)("Purge cache","quant")),(0,t.createElement)("br",null),(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>s("/diagnostics")},(0,xe.__)("Diagnostics","quant")))))),f&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Sync Queue","quant")),(0,t.createElement)("div",null,(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",onClick:async()=>{d(!0),_(null);try{const e=await ke()({path:"/quant/v1/queue/process",method:"POST",data:{limit:20}});_({status:e.failed>0?"warning":"success",message:(0,xe.sprintf)(/* translators: 1: processed items, 2: failed items, 3: items still pending */ /* translators: 1: processed items, 2: failed items, 3: items still pending */ +(0,xe.__)("Processed %1$d items, %2$d failed, %3$d still pending.","quant"),e.processed||0,e.failed||0,e.remaining||0)})}catch(e){_({status:"error",message:e.message||(0,xe.__)("Failed to process the queue.","quant")})}finally{d(!1),await E()}},disabled:m||!y.pending,isBusy:m},(0,xe.__)("Process now","quant"))," ",y.failed>0&&(0,t.createElement)(Se.Button,{variant:"tertiary",size:"small",onClick:async()=>{_(null);try{const e=await ke()({path:"/quant/v1/queue/retry",method:"POST"});_({status:"info",message:(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ +(0,xe.__)("%d failed items were queued again.","quant"),e.queued||0)})}catch(e){_({status:"error",message:e.message||(0,xe.__)("Failed to retry.","quant")})}await E()}},(0,xe.__)("Retry failed","quant")))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-stats"},(0,t.createElement)(Te,{label:(0,xe.__)("Pending","quant"),value:null!==(e=y.pending)&&void 0!==e?e:0,tone:"info"}),(0,t.createElement)(Te,{label:(0,xe.__)("Processing","quant"),value:null!==(n=y.processing)&&void 0!==n?n:0,tone:"warning"}),(0,t.createElement)(Te,{label:(0,xe.__)("Failed","quant"),value:null!==(l=y.failed)&&void 0!==l?l:0,tone:"error"}),(0,t.createElement)(Te,{label:(0,xe.__)("Completed","quant"),value:null!==(r=y.completed)&&void 0!==r?r:0,tone:"success"})),o.next_cron&&(0,t.createElement)("p",{style:{color:"#666",fontSize:"13px"}},(0,xe.sprintf)(/* translators: %s: time of the next cron run */ /* translators: %s: time of the next cron run */ +(0,xe.__)("Next background run: %s","quant"),o.next_cron_label||new Date(1e3*o.next_cron).toLocaleTimeString())),c.length>0&&(0,t.createElement)("table",{className:"widefat striped",style:{marginTop:"12px"}},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Type","quant")),(0,t.createElement)("th",null,(0,xe.__)("Item","quant")),(0,t.createElement)("th",null,(0,xe.__)("Error","quant")))),(0,t.createElement)("tbody",null,c.slice(0,5).map((e,a)=>(0,t.createElement)("tr",{key:a},(0,t.createElement)("td",null,e.type),(0,t.createElement)("td",null,(0,t.createElement)("code",null,e.object_id)),(0,t.createElement)("td",{style:{color:"#721c24"}},e.error_message))))))))}function Pe({status:e}){const a={synced:(0,xe.__)("Synced","quant"),pending:(0,xe.__)("Pending","quant"),never:(0,xe.__)("Never","quant"),failed:(0,xe.__)("Failed","quant")};return(0,t.createElement)("span",{className:`quant-status-badge quant-status-badge--${e}`},a[e]||e)}function De({page:e,pages:a,onPageChange:n}){return a<=1?null:(0,t.createElement)("div",{className:"quant-pagination"},(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",disabled:e<=1,onClick:()=>n(e-1)},(0,xe.__)("Previous","quant")),(0,t.createElement)("span",{className:"quant-pagination__info"},(0,xe.__)("Page","quant")," ",e," ",(0,xe.__)("of","quant")," ",a),(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",disabled:e>=a,onClick:()=>n(e+1)},(0,xe.__)("Next","quant")))}function Re({contentType:e,contentTypes:n,specialType:l,onSelectionChange:r,refreshToken:s=0}){const[o,i]=(0,a.useState)([]),[c,u]=(0,a.useState)(!0),[m,d]=(0,a.useState)(null),[p,_]=(0,a.useState)(1),[h,g]=(0,a.useState)(1),[E,y]=(0,a.useState)(0),[f,v]=(0,a.useState)(new Set),[q,b]=(0,a.useState)(!1),C=Array.isArray(n)&&n.length>0,[x,w]=(0,a.useState)(()=>C?n[0].subtype||"category":""),S=e&&e.type,N=e&&e.subtype||"";(0,a.useEffect)(()=>{let e=!1;return u(!0),d(null),ke()({path:"theme_assets"===l?`/quant/v1/theme-assets?page=${p}&per_page=50`:"redirects"===l?`/quant/v1/redirects?page=${p}&per_page=50`:`/quant/v1/content?type=${C?"taxonomy":S||"post"}&subtype=${encodeURIComponent(C?x:N)}&page=${p}&per_page=20`}).then(t=>{e||(i(t.items||[]),g(t.pages||1),y(t.total||0))}).catch(t=>{e||(i([]),g(1),y(0),d(t.message||(0,xe.__)("Failed to load content.","quant")))}).finally(()=>{e||u(!1)}),()=>{e=!0}},[p,x,s,l,C,S,N]);const k=e=>{w(e),_(1),v(new Set),b(!1)};(0,a.useEffect)(()=>{v(new Set),b(!1)},[e,n,l]),(0,a.useEffect)(()=>{if(r){const e=o.filter(e=>f.has(e.id)).map(e=>({type:e.type,id:e.id,subtype:e.subtype,url:e.url}));r(e)}},[f,o,r]);const T=e=>{_(e),v(new Set),b(!1)},B=e=>e.url;return c&&0===o.length?(0,t.createElement)("div",{className:"quant-content-browser quant-content-browser--loading"},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("p",null,(0,xe.__)("Loading content…","quant"))):(0,t.createElement)("div",{className:"quant-content-browser"},(()=>{if(!n||n.length<=1)return null;const e=n.map(e=>({label:`${e.label} (${e.count})`,value:e.subtype}));return(0,t.createElement)("div",{className:"quant-content-browser__taxonomy-selector"},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Taxonomy","quant"),value:x,options:e,onChange:k,__nextHasNoMarginBottom:!0}))})(),(0,t.createElement)("div",{className:"quant-content-browser__header"},(0,t.createElement)("span",{className:"quant-content-browser__count"},E," ",(0,xe.__)("items","quant"),f.size>0&&` (${f.size} ${(0,xe.__)("selected","quant")})`),(0,t.createElement)(De,{page:p,pages:h,onPageChange:T})),m&&(0,t.createElement)("div",{className:"quant-content-browser__empty"},(0,t.createElement)("p",{className:"quant-status--error"},m)),!m&&0===o.length&&(0,t.createElement)("div",{className:"quant-content-browser__empty"},(0,t.createElement)("p",null,(0,xe.__)("No content found.","quant"))),o.length>0&&(0,t.createElement)("table",{className:"quant-content-browser__table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"quant-content-browser__col-checkbox"},(0,t.createElement)(Se.CheckboxControl,{label:(0,t.createElement)("span",{className:"screen-reader-text"},(0,xe.__)("Select all","quant")),checked:q,onChange:e=>{b(e),v(e?new Set(o.map(e=>e.id)):new Set)},__nextHasNoMarginBottom:!0})),(0,t.createElement)("th",{className:"quant-content-browser__col-title"},"redirects"===l?(0,xe.__)("Source","quant"):(0,xe.__)("Title","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-url"},"redirects"===l?(0,xe.__)("Destination","quant"):(0,xe.__)("URL","quant")),"redirects"===l&&(0,t.createElement)("th",{className:"quant-content-browser__col-code"},(0,xe.__)("Code","quant")),"theme_assets"===l&&(0,t.createElement)("th",{className:"quant-content-browser__col-type"},(0,xe.__)("Type","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-status"},(0,xe.__)("Status","quant")),!l&&(0,t.createElement)("th",{className:"quant-content-browser__col-synced"},(0,xe.__)("Last Synced","quant")),(0,t.createElement)("th",{className:"quant-content-browser__col-actions"},(0,xe.__)("Actions","quant")))),(0,t.createElement)("tbody",null,o.map(e=>{return(0,t.createElement)("tr",{key:e.id,className:f.has(e.id)?"is-selected":""},(0,t.createElement)("td",{className:"quant-content-browser__col-checkbox"},(0,t.createElement)(Se.CheckboxControl,{label:(0,t.createElement)("span",{className:"screen-reader-text"},(0,xe.sprintf)(/* translators: %s: item title or URL */ /* translators: %s: item title or URL */ +(0,xe.__)("Select %s","quant"),e.title||e.url)),checked:f.has(e.id),onChange:t=>((e,t)=>{const a=new Set(f);t?a.add(e):a.delete(e),v(a),b(a.size===o.length)})(e.id,t),__nextHasNoMarginBottom:!0})),(0,t.createElement)("td",{className:"quant-content-browser__col-title"},"redirects"===l?(0,t.createElement)("code",null,e.url):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,e.title||(0,xe.__)("(No title)","quant")),e.subtype&&(0,t.createElement)("span",{className:"quant-content-browser__subtype"},e.subtype))),(0,t.createElement)("td",{className:"quant-content-browser__col-url"},(0,t.createElement)("code",null,"redirects"===l?e.destination:e.url)),"redirects"===l&&(0,t.createElement)("td",{className:"quant-content-browser__col-code"},(0,t.createElement)("span",{className:`quant-redirect-code quant-redirect-code--${e.code}`},e.code)),"theme_assets"===l&&(0,t.createElement)("td",{className:"quant-content-browser__col-type"},(0,t.createElement)("span",{className:`quant-asset-type quant-asset-type--${e.file_type}`},e.file_type)),(0,t.createElement)("td",{className:"quant-content-browser__col-status"},(0,t.createElement)(Pe,{status:e.sync_status})),!l&&(0,t.createElement)("td",{className:"quant-content-browser__col-synced"},e.last_synced_label||((a=e.last_synced)?new Date(a).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-")),(0,t.createElement)("td",{className:"quant-content-browser__col-actions"},(0,t.createElement)(Se.Button,{variant:"link",size:"small",href:B(e),target:"_blank",rel:"noopener noreferrer"},(0,xe.__)("View","quant"))));var a}))),(0,t.createElement)("div",{className:"quant-content-browser__footer"},(0,t.createElement)(De,{page:p,pages:h,onPageChange:T})))}const Me=["fetch_error","invalid_json","internal_server_error"];function je({onComplete:e,onFinished:n,pollInterval:l=2e3,autoProcess:r=!1}){const[s,o]=(0,a.useState)(null),[i,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(0),[d,p]=(0,a.useState)(0),[_,h]=(0,a.useState)([]),[g,E]=(0,a.useState)("active"),[y,f]=(0,a.useState)(null),[v,q]=(0,a.useState)(0),[b,C]=(0,a.useState)(!1),x=(0,a.useRef)(!1),w=(0,a.useRef)(e),S=(0,a.useRef)(n);(0,a.useEffect)(()=>{w.current=e,S.current=n},[e,n]);const N=(0,a.useCallback)(e=>{E(e),S.current&&S.current()},[]);(0,a.useEffect)(()=>{let e=!1,t=null,a=!1,n=0;const s=async()=>{var i;if(!x.current)try{if(r){const t=await ke()({path:"/quant/v1/queue/process",method:"POST",data:{limit:5}});if(e)return;m(e=>e+(t.processed||0)),p(e=>e+(t.failed||0)),t.errors&&t.errors.length&&h(e=>e.concat(t.errors).slice(-10))}const i=await ke()({path:"/quant/v1/queue/status"});if(e||x.current)return;if(n=0,C(!1),o(i),a||(a=!0,c((i.pending||0)+(i.processing||0))),0===i.pending&&0===i.processing)return void N("done");t=setTimeout(s,l)}catch(a){if(e||x.current)return;if(n+=1,function(e,t){return t<=4&&function(e){if(!e||"object"!=typeof e)return!1;const t=Number(e.data?.status||e.status||0);return 429===t||t>=500||Me.includes(e.code)}(e)}(a,n))return C(!0),void(t=setTimeout(s,(i=n,Math.min(15e3,2e3*2**Math.max(0,i-1)))));C(!1),f(a.message||(0,xe.__)("Failed to process the queue","quant")),N("error")}};return x.current=!1,E("active"),f(null),s(),()=>{e=!0,t&&clearTimeout(t)}},[r,l,v,N]);const k=s?s.pending+s.processing:0,T=i||0,B=Math.max(0,Math.min(T,T-k)),P="done"===g||0===T?100:Math.round(B/T*100);let D=g;"done"===g&&d>0?D="failed":"done"===g&&(D="complete");const R={active:(0,xe.__)("Syncing content…","quant"),complete:(0,xe.__)("Sync complete","quant"),failed:(0,xe.__)("Sync completed with errors","quant"),stopped:(0,xe.__)("Stopped. Pending items stay in the queue.","quant"),error:(0,xe.__)("Processing stopped","quant")};return(0,t.createElement)(Se.Card,{className:"quant-progress"},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-progress__content"},(0,t.createElement)("div",{className:"quant-progress__header"},(0,t.createElement)("h3",{className:"quant-progress__title"},R[D]),"active"===g&&b&&(0,t.createElement)("span",{className:"quant-progress__processing"},(0,xe.__)("The server did not answer. Trying again…","quant")),"active"===g&&!b&&s&&(0,t.createElement)("span",{className:"quant-progress__processing"},(0,xe.sprintf)(/* translators: %d: number of pending items */ /* translators: %d: number of pending items */ +(0,xe.__)("%d remaining","quant"),k))),(0,t.createElement)("div",{className:"quant-progress__bar-container",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":P},(0,t.createElement)("div",{className:`quant-progress__bar quant-progress__bar--${D}`,style:{width:`${P}%`}})),(0,t.createElement)("div",{className:"quant-progress__stats"},(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--completed"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ +(0,xe.__)("%d completed","quant"),r?u:B)),k>0&&(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--pending"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ +(0,xe.__)("%d pending","quant"),k)),d>0&&(0,t.createElement)("span",{className:"quant-progress__stat quant-progress__stat--failed"},(0,xe.sprintf)(/* translators: %d: number of items */ /* translators: %d: number of items */ +(0,xe.__)("%d failed","quant"),d))),y&&(0,t.createElement)("p",{className:"quant-progress__error"},y),_.length>0&&"active"!==g&&(0,t.createElement)("ul",{className:"quant-progress__errors"},_.map((e,a)=>(0,t.createElement)("li",{key:a},e))),(0,t.createElement)("div",{className:"quant-progress__actions"},"active"===g&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>{x.current=!0,N("stopped")}},(0,xe.__)("Stop","quant")),"active"!==g&&d>0&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{try{await ke()({path:"/quant/v1/queue/retry",method:"POST"}),o(null),c(null),m(0),p(0),h([]),q(e=>e+1)}catch(e){f(e.message||(0,xe.__)("Failed to retry","quant"))}}},(0,xe.__)("Retry Failed","quant")),"active"!==g&&(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>{w.current&&w.current()}},(0,xe.__)("Dismiss","quant"))))))}function Ae(){const[e,n]=(0,a.useState)({loading:!0,mode:"static",connected:!1}),[l,r]=(0,a.useState)([]),[s,o]=(0,a.useState)([]),[i,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),[_,h]=(0,a.useState)(null),[g,E]=(0,a.useState)(!1),[y,f]=(0,a.useState)(0);(0,a.useEffect)(()=>{Promise.all([ke()({path:"/quant/v1/status"}),ke()({path:"/quant/v1/content-types"})]).then(([e,t])=>{n({loading:!1,...e}),r(t)}).catch(e=>{p(e.message||(0,xe.__)("Failed to load the content overview.","quant")),n({loading:!1,mode:"static",connected:!1})})},[]);const v=e=>{c({status:"success",message:e}),E(!0),h(e=>e?e+1:1)},q=(0,a.useCallback)(()=>{E(!1),f(e=>e+1)},[]),b=(0,a.useCallback)(()=>{h(null),c(null)},[]),C=async(e,t)=>{if(!t||window.confirm(t)){m(!0),c(null);try{const t=await ke()({path:"/quant/v1/seed",method:"POST",data:{types:e}});v((0,xe.sprintf)(/* translators: %d: number of queued items */ /* translators: %d: number of queued items */ +(0,xe.__)("Queued %d items. Processing…","quant"),t.queued))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to queue content","quant")})}finally{m(!1)}}},x=async e=>{if(0!==s.length){m(!0),c(null);try{const t=await ke()({path:"/quant/v1/sync",method:"POST",data:{items:s,action:e}});o([]);const a="unpublish"===e?/* translators: %d: number of items */ /* translators: %d: number of items */(0,xe.__)("Queued %d items to unpublish. Processing…","quant"):/* translators: %d: number of items */ /* translators: %d: number of items */(0,xe.__)("Queued %d items. Processing…","quant");v((0,xe.sprintf)(a,t.queued))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to queue items","quant")})}finally{m(!1)}}},w=(0,a.useCallback)(e=>o(e),[]),S=(0,a.useMemo)(()=>{const e=[],t=e=>l.find(t=>t.type===e);for(const a of["post","page"]){const n=t(a);n&&e.push({name:a,title:`${n.label} (${n.count})`,contentType:n})}for(const t of l.filter(e=>"cpt"===e.type))e.push({name:`cpt_${t.subtype}`,title:`${t.label} (${t.count})`,contentType:t});const a=l.filter(e=>"taxonomy"===e.type);a.length>0&&e.push({name:"taxonomies",title:`${(0,xe.__)("Taxonomies","quant")} (${a.reduce((e,t)=>e+t.count,0)})`,contentTypes:a});const n=t("media");n&&e.push({name:"media",title:`${n.label} (${n.count})`,contentType:n});const r=t("theme_assets");r&&e.push({name:"theme_assets",title:`${r.label} (${r.count})`,contentType:r,specialType:"theme_assets"});const s=t("redirects");return s&&s.count>0&&e.push({name:"redirects",title:`${s.label} (${s.count})`,contentType:s,specialType:"redirects"}),e},[l]),N=l.filter(e=>"special"===e.category);return e.loading?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Spinner,null)):d?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},d)):"static"!==e.mode?(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("Content publishing is available in Static Site mode. In CDN Only mode the plugin purges the Quant cache when content changes.","quant"))):(0,t.createElement)("div",{className:"quant-content"},(0,t.createElement)("h1",null,(0,xe.__)("Content","quant")),!e.connected&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Not connected to the Quant API. Check the settings before you push content.","quant")),i&&(0,t.createElement)(Se.Notice,{status:i.status,onRemove:()=>c(null),isDismissible:!0},i.message),_&&(0,t.createElement)(je,{key:_,autoProcess:!0,onFinished:q,onComplete:b}),(0,t.createElement)(Se.Card,{className:"quant-content__header-card"},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{className:"quant-content__actions"},(0,t.createElement)("div",{className:"quant-content__mode-indicator"},(0,t.createElement)("span",{className:"quant-content__mode-badge quant-content__mode-badge--static"},(0,xe.__)("Static Mode","quant")),(0,t.createElement)("span",{className:"quant-content__mode-description"},(0,xe.__)("Pages, files and redirects are published to the Quant edge.","quant"))),(0,t.createElement)("div",{className:"quant-content__batch-actions"},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>C(["all"],(0,xe.__)("Queue the whole site for publishing: posts, pages, custom post types, terms, media, home, archives, author pages, theme assets, custom routes, sitemaps and redirects. Continue?","quant")),disabled:u||g,isBusy:u},(0,xe.__)("Push everything","quant")),(0,t.createElement)(Se.DropdownMenu,{icon:"arrow-down-alt2",label:(0,xe.__)("Push one type","quant"),toggleProps:{variant:"secondary",children:(0,xe.__)("Push…","quant")}},()=>(0,t.createElement)(Se.MenuGroup,null,N.map(e=>(0,t.createElement)(Se.MenuItem,{key:e.type,onClick:()=>C([e.type])},`${e.label} (${e.count})`)),(0,t.createElement)(Se.MenuItem,{onClick:()=>C(["taxonomy"])},(0,xe.__)("All taxonomy terms","quant")),(0,t.createElement)(Se.MenuItem,{onClick:()=>C(["media"])},(0,xe.__)("All media","quant")))),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>x("sync"),disabled:u||0===s.length||g},(0,xe.__)("Push selected","quant"),s.length>0&&` (${s.length})`),(0,t.createElement)(Se.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>x("unpublish"),disabled:u||0===s.length||g},(0,xe.__)("Unpublish selected","quant")),(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:async()=>{try{const e=await ke()({path:"/quant/v1/queue/status"});if(0===e.pending&&0===e.processing)return void c({status:"info",message:(0,xe.__)('The queue is empty. Use "Push everything" or select items to push.',"quant")});v((0,xe.sprintf)(/* translators: %d: number of pending items */ /* translators: %d: number of pending items */ +(0,xe.__)("Processing %d pending items…","quant"),e.pending))}catch(e){c({status:"error",message:e.message||(0,xe.__)("Failed to read the queue","quant")})}},disabled:g,isBusy:g},g?(0,xe.__)("Processing…","quant"):(0,xe.__)("Process queue","quant")))))),S.length>0&&(0,t.createElement)(Se.Card,{className:"quant-content__browser-card"},(0,t.createElement)(Se.TabPanel,{tabs:S,onSelect:()=>o([])},e=>(0,t.createElement)(Re,{contentType:e.contentType,contentTypes:e.contentTypes,specialType:e.specialType,onSelectionChange:w,refreshToken:y,key:e.name}))))}function Fe(){const[e,n]=(0,a.useState)(""),[l,r]=(0,a.useState)(!1),[s,o]=(0,a.useState)(null);return(0,t.createElement)("div",{className:"quant-cache"},(0,t.createElement)("h1",null,(0,xe.__)("Cache Management","quant")),s&&(0,t.createElement)(Se.Notice,{status:s.status,onRemove:()=>o(null),isDismissible:!0},s.message),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Purge Cache","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Enter paths to purge from the CDN cache. One path per line.","quant")),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Paths to purge","quant"),value:e,onChange:n,placeholder:"/blog/my-post\n/about\n/contact",rows:8,help:(0,xe.__)("Use /* to purge all paths under a directory","quant")}),(0,t.createElement)("div",{style:{display:"flex",gap:"12px",marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{if(e.trim()){r(!0),o(null);try{const t=e.split("\n").filter(e=>e.trim());await ke()({path:"/quant/v1/purge",method:"POST",data:{paths:t}}),o({status:"success",message:(0,xe.__)("Cache purged successfully","quant")}),n("")}catch(e){o({status:"error",message:e.message||(0,xe.__)("Failed to purge cache","quant")})}finally{r(!1)}}},disabled:l||!e.trim(),isBusy:l},(0,xe.__)("Purge Selected Paths","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:async()=>{if(window.confirm((0,xe.__)("Purge entire cache? This cannot be undone.","quant"))){r(!0),o(null);try{await ke()({path:"/quant/v1/purge",method:"POST",data:{paths:["/*"]}}),o({status:"success",message:(0,xe.__)("Entire cache purged","quant")})}catch(e){o({status:"error",message:e.message||(0,xe.__)("Failed to purge cache","quant")})}finally{r(!1)}}},disabled:l},(0,xe.__)("Purge All Cache","quant"))))))}function Oe({gap:e=4,className:a="",children:n}){return(0,t.createElement)(Se.Flex,{direction:"column",align:"stretch",justify:"flex-start",gap:e,className:`quant-form-stack ${a}`.trim()},n)}function He({label:e,help:a,children:n}){return(0,t.createElement)("fieldset",{className:"quant-field-group"},(0,t.createElement)("legend",{className:"quant-field-group__label"},e),a&&(0,t.createElement)("p",{className:"quant-field-group__help"},a),(0,t.createElement)(Oe,{gap:3},n))}const $e={facet_type:"taxonomy",taxonomy:"category",custom_key:"",facet_display:"checkbox",facet_heading:"",facet_limit:10},ze={id:"",label:"",status:!0,route:"/search",title:"Search",description:"",post_types:[],languages:[],manual_filters:"",display:{display_search:!0,display_stats:!0,show_clear_refinements:!0,pagination_enabled:!0,per_page:10},facets:[]};function Ie({facet:e,taxonomies:a,onChange:n,onRemove:l}){return(0,t.createElement)("div",{className:"quant-facet-row"},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Type","quant"),value:e.facet_type,options:[{label:(0,xe.__)("Taxonomy","quant"),value:"taxonomy"},{label:(0,xe.__)("Content type","quant"),value:"content_type"},{label:(0,xe.__)("Language","quant"),value:"language"},{label:(0,xe.__)("Custom attribute","quant"),value:"custom"}],onChange:t=>n({...e,facet_type:t}),__nextHasNoMarginBottom:!0}),"taxonomy"===e.facet_type&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Taxonomy","quant"),value:e.taxonomy,options:a.map(e=>({label:e.label,value:e.name})),onChange:t=>n({...e,taxonomy:t}),__nextHasNoMarginBottom:!0}),"custom"===e.facet_type&&(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Attribute key","quant"),value:e.custom_key,onChange:t=>n({...e,custom_key:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Heading","quant"),value:e.facet_heading,onChange:t=>n({...e,facet_heading:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Display","quant"),value:e.facet_display,options:[{label:(0,xe.__)("Checkboxes","quant"),value:"checkbox"},{label:(0,xe.__)("Menu","quant"),value:"menu"},{label:(0,xe.__)("Select","quant"),value:"select"}],onChange:t=>n({...e,facet_display:t}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Limit","quant"),type:"number",value:e.facet_limit,onChange:t=>n({...e,facet_limit:parseInt(t,10)||10}),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.Button,{variant:"link",isDestructive:!0,onClick:l},(0,xe.__)("Remove","quant")))}function Qe({page:e,postTypes:n,taxonomies:l,onSave:r,onCancel:s,saving:o}){const[i,c]=(0,a.useState)({...ze,...e||{},display:{...ze.display,...e?.display||{}}}),u=(e,t)=>c(a=>({...a,[e]:t})),m=(e,t)=>c(a=>({...a,display:{...a.display,[e]:t}}));return(0,t.createElement)(Oe,{className:"quant-search-page-editor"},(0,t.createElement)("h3",{className:"quant-form-stack__title"},e?.id?(0,xe.__)("Edit search page","quant"):(0,xe.__)("New search page","quant")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Label","quant"),value:i.label,onChange:e=>u("label",e),help:(0,xe.__)("Shown in the admin only.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Enabled","quant"),checked:!!i.status,onChange:e=>u("status",e),help:(0,xe.__)("A disabled page is kept as a draft and removed from Quant.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Route","quant"),value:i.route,onChange:e=>u("route",e),placeholder:"/search",help:(0,xe.__)("The plugin creates a WordPress page at this path that renders the search.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Page title","quant"),value:i.title,onChange:e=>u("title",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Description","quant"),value:i.description,onChange:e=>u("description",e),rows:2,__nextHasNoMarginBottom:!0}),(0,t.createElement)(He,{label:(0,xe.__)("Content types to search","quant"),help:(0,xe.__)("None selected = all indexed types.","quant")},n.map(e=>(0,t.createElement)(Se.CheckboxControl,{key:e.name,label:e.label,checked:i.post_types.includes(e.name),onChange:t=>((e,t)=>u("post_types",t?[...i.post_types,e]:i.post_types.filter(t=>t!==e)))(e.name,t),__nextHasNoMarginBottom:!0}))),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Manual filters","quant"),value:i.manual_filters,onChange:e=>u("manual_filters",e),placeholder:"category_en:'News'",help:(0,xe.__)("Appended to the page filters as written. Use the project's search syntax: Algolia on QuantCDN (category_en:'News'), Typesense on QuantGov (category_en:=`News`).","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(He,{label:(0,xe.__)("Display","quant")},(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Show the search box","quant"),checked:!!i.display.display_search,onChange:e=>m("display_search",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Show the result count","quant"),checked:!!i.display.display_stats,onChange:e=>m("display_stats",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)('Show "Clear refinements"',"quant"),checked:!!i.display.show_clear_refinements,onChange:e=>m("show_clear_refinements",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Pagination","quant"),checked:!!i.display.pagination_enabled,onChange:e=>m("pagination_enabled",e),__nextHasNoMarginBottom:!0})),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Results per page","quant"),type:"number",value:i.display.per_page,onChange:e=>m("per_page",parseInt(e,10)||10),__nextHasNoMarginBottom:!0}),(0,t.createElement)(He,{label:(0,xe.__)("Facets","quant")},i.facets.map((e,a)=>(0,t.createElement)(Ie,{key:a,facet:e,taxonomies:l,onChange:e=>((e,t)=>c(a=>({...a,facets:a.facets.map((a,n)=>n===e?t:a)})))(a,e),onRemove:()=>(e=>c(t=>({...t,facets:t.facets.filter((t,a)=>a!==e)})))(a)})),(0,t.createElement)("div",null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>u("facets",[...i.facets,{...$e}])},(0,xe.__)("Add facet","quant")))),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,className:"quant-form-stack__actions"},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>r(i),disabled:o||!i.label.trim(),isBusy:o},(0,xe.__)("Save search page","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:s,disabled:o},(0,xe.__)("Cancel","quant")))))}const Le=[0,3e3,7e3,2e4];function Ue({status:e,onRefresh:a}){var n,l;return e?(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Quant Search","quant")),(0,t.createElement)(Se.Button,{variant:"tertiary",size:"small",onClick:a},(0,xe.__)("Refresh","quant"))),(0,t.createElement)(Se.CardBody,null,!e.configured&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Configure the project credentials first.","quant")),e.configured&&!e.connected&&(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ +(0,xe.__)("Cannot reach the Quant API: %s","quant"),e.error||"")),e.connected&&!e.enabled&&(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},(0,xe.__)("Search is not enabled for this project. Enable it in the Quant dashboard under the project settings.","quant")),e.enabled&&(0,t.createElement)("table",{className:"widefat quant-kv-table"},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Index","quant")),(0,t.createElement)("td",null,e.index?.algolia_index||e.stats?.name||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Search engine","quant")),(0,t.createElement)("td",null,"typesense"===e.backend?"Typesense":"Algolia")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Records","quant")),(0,t.createElement)("td",null,null!==(n=e.stats?.entries)&&void 0!==n?n:"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Pending tasks","quant")),(0,t.createElement)("td",null,null!==(l=e.stats?.numberOfPendingTasks)&&void 0!==l?l:"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Last updated","quant")),(0,t.createElement)("td",null,e.stats?.updatedAt||"-")))))):(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardBody,null,(0,t.createElement)(Se.Spinner,null)))}function We({pages:e,onEdit:a,onDelete:n}){return 0===e.length?(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.__)('No search pages yet. A search page is a WordPress page that shows Quant Search results with facets. You can also place the "Quant Search" block or the [quant_search] shortcode on any page.',"quant")):(0,t.createElement)("table",{className:"widefat striped"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,xe.__)("Label","quant")),(0,t.createElement)("th",null,(0,xe.__)("Route","quant")),(0,t.createElement)("th",null,(0,xe.__)("Status","quant")),(0,t.createElement)("th",null,(0,xe.__)("Facets","quant")),(0,t.createElement)("th",null))),(0,t.createElement)("tbody",null,e.map(e=>(0,t.createElement)("tr",{key:e.id},(0,t.createElement)("td",null,(0,t.createElement)("strong",null,e.label),(0,t.createElement)("br",null),(0,t.createElement)("code",null,`[quant_search page="${e.id}"]`)),(0,t.createElement)("td",null,e.url?(0,t.createElement)("a",{href:e.url,target:"_blank",rel:"noreferrer"},e.route):e.route),(0,t.createElement)("td",null,e.status?(0,xe.__)("Enabled","quant"):(0,xe.__)("Disabled","quant")),(0,t.createElement)("td",null,e.facets.length),(0,t.createElement)("td",null,(0,t.createElement)(Se.Flex,{justify:"flex-end",gap:3},(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>a(e)},(0,xe.__)("Edit","quant")),(0,t.createElement)(Se.Button,{variant:"link",isDestructive:!0,onClick:()=>n(e)},(0,xe.__)("Delete","quant"))))))))}function Ye(){const[e,n]=(0,a.useState)(null),[l,r]=(0,a.useState)(null),[s,o]=(0,a.useState)([]),[i,c]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[d,p]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[g,E]=(0,a.useState)(0),[y,f]=(0,a.useState)(!1),v=(e,t)=>m({status:e,message:t}),q=(e,t)=>e?.push_needed?v("warning",(0,xe.sprintf)(/* translators: %s: what was saved, for example "Search settings saved." */ /* translators: %s: what was saved, for example "Search settings saved." */ +(0,xe.__)("%s The search form is part of every page, so pages on the edge keep the old form until you push them again. On the Content page, select Push everything.","quant"),t)):v("success",t),b=(0,a.useCallback)(()=>E(0),[]),C=(0,a.useRef)(!0),x=(0,a.useRef)(null);(0,a.useEffect)(()=>(C.current=!0,()=>{C.current=!1,clearTimeout(x.current)}),[]);const w=(0,a.useCallback)(()=>ke()({path:"/quant/v1/search/status"}).catch(()=>({configured:!1})).then(e=>(C.current&&n(e),e)),[]),S=(0,a.useRef)(null),N=(0,a.useCallback)(()=>{clearTimeout(x.current);const e=(t,a)=>{w().then(n=>{const l=t+1;C.current&&l0||null===e||n.entries===e||null!==t&&n.entries!==t}(S.current,a,n)&&(x.current=setTimeout(()=>{var t;return e(l,null!==(t=n?.stats?.entries)&&void 0!==t?t:null)},Le[l]))})};e(0,S.current)},[w]);(0,a.useEffect)(()=>{w(),ke()({path:"/quant/v1/search/settings"}).then(e=>{r(e),f(!!e?.settings?.enabled)}).catch(e=>v("error",e.message)),ke()({path:"/quant/v1/search/pages"}).then(o).catch(()=>o([]))},[w]);const k=l?.settings,T=(e,t)=>r(a=>({...a,settings:{...a.settings,[e]:t}}));return(0,t.createElement)("div",{className:"quant-search-admin"},(0,t.createElement)("h1",null,(0,xe.__)("Search","quant")),u&&(0,t.createElement)(Se.Notice,{status:u.status,onRemove:()=>m(null),isDismissible:!0},u.message),g>0&&(0,t.createElement)(je,{key:g,autoProcess:!0,onFinished:N,onComplete:b}),(0,t.createElement)(Ue,{status:e,onRefresh:w}),k&&(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Search Records","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)(Oe,null,(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Keep search records updated","quant"),checked:!!k.enabled,onChange:e=>T("enabled",e),help:(0,xe.__)("Send a search record with every page push so the index follows your content.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(He,{label:(0,xe.__)("Indexed content types","quant")},l.post_types.map(e=>(0,t.createElement)(Se.CheckboxControl,{key:e.name,label:e.label,checked:k.post_types.includes(e.name),onChange:t=>((e,t)=>T("post_types",t?[...k.post_types,e]:k.post_types.filter(t=>t!==e)))(e.name,t),__nextHasNoMarginBottom:!0}))),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Summary source","quant"),value:k.summary_source,options:[{label:(0,xe.__)("Excerpt, or the first words of the content","quant"),value:"excerpt"},{label:(0,xe.__)("First words of the content","quant"),value:"content"}],onChange:e=>T("summary_source",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Image size","quant"),value:k.image_size,options:(l.image_sizes||[]).map(e=>({label:e,value:e})),onChange:e=>T("image_size",e),help:(0,xe.__)("Featured image size stored in the record.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Send the WordPress search form to a Quant Search page","quant"),checked:!!k.replace_wp_search,onChange:e=>T("replace_wp_search",e),help:(0,xe.__)("The theme search form and ?s= searches use the default search page below, so search works on the static site.","quant"),__nextHasNoMarginBottom:!0}),k.replace_wp_search&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Default search page","quant"),value:k.default_page,options:[{label:(0,xe.__)("First enabled page","quant"),value:""}].concat(s.map(e=>({label:e.label,value:e.id}))),onChange:e=>T("default_page",e),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,className:"quant-form-stack__actions"},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{p(!0);try{const e=await ke()({path:"/quant/v1/search/settings",method:"POST",data:k});r(t=>({...t,settings:e.settings})),f(!!e.settings?.enabled),q(e,(0,xe.__)("Search settings saved.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Failed to save","quant"))}finally{p(!1)}},disabled:d,isBusy:d},(0,xe.__)("Save","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{var t;h(!0),S.current=null!==(t=e?.stats?.entries)&&void 0!==t?t:null;try{const e=await ke()({path:"/quant/v1/search/reindex",method:"POST"});v("success",(0,xe.sprintf)(/* translators: %d: number of records */ /* translators: %d: number of records */ +(0,xe.__)("Queued %d records. Processing…","quant"),e.queued)),E(e=>e+1)}catch(e){v("error",e.message||(0,xe.__)("Reindex failed","quant"))}finally{h(!1)}},disabled:_||!y||!e?.enabled},(0,xe.__)("Rebuild index","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:async()=>{const e=(0,xe.__)("Remove every record from the search index?","quant");if(window.confirm(e)){h(!0);try{await ke()({path:"/quant/v1/search/clear",method:"POST"}),v("success",(0,xe.__)("Search index cleared.","quant")),w()}catch(e){v("error",e.message||(0,xe.__)("Clear failed","quant"))}finally{h(!1)}}},disabled:_||!e?.enabled},(0,xe.__)("Clear index","quant"))))))),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Search Pages","quant")),!i&&(0,t.createElement)(Se.Button,{variant:"primary",size:"small",onClick:()=>c({})},(0,xe.__)("Add search page","quant"))),(0,t.createElement)(Se.CardBody,null,i?(0,t.createElement)(Qe,{page:i.id?i:null,postTypes:l?.post_types||[],taxonomies:l?.taxonomies||[],onSave:async e=>{p(!0);try{const t=await ke()({path:"/quant/v1/search/pages",method:"POST",data:e});o(e=>[...e.filter(e=>e.id!==t.id),t]),c(null),q(t,(0,xe.__)("Search page saved. Its WordPress page was queued for publishing.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Failed to save the search page","quant"))}finally{p(!1)}},onCancel:()=>c(null),saving:d}):(0,t.createElement)(We,{pages:s,onEdit:c,onDelete:async e=>{const t=(0,xe.sprintf)(/* translators: %s: search page label */ /* translators: %s: search page label */ +(0,xe.__)('Delete the search page "%s"? Its WordPress page is moved to the trash.',"quant"),e.label);if(window.confirm(t))try{const t=await ke()({path:`/quant/v1/search/pages/${e.id}`,method:"DELETE"});o(t=>t.filter(t=>t.id!==e.id)),q(t,(0,xe.__)("Search page deleted.","quant"))}catch(e){v("error",e.message||(0,xe.__)("Delete failed","quant"))}}}))))}const Ve=[["home",(0,xe.__)("Home page","quant")],["post",(0,xe.__)("Posts","quant")],["page",(0,xe.__)("Pages","quant")],["taxonomy",(0,xe.__)("Categories and tags","quant")],["archives",(0,xe.__)("Archives","quant")],["authors",(0,xe.__)("Author pages","quant")],["sitemaps",(0,xe.__)("Sitemaps","quant")]],Ge=e=>Array.isArray(e)?e.join("\n"):e||"",Je=e=>e.split("\n").map(e=>e.trim()).filter(Boolean);function Ke({title:e,children:a,description:n}){return(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},e)),(0,t.createElement)(Se.CardBody,null,n&&(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},n),a))}const Xe=(0,xe.__)("Set by a QUANT_* environment variable or constant. Change it there.","quant");function Ze({oauthStatus:e,setOauthStatus:n,onProjectSelected:l,notify:r,showManual:s,manualConfigured:o,setShowManual:i}){const[c,u]=(0,a.useState)([]),[m,d]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[h,g]=(0,a.useState)(null),[E,y]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[q,b]=(0,a.useState)(!1),[C,x]=(0,a.useState)(!1),w=(0,a.useCallback)(async()=>{d(!0),g(null);try{const e=await ke()({path:"/quant/v1/oauth/projects"});u(Array.isArray(e)?e:[])}catch(e){u([]),g(e.message||(0,xe.__)("Failed to load projects","quant"))}finally{d(!1),_(!0)}},[]);(0,a.useEffect)(()=>{e?.connected&&!e.has_project&&w()},[e,w]);const S=async()=>{try{const e=await ke()({path:"/quant/v1/oauth/connect"});e.redirect_url&&(window.location.href=e.redirect_url)}catch(e){r("error",e.message||(0,xe.__)("Failed to start the login","quant"))}},N=async()=>{try{await ke()({path:"/quant/v1/oauth/disconnect",method:"POST"}),n({connected:!1}),u([]),l(),r("success",(0,xe.__)("Disconnected from Quant","quant"))}catch(e){r("error",e.message||(0,xe.__)("Failed to disconnect","quant"))}},k=[{label:(0,xe.__)("Select an organization…","quant"),value:""}].concat(c.map(e=>({label:e.organization.name,value:e.organization.machine_name||e.organization.name}))),T=c.find(e=>(e.organization.machine_name||e.organization.name)===E),B=[{label:(0,xe.__)("Select a project…","quant"),value:""}].concat((T?.projects||[]).map(e=>({label:e.name||e.machine_name,value:e.machine_name||e.name})));if(!e?.connected)return(0,t.createElement)(Ke,{title:(0,xe.__)("Connect to Quant","quant"),description:(0,xe.__)("Sign in to Quant and pick the project this site publishes to. You can also enter the project credentials by hand.","quant")},(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:4},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:S,icon:"admin-users"},(0,xe.__)("Login to Quant","quant"))),!o&&(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>i(!s)},s?(0,xe.__)("Hide manual credentials","quant"):(0,xe.__)("Use manual credentials instead","quant")))));const P=function({loading:e,loaded:t,error:a,count:n}){return e||!t?"loading":a||0===n?"empty":"list"}({loading:m,loaded:p,error:h,count:c.length});return e.has_project&&!C?(0,t.createElement)(Ke,{title:(0,xe.__)("Connect to Quant","quant")},(0,t.createElement)("p",{className:"quant-connected-badge"},(0,t.createElement)(Se.Icon,{icon:"yes-alt"})," ",(0,xe.__)("Connected","quant"),e.user?.email&&(0,t.createElement)("span",{style:{color:"#666",marginLeft:"8px"}},e.user.email)),(0,t.createElement)("p",{style:{margin:"8px 0"}},(0,t.createElement)("strong",null,(0,xe.__)("Organization:","quant"))," ",e.organization),(0,t.createElement)("p",{style:{margin:"8px 0"}},(0,t.createElement)("strong",null,(0,xe.__)("Project:","quant"))," ",e.project),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>{e.project_limited?(async()=>{try{await ke()({path:"/quant/v1/oauth/disconnect",method:"POST"})}catch(e){}await S()})():(x(!0),w())}},(0,xe.__)("Change Project","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:N},(0,xe.__)("Disconnect","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"link",onClick:()=>i(!s)},s?(0,xe.__)("Hide manual credentials","quant"):(0,xe.__)("Show manual credentials","quant"))))):"empty"===P?(0,t.createElement)(Ke,{title:(0,xe.__)("Connect to Quant","quant")},(0,t.createElement)(Se.Notice,{status:"warning",isDismissible:!1},h||(0,xe.__)("No organizations or projects are available to this Quant account. Check the account in the Quant dashboard, or log in again.","quant")),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:S},(0,xe.__)("Reconnect","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:w},(0,xe.__)("Try again","quant"))),(0,t.createElement)(Se.FlexItem,null,C?(0,t.createElement)(Se.Button,{variant:"tertiary",onClick:()=>x(!1)},(0,xe.__)("Cancel","quant")):(0,t.createElement)(Se.Button,{variant:"tertiary",isDestructive:!0,onClick:N},(0,xe.__)("Disconnect","quant"))))):(0,t.createElement)(Ke,{title:(0,xe.__)("Connect to Quant","quant"),description:C?(0,xe.__)("Select a different project for this site.","quant"):(0,xe.__)("Connected. Select the project to use with this site.","quant")},"loading"===P?(0,t.createElement)(Se.Spinner,null):(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Organization","quant"),value:E,options:k,onChange:e=>{y(e),v("")}}),E&&(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Project","quant"),value:f,options:B,onChange:v}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{b(!0);try{await ke()({path:"/quant/v1/oauth/select-project",method:"POST",data:{organization:E,project:f}}),n(await ke()({path:"/quant/v1/oauth/status"})),x(!1),l(),r("success",(0,xe.__)("Project selected.","quant"))}catch(e){r("error",e.message||(0,xe.__)("Failed to select the project","quant"))}finally{b(!1)}},disabled:!E||!f||q,isBusy:q},C?(0,xe.__)("Switch to This Project","quant"):(0,xe.__)("Use This Project","quant"))),(0,t.createElement)(Se.FlexItem,null,C?(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>x(!1)},(0,xe.__)("Cancel","quant")):(0,t.createElement)(Se.Button,{variant:"secondary",isDestructive:!0,onClick:N},(0,xe.__)("Disconnect","quant"))))))}function et(){const[e,n]=(0,a.useState)(null),[l,r]=(0,a.useState)(""),[s,o]=(0,a.useState)(""),[i,c]=(0,a.useState)(""),[u,m]=(0,a.useState)(null),[d,p]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[g,E]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),[v,q]=(0,a.useState)(null),[b,C]=(0,a.useState)(null),x=(0,a.useCallback)((e,t)=>C({status:e,message:t}),[]),w=(0,a.useCallback)(async()=>{const[e,t]=await Promise.all([ke()({path:"/quant/v1/settings"}),ke()({path:"/quant/v1/oauth/status"})]);n(e),m(t),r(Ge(e.custom_routes)),o(Ge(e.domain_rewrites)),c(Ge(e.schedule?.custom_routes))},[]);(0,a.useEffect)(()=>{"success"===new URLSearchParams(window.location.search).get("oauth")&&(x("success",(0,xe.__)("Connected to Quant. Now select a project below.","quant")),window.history.replaceState({},"",window.location.pathname+"?page=quant#/settings")),w().catch(e=>x("error",e.message||(0,xe.__)("Failed to load settings","quant")))},[w,x]);const S=(e,t)=>n(a=>({...a,[e]:t})),N=(e,t)=>n(a=>({...a,schedule:{...a.schedule,[e]:t}})),k=async()=>{h(!0),C(null);try{const t={...e,custom_routes:Je(l),domain_rewrites:Je(s),schedule:{...e.schedule,custom_routes:Je(i)}};delete t.overridden,delete t.schedules,delete t.has_token,t.token||delete t.token;const a=await ke()({path:"/quant/v1/settings",method:"POST",data:t});n({...a,token:""}),x("success",(0,xe.__)("Settings saved.","quant"))}catch(e){x("error",e.message||(0,xe.__)("Failed to save settings","quant"))}finally{h(!1)}};if(!e)return(0,t.createElement)("div",{className:"quant-settings"},(0,t.createElement)("h1",null,(0,xe.__)("Settings","quant")),(0,t.createElement)(Se.Spinner,null));const T=e.overridden||{},B=!!(e.organization&&e.project&&e.has_token),P=(e,t)=>!(!T[e]||!T[e].includes(t)),D=(e,t,a)=>P(e,t)?Xe:a,R=Object.entries(e.schedules||{}).map(([e,t])=>({value:e,label:t}));return(0,t.createElement)("div",{className:"quant-settings"},(0,t.createElement)("h1",null,(0,xe.__)("Settings","quant")),b&&(0,t.createElement)(Se.Notice,{status:b.status,onRemove:()=>C(null),isDismissible:!0},b.message),(0,t.createElement)(Ze,{oauthStatus:u,setOauthStatus:m,onProjectSelected:()=>w().catch(()=>{}),notify:x,showManual:d,manualConfigured:B,setShowManual:p}),(d||!u?.connected&&B)&&(0,t.createElement)(Ke,{title:(0,xe.__)("Project Credentials","quant"),description:(0,xe.__)("Copy these from the Integrations page of the Quant dashboard.","quant")},(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Endpoint","quant"),value:e.endpoint,onChange:e=>S("endpoint",e),disabled:P("credentials","endpoint"),help:D("credentials","endpoint",(0,xe.__)("https://api.quantcdn.io for QuantCDN, https://api.quantgov.cloud for QuantGov. Without /v1.","quant"))}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Organization (API Customer)","quant"),value:e.organization,onChange:e=>S("organization",e),disabled:P("credentials","organization"),help:D("credentials","organization")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Project","quant"),value:e.project,onChange:e=>S("project",e),disabled:P("credentials","project"),help:D("credentials","project")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Token","quant"),type:"password",value:e.token,onChange:e=>S("token",e),disabled:P("credentials","token"),placeholder:e.has_token?(0,xe.__)("Token saved. Enter a new one to replace it.","quant"):(0,xe.__)("Project token","quant"),help:D("credentials","token")}),(0,t.createElement)(Se.Flex,{justify:"flex-start",gap:2,style:{marginTop:"16px"}},(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"primary",onClick:k,disabled:_,isBusy:_},(0,xe.__)("Save Credentials","quant"))),(0,t.createElement)(Se.FlexItem,null,(0,t.createElement)(Se.Button,{variant:"secondary",onClick:async()=>{E(!0);try{const e=await ke()({path:"/quant/v1/status"});x(e.connected?"success":"error",e.connected?(0,xe.__)("Connected to the Quant API.","quant"):(0,xe.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */ +(0,xe.__)("Connection failed: %s","quant"),e.error||(0,xe.__)("check your credentials","quant")))}catch(e){x("error",e.message||(0,xe.__)("Connection test failed","quant"))}finally{E(!1)}},disabled:g,isBusy:g},(0,xe.__)("Test Connection","quant"))))),(0,t.createElement)(Ke,{title:(0,xe.__)("API Connection","quant"),description:(0,xe.__)("Applies to every request the plugin makes, in both modes.","quant")},(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("HTTP request timeout (seconds)","quant"),type:"number",value:e.http_request_timeout,onChange:e=>S("http_request_timeout",parseInt(e,10)||30),disabled:P("credentials","http_request_timeout")})),(0,t.createElement)(Ke,{title:(0,xe.__)("Mode","quant")},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Plugin mode","quant"),value:e.mode,disabled:P("mode","mode"),options:[{label:(0,xe.__)("Static Site: publish the whole site to the Quant edge","quant"),value:"static"},{label:(0,xe.__)("CDN Only: WordPress serves pages, Quant caches and purges them","quant"),value:"cdn_only"}],onChange:e=>S("mode",e)}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Automatic static push","quant"),checked:!!e.auto_sync,onChange:e=>S("auto_sync",e),disabled:"static"!==e.mode||P("sync","auto_sync"),help:(0,xe.__)("Push pages, terms and media to Quant when they change (Static mode).","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Also push related pages","quant"),checked:!1!==e.sync_related,onChange:e=>S("sync_related",e),disabled:"static"!==e.mode||!e.auto_sync,help:(0,xe.__)("When a post changes, also push the home page, its categories, tags, author and archive pages.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Cache purge on save","quant"),checked:!!e.auto_purge,onChange:e=>S("auto_purge",e),disabled:P("sync","auto_purge"),help:(0,xe.__)("Purge the edge cache when content changes. Used in CDN Only mode, or in Static mode when automatic push is off.","quant")})),"static"===e.mode&&(0,t.createElement)(Ke,{title:(0,xe.__)("Static Site Rendering","quant"),description:(0,xe.__)("How the plugin fetches pages from this server before it pushes them.","quant")},(0,t.createElement)("div",{className:"quant-inline-test"},(0,t.createElement)("strong",null,(0,xe.__)("Internal connectivity","quant")),null===v?(0,t.createElement)("span",{style:{color:"#757575"}},(0,xe.__)("Not tested","quant")):(0,t.createElement)("span",{style:{color:v.success?"#00a32a":"#d63638"}},v.success?"✓ "+(0,xe.__)("Working","quant"):"✗ "+v.message),(0,t.createElement)(Se.Button,{variant:"secondary",size:"small",onClick:async()=>{f(!0),q(null);try{q(await ke()({path:"/quant/v1/test-internal",method:"POST"}))}catch(e){q({success:!1,message:e.message||(0,xe.__)("Test failed","quant")})}finally{f(!1)}},disabled:y,isBusy:y},(0,xe.__)("Test","quant")),v?.adjusted_url&&(0,t.createElement)("div",{className:"quant-inline-test__detail"},v.adjusted_url,v.host_header?` (Host: ${v.host_header})`:"")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Webserver URL","quant"),value:e.webserver_url,onChange:e=>S("webserver_url",e),placeholder:"http://localhost",disabled:P("static","webserver_url"),help:D("static","webserver_url",(0,xe.__)("Where the plugin can reach this site from the server, for example http://localhost. Leave empty to use the site URL.","quant"))}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Hostname (Host header)","quant"),value:e.webserver_host,onChange:e=>S("webserver_host",e),placeholder:"www.example.com",disabled:P("static","webserver_host"),help:D("static","webserver_host",(0,xe.__)("The public hostname WordPress expects, so rendered links use the public domain.","quant"))}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Disable SSL verification for the local webserver","quant"),checked:!!e.disable_tls_verify,onChange:e=>S("disable_tls_verify",e),disabled:P("credentials","disable_tls_verify"),help:D("credentials","disable_tls_verify",(0,xe.__)("Only for a local webserver with a self-signed certificate. Calls to the Quant API always verify TLS.","quant"))}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Strip host domain from content","quant"),checked:!!e.strip_host,onChange:e=>S("strip_host",e),help:(0,xe.__)("Rewrite absolute links to this site as relative links, and upgrade http:// links to https://.","quant")}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Additional domains to make relative","quant"),value:s,onChange:o,rows:3,placeholder:"cdn.example.com",help:(0,xe.__)("One per line. Useful for staging or editorial domains.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Follow pagination links","quant"),checked:!!e.follow_links,onChange:e=>S("follow_links",e),help:(0,xe.__)("Queue the next pages of listings found in rendered markup.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Override existing proxies","quant"),checked:!!e.proxy_override,onChange:e=>S("proxy_override",e),help:(0,xe.__)("Tell Quant that pushed pages replace proxy rules at the same path.","quant")})),"static"===e.mode&&(0,t.createElement)(Ke,{title:(0,xe.__)("Seed Content","quant"),description:(0,xe.__)("What a full push includes besides posts, pages, terms and media.","quant")},(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Theme assets","quant"),checked:!!e.theme_assets,onChange:e=>S("theme_assets",e),help:(0,xe.__)("CSS, JavaScript, images and fonts of the active theme and its parent.","quant")}),(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Sitemaps","quant"),checked:!!e.sitemap,onChange:e=>S("sitemap",e),help:(0,xe.__)("WordPress core sitemaps, Yoast SEO and Rank Math sitemaps with their stylesheets.","quant")}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("404 page path","quant"),value:e.route_404,onChange:e=>S("route_404",e),placeholder:"/404",help:(0,xe.__)("A path that returns your 404 page. It is published as the Quant 404 page.","quant")}),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Custom routes","quant"),value:l,onChange:r,rows:4,placeholder:"/robots.txt\n/custom-page",help:(0,xe.__)("One per line. Content routes are rendered; paths that match a file on disk are uploaded.","quant")})),"static"===e.mode&&(0,t.createElement)(Ke,{title:(0,xe.__)("Scheduled Push","quant"),description:(0,xe.__)("Re-push chosen content on a schedule, for example for listings that change without a save.","quant")},(0,t.createElement)(Se.ToggleControl,{label:(0,xe.__)("Enable scheduled push","quant"),checked:!!e.schedule?.enabled,onChange:e=>N("enabled",e)}),e.schedule?.enabled&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Schedule","quant"),value:e.schedule.interval,options:R,onChange:e=>N("interval",e)}),Ve.map(([a,n])=>(0,t.createElement)(Se.CheckboxControl,{key:a,label:n,checked:(e.schedule.types||[]).includes(a),onChange:t=>N("types",t?[...e.schedule.types||[],a]:(e.schedule.types||[]).filter(e=>e!==a))})),(0,t.createElement)(Se.TextareaControl,{label:(0,xe.__)("Custom routes","quant"),value:i,onChange:c,rows:3,placeholder:"/robots.txt"}))),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:k,disabled:_,isBusy:_},(0,xe.__)("Save Settings","quant"))))}function tt(){const e=G(),[n,l]=(0,a.useState)(null),[r,s]=(0,a.useState)(!0),[o,i]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[m,d]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[h,g]=(0,a.useState)(null),[E,y]=(0,a.useState)(null),[f,v]=(0,a.useState)("detect");(0,a.useEffect)(()=>{q()},[]);const q=async()=>{s(!0),y(null);try{const e=await ke()({path:"/quant/v1/migration/status"});l(e),e.migration_complete?v("complete"):e.needs_migration?v("preview"):e.has_v1_settings||v("no-migration")}catch(e){y(e.message||(0,xe.__)("Failed to check migration status","quant"))}finally{s(!1)}},b=async()=>{d(!0),u(null);try{await ke()({path:"/quant/v1/migration/cleanup",method:"POST"}),u({status:"success",message:(0,xe.__)("The 1.x settings were removed.","quant")});const e=await ke()({path:"/quant/v1/migration/status"});l(e)}catch(e){u({status:"error",message:e.message||(0,xe.__)("The 1.x settings could not be removed.","quant")})}finally{d(!1)}};return r?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration","quant")),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("span",null,(0,xe.__)("Checking for v1 settings…","quant")))))):"no-migration"===f?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration","quant")),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("No v1 settings found. Nothing to migrate.","quant")),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/settings")},(0,xe.__)("Go to Settings","quant")))):"complete"===f?(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migration Complete","quant")),c&&(0,t.createElement)(Se.Notice,{status:c.status,onRemove:()=>u(null),isDismissible:!0},c.message),(0,t.createElement)(Se.Notice,{status:"success",isDismissible:!1},(0,xe.__)("Your settings have been successfully migrated to v2!","quant")),h&&h.migrated&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Migration Summary","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("ul",{style:{margin:0,paddingLeft:"20px"}},h.migrated.credentials&&(0,t.createElement)("li",null,(0,xe.__)("Credentials migrated:","quant")," ",h.migrated.credentials.organization," ","/"," ",h.migrated.credentials.project),h.migrated.mode&&(0,t.createElement)("li",null,(0,xe.__)("Mode set to:","quant")," ",h.migrated.mode),h.migrated.migration_date&&(0,t.createElement)("li",null,(0,xe.__)("Migrated at:","quant")," ",h.migrated.migration_date)))),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Next Steps","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,xe.__)("Your migration is complete. Here are some recommended next steps:","quant")),(0,t.createElement)("ul",{style:{paddingLeft:"20px"}},(0,t.createElement)("li",null,(0,xe.__)("Verify your connection in Settings","quant")),(0,t.createElement)("li",null,(0,xe.__)("Review your content sync status","quant")),(0,t.createElement)("li",null,(0,xe.__)("Run a full site sync if needed","quant"))),(0,t.createElement)("div",{style:{display:"flex",gap:"10px",marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/dashboard")},(0,xe.__)("Go to Dashboard","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/settings")},(0,xe.__)("Review Settings","quant"))))),n&&n.has_v1_settings&&(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Cleanup","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("p",null,(0,xe.__)("Old v1 data still exists. You can clean it up now or later.","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:b,disabled:m,isBusy:m},m?(0,xe.__)("Cleaning up…","quant"):(0,xe.__)("Clean Up v1 Data","quant"))))):(0,t.createElement)("div",{className:"quant-migration"},(0,t.createElement)("h1",null,(0,xe.__)("Migrate from v1","quant")),E&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>y(null),isDismissible:!0},E),(0,t.createElement)(Se.Notice,{status:"info",isDismissible:!1},(0,xe.__)("We detected settings from v1 of the QuantCDN plugin. Let's migrate them to v2.","quant")),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Settings to Migrate","quant"))),(0,t.createElement)(Se.CardBody,null,n&&n.v1_settings&&(0,t.createElement)("table",{className:"widefat",style:{marginBottom:"16px"}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Organization","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},n.v1_settings.organization||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Project","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},n.v1_settings.project||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("API Token","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},n.v1_settings.token||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Endpoint","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},n.v1_settings.endpoint||"https://api.quantcdn.io")))),n&&n.v1_queue_count>0&&(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.sprintf)(/* translators: %d: number of v1 batch rows */ /* translators: %d: number of v1 batch rows */ +(0,xe.__)("Note: %d rows of 1.x batch state are still in wp_options. Cleanup removes them.","quant"),n.v1_queue_count)),(0,t.createElement)(Se.CheckboxControl,{label:(0,xe.__)("Remove old v1 data after migration","quant"),checked:p,onChange:_,help:(0,xe.__)("This will delete old options and tables after successful migration","quant")}))),(0,t.createElement)(Se.Card,{style:{marginTop:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("What will happen","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("ul",{style:{margin:0,paddingLeft:"20px"}},(0,t.createElement)("li",null,(0,xe.__)("Your API credentials will be copied to the new format","quant")),(0,t.createElement)("li",null,(0,xe.__)('Plugin mode will be set to "Static" (default)',"quant")),(0,t.createElement)("li",null,(0,xe.__)("Auto-sync and auto-purge will be enabled","quant")),(0,t.createElement)("li",null,(0,xe.__)("A new sync queue table will be used","quant"))))),(0,t.createElement)("div",{style:{marginTop:"16px",display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:async()=>{i(!0),y(null);try{const e=await ke()({path:"/quant/v1/migration/run",method:"POST"});g(e),p&&e.success&&await b(),v("complete")}catch(e){y(e.message||(0,xe.__)("Migration failed","quant"))}finally{i(!1)}},disabled:o,isBusy:o},o?(0,xe.__)("Migrating…","quant"):(0,xe.__)("Start Migration","quant")),(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/settings"),disabled:o},(0,xe.__)("Skip & Configure Manually","quant"))))}function at({result:e}){return"success"===e?(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt",style:{fontSize:"48px",color:"#00a32a",display:"block",marginBottom:"15px"}}),(0,t.createElement)("p",{style:{fontSize:"18px",color:"#00a32a",margin:0}},(0,xe.__)("Connection successful!","quant"))):"error"===e?(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("span",{className:"dashicons dashicons-dismiss",style:{fontSize:"48px",color:"#d63638",display:"block",marginBottom:"15px"}}),(0,t.createElement)("p",{style:{fontSize:"18px",color:"#d63638",margin:0}},(0,xe.__)("Connection failed","quant"))):(0,t.createElement)("div",{style:{padding:"20px"}},(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Let's verify your connection to QuantCDN.","quant")))}const nt=[{label:"QuantCDN",value:"https://api.quantcdn.io"},{label:"QuantGov",value:"https://api.quantgov.cloud"}];function lt(){const e=G(),[n,l]=(0,a.useState)(1),[r,s]=(0,a.useState)(!0),[o,i]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1),[m,d]=(0,a.useState)(null),[p,_]=(0,a.useState)(null),[h,g]=(0,a.useState)({organization:"",project:"",token:"",endpoint:"https://api.quantcdn.io",mode:"static"});(0,a.useEffect)(()=>{E()},[]);const E=async()=>{try{const t=await ke()({path:"/quant/v1/onboarding/status"});if("migration"===t.state)return void e("/migration");"configured"===t.state&&e("/dashboard")}catch(e){}finally{s(!1)}},y=(e,t)=>{g(a=>({...a,[e]:t}))},f=async()=>{i(!0),d(null);try{await ke()({path:"/quant/v1/settings",method:"POST",data:h}),l(3)}catch(e){d(e.message||(0,xe.__)("Failed to save credentials","quant"))}finally{i(!1)}},v=async()=>{i(!0),d(null);try{await ke()({path:"/quant/v1/settings",method:"POST",data:{endpoint:h.endpoint,mode:h.mode}});const e=await ke()({path:"/quant/v1/oauth/connect"});if(e.redirect_url)return void(window.location.href=e.redirect_url);d((0,xe.__)("The login could not be started.","quant"))}catch(e){d(e.message||(0,xe.__)("The login could not be started.","quant"))}i(!1)},q=nt.find(e=>e.value===h.endpoint)?h.endpoint:"custom",b=async()=>{i(!0),d(null);try{await ke()({path:"/quant/v1/settings",method:"POST",data:{mode:h.mode}}),l(4)}catch(e){d(e.message||(0,xe.__)("Failed to save mode","quant"))}finally{i(!1)}},C=async()=>{u(!0),d(null),_(null);try{(await ke()({path:"/quant/v1/status"})).connected?(_("success"),setTimeout(()=>l(5),1500)):(_("error"),d((0,xe.__)("Connection failed. Please check your credentials.","quant")))}catch(e){_("error"),d(e.message||(0,xe.__)("Connection test failed","quant"))}finally{u(!1)}};return r?(0,t.createElement)("div",{className:"quant-onboarding"},(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"200px"}},(0,t.createElement)(Se.Spinner,null))):(0,t.createElement)("div",{className:"quant-onboarding",style:{maxWidth:"700px",margin:"0 auto"}},n>=2&&n<=4&&(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px",marginBottom:"30px"}},[2,3,4].map(e=>(0,t.createElement)("div",{key:e,style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:n>=e?"#5c40ff":"#ddd"}}))),(()=>{switch(n){case 1:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardBody,{style:{textAlign:"center",padding:"40px"}},(0,t.createElement)("svg",{width:"64",height:"64",viewBox:"0 0 32 32",fill:"none",style:{marginBottom:"20px"}},(0,t.createElement)("rect",{width:"32",height:"32",rx:"6",fill:"#5c40ff"}),(0,t.createElement)("text",{x:"50%",y:"55%",dominantBaseline:"middle",textAnchor:"middle",fill:"white",fontSize:"16",fontWeight:"bold"},"Q")),(0,t.createElement)("h1",{style:{marginBottom:"10px"}},(0,xe.__)("Welcome to QuantCDN","quant")),(0,t.createElement)("p",{style:{color:"#666",fontSize:"16px",maxWidth:"500px",margin:"0 auto 30px"}},(0,xe.__)("Let's get your WordPress site connected to QuantCDN. This wizard will guide you through the setup process.","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>l(2),style:{padding:"10px 30px"}},(0,xe.__)("Get Started","quant"))));case 2:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 1: API Credentials","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)(Oe,null,m&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>d(null),isDismissible:!0},m),(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Platform","quant"),value:q,options:nt.concat([{label:(0,xe.__)("Other endpoint","quant"),value:"custom"}]),onChange:e=>{"custom"!==e&&y("endpoint",e)},help:(0,xe.__)("Choose the dashboard you sign in to.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)("div",{className:"quant-onboarding__oauth"},(0,t.createElement)(Se.Button,{variant:"primary",icon:"admin-users",onClick:v,disabled:o,isBusy:o},(0,xe.__)("Login to Quant","quant")),(0,t.createElement)("p",{style:{color:"#666"}},(0,xe.__)("Sign in and pick the project, or enter the project credentials below.","quant"))),(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Or enter the project credentials. You can find them in the","quant")," ",(0,t.createElement)("a",{href:"https://api.quantgov.cloud"===q?"https://dash.quantgov.cloud":"https://dashboard.quantcdn.io",target:"_blank",rel:"noopener noreferrer"},(0,xe.__)("Quant dashboard","quant"))," ",(0,xe.__)("on the Integrations page of the project.","quant")),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Organization","quant"),value:h.organization,onChange:e=>y("organization",e),help:(0,xe.__)("Your QuantCDN organization identifier","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("Project","quant"),value:h.project,onChange:e=>y("project",e),help:(0,xe.__)("Your QuantCDN project name","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Token","quant"),type:"password",value:h.token,onChange:e=>y("token",e),help:(0,xe.__)("Your project API token","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)(Se.TextControl,{label:(0,xe.__)("API Endpoint","quant"),value:h.endpoint,onChange:e=>y("endpoint",e),help:(0,xe.__)("https://api.quantcdn.io for QuantCDN, https://api.quantgov.cloud for QuantGov. Without /v1.","quant"),__nextHasNoMarginBottom:!0}),(0,t.createElement)("div",{style:{display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:f,disabled:o||!h.organization||!h.project||!h.token,isBusy:o},o?(0,xe.__)("Saving…","quant"):(0,xe.__)("Continue","quant"))))));case 3:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 2: Choose Mode","quant"))),(0,t.createElement)(Se.CardBody,null,m&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>d(null),isDismissible:!0},m),(0,t.createElement)("p",{style:{color:"#666",marginTop:0}},(0,xe.__)("Choose how you want to use QuantCDN with your WordPress site.","quant")),(0,t.createElement)("div",{style:{marginBottom:"20px"}},(0,t.createElement)(Se.SelectControl,{label:(0,xe.__)("Plugin Mode","quant"),value:h.mode,options:[{label:(0,xe.__)("Static Site (Recommended)","quant"),value:"static"},{label:(0,xe.__)("CDN Only","quant"),value:"cdn_only"}],onChange:e=>y("mode",e)})),(0,t.createElement)("div",{style:{backgroundColor:"#f0f0f0",padding:"15px",borderRadius:"4px",marginBottom:"20px"}},"static"===h.mode?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,(0,xe.__)("Static Site Mode","quant")),(0,t.createElement)("p",{style:{margin:"10px 0 0",color:"#666"}},(0,xe.__)("Your entire site is rendered and served from QuantCDN's edge. Pages are synced automatically when you publish or update content. Ideal for maximum performance and security.","quant"))):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("strong",null,(0,xe.__)("CDN Only Mode","quant")),(0,t.createElement)("p",{style:{margin:"10px 0 0",color:"#666"}},(0,xe.__)("WordPress serves dynamic content while QuantCDN handles caching. Cache is automatically purged when content changes. Good for sites that need dynamic features.","quant")))),(0,t.createElement)("div",{style:{display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>l(2)},(0,xe.__)("Back","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:b,disabled:o,isBusy:o},o?(0,xe.__)("Saving…","quant"):(0,xe.__)("Continue","quant")))));case 4:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Step 3: Test Connection","quant"))),(0,t.createElement)(Se.CardBody,{style:{textAlign:"center"}},m&&(0,t.createElement)(Se.Notice,{status:"error",onRemove:()=>d(null),isDismissible:!0},m),(0,t.createElement)(at,{result:p}),(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px",marginTop:"20px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>l(2),disabled:c},(0,xe.__)("Back to Credentials","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:C,disabled:c,isBusy:c},c?(0,xe.__)("Testing…","quant"):(0,xe.__)("Test Connection","quant")))));case 5:return(0,t.createElement)(Se.Card,{className:"quant-onboarding__card"},(0,t.createElement)(Se.CardBody,{style:{textAlign:"center",padding:"40px"}},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt",style:{fontSize:"64px",color:"#00a32a",display:"block",marginBottom:"20px"}}),(0,t.createElement)("h1",{style:{marginBottom:"10px"}},(0,xe.__)("You're All Set!","quant")),(0,t.createElement)("p",{style:{color:"#666",fontSize:"16px",maxWidth:"500px",margin:"0 auto 30px"}},"static"===h.mode?(0,xe.__)("Your site is now connected to QuantCDN. Head to the Content page to sync your first pages.","quant"):(0,xe.__)("Your site is now connected to QuantCDN. Cache will be automatically purged when you update content.","quant")),(0,t.createElement)("div",{style:{display:"flex",justifyContent:"center",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>e("/dashboard")},(0,xe.__)("Go to Dashboard","quant")),"static"===h.mode&&(0,t.createElement)(Se.Button,{variant:"secondary",onClick:()=>e("/content")},(0,xe.__)("Sync Content","quant")))));default:return null}})())}function rt(){var e,n,l,r;const[s,o]=(0,a.useState)(null),[i,c]=(0,a.useState)(!0),[u,m]=(0,a.useState)(null),[d,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{_()},[]);const _=async()=>{c(!0),m(null);try{const e=await ke()({path:"/quant/v1/diagnostics"});o(e)}catch(e){m(e.message||(0,xe.__)("Failed to load diagnostics","quant"))}finally{c(!1)}},h=({success:e,successText:a,failText:n})=>(0,t.createElement)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"3px",fontSize:"12px",fontWeight:"500",backgroundColor:e?"#d4edda":"#f8d7da",color:e?"#155724":"#721c24"}},e?a:n);return i?(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("h1",null,(0,xe.__)("Diagnostics","quant")),(0,t.createElement)(Se.Card,null,(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(Se.Spinner,null),(0,t.createElement)("span",null,(0,xe.__)("Loading diagnostic information…","quant")))))):u?(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("h1",null,(0,xe.__)("Diagnostics","quant")),(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},u),(0,t.createElement)("div",{style:{marginTop:"16px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:_},(0,xe.__)("Retry","quant")))):(0,t.createElement)("div",{className:"quant-diagnostics"},(0,t.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},(0,t.createElement)("h1",{style:{margin:0}},(0,xe.__)("Diagnostics","quant")),(0,t.createElement)("div",{style:{display:"flex",gap:"10px"}},(0,t.createElement)(Se.Button,{variant:"secondary",onClick:_},(0,xe.__)("Refresh","quant")),(0,t.createElement)(Se.Button,{variant:"primary",onClick:()=>{if(!s)return;p(!0);const e=(e=>{var t,a,n,l;const r=["=".repeat(60),"QuantCDN Diagnostic Report",`Generated: ${(new Date).toISOString()}`,"=".repeat(60),"","## Environment",`PHP Version: ${e.environment?.php_version||"Unknown"}`,`WordPress Version: ${e.environment?.wordpress_version||"Unknown"}`,`Plugin Version: ${e.environment?.plugin_version||"Unknown"}`,`PHP Memory Limit: ${e.environment?.php_memory_limit||"Unknown"}`,`PHP Max Execution Time: ${e.environment?.php_max_execution_time||"Unknown"}`,"Multisite: "+(e.environment?.is_multisite?"Yes":"No"),"","## Plugin Configuration",`Mode: ${e.plugin?.mode||"Unknown"}`,"Has Credentials: "+(e.plugin?.has_credentials?"Yes":"No"),`Organization: ${e.plugin?.organization||"Not set"}`,`Project: ${e.plugin?.project||"Not set"}`,`Endpoint: ${e.plugin?.endpoint||"Not set"}`,"","## API Connection","Connected: "+(e.api?.connected?"Yes":"No"),e.api?.error?`Error: ${e.api.error}`:"","","## Database","V2 Table Exists: "+(e.database?.v2_table_exists?"Yes":"No"),"V1 Table Exists: "+(e.database?.v1_table_exists?"Yes":"No"),"","## Queue Status",`Pending: ${null!==(t=e.queue?.pending)&&void 0!==t?t:"Unknown"}`,`Processing: ${null!==(a=e.queue?.processing)&&void 0!==a?a:"Unknown"}`,`Failed: ${null!==(n=e.queue?.failed)&&void 0!==n?n:"Unknown"}`,`Total: ${null!==(l=e.queue?.total)&&void 0!==l?l:"Unknown"}`,"","## Migration Status","Needs Migration: "+(e.migration?.needs_migration?"Yes":"No"),"Migration Complete: "+(e.migration?.migration_complete?"Yes":"No"),e.migration?.migration_date?`Migration Date: ${e.migration.migration_date}`:"",""];return e.recent_errors&&e.recent_errors.length>0&&(r.push("## Recent Errors"),e.recent_errors.forEach((e,t)=>{r.push(`${t+1}. [${e.type}:${e.object_id}] ${e.error_message}`),r.push(` At: ${e.processed_at}`)}),r.push("")),r.push("=".repeat(60)),r.push("End of Report"),r.filter(e=>null!==e).join("\n")})(s),t=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(t),n=document.createElement("a");n.href=a,n.download=`quant-diagnostics-${(new Date).toISOString().split("T")[0]}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(a),p(!1)},disabled:d,isBusy:d},d?(0,xe.__)("Downloading…","quant"):(0,xe.__)("Download Report","quant")))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Environment","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("PHP Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("WordPress Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.wordpress_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Plugin Version","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.plugin_version||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("PHP Memory Limit","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_memory_limit||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("PHP Max Execution Time","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.php_max_execution_time||"-"," ","seconds")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Multisite","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.environment?.is_multisite?(0,xe.__)("Yes","quant"):(0,xe.__)("No","quant"))))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Plugin Configuration","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("Mode","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},"static"===s?.plugin?.mode?(0,xe.__)("Static Site","quant"):(0,xe.__)("CDN Only","quant"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Credentials","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},(0,t.createElement)(h,{success:s?.plugin?.has_credentials,successText:(0,xe.__)("Configured","quant"),failText:(0,xe.__)("Not Configured","quant")}))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Organization","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.organization||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Project","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.project||"-")),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Endpoint","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.plugin?.endpoint||"-")))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("API Connection","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},(0,t.createElement)(h,{success:s?.api?.connected,successText:(0,xe.__)("Connected","quant"),failText:(0,xe.__)("Not Connected","quant")}),s?.api?.error&&(0,t.createElement)("span",{style:{color:"#721c24"}},s.api.error)))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Database","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("V2 Sync Queue Table","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},(0,t.createElement)(h,{success:s?.database?.v2_table_exists,successText:(0,xe.__)("Exists","quant"),failText:(0,xe.__)("Missing","quant")}))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("V1 Queue Table","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.database?.v1_table_exists?(0,t.createElement)("span",{style:{color:"#856404"}},(0,xe.__)("Exists (can be cleaned up)","quant")):(0,t.createElement)("span",{style:{color:"#666"}},(0,xe.__)("Not present","quant")))))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Queue Status","quant"))),(0,t.createElement)(Se.CardBody,null,s?.queue?.error?(0,t.createElement)(Se.Notice,{status:"error",isDismissible:!1},s.queue.error):(0,t.createElement)("div",{style:{display:"flex",gap:"30px"}},(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#0073aa"}},null!==(e=s?.queue?.pending)&&void 0!==e?e:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Pending","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#f0b849"}},null!==(n=s?.queue?.processing)&&void 0!==n?n:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Processing","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#d63638"}},null!==(l=s?.queue?.failed)&&void 0!==l?l:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Failed","quant"))),(0,t.createElement)("div",{style:{textAlign:"center"}},(0,t.createElement)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#666"}},null!==(r=s?.queue?.total)&&void 0!==r?r:0),(0,t.createElement)("div",{style:{fontSize:"12px",color:"#666"}},(0,xe.__)("Total","quant")))))),(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Migration Status","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px",width:"200px"}},(0,xe.__)("Needs Migration","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.migration?.needs_migration?(0,t.createElement)("a",{href:"#/migration"},(0,xe.__)("Yes - Click to migrate","quant")):(0,xe.__)("No","quant"))),(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Migration Complete","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s?.migration?.migration_complete?(0,xe.__)("Yes","quant"):(0,xe.__)("No","quant"))),s?.migration?.migration_date&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Migration Date","quant")),(0,t.createElement)("td",{style:{padding:"8px"}},s.migration.migration_date)))))),s?.recent_errors&&s.recent_errors.length>0&&(0,t.createElement)(Se.Card,{style:{marginBottom:"16px"}},(0,t.createElement)(Se.CardHeader,null,(0,t.createElement)("h2",{style:{margin:0}},(0,xe.__)("Recent Errors","quant"))),(0,t.createElement)(Se.CardBody,null,(0,t.createElement)("table",{className:"widefat",style:{margin:0}},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Type","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("ID","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Error","quant")),(0,t.createElement)("th",{style:{textAlign:"left",padding:"8px"}},(0,xe.__)("Time","quant")))),(0,t.createElement)("tbody",null,s.recent_errors.map((e,a)=>(0,t.createElement)("tr",{key:a},(0,t.createElement)("td",{style:{padding:"8px"}},e.type),(0,t.createElement)("td",{style:{padding:"8px"}},e.object_id),(0,t.createElement)("td",{style:{padding:"8px",color:"#721c24"}},e.error_message),(0,t.createElement)("td",{style:{padding:"8px",whiteSpace:"nowrap"}},e.processed_at))))))))}function st(){return(0,t.createElement)(Ee,null,(0,t.createElement)(we,null,(0,t.createElement)(ce,null,(0,t.createElement)(oe,{path:"/",element:(0,t.createElement)(se,{to:"/dashboard",replace:!0})}),(0,t.createElement)(oe,{path:"/dashboard",element:(0,t.createElement)(Be,null)}),(0,t.createElement)(oe,{path:"/content",element:(0,t.createElement)(Ae,null)}),(0,t.createElement)(oe,{path:"/cache",element:(0,t.createElement)(Fe,null)}),(0,t.createElement)(oe,{path:"/search",element:(0,t.createElement)(Ye,null)}),(0,t.createElement)(oe,{path:"/settings",element:(0,t.createElement)(et,null)}),(0,t.createElement)(oe,{path:"/migration",element:(0,t.createElement)(tt,null)}),(0,t.createElement)(oe,{path:"/onboarding",element:(0,t.createElement)(lt,null)}),(0,t.createElement)(oe,{path:"/diagnostics",element:(0,t.createElement)(rt,null)}))))}const ot=document.getElementById("quant-admin-root");ot&&("function"==typeof a.createRoot?a.createRoot(ot).render((0,t.createElement)(st,null)):a.render((0,t.createElement)(st,null),ot))})(); \ No newline at end of file diff --git a/plugins/quant/assets/src/components/FormStack/FormStack.jsx b/plugins/quant/assets/src/components/FormStack/FormStack.jsx new file mode 100644 index 0000000..7ec35c4 --- /dev/null +++ b/plugins/quant/assets/src/components/FormStack/FormStack.jsx @@ -0,0 +1,45 @@ +import { Flex } from '@wordpress/components'; + +/** + * Vertical stack of form controls with the block editor spacing. + * + * On current WordPress (7.x) the core controls have no bottom margin, so the + * parent sets the space between them (16px between fields, 12px between + * the rows of a group). + * + * @param {Object} props Component props. + * @param {number} props.gap Gap in 4px steps (default 4 = 16px). + * @param {string} props.className Extra class names. + * @param {*} props.children Controls. + */ +export function FormStack( { gap = 4, className = '', children } ) { + return ( + + { children } + + ); +} + +/** + * A labelled group of checkboxes or toggles, as a fieldset. + * + * @param {Object} props Component props. + * @param {string} props.label Group label, styled as a control label. + * @param {string} props.help Help text under the label. + * @param {*} props.children Rows. + */ +export function FieldGroup( { label, help, children } ) { + return ( +
+ { label } + { help &&

{ help }

} + { children } +
+ ); +} diff --git a/plugins/quant/assets/src/components/SearchPageEditor/SearchPageEditor.jsx b/plugins/quant/assets/src/components/SearchPageEditor/SearchPageEditor.jsx index 98d1856..f5209fa 100644 --- a/plugins/quant/assets/src/components/SearchPageEditor/SearchPageEditor.jsx +++ b/plugins/quant/assets/src/components/SearchPageEditor/SearchPageEditor.jsx @@ -10,6 +10,7 @@ import { FlexItem, } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; +import { FormStack, FieldGroup } from '../FormStack/FormStack'; const EMPTY_FACET = { facet_type: 'taxonomy', @@ -169,8 +170,8 @@ export function SearchPageEditor( { ); return ( -
-

+ +

{ page?.id ? __( 'Edit search page', 'quant' ) : __( 'New search page', 'quant' ) } @@ -181,6 +182,7 @@ export function SearchPageEditor( { value={ draft.label } onChange={ ( v ) => set( 'label', v ) } help={ __( 'Shown in the admin only.', 'quant' ) } + __nextHasNoMarginBottom /> set( 'title', v ) } + __nextHasNoMarginBottom /> set( 'description', v ) } rows={ 2 } + __nextHasNoMarginBottom /> -

- { __( 'Content types to search', 'quant' ) }{ ' ' } - - { __( '(none selected = all indexed types)', 'quant' ) } - -

- { postTypes.map( ( type ) => ( - - togglePostType( type.name, checked ) - } - /> - ) ) } + + { postTypes.map( ( type ) => ( + + togglePostType( type.name, checked ) + } + __nextHasNoMarginBottom + /> + ) ) } + -

{ __( 'Display', 'quant' ) }

- setDisplay( 'display_search', v ) } - /> - setDisplay( 'display_stats', v ) } - /> - setDisplay( 'show_clear_refinements', v ) } - /> - setDisplay( 'pagination_enabled', v ) } - /> + + setDisplay( 'display_search', v ) } + __nextHasNoMarginBottom + /> + setDisplay( 'display_stats', v ) } + __nextHasNoMarginBottom + /> + + setDisplay( 'show_clear_refinements', v ) + } + __nextHasNoMarginBottom + /> + setDisplay( 'pagination_enabled', v ) } + __nextHasNoMarginBottom + /> + setDisplay( 'per_page', parseInt( v, 10 ) || 10 ) } + __nextHasNoMarginBottom /> -

{ __( 'Facets', 'quant' ) }

- { draft.facets.map( ( facet, index ) => ( - setFacet( index, f ) } - onRemove={ () => removeFacet( index ) } - /> - ) ) } - + + { draft.facets.map( ( facet, index ) => ( + setFacet( index, f ) } + onRemove={ () => removeFacet( index ) } + /> + ) ) } +
+ +
+

+ ); } diff --git a/plugins/quant/assets/src/index.scss b/plugins/quant/assets/src/index.scss index 4a816f5..16aa39a 100644 --- a/plugins/quant/assets/src/index.scss +++ b/plugins/quant/assets/src/index.scss @@ -228,14 +228,44 @@ gap: 12px; align-items: end; padding: 12px; - margin-bottom: 12px; border: 1px solid #ddd; border-radius: 4px; background: #fafafa; + + // Line the Remove link up with the 40px inputs beside it. + > .components-button.is-link { + justify-self: start; + min-height: 40px; + } +} + +// A fieldset whose legend looks like a core control label. +.quant-field-group { + min-width: 0; + margin: 0; + padding: 0; + border: 0; + + &__label { + display: block; + margin: 0 0 8px; + padding: 0; + font-size: 11px; + font-weight: 500; + line-height: 1.4; + text-transform: uppercase; + } + + &__help { + margin: -4px 0 12px; + font-size: 12px; + line-height: 1.4; + color: #757575; + } } .quant-onboarding__oauth { - margin: 8px 0 24px; + margin: 0; padding-bottom: 16px; border-bottom: 1px solid #ddd; @@ -247,3 +277,23 @@ .quant-settings .components-base-control + .components-base-control { margin-top: 16px; } + +// Form layout. On current WordPress (7.x) the core controls have no bottom +// margin, so the parent stack sets the space between them (FormStack.jsx): 16px +// between fields, 12px between the rows of a group, 24px around a group. +.quant-form-stack { + + > p, + > h3, + > h4 { + margin: 0; + } + + > .quant-field-group { + margin-block: 8px; + } + + > .quant-form-stack__actions { + margin-top: 8px; + } +} diff --git a/plugins/quant/assets/src/pages/Onboarding.jsx b/plugins/quant/assets/src/pages/Onboarding.jsx index f37e4d5..6fbe94d 100644 --- a/plugins/quant/assets/src/pages/Onboarding.jsx +++ b/plugins/quant/assets/src/pages/Onboarding.jsx @@ -11,6 +11,7 @@ import { } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import apiFetch from '@wordpress/api-fetch'; +import { FormStack } from '../components/FormStack/FormStack'; import { useNavigate } from 'react-router-dom'; /** @@ -301,143 +302,155 @@ export function Onboarding() { - { error && ( - setError( null ) } - isDismissible - > - { error } - - ) } - - { - if ( v !== 'custom' ) { - updateSetting( 'endpoint', v ); - } - } } - help={ __( - 'Choose the dashboard you sign in to.', - 'quant' + + { error && ( + setError( null ) } + isDismissible + > + { error } + ) } - /> -
- -

+ { + if ( v !== 'custom' ) { + updateSetting( 'endpoint', v ); + } + } } + help={ __( + 'Choose the dashboard you sign in to.', + 'quant' + ) } + __nextHasNoMarginBottom + /> + +

+ +

+ { __( + 'Sign in and pick the project, or enter the project credentials below.', + 'quant' + ) } +

+
+ +

{ __( - 'Sign in and pick the project, or enter the project credentials below.', + 'Or enter the project credentials. You can find them in the', + 'quant' + ) }{ ' ' } + + { __( 'Quant dashboard', 'quant' ) } + { ' ' } + { __( + 'on the Integrations page of the project.', 'quant' ) }

-
-

- { __( - 'Or enter the project credentials. You can find them in the', - 'quant' - ) }{ ' ' } - + updateSetting( 'organization', v ) } - target="_blank" - rel="noopener noreferrer" - > - { __( 'Quant dashboard', 'quant' ) } - { ' ' } - { __( - 'on the Integrations page of the project.', - 'quant' - ) } -

- - - updateSetting( 'organization', v ) - } - help={ __( - 'Your QuantCDN organization identifier', - 'quant' - ) } - /> - - updateSetting( 'project', v ) - } - help={ __( - 'Your QuantCDN project name', - 'quant' - ) } - /> - - updateSetting( 'token', v ) - } - help={ __( 'Your project API token', 'quant' ) } - /> - - updateSetting( 'endpoint', v ) - } - help={ __( - 'https://api.quantcdn.io for QuantCDN, https://api.quantgov.cloud for QuantGov. Without /v1.', - 'quant' - ) } - /> - -
- -
+ + +
); diff --git a/plugins/quant/assets/src/pages/Search.jsx b/plugins/quant/assets/src/pages/Search.jsx index 7188cb8..3c4fefe 100644 --- a/plugins/quant/assets/src/pages/Search.jsx +++ b/plugins/quant/assets/src/pages/Search.jsx @@ -16,6 +16,7 @@ import { __, sprintf } from '@wordpress/i18n'; import apiFetch from '@wordpress/api-fetch'; import { SearchPageEditor } from '../components/SearchPageEditor/SearchPageEditor'; import { Progress } from '../components/Progress/Progress'; +import { FormStack, FieldGroup } from '../components/FormStack/FormStack'; import { REFRESH_DELAYS, indexMayStillChange } from './indexRefresh'; /** @@ -172,20 +173,22 @@ function PagesTable( { pages, onEdit, onDelete } ) { : __( 'Disabled', 'quant' ) } { page.facets.length } - - { ' ' } - + + + + + ) ) } @@ -460,148 +463,160 @@ export function Search() { - updateSetting( 'enabled', v ) } - help={ __( - 'Send a search record with every page push so the index follows your content.', - 'quant' - ) } - /> -

- - { __( 'Indexed content types', 'quant' ) } - -

- { config.post_types.map( ( type ) => ( - + - togglePostType( type.name, checked ) + checked={ !! settings.enabled } + onChange={ ( v ) => + updateSetting( 'enabled', v ) } + help={ __( + 'Send a search record with every page push so the index follows your content.', + 'quant' + ) } + __nextHasNoMarginBottom /> - ) ) } - - updateSetting( 'summary_source', v ) - } - /> - ( { label: s, value: s } ) - ) } - onChange={ ( v ) => - updateSetting( 'image_size', v ) - } - help={ __( - 'Featured image size stored in the record.', - 'quant' - ) } - /> - - updateSetting( 'replace_wp_search', v ) - } - help={ __( - 'The theme search form and ?s= searches use the default search page below, so search works on the static site.', - 'quant' - ) } - /> - { settings.replace_wp_search && ( + + { config.post_types.map( ( type ) => ( + + togglePostType( type.name, checked ) + } + __nextHasNoMarginBottom + /> + ) ) } + ( { - label: p.label, - value: p.id, - } ) ) + { + label: __( + 'First words of the content', + 'quant' + ), + value: 'content', + }, + ] } + onChange={ ( v ) => + updateSetting( 'summary_source', v ) + } + __nextHasNoMarginBottom + /> + ( { label: s, value: s } ) ) } onChange={ ( v ) => - updateSetting( 'default_page', v ) + updateSetting( 'image_size', v ) } + help={ __( + 'Featured image size stored in the record.', + 'quant' + ) } + __nextHasNoMarginBottom /> - ) } - - - - - - - - - - - + __nextHasNoMarginBottom + /> + ) } + + + + + + + + + + + +
) } From fe90506204860aa47815adce80fc9bbc383e2ec5 Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Sun, 15 Nov 2026 12:10:17 +1000 Subject: [PATCH 2/3] feat(search): a cleaner default search page that themes can restyle The default stylesheet keeps the theme's fonts and text colour and adds: - one spacing scale; the checkbox and the count badge have a gap from the label, and counts are quiet right-aligned badges - facet headings as small capitals with a rule; empty facets are hidden - the result title larger than the summary; tags as quiet pills - "Clear refinements" as an outline button in the text colour (the InstantSearch theme drew white text on pale blue, below WCAG AA) - a visible focus outline on every link, button and field - facets above the results, side by side, in a container narrower than 37.5rem (phones, narrow columns) - the InstantSearch widgets no longer force navy text or icons - a styled no-JavaScript form; no empty facet column or single-page pagination Every value is a --quant-search-* custom property. The defaults sit in :where(.quant-search), so a theme rule on .quant-search always wins. Class names and markup are unchanged. Tests cover the defaults, the widget colour, the button, the focus outline and that the readme documents every property. --- .../quant/assets/build/autocomplete-rtl.css | 2 +- .../quant/assets/build/autocomplete.asset.php | 2 +- plugins/quant/assets/build/autocomplete.css | 2 +- plugins/quant/assets/build/search-rtl.css | 2 +- plugins/quant/assets/build/search.asset.php | 2 +- plugins/quant/assets/build/search.css | 2 +- plugins/quant/assets/src/frontend/search.scss | 495 ++++++++++++++++-- .../quant/tests/Search/SearchStylesTest.php | 55 ++ 8 files changed, 522 insertions(+), 40 deletions(-) diff --git a/plugins/quant/assets/build/autocomplete-rtl.css b/plugins/quant/assets/build/autocomplete-rtl.css index 9553423..2f92f00 100644 --- a/plugins/quant/assets/build/autocomplete-rtl.css +++ b/plugins/quant/assets/build/autocomplete-rtl.css @@ -1,2 +1,2 @@ :root{--aa-search-input-height:44px;--aa-input-icon-size:20px;--aa-base-unit:16;--aa-spacing-factor:1;--aa-spacing:calc(var(--aa-base-unit)*var(--aa-spacing-factor)*1px);--aa-spacing-half:calc(var(--aa-spacing)/2);--aa-panel-max-height:650px;--aa-base-z-index:9999;--aa-font-size:calc(var(--aa-base-unit)*1px);--aa-font-family:inherit;--aa-font-weight-medium:500;--aa-font-weight-semibold:600;--aa-font-weight-bold:700;--aa-icon-size:20px;--aa-icon-stroke-width:1.6;--aa-icon-color-rgb:119,119,163;--aa-icon-color-alpha:1;--aa-action-icon-size:20px;--aa-text-color-rgb:38,38,39;--aa-text-color-alpha:1;--aa-primary-color-rgb:62,52,211;--aa-primary-color-alpha:0.2;--aa-muted-color-rgb:128,126,163;--aa-muted-color-alpha:0.6;--aa-panel-border-color-rgb:128,126,163;--aa-panel-border-color-alpha:0.3;--aa-input-border-color-rgb:128,126,163;--aa-input-border-color-alpha:0.8;--aa-background-color-rgb:255,255,255;--aa-background-color-alpha:1;--aa-input-background-color-rgb:255,255,255;--aa-input-background-color-alpha:1;--aa-selected-color-rgb:179,173,214;--aa-selected-color-alpha:0.205;--aa-description-highlight-background-color-rgb:245,223,77;--aa-description-highlight-background-color-alpha:0.5;--aa-detached-media-query:(max-width:680px);--aa-detached-modal-media-query:(min-width:680px);--aa-detached-modal-max-width:680px;--aa-detached-modal-max-height:500px;--aa-overlay-color-rgb:115,114,129;--aa-overlay-color-alpha:0.4;--aa-panel-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);--aa-scrollbar-width:13px;--aa-scrollbar-track-background-color-rgb:234,234,234;--aa-scrollbar-track-background-color-alpha:1;--aa-scrollbar-thumb-background-color-rgb:var(--aa-background-color-rgb);--aa-scrollbar-thumb-background-color-alpha:1}@media (hover:none) and (pointer:coarse){:root{--aa-spacing-factor:1.2;--aa-action-icon-size:22px}}body.dark,body[data-theme=dark]{--aa-text-color-rgb:183,192,199;--aa-primary-color-rgb:146,138,255;--aa-muted-color-rgb:146,138,255;--aa-input-background-color-rgb:0,3,9;--aa-background-color-rgb:21,24,42;--aa-selected-color-rgb:146,138,255;--aa-selected-color-alpha:0.25;--aa-description-highlight-background-color-rgb:0 255 255;--aa-description-highlight-background-color-alpha:0.25;--aa-icon-color-rgb:119,119,163;--aa-panel-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--aa-scrollbar-track-background-color-rgb:44,46,64;--aa-scrollbar-thumb-background-color-rgb:var(--aa-background-color-rgb)}.aa-Autocomplete *,.aa-DetachedFormContainer *,.aa-Panel *{box-sizing:border-box}.aa-Autocomplete,.aa-DetachedFormContainer,.aa-Panel{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-family:inherit;font-family:var(--aa-font-family);font-size:16px;font-size:var(--aa-font-size);font-weight:400;line-height:1em;margin:0;padding:0;text-align:right}.aa-Form{align-items:center;background-color:#fff;background-color:rgba(var(--aa-input-background-color-rgb),var(--aa-input-background-color-alpha));border:1px solid rgba(128,126,163,.8);border:1px solid rgba(var(--aa-input-border-color-rgb),var(--aa-input-border-color-alpha));border-radius:3px;display:flex;line-height:1em;margin:0;position:relative;width:100%}.aa-Form:focus-within{border-color:#3e34d3;border-color:rgba(var(--aa-primary-color-rgb),1);box-shadow:0 0 0 2px rgba(62,52,211,.2),inset 0 0 0 2px rgba(62,52,211,.2);box-shadow:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px,inset rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px;outline:medium none currentColor}.aa-InputWrapperPrefix{align-items:center;display:flex;flex-shrink:0;height:44px;height:var(--aa-search-input-height);order:1}.aa-Label,.aa-LoadingIndicator{cursor:auto;flex-shrink:0;height:100%;padding:0;text-align:right}.aa-Label svg,.aa-LoadingIndicator svg{color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);height:auto;max-height:20px;max-height:var(--aa-input-icon-size);stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-input-icon-size)}.aa-LoadingIndicator,.aa-SubmitButton{height:100%;padding-right:11px;padding-right:calc(var(--aa-spacing)*.75 - 1px);padding-left:8px;padding-left:var(--aa-spacing-half);width:47px;width:calc(var(--aa-spacing)*1.75 + var(--aa-icon-size) - 1px)}@media (hover:none) and (pointer:coarse){.aa-LoadingIndicator,.aa-SubmitButton{padding-right:3px;padding-right:calc(var(--aa-spacing-half)/2 - 1px);width:39px;width:calc(var(--aa-icon-size) + var(--aa-spacing)*1.25 - 1px)}}.aa-SubmitButton{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;margin:0}.aa-LoadingIndicator{align-items:center;display:flex;justify-content:center}.aa-LoadingIndicator[hidden]{display:none}.aa-InputWrapper{order:3;position:relative;width:100%}.aa-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font:inherit;height:44px;height:var(--aa-search-input-height);padding:0;width:100%}.aa-Input::-moz-placeholder{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));opacity:1}.aa-Input::placeholder{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));opacity:1}.aa-Input:focus{border-color:none;box-shadow:none;outline:none}.aa-Input::-webkit-search-cancel-button,.aa-Input::-webkit-search-decoration,.aa-Input::-webkit-search-results-button,.aa-Input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.aa-InputWrapperSuffix{align-items:center;display:flex;height:44px;height:var(--aa-search-input-height);order:4}.aa-ClearButton{align-items:center;background:none;border:0;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;height:100%;margin:0;padding:0 12.83328px;padding:0 calc(var(--aa-spacing)*.83333 - .5px)}@media (hover:none) and (pointer:coarse){.aa-ClearButton{padding:0 10.16672px;padding:0 calc(var(--aa-spacing)*.66667 - .5px)}}.aa-ClearButton:focus,.aa-ClearButton:hover{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha))}.aa-ClearButton[hidden]{display:none}.aa-ClearButton svg{stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-icon-size)}.aa-Panel{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:4px;border-radius:calc(var(--aa-spacing)/4);box-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);box-shadow:var(--aa-panel-shadow);margin:8px 0 0;overflow:hidden;position:absolute;transition:opacity .2s ease-in,filter .2s ease-in}@media screen and (prefers-reduced-motion){.aa-Panel{transition:none}}.aa-Panel button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;margin:0;padding:0}.aa-PanelLayout{height:100%;margin:0;max-height:650px;max-height:var(--aa-panel-max-height);overflow-y:auto;padding:0;position:relative;text-align:right}.aa-PanelLayoutColumns--twoGolden{display:grid;grid-template-columns:39.2% auto;overflow:hidden;padding:0}.aa-PanelLayoutColumns--two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:hidden;padding:0}.aa-PanelLayoutColumns--three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:hidden;padding:0}.aa-Panel--stalled .aa-Source{filter:grayscale(1);opacity:.8}.aa-Panel--scrollable{margin:0;max-height:650px;max-height:var(--aa-panel-max-height);overflow-x:hidden;overflow-y:auto;padding:8px;padding:var(--aa-spacing-half);scrollbar-color:#fff #eaeaea;scrollbar-color:rgba(var(--aa-scrollbar-thumb-background-color-rgb),var(--aa-scrollbar-thumb-background-color-alpha)) rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha));scrollbar-width:thin}.aa-Panel--scrollable::-webkit-scrollbar{width:13px;width:var(--aa-scrollbar-width)}.aa-Panel--scrollable::-webkit-scrollbar-track{background-color:#eaeaea;background-color:rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha))}.aa-Panel--scrollable::-webkit-scrollbar-thumb{background-color:#fff;background-color:rgba(var(--aa-scrollbar-thumb-background-color-rgb),var(--aa-scrollbar-thumb-background-color-alpha));border:3px solid #eaeaea;border:3px solid rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha));border-radius:9999px;border-left-width:2px}.aa-Source{margin:0;padding:0;position:relative;width:100%}.aa-Source:empty{display:none}.aa-SourceNoResults{font-size:1em;margin:0;padding:16px;padding:var(--aa-spacing)}.aa-List{list-style:none;margin:0}.aa-List,.aa-SourceHeader{padding:0;position:relative}.aa-SourceHeader{margin:8px 0 8px .5em;margin:var(--aa-spacing-half) 0 var(--aa-spacing-half) .5em}.aa-SourceHeader:empty{display:none}.aa-SourceHeaderTitle{background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);display:inline-block;font-size:.8em;font-weight:600;font-weight:var(--aa-font-weight-semibold);margin:0;padding:0 0 0 8px;padding:0 0 0 var(--aa-spacing-half);position:relative;z-index:9999;z-index:var(--aa-base-z-index)}.aa-SourceHeaderLine{border-bottom:1px solid #3e34d3;border-bottom:1px solid rgba(var(--aa-primary-color-rgb),1);display:block;height:2px;right:0;margin:0;opacity:.3;padding:0;position:absolute;left:0;top:8px;top:var(--aa-spacing-half);z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-SourceFooterSeeAll{background:linear-gradient(-180deg,#fff,rgba(128,126,163,.14));background:linear-gradient(-180deg,rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha)),rgba(128,126,163,.14));border:1px solid rgba(128,126,163,.6);border:1px solid rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));border-radius:5px;box-shadow:inset 0 0 2px #fff,0 2px 2px -1px rgba(76,69,88,.15);color:inherit;font-size:.95em;font-weight:500;font-weight:var(--aa-font-weight-medium);padding:.475em 1em .6em;-webkit-text-decoration:none;text-decoration:none}.aa-SourceFooterSeeAll:focus,.aa-SourceFooterSeeAll:hover{border:1px solid #3e34d3;border:1px solid rgba(var(--aa-primary-color-rgb),1);color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1)}.aa-Item{align-items:center;border-radius:3px;cursor:pointer;display:grid;min-height:40px;min-height:calc(var(--aa-spacing)*2.5);padding:4px;padding:calc(var(--aa-spacing-half)/2)}.aa-Item[aria-selected=true]{background-color:rgba(179,173,214,.205);background-color:rgba(var(--aa-selected-color-rgb),var(--aa-selected-color-alpha))}.aa-Item[aria-selected=true] .aa-ActiveOnly,.aa-Item[aria-selected=true] .aa-ItemActionButton{visibility:visible}.aa-ItemIcon{align-items:center;background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:3px;box-shadow:inset 0 0 0 1px rgba(128,126,163,.3);box-shadow:inset 0 0 0 1px rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));color:#7777a3;color:rgba(var(--aa-icon-color-rgb),var(--aa-icon-color-alpha));display:flex;flex-shrink:0;font-size:.7em;height:28px;height:calc(var(--aa-icon-size) + var(--aa-spacing-half));justify-content:center;overflow:hidden;stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);text-align:center;width:28px;width:calc(var(--aa-icon-size) + var(--aa-spacing-half))}.aa-ItemIcon img{height:auto;max-height:20px;max-height:calc(var(--aa-icon-size) + var(--aa-spacing-half) - 8px);max-width:20px;max-width:calc(var(--aa-icon-size) + var(--aa-spacing-half) - 8px);width:auto}.aa-ItemIcon svg{height:20px;height:var(--aa-icon-size);width:20px;width:var(--aa-icon-size)}.aa-ItemIcon--alignTop{align-self:flex-start}.aa-ItemIcon--noBorder{background:none;box-shadow:none}.aa-ItemIcon--picture{height:96px;width:96px}.aa-ItemIcon--picture img{max-height:100%;max-width:100%;padding:8px;padding:var(--aa-spacing-half)}.aa-ItemContent{align-items:center;cursor:pointer;display:grid;gap:8px;grid-gap:8px;grid-gap:var(--aa-spacing-half);gap:var(--aa-spacing-half);grid-auto-flow:column;line-height:1.25em;overflow:hidden}.aa-ItemContent:empty{display:none}.aa-ItemContent mark{background:none;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-style:normal;font-weight:700;font-weight:var(--aa-font-weight-bold)}.aa-ItemContent--dual{display:flex;flex-direction:column;justify-content:space-between;text-align:right}.aa-ItemContent--dual .aa-ItemContentSubtitle,.aa-ItemContent--dual .aa-ItemContentTitle{display:block}.aa-ItemContent--indented{padding-right:36px;padding-right:calc(var(--aa-icon-size) + var(--aa-spacing))}.aa-ItemContentBody{display:grid;gap:4px;grid-gap:4px;grid-gap:calc(var(--aa-spacing-half)/2);gap:calc(var(--aa-spacing-half)/2)}.aa-ItemContentTitle{display:inline-block;margin:0 0 0 .5em;max-width:100%;overflow:hidden;padding:0;text-overflow:ellipsis;white-space:nowrap}.aa-ItemContentSubtitle{font-size:.92em}.aa-ItemContentSubtitleIcon:before{border-color:rgba(128,126,163,.64);border-color:rgba(var(--aa-muted-color-rgb),.64);border-style:solid;content:"";display:inline-block;right:1px;position:relative;top:-3px}.aa-ItemContentSubtitle--inline .aa-ItemContentSubtitleIcon:before{border-width:0 0 1.5px;margin-right:8px;margin-right:var(--aa-spacing-half);margin-left:4px;margin-left:calc(var(--aa-spacing-half)/2);width:10px;width:calc(var(--aa-spacing-half) + 2px)}.aa-ItemContentSubtitle--standalone{align-items:center;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));display:grid;gap:8px;grid-gap:8px;grid-gap:var(--aa-spacing-half);gap:var(--aa-spacing-half);grid-auto-flow:column;justify-content:start}.aa-ItemContentSubtitle--standalone .aa-ItemContentSubtitleIcon:before{border-radius:0 0 3px 0;border-width:0 1.5px 1.5px 0;height:8px;height:var(--aa-spacing-half);width:8px;width:var(--aa-spacing-half)}.aa-ItemContentSubtitleCategory{color:#807ea3;color:rgba(var(--aa-muted-color-rgb),1);font-weight:500}.aa-ItemContentDescription{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-size:.85em;max-width:100%;overflow-x:hidden;text-overflow:ellipsis}.aa-ItemContentDescription:empty{display:none}.aa-ItemContentDescription mark{background:rgba(245,223,77,.5);background:rgba(var(--aa-description-highlight-background-color-rgb),var(--aa-description-highlight-background-color-alpha));color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-style:normal;font-weight:500;font-weight:var(--aa-font-weight-medium)}.aa-ItemContentDash{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));display:none;opacity:.4}.aa-ItemContentTag{background-color:rgba(62,52,211,.2);background-color:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha));border-radius:3px;margin:0 0 0 .4em;padding:.08em .3em}.aa-ItemLink,.aa-ItemWrapper{align-items:center;color:inherit;display:grid;gap:4px;grid-gap:4px;grid-gap:calc(var(--aa-spacing-half)/2);gap:calc(var(--aa-spacing-half)/2);grid-auto-flow:column;justify-content:space-between;width:100%}.aa-ItemLink{color:inherit;-webkit-text-decoration:none;text-decoration:none}.aa-ItemActions{display:grid;grid-auto-flow:column;height:100%;justify-self:end;margin:0 -5.33333px;margin:0 calc(var(--aa-spacing)/-3);padding:0 0 0 2px}.aa-ItemActionButton{align-items:center;background:none;border:0;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;flex-shrink:0;padding:0}.aa-ItemActionButton:focus svg,.aa-ItemActionButton:hover svg{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha))}@media (hover:none) and (pointer:coarse){.aa-ItemActionButton:focus svg,.aa-ItemActionButton:hover svg{color:inherit}}.aa-ItemActionButton svg{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));margin:5.33333px;margin:calc(var(--aa-spacing)/3);stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-action-icon-size)}.aa-ActiveOnly{visibility:hidden}.aa-PanelHeader{align-items:center;background:#3e34d3;background:rgba(var(--aa-primary-color-rgb),1);color:#fff;display:grid;height:var(--aa-modal-header-height);margin:0;padding:8px 16px;padding:var(--aa-spacing-half) var(--aa-spacing);position:relative}.aa-PanelHeader:after{background-image:linear-gradient(#fff,hsla(0,0%,100%,0));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),1),rgba(var(--aa-background-color-rgb),0));bottom:-8px;bottom:calc(var(--aa-spacing-half)*-1);content:"";height:8px;height:var(--aa-spacing-half);right:0;pointer-events:none;position:absolute;left:0}.aa-PanelFooter,.aa-PanelHeader:after{z-index:9999;z-index:var(--aa-base-z-index)}.aa-PanelFooter{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));box-shadow:inset 0 1px 0 rgba(128,126,163,.3);box-shadow:inset 0 1px 0 rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));display:flex;justify-content:space-between;margin:0;padding:16px;padding:var(--aa-spacing);position:relative}.aa-PanelFooter:after{background-image:linear-gradient(hsla(0,0%,100%,0),rgba(128,126,163,.6));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),0),rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha)));content:"";height:16px;height:var(--aa-spacing);right:0;opacity:.12;pointer-events:none;position:absolute;left:0;top:-16px;top:calc(var(--aa-spacing)*-1);z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-DetachedContainer{background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));bottom:0;box-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);box-shadow:var(--aa-panel-shadow);display:flex;flex-direction:column;right:0;margin:0;overflow:hidden;padding:0;position:fixed;left:0;top:0;z-index:9999;z-index:var(--aa-base-z-index)}.aa-DetachedContainer:after{height:32px}.aa-DetachedContainer .aa-SourceHeader{margin:8px 2px 8px 0;margin:var(--aa-spacing-half) 2px var(--aa-spacing-half) 0}.aa-DetachedContainer .aa-Panel{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:0;box-shadow:none;flex-grow:1;margin:0;padding:0;position:relative}.aa-DetachedContainer .aa-PanelLayout{bottom:0;box-shadow:none;right:0;margin:0;max-height:none;overflow-y:auto;position:absolute;left:0;top:0;width:100%}.aa-DetachedFormContainer{border-bottom:1px solid rgba(128,126,163,.3);border-bottom:1px solid rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));display:flex;flex-direction:row;justify-content:space-between;margin:0;padding:8px;padding:var(--aa-spacing-half)}.aa-DetachedCancelButton{background:none;border:0;border-radius:3px;color:inherit;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));cursor:pointer;font:inherit;margin:0 8px 0 0;margin:0 var(--aa-spacing-half) 0 0;padding:0 8px;padding:0 var(--aa-spacing-half)}.aa-DetachedCancelButton:focus,.aa-DetachedCancelButton:hover{box-shadow:inset 0 0 0 1px rgba(128,126,163,.3);box-shadow:inset 0 0 0 1px rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha))}.aa-DetachedContainer--modal{border-radius:6px;bottom:inherit;height:auto;margin:0 auto;max-width:680px;max-width:var(--aa-detached-modal-max-width);position:absolute;top:3%}.aa-DetachedContainer--modal .aa-PanelLayout{max-height:500px;max-height:var(--aa-detached-modal-max-height);padding-bottom:8px;padding-bottom:var(--aa-spacing-half);position:static}.aa-DetachedContainer--modal .aa-PanelLayout:empty{display:none}.aa-DetachedSearchButton{align-items:center;background-color:#fff;background-color:rgba(var(--aa-input-background-color-rgb),var(--aa-input-background-color-alpha));border:1px solid rgba(128,126,163,.8);border:1px solid rgba(var(--aa-input-border-color-rgb),var(--aa-input-border-color-alpha));border-radius:3px;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;font:inherit;font-family:inherit;font-family:var(--aa-font-family);font-size:16px;font-size:var(--aa-font-size);height:44px;height:var(--aa-search-input-height);margin:0;padding:0 5.5px;padding:0 calc(var(--aa-search-input-height)/8);position:relative;text-align:right;width:100%}.aa-DetachedSearchButton:focus{border-color:#3e34d3;border-color:rgba(var(--aa-primary-color-rgb),1);box-shadow:0 0 0 3px rgba(62,52,211,.2),inset 0 0 0 2px rgba(62,52,211,.2);box-shadow:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 3px,inset rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px;outline:medium none currentColor}.aa-DetachedSearchButtonIcon{align-items:center;color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);cursor:auto;display:flex;flex-shrink:0;height:100%;justify-content:center;width:36px;width:calc(var(--aa-icon-size) + var(--aa-spacing))}.aa-DetachedSearchButtonQuery{color:#262627;color:rgba(var(--aa-text-color-rgb),1);line-height:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aa-DetachedSearchButtonPlaceholder[hidden]{display:none}.aa-Detached{height:100vh;overflow:hidden}.aa-DetachedOverlay{background-color:hsla(244,6%,48%,.4);background-color:rgba(var(--aa-overlay-color-rgb),var(--aa-overlay-color-alpha));height:100vh;right:0;margin:0;padding:0;position:fixed;left:0;top:0;z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-GradientBottom,.aa-GradientTop{height:8px;height:var(--aa-spacing-half);right:0;pointer-events:none;position:absolute;left:0;z-index:9999;z-index:var(--aa-base-z-index)}.aa-GradientTop{background-image:linear-gradient(#fff,hsla(0,0%,100%,0));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),1),rgba(var(--aa-background-color-rgb),0));top:0}.aa-GradientBottom{background-image:linear-gradient(hsla(0,0%,100%,0),#fff);background-image:linear-gradient(rgba(var(--aa-background-color-rgb),0),rgba(var(--aa-background-color-rgb),1));border-bottom-right-radius:4px;border-bottom-right-radius:calc(var(--aa-spacing)/4);border-bottom-left-radius:4px;border-bottom-left-radius:calc(var(--aa-spacing)/4);bottom:0}@media (hover:none) and (pointer:coarse){.aa-DesktopOnly{display:none}}@media (hover:hover){.aa-TouchOnly{display:none}} -.quant-search{display:flex;flex-wrap:wrap;gap:2rem}.quant-search__description{flex-basis:100%;margin:0 0 .5rem}.quant-search__facets{flex:0 0 240px;max-width:100%}.quant-search__facet{margin-bottom:1.5rem}.quant-search__facet-heading{font-weight:600;margin-bottom:.5rem}.quant-search__content{flex:1 1 320px;min-width:0}.quant-search__stats{font-size:.9em;margin:.75rem 0;opacity:.8}.quant-search .ais-Hits-list{display:block;margin:0}.quant-search .ais-Hits-item{border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid rgba(0,0,0,.1)}.quant-search__hit{display:flow-root;padding:1rem 0}.quant-search__hit a{text-decoration:none}.quant-search__hit img{float:left;height:auto;margin:0 1rem .5rem 0;max-width:120px}.quant-search__hit-title{font-size:1.1em;margin:0 0 .25rem}.quant-search__hit-summary{margin:0;opacity:.85}.quant-search__hit-tag{background:rgba(0,0,0,.06);border-radius:999px;display:inline-block;font-size:.8em;margin:.25rem 0 0 .25rem;padding:.1rem .5rem}.quant-search__empty{opacity:.8;padding:2rem 0;text-align:center}.quant-search--unavailable{border:1px dashed rgba(0,0,0,.3);padding:1rem}.quant-search .ais-Pagination{margin-top:1.5rem}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} +:where(.quant-search){--quant-search-gap:1rem;--quant-search-gap-xs:calc(var(--quant-search-gap)*0.25);--quant-search-gap-sm:calc(var(--quant-search-gap)*0.5);--quant-search-gap-md:calc(var(--quant-search-gap)*0.75);--quant-search-gap-lg:calc(var(--quant-search-gap)*1.5);--quant-search-gap-xl:calc(var(--quant-search-gap)*2.5);--quant-search-facets-width:14rem;--quant-search-content-min-width:20rem;--quant-search-hit-image-width:7.5rem;--quant-search-radius:0.375rem;--quant-search-accent:var(--wp--preset--color--contrast,currentcolor);--quant-search-muted:color-mix(in srgb,currentcolor 75%,transparent);--quant-search-border:color-mix(in srgb,currentcolor 18%,transparent);--quant-search-border-strong:color-mix(in srgb,currentcolor 45%,transparent);--quant-search-surface:color-mix(in srgb,currentcolor 6%,transparent);--quant-search-surface-hover:color-mix(in srgb,currentcolor 10%,transparent);--quant-search-input-background:transparent;--quant-search-highlight:rgba(255,210,70,.45);--quant-search-focus-ring:var(--quant-search-accent);--quant-search-focus-width:2px;--quant-search-disabled-opacity:0.55;--quant-search-font-size-small:0.875em;--quant-search-font-size-xsmall:0.8125em;--quant-search-facet-heading-size:0.75em;--quant-search-hit-title-size:1.25em;--quant-search-hit-summary-size:0.9375em}.quant-search{align-items:flex-start;container:quant-search/inline-size;display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xl)}.quant-search .ais-ClearRefinements,.quant-search .ais-Hits,.quant-search .ais-Menu,.quant-search .ais-MenuSelect,.quant-search .ais-Pagination,.quant-search .ais-RefinementList,.quant-search .ais-SearchBox,.quant-search .ais-Stats{color:inherit}.quant-search :where(a,button,input,select,[tabindex]):focus-visible{outline:var(--quant-search-focus-width) solid var(--quant-search-focus-ring);outline-offset:2px}.quant-search__description{flex-basis:100%;margin:0}.quant-search__facets{display:flex;flex:0 0 var(--quant-search-facets-width);flex-direction:column;gap:var(--quant-search-gap-lg);max-width:100%}.quant-search__facet{margin:0}.quant-search__facet:has(.ais-Menu--noRefinement),.quant-search__facet:has(.ais-MenuSelect--noRefinement),.quant-search__facet:has(.ais-RefinementList--noRefinement),.quant-search__facet:has(>div:empty){display:none}.quant-search__facets:not(:has(.ais-RefinementList,.ais-Menu,.ais-MenuSelect)){display:none}.quant-search__pagination:has(.ais-Pagination--noRefinement){display:none}.quant-search__facet-heading{border-bottom:1px solid var(--quant-search-border);font-size:var(--quant-search-facet-heading-size);font-weight:600;letter-spacing:.06em;line-height:1.4;margin:0 0 var(--quant-search-gap-sm);padding-bottom:var(--quant-search-gap-xs);text-transform:uppercase}.quant-search__content{display:flex;flex:1 1 var(--quant-search-content-min-width);flex-direction:column;gap:var(--quant-search-gap);min-width:0}.quant-search__stats{color:var(--quant-search-muted);font-size:var(--quant-search-font-size-small);margin:0}.quant-search .ais-SearchBox-form{background:none;height:auto}.quant-search .ais-SearchBox-input{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) 2.5rem var(--quant-search-gap-sm) 2.75rem;width:100%}.quant-search .ais-SearchBox-input:focus{border-color:var(--quant-search-accent);box-shadow:none}.quant-search .ais-SearchBox-input::-moz-placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-input::placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset,.quant-search .ais-SearchBox-submit{border-radius:var(--quant-search-radius);color:inherit;height:1.75rem;width:1.75rem}.quant-search .ais-SearchBox-submit{right:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset{left:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-resetIcon path,.quant-search .ais-SearchBox-submitIcon path{fill:currentcolor}.quant-search__fallback{display:flex;gap:var(--quant-search-gap-sm)}.quant-search__fallback label{flex:1;min-width:0}.quant-search__fallback button,.quant-search__fallback input[type=search]{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) var(--quant-search-gap-md)}.quant-search__fallback input[type=search]{width:100%}.quant-search__fallback button{background:transparent;cursor:pointer}.quant-search .ais-ClearRefinements-button{align-items:center;background:transparent;border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);color:inherit;cursor:pointer;display:inline-flex;font:inherit;font-size:var(--quant-search-font-size-small);font-weight:500;line-height:1.2;min-height:2.25rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-md)}.quant-search .ais-ClearRefinements-button--disabled,.quant-search .ais-ClearRefinements-button:disabled{background:transparent;color:inherit;cursor:not-allowed;opacity:var(--quant-search-disabled-opacity)}.quant-search .ais-ClearRefinements-button:hover:not(:disabled){background:var(--quant-search-surface-hover)}.quant-search .ais-Menu-list,.quant-search .ais-RefinementList-list{display:flex;flex-direction:column;gap:var(--quant-search-gap-xs);list-style:none;margin:0;padding:0}.quant-search .ais-Menu-item,.quant-search .ais-RefinementList-item{margin:0;padding:0}.quant-search .ais-Menu-link,.quant-search .ais-RefinementList-label{align-items:center;color:inherit;cursor:pointer;display:flex;gap:var(--quant-search-gap-sm);line-height:1.3;min-height:1.75rem;text-decoration:none}.quant-search .ais-RefinementList-checkbox{accent-color:var(--quant-search-accent);cursor:pointer;flex:none;height:1.0625rem;margin:0;width:1.0625rem}.quant-search .ais-Menu-label,.quant-search .ais-RefinementList-labelText{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.quant-search .ais-Menu-item--selected .ais-Menu-label,.quant-search .ais-RefinementList-item--selected .ais-RefinementList-labelText{font-weight:600}.quant-search .ais-Menu-count,.quant-search .ais-RefinementList-count{background:var(--quant-search-surface);border:0;border-radius:999px;color:var(--quant-search-muted);flex:none;font-size:var(--quant-search-font-size-xsmall);font-variant-numeric:tabular-nums;line-height:1.6;margin:0 auto 0 0;padding:0 var(--quant-search-gap-sm)}.quant-search .ais-MenuSelect-select{background-color:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.5rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-sm);width:100%}.quant-search .ais-Menu-showMore,.quant-search .ais-RefinementList-showMore{background:none;border:0;color:inherit;cursor:pointer;font:inherit;font-size:var(--quant-search-font-size-small);margin-top:var(--quant-search-gap-sm);padding:0;text-decoration:underline}.quant-search .ais-Hits-list{display:block;list-style:none;margin:0;padding:0}.quant-search .ais-Hits-item{background:none;border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid var(--quant-search-border)}.quant-search__hit-title{font-size:var(--quant-search-hit-title-size);font-weight:600;line-height:1.3;margin:0 0 var(--quant-search-gap-xs)}.quant-search__hit-summary{color:var(--quant-search-muted);font-size:var(--quant-search-hit-summary-size);line-height:1.55;margin:0}.quant-search__hit-tag{background:var(--quant-search-surface);border:1px solid var(--quant-search-border);border-radius:999px;color:var(--quant-search-muted);display:inline-block;font-size:var(--quant-search-font-size-xsmall);line-height:1.5;margin:0;padding:.125em var(--quant-search-gap-sm)}.quant-search__hit{display:flow-root;padding:var(--quant-search-gap-lg) 0}.quant-search__hit a{color:inherit;text-decoration:none}.quant-search__hit a:focus-visible .quant-search__hit-title,.quant-search__hit a:hover .quant-search__hit-title{text-decoration:underline;text-underline-offset:.15em}.quant-search__hit img{aspect-ratio:4/3;border-radius:var(--quant-search-radius);float:left;height:auto;margin:0 var(--quant-search-gap) var(--quant-search-gap-sm) 0;max-width:35%;-o-object-fit:cover;object-fit:cover;width:var(--quant-search-hit-image-width)}.quant-search__hit>div:has(.quant-search__hit-tag){display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);margin-top:var(--quant-search-gap-md)}.quant-search .ais-Hits-item:first-child .quant-search__hit{padding-top:var(--quant-search-gap-sm)}.quant-search .ais-Highlight-highlighted,.quant-search .ais-Snippet-highlighted{background:var(--quant-search-highlight);border-radius:.15em;color:inherit}.quant-search__empty{color:var(--quant-search-muted);padding:var(--quant-search-gap-xl) 0;text-align:center}.quant-search__empty h4{color:inherit;margin:0 0 var(--quant-search-gap-sm)}.quant-search__empty p{margin:0}.quant-search--unavailable{border:1px dashed var(--quant-search-border-strong);border-radius:var(--quant-search-radius);padding:var(--quant-search-gap)}.quant-search--unavailable p{margin:0}.quant-search .ais-Pagination{margin-top:var(--quant-search-gap)}.quant-search .ais-Pagination-list{display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);justify-content:center;list-style:none;margin:0;padding:0}.quant-search .ais-Pagination-item{margin:0}.quant-search .ais-Pagination-link{align-items:center;background:transparent;border:1px solid var(--quant-search-border);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;display:inline-flex;font-variant-numeric:tabular-nums;height:2.5rem;justify-content:center;line-height:1;min-width:2.5rem;padding:0 var(--quant-search-gap-sm);text-decoration:none}.quant-search .ais-Pagination-link:hover{background:var(--quant-search-surface-hover)}.quant-search .ais-Pagination-item--selected .ais-Pagination-link{background:transparent;border:2px solid var(--quant-search-accent);color:inherit;font-weight:600}.quant-search .ais-Pagination-item--disabled .ais-Pagination-link{background:transparent;color:inherit;opacity:var(--quant-search-disabled-opacity)}@container quant-search (max-width: 37.5rem){.quant-search__facets{display:grid;flex-basis:100%;gap:var(--quant-search-gap) var(--quant-search-gap-lg);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}.quant-search__clear{grid-column:1/-1}.quant-search__content{flex-basis:100%}.quant-search__hit img{width:calc(var(--quant-search-hit-image-width)*.7)}}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} diff --git a/plugins/quant/assets/build/autocomplete.asset.php b/plugins/quant/assets/build/autocomplete.asset.php index 323a259..ddd9929 100644 --- a/plugins/quant/assets/build/autocomplete.asset.php +++ b/plugins/quant/assets/build/autocomplete.asset.php @@ -1 +1 @@ - array(), 'version' => '78c736a0f72c30f24abe'); + array(), 'version' => 'bceeaea64d10ecabf1a4'); diff --git a/plugins/quant/assets/build/autocomplete.css b/plugins/quant/assets/build/autocomplete.css index 121b9a6..f4a07fd 100644 --- a/plugins/quant/assets/build/autocomplete.css +++ b/plugins/quant/assets/build/autocomplete.css @@ -1,2 +1,2 @@ :root{--aa-search-input-height:44px;--aa-input-icon-size:20px;--aa-base-unit:16;--aa-spacing-factor:1;--aa-spacing:calc(var(--aa-base-unit)*var(--aa-spacing-factor)*1px);--aa-spacing-half:calc(var(--aa-spacing)/2);--aa-panel-max-height:650px;--aa-base-z-index:9999;--aa-font-size:calc(var(--aa-base-unit)*1px);--aa-font-family:inherit;--aa-font-weight-medium:500;--aa-font-weight-semibold:600;--aa-font-weight-bold:700;--aa-icon-size:20px;--aa-icon-stroke-width:1.6;--aa-icon-color-rgb:119,119,163;--aa-icon-color-alpha:1;--aa-action-icon-size:20px;--aa-text-color-rgb:38,38,39;--aa-text-color-alpha:1;--aa-primary-color-rgb:62,52,211;--aa-primary-color-alpha:0.2;--aa-muted-color-rgb:128,126,163;--aa-muted-color-alpha:0.6;--aa-panel-border-color-rgb:128,126,163;--aa-panel-border-color-alpha:0.3;--aa-input-border-color-rgb:128,126,163;--aa-input-border-color-alpha:0.8;--aa-background-color-rgb:255,255,255;--aa-background-color-alpha:1;--aa-input-background-color-rgb:255,255,255;--aa-input-background-color-alpha:1;--aa-selected-color-rgb:179,173,214;--aa-selected-color-alpha:0.205;--aa-description-highlight-background-color-rgb:245,223,77;--aa-description-highlight-background-color-alpha:0.5;--aa-detached-media-query:(max-width:680px);--aa-detached-modal-media-query:(min-width:680px);--aa-detached-modal-max-width:680px;--aa-detached-modal-max-height:500px;--aa-overlay-color-rgb:115,114,129;--aa-overlay-color-alpha:0.4;--aa-panel-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);--aa-scrollbar-width:13px;--aa-scrollbar-track-background-color-rgb:234,234,234;--aa-scrollbar-track-background-color-alpha:1;--aa-scrollbar-thumb-background-color-rgb:var(--aa-background-color-rgb);--aa-scrollbar-thumb-background-color-alpha:1}@media (hover:none) and (pointer:coarse){:root{--aa-spacing-factor:1.2;--aa-action-icon-size:22px}}body.dark,body[data-theme=dark]{--aa-text-color-rgb:183,192,199;--aa-primary-color-rgb:146,138,255;--aa-muted-color-rgb:146,138,255;--aa-input-background-color-rgb:0,3,9;--aa-background-color-rgb:21,24,42;--aa-selected-color-rgb:146,138,255;--aa-selected-color-alpha:0.25;--aa-description-highlight-background-color-rgb:0 255 255;--aa-description-highlight-background-color-alpha:0.25;--aa-icon-color-rgb:119,119,163;--aa-panel-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--aa-scrollbar-track-background-color-rgb:44,46,64;--aa-scrollbar-thumb-background-color-rgb:var(--aa-background-color-rgb)}.aa-Autocomplete *,.aa-DetachedFormContainer *,.aa-Panel *{box-sizing:border-box}.aa-Autocomplete,.aa-DetachedFormContainer,.aa-Panel{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-family:inherit;font-family:var(--aa-font-family);font-size:16px;font-size:var(--aa-font-size);font-weight:400;line-height:1em;margin:0;padding:0;text-align:left}.aa-Form{align-items:center;background-color:#fff;background-color:rgba(var(--aa-input-background-color-rgb),var(--aa-input-background-color-alpha));border:1px solid rgba(128,126,163,.8);border:1px solid rgba(var(--aa-input-border-color-rgb),var(--aa-input-border-color-alpha));border-radius:3px;display:flex;line-height:1em;margin:0;position:relative;width:100%}.aa-Form:focus-within{border-color:#3e34d3;border-color:rgba(var(--aa-primary-color-rgb),1);box-shadow:0 0 0 2px rgba(62,52,211,.2),inset 0 0 0 2px rgba(62,52,211,.2);box-shadow:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px,inset rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px;outline:medium none currentColor}.aa-InputWrapperPrefix{align-items:center;display:flex;flex-shrink:0;height:44px;height:var(--aa-search-input-height);order:1}.aa-Label,.aa-LoadingIndicator{cursor:auto;flex-shrink:0;height:100%;padding:0;text-align:left}.aa-Label svg,.aa-LoadingIndicator svg{color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);height:auto;max-height:20px;max-height:var(--aa-input-icon-size);stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-input-icon-size)}.aa-LoadingIndicator,.aa-SubmitButton{height:100%;padding-left:11px;padding-left:calc(var(--aa-spacing)*.75 - 1px);padding-right:8px;padding-right:var(--aa-spacing-half);width:47px;width:calc(var(--aa-spacing)*1.75 + var(--aa-icon-size) - 1px)}@media (hover:none) and (pointer:coarse){.aa-LoadingIndicator,.aa-SubmitButton{padding-left:3px;padding-left:calc(var(--aa-spacing-half)/2 - 1px);width:39px;width:calc(var(--aa-icon-size) + var(--aa-spacing)*1.25 - 1px)}}.aa-SubmitButton{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;margin:0}.aa-LoadingIndicator{align-items:center;display:flex;justify-content:center}.aa-LoadingIndicator[hidden]{display:none}.aa-InputWrapper{order:3;position:relative;width:100%}.aa-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font:inherit;height:44px;height:var(--aa-search-input-height);padding:0;width:100%}.aa-Input::-moz-placeholder{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));opacity:1}.aa-Input::placeholder{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));opacity:1}.aa-Input:focus{border-color:none;box-shadow:none;outline:none}.aa-Input::-webkit-search-cancel-button,.aa-Input::-webkit-search-decoration,.aa-Input::-webkit-search-results-button,.aa-Input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.aa-InputWrapperSuffix{align-items:center;display:flex;height:44px;height:var(--aa-search-input-height);order:4}.aa-ClearButton{align-items:center;background:none;border:0;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;height:100%;margin:0;padding:0 12.83328px;padding:0 calc(var(--aa-spacing)*.83333 - .5px)}@media (hover:none) and (pointer:coarse){.aa-ClearButton{padding:0 10.16672px;padding:0 calc(var(--aa-spacing)*.66667 - .5px)}}.aa-ClearButton:focus,.aa-ClearButton:hover{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha))}.aa-ClearButton[hidden]{display:none}.aa-ClearButton svg{stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-icon-size)}.aa-Panel{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:4px;border-radius:calc(var(--aa-spacing)/4);box-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);box-shadow:var(--aa-panel-shadow);margin:8px 0 0;overflow:hidden;position:absolute;transition:opacity .2s ease-in,filter .2s ease-in}@media screen and (prefers-reduced-motion){.aa-Panel{transition:none}}.aa-Panel button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;margin:0;padding:0}.aa-PanelLayout{height:100%;margin:0;max-height:650px;max-height:var(--aa-panel-max-height);overflow-y:auto;padding:0;position:relative;text-align:left}.aa-PanelLayoutColumns--twoGolden{display:grid;grid-template-columns:39.2% auto;overflow:hidden;padding:0}.aa-PanelLayoutColumns--two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:hidden;padding:0}.aa-PanelLayoutColumns--three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:hidden;padding:0}.aa-Panel--stalled .aa-Source{filter:grayscale(1);opacity:.8}.aa-Panel--scrollable{margin:0;max-height:650px;max-height:var(--aa-panel-max-height);overflow-x:hidden;overflow-y:auto;padding:8px;padding:var(--aa-spacing-half);scrollbar-color:#fff #eaeaea;scrollbar-color:rgba(var(--aa-scrollbar-thumb-background-color-rgb),var(--aa-scrollbar-thumb-background-color-alpha)) rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha));scrollbar-width:thin}.aa-Panel--scrollable::-webkit-scrollbar{width:13px;width:var(--aa-scrollbar-width)}.aa-Panel--scrollable::-webkit-scrollbar-track{background-color:#eaeaea;background-color:rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha))}.aa-Panel--scrollable::-webkit-scrollbar-thumb{background-color:#fff;background-color:rgba(var(--aa-scrollbar-thumb-background-color-rgb),var(--aa-scrollbar-thumb-background-color-alpha));border:3px solid #eaeaea;border:3px solid rgba(var(--aa-scrollbar-track-background-color-rgb),var(--aa-scrollbar-track-background-color-alpha));border-radius:9999px;border-right-width:2px}.aa-Source{margin:0;padding:0;position:relative;width:100%}.aa-Source:empty{display:none}.aa-SourceNoResults{font-size:1em;margin:0;padding:16px;padding:var(--aa-spacing)}.aa-List{list-style:none;margin:0}.aa-List,.aa-SourceHeader{padding:0;position:relative}.aa-SourceHeader{margin:8px .5em 8px 0;margin:var(--aa-spacing-half) .5em var(--aa-spacing-half) 0}.aa-SourceHeader:empty{display:none}.aa-SourceHeaderTitle{background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);display:inline-block;font-size:.8em;font-weight:600;font-weight:var(--aa-font-weight-semibold);margin:0;padding:0 8px 0 0;padding:0 var(--aa-spacing-half) 0 0;position:relative;z-index:9999;z-index:var(--aa-base-z-index)}.aa-SourceHeaderLine{border-bottom:1px solid #3e34d3;border-bottom:1px solid rgba(var(--aa-primary-color-rgb),1);display:block;height:2px;left:0;margin:0;opacity:.3;padding:0;position:absolute;right:0;top:8px;top:var(--aa-spacing-half);z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-SourceFooterSeeAll{background:linear-gradient(180deg,#fff,rgba(128,126,163,.14));background:linear-gradient(180deg,rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha)),rgba(128,126,163,.14));border:1px solid rgba(128,126,163,.6);border:1px solid rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));border-radius:5px;box-shadow:inset 0 0 2px #fff,0 2px 2px -1px rgba(76,69,88,.15);color:inherit;font-size:.95em;font-weight:500;font-weight:var(--aa-font-weight-medium);padding:.475em 1em .6em;-webkit-text-decoration:none;text-decoration:none}.aa-SourceFooterSeeAll:focus,.aa-SourceFooterSeeAll:hover{border:1px solid #3e34d3;border:1px solid rgba(var(--aa-primary-color-rgb),1);color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1)}.aa-Item{align-items:center;border-radius:3px;cursor:pointer;display:grid;min-height:40px;min-height:calc(var(--aa-spacing)*2.5);padding:4px;padding:calc(var(--aa-spacing-half)/2)}.aa-Item[aria-selected=true]{background-color:rgba(179,173,214,.205);background-color:rgba(var(--aa-selected-color-rgb),var(--aa-selected-color-alpha))}.aa-Item[aria-selected=true] .aa-ActiveOnly,.aa-Item[aria-selected=true] .aa-ItemActionButton{visibility:visible}.aa-ItemIcon{align-items:center;background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:3px;box-shadow:inset 0 0 0 1px rgba(128,126,163,.3);box-shadow:inset 0 0 0 1px rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));color:#7777a3;color:rgba(var(--aa-icon-color-rgb),var(--aa-icon-color-alpha));display:flex;flex-shrink:0;font-size:.7em;height:28px;height:calc(var(--aa-icon-size) + var(--aa-spacing-half));justify-content:center;overflow:hidden;stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);text-align:center;width:28px;width:calc(var(--aa-icon-size) + var(--aa-spacing-half))}.aa-ItemIcon img{height:auto;max-height:20px;max-height:calc(var(--aa-icon-size) + var(--aa-spacing-half) - 8px);max-width:20px;max-width:calc(var(--aa-icon-size) + var(--aa-spacing-half) - 8px);width:auto}.aa-ItemIcon svg{height:20px;height:var(--aa-icon-size);width:20px;width:var(--aa-icon-size)}.aa-ItemIcon--alignTop{align-self:flex-start}.aa-ItemIcon--noBorder{background:none;box-shadow:none}.aa-ItemIcon--picture{height:96px;width:96px}.aa-ItemIcon--picture img{max-height:100%;max-width:100%;padding:8px;padding:var(--aa-spacing-half)}.aa-ItemContent{align-items:center;cursor:pointer;display:grid;gap:8px;grid-gap:8px;grid-gap:var(--aa-spacing-half);gap:var(--aa-spacing-half);grid-auto-flow:column;line-height:1.25em;overflow:hidden}.aa-ItemContent:empty{display:none}.aa-ItemContent mark{background:none;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-style:normal;font-weight:700;font-weight:var(--aa-font-weight-bold)}.aa-ItemContent--dual{display:flex;flex-direction:column;justify-content:space-between;text-align:left}.aa-ItemContent--dual .aa-ItemContentSubtitle,.aa-ItemContent--dual .aa-ItemContentTitle{display:block}.aa-ItemContent--indented{padding-left:36px;padding-left:calc(var(--aa-icon-size) + var(--aa-spacing))}.aa-ItemContentBody{display:grid;gap:4px;grid-gap:4px;grid-gap:calc(var(--aa-spacing-half)/2);gap:calc(var(--aa-spacing-half)/2)}.aa-ItemContentTitle{display:inline-block;margin:0 .5em 0 0;max-width:100%;overflow:hidden;padding:0;text-overflow:ellipsis;white-space:nowrap}.aa-ItemContentSubtitle{font-size:.92em}.aa-ItemContentSubtitleIcon:before{border-color:rgba(128,126,163,.64);border-color:rgba(var(--aa-muted-color-rgb),.64);border-style:solid;content:"";display:inline-block;left:1px;position:relative;top:-3px}.aa-ItemContentSubtitle--inline .aa-ItemContentSubtitleIcon:before{border-width:0 0 1.5px;margin-left:8px;margin-left:var(--aa-spacing-half);margin-right:4px;margin-right:calc(var(--aa-spacing-half)/2);width:10px;width:calc(var(--aa-spacing-half) + 2px)}.aa-ItemContentSubtitle--standalone{align-items:center;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));display:grid;gap:8px;grid-gap:8px;grid-gap:var(--aa-spacing-half);gap:var(--aa-spacing-half);grid-auto-flow:column;justify-content:start}.aa-ItemContentSubtitle--standalone .aa-ItemContentSubtitleIcon:before{border-radius:0 0 0 3px;border-width:0 0 1.5px 1.5px;height:8px;height:var(--aa-spacing-half);width:8px;width:var(--aa-spacing-half)}.aa-ItemContentSubtitleCategory{color:#807ea3;color:rgba(var(--aa-muted-color-rgb),1);font-weight:500}.aa-ItemContentDescription{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-size:.85em;max-width:100%;overflow-x:hidden;text-overflow:ellipsis}.aa-ItemContentDescription:empty{display:none}.aa-ItemContentDescription mark{background:rgba(245,223,77,.5);background:rgba(var(--aa-description-highlight-background-color-rgb),var(--aa-description-highlight-background-color-alpha));color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));font-style:normal;font-weight:500;font-weight:var(--aa-font-weight-medium)}.aa-ItemContentDash{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));display:none;opacity:.4}.aa-ItemContentTag{background-color:rgba(62,52,211,.2);background-color:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha));border-radius:3px;margin:0 .4em 0 0;padding:.08em .3em}.aa-ItemLink,.aa-ItemWrapper{align-items:center;color:inherit;display:grid;gap:4px;grid-gap:4px;grid-gap:calc(var(--aa-spacing-half)/2);gap:calc(var(--aa-spacing-half)/2);grid-auto-flow:column;justify-content:space-between;width:100%}.aa-ItemLink{color:inherit;-webkit-text-decoration:none;text-decoration:none}.aa-ItemActions{display:grid;grid-auto-flow:column;height:100%;justify-self:end;margin:0 -5.33333px;margin:0 calc(var(--aa-spacing)/-3);padding:0 2px 0 0}.aa-ItemActionButton{align-items:center;background:none;border:0;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;flex-shrink:0;padding:0}.aa-ItemActionButton:focus svg,.aa-ItemActionButton:hover svg{color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha))}@media (hover:none) and (pointer:coarse){.aa-ItemActionButton:focus svg,.aa-ItemActionButton:hover svg{color:inherit}}.aa-ItemActionButton svg{color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));margin:5.33333px;margin:calc(var(--aa-spacing)/3);stroke-width:1.6;stroke-width:var(--aa-icon-stroke-width);width:20px;width:var(--aa-action-icon-size)}.aa-ActiveOnly{visibility:hidden}.aa-PanelHeader{align-items:center;background:#3e34d3;background:rgba(var(--aa-primary-color-rgb),1);color:#fff;display:grid;height:var(--aa-modal-header-height);margin:0;padding:8px 16px;padding:var(--aa-spacing-half) var(--aa-spacing);position:relative}.aa-PanelHeader:after{background-image:linear-gradient(#fff,hsla(0,0%,100%,0));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),1),rgba(var(--aa-background-color-rgb),0));bottom:-8px;bottom:calc(var(--aa-spacing-half)*-1);content:"";height:8px;height:var(--aa-spacing-half);left:0;pointer-events:none;position:absolute;right:0}.aa-PanelFooter,.aa-PanelHeader:after{z-index:9999;z-index:var(--aa-base-z-index)}.aa-PanelFooter{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));box-shadow:inset 0 1px 0 rgba(128,126,163,.3);box-shadow:inset 0 1px 0 rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));display:flex;justify-content:space-between;margin:0;padding:16px;padding:var(--aa-spacing);position:relative}.aa-PanelFooter:after{background-image:linear-gradient(hsla(0,0%,100%,0),rgba(128,126,163,.6));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),0),rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha)));content:"";height:16px;height:var(--aa-spacing);left:0;opacity:.12;pointer-events:none;position:absolute;right:0;top:-16px;top:calc(var(--aa-spacing)*-1);z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-DetachedContainer{background:#fff;background:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));bottom:0;box-shadow:0 0 0 1px rgba(35,38,59,.1),0 6px 16px -4px rgba(35,38,59,.15);box-shadow:var(--aa-panel-shadow);display:flex;flex-direction:column;left:0;margin:0;overflow:hidden;padding:0;position:fixed;right:0;top:0;z-index:9999;z-index:var(--aa-base-z-index)}.aa-DetachedContainer:after{height:32px}.aa-DetachedContainer .aa-SourceHeader{margin:8px 0 8px 2px;margin:var(--aa-spacing-half) 0 var(--aa-spacing-half) 2px}.aa-DetachedContainer .aa-Panel{background-color:#fff;background-color:rgba(var(--aa-background-color-rgb),var(--aa-background-color-alpha));border-radius:0;box-shadow:none;flex-grow:1;margin:0;padding:0;position:relative}.aa-DetachedContainer .aa-PanelLayout{bottom:0;box-shadow:none;left:0;margin:0;max-height:none;overflow-y:auto;position:absolute;right:0;top:0;width:100%}.aa-DetachedFormContainer{border-bottom:1px solid rgba(128,126,163,.3);border-bottom:1px solid rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha));display:flex;flex-direction:row;justify-content:space-between;margin:0;padding:8px;padding:var(--aa-spacing-half)}.aa-DetachedCancelButton{background:none;border:0;border-radius:3px;color:inherit;color:#262627;color:rgba(var(--aa-text-color-rgb),var(--aa-text-color-alpha));cursor:pointer;font:inherit;margin:0 0 0 8px;margin:0 0 0 var(--aa-spacing-half);padding:0 8px;padding:0 var(--aa-spacing-half)}.aa-DetachedCancelButton:focus,.aa-DetachedCancelButton:hover{box-shadow:inset 0 0 0 1px rgba(128,126,163,.3);box-shadow:inset 0 0 0 1px rgba(var(--aa-panel-border-color-rgb),var(--aa-panel-border-color-alpha))}.aa-DetachedContainer--modal{border-radius:6px;bottom:inherit;height:auto;margin:0 auto;max-width:680px;max-width:var(--aa-detached-modal-max-width);position:absolute;top:3%}.aa-DetachedContainer--modal .aa-PanelLayout{max-height:500px;max-height:var(--aa-detached-modal-max-height);padding-bottom:8px;padding-bottom:var(--aa-spacing-half);position:static}.aa-DetachedContainer--modal .aa-PanelLayout:empty{display:none}.aa-DetachedSearchButton{align-items:center;background-color:#fff;background-color:rgba(var(--aa-input-background-color-rgb),var(--aa-input-background-color-alpha));border:1px solid rgba(128,126,163,.8);border:1px solid rgba(var(--aa-input-border-color-rgb),var(--aa-input-border-color-alpha));border-radius:3px;color:rgba(128,126,163,.6);color:rgba(var(--aa-muted-color-rgb),var(--aa-muted-color-alpha));cursor:pointer;display:flex;font:inherit;font-family:inherit;font-family:var(--aa-font-family);font-size:16px;font-size:var(--aa-font-size);height:44px;height:var(--aa-search-input-height);margin:0;padding:0 5.5px;padding:0 calc(var(--aa-search-input-height)/8);position:relative;text-align:left;width:100%}.aa-DetachedSearchButton:focus{border-color:#3e34d3;border-color:rgba(var(--aa-primary-color-rgb),1);box-shadow:0 0 0 3px rgba(62,52,211,.2),inset 0 0 0 2px rgba(62,52,211,.2);box-shadow:rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 3px,inset rgba(var(--aa-primary-color-rgb),var(--aa-primary-color-alpha)) 0 0 0 2px;outline:medium none currentColor}.aa-DetachedSearchButtonIcon{align-items:center;color:#3e34d3;color:rgba(var(--aa-primary-color-rgb),1);cursor:auto;display:flex;flex-shrink:0;height:100%;justify-content:center;width:36px;width:calc(var(--aa-icon-size) + var(--aa-spacing))}.aa-DetachedSearchButtonQuery{color:#262627;color:rgba(var(--aa-text-color-rgb),1);line-height:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aa-DetachedSearchButtonPlaceholder[hidden]{display:none}.aa-Detached{height:100vh;overflow:hidden}.aa-DetachedOverlay{background-color:hsla(244,6%,48%,.4);background-color:rgba(var(--aa-overlay-color-rgb),var(--aa-overlay-color-alpha));height:100vh;left:0;margin:0;padding:0;position:fixed;right:0;top:0;z-index:9998;z-index:calc(var(--aa-base-z-index) - 1)}.aa-GradientBottom,.aa-GradientTop{height:8px;height:var(--aa-spacing-half);left:0;pointer-events:none;position:absolute;right:0;z-index:9999;z-index:var(--aa-base-z-index)}.aa-GradientTop{background-image:linear-gradient(#fff,hsla(0,0%,100%,0));background-image:linear-gradient(rgba(var(--aa-background-color-rgb),1),rgba(var(--aa-background-color-rgb),0));top:0}.aa-GradientBottom{background-image:linear-gradient(hsla(0,0%,100%,0),#fff);background-image:linear-gradient(rgba(var(--aa-background-color-rgb),0),rgba(var(--aa-background-color-rgb),1));border-bottom-left-radius:4px;border-bottom-left-radius:calc(var(--aa-spacing)/4);border-bottom-right-radius:4px;border-bottom-right-radius:calc(var(--aa-spacing)/4);bottom:0}@media (hover:none) and (pointer:coarse){.aa-DesktopOnly{display:none}}@media (hover:hover){.aa-TouchOnly{display:none}} -.quant-search{display:flex;flex-wrap:wrap;gap:2rem}.quant-search__description{flex-basis:100%;margin:0 0 .5rem}.quant-search__facets{flex:0 0 240px;max-width:100%}.quant-search__facet{margin-bottom:1.5rem}.quant-search__facet-heading{font-weight:600;margin-bottom:.5rem}.quant-search__content{flex:1 1 320px;min-width:0}.quant-search__stats{font-size:.9em;margin:.75rem 0;opacity:.8}.quant-search .ais-Hits-list{display:block;margin:0}.quant-search .ais-Hits-item{border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid rgba(0,0,0,.1)}.quant-search__hit{display:flow-root;padding:1rem 0}.quant-search__hit a{text-decoration:none}.quant-search__hit img{float:right;height:auto;margin:0 0 .5rem 1rem;max-width:120px}.quant-search__hit-title{font-size:1.1em;margin:0 0 .25rem}.quant-search__hit-summary{margin:0;opacity:.85}.quant-search__hit-tag{background:rgba(0,0,0,.06);border-radius:999px;display:inline-block;font-size:.8em;margin:.25rem .25rem 0 0;padding:.1rem .5rem}.quant-search__empty{opacity:.8;padding:2rem 0;text-align:center}.quant-search--unavailable{border:1px dashed rgba(0,0,0,.3);padding:1rem}.quant-search .ais-Pagination{margin-top:1.5rem}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} +:where(.quant-search){--quant-search-gap:1rem;--quant-search-gap-xs:calc(var(--quant-search-gap)*0.25);--quant-search-gap-sm:calc(var(--quant-search-gap)*0.5);--quant-search-gap-md:calc(var(--quant-search-gap)*0.75);--quant-search-gap-lg:calc(var(--quant-search-gap)*1.5);--quant-search-gap-xl:calc(var(--quant-search-gap)*2.5);--quant-search-facets-width:14rem;--quant-search-content-min-width:20rem;--quant-search-hit-image-width:7.5rem;--quant-search-radius:0.375rem;--quant-search-accent:var(--wp--preset--color--contrast,currentcolor);--quant-search-muted:color-mix(in srgb,currentcolor 75%,transparent);--quant-search-border:color-mix(in srgb,currentcolor 18%,transparent);--quant-search-border-strong:color-mix(in srgb,currentcolor 45%,transparent);--quant-search-surface:color-mix(in srgb,currentcolor 6%,transparent);--quant-search-surface-hover:color-mix(in srgb,currentcolor 10%,transparent);--quant-search-input-background:transparent;--quant-search-highlight:rgba(255,210,70,.45);--quant-search-focus-ring:var(--quant-search-accent);--quant-search-focus-width:2px;--quant-search-disabled-opacity:0.55;--quant-search-font-size-small:0.875em;--quant-search-font-size-xsmall:0.8125em;--quant-search-facet-heading-size:0.75em;--quant-search-hit-title-size:1.25em;--quant-search-hit-summary-size:0.9375em}.quant-search{align-items:flex-start;container:quant-search/inline-size;display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xl)}.quant-search .ais-ClearRefinements,.quant-search .ais-Hits,.quant-search .ais-Menu,.quant-search .ais-MenuSelect,.quant-search .ais-Pagination,.quant-search .ais-RefinementList,.quant-search .ais-SearchBox,.quant-search .ais-Stats{color:inherit}.quant-search :where(a,button,input,select,[tabindex]):focus-visible{outline:var(--quant-search-focus-width) solid var(--quant-search-focus-ring);outline-offset:2px}.quant-search__description{flex-basis:100%;margin:0}.quant-search__facets{display:flex;flex:0 0 var(--quant-search-facets-width);flex-direction:column;gap:var(--quant-search-gap-lg);max-width:100%}.quant-search__facet{margin:0}.quant-search__facet:has(.ais-Menu--noRefinement),.quant-search__facet:has(.ais-MenuSelect--noRefinement),.quant-search__facet:has(.ais-RefinementList--noRefinement),.quant-search__facet:has(>div:empty){display:none}.quant-search__facets:not(:has(.ais-RefinementList,.ais-Menu,.ais-MenuSelect)){display:none}.quant-search__pagination:has(.ais-Pagination--noRefinement){display:none}.quant-search__facet-heading{border-bottom:1px solid var(--quant-search-border);font-size:var(--quant-search-facet-heading-size);font-weight:600;letter-spacing:.06em;line-height:1.4;margin:0 0 var(--quant-search-gap-sm);padding-bottom:var(--quant-search-gap-xs);text-transform:uppercase}.quant-search__content{display:flex;flex:1 1 var(--quant-search-content-min-width);flex-direction:column;gap:var(--quant-search-gap);min-width:0}.quant-search__stats{color:var(--quant-search-muted);font-size:var(--quant-search-font-size-small);margin:0}.quant-search .ais-SearchBox-form{background:none;height:auto}.quant-search .ais-SearchBox-input{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) 2.75rem var(--quant-search-gap-sm) 2.5rem;width:100%}.quant-search .ais-SearchBox-input:focus{border-color:var(--quant-search-accent);box-shadow:none}.quant-search .ais-SearchBox-input::-moz-placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-input::placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset,.quant-search .ais-SearchBox-submit{border-radius:var(--quant-search-radius);color:inherit;height:1.75rem;width:1.75rem}.quant-search .ais-SearchBox-submit{left:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset{right:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-resetIcon path,.quant-search .ais-SearchBox-submitIcon path{fill:currentcolor}.quant-search__fallback{display:flex;gap:var(--quant-search-gap-sm)}.quant-search__fallback label{flex:1;min-width:0}.quant-search__fallback button,.quant-search__fallback input[type=search]{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) var(--quant-search-gap-md)}.quant-search__fallback input[type=search]{width:100%}.quant-search__fallback button{background:transparent;cursor:pointer}.quant-search .ais-ClearRefinements-button{align-items:center;background:transparent;border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);color:inherit;cursor:pointer;display:inline-flex;font:inherit;font-size:var(--quant-search-font-size-small);font-weight:500;line-height:1.2;min-height:2.25rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-md)}.quant-search .ais-ClearRefinements-button--disabled,.quant-search .ais-ClearRefinements-button:disabled{background:transparent;color:inherit;cursor:not-allowed;opacity:var(--quant-search-disabled-opacity)}.quant-search .ais-ClearRefinements-button:hover:not(:disabled){background:var(--quant-search-surface-hover)}.quant-search .ais-Menu-list,.quant-search .ais-RefinementList-list{display:flex;flex-direction:column;gap:var(--quant-search-gap-xs);list-style:none;margin:0;padding:0}.quant-search .ais-Menu-item,.quant-search .ais-RefinementList-item{margin:0;padding:0}.quant-search .ais-Menu-link,.quant-search .ais-RefinementList-label{align-items:center;color:inherit;cursor:pointer;display:flex;gap:var(--quant-search-gap-sm);line-height:1.3;min-height:1.75rem;text-decoration:none}.quant-search .ais-RefinementList-checkbox{accent-color:var(--quant-search-accent);cursor:pointer;flex:none;height:1.0625rem;margin:0;width:1.0625rem}.quant-search .ais-Menu-label,.quant-search .ais-RefinementList-labelText{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.quant-search .ais-Menu-item--selected .ais-Menu-label,.quant-search .ais-RefinementList-item--selected .ais-RefinementList-labelText{font-weight:600}.quant-search .ais-Menu-count,.quant-search .ais-RefinementList-count{background:var(--quant-search-surface);border:0;border-radius:999px;color:var(--quant-search-muted);flex:none;font-size:var(--quant-search-font-size-xsmall);font-variant-numeric:tabular-nums;line-height:1.6;margin:0 0 0 auto;padding:0 var(--quant-search-gap-sm)}.quant-search .ais-MenuSelect-select{background-color:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.5rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-sm);width:100%}.quant-search .ais-Menu-showMore,.quant-search .ais-RefinementList-showMore{background:none;border:0;color:inherit;cursor:pointer;font:inherit;font-size:var(--quant-search-font-size-small);margin-top:var(--quant-search-gap-sm);padding:0;text-decoration:underline}.quant-search .ais-Hits-list{display:block;list-style:none;margin:0;padding:0}.quant-search .ais-Hits-item{background:none;border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid var(--quant-search-border)}.quant-search__hit-title{font-size:var(--quant-search-hit-title-size);font-weight:600;line-height:1.3;margin:0 0 var(--quant-search-gap-xs)}.quant-search__hit-summary{color:var(--quant-search-muted);font-size:var(--quant-search-hit-summary-size);line-height:1.55;margin:0}.quant-search__hit-tag{background:var(--quant-search-surface);border:1px solid var(--quant-search-border);border-radius:999px;color:var(--quant-search-muted);display:inline-block;font-size:var(--quant-search-font-size-xsmall);line-height:1.5;margin:0;padding:.125em var(--quant-search-gap-sm)}.quant-search__hit{display:flow-root;padding:var(--quant-search-gap-lg) 0}.quant-search__hit a{color:inherit;text-decoration:none}.quant-search__hit a:focus-visible .quant-search__hit-title,.quant-search__hit a:hover .quant-search__hit-title{text-decoration:underline;text-underline-offset:.15em}.quant-search__hit img{aspect-ratio:4/3;border-radius:var(--quant-search-radius);float:right;height:auto;margin:0 0 var(--quant-search-gap-sm) var(--quant-search-gap);max-width:35%;-o-object-fit:cover;object-fit:cover;width:var(--quant-search-hit-image-width)}.quant-search__hit>div:has(.quant-search__hit-tag){display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);margin-top:var(--quant-search-gap-md)}.quant-search .ais-Hits-item:first-child .quant-search__hit{padding-top:var(--quant-search-gap-sm)}.quant-search .ais-Highlight-highlighted,.quant-search .ais-Snippet-highlighted{background:var(--quant-search-highlight);border-radius:.15em;color:inherit}.quant-search__empty{color:var(--quant-search-muted);padding:var(--quant-search-gap-xl) 0;text-align:center}.quant-search__empty h4{color:inherit;margin:0 0 var(--quant-search-gap-sm)}.quant-search__empty p{margin:0}.quant-search--unavailable{border:1px dashed var(--quant-search-border-strong);border-radius:var(--quant-search-radius);padding:var(--quant-search-gap)}.quant-search--unavailable p{margin:0}.quant-search .ais-Pagination{margin-top:var(--quant-search-gap)}.quant-search .ais-Pagination-list{display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);justify-content:center;list-style:none;margin:0;padding:0}.quant-search .ais-Pagination-item{margin:0}.quant-search .ais-Pagination-link{align-items:center;background:transparent;border:1px solid var(--quant-search-border);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;display:inline-flex;font-variant-numeric:tabular-nums;height:2.5rem;justify-content:center;line-height:1;min-width:2.5rem;padding:0 var(--quant-search-gap-sm);text-decoration:none}.quant-search .ais-Pagination-link:hover{background:var(--quant-search-surface-hover)}.quant-search .ais-Pagination-item--selected .ais-Pagination-link{background:transparent;border:2px solid var(--quant-search-accent);color:inherit;font-weight:600}.quant-search .ais-Pagination-item--disabled .ais-Pagination-link{background:transparent;color:inherit;opacity:var(--quant-search-disabled-opacity)}@container quant-search (max-width: 37.5rem){.quant-search__facets{display:grid;flex-basis:100%;gap:var(--quant-search-gap) var(--quant-search-gap-lg);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}.quant-search__clear{grid-column:1/-1}.quant-search__content{flex-basis:100%}.quant-search__hit img{width:calc(var(--quant-search-hit-image-width)*.7)}}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} diff --git a/plugins/quant/assets/build/search-rtl.css b/plugins/quant/assets/build/search-rtl.css index 8959174..3e1d338 100644 --- a/plugins/quant/assets/build/search-rtl.css +++ b/plugins/quant/assets/build/search-rtl.css @@ -1,2 +1,2 @@ .ais-Breadcrumb-list,.ais-CurrentRefinements-list,.ais-HierarchicalMenu-list,.ais-Hits-list,.ais-InfiniteHits-list,.ais-InfiniteResults-list,.ais-Menu-list,.ais-NumericMenu-list,.ais-Pagination-list,.ais-RatingMenu-list,.ais-RefinementList-list,.ais-Results-list,.ais-ToggleRefinement-list{list-style:none;margin:0;padding:0}.ais-ClearRefinements-button,.ais-CurrentRefinements-delete,.ais-CurrentRefinements-reset,.ais-GeoSearch-redo,.ais-GeoSearch-reset,.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-InfiniteResults-loadMore,.ais-Menu-showMore,.ais-RangeInput-submit,.ais-RefinementList-showMore,.ais-SearchBox-reset,.ais-SearchBox-submit,.ais-VoiceSearch-button{background:none;border:0;color:inherit;cursor:pointer;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ais-ClearRefinements-button::-moz-focus-inner,.ais-CurrentRefinements-delete::-moz-focus-inner,.ais-CurrentRefinements-reset::-moz-focus-inner,.ais-GeoSearch-redo::-moz-focus-inner,.ais-GeoSearch-reset::-moz-focus-inner,.ais-HierarchicalMenu-showMore::-moz-focus-inner,.ais-InfiniteHits-loadMore::-moz-focus-inner,.ais-InfiniteHits-loadPrevious::-moz-focus-inner,.ais-InfiniteResults-loadMore::-moz-focus-inner,.ais-Menu-showMore::-moz-focus-inner,.ais-RangeInput-submit::-moz-focus-inner,.ais-RefinementList-showMore::-moz-focus-inner,.ais-SearchBox-reset::-moz-focus-inner,.ais-SearchBox-submit::-moz-focus-inner,.ais-VoiceSearch-button::-moz-focus-inner{border:0;padding:0}.ais-ClearRefinements-button[disabled],.ais-CurrentRefinements-delete[disabled],.ais-CurrentRefinements-reset[disabled],.ais-GeoSearch-redo[disabled],.ais-GeoSearch-reset[disabled],.ais-HierarchicalMenu-showMore[disabled],.ais-InfiniteHits-loadMore[disabled],.ais-InfiniteHits-loadPrevious[disabled],.ais-InfiniteResults-loadMore[disabled],.ais-Menu-showMore[disabled],.ais-RangeInput-submit[disabled],.ais-RefinementList-showMore[disabled],.ais-SearchBox-reset[disabled],.ais-SearchBox-submit[disabled],.ais-VoiceSearch-button[disabled]{cursor:default}.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-Menu-showMore,.ais-RefinementList-showMore{overflow-anchor:none}.ais-Breadcrumb-item,.ais-Breadcrumb-list,.ais-Pagination-list,.ais-PoweredBy,.ais-RangeInput-form,.ais-RatingMenu-link{align-items:center;display:flex}.ais-GeoSearch,.ais-GeoSearch-map{height:100%}.ais-HierarchicalMenu-list .ais-HierarchicalMenu-list{margin-right:1em}.ais-PoweredBy-logo{display:block;height:1.2em;width:auto}.ais-RatingMenu-starIcon{display:block;height:20px;width:20px}.ais-SearchBox-input::-ms-clear,.ais-SearchBox-input::-ms-reveal{display:none;height:0;width:0}.ais-SearchBox-input::-webkit-search-cancel-button,.ais-SearchBox-input::-webkit-search-decoration,.ais-SearchBox-input::-webkit-search-results-button,.ais-SearchBox-input::-webkit-search-results-decoration{display:none}.ais-RangeSlider .rheostat{margin-bottom:40px;margin-top:40px;overflow:visible}.ais-RangeSlider .rheostat-background{height:6px;top:0;width:100%}.ais-RangeSlider .rheostat-handle{margin-right:-12px;top:-7px}.ais-RangeSlider .rheostat-background{background-color:#fff;border:1px solid #aaa;position:relative}.ais-RangeSlider .rheostat-progress{background-color:#333;height:4px;position:absolute;top:1px}.rheostat-handle{background-color:#fff;border:1px solid #333;border-radius:50%;cursor:grab;height:20px;position:relative;width:20px;z-index:1}.rheostat-marker{background-color:#aaa;height:5px;margin-right:-1px;position:absolute;width:1px}.rheostat-marker--large{height:9px}.rheostat-value{padding-top:15px}.rheostat-tooltip,.rheostat-value{margin-right:50%;position:absolute;text-align:center;transform:translateX(50%)}.rheostat-tooltip{top:-22px}[class^=ais-]{box-sizing:border-box;font-size:1rem}a[class^=ais-]{text-decoration:none}.ais-Breadcrumb,.ais-ClearRefinements,.ais-CurrentRefinements,.ais-GeoSearch,.ais-HierarchicalMenu,.ais-Hits,.ais-HitsPerPage,.ais-InfiniteHits,.ais-InfiniteResults,.ais-Menu,.ais-MenuSelect,.ais-NumericMenu,.ais-NumericSelector,.ais-Pagination,.ais-Panel,.ais-PoweredBy,.ais-RangeInput,.ais-RangeSlider,.ais-RatingMenu,.ais-RefinementList,.ais-Results,.ais-ResultsPerPage,.ais-SearchBox,.ais-SortBy,.ais-Stats,.ais-ToggleRefinement{color:#3a4570}.ais-Breadcrumb-item--selected,.ais-HierarchicalMenu-item--selected,.ais-Menu-item--selected{font-weight:700}.ais-Breadcrumb-separator{font-weight:400;margin:0 .3em}.ais-Breadcrumb-link,.ais-HierarchicalMenu-link,.ais-Menu-link,.ais-Pagination-link,.ais-RatingMenu-link{color:#0096db;transition:color .2s ease-out}.ais-Breadcrumb-link:focus,.ais-Breadcrumb-link:hover,.ais-HierarchicalMenu-link:focus,.ais-HierarchicalMenu-link:hover,.ais-Menu-link:focus,.ais-Menu-link:hover,.ais-Pagination-link:focus,.ais-Pagination-link:hover,.ais-RatingMenu-link:focus,.ais-RatingMenu-link:hover{color:#0073a8}.ais-ClearRefinements-button,.ais-CurrentRefinements-reset,.ais-GeoSearch-redo,.ais-GeoSearch-reset,.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-InfiniteResults-loadMore,.ais-Menu-showMore,.ais-RefinementList-showMore{background-color:#0096db;border-radius:5px;color:#fff;font-size:.8rem;outline:none;padding:.3rem .5rem;transition:background-color .2s ease-out}.ais-ClearRefinements-button:focus,.ais-ClearRefinements-button:hover,.ais-CurrentRefinements-reset:focus,.ais-CurrentRefinements-reset:hover,.ais-GeoSearch-redo:focus,.ais-GeoSearch-redo:hover,.ais-GeoSearch-reset:focus,.ais-GeoSearch-reset:hover,.ais-HierarchicalMenu-showMore:focus,.ais-HierarchicalMenu-showMore:hover,.ais-InfiniteHits-loadMore:focus,.ais-InfiniteHits-loadMore:hover,.ais-InfiniteHits-loadPrevious:focus,.ais-InfiniteHits-loadPrevious:hover,.ais-InfiniteResults-loadMore:focus,.ais-InfiniteResults-loadMore:hover,.ais-Menu-showMore:focus,.ais-Menu-showMore:hover,.ais-RefinementList-showMore:focus,.ais-RefinementList-showMore:hover{background-color:#0073a8}.ais-ClearRefinements-button--disabled,.ais-GeoSearch-redo--disabled,.ais-GeoSearch-reset--disabled,.ais-HierarchicalMenu-showMore--disabled,.ais-InfiniteHits-loadMore--disabled,.ais-InfiniteResults-loadMore--disabled,.ais-Menu-showMore--disabled,.ais-RefinementList-showMore--disabled{cursor:not-allowed;opacity:.6}.ais-ClearRefinements-button--disabled:focus,.ais-ClearRefinements-button--disabled:hover,.ais-GeoSearch-redo--disabled:focus,.ais-GeoSearch-redo--disabled:hover,.ais-GeoSearch-reset--disabled:focus,.ais-GeoSearch-reset--disabled:hover,.ais-HierarchicalMenu-showMore--disabled:focus,.ais-HierarchicalMenu-showMore--disabled:hover,.ais-InfiniteHits-loadMore--disabled:focus,.ais-InfiniteHits-loadMore--disabled:hover,.ais-InfiniteResults-loadMore--disabled:focus,.ais-InfiniteResults-loadMore--disabled:hover,.ais-Menu-showMore--disabled:focus,.ais-Menu-showMore--disabled:hover,.ais-RefinementList-showMore--disabled:focus,.ais-RefinementList-showMore--disabled:hover{background-color:#0096db}.ais-InfiniteHits-loadPrevious--disabled{display:none}.ais-CurrentRefinements{margin-top:-.3rem}.ais-CurrentRefinements,.ais-CurrentRefinements-list{display:flex;flex-wrap:wrap}.ais-CurrentRefinements-item{background-color:#495588;border-radius:5px;display:flex;margin-left:.3rem;margin-top:.3rem;padding:.3rem .5rem}.ais-CurrentRefinements-category{display:flex;margin-right:.3em}.ais-CurrentRefinements-delete{margin-right:.3rem}.ais-CurrentRefinements-categoryLabel,.ais-CurrentRefinements-delete,.ais-CurrentRefinements-label{color:#fff;font-size:.8rem;white-space:nowrap}.ais-CurrentRefinements-reset{margin-top:.3rem;white-space:nowrap}.ais-CurrentRefinements-reset+.ais-CurrentRefinements-list{margin-right:.3rem}.ais-GeoSearch{position:relative}.ais-GeoSearch-control{right:3.75rem;position:absolute;top:.8rem}.ais-GeoSearch-label{background-color:#fff;border-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,.1);display:block;font-size:.8rem;outline:none;padding:.3rem .5rem;transition:background-color .2s ease-out}.ais-GeoSearch-input{margin:0 0 0 .25rem}.ais-GeoSearch-label,.ais-GeoSearch-redo,.ais-GeoSearch-reset{white-space:nowrap}.ais-GeoSearch-reset{bottom:1.25rem;right:50%;position:absolute;transform:translateX(50%)}.ais-HierarchicalMenu-link,.ais-Menu-link{display:block;line-height:1.5}.ais-HierarchicalMenu-list,.ais-Menu-list,.ais-NumericMenu-list,.ais-RatingMenu-list,.ais-RefinementList-list{font-weight:400;line-height:1.5}.ais-HierarchicalMenu-link:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%233A4570%27 d=%27m7.3 24-2.8-2.8 9.3-9.2-9.3-9.2L7.3 0l12.2 12z%27/%3E%3C/svg%3E");background-size:100% 100%;content:"";display:none;height:10px;margin-right:.3em;width:10px}.ais-HierarchicalMenu-item--parent>.ais-HierarchicalMenu-link:after{display:inline-block}.ais-HierarchicalMenu-item--selected>.ais-HierarchicalMenu-link:after{transform:rotate(-90deg)}.ais-CurrentRefinements-count,.ais-RatingMenu-count{font-size:.8rem}.ais-CurrentRefinements-count:before,.ais-RatingMenu-count:before{content:"("}.ais-CurrentRefinements-count:after,.ais-RatingMenu-count:after{content:")"}.ais-HierarchicalMenu-count,.ais-Menu-count,.ais-RefinementList-count,.ais-ToggleRefinement-count{background-color:#dfe2ee;border-radius:8px;color:#3a4570;font-size:.8rem;padding:.1rem .4rem}.ais-HierarchicalMenu-showMore,.ais-Menu-showMore,.ais-RefinementList-showMore{margin-top:.5rem}.ais-Highlight-highlighted,.ais-Snippet-highlighted{background-color:#ffc168}.ais-Hits-list,.ais-InfiniteHits-list,.ais-InfiniteResults-list,.ais-Results-list{display:flex;flex-wrap:wrap;margin-right:-1rem;margin-top:-1rem}.ais-Panel-body .ais-Hits-list,.ais-Panel-body .ais-InfiniteHits-list,.ais-Panel-body .ais-InfiniteResults-list,.ais-Panel-body .ais-Results-list{margin:.5rem -1rem 0 0}.ais-Hits-item,.ais-InfiniteHits-item,.ais-InfiniteResults-item,.ais-Results-item{border:1px solid #c4c8d8;box-shadow:0 2px 5px 0 #e3e5ec;margin-right:1rem;margin-top:1rem;padding:1rem;width:calc(25% - 1rem)}.ais-Panel-body .ais-Hits-item,.ais-Panel-body .ais-InfiniteHits-item,.ais-Panel-body .ais-InfiniteResults-item,.ais-Panel-body .ais-Results-item{margin:.5rem 1rem .5rem 0}.ais-InfiniteHits-loadMore,.ais-InfiniteResults-loadMore{margin-top:1rem}.ais-InfiniteHits-loadPrevious{margin-bottom:1rem}.ais-HitsPerPage-select,.ais-MenuSelect-select,.ais-NumericSelector-select,.ais-ResultsPerPage-select,.ais-SortBy-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%233A4570%27 d=%27m0 7.3 2.8-2.8 9.2 9.3 9.2-9.3L24 7.3 12 19.5z%27/%3E%3C/svg%3E");background-position:8% 50%;background-repeat:no-repeat;background-size:10px 10px;border:1px solid #c4c8d8;border-radius:5px;max-width:100%;padding:.3rem .3rem .3rem 2rem}.ais-Panel--collapsible{position:relative}.ais-Panel--collapsible.ais-Panel--collapsed .ais-Panel-body,.ais-Panel--collapsible.ais-Panel--collapsed .ais-Panel-footer{display:none}.ais-Panel--collapsible .ais-Panel-collapseButton{background:none;border:none;padding:0;position:absolute;left:0;top:0}.ais-Panel-header{border-bottom:1px solid #c4c8d8;font-size:.8rem;font-weight:700;margin-bottom:.5rem;padding-bottom:.5rem;text-transform:uppercase}.ais-Panel-footer{font-size:.8rem;margin-top:.5rem}.ais-RangeInput-input{height:1.5rem;line-height:1.5rem;padding:0 .2rem;width:5rem}.ais-RangeInput-separator{margin:0 .3rem}.ais-RangeInput-submit{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#0096db;border:none;border-radius:5px;color:#fff;font-size:.8rem;height:1.5rem;line-height:1.5rem;margin-right:.3rem;outline:none;padding:0 .5rem;transition:.2s ease-out}.ais-RangeInput-submit:focus,.ais-RangeInput-submit:hover{background-color:#0073a8}.ais-RatingMenu-count{color:#3a4570}.ais-Pagination-list{justify-content:center}.ais-Pagination-item+.ais-Pagination-item{margin-right:.3rem}.ais-Pagination-link{border:1px solid #c4c8d8;border-radius:5px;display:block;padding:.3rem .6rem;transition:background-color .2s ease-out}.ais-Pagination-link:focus,.ais-Pagination-link:hover{background-color:#e3e5ec}.ais-Pagination-item--disabled .ais-Pagination-link{color:#a5abc4;cursor:not-allowed;opacity:.6}.ais-Pagination-item--disabled .ais-Pagination-link:focus,.ais-Pagination-item--disabled .ais-Pagination-link:hover{background-color:#fff;color:#a5abc4}.ais-Pagination-item--selected .ais-Pagination-link{background-color:#0096db;border-color:#0096db;color:#fff}.ais-Pagination-item--selected .ais-Pagination-link:focus,.ais-Pagination-item--selected .ais-Pagination-link:hover{color:#fff}.ais-PoweredBy-text,.ais-Stats-text,.rheostat-tooltip,.rheostat-value{font-size:.8rem}.ais-PoweredBy-logo{margin-right:.3rem}.ais-RangeSlider .rheostat-progress{background-color:#495588}.ais-RangeSlider .rheostat-background{border-color:#878faf;box-sizing:border-box}.ais-RangeSlider .rheostat-handle{border-color:#878faf}.ais-RangeSlider .rheostat-marker{background-color:#878faf}.ais-Panel-body .ais-RangeSlider{margin:2rem 0}.ais-RangeSlider-handle{background:#fff;border:1px solid #46aeda;border-radius:50%;cursor:pointer;height:20px;position:relative;width:20px;z-index:1}.ais-RangeSlider-tooltip{background:#fff;font-size:.8em;position:absolute;top:-22px}.ais-RangeSlider-value{font-size:.8em;margin-right:-20px;padding-top:15px;position:absolute;text-align:center;width:40px}.ais-RangeSlider-marker{background:#ddd;height:5px;margin-right:-1px;position:absolute;width:1px}.ais-RatingMenu-item--disabled .ais-RatingMenu-count,.ais-RatingMenu-item--disabled .ais-RatingMenu-label{color:#c4c8d8}.ais-RatingMenu-item--selected{font-weight:700}.ais-RatingMenu-link{line-height:1.5}.ais-RatingMenu-link>*+*{margin-right:.3rem}.ais-RatingMenu-starIcon{fill:#ffc168;position:relative;top:-1px;width:15px}.ais-RatingMenu-item--disabled .ais-RatingMenu-starIcon{fill:#c4c8d8}.ais-HierarchicalMenu-searchBox>*,.ais-Menu-searchBox>*,.ais-RefinementList-searchBox>*{margin-bottom:.5rem}.ais-SearchBox-form{display:block;position:relative}.ais-SearchBox-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #c4c8d8;border-radius:5px;padding:.3rem 1.7rem;position:relative;width:100%}.ais-SearchBox-input::-webkit-input-placeholder{color:#a5aed1}.ais-SearchBox-input::-moz-placeholder{color:#a5aed1}.ais-SearchBox-input:-ms-input-placeholder{color:#a5aed1}.ais-SearchBox-input:-moz-placeholder{color:#a5aed1}.ais-SearchBox-loadingIndicator,.ais-SearchBox-reset,.ais-SearchBox-submit{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:20px;position:absolute;left:.3rem;top:50%;transform:translateY(-50%);width:20px;z-index:1}.ais-SearchBox-submit{right:.3rem}.ais-SearchBox-reset{left:.3rem}.ais-SearchBox-loadingIcon,.ais-SearchBox-resetIcon,.ais-SearchBox-submitIcon{right:50%;position:absolute;top:50%;transform:translateX(50%) translateY(-50%)}.ais-SearchBox-resetIcon path,.ais-SearchBox-submitIcon path{fill:#495588}.ais-SearchBox-submitIcon{height:14px;width:14px}.ais-SearchBox-resetIcon{height:12px;width:12px}.ais-SearchBox-loadingIcon{height:16px;width:16px}.ais-VoiceSearch-button{background-color:transparent;border:none;border-radius:50%;color:#3a4570;height:24px;padding:4px;width:24px}.ais-VoiceSearch-button svg{color:currentColor}.ais-VoiceSearch-button:hover{background-color:#a5aed1;color:#fff;cursor:pointer}.ais-VoiceSearch-button:disabled{color:#a5aed1}.ais-VoiceSearch-button:disabled:hover{background:inherit;color:#a5aed1;cursor:not-allowed} -.quant-search{display:flex;flex-wrap:wrap;gap:2rem}.quant-search__description{flex-basis:100%;margin:0 0 .5rem}.quant-search__facets{flex:0 0 240px;max-width:100%}.quant-search__facet{margin-bottom:1.5rem}.quant-search__facet-heading{font-weight:600;margin-bottom:.5rem}.quant-search__content{flex:1 1 320px;min-width:0}.quant-search__stats{font-size:.9em;margin:.75rem 0;opacity:.8}.quant-search .ais-Hits-list{display:block;margin:0}.quant-search .ais-Hits-item{border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid rgba(0,0,0,.1)}.quant-search__hit{display:flow-root;padding:1rem 0}.quant-search__hit a{text-decoration:none}.quant-search__hit img{float:left;height:auto;margin:0 1rem .5rem 0;max-width:120px}.quant-search__hit-title{font-size:1.1em;margin:0 0 .25rem}.quant-search__hit-summary{margin:0;opacity:.85}.quant-search__hit-tag{background:rgba(0,0,0,.06);border-radius:999px;display:inline-block;font-size:.8em;margin:.25rem 0 0 .25rem;padding:.1rem .5rem}.quant-search__empty{opacity:.8;padding:2rem 0;text-align:center}.quant-search--unavailable{border:1px dashed rgba(0,0,0,.3);padding:1rem}.quant-search .ais-Pagination{margin-top:1.5rem}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} +:where(.quant-search){--quant-search-gap:1rem;--quant-search-gap-xs:calc(var(--quant-search-gap)*0.25);--quant-search-gap-sm:calc(var(--quant-search-gap)*0.5);--quant-search-gap-md:calc(var(--quant-search-gap)*0.75);--quant-search-gap-lg:calc(var(--quant-search-gap)*1.5);--quant-search-gap-xl:calc(var(--quant-search-gap)*2.5);--quant-search-facets-width:14rem;--quant-search-content-min-width:20rem;--quant-search-hit-image-width:7.5rem;--quant-search-radius:0.375rem;--quant-search-accent:var(--wp--preset--color--contrast,currentcolor);--quant-search-muted:color-mix(in srgb,currentcolor 75%,transparent);--quant-search-border:color-mix(in srgb,currentcolor 18%,transparent);--quant-search-border-strong:color-mix(in srgb,currentcolor 45%,transparent);--quant-search-surface:color-mix(in srgb,currentcolor 6%,transparent);--quant-search-surface-hover:color-mix(in srgb,currentcolor 10%,transparent);--quant-search-input-background:transparent;--quant-search-highlight:rgba(255,210,70,.45);--quant-search-focus-ring:var(--quant-search-accent);--quant-search-focus-width:2px;--quant-search-disabled-opacity:0.55;--quant-search-font-size-small:0.875em;--quant-search-font-size-xsmall:0.8125em;--quant-search-facet-heading-size:0.75em;--quant-search-hit-title-size:1.25em;--quant-search-hit-summary-size:0.9375em}.quant-search{align-items:flex-start;container:quant-search/inline-size;display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xl)}.quant-search .ais-ClearRefinements,.quant-search .ais-Hits,.quant-search .ais-Menu,.quant-search .ais-MenuSelect,.quant-search .ais-Pagination,.quant-search .ais-RefinementList,.quant-search .ais-SearchBox,.quant-search .ais-Stats{color:inherit}.quant-search :where(a,button,input,select,[tabindex]):focus-visible{outline:var(--quant-search-focus-width) solid var(--quant-search-focus-ring);outline-offset:2px}.quant-search__description{flex-basis:100%;margin:0}.quant-search__facets{display:flex;flex:0 0 var(--quant-search-facets-width);flex-direction:column;gap:var(--quant-search-gap-lg);max-width:100%}.quant-search__facet{margin:0}.quant-search__facet:has(.ais-Menu--noRefinement),.quant-search__facet:has(.ais-MenuSelect--noRefinement),.quant-search__facet:has(.ais-RefinementList--noRefinement),.quant-search__facet:has(>div:empty){display:none}.quant-search__facets:not(:has(.ais-RefinementList,.ais-Menu,.ais-MenuSelect)){display:none}.quant-search__pagination:has(.ais-Pagination--noRefinement){display:none}.quant-search__facet-heading{border-bottom:1px solid var(--quant-search-border);font-size:var(--quant-search-facet-heading-size);font-weight:600;letter-spacing:.06em;line-height:1.4;margin:0 0 var(--quant-search-gap-sm);padding-bottom:var(--quant-search-gap-xs);text-transform:uppercase}.quant-search__content{display:flex;flex:1 1 var(--quant-search-content-min-width);flex-direction:column;gap:var(--quant-search-gap);min-width:0}.quant-search__stats{color:var(--quant-search-muted);font-size:var(--quant-search-font-size-small);margin:0}.quant-search .ais-SearchBox-form{background:none;height:auto}.quant-search .ais-SearchBox-input{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) 2.5rem var(--quant-search-gap-sm) 2.75rem;width:100%}.quant-search .ais-SearchBox-input:focus{border-color:var(--quant-search-accent);box-shadow:none}.quant-search .ais-SearchBox-input::-moz-placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-input::placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset,.quant-search .ais-SearchBox-submit{border-radius:var(--quant-search-radius);color:inherit;height:1.75rem;width:1.75rem}.quant-search .ais-SearchBox-submit{right:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset{left:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-resetIcon path,.quant-search .ais-SearchBox-submitIcon path{fill:currentcolor}.quant-search__fallback{display:flex;gap:var(--quant-search-gap-sm)}.quant-search__fallback label{flex:1;min-width:0}.quant-search__fallback button,.quant-search__fallback input[type=search]{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) var(--quant-search-gap-md)}.quant-search__fallback input[type=search]{width:100%}.quant-search__fallback button{background:transparent;cursor:pointer}.quant-search .ais-ClearRefinements-button{align-items:center;background:transparent;border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);color:inherit;cursor:pointer;display:inline-flex;font:inherit;font-size:var(--quant-search-font-size-small);font-weight:500;line-height:1.2;min-height:2.25rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-md)}.quant-search .ais-ClearRefinements-button--disabled,.quant-search .ais-ClearRefinements-button:disabled{background:transparent;color:inherit;cursor:not-allowed;opacity:var(--quant-search-disabled-opacity)}.quant-search .ais-ClearRefinements-button:hover:not(:disabled){background:var(--quant-search-surface-hover)}.quant-search .ais-Menu-list,.quant-search .ais-RefinementList-list{display:flex;flex-direction:column;gap:var(--quant-search-gap-xs);list-style:none;margin:0;padding:0}.quant-search .ais-Menu-item,.quant-search .ais-RefinementList-item{margin:0;padding:0}.quant-search .ais-Menu-link,.quant-search .ais-RefinementList-label{align-items:center;color:inherit;cursor:pointer;display:flex;gap:var(--quant-search-gap-sm);line-height:1.3;min-height:1.75rem;text-decoration:none}.quant-search .ais-RefinementList-checkbox{accent-color:var(--quant-search-accent);cursor:pointer;flex:none;height:1.0625rem;margin:0;width:1.0625rem}.quant-search .ais-Menu-label,.quant-search .ais-RefinementList-labelText{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.quant-search .ais-Menu-item--selected .ais-Menu-label,.quant-search .ais-RefinementList-item--selected .ais-RefinementList-labelText{font-weight:600}.quant-search .ais-Menu-count,.quant-search .ais-RefinementList-count{background:var(--quant-search-surface);border:0;border-radius:999px;color:var(--quant-search-muted);flex:none;font-size:var(--quant-search-font-size-xsmall);font-variant-numeric:tabular-nums;line-height:1.6;margin:0 auto 0 0;padding:0 var(--quant-search-gap-sm)}.quant-search .ais-MenuSelect-select{background-color:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.5rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-sm);width:100%}.quant-search .ais-Menu-showMore,.quant-search .ais-RefinementList-showMore{background:none;border:0;color:inherit;cursor:pointer;font:inherit;font-size:var(--quant-search-font-size-small);margin-top:var(--quant-search-gap-sm);padding:0;text-decoration:underline}.quant-search .ais-Hits-list{display:block;list-style:none;margin:0;padding:0}.quant-search .ais-Hits-item{background:none;border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid var(--quant-search-border)}.quant-search__hit-title{font-size:var(--quant-search-hit-title-size);font-weight:600;line-height:1.3;margin:0 0 var(--quant-search-gap-xs)}.quant-search__hit-summary{color:var(--quant-search-muted);font-size:var(--quant-search-hit-summary-size);line-height:1.55;margin:0}.quant-search__hit-tag{background:var(--quant-search-surface);border:1px solid var(--quant-search-border);border-radius:999px;color:var(--quant-search-muted);display:inline-block;font-size:var(--quant-search-font-size-xsmall);line-height:1.5;margin:0;padding:.125em var(--quant-search-gap-sm)}.quant-search__hit{display:flow-root;padding:var(--quant-search-gap-lg) 0}.quant-search__hit a{color:inherit;text-decoration:none}.quant-search__hit a:focus-visible .quant-search__hit-title,.quant-search__hit a:hover .quant-search__hit-title{text-decoration:underline;text-underline-offset:.15em}.quant-search__hit img{aspect-ratio:4/3;border-radius:var(--quant-search-radius);float:left;height:auto;margin:0 var(--quant-search-gap) var(--quant-search-gap-sm) 0;max-width:35%;-o-object-fit:cover;object-fit:cover;width:var(--quant-search-hit-image-width)}.quant-search__hit>div:has(.quant-search__hit-tag){display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);margin-top:var(--quant-search-gap-md)}.quant-search .ais-Hits-item:first-child .quant-search__hit{padding-top:var(--quant-search-gap-sm)}.quant-search .ais-Highlight-highlighted,.quant-search .ais-Snippet-highlighted{background:var(--quant-search-highlight);border-radius:.15em;color:inherit}.quant-search__empty{color:var(--quant-search-muted);padding:var(--quant-search-gap-xl) 0;text-align:center}.quant-search__empty h4{color:inherit;margin:0 0 var(--quant-search-gap-sm)}.quant-search__empty p{margin:0}.quant-search--unavailable{border:1px dashed var(--quant-search-border-strong);border-radius:var(--quant-search-radius);padding:var(--quant-search-gap)}.quant-search--unavailable p{margin:0}.quant-search .ais-Pagination{margin-top:var(--quant-search-gap)}.quant-search .ais-Pagination-list{display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);justify-content:center;list-style:none;margin:0;padding:0}.quant-search .ais-Pagination-item{margin:0}.quant-search .ais-Pagination-link{align-items:center;background:transparent;border:1px solid var(--quant-search-border);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;display:inline-flex;font-variant-numeric:tabular-nums;height:2.5rem;justify-content:center;line-height:1;min-width:2.5rem;padding:0 var(--quant-search-gap-sm);text-decoration:none}.quant-search .ais-Pagination-link:hover{background:var(--quant-search-surface-hover)}.quant-search .ais-Pagination-item--selected .ais-Pagination-link{background:transparent;border:2px solid var(--quant-search-accent);color:inherit;font-weight:600}.quant-search .ais-Pagination-item--disabled .ais-Pagination-link{background:transparent;color:inherit;opacity:var(--quant-search-disabled-opacity)}@container quant-search (max-width: 37.5rem){.quant-search__facets{display:grid;flex-basis:100%;gap:var(--quant-search-gap) var(--quant-search-gap-lg);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}.quant-search__clear{grid-column:1/-1}.quant-search__content{flex-basis:100%}.quant-search__hit img{width:calc(var(--quant-search-hit-image-width)*.7)}}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} diff --git a/plugins/quant/assets/build/search.asset.php b/plugins/quant/assets/build/search.asset.php index 13d2db0..d467cf8 100644 --- a/plugins/quant/assets/build/search.asset.php +++ b/plugins/quant/assets/build/search.asset.php @@ -1 +1 @@ - array(), 'version' => 'eeb5f48741bebf58d1b5'); + array(), 'version' => 'b0156f76cca6d181ecfd'); diff --git a/plugins/quant/assets/build/search.css b/plugins/quant/assets/build/search.css index c52f003..72d678c 100644 --- a/plugins/quant/assets/build/search.css +++ b/plugins/quant/assets/build/search.css @@ -1,2 +1,2 @@ .ais-Breadcrumb-list,.ais-CurrentRefinements-list,.ais-HierarchicalMenu-list,.ais-Hits-list,.ais-InfiniteHits-list,.ais-InfiniteResults-list,.ais-Menu-list,.ais-NumericMenu-list,.ais-Pagination-list,.ais-RatingMenu-list,.ais-RefinementList-list,.ais-Results-list,.ais-ToggleRefinement-list{list-style:none;margin:0;padding:0}.ais-ClearRefinements-button,.ais-CurrentRefinements-delete,.ais-CurrentRefinements-reset,.ais-GeoSearch-redo,.ais-GeoSearch-reset,.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-InfiniteResults-loadMore,.ais-Menu-showMore,.ais-RangeInput-submit,.ais-RefinementList-showMore,.ais-SearchBox-reset,.ais-SearchBox-submit,.ais-VoiceSearch-button{background:none;border:0;color:inherit;cursor:pointer;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ais-ClearRefinements-button::-moz-focus-inner,.ais-CurrentRefinements-delete::-moz-focus-inner,.ais-CurrentRefinements-reset::-moz-focus-inner,.ais-GeoSearch-redo::-moz-focus-inner,.ais-GeoSearch-reset::-moz-focus-inner,.ais-HierarchicalMenu-showMore::-moz-focus-inner,.ais-InfiniteHits-loadMore::-moz-focus-inner,.ais-InfiniteHits-loadPrevious::-moz-focus-inner,.ais-InfiniteResults-loadMore::-moz-focus-inner,.ais-Menu-showMore::-moz-focus-inner,.ais-RangeInput-submit::-moz-focus-inner,.ais-RefinementList-showMore::-moz-focus-inner,.ais-SearchBox-reset::-moz-focus-inner,.ais-SearchBox-submit::-moz-focus-inner,.ais-VoiceSearch-button::-moz-focus-inner{border:0;padding:0}.ais-ClearRefinements-button[disabled],.ais-CurrentRefinements-delete[disabled],.ais-CurrentRefinements-reset[disabled],.ais-GeoSearch-redo[disabled],.ais-GeoSearch-reset[disabled],.ais-HierarchicalMenu-showMore[disabled],.ais-InfiniteHits-loadMore[disabled],.ais-InfiniteHits-loadPrevious[disabled],.ais-InfiniteResults-loadMore[disabled],.ais-Menu-showMore[disabled],.ais-RangeInput-submit[disabled],.ais-RefinementList-showMore[disabled],.ais-SearchBox-reset[disabled],.ais-SearchBox-submit[disabled],.ais-VoiceSearch-button[disabled]{cursor:default}.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-Menu-showMore,.ais-RefinementList-showMore{overflow-anchor:none}.ais-Breadcrumb-item,.ais-Breadcrumb-list,.ais-Pagination-list,.ais-PoweredBy,.ais-RangeInput-form,.ais-RatingMenu-link{align-items:center;display:flex}.ais-GeoSearch,.ais-GeoSearch-map{height:100%}.ais-HierarchicalMenu-list .ais-HierarchicalMenu-list{margin-left:1em}.ais-PoweredBy-logo{display:block;height:1.2em;width:auto}.ais-RatingMenu-starIcon{display:block;height:20px;width:20px}.ais-SearchBox-input::-ms-clear,.ais-SearchBox-input::-ms-reveal{display:none;height:0;width:0}.ais-SearchBox-input::-webkit-search-cancel-button,.ais-SearchBox-input::-webkit-search-decoration,.ais-SearchBox-input::-webkit-search-results-button,.ais-SearchBox-input::-webkit-search-results-decoration{display:none}.ais-RangeSlider .rheostat{margin-bottom:40px;margin-top:40px;overflow:visible}.ais-RangeSlider .rheostat-background{height:6px;top:0;width:100%}.ais-RangeSlider .rheostat-handle{margin-left:-12px;top:-7px}.ais-RangeSlider .rheostat-background{background-color:#fff;border:1px solid #aaa;position:relative}.ais-RangeSlider .rheostat-progress{background-color:#333;height:4px;position:absolute;top:1px}.rheostat-handle{background-color:#fff;border:1px solid #333;border-radius:50%;cursor:grab;height:20px;position:relative;width:20px;z-index:1}.rheostat-marker{background-color:#aaa;height:5px;margin-left:-1px;position:absolute;width:1px}.rheostat-marker--large{height:9px}.rheostat-value{padding-top:15px}.rheostat-tooltip,.rheostat-value{margin-left:50%;position:absolute;text-align:center;transform:translateX(-50%)}.rheostat-tooltip{top:-22px}[class^=ais-]{box-sizing:border-box;font-size:1rem}a[class^=ais-]{text-decoration:none}.ais-Breadcrumb,.ais-ClearRefinements,.ais-CurrentRefinements,.ais-GeoSearch,.ais-HierarchicalMenu,.ais-Hits,.ais-HitsPerPage,.ais-InfiniteHits,.ais-InfiniteResults,.ais-Menu,.ais-MenuSelect,.ais-NumericMenu,.ais-NumericSelector,.ais-Pagination,.ais-Panel,.ais-PoweredBy,.ais-RangeInput,.ais-RangeSlider,.ais-RatingMenu,.ais-RefinementList,.ais-Results,.ais-ResultsPerPage,.ais-SearchBox,.ais-SortBy,.ais-Stats,.ais-ToggleRefinement{color:#3a4570}.ais-Breadcrumb-item--selected,.ais-HierarchicalMenu-item--selected,.ais-Menu-item--selected{font-weight:700}.ais-Breadcrumb-separator{font-weight:400;margin:0 .3em}.ais-Breadcrumb-link,.ais-HierarchicalMenu-link,.ais-Menu-link,.ais-Pagination-link,.ais-RatingMenu-link{color:#0096db;transition:color .2s ease-out}.ais-Breadcrumb-link:focus,.ais-Breadcrumb-link:hover,.ais-HierarchicalMenu-link:focus,.ais-HierarchicalMenu-link:hover,.ais-Menu-link:focus,.ais-Menu-link:hover,.ais-Pagination-link:focus,.ais-Pagination-link:hover,.ais-RatingMenu-link:focus,.ais-RatingMenu-link:hover{color:#0073a8}.ais-ClearRefinements-button,.ais-CurrentRefinements-reset,.ais-GeoSearch-redo,.ais-GeoSearch-reset,.ais-HierarchicalMenu-showMore,.ais-InfiniteHits-loadMore,.ais-InfiniteHits-loadPrevious,.ais-InfiniteResults-loadMore,.ais-Menu-showMore,.ais-RefinementList-showMore{background-color:#0096db;border-radius:5px;color:#fff;font-size:.8rem;outline:none;padding:.3rem .5rem;transition:background-color .2s ease-out}.ais-ClearRefinements-button:focus,.ais-ClearRefinements-button:hover,.ais-CurrentRefinements-reset:focus,.ais-CurrentRefinements-reset:hover,.ais-GeoSearch-redo:focus,.ais-GeoSearch-redo:hover,.ais-GeoSearch-reset:focus,.ais-GeoSearch-reset:hover,.ais-HierarchicalMenu-showMore:focus,.ais-HierarchicalMenu-showMore:hover,.ais-InfiniteHits-loadMore:focus,.ais-InfiniteHits-loadMore:hover,.ais-InfiniteHits-loadPrevious:focus,.ais-InfiniteHits-loadPrevious:hover,.ais-InfiniteResults-loadMore:focus,.ais-InfiniteResults-loadMore:hover,.ais-Menu-showMore:focus,.ais-Menu-showMore:hover,.ais-RefinementList-showMore:focus,.ais-RefinementList-showMore:hover{background-color:#0073a8}.ais-ClearRefinements-button--disabled,.ais-GeoSearch-redo--disabled,.ais-GeoSearch-reset--disabled,.ais-HierarchicalMenu-showMore--disabled,.ais-InfiniteHits-loadMore--disabled,.ais-InfiniteResults-loadMore--disabled,.ais-Menu-showMore--disabled,.ais-RefinementList-showMore--disabled{cursor:not-allowed;opacity:.6}.ais-ClearRefinements-button--disabled:focus,.ais-ClearRefinements-button--disabled:hover,.ais-GeoSearch-redo--disabled:focus,.ais-GeoSearch-redo--disabled:hover,.ais-GeoSearch-reset--disabled:focus,.ais-GeoSearch-reset--disabled:hover,.ais-HierarchicalMenu-showMore--disabled:focus,.ais-HierarchicalMenu-showMore--disabled:hover,.ais-InfiniteHits-loadMore--disabled:focus,.ais-InfiniteHits-loadMore--disabled:hover,.ais-InfiniteResults-loadMore--disabled:focus,.ais-InfiniteResults-loadMore--disabled:hover,.ais-Menu-showMore--disabled:focus,.ais-Menu-showMore--disabled:hover,.ais-RefinementList-showMore--disabled:focus,.ais-RefinementList-showMore--disabled:hover{background-color:#0096db}.ais-InfiniteHits-loadPrevious--disabled{display:none}.ais-CurrentRefinements{margin-top:-.3rem}.ais-CurrentRefinements,.ais-CurrentRefinements-list{display:flex;flex-wrap:wrap}.ais-CurrentRefinements-item{background-color:#495588;border-radius:5px;display:flex;margin-right:.3rem;margin-top:.3rem;padding:.3rem .5rem}.ais-CurrentRefinements-category{display:flex;margin-left:.3em}.ais-CurrentRefinements-delete{margin-left:.3rem}.ais-CurrentRefinements-categoryLabel,.ais-CurrentRefinements-delete,.ais-CurrentRefinements-label{color:#fff;font-size:.8rem;white-space:nowrap}.ais-CurrentRefinements-reset{margin-top:.3rem;white-space:nowrap}.ais-CurrentRefinements-reset+.ais-CurrentRefinements-list{margin-left:.3rem}.ais-GeoSearch{position:relative}.ais-GeoSearch-control{left:3.75rem;position:absolute;top:.8rem}.ais-GeoSearch-label{background-color:#fff;border-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,.1);display:block;font-size:.8rem;outline:none;padding:.3rem .5rem;transition:background-color .2s ease-out}.ais-GeoSearch-input{margin:0 .25rem 0 0}.ais-GeoSearch-label,.ais-GeoSearch-redo,.ais-GeoSearch-reset{white-space:nowrap}.ais-GeoSearch-reset{bottom:1.25rem;left:50%;position:absolute;transform:translateX(-50%)}.ais-HierarchicalMenu-link,.ais-Menu-link{display:block;line-height:1.5}.ais-HierarchicalMenu-list,.ais-Menu-list,.ais-NumericMenu-list,.ais-RatingMenu-list,.ais-RefinementList-list{font-weight:400;line-height:1.5}.ais-HierarchicalMenu-link:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%233A4570%27 d=%27m7.3 24-2.8-2.8 9.3-9.2-9.3-9.2L7.3 0l12.2 12z%27/%3E%3C/svg%3E");background-size:100% 100%;content:"";display:none;height:10px;margin-left:.3em;width:10px}.ais-HierarchicalMenu-item--parent>.ais-HierarchicalMenu-link:after{display:inline-block}.ais-HierarchicalMenu-item--selected>.ais-HierarchicalMenu-link:after{transform:rotate(90deg)}.ais-CurrentRefinements-count,.ais-RatingMenu-count{font-size:.8rem}.ais-CurrentRefinements-count:before,.ais-RatingMenu-count:before{content:"("}.ais-CurrentRefinements-count:after,.ais-RatingMenu-count:after{content:")"}.ais-HierarchicalMenu-count,.ais-Menu-count,.ais-RefinementList-count,.ais-ToggleRefinement-count{background-color:#dfe2ee;border-radius:8px;color:#3a4570;font-size:.8rem;padding:.1rem .4rem}.ais-HierarchicalMenu-showMore,.ais-Menu-showMore,.ais-RefinementList-showMore{margin-top:.5rem}.ais-Highlight-highlighted,.ais-Snippet-highlighted{background-color:#ffc168}.ais-Hits-list,.ais-InfiniteHits-list,.ais-InfiniteResults-list,.ais-Results-list{display:flex;flex-wrap:wrap;margin-left:-1rem;margin-top:-1rem}.ais-Panel-body .ais-Hits-list,.ais-Panel-body .ais-InfiniteHits-list,.ais-Panel-body .ais-InfiniteResults-list,.ais-Panel-body .ais-Results-list{margin:.5rem 0 0 -1rem}.ais-Hits-item,.ais-InfiniteHits-item,.ais-InfiniteResults-item,.ais-Results-item{border:1px solid #c4c8d8;box-shadow:0 2px 5px 0 #e3e5ec;margin-left:1rem;margin-top:1rem;padding:1rem;width:calc(25% - 1rem)}.ais-Panel-body .ais-Hits-item,.ais-Panel-body .ais-InfiniteHits-item,.ais-Panel-body .ais-InfiniteResults-item,.ais-Panel-body .ais-Results-item{margin:.5rem 0 .5rem 1rem}.ais-InfiniteHits-loadMore,.ais-InfiniteResults-loadMore{margin-top:1rem}.ais-InfiniteHits-loadPrevious{margin-bottom:1rem}.ais-HitsPerPage-select,.ais-MenuSelect-select,.ais-NumericSelector-select,.ais-ResultsPerPage-select,.ais-SortBy-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%233A4570%27 d=%27m0 7.3 2.8-2.8 9.2 9.3 9.2-9.3L24 7.3 12 19.5z%27/%3E%3C/svg%3E");background-position:92% 50%;background-repeat:no-repeat;background-size:10px 10px;border:1px solid #c4c8d8;border-radius:5px;max-width:100%;padding:.3rem 2rem .3rem .3rem}.ais-Panel--collapsible{position:relative}.ais-Panel--collapsible.ais-Panel--collapsed .ais-Panel-body,.ais-Panel--collapsible.ais-Panel--collapsed .ais-Panel-footer{display:none}.ais-Panel--collapsible .ais-Panel-collapseButton{background:none;border:none;padding:0;position:absolute;right:0;top:0}.ais-Panel-header{border-bottom:1px solid #c4c8d8;font-size:.8rem;font-weight:700;margin-bottom:.5rem;padding-bottom:.5rem;text-transform:uppercase}.ais-Panel-footer{font-size:.8rem;margin-top:.5rem}.ais-RangeInput-input{height:1.5rem;line-height:1.5rem;padding:0 .2rem;width:5rem}.ais-RangeInput-separator{margin:0 .3rem}.ais-RangeInput-submit{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#0096db;border:none;border-radius:5px;color:#fff;font-size:.8rem;height:1.5rem;line-height:1.5rem;margin-left:.3rem;outline:none;padding:0 .5rem;transition:.2s ease-out}.ais-RangeInput-submit:focus,.ais-RangeInput-submit:hover{background-color:#0073a8}.ais-RatingMenu-count{color:#3a4570}.ais-Pagination-list{justify-content:center}.ais-Pagination-item+.ais-Pagination-item{margin-left:.3rem}.ais-Pagination-link{border:1px solid #c4c8d8;border-radius:5px;display:block;padding:.3rem .6rem;transition:background-color .2s ease-out}.ais-Pagination-link:focus,.ais-Pagination-link:hover{background-color:#e3e5ec}.ais-Pagination-item--disabled .ais-Pagination-link{color:#a5abc4;cursor:not-allowed;opacity:.6}.ais-Pagination-item--disabled .ais-Pagination-link:focus,.ais-Pagination-item--disabled .ais-Pagination-link:hover{background-color:#fff;color:#a5abc4}.ais-Pagination-item--selected .ais-Pagination-link{background-color:#0096db;border-color:#0096db;color:#fff}.ais-Pagination-item--selected .ais-Pagination-link:focus,.ais-Pagination-item--selected .ais-Pagination-link:hover{color:#fff}.ais-PoweredBy-text,.ais-Stats-text,.rheostat-tooltip,.rheostat-value{font-size:.8rem}.ais-PoweredBy-logo{margin-left:.3rem}.ais-RangeSlider .rheostat-progress{background-color:#495588}.ais-RangeSlider .rheostat-background{border-color:#878faf;box-sizing:border-box}.ais-RangeSlider .rheostat-handle{border-color:#878faf}.ais-RangeSlider .rheostat-marker{background-color:#878faf}.ais-Panel-body .ais-RangeSlider{margin:2rem 0}.ais-RangeSlider-handle{background:#fff;border:1px solid #46aeda;border-radius:50%;cursor:pointer;height:20px;position:relative;width:20px;z-index:1}.ais-RangeSlider-tooltip{background:#fff;font-size:.8em;position:absolute;top:-22px}.ais-RangeSlider-value{font-size:.8em;margin-left:-20px;padding-top:15px;position:absolute;text-align:center;width:40px}.ais-RangeSlider-marker{background:#ddd;height:5px;margin-left:-1px;position:absolute;width:1px}.ais-RatingMenu-item--disabled .ais-RatingMenu-count,.ais-RatingMenu-item--disabled .ais-RatingMenu-label{color:#c4c8d8}.ais-RatingMenu-item--selected{font-weight:700}.ais-RatingMenu-link{line-height:1.5}.ais-RatingMenu-link>*+*{margin-left:.3rem}.ais-RatingMenu-starIcon{fill:#ffc168;position:relative;top:-1px;width:15px}.ais-RatingMenu-item--disabled .ais-RatingMenu-starIcon{fill:#c4c8d8}.ais-HierarchicalMenu-searchBox>*,.ais-Menu-searchBox>*,.ais-RefinementList-searchBox>*{margin-bottom:.5rem}.ais-SearchBox-form{display:block;position:relative}.ais-SearchBox-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #c4c8d8;border-radius:5px;padding:.3rem 1.7rem;position:relative;width:100%}.ais-SearchBox-input::-webkit-input-placeholder{color:#a5aed1}.ais-SearchBox-input::-moz-placeholder{color:#a5aed1}.ais-SearchBox-input:-ms-input-placeholder{color:#a5aed1}.ais-SearchBox-input:-moz-placeholder{color:#a5aed1}.ais-SearchBox-loadingIndicator,.ais-SearchBox-reset,.ais-SearchBox-submit{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:20px;position:absolute;right:.3rem;top:50%;transform:translateY(-50%);width:20px;z-index:1}.ais-SearchBox-submit{left:.3rem}.ais-SearchBox-reset{right:.3rem}.ais-SearchBox-loadingIcon,.ais-SearchBox-resetIcon,.ais-SearchBox-submitIcon{left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%)}.ais-SearchBox-resetIcon path,.ais-SearchBox-submitIcon path{fill:#495588}.ais-SearchBox-submitIcon{height:14px;width:14px}.ais-SearchBox-resetIcon{height:12px;width:12px}.ais-SearchBox-loadingIcon{height:16px;width:16px}.ais-VoiceSearch-button{background-color:transparent;border:none;border-radius:50%;color:#3a4570;height:24px;padding:4px;width:24px}.ais-VoiceSearch-button svg{color:currentColor}.ais-VoiceSearch-button:hover{background-color:#a5aed1;color:#fff;cursor:pointer}.ais-VoiceSearch-button:disabled{color:#a5aed1}.ais-VoiceSearch-button:disabled:hover{background:inherit;color:#a5aed1;cursor:not-allowed} -.quant-search{display:flex;flex-wrap:wrap;gap:2rem}.quant-search__description{flex-basis:100%;margin:0 0 .5rem}.quant-search__facets{flex:0 0 240px;max-width:100%}.quant-search__facet{margin-bottom:1.5rem}.quant-search__facet-heading{font-weight:600;margin-bottom:.5rem}.quant-search__content{flex:1 1 320px;min-width:0}.quant-search__stats{font-size:.9em;margin:.75rem 0;opacity:.8}.quant-search .ais-Hits-list{display:block;margin:0}.quant-search .ais-Hits-item{border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid rgba(0,0,0,.1)}.quant-search__hit{display:flow-root;padding:1rem 0}.quant-search__hit a{text-decoration:none}.quant-search__hit img{float:right;height:auto;margin:0 0 .5rem 1rem;max-width:120px}.quant-search__hit-title{font-size:1.1em;margin:0 0 .25rem}.quant-search__hit-summary{margin:0;opacity:.85}.quant-search__hit-tag{background:rgba(0,0,0,.06);border-radius:999px;display:inline-block;font-size:.8em;margin:.25rem .25rem 0 0;padding:.1rem .5rem}.quant-search__empty{opacity:.8;padding:2rem 0;text-align:center}.quant-search--unavailable{border:1px dashed rgba(0,0,0,.3);padding:1rem}.quant-search .ais-Pagination{margin-top:1.5rem}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} +:where(.quant-search){--quant-search-gap:1rem;--quant-search-gap-xs:calc(var(--quant-search-gap)*0.25);--quant-search-gap-sm:calc(var(--quant-search-gap)*0.5);--quant-search-gap-md:calc(var(--quant-search-gap)*0.75);--quant-search-gap-lg:calc(var(--quant-search-gap)*1.5);--quant-search-gap-xl:calc(var(--quant-search-gap)*2.5);--quant-search-facets-width:14rem;--quant-search-content-min-width:20rem;--quant-search-hit-image-width:7.5rem;--quant-search-radius:0.375rem;--quant-search-accent:var(--wp--preset--color--contrast,currentcolor);--quant-search-muted:color-mix(in srgb,currentcolor 75%,transparent);--quant-search-border:color-mix(in srgb,currentcolor 18%,transparent);--quant-search-border-strong:color-mix(in srgb,currentcolor 45%,transparent);--quant-search-surface:color-mix(in srgb,currentcolor 6%,transparent);--quant-search-surface-hover:color-mix(in srgb,currentcolor 10%,transparent);--quant-search-input-background:transparent;--quant-search-highlight:rgba(255,210,70,.45);--quant-search-focus-ring:var(--quant-search-accent);--quant-search-focus-width:2px;--quant-search-disabled-opacity:0.55;--quant-search-font-size-small:0.875em;--quant-search-font-size-xsmall:0.8125em;--quant-search-facet-heading-size:0.75em;--quant-search-hit-title-size:1.25em;--quant-search-hit-summary-size:0.9375em}.quant-search{align-items:flex-start;container:quant-search/inline-size;display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xl)}.quant-search .ais-ClearRefinements,.quant-search .ais-Hits,.quant-search .ais-Menu,.quant-search .ais-MenuSelect,.quant-search .ais-Pagination,.quant-search .ais-RefinementList,.quant-search .ais-SearchBox,.quant-search .ais-Stats{color:inherit}.quant-search :where(a,button,input,select,[tabindex]):focus-visible{outline:var(--quant-search-focus-width) solid var(--quant-search-focus-ring);outline-offset:2px}.quant-search__description{flex-basis:100%;margin:0}.quant-search__facets{display:flex;flex:0 0 var(--quant-search-facets-width);flex-direction:column;gap:var(--quant-search-gap-lg);max-width:100%}.quant-search__facet{margin:0}.quant-search__facet:has(.ais-Menu--noRefinement),.quant-search__facet:has(.ais-MenuSelect--noRefinement),.quant-search__facet:has(.ais-RefinementList--noRefinement),.quant-search__facet:has(>div:empty){display:none}.quant-search__facets:not(:has(.ais-RefinementList,.ais-Menu,.ais-MenuSelect)){display:none}.quant-search__pagination:has(.ais-Pagination--noRefinement){display:none}.quant-search__facet-heading{border-bottom:1px solid var(--quant-search-border);font-size:var(--quant-search-facet-heading-size);font-weight:600;letter-spacing:.06em;line-height:1.4;margin:0 0 var(--quant-search-gap-sm);padding-bottom:var(--quant-search-gap-xs);text-transform:uppercase}.quant-search__content{display:flex;flex:1 1 var(--quant-search-content-min-width);flex-direction:column;gap:var(--quant-search-gap);min-width:0}.quant-search__stats{color:var(--quant-search-muted);font-size:var(--quant-search-font-size-small);margin:0}.quant-search .ais-SearchBox-form{background:none;height:auto}.quant-search .ais-SearchBox-input{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) 2.75rem var(--quant-search-gap-sm) 2.5rem;width:100%}.quant-search .ais-SearchBox-input:focus{border-color:var(--quant-search-accent);box-shadow:none}.quant-search .ais-SearchBox-input::-moz-placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-input::placeholder{color:var(--quant-search-muted)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset,.quant-search .ais-SearchBox-submit{border-radius:var(--quant-search-radius);color:inherit;height:1.75rem;width:1.75rem}.quant-search .ais-SearchBox-submit{left:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-loadingIndicator,.quant-search .ais-SearchBox-reset{right:var(--quant-search-gap-sm)}.quant-search .ais-SearchBox-resetIcon path,.quant-search .ais-SearchBox-submitIcon path{fill:currentcolor}.quant-search__fallback{display:flex;gap:var(--quant-search-gap-sm)}.quant-search__fallback label{flex:1;min-width:0}.quant-search__fallback button,.quant-search__fallback input[type=search]{background:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.75rem;padding:var(--quant-search-gap-sm) var(--quant-search-gap-md)}.quant-search__fallback input[type=search]{width:100%}.quant-search__fallback button{background:transparent;cursor:pointer}.quant-search .ais-ClearRefinements-button{align-items:center;background:transparent;border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);color:inherit;cursor:pointer;display:inline-flex;font:inherit;font-size:var(--quant-search-font-size-small);font-weight:500;line-height:1.2;min-height:2.25rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-md)}.quant-search .ais-ClearRefinements-button--disabled,.quant-search .ais-ClearRefinements-button:disabled{background:transparent;color:inherit;cursor:not-allowed;opacity:var(--quant-search-disabled-opacity)}.quant-search .ais-ClearRefinements-button:hover:not(:disabled){background:var(--quant-search-surface-hover)}.quant-search .ais-Menu-list,.quant-search .ais-RefinementList-list{display:flex;flex-direction:column;gap:var(--quant-search-gap-xs);list-style:none;margin:0;padding:0}.quant-search .ais-Menu-item,.quant-search .ais-RefinementList-item{margin:0;padding:0}.quant-search .ais-Menu-link,.quant-search .ais-RefinementList-label{align-items:center;color:inherit;cursor:pointer;display:flex;gap:var(--quant-search-gap-sm);line-height:1.3;min-height:1.75rem;text-decoration:none}.quant-search .ais-RefinementList-checkbox{accent-color:var(--quant-search-accent);cursor:pointer;flex:none;height:1.0625rem;margin:0;width:1.0625rem}.quant-search .ais-Menu-label,.quant-search .ais-RefinementList-labelText{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.quant-search .ais-Menu-item--selected .ais-Menu-label,.quant-search .ais-RefinementList-item--selected .ais-RefinementList-labelText{font-weight:600}.quant-search .ais-Menu-count,.quant-search .ais-RefinementList-count{background:var(--quant-search-surface);border:0;border-radius:999px;color:var(--quant-search-muted);flex:none;font-size:var(--quant-search-font-size-xsmall);font-variant-numeric:tabular-nums;line-height:1.6;margin:0 0 0 auto;padding:0 var(--quant-search-gap-sm)}.quant-search .ais-MenuSelect-select{background-color:var(--quant-search-input-background);border:1px solid var(--quant-search-border-strong);border-radius:var(--quant-search-radius);box-sizing:border-box;color:inherit;font:inherit;min-height:2.5rem;padding:var(--quant-search-gap-xs) var(--quant-search-gap-sm);width:100%}.quant-search .ais-Menu-showMore,.quant-search .ais-RefinementList-showMore{background:none;border:0;color:inherit;cursor:pointer;font:inherit;font-size:var(--quant-search-font-size-small);margin-top:var(--quant-search-gap-sm);padding:0;text-decoration:underline}.quant-search .ais-Hits-list{display:block;list-style:none;margin:0;padding:0}.quant-search .ais-Hits-item{background:none;border:0;box-shadow:none;margin:0;padding:0;width:100%}.quant-search .ais-Hits-item+.ais-Hits-item{border-top:1px solid var(--quant-search-border)}.quant-search__hit-title{font-size:var(--quant-search-hit-title-size);font-weight:600;line-height:1.3;margin:0 0 var(--quant-search-gap-xs)}.quant-search__hit-summary{color:var(--quant-search-muted);font-size:var(--quant-search-hit-summary-size);line-height:1.55;margin:0}.quant-search__hit-tag{background:var(--quant-search-surface);border:1px solid var(--quant-search-border);border-radius:999px;color:var(--quant-search-muted);display:inline-block;font-size:var(--quant-search-font-size-xsmall);line-height:1.5;margin:0;padding:.125em var(--quant-search-gap-sm)}.quant-search__hit{display:flow-root;padding:var(--quant-search-gap-lg) 0}.quant-search__hit a{color:inherit;text-decoration:none}.quant-search__hit a:focus-visible .quant-search__hit-title,.quant-search__hit a:hover .quant-search__hit-title{text-decoration:underline;text-underline-offset:.15em}.quant-search__hit img{aspect-ratio:4/3;border-radius:var(--quant-search-radius);float:right;height:auto;margin:0 0 var(--quant-search-gap-sm) var(--quant-search-gap);max-width:35%;-o-object-fit:cover;object-fit:cover;width:var(--quant-search-hit-image-width)}.quant-search__hit>div:has(.quant-search__hit-tag){display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);margin-top:var(--quant-search-gap-md)}.quant-search .ais-Hits-item:first-child .quant-search__hit{padding-top:var(--quant-search-gap-sm)}.quant-search .ais-Highlight-highlighted,.quant-search .ais-Snippet-highlighted{background:var(--quant-search-highlight);border-radius:.15em;color:inherit}.quant-search__empty{color:var(--quant-search-muted);padding:var(--quant-search-gap-xl) 0;text-align:center}.quant-search__empty h4{color:inherit;margin:0 0 var(--quant-search-gap-sm)}.quant-search__empty p{margin:0}.quant-search--unavailable{border:1px dashed var(--quant-search-border-strong);border-radius:var(--quant-search-radius);padding:var(--quant-search-gap)}.quant-search--unavailable p{margin:0}.quant-search .ais-Pagination{margin-top:var(--quant-search-gap)}.quant-search .ais-Pagination-list{display:flex;flex-wrap:wrap;gap:var(--quant-search-gap-xs);justify-content:center;list-style:none;margin:0;padding:0}.quant-search .ais-Pagination-item{margin:0}.quant-search .ais-Pagination-link{align-items:center;background:transparent;border:1px solid var(--quant-search-border);border-radius:var(--quant-search-radius);box-shadow:none;box-sizing:border-box;color:inherit;display:inline-flex;font-variant-numeric:tabular-nums;height:2.5rem;justify-content:center;line-height:1;min-width:2.5rem;padding:0 var(--quant-search-gap-sm);text-decoration:none}.quant-search .ais-Pagination-link:hover{background:var(--quant-search-surface-hover)}.quant-search .ais-Pagination-item--selected .ais-Pagination-link{background:transparent;border:2px solid var(--quant-search-accent);color:inherit;font-weight:600}.quant-search .ais-Pagination-item--disabled .ais-Pagination-link{background:transparent;color:inherit;opacity:var(--quant-search-disabled-opacity)}@container quant-search (max-width: 37.5rem){.quant-search__facets{display:grid;flex-basis:100%;gap:var(--quant-search-gap) var(--quant-search-gap-lg);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}.quant-search__clear{grid-column:1/-1}.quant-search__content{flex-basis:100%}.quant-search__hit img{width:calc(var(--quant-search-hit-image-width)*.7)}}.quant-search-autocomplete{max-width:480px}.quant-search-autocomplete .aa-Panel{z-index:1000}.quant-search-autocomplete .quant-autocomplete__title{font-size:1em;margin:0}.quant-search-autocomplete .quant-autocomplete__summary{font-size:.85em;margin:.25rem 0 0;opacity:.8} diff --git a/plugins/quant/assets/src/frontend/search.scss b/plugins/quant/assets/src/frontend/search.scss index 5a13bba..8922c66 100644 --- a/plugins/quant/assets/src/frontend/search.scss +++ b/plugins/quant/assets/src/frontend/search.scss @@ -1,38 +1,337 @@ /* Quant Search page and autocomplete styles. - Theme-neutral; themes can override. */ + + The page follows the theme: text, links and fonts are inherited, and the + quiet colours are mixes of the current text colour, so they also work on a + dark theme. Every value is a custom property on .quant-search; set them in + the theme to restyle the page. The readme lists them under "Styling the + search page". + + The defaults are in :where(), which has no specificity, so a theme rule on + .quant-search wins whatever the stylesheet order. */ +:where(.quant-search) { + // Spacing scale. Change --quant-search-gap to scale every space. + --quant-search-gap: 1rem; + --quant-search-gap-xs: calc(var(--quant-search-gap) * 0.25); + --quant-search-gap-sm: calc(var(--quant-search-gap) * 0.5); + --quant-search-gap-md: calc(var(--quant-search-gap) * 0.75); + --quant-search-gap-lg: calc(var(--quant-search-gap) * 1.5); + --quant-search-gap-xl: calc(var(--quant-search-gap) * 2.5); + + // Layout. + --quant-search-facets-width: 14rem; + --quant-search-content-min-width: 20rem; + --quant-search-hit-image-width: 7.5rem; + --quant-search-radius: 0.375rem; + + // Colours. The accent marks the checked boxes, the current page and the + // focus ring. It defaults to the block theme's text colour (or the + // inherited text colour), so it always contrasts with the background. + --quant-search-accent: var(--wp--preset--color--contrast, currentcolor); + --quant-search-muted: color-mix(in srgb, currentcolor 75%, transparent); + --quant-search-border: color-mix(in srgb, currentcolor 18%, transparent); + --quant-search-border-strong: color-mix(in srgb, currentcolor 45%, transparent); + --quant-search-surface: color-mix(in srgb, currentcolor 6%, transparent); + --quant-search-surface-hover: color-mix(in srgb, currentcolor 10%, transparent); + --quant-search-input-background: transparent; + --quant-search-highlight: rgb(255 210 70 / 45%); + --quant-search-focus-ring: var(--quant-search-accent); + --quant-search-focus-width: 2px; + --quant-search-disabled-opacity: 0.55; + + // Type. Sizes are relative to the theme's body text. + --quant-search-font-size-small: 0.875em; + --quant-search-font-size-xsmall: 0.8125em; + --quant-search-facet-heading-size: 0.75em; + --quant-search-hit-title-size: 1.25em; + --quant-search-hit-summary-size: 0.9375em; +} + .quant-search { display: flex; flex-wrap: wrap; - gap: 2rem; + align-items: flex-start; + gap: var(--quant-search-gap-xl); + container: quant-search / inline-size; + + // The instantsearch.css theme colours every widget navy; follow the theme. + .ais-ClearRefinements, + .ais-Hits, + .ais-Menu, + .ais-MenuSelect, + .ais-Pagination, + .ais-RefinementList, + .ais-SearchBox, + .ais-Stats { + color: inherit; + } + + // A visible focus ring on every control. + :where(a, button, input, select, [tabindex]):focus-visible { + outline: var(--quant-search-focus-width) solid var(--quant-search-focus-ring); + outline-offset: 2px; + } &__description { flex-basis: 100%; - margin: 0 0 0.5rem; + margin: 0; } &__facets { - flex: 0 0 240px; + display: flex; + flex: 0 0 var(--quant-search-facets-width); + flex-direction: column; + gap: var(--quant-search-gap-lg); max-width: 100%; } &__facet { - margin-bottom: 1.5rem; + margin: 0; + } + + // An empty facet (no values for this search, or no JavaScript to load + // them) is hidden with its heading. + &__facet:has(.ais-RefinementList--noRefinement), + &__facet:has(.ais-Menu--noRefinement), + &__facet:has(.ais-MenuSelect--noRefinement), + &__facet:has(> div:empty) { + display: none; + } + + // Without JavaScript no facet widget mounts: drop the empty column. + &__facets:not(:has(.ais-RefinementList, .ais-Menu, .ais-MenuSelect)) { + display: none; + } + + // One page of results (or none) needs no pagination. + &__pagination:has(.ais-Pagination--noRefinement) { + display: none; } &__facet-heading { + margin: 0 0 var(--quant-search-gap-sm); + padding-bottom: var(--quant-search-gap-xs); + border-bottom: 1px solid var(--quant-search-border); + font-size: var(--quant-search-facet-heading-size); font-weight: 600; - margin-bottom: 0.5rem; + letter-spacing: 0.06em; + line-height: 1.4; + text-transform: uppercase; } &__content { - flex: 1 1 320px; + display: flex; + flex: 1 1 var(--quant-search-content-min-width); + flex-direction: column; + gap: var(--quant-search-gap); min-width: 0; } &__stats { - margin: 0.75rem 0; - font-size: 0.9em; - opacity: 0.8; + margin: 0; + color: var(--quant-search-muted); + font-size: var(--quant-search-font-size-small); + } + + // Search box (InstantSearch). + .ais-SearchBox-form { + height: auto; + background: none; + } + + .ais-SearchBox-input { + box-sizing: border-box; + width: 100%; + min-height: 2.75rem; + padding: var(--quant-search-gap-sm) 2.75rem var(--quant-search-gap-sm) 2.5rem; + border: 1px solid var(--quant-search-border-strong); + border-radius: var(--quant-search-radius); + background: var(--quant-search-input-background); + box-shadow: none; + color: inherit; + font: inherit; + } + + .ais-SearchBox-input:focus { + border-color: var(--quant-search-accent); + box-shadow: none; + } + + .ais-SearchBox-input::placeholder { + color: var(--quant-search-muted); + } + + .ais-SearchBox-submit, + .ais-SearchBox-reset, + .ais-SearchBox-loadingIndicator { + width: 1.75rem; + height: 1.75rem; + border-radius: var(--quant-search-radius); + color: inherit; + } + + .ais-SearchBox-submit { + left: var(--quant-search-gap-sm); + } + + .ais-SearchBox-reset, + .ais-SearchBox-loadingIndicator { + right: var(--quant-search-gap-sm); + } + + .ais-SearchBox-submitIcon path, + .ais-SearchBox-resetIcon path { + fill: currentcolor; + } + + // No-JavaScript fallback form. + &__fallback { + display: flex; + gap: var(--quant-search-gap-sm); + + label { + flex: 1; + min-width: 0; + } + + input[type="search"], + button { + box-sizing: border-box; + min-height: 2.75rem; + padding: var(--quant-search-gap-sm) var(--quant-search-gap-md); + border: 1px solid var(--quant-search-border-strong); + border-radius: var(--quant-search-radius); + background: var(--quant-search-input-background); + color: inherit; + font: inherit; + } + + input[type="search"] { + width: 100%; + } + + button { + background: transparent; + cursor: pointer; + } + } + + // Clear refinements: a neutral outline button. The text is the theme's + // text colour, so it meets WCAG AA contrast on any theme. + .ais-ClearRefinements-button { + display: inline-flex; + align-items: center; + min-height: 2.25rem; + padding: var(--quant-search-gap-xs) var(--quant-search-gap-md); + border: 1px solid var(--quant-search-border-strong); + border-radius: var(--quant-search-radius); + background: transparent; + color: inherit; + font: inherit; + font-size: var(--quant-search-font-size-small); + font-weight: 500; + line-height: 1.2; + cursor: pointer; + } + + .ais-ClearRefinements-button--disabled, + .ais-ClearRefinements-button:disabled { + background: transparent; + color: inherit; + opacity: var(--quant-search-disabled-opacity); + cursor: not-allowed; + } + + .ais-ClearRefinements-button:hover:not(:disabled) { + background: var(--quant-search-surface-hover); + } + + // Refinement list and menu facets. + .ais-RefinementList-list, + .ais-Menu-list { + display: flex; + flex-direction: column; + gap: var(--quant-search-gap-xs); + margin: 0; + padding: 0; + list-style: none; + } + + .ais-RefinementList-item, + .ais-Menu-item { + margin: 0; + padding: 0; + } + + .ais-RefinementList-label, + .ais-Menu-link { + display: flex; + align-items: center; + gap: var(--quant-search-gap-sm); + min-height: 1.75rem; + color: inherit; + line-height: 1.3; + text-decoration: none; + cursor: pointer; + } + + .ais-RefinementList-checkbox { + flex: none; + width: 1.0625rem; + height: 1.0625rem; + margin: 0; + accent-color: var(--quant-search-accent); + cursor: pointer; + } + + .ais-RefinementList-labelText, + .ais-Menu-label { + flex: 1 1 auto; + min-width: 0; + overflow-wrap: anywhere; + } + + .ais-Menu-item--selected .ais-Menu-label, + .ais-RefinementList-item--selected .ais-RefinementList-labelText { + font-weight: 600; + } + + .ais-RefinementList-count, + .ais-Menu-count { + flex: none; + margin: 0 0 0 auto; + padding: 0 var(--quant-search-gap-sm); + border: 0; + border-radius: 999px; + background: var(--quant-search-surface); + color: var(--quant-search-muted); + font-size: var(--quant-search-font-size-xsmall); + font-variant-numeric: tabular-nums; + line-height: 1.6; + } + + .ais-MenuSelect-select { + box-sizing: border-box; + width: 100%; + min-height: 2.5rem; + padding: var(--quant-search-gap-xs) var(--quant-search-gap-sm); + border: 1px solid var(--quant-search-border-strong); + border-radius: var(--quant-search-radius); + background-color: var(--quant-search-input-background); + color: inherit; + font: inherit; + } + + .ais-RefinementList-showMore, + .ais-Menu-showMore { + margin-top: var(--quant-search-gap-sm); + padding: 0; + border: 0; + background: none; + color: inherit; + font: inherit; + font-size: var(--quant-search-font-size-small); + text-decoration: underline; + cursor: pointer; } // The instantsearch.css theme draws hits as cards a quarter of the row @@ -40,6 +339,8 @@ .ais-Hits-list { display: block; margin: 0; + padding: 0; + list-style: none; } .ais-Hits-item { @@ -47,64 +348,190 @@ margin: 0; padding: 0; border: 0; + background: none; box-shadow: none; } // Each hit is the only child of its list item, so the line between rows // goes on the items (a :last-child rule on the hit matches every hit). .ais-Hits-item + .ais-Hits-item { - border-top: 1px solid rgba(0, 0, 0, 0.1); + border-top: 1px solid var(--quant-search-border); + } + + &__hit-title { + margin: 0 0 var(--quant-search-gap-xs); + font-size: var(--quant-search-hit-title-size); + font-weight: 600; + line-height: 1.3; + } + + &__hit-summary { + margin: 0; + color: var(--quant-search-muted); + font-size: var(--quant-search-hit-summary-size); + line-height: 1.55; + } + + &__hit-tag { + display: inline-block; + margin: 0; + padding: 0.125em var(--quant-search-gap-sm); + border: 1px solid var(--quant-search-border); + border-radius: 999px; + background: var(--quant-search-surface); + color: var(--quant-search-muted); + font-size: var(--quant-search-font-size-xsmall); + line-height: 1.5; } &__hit { // Holds the floated image, so a short hit does not push into the next. display: flow-root; - padding: 1rem 0; + padding: var(--quant-search-gap-lg) 0; a { + color: inherit; text-decoration: none; } + a:hover .quant-search__hit-title, + a:focus-visible .quant-search__hit-title { + text-decoration: underline; + text-underline-offset: 0.15em; + } + img { - max-width: 120px; - height: auto; float: right; - margin: 0 0 0.5rem 1rem; + width: var(--quant-search-hit-image-width); + max-width: 35%; + height: auto; + aspect-ratio: 4 / 3; + margin: 0 0 var(--quant-search-gap-sm) var(--quant-search-gap); + border-radius: var(--quant-search-radius); + object-fit: cover; } - } - &__hit-title { - margin: 0 0 0.25rem; - font-size: 1.1em; + // The row of tags (the last child of the hit). + > div:has(.quant-search__hit-tag) { + display: flex; + flex-wrap: wrap; + gap: var(--quant-search-gap-xs); + margin-top: var(--quant-search-gap-md); + } } - &__hit-summary { - margin: 0; - opacity: 0.85; + .ais-Hits-item:first-child .quant-search__hit { + padding-top: var(--quant-search-gap-sm); } - &__hit-tag { - display: inline-block; - margin: 0.25rem 0.25rem 0 0; - padding: 0.1rem 0.5rem; - border-radius: 999px; - background: rgba(0, 0, 0, 0.06); - font-size: 0.8em; + .ais-Highlight-highlighted, + .ais-Snippet-highlighted { + border-radius: 0.15em; + background: var(--quant-search-highlight); + color: inherit; } &__empty { - padding: 2rem 0; + padding: var(--quant-search-gap-xl) 0; text-align: center; - opacity: 0.8; + color: var(--quant-search-muted); + + h4 { + margin: 0 0 var(--quant-search-gap-sm); + color: inherit; + } + + p { + margin: 0; + } } &--unavailable { - padding: 1rem; - border: 1px dashed rgba(0, 0, 0, 0.3); + padding: var(--quant-search-gap); + border: 1px dashed var(--quant-search-border-strong); + border-radius: var(--quant-search-radius); + + p { + margin: 0; + } } + // Pagination. .ais-Pagination { - margin-top: 1.5rem; + margin-top: var(--quant-search-gap); + } + + .ais-Pagination-list { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--quant-search-gap-xs); + margin: 0; + padding: 0; + list-style: none; + } + + .ais-Pagination-item { + margin: 0; + } + + .ais-Pagination-link { + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + min-width: 2.5rem; + height: 2.5rem; + padding: 0 var(--quant-search-gap-sm); + border: 1px solid var(--quant-search-border); + border-radius: var(--quant-search-radius); + background: transparent; + box-shadow: none; + color: inherit; + font-variant-numeric: tabular-nums; + line-height: 1; + text-decoration: none; + } + + .ais-Pagination-link:hover { + background: var(--quant-search-surface-hover); + } + + .ais-Pagination-item--selected .ais-Pagination-link { + border: 2px solid var(--quant-search-accent); + background: transparent; + color: inherit; + font-weight: 600; + } + + .ais-Pagination-item--disabled .ais-Pagination-link { + background: transparent; + color: inherit; + opacity: var(--quant-search-disabled-opacity); + } +} + +// Narrow container (a phone, a sidebar or a narrow content column): the +// facets go above the results, side by side when there is room. +@container quant-search (max-width: 37.5rem) { + + .quant-search__facets { + display: grid; + flex-basis: 100%; + grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); + gap: var(--quant-search-gap) var(--quant-search-gap-lg); + } + + .quant-search__clear { + grid-column: 1 / -1; + } + + .quant-search__content { + flex-basis: 100%; + } + + .quant-search__hit img { + width: calc(var(--quant-search-hit-image-width) * 0.7); } } diff --git a/plugins/quant/tests/Search/SearchStylesTest.php b/plugins/quant/tests/Search/SearchStylesTest.php index 12d7a3e..b4a7eb1 100644 --- a/plugins/quant/tests/Search/SearchStylesTest.php +++ b/plugins/quant/tests/Search/SearchStylesTest.php @@ -56,6 +56,61 @@ public function testAHitHoldsItsFloatedImage(): void $this->assertMatchesRegularExpression('/(^|;)display:flow-root(;|$)/', $this->rule('.quant-search__hit')); } + public function testTheDefaultsAreCustomPropertiesWithoutSpecificity(): void + { + // :where() has no specificity, so a theme rule on .quant-search wins in any stylesheet order. + $defaults = $this->rule(':where(.quant-search)'); + + $this->assertStringContainsString('--quant-search-gap:1rem', $defaults); + $this->assertStringContainsString('--quant-search-accent:var(--wp--preset--color--contrast,currentcolor)', $defaults); + $this->assertStringNotContainsString('--quant-search-gap:', $this->rule('.quant-search'), 'No default on the specific selector.'); + } + + public function testTheReadmeDocumentsEveryCustomProperty(): void + { + preg_match_all('/(--quant-search-[a-z-]+):/', $this->css(), $declared); + $readme = (string) file_get_contents(__DIR__ . '/../../readme.txt'); + $this->assertStringContainsString('== Styling the search page ==', $readme); + + foreach (array_unique($declared[1]) as $property) { + // The gap scale is documented as one item: `--quant-search-gap-xs`, `-sm`, `-md`, `-lg`, `-xl`. + $documented = str_contains($readme, '`' . $property . '`') + || (str_starts_with($property, '--quant-search-gap-') && str_contains($readme, '`-' . substr($property, 19) . '`')); + $this->assertTrue($documented, "readme.txt does not document {$property}."); + } + } + + public function testTheWidgetsFollowTheThemeTextColour(): void + { + // instantsearch.css sets color:#3a4570 on every widget root. + foreach (['.ais-Hits', '.ais-RefinementList', '.ais-SearchBox', '.ais-ClearRefinements', '.ais-Pagination', '.ais-Stats'] as $widget) { + $this->assertMatchesRegularExpression('/(^|;)color:inherit(;|$)/', $this->rule('.quant-search ' . $widget), $widget); + } + } + + public function testClearRefinementsIsANeutralButtonInTheTextColour(): void + { + // The theme button is white text on a pale blue (#0096db), below WCAG AA contrast. + $button = $this->rule('.quant-search .ais-ClearRefinements-button'); + + $this->assertMatchesRegularExpression('/(^|;)color:inherit(;|$)/', $button); + $this->assertMatchesRegularExpression('/(^|;)background:transparent(;|$)/', $button); + } + + public function testEveryControlHasAFocusOutline(): void + { + $this->assertStringContainsString( + '.quant-search :where(a,button,input,select,[tabindex]):focus-visible{outline:var(--quant-search-focus-width) solid var(--quant-search-focus-ring)', + $this->css() + ); + } + + public function testCheckboxAndCountAreSpacedFromTheLabel(): void + { + $this->assertStringContainsString('gap:var(--quant-search-gap-sm)', $this->rule('.quant-search .ais-RefinementList-label')); + $this->assertStringContainsString('margin:0 0 0 auto', $this->rule('.quant-search .ais-RefinementList-count')); + } + private function css(): string { $css = (string) file_get_contents(self::STYLESHEET); From eeb6713d158618cf756cbbde1315c11dec100eee Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Sun, 15 Nov 2026 12:10:17 +1000 Subject: [PATCH 3/3] docs(readme): styling the search page; changelog for the next release Lists every --quant-search-* custom property with its default, the narrow layout, and the stable class names themes can target. --- plugins/quant/readme.txt | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/plugins/quant/readme.txt b/plugins/quant/readme.txt index 5b62a0b..0a087f2 100644 --- a/plugins/quant/readme.txt +++ b/plugins/quant/readme.txt @@ -72,6 +72,50 @@ Version 2.0 requires PHP 8.2. Sites on older PHP are not offered the update and Set these to configure the plugin without the admin UI (for example on Quant Cloud): `QUANT_API_ENDPOINT`, `QUANT_CUSTOMER`, `QUANT_PROJECT`, `QUANT_TOKEN`, `QUANT_WEBSERVER_URL`, `QUANT_WEBSERVER_HOST`, `QUANT_ENABLED`, `QUANT_PURGE_ON_SAVE`, `QUANT_DISABLE_TLS_VERIFY`, `QUANT_HTTP_REQUEST_TIMEOUT`, `QUANT_MODE`. The same names work as PHP constants in `wp-config.php`. Overridden fields are read-only in the UI. +== Styling the search page == + +The search page (the page the plugin creates, the "Quant Search" block and the `[quant_search]` shortcode) uses the theme's fonts and text colour. Result titles are in the text colour and are underlined on hover and focus. Lines, count badges, tags and secondary text are mixes of the text colour, so the page also works on a dark theme. The plugin's own rules apply only inside `.quant-search`; the bundled InstantSearch.js theme styles the `ais-` widget classes. + +To restyle the page, set these custom properties on `.quant-search` in the theme stylesheet or in Additional CSS (Appearance > Editor > Styles in a block theme, Appearance > Customize in a classic theme). The plugin defaults have no specificity, so a rule on `.quant-search` wins in any stylesheet order. + +` +.quant-search { + --quant-search-accent: #1d4ed8; + --quant-search-gap: 1.25rem; + --quant-search-facets-width: 16rem; +} +` + +Spacing and layout: + +* `--quant-search-gap` (1rem): the base space. The other spaces are multiples of it, so a change here scales the page. +* `--quant-search-gap-xs`, `-sm`, `-md`, `-lg`, `-xl` (0.25, 0.5, 0.75, 1.5 and 2.5 times the gap). `-xl` is the space between the facets and the results. +* `--quant-search-facets-width` (14rem): the width of the facet column. +* `--quant-search-content-min-width` (20rem): the results column is never narrower than this next to the facets. +* `--quant-search-hit-image-width` (7.5rem): the result thumbnail width. +* `--quant-search-radius` (0.375rem): the corner radius of the search box, buttons, pagination and thumbnails. + +Colours: + +* `--quant-search-accent`: the checked boxes, the search box border on focus, the current page and the focus ring. Default: the block theme's `contrast` colour, or the text colour. +* `--quant-search-muted`: secondary text (result summaries, counts, tags, the result count). Default: 75% of the text colour. +* `--quant-search-border`, `--quant-search-border-strong`: lines and control borders (18% and 45% of the text colour). +* `--quant-search-surface`, `--quant-search-surface-hover`: the count badge and tag background, and the hover background (6% and 10% of the text colour). +* `--quant-search-input-background` (transparent): the search box and select background. +* `--quant-search-highlight`: the background of the matched words. +* `--quant-search-focus-ring` (the accent) and `--quant-search-focus-width` (2px): the focus outline of every link, button and field. +* `--quant-search-disabled-opacity` (0.55): disabled buttons and pagination links. + +Type (relative to the theme's text size): + +* `--quant-search-hit-title-size` (1.25em) and `--quant-search-hit-summary-size` (0.9375em): the result title and summary. +* `--quant-search-facet-heading-size` (0.75em): the facet headings. +* `--quant-search-font-size-small` (0.875em) and `--quant-search-font-size-xsmall` (0.8125em): the result count, the "Clear refinements" button, counts and tags. + +When the search area is narrower than 37.5rem (for example on a phone), the facets move above the results, side by side when there is room. A facet with no values for the current search is hidden with its heading. + +For larger changes, target the classes. They are stable: `quant-search`, `quant-search__description`, `quant-search__facets`, `quant-search__clear`, `quant-search__facet`, `quant-search__facet-heading`, `quant-search__content`, `quant-search__box`, `quant-search__stats`, `quant-search__hits`, `quant-search__hit`, `quant-search__hit-title`, `quant-search__hit-summary`, `quant-search__hit-tag`, `quant-search__pagination`, `quant-search__empty`, `quant-search__fallback` (the search form without JavaScript) and `quant-search--unavailable`. The widgets inside them use the InstantSearch.js `ais-` classes, for example `ais-SearchBox-input`, `ais-RefinementList-label`, `ais-RefinementList-count`, `ais-ClearRefinements-button` and `ais-Pagination-link`. + == Frequently Asked Questions == = Where do I find the project credentials? = @@ -92,6 +136,11 @@ Follow the [Forms documentation](https://docs.quantcdn.io/docs/dashboard/forms). == Changelog == += 2.0.5 = +* Search page: a cleaner default style that still follows the theme. The checkboxes, counts, headings, tags, buttons and pagination have even spacing, every control has a visible focus outline, the "Clear refinements" button uses the theme text colour (it was pale blue), the result title is larger than its summary, and on a phone the facets move above the results. The InstantSearch widgets no longer turn the text navy. +* Search page: every size, space and colour is a CSS custom property (`--quant-search-gap`, `--quant-search-accent` and others). See "Styling the search page" in the readme. +* Admin: the search settings, the search page form, the first-run form and the block settings had no space between their fields, checkboxes and toggles on current WordPress (7.x). They now use the block editor spacing. + = 2.0.4 = * Security: after you choose a project, the Quant login is limited to that project, so it can no longer read the publishing token of other projects in your organization. To choose another project, "Change Project" asks you to log in again. * Security: "Disconnect" now ends the Quant login at Quant, not only in WordPress.