From e51c5f9123c6406120ff5805c585391e5f99d33d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 09:39:58 +0000 Subject: [PATCH 1/2] feat(bricks): add color swatches to variable-picker dropdown Paint a colour square next to each --sf-color-* entry in the Bricks variable-picker dropdown, builder-side only. Variables stay empty-valued so nothing hits :root and dark/light remains framework-driven; the swatch is rendered from the server-resolved hex map (get_color_hex_map), localised alongside the existing class-hints config. Additive and fail-silent, reusing the class-hints decoration pattern: a debounced MutationObserver reconciles each row every pass (Bricks/Vue reuses
  • nodes when the search filter runs, so a one-time marker would go stale). resolveSwatchColor() is pure/DOM-free and only matches known --sf-color-* tokens, so the same observer is harmless in the spacing / typography pickers. Restores the swatch affordance lost when the Color Palette injection was disabled on Bricks 2.2+ (#182). Toggle via slashed_bricks/show_color_swatches. Refs #183 Co-Authored-By: Jack Granatowski --- .../integrations/bricks/README.md | 10 + .../bricks/assets/editor-app/app.css | 2 +- .../bricks/assets/editor-app/app.js | 8 +- .../editor-app/src/lib/color-swatches.js | 220 ++++++++++++++++++ .../bricks/editor-app/src/main.js | 3 + .../bricks/editor-app/src/styles/panel.css | 26 +++ .../bricks/includes/class-rebemer-enqueue.php | 23 +- 7 files changed, 285 insertions(+), 7 deletions(-) create mode 100644 plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js diff --git a/plugins/SLASHED-for-WP/integrations/bricks/README.md b/plugins/SLASHED-for-WP/integrations/bricks/README.md index bf0b3710..78bb21d3 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/README.md +++ b/plugins/SLASHED-for-WP/integrations/bricks/README.md @@ -8,6 +8,7 @@ A WordPress plugin that integrates the [SLASHED](https://github.com/codeslash-de - **Variable Pickers** - Registers every `--sf-*` CSS custom property declared in the active bundle (~600 in `optimal`, ~700 in `full`) with the Bricks variable pickers and code editor autocomplete, organized into category groups - **Class Autocomplete** - Registers every `.sf-*` layout/utility class and `.is-*` state class declared in the active bundle with the Bricks class input, organized into "SLASHED Layout" and "SLASHED State" categories - **Color Palette** - Synchronizes every `--sf-color-*` token (brand scales including alpha steps, status, and semantic colors) with the Bricks global color palette. Disabled automatically on Bricks 2.2+ (the new Color Manager bakes palette colors into `:root` as static hex, which would override the framework's adaptive `light-dark()` tokens and break dark mode) — use the Variable Manager to reach the tokens there +- **Variable-Picker Swatches** - Paints a colour square next to each `--sf-color-*` entry in the Bricks variable-picker dropdown, builder-side only. Because the variables stay empty-valued, Bricks has no value to draw a swatch from; the square is rendered from a server-resolved hex map so dark/light stays 100% framework-driven and nothing is written to `:root`. Purely additive and fail-silent: if Bricks ever changes the picker markup you lose the squares, never the picker. Restores the swatch affordance lost when the Color Palette is disabled on Bricks 2.2+. Toggle with the `slashed_bricks/show_color_swatches` filter - **Dynamic Detection** - The integration parses the loaded CSS bundle at runtime, so registrations stay in sync with whichever bundle (`essential` / `optimal` / `full`) and SLASHED release is active. There is no hand-curated list to drift out of date. - **reBEMer** - Subtree-scoped BEM class manager inside the Bricks builder structure panel: add / rename / replace classes for an element and its children in one transaction, with reference-count preflight (REST), snapshot+rollback, reserved-name guard against SLASHED utilities, and Cmd/Ctrl-Z undo. See [docs/rebemer.md](../../docs/rebemer.md) for the full design. @@ -95,6 +96,15 @@ Control whether SLASHED palettes are injected into the Bricks color palette (`br add_filter( 'slashed_bricks/inject_color_palette', '__return_true' ); ``` +#### `slashed_bricks/show_color_swatches` + +Control whether colour swatches are painted next to `--sf-color-*` entries in the Bricks variable-picker dropdown (builder-side only — see Variable-Picker Swatches above). Defaults to `true`. Returning `false` also skips localising the hex map, so no extra data is sent to the builder. + +```php +// Hide the variable-picker swatches. +add_filter( 'slashed_bricks/show_color_swatches', '__return_false' ); +``` + #### `slashed_bricks/registered_variables` Filter the CSS variables array before registration with Bricks. diff --git a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css index 5b4827ad..90a50fd2 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css +++ b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css @@ -1 +1 @@ -#slashed-rebemer-host{--rebemer-bg: #161a1d;--rebemer-fg: #e1e1e1;--rebemer-fg-muted: #8a8d95;--rebemer-border: #3d4752;--rebemer-accent: #e2b93b;--rebemer-accent-hover: #ffd042;--rebemer-input-bg: #293038;--rebemer-input-border: #3d4752;--rebemer-error: #ff4c4c;--rebemer-success: #4ade80;--rebemer-radius: 4px;--rebemer-font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif}.rebemer-badge-host{display:inline-flex;align-items:center;align-self:center;flex:0 0 auto;margin:0 4px;opacity:0;pointer-events:none;transition:opacity 80ms linear}.structure-item:hover .rebemer-badge-host,.structure-item:focus-within .rebemer-badge-host,li[data-id]:hover>.rebemer-badge-host,li[data-id]:focus-within>.rebemer-badge-host{opacity:1;pointer-events:auto}.rebemer-badge{font:600 9px/1 var(--rebemer-font, "Inter", -apple-system, BlinkMacSystemFont, sans-serif);letter-spacing:0;text-transform:none;color:var(--rebemer-fg-muted, #8a8d95);display:inline;background:transparent;padding:1px 3px;margin:0;cursor:pointer;border-radius:2px;pointer-events:auto}.rebemer-badge:hover{color:var(--rebemer-accent, #e2b93b);background:#e2b93b14}.rebemer-badge:focus-visible{outline:1px dotted var(--rebemer-accent, #e2b93b);outline-offset:1px;color:var(--rebemer-accent, #e2b93b)}.rebemer-panel{position:fixed;top:80px;left:50%;transform:translate(-50%);width:440px;max-width:calc(100vw - 40px);max-height:80vh;z-index:100000;background:var(--rebemer-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);box-shadow:0 10px 40px #0009;display:flex;flex-direction:column;font:12px/1.45 var(--rebemer-font);overflow:hidden;outline:none}.rebemer-panel__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--rebemer-border)}.rebemer-panel__title{margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#fff}.rebemer-panel__subject{color:var(--rebemer-accent);text-transform:none;font-weight:500}.rebemer-panel__close{background:transparent;border:0;font-size:18px;color:var(--rebemer-fg-muted);cursor:pointer;padding:2px 6px}.rebemer-panel__close:hover{color:#fff}.rebemer-panel__toolbar{padding:10px 14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--rebemer-border)}.rebemer-field{display:flex;flex-direction:column;gap:4px;font-size:11px}.rebemer-field--inline{flex-direction:row;align-items:center;gap:6px}.rebemer-field__label{color:var(--rebemer-fg-muted);text-transform:uppercase;letter-spacing:.5px;font-size:10px}.rebemer-field select,.rebemer-field input[type=text]{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);color:var(--rebemer-fg);padding:4px 6px;font:inherit}.rebemer-field select:focus,.rebemer-field input:focus{outline:1px solid var(--rebemer-accent)}.rebemer-panel__mode-hint{margin:0;padding:5px 14px;font-size:11px;color:var(--rebemer-fg-muted);background:var(--rebemer-bg);border-bottom:1px solid var(--rebemer-border);line-height:1.4}.rebemer-panel__notice{margin:0;padding:8px 14px;background:#e2b93b14;border-bottom:1px solid var(--rebemer-border);color:var(--rebemer-fg);font-size:11px;line-height:1.5}.rebemer-panel__notice--warn{background:#e2b93b29}.rebemer-panel__notice strong{color:var(--rebemer-accent);font-weight:600}.rebemer-panel__notice-skip{display:block;margin-top:2px;color:var(--rebemer-fg-muted)}.rebemer-panel__body{flex:1;overflow-y:auto;padding:8px 14px;display:flex;flex-direction:column;gap:6px}.rebemer-row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--rebemer-radius);background:#ffffff05;margin-left:calc(var(--rebemer-row-depth, 0) * 12px)}.rebemer-row:hover{background:#ffffff0a}.rebemer-row--disabled{opacity:.45}.rebemer-row__include input{cursor:pointer}.rebemer-row__meta{display:flex;gap:6px;align-items:baseline;min-width:0}.rebemer-row__label{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rebemer-row__type{font-size:9px;color:var(--rebemer-fg-muted);text-transform:uppercase}.rebemer-row__hint{font-size:9px;color:var(--rebemer-accent);text-transform:uppercase;letter-spacing:.5px;background:#e2b93b1f;padding:1px 4px;border-radius:2px}.rebemer-row__inputs{grid-column:1 / -1;display:flex;gap:6px;align-items:center}.rebemer-row__name{flex:1;display:flex;align-items:stretch;background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);overflow:hidden}.rebemer-row__prefix{padding:4px 6px;background:#00000040;color:var(--rebemer-fg-muted);font-size:11px;border-right:1px solid var(--rebemer-input-border);white-space:nowrap}.rebemer-row__name input{background:transparent;border:0;outline:0;color:var(--rebemer-fg);font:inherit;padding:4px 6px;flex:1;min-width:0}.rebemer-row--suggested .rebemer-row__name input:not(:focus){color:var(--rebemer-fg-muted);font-style:italic}.rebemer-row__modifier{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);color:var(--rebemer-fg);font:inherit;padding:4px 6px;width:90px}.rebemer-row__recommend{grid-column:1 / -1;margin:0;padding:6px 8px;background:#4ade8014;border-left:2px solid var(--rebemer-success);border-radius:2px;color:var(--rebemer-fg);font-size:11px;line-height:1.4}.rebemer-row__recommend code{background:#0000004d;padding:1px 4px;border-radius:2px;font:11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--rebemer-accent)}.rebemer-row__warn,.rebemer-row__info{grid-column:1 / -1;margin:0;padding:5px 8px;font-size:11px;line-height:1.4;border-radius:2px}.rebemer-row__warn{background:#e2b93b1f;border-left:2px solid #e2b93b;color:var(--rebemer-fg)}.rebemer-row__info{background:#63b3ed1a;border-left:2px solid #63b3ed;color:var(--rebemer-fg-muted)}.rebemer-row__chips{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:4px 0 0;font-size:10px}.rebemer-row__chips-label,.rebemer-row__chips-empty,.rebemer-row__chips-skip{color:var(--rebemer-fg-muted);text-transform:uppercase;letter-spacing:.5px;font-size:9px}.rebemer-row__chips-skip{margin-left:auto;cursor:help;color:#c8a038}.rebemer-chip{font:10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#0000004d;border:1px solid var(--rebemer-input-border);color:var(--rebemer-fg);padding:2px 5px;border-radius:2px;white-space:nowrap}.rebemer-panel__footer{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid var(--rebemer-border)}.rebemer-btn{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);color:var(--rebemer-fg);padding:6px 12px;border-radius:var(--rebemer-radius);font:inherit;cursor:pointer}.rebemer-btn:hover{border-color:var(--rebemer-fg-muted)}.rebemer-btn--primary{background:var(--rebemer-accent);border-color:var(--rebemer-accent);color:var(--rebemer-bg);font-weight:600}.rebemer-btn--primary:hover{background:var(--rebemer-accent-hover);border-color:var(--rebemer-accent-hover)}.rebemer-toast{position:fixed;bottom:16px;right:16px;z-index:100002;background:var(--rebemer-input-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);padding:8px 12px;font:12px/1.45 var(--rebemer-font);cursor:pointer;box-shadow:0 4px 12px #0006}.rebemer-toast--success{border-color:var(--rebemer-success)}.rebemer-toast--error{border-color:var(--rebemer-error);color:var(--rebemer-error)}.rebemer-class-hint{position:fixed;z-index:100003;max-width:280px;background:var(--rebemer-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);padding:8px 10px;font:12px/1.45 var(--rebemer-font);box-shadow:0 6px 20px #00000080;pointer-events:none}.rebemer-class-hint[hidden]{display:none}.rebemer-class-hint__name{font:600 11px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--rebemer-accent)}.rebemer-class-hint__cat{margin-left:6px;font-size:9px;text-transform:uppercase;letter-spacing:.5px;color:var(--rebemer-fg-muted)}.rebemer-class-hint__cat[hidden]{display:none}.rebemer-class-hint__desc{margin:4px 0 0;color:var(--rebemer-fg)} +#slashed-rebemer-host{--rebemer-bg: #161a1d;--rebemer-fg: #e1e1e1;--rebemer-fg-muted: #8a8d95;--rebemer-border: #3d4752;--rebemer-accent: #e2b93b;--rebemer-accent-hover: #ffd042;--rebemer-input-bg: #293038;--rebemer-input-border: #3d4752;--rebemer-error: #ff4c4c;--rebemer-success: #4ade80;--rebemer-radius: 4px;--rebemer-font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif}.rebemer-badge-host{display:inline-flex;align-items:center;align-self:center;flex:0 0 auto;margin:0 4px;opacity:0;pointer-events:none;transition:opacity 80ms linear}.structure-item:hover .rebemer-badge-host,.structure-item:focus-within .rebemer-badge-host,li[data-id]:hover>.rebemer-badge-host,li[data-id]:focus-within>.rebemer-badge-host{opacity:1;pointer-events:auto}.rebemer-badge{font:600 9px/1 var(--rebemer-font, "Inter", -apple-system, BlinkMacSystemFont, sans-serif);letter-spacing:0;text-transform:none;color:var(--rebemer-fg-muted, #8a8d95);display:inline;background:transparent;padding:1px 3px;margin:0;cursor:pointer;border-radius:2px;pointer-events:auto}.rebemer-badge:hover{color:var(--rebemer-accent, #e2b93b);background:#e2b93b14}.rebemer-badge:focus-visible{outline:1px dotted var(--rebemer-accent, #e2b93b);outline-offset:1px;color:var(--rebemer-accent, #e2b93b)}.rebemer-panel{position:fixed;top:80px;left:50%;transform:translate(-50%);width:440px;max-width:calc(100vw - 40px);max-height:80vh;z-index:100000;background:var(--rebemer-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);box-shadow:0 10px 40px #0009;display:flex;flex-direction:column;font:12px/1.45 var(--rebemer-font);overflow:hidden;outline:none}.rebemer-panel__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--rebemer-border)}.rebemer-panel__title{margin:0;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#fff}.rebemer-panel__subject{color:var(--rebemer-accent);text-transform:none;font-weight:500}.rebemer-panel__close{background:transparent;border:0;font-size:18px;color:var(--rebemer-fg-muted);cursor:pointer;padding:2px 6px}.rebemer-panel__close:hover{color:#fff}.rebemer-panel__toolbar{padding:10px 14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--rebemer-border)}.rebemer-field{display:flex;flex-direction:column;gap:4px;font-size:11px}.rebemer-field--inline{flex-direction:row;align-items:center;gap:6px}.rebemer-field__label{color:var(--rebemer-fg-muted);text-transform:uppercase;letter-spacing:.5px;font-size:10px}.rebemer-field select,.rebemer-field input[type=text]{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);color:var(--rebemer-fg);padding:4px 6px;font:inherit}.rebemer-field select:focus,.rebemer-field input:focus{outline:1px solid var(--rebemer-accent)}.rebemer-panel__mode-hint{margin:0;padding:5px 14px;font-size:11px;color:var(--rebemer-fg-muted);background:var(--rebemer-bg);border-bottom:1px solid var(--rebemer-border);line-height:1.4}.rebemer-panel__notice{margin:0;padding:8px 14px;background:#e2b93b14;border-bottom:1px solid var(--rebemer-border);color:var(--rebemer-fg);font-size:11px;line-height:1.5}.rebemer-panel__notice--warn{background:#e2b93b29}.rebemer-panel__notice strong{color:var(--rebemer-accent);font-weight:600}.rebemer-panel__notice-skip{display:block;margin-top:2px;color:var(--rebemer-fg-muted)}.rebemer-panel__body{flex:1;overflow-y:auto;padding:8px 14px;display:flex;flex-direction:column;gap:6px}.rebemer-row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--rebemer-radius);background:#ffffff05;margin-left:calc(var(--rebemer-row-depth, 0) * 12px)}.rebemer-row:hover{background:#ffffff0a}.rebemer-row--disabled{opacity:.45}.rebemer-row__include input{cursor:pointer}.rebemer-row__meta{display:flex;gap:6px;align-items:baseline;min-width:0}.rebemer-row__label{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rebemer-row__type{font-size:9px;color:var(--rebemer-fg-muted);text-transform:uppercase}.rebemer-row__hint{font-size:9px;color:var(--rebemer-accent);text-transform:uppercase;letter-spacing:.5px;background:#e2b93b1f;padding:1px 4px;border-radius:2px}.rebemer-row__inputs{grid-column:1 / -1;display:flex;gap:6px;align-items:center}.rebemer-row__name{flex:1;display:flex;align-items:stretch;background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);overflow:hidden}.rebemer-row__prefix{padding:4px 6px;background:#00000040;color:var(--rebemer-fg-muted);font-size:11px;border-right:1px solid var(--rebemer-input-border);white-space:nowrap}.rebemer-row__name input{background:transparent;border:0;outline:0;color:var(--rebemer-fg);font:inherit;padding:4px 6px;flex:1;min-width:0}.rebemer-row--suggested .rebemer-row__name input:not(:focus){color:var(--rebemer-fg-muted);font-style:italic}.rebemer-row__modifier{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);border-radius:var(--rebemer-radius);color:var(--rebemer-fg);font:inherit;padding:4px 6px;width:90px}.rebemer-row__recommend{grid-column:1 / -1;margin:0;padding:6px 8px;background:#4ade8014;border-left:2px solid var(--rebemer-success);border-radius:2px;color:var(--rebemer-fg);font-size:11px;line-height:1.4}.rebemer-row__recommend code{background:#0000004d;padding:1px 4px;border-radius:2px;font:11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--rebemer-accent)}.rebemer-row__warn,.rebemer-row__info{grid-column:1 / -1;margin:0;padding:5px 8px;font-size:11px;line-height:1.4;border-radius:2px}.rebemer-row__warn{background:#e2b93b1f;border-left:2px solid #e2b93b;color:var(--rebemer-fg)}.rebemer-row__info{background:#63b3ed1a;border-left:2px solid #63b3ed;color:var(--rebemer-fg-muted)}.rebemer-row__chips{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:4px 0 0;font-size:10px}.rebemer-row__chips-label,.rebemer-row__chips-empty,.rebemer-row__chips-skip{color:var(--rebemer-fg-muted);text-transform:uppercase;letter-spacing:.5px;font-size:9px}.rebemer-row__chips-skip{margin-left:auto;cursor:help;color:#c8a038}.rebemer-chip{font:10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#0000004d;border:1px solid var(--rebemer-input-border);color:var(--rebemer-fg);padding:2px 5px;border-radius:2px;white-space:nowrap}.rebemer-panel__footer{display:flex;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:1px solid var(--rebemer-border)}.rebemer-btn{background:var(--rebemer-input-bg);border:1px solid var(--rebemer-input-border);color:var(--rebemer-fg);padding:6px 12px;border-radius:var(--rebemer-radius);font:inherit;cursor:pointer}.rebemer-btn:hover{border-color:var(--rebemer-fg-muted)}.rebemer-btn--primary{background:var(--rebemer-accent);border-color:var(--rebemer-accent);color:var(--rebemer-bg);font-weight:600}.rebemer-btn--primary:hover{background:var(--rebemer-accent-hover);border-color:var(--rebemer-accent-hover)}.rebemer-toast{position:fixed;bottom:16px;right:16px;z-index:100002;background:var(--rebemer-input-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);padding:8px 12px;font:12px/1.45 var(--rebemer-font);cursor:pointer;box-shadow:0 4px 12px #0006}.rebemer-toast--success{border-color:var(--rebemer-success)}.rebemer-toast--error{border-color:var(--rebemer-error);color:var(--rebemer-error)}.rebemer-class-hint{position:fixed;z-index:100003;max-width:280px;background:var(--rebemer-bg);color:var(--rebemer-fg);border:1px solid var(--rebemer-border);border-radius:var(--rebemer-radius);padding:8px 10px;font:12px/1.45 var(--rebemer-font);box-shadow:0 6px 20px #00000080;pointer-events:none}.rebemer-class-hint[hidden]{display:none}.rebemer-class-hint__name{font:600 11px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--rebemer-accent)}.rebemer-class-hint__cat{margin-left:6px;font-size:9px;text-transform:uppercase;letter-spacing:.5px;color:var(--rebemer-fg-muted)}.rebemer-class-hint__cat[hidden]{display:none}.rebemer-class-hint__desc{margin:4px 0 0;color:var(--rebemer-fg)}.slashed-var-swatch{flex:0 0 auto;display:inline-block;width:12px;height:12px;margin-right:7px;vertical-align:middle;border-radius:3px;border:1px solid rgba(127,127,127,.45);background-color:#fff;background-image:linear-gradient(var(--slashed-swatch-color, transparent),var(--slashed-swatch-color, transparent)),linear-gradient(45deg,rgba(127,127,127,.35) 25%,transparent 25%,transparent 75%,rgba(127,127,127,.35) 75%),linear-gradient(45deg,rgba(127,127,127,.35) 25%,transparent 25%,transparent 75%,rgba(127,127,127,.35) 75%);background-position:0 0,0 0,4px 4px;background-size:auto,8px 8px,8px 8px} diff --git a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js index 8316e0a3..9886c614 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js +++ b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js @@ -1,7 +1,7 @@ -var Os=Object.defineProperty;var ni=e=>{throw TypeError(e)};var Ms=(e,t,n)=>t in e?Os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>Ms(e,typeof t!="symbol"?t+"":t,n),_r=(e,t,n)=>t.has(e)||ni("Cannot "+n);var f=(e,t,n)=>(_r(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?ni("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),E=(e,t,n,r)=>(_r(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),I=(e,t,n)=>(_r(e,t,"access private method"),n);var Kr=Array.isArray,Is=Array.prototype.indexOf,St=Array.prototype.includes,rr=Array.from,Ns=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Rs=Object.getOwnPropertyDescriptors,Ls=Object.prototype,Ps=Array.prototype,xi=Object.getPrototypeOf,ri=Object.isExtensible;const Ds=()=>{};function Fs(e){for(var t=0;t{e=r,t=i});return{promise:n,resolve:e,reject:t}}const ne=2,Jt=4,ir=8,Ti=1<<24,De=16,je=32,dt=64,Er=128,Me=512,$=1024,te=2048,Ue=4096,le=8192,Ie=16384,Pt=32768,kr=1<<25,Xt=65536,Un=1<<17,Bs=1<<18,en=1<<19,js=1<<20,ze=1<<25,Nt=65536,Gn=1<<21,qt=1<<22,at=1<<23,Ct=Symbol("$state"),Hs=Symbol("legacy props"),qs=Symbol(""),Fn=Symbol("attributes"),Sr=Symbol("class"),Cr=Symbol("style"),on=Symbol("text"),Bn=Symbol("form reset"),sr=new class extends Error{constructor(){super(...arguments);ae(this,"name","StaleReactionError");ae(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ks(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ws(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function zs(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Us(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Gs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Vs(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ys(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Js(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Xs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Zs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Qs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function $s(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const eo=1,to=2,Oi=4,no=8,ro=16,io=1,so=4,oo=8,lo=16,ao=1,fo=2,Z=Symbol("uninitialized"),Mi="http://www.w3.org/1999/xhtml";function uo(){console.warn("https://svelte.dev/e/derived_inert")}function co(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ho(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Ii(e){return e===this.v}function _o(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ni(e){return!_o(e,this.v)}let he=null;function Zt(e){he=e}function kn(e,t=!1,n){he={p:he,i:!1,c:null,e:null,s:e,x:null,r:M,l:null}}function Sn(e){var t=he,n=t.e;if(n!==null){t.e=null;for(var r of n)$i(r)}return t.i=!0,he=t.p,{}}function Ri(){return!0}let vt=[];function Li(){var e=vt;vt=[],Fs(e)}function ft(e){if(vt.length===0&&!un){var t=vt;queueMicrotask(()=>{t===vt&&Li()})}vt.push(e)}function vo(){for(;vt.length>0;)Li()}function Pi(e){var t=M;if(t===null)return O.f|=at,e;if((t.f&Pt)===0&&(t.f&Jt)===0)throw e;ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&Er)!==0){if((t.f&Pt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const po=-7169;function z(e,t){e.f=e.f&po|t}function Wr(e){(e.f&Me)!==0||e.deps===null?z(e,$):z(e,Ue)}function Di(e){if(e!==null)for(const t of e)(t.f&ne)===0||(t.f&Nt)===0||(t.f^=Nt,Di(t.deps))}function Fi(e,t,n){(e.f&te)!==0?t.add(e):(e.f&Ue)!==0&&n.add(e),Di(e.deps),z(e,$)}let Ln=!1;function go(e){var t=Ln;try{return Ln=!1,[e(),Ln]}finally{Ln=t}}let vr=null,Ft=null,x=null,xr=null,Fe=null,Ar=null,un=!1,pr=!1,jt=null,jn=null;var ii=0;let mo=1;var Wt,rt,mt,zt,Ut,bt,Gt,Ye,gn,pe,mn,it,qe,Ke,Vt,yt,R,Tr,ln,Or,Bi,ji,Hn,bo,Mr,Bt;const er=class er{constructor(){S(this,R);ae(this,"id",mo++);S(this,Wt,!1);ae(this,"linked",!0);S(this,rt,null);S(this,mt,null);ae(this,"async_deriveds",new Map);ae(this,"current",new Map);ae(this,"previous",new Map);ae(this,"unblocked",new Set);S(this,zt,new Set);S(this,Ut,new Set);S(this,bt,new Set);S(this,Gt,0);S(this,Ye,new Map);S(this,gn,null);S(this,pe,[]);S(this,mn,[]);S(this,it,new Set);S(this,qe,new Set);S(this,Ke,new Map);S(this,Vt,new Set);ae(this,"is_fork",!1);S(this,yt,!1)}skip_effect(t){f(this,Ke).has(t)||f(this,Ke).set(t,{d:[],m:[]}),f(this,Vt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=f(this,Ke).get(t);if(r){f(this,Ke).delete(t);for(var i of r.d)z(i,te),n(i);for(i of r.m)z(i,Ue),n(i)}f(this,Vt).add(t)}capture(t,n,r=!1){t.v!==Z&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&at)===0&&(this.current.set(t,[n,r]),Fe?.set(t,n)),this.is_fork||(t.v=n)}activate(){x=this}deactivate(){x=null,Fe=null}flush(){try{pr=!0,x=this,I(this,R,ln).call(this)}finally{ii=0,Ar=null,jt=null,jn=null,pr=!1,x=null,Fe=null,xt.clear()}}discard(){for(const t of f(this,Ut))t(this);f(this,Ut).clear(),f(this,bt).clear(),I(this,R,Bt).call(this)}register_created_effect(t){f(this,mn).push(t)}increment(t,n){if(E(this,Gt,f(this,Gt)+1),t){let r=f(this,Ye).get(n)??0;f(this,Ye).set(n,r+1)}}decrement(t,n){if(E(this,Gt,f(this,Gt)-1),t){let r=f(this,Ye).get(n)??0;r===1?f(this,Ye).delete(n):f(this,Ye).set(n,r-1)}f(this,yt)||(E(this,yt,!0),ft(()=>{E(this,yt,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)f(this,it).add(r);for(const r of n)f(this,qe).add(r);t.clear(),n.clear()}oncommit(t){f(this,zt).add(t)}ondiscard(t){f(this,Ut).add(t)}on_fork_commit(t){f(this,bt).add(t)}run_fork_commit_callbacks(){for(const t of f(this,bt))t(this);f(this,bt).clear()}settled(){return(f(this,gn)??E(this,gn,Ai())).promise}static ensure(){var t;if(x===null){const n=x=new er;I(t=n,R,Mr).call(t),!pr&&!un&&ft(()=>{f(n,Wt)||n.flush()})}return x}apply(){{Fe=null;return}}schedule(t){if(Ar=t,t.b?.is_pending&&(t.f&(Jt|ir|Ti))!==0&&(t.f&Pt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(jt!==null&&n===M&&(O===null||(O.f&ne)===0))return;if((r&(dt|je))!==0){if((r&$)===0)return;n.f^=$}}f(this,pe).push(n)}};Wt=new WeakMap,rt=new WeakMap,mt=new WeakMap,zt=new WeakMap,Ut=new WeakMap,bt=new WeakMap,Gt=new WeakMap,Ye=new WeakMap,gn=new WeakMap,pe=new WeakMap,mn=new WeakMap,it=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Vt=new WeakMap,yt=new WeakMap,R=new WeakSet,Tr=function(){if(this.is_fork)return!0;for(const r of f(this,Ye).keys()){for(var t=r,n=!1;t.parent!==null;){if(f(this,Ke).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},ln=function(){var l,c,h;if(E(this,Wt,!0),ii++>1e3&&(I(this,R,Bt).call(this),wo()),!I(this,R,Tr).call(this)){for(const u of f(this,it))f(this,qe).delete(u),z(u,te),this.schedule(u);for(const u of f(this,qe))z(u,Ue),this.schedule(u)}const t=f(this,pe);E(this,pe,[]),this.apply();var n=jt=[],r=[],i=jn=[];for(const u of t)try{I(this,R,Or).call(this,u,n,r)}catch(d){throw Ki(u),d}if(x=null,i.length>0){var s=er.ensure();for(const u of i)s.schedule(u)}if(jt=null,jn=null,I(this,R,Tr).call(this)){I(this,R,Hn).call(this,r),I(this,R,Hn).call(this,n);for(const[u,d]of f(this,Ke))qi(u,d);i.length>0&&I(l=x,R,ln).call(l);return}const o=I(this,R,Bi).call(this);if(o){I(c=o,R,ji).call(c,this);return}f(this,it).clear(),f(this,qe).clear();for(const u of f(this,zt))u(this);f(this,zt).clear(),xr=this,si(r),si(n),xr=null,f(this,gn)?.resolve();var a=x;if(this.linked&&f(this,Gt)===0&&I(this,R,Bt).call(this),f(this,pe).length>0){a===null&&(a=this,I(this,R,Mr).call(this));const u=a;f(u,pe).push(...f(this,pe).filter(d=>!f(u,pe).includes(d)))}a!==null&&I(h=a,R,ln).call(h)},Or=function(t,n,r){t.f^=$;for(var i=t.first;i!==null;){var s=i.f,o=(s&(je|dt))!==0,a=o&&(s&$)!==0,l=a||(s&le)!==0||f(this,Ke).has(i);if(!l&&i.fn!==null){o?i.f^=$:(s&Jt)!==0?n.push(i):xn(i)&&((s&De)!==0&&f(this,qe).add(i),$t(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var h=i.next;if(h!==null){i=h;break}i=i.parent}}},Bi=function(){for(var t=f(this,rt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=f(t,rt)}return null},ji=function(t){var r;for(const[i,s]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,s);for(const[i,s]of t.async_deriveds){const o=this.async_deriveds.get(i);o&&s.promise.then(o.resolve)}const n=i=>{var s=i.reactions;if(s!==null)for(const l of s){var o=l.f;if((o&ne)!==0)n(l);else{var a=l;o&(qt|De)&&!this.async_deriveds.has(a)&&(f(this,qe).delete(a),z(a,te),this.schedule(a))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),I(r=t,R,Bt).call(r),x=this,I(this,R,ln).call(this)},Hn=function(t){for(var n=0;n!this.current.has(d));if(i.length===0)t&&u.discard();else if(n.length>0){if(t)for(const d of f(this,Vt))u.unskip_effect(d,_=>{var v;(_.f&(De|qt))!==0?u.schedule(_):I(v=u,R,Hn).call(v,[_])});u.activate();var s=new Set,o=new Map;for(var a of n)Hi(a,i,s,o);o=new Map;var l=[...u.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(l.length>0)for(const d of f(this,mn))(d.f&(Ie|le|Un))===0&&zr(d,l,o)&&((d.f&(qt|De))!==0?(z(d,te),u.schedule(d)):f(u,it).add(d));if(f(u,pe).length>0&&!f(u,yt)){u.apply();for(var c of f(u,pe))I(h=u,R,Or).call(h,c,[],[]);E(u,pe,[])}u.deactivate()}}}},Mr=function(){Ft===null?vr=Ft=this:(E(Ft,mt,this),E(this,rt,Ft)),Ft=this},Bt=function(){var t=f(this,rt),n=f(this,mt);t===null?vr=n:E(t,mt,n),n===null?Ft=t:E(n,rt,t),this.linked=!1};let Rt=er;function yo(e){var t=un;un=!0;try{for(var n;;){if(vo(),x===null)return n;x.flush()}}finally{un=t}}function wo(){try{Ys()}catch(e){ot(e,Ar)}}let Ve=null;function si(e){var t=e.length;if(t!==0){for(var n=0;n0)){xt.clear();for(const i of Ve){if((i.f&(Ie|le))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)Ve.has(o)&&(Ve.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Ie|le))===0&&$t(l)}}Ve.clear()}}Ve=null}}function Hi(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&ne)!==0?Hi(i,t,n,r):(s&(qt|De))!==0&&(s&te)===0&&zr(i,t,r)&&(z(i,te),Ur(i))}}function zr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(St.call(t,i))return!0;if((i.f&ne)!==0&&zr(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function Ur(e){x.schedule(e)}function qi(e,t){if(!((e.f&je)!==0&&(e.f&$)!==0)){(e.f&te)!==0?t.d.push(e):(e.f&Ue)!==0&&t.m.push(e),z(e,$);for(var n=e.first;n!==null;)qi(n,t),n=n.next}}function Ki(e){z(e,$);for(var t=e.first;t!==null;)Ki(t),t=t.next}function Eo(e){let t=0,n=Lt(0),r;return()=>{Yr()&&(g(n),lr(()=>(t===0&&(r=tn(()=>e(()=>cn(n)))),t+=1,()=>{ft(()=>{t-=1,t===0&&(r?.(),r=void 0,cn(n))})})))}}var ko=Xt|en;function So(e,t,n,r){new Co(e,t,n,r)}var Ce,qr,xe,wt,fe,Ae,re,ge,Je,Et,st,Yt,bn,yn,Xe,tr,U,xo,Ao,To,Ir,qn,Kn,Nr,Rr;class Co{constructor(t,n,r,i){S(this,U);ae(this,"parent");ae(this,"is_pending",!1);ae(this,"transform_error");S(this,Ce);S(this,qr,null);S(this,xe);S(this,wt);S(this,fe);S(this,Ae,null);S(this,re,null);S(this,ge,null);S(this,Je,null);S(this,Et,0);S(this,st,0);S(this,Yt,!1);S(this,bn,new Set);S(this,yn,new Set);S(this,Xe,null);S(this,tr,Eo(()=>(E(this,Xe,Lt(f(this,Et))),()=>{E(this,Xe,null)})));E(this,Ce,t),E(this,xe,n),E(this,wt,s=>{var o=M;o.b=this,o.f|=Er,r(s)}),this.parent=M.b,this.transform_error=i??this.parent?.transform_error??(s=>s),E(this,fe,Zr(()=>{I(this,U,Ir).call(this)},ko))}defer_effect(t){Fi(t,f(this,bn),f(this,yn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!f(this,xe).pending}update_pending_count(t,n){I(this,U,Nr).call(this,t,n),E(this,Et,f(this,Et)+t),!(!f(this,Xe)||f(this,Yt))&&(E(this,Yt,!0),ft(()=>{E(this,Yt,!1),f(this,Xe)&&Qt(f(this,Xe),f(this,Et))}))}get_effect_pending(){return f(this,tr).call(this),g(f(this,Xe))}error(t){if(!f(this,xe).onerror&&!f(this,xe).failed)throw t;x?.is_fork?(f(this,Ae)&&x.skip_effect(f(this,Ae)),f(this,re)&&x.skip_effect(f(this,re)),f(this,ge)&&x.skip_effect(f(this,ge)),x.on_fork_commit(()=>{I(this,U,Rr).call(this,t)})):I(this,U,Rr).call(this,t)}}Ce=new WeakMap,qr=new WeakMap,xe=new WeakMap,wt=new WeakMap,fe=new WeakMap,Ae=new WeakMap,re=new WeakMap,ge=new WeakMap,Je=new WeakMap,Et=new WeakMap,st=new WeakMap,Yt=new WeakMap,bn=new WeakMap,yn=new WeakMap,Xe=new WeakMap,tr=new WeakMap,U=new WeakSet,xo=function(){try{E(this,Ae,Te(()=>f(this,wt).call(this,f(this,Ce))))}catch(t){this.error(t)}},Ao=function(t){const n=f(this,xe).failed;n&&E(this,ge,Te(()=>{n(f(this,Ce),()=>t,()=>()=>{})}))},To=function(){const t=f(this,xe).pending;t&&(this.is_pending=!0,E(this,re,Te(()=>t(f(this,Ce)))),ft(()=>{var n=E(this,Je,document.createDocumentFragment()),r=Qe();n.append(r),E(this,Ae,I(this,U,Kn).call(this,()=>Te(()=>f(this,wt).call(this,r)))),f(this,st)===0&&(f(this,Ce).before(n),E(this,Je,null),At(f(this,re),()=>{E(this,re,null)}),I(this,U,qn).call(this,x))}))},Ir=function(){try{if(this.is_pending=this.has_pending_snippet(),E(this,st,0),E(this,Et,0),E(this,Ae,Te(()=>{f(this,wt).call(this,f(this,Ce))})),f(this,st)>0){var t=E(this,Je,document.createDocumentFragment());ei(f(this,Ae),t);const n=f(this,xe).pending;E(this,re,Te(()=>n(f(this,Ce))))}else I(this,U,qn).call(this,x)}catch(n){this.error(n)}},qn=function(t){this.is_pending=!1,t.transfer_effects(f(this,bn),f(this,yn))},Kn=function(t){var n=M,r=O,i=he;Ge(f(this,fe)),Re(f(this,fe)),Zt(f(this,fe).ctx);try{return Rt.ensure(),t()}catch(s){return Pi(s),null}finally{Ge(n),Re(r),Zt(i)}},Nr=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&I(r=this.parent,U,Nr).call(r,t,n);return}E(this,st,f(this,st)+t),f(this,st)===0&&(I(this,U,qn).call(this,n),f(this,re)&&At(f(this,re),()=>{E(this,re,null)}),f(this,Je)&&(f(this,Ce).before(f(this,Je)),E(this,Je,null)))},Rr=function(t){f(this,Ae)&&(de(f(this,Ae)),E(this,Ae,null)),f(this,re)&&(de(f(this,re)),E(this,re,null)),f(this,ge)&&(de(f(this,ge)),E(this,ge,null));var n=f(this,xe).onerror;let r=f(this,xe).failed;var i=!1,s=!1;const o=()=>{if(i){ho();return}i=!0,s&&$s(),f(this,ge)!==null&&At(f(this,ge),()=>{E(this,ge,null)}),I(this,U,Kn).call(this,()=>{I(this,U,Ir).call(this)})},a=l=>{try{s=!0,n?.(l,o),s=!1}catch(c){ot(c,f(this,fe)&&f(this,fe).parent)}r&&E(this,ge,I(this,U,Kn).call(this,()=>{try{return Te(()=>{var c=M;c.b=this,c.f|=Er,r(f(this,Ce),()=>l,()=>o)})}catch(c){return ot(c,f(this,fe).parent),null}}))};ft(()=>{var l;try{l=this.transform_error(t)}catch(c){ot(c,f(this,fe)&&f(this,fe).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>ot(c,f(this,fe)&&f(this,fe).parent)):a(l)})};function Oo(e,t,n,r){const i=vn;var s=e.filter(d=>!d.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var o=M,a=Mo(),l=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function c(d){if((o.f&Ie)===0){a();try{r(d)}catch(_){ot(_,o)}Vn()}}var h=Wi();if(n.length===0){l.then(()=>c(t.map(i))).finally(h);return}function u(){Promise.all(n.map(d=>Io(d))).then(d=>c([...t.map(i),...d])).catch(d=>ot(d,o)).finally(h)}l?l.then(()=>{a(),u(),Vn()}):u()}function Mo(){var e=M,t=O,n=he,r=x;return function(s=!0){Ge(e),Re(t),Zt(n),s&&(e.f&Ie)===0&&(r?.activate(),r?.apply())}}function Vn(e=!0){Ge(null),Re(null),Zt(null),e&&x?.deactivate()}function Wi(){var e=M,t=e.b,n=x,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),()=>{t.update_pending_count(-1,n),n.decrement(r,e)}}function vn(e){var t=ne|te;return M!==null&&(M.f|=en),{ctx:he,deps:null,effects:null,equals:Ii,f:t,fn:e,reactions:null,rv:0,v:Z,wv:0,parent:M,ac:null}}const Pn=Symbol("obsolete");function Io(e,t,n){let r=M;r===null&&Ws();var i=void 0,s=Lt(Z),o=!O,a=new Set;return zo(()=>{var l=M,c=Ai();i=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==sr&&c.reject(_)}).finally(Vn)}catch(_){c.reject(_),Vn()}var h=x;if(o){if((l.f&Pt)!==0)var u=Wi();if(r.b.is_rendered())h.async_deriveds.get(l)?.reject(Pn);else for(const _ of a.values())_.reject(Pn);a.add(c),h.async_deriveds.set(l,c)}const d=(_,v=void 0)=>{u?.(),a.delete(c),v!==Pn&&(h.activate(),v?(s.f|=at,Qt(s,v)):((s.f&at)!==0&&(s.f^=at),Qt(s,_)),h.deactivate())};c.promise.then(d,_=>d(null,_||"unknown"))}),Jr(()=>{for(const l of a)l.reject(Pn)}),new Promise(l=>{function c(h){function u(){h===i?l(s):c(i)}h.then(u,u)}c(i)})}function be(e){const t=vn(e);return ss(t),t}function zi(e){const t=vn(e);return t.equals=Ni,t}function No(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!Vi&&Po()}return t}function Po(){Vi=!1;for(const e of Yn){(e.f&$)!==0&&z(e,Ue);let t;try{t=xn(e)}catch{t=!0}t&&$t(e)}Yn.clear()}function cn(e){Q(e,e.v+1)}function Yi(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s{if(Tt===s)return a();var l=O,c=Tt;Re(null),fi(s);var h=a();return Re(l),fi(c),h};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Xs();var h=n.get(l);return h===void 0?o(()=>{var u=oe(c.value);return n.set(l,u),u}):Q(h,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const h=o(()=>oe(Z));n.set(l,h),cn(i)}}else Q(c,Z),cn(i);return!0},get(a,l,c){if(l===Ct)return e;var h=n.get(l),u=l in a;if(h===void 0&&(!u||Ht(a,l)?.writable)&&(h=o(()=>{var _=lt(u?a[l]:Z),v=oe(_);return v}),n.set(l,h)),h!==void 0){var d=g(h);return d===Z?void 0:d}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var h=n.get(l);h&&(c.value=g(h))}else if(c===void 0){var u=n.get(l),d=u?.v;if(u!==void 0&&d!==Z)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(a,l){if(l===Ct)return!0;var c=n.get(l),h=c!==void 0&&c.v!==Z||Reflect.has(a,l);if(c!==void 0||M!==null&&(!h||Ht(a,l)?.writable)){c===void 0&&(c=o(()=>{var d=h?lt(a[l]):Z,_=oe(d);return _}),n.set(l,c));var u=g(c);if(u===Z)return!1}return h},set(a,l,c,h){var u=n.get(l),d=l in a;if(r&&l==="length")for(var _=c;_oe(Z)),n.set(_+"",v))}if(u===void 0)(!d||Ht(a,l)?.writable)&&(u=o(()=>oe(void 0)),Q(u,lt(c)),n.set(l,u));else{d=u.v!==Z;var b=o(()=>lt(c));Q(u,b)}var p=Reflect.getOwnPropertyDescriptor(a,l);if(p?.set&&p.set.call(h,c),!d){if(r&&typeof l=="string"){var m=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=m.v&&Q(m,w+1)}cn(i)}return!0},ownKeys(a){g(i);var l=Reflect.ownKeys(a).filter(u=>{var d=n.get(u);return d===void 0||d.v!==Z});for(var[c,h]of n)h.v!==Z&&!(c in a)&&l.push(c);return l},setPrototypeOf(){Zs()}})}function oi(e){try{if(e!==null&&typeof e=="object"&&Ct in e)return e[Ct]}catch{}return e}function Do(e,t){return Object.is(oi(e),oi(t))}var Lr,Ji,Xi,Zi;function Fo(){if(Lr===void 0){Lr=window,Ji=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xi=Ht(t,"firstChild").get,Zi=Ht(t,"nextSibling").get,ri(e)&&(e[Sr]=void 0,e[Fn]=null,e[Cr]=void 0,e.__e=void 0),ri(n)&&(n[on]=void 0)}}function Qe(e=""){return document.createTextNode(e)}function Jn(e){return Xi.call(e)}function Cn(e){return Zi.call(e)}function L(e,t){return Jn(e)}function Kt(e,t=!1){{var n=Jn(e);return n instanceof Comment&&n.data===""?Cn(n):n}}function N(e,t=1,n=!1){let r=e;for(;t--;)r=Cn(r);return r}function Bo(e){e.textContent=""}function Qi(){return!1}function jo(e,t,n){return document.createElementNS(Mi,e,void 0)}let li=!1;function Ho(){li||(li=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Bn]?.()})},{capture:!0}))}function or(e){var t=O,n=M;Re(null),Ge(null);try{return e()}finally{Re(t),Ge(n)}}function Vr(e,t,n,r=n){e.addEventListener(t,()=>or(n));const i=e[Bn];i?e[Bn]=()=>{i(),r(!0)}:e[Bn]=()=>r(!0),Ho()}function qo(e){M===null&&(O===null&&Vs(),Gs()),$e&&Us()}function Ko(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function et(e,t){var n=M;n!==null&&(n.f&le)!==0&&(e|=le);var r={ctx:he,deps:null,nodes:null,f:e|te|Me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};x?.register_created_effect(r);var i=r;if((e&Jt)!==0)jt!==null?jt.push(r):Rt.ensure().schedule(r);else if(t!==null){try{$t(r)}catch(o){throw de(r),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&en)===0&&(i=i.first,(e&De)!==0&&(e&Xt)!==0&&i!==null&&(i.f|=Xt))}if(i!==null&&(i.parent=n,n!==null&&Ko(i,n),O!==null&&(O.f&ne)!==0&&(e&dt)===0)){var s=O;(s.effects??(s.effects=[])).push(i)}return r}function Yr(){return O!==null&&!Be}function Jr(e){const t=et(ir,null);return z(t,$),t.teardown=e,t}function Xr(e){qo();var t=M.f,n=!O&&(t&je)!==0&&(t&Pt)===0;if(n){var r=he;(r.e??(r.e=[])).push(e)}else return $i(e)}function $i(e){return et(Jt|js,e)}function Wo(e){Rt.ensure();const t=et(dt|en,e);return(n={})=>new Promise(r=>{n.outro?At(t,()=>{de(t),r(void 0)}):(de(t),r(void 0))})}function es(e){return et(Jt,e)}function zo(e){return et(qt|en,e)}function lr(e,t=0){return et(ir|t,e)}function se(e,t=[],n=[],r=[]){Oo(r,t,n,i=>{et(ir,()=>e(...i.map(g)))})}function Zr(e,t=0){var n=et(De|t,e);return n}function Te(e){return et(je|en,e)}function ts(e){var t=e.teardown;if(t!==null){const n=$e,r=O;ai(!0),Re(null);try{t.call(null)}finally{ai(n),Re(r)}}}function Qr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&or(()=>{i.abort(sr)});var r=n.next;(n.f&dt)!==0?n.parent=null:de(n,t),n=r}}function Uo(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&je)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Bs)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Go(e.nodes.start,e.nodes.end),n=!0),z(e,kr),Qr(e,t&&!n),pn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();ts(e),e.f^=kr,e.f|=Ie;var i=e.parent;i!==null&&i.first!==null&&ns(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Go(e,t){for(;e!==null;){var n=e===t?null:Cn(e);e.remove(),e=n}}function ns(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function At(e,t,n=!0){var r=[];rs(e,r,!0);var i=()=>{n&&de(e),t&&t()},s=r.length;if(s>0){var o=()=>--s||i();for(var a of r)a.out(o)}else i()}function rs(e,t,n){if((e.f&le)===0){e.f^=le;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next;if((i.f&dt)===0){var o=(i.f&Xt)!==0||(i.f&je)!==0&&(e.f&De)!==0;rs(i,t,o?n:!1)}i=s}}}function $r(e){is(e,!0)}function is(e,t){if((e.f&le)!==0){e.f^=le,(e.f&$)===0&&(z(e,te),Rt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Xt)!==0||(n.f&je)!==0;is(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const o of s)(o.is_global||t)&&o.in()}}function ei(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Cn(n);t.append(n),n=i}}let Wn=!1,$e=!1;function ai(e){$e=e}let O=null,Be=!1;function Re(e){O=e}let M=null;function Ge(e){M=e}let Ne=null;function ss(e){O!==null&&(Ne===null?Ne=[e]:Ne.push(e))}let ue=null,ve=0,Se=null;function Vo(e){Se=e}let os=1,pt=0,Tt=pt;function fi(e){Tt=e}function ls(){return++os}function xn(e){var t=e.f;if((t&te)!==0)return!0;if(t&ne&&(e.f&=~Nt),(t&Ue)!==0){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}(t&Me)!==0&&Fe===null&&z(e,$)}return!1}function as(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ne!==null&&St.call(Ne,e)))for(var i=0;i{e.ac.abort(sr)}),e.ac=null);try{e.f|=Gn;var h=e.fn,u=h();e.f|=Pt;var d=e.deps,_=x?.is_fork;if(ue!==null){var v;if(_||pn(e,ve),d!==null&&ve>0)for(d.length=ve+ue.length,v=0;vn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ft(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function $o(e,t,n,r,i){var s={capture:r,passive:i},o=Qo(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Jr(()=>{t.removeEventListener(e,o,s)})}function ut(e,t,n){(t[gt]??(t[gt]={}))[e]=n}function ar(e){for(var t=0;t{throw p});throw d}}finally{e[gt]=t,delete e.currentTarget,Re(h),Ge(u)}}}const el=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function tl(e){return el?.createHTML(e)??e}function nl(e){var t=jo("template");return t.innerHTML=tl(e.replaceAll("","")),t.content}function Xn(e,t){var n=M;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=(t&ao)!==0,r=(t&fo)!==0,i,s=!e.startsWith("");return()=>{i===void 0&&(i=nl(s?e:""+e),n||(i=Jn(i)));var o=r||Ji?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=Jn(o),l=o.lastChild;Xn(a,l)}else Xn(o,o);return o}}function rl(e=""){{var t=Qe(e+"");return Xn(t,t),t}}function il(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Qe();return e.append(t,n),Xn(t,n),e}function W(e,t){e!==null&&e.before(t)}function ce(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[on]??(e[on]=e.nodeValue))&&(e[on]=n,e.nodeValue=`${n}`)}function hs(e,t){return sl(e,t)}const Dn=new Map;function sl(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:o=!0,transformError:a}){Fo();var l=void 0,c=Wo(()=>{var h=n??t.appendChild(Qe());So(h,{pending:()=>{}},_=>{kn({});var v=he;s&&(v.c=s),i&&(r.$$events=i),l=e(_,r)||{},Sn()},a);var u=new Set,d=_=>{for(var v=0;v<_.length;v++){var b=_[v];if(!u.has(b)){u.add(b);var p=Zo(b);for(const C of[t,document]){var m=Dn.get(C);m===void 0&&(m=new Map,Dn.set(C,m));var w=m.get(b);w===void 0?(C.addEventListener(b,Dr,{passive:p}),m.set(b,1)):m.set(b,w+1)}}}};return d(rr(ds)),Pr.add(d),()=>{for(var _ of u)for(const p of[t,document]){var v=Dn.get(p),b=v.get(_);--b==0?(p.removeEventListener(_,Dr),v.delete(_),v.size===0&&Dn.delete(p)):v.set(_,b)}Pr.delete(d),h!==n&&h.parentNode?.removeChild(h)}});return Fr.set(l,c),l}let Fr=new WeakMap;function fr(e,t){const n=Fr.get(e);return n?(Fr.delete(e),n(t)):Promise.resolve()}var Pe,We,me,kt,wn,En,nr;class ol{constructor(t,n=!0){ae(this,"anchor");S(this,Pe,new Map);S(this,We,new Map);S(this,me,new Map);S(this,kt,new Set);S(this,wn,!0);S(this,En,t=>{if(f(this,Pe).has(t)){var n=f(this,Pe).get(t),r=f(this,We).get(n);if(r)$r(r),f(this,kt).delete(n);else{var i=f(this,me).get(n);i&&(f(this,We).set(n,i.effect),f(this,me).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,o]of f(this,Pe)){if(f(this,Pe).delete(s),s===t)break;const a=f(this,me).get(o);a&&(de(a.effect),f(this,me).delete(o))}for(const[s,o]of f(this,We)){if(s===n||f(this,kt).has(s))continue;const a=()=>{if(Array.from(f(this,Pe).values()).includes(s)){var c=document.createDocumentFragment();ei(o,c),c.append(Qe()),f(this,me).set(s,{effect:o,fragment:c})}else de(o);f(this,kt).delete(s),f(this,We).delete(s)};f(this,wn)||!r?(f(this,kt).add(s),At(o,a,!1)):a()}}});S(this,nr,t=>{f(this,Pe).delete(t);const n=Array.from(f(this,Pe).values());for(const[r,i]of f(this,me))n.includes(r)||(de(i.effect),f(this,me).delete(r))});this.anchor=t,E(this,wn,n)}ensure(t,n){var r=x,i=Qi();if(n&&!f(this,We).has(t)&&!f(this,me).has(t))if(i){var s=document.createDocumentFragment(),o=Qe();s.append(o),f(this,me).set(t,{effect:Te(()=>n(o)),fragment:s})}else f(this,We).set(t,Te(()=>n(this.anchor)));if(f(this,Pe).set(r,t),i){for(const[a,l]of f(this,We))a===t?r.unskip_effect(l):r.skip_effect(l);for(const[a,l]of f(this,me))a===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(f(this,En)),r.ondiscard(f(this,nr))}else f(this,En).call(this,r)}}Pe=new WeakMap,We=new WeakMap,me=new WeakMap,kt=new WeakMap,wn=new WeakMap,En=new WeakMap,nr=new WeakMap;function ie(e,t,n=!1){var r=new ol(e),i=n?Xt:0;function s(o,a){r.ensure(o,a)}Zr(()=>{var o=!1;t((a,l=0)=>{o=!0,s(l,a)}),o||s(-1,null)},i)}function ll(e,t){return t}function al(e,t,n){for(var r=[],i=t.length,s,o=t.length,a=0;a{if(s){if(s.pending.delete(u),s.done.add(u),s.pending.size===0){var d=e.outrogroups;Br(e,rr(s.done)),d.delete(s),d.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var c=n,h=c.parentNode;Bo(h),h.append(c),e.items.clear()}Br(e,t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function Br(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const a of o)r.add(e.items.get(a).e)}for(var i=0;i{var C=n();return Kr(C)?C:C==null?[]:rr(C)}),d,_=new Map,v=!0;function b(C){(w.effect.f&Ie)===0&&(w.pending.delete(C),w.fallback=h,fl(w,d,o,t,r),h!==null&&(d.length===0?(h.f&ze)===0?$r(h):(h.f^=ze,an(h,null,o)):At(h,()=>{h=null})))}function p(C){w.pending.delete(C)}var m=Zr(()=>{d=g(u);for(var C=d.length,T=new Set,H=x,ee=Qi(),Y=0;Ys(o)):(h=Te(()=>s(ci??(ci=Qe()))),h.f|=ze)),C>T.size&&zs(),!v)if(_.set(H,T),ee){for(const[_t,He]of a)T.has(_t)||H.skip_effect(He.e);H.oncommit(b),H.ondiscard(p)}else b(H);g(u)}),w={effect:m,items:a,pending:_,outrogroups:null,fallback:h};v=!1}function sn(e){for(;e!==null&&(e.f&je)===0;)e=e.next;return e}function fl(e,t,n,r,i){var s=(r&no)!==0,o=t.length,a=e.items,l=sn(e.effect.first),c,h=null,u,d=[],_=[],v,b,p,m;if(s)for(m=0;m0){var we=(r&Oi)!==0&&o===0?n:null;if(s){for(m=0;m<_e;m+=1)Y[m].nodes?.a?.measure();for(m=0;m<_e;m+=1)Y[m].nodes?.a?.fix()}al(e,Y,we)}}s&&ft(()=>{if(u!==void 0)for(p of u)p.nodes?.a?.apply()})}function ul(e,t,n,r,i,s,o,a){var l=(o&eo)!==0?(o&ro)===0?Lo(n,!1,!1):Lt(n):null,c=(o&to)!==0?Lt(i):null;return{v:l,i:c,e:Te(()=>(s(t,l??n,c??i,a),()=>{e.delete(r)}))}}function an(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,s=t&&(t.f&ze)===0?t.nodes.start:n;r!==null;){var o=Cn(r);if(s.before(r),r===i)return;r=o}}function nt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const di=[...` -\r\f \v\uFEFF`];function cl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+s;(o===0||di.includes(r[o-1]))&&(a===r.length||di.includes(r[a]))?r=(o===0?"":r.substring(0,o))+r.substring(a+1):o=a}}return r===""?null:r}function dl(e,t){return e==null?null:String(e)}function ti(e,t,n,r,i,s){var o=e[Sr];if(o!==n||o===void 0){var a=cl(n,r,s);a==null?e.removeAttribute("class"):e.className=a,e[Sr]=n}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function hl(e,t,n,r){var i=e[Cr];if(i!==t){var s=dl(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e[Cr]=t}return r}function vs(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Kr(t))return co();for(var r of e.options)r.selected=t.includes(dn(r));return}for(r of e.options){var i=dn(r);if(Do(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function _l(e){var t=new MutationObserver(()=>{vs(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Jr(()=>{t.disconnect()})}function vl(e,t,n=t){var r=new WeakSet,i=!0;Vr(e,"change",s=>{var o=s?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(o),dn);else{var l=e.querySelector(o)??e.querySelector("option:not([disabled])");a=l&&dn(l)}n(a),e.__value=a,x!==null&&r.add(x)}),es(()=>{var s=t();if(e===document.activeElement){var o=x;if(r.has(o))return}if(vs(e,s,i),i&&s===void 0){var a=e.querySelector(":checked");a!==null&&(s=dn(a),n(s))}e.__value=s,i=!1}),_l(e)}function dn(e){return"__value"in e?e.__value:e.value}const pl=Symbol("is custom element"),gl=Symbol("is html");function Ot(e,t,n,r){var i=ml(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[qs]=n),n==null?e.removeAttribute(t):typeof n!="string"&&bl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ml(e){return e[Fn]??(e[Fn]={[pl]:e.nodeName.includes("-"),[gl]:e.namespaceURI===Mi})}var hi=new Map;function bl(e){var t=e.getAttribute("is")||e.nodeName,n=hi.get(t);if(n)return n;hi.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=Rs(i);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);i=xi(i)}return n}function _i(e,t,n=t){var r=new WeakSet;Vr(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=gr(e)?mr(s):s,n(s),x!==null&&r.add(x),await Jo(),s!==(s=t())){var o=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=s??"",a!==null){var c=e.value.length;o===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(a,c))}}}),tn(t)==null&&e.value&&(n(gr(e)?mr(e.value):e.value),x!==null&&r.add(x)),lr(()=>{var i=t();if(e===document.activeElement){var s=x;if(r.has(s))return}gr(e)&&i===mr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function ps(e,t,n=t){Vr(e,"change",r=>{var i=r?e.defaultChecked:e.checked;n(i)}),tn(t)==null&&n(e.checked),lr(()=>{var r=t();e.checked=!!r})}function gr(e){var t=e.type;return t==="number"||t==="range"}function mr(e){return e===""?null:+e}function br(e,t){return e===t||e?.[Ct]===t}function yl(e={},t,n,r){var i=he.r,s=M;return es(()=>{var o,a;return lr(()=>{o=a,a=[],tn(()=>{br(n(...a),e)||(t(e,...a),o&&br(n(...o),e)&&t(null,...o))})}),()=>{let l=s;for(;l!==i&&l.parent!==null&&l.parent.f&kr;)l=l.parent;const c=()=>{a&&br(n(...a),e)&&t(null,...a)},h=l.teardown;l.teardown=()=>{c(),h?.()}}}),e}function hn(e,t,n,r){var i=!0,s=(n&oo)!==0,o=(n&lo)!==0,a=r,l=!0,c=void 0,h=()=>o&&i?(c??(c=vn(r)),g(c)):(l&&(l=!1,a=o?tn(r):r),a);let u;if(s){var d=Ct in e||Hs in e;u=Ht(e,t)?.set??(d&&t in e?T=>e[t]=T:void 0)}var _,v=!1;s?[_,v]=go(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),u&&(Js(),u(_)));var b;if(b=()=>{var T=e[t];return T===void 0?h():(l=!0,T)},(n&so)===0)return b;if(u){var p=e.$$legacy;return(function(T,H){return arguments.length>0?((!H||p||v)&&u(H?b():T),T):b()})}var m=!1,w=((n&io)!==0?vn:zi)(()=>(m=!1,b()));s&&g(w);var C=M;return(function(T,H){if(arguments.length>0){const ee=H?g(w):s?lt(T):T;return Q(w,ee),m=!0,a!==void 0&&(a=ee),T}return $e&&m||(C.f&Ie)!==0?w.v:g(w)})}function wl(e){he===null&&Ks(),Xr(()=>{const t=tn(e);if(typeof t=="function")return t})}const gs="[data-v-app]",El=["header","content","footer"];let Oe=null,Le=null;function kl(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Sl(){if(typeof document>"u")return!1;const t=document.querySelector(gs)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Oe=null,!1):(Oe=t,Le=null,!0)}function Cl(){if(Le!==null)return Le;const e=typeof document<"u"?document.querySelector(gs)?.__vue_app__:null;if(!e)return Le=!1,!1;const t=e.config?.globalProperties??{};if(typeof Oe?.$history?.pause=="function"&&typeof Oe?.$history?.resume=="function")return Le={pause:()=>Oe.$history.pause(),resume:()=>Oe.$history.resume()},Le;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(Le={pause:()=>n.history.pause(),resume:()=>n.history.resume()},Le):typeof t.pauseHistory=="function"&&typeof t.resumeHistory=="function"?(Le={pause:()=>t.pauseHistory(),resume:()=>t.resumeHistory()},Le):(Le=!1,!1)}function xl(e){const t=Cl();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function ct(e){if(!Oe||!e)return null;for(const t of El){const n=Oe[t];if(!Array.isArray(n))continue;const r=n.find(i=>i&&i.id===e);if(r)return r}return null}function Al(e){const t=ct(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return ms(t,1,n),n}function ms(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const i=ct(r);i&&(n.push({id:i.id,depth:t,label:i.label,name:i.name,settings:i.settings}),ms(i,t+1,n))}}function bs(){return Oe?Oe.globalClasses:[]}function yr(e,t){if(!Oe)throw new Error("rebemer: not ready");const n=Oe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const i=new Set(n.map(o=>o?.id).filter(Boolean)),s=kl(i);return n.push({id:s,name:e,settings:t||{}}),s}function vi(e,t){const n=ct(e);if(!n)return;n.settings||(n.settings={});const r=Array.isArray(t)?t:[];Array.isArray(n.settings._cssGlobalClasses)?n.settings._cssGlobalClasses.splice(0,n.settings._cssGlobalClasses.length,...r):n.settings._cssGlobalClasses=[...r]}function pi(e,t){const n=ct(e);n&&(n.label=t)}const Zn="slashed-rebemer-host",Tl="slashed-class-hint",ys=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],Ol=3;function Ml(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n[0]==="."&&(n=n.slice(1)),!n.startsWith("sf-")&&!n.startsWith("is-"))||!Object.prototype.hasOwnProperty.call(t,n))return null;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let jr=!1,Qn={},Ze=null,_n=null,ye=null;function Il(){if(Ze&&Ze.isConnected)return Ze;let e=document.getElementById(Zn);e||(e=document.createElement("div"),e.id=Zn,document.body.appendChild(e));const t=document.createElement("div");return t.id=Tl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

    ',e.appendChild(t),Ze=t,t}function ws(e){let t=e;for(let n=0;t&&na&&n.top-s-i>=0&&(l=n.top-s-i);let c=n.left;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(l)}px`,e.style.left=`${Math.round(c)}px`}function Es(e,t){const n=Il();n.querySelector(".rebemer-class-hint__name").textContent=`.${t.name}`;const r=n.querySelector(".rebemer-class-hint__cat");r.textContent=t.category||"",r.hidden=!t.category,n.querySelector(".rebemer-class-hint__desc").textContent=t.description,n.hidden=!1,Nl(n,e),ye=e}function ht(){Ze&&(Ze.hidden=!0),ye=null}function Rl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${Zn}`))return;if(!t.closest(ys.join(","))){ye&&ht();return}const n=ws(t);if(!n){ye&&ht();return}n.el!==ye&&Es(n.el,n.hint)}function Ll(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Pl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${Zn}`))return;if(!t.closest(ys.join(","))){ye&&ht();return}const n=ws(t);if(!n){ye&&ht();return}n.el!==ye&&Es(n.el,n.hint)}function Dl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Fl(e){e.key==="Escape"&&ht()}function Bl(e,t,n={}){if(zn(),jr=!!e,Qn=t&&typeof t=="object"?t:{},!jr||Object.keys(Qn).length===0)return;_n=new AbortController;const{signal:r}=_n,i={passive:!0,signal:r};document.addEventListener("mouseover",Rl,i),document.addEventListener("mouseout",Ll,i),document.addEventListener("focusin",Pl,i),document.addEventListener("focusout",Dl,i),document.addEventListener("keydown",Fl,i),window.addEventListener("scroll",ht,{capture:!0,passive:!0,signal:r}),n.signal&&(n.signal.aborted?zn():n.signal.addEventListener("abort",zn,{once:!0}))}function zn(){_n&&(_n.abort(),_n=null),Ze&&(Ze.remove(),Ze=null),ye=null,jr=!1,Qn={}}const jl="5";var Ci;typeof window<"u"&&((Ci=window.__svelte??(window.__svelte={})).v??(Ci.v=new Set)).add(jl);var Hl=V('reBEM');function ql(e,t){kn(t,!0);function n(i){i.stopPropagation(),i.preventDefault(),t.onActivate?.(t.elementId)}var r=Hl();se(()=>{Ot(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),Ot(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),ut("click",r,n),ut("keydown",r,i=>(i.key==="Enter"||i.key===" ")&&n(i)),W(e,r),Sn()}ar(["click","keydown"]);function Mt(e){return e?String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x00-\x7f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}const Kl=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,Wl=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function zl(e){return e?Wl.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:Kl.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const ur=new Set(["_padding","_padding_top","_padding_right","_padding_bottom","_padding_left","_margin","_margin_top","_margin_right","_margin_bottom","_margin_left","_width","_widthMin","_widthMax","_minWidth","_maxWidth","_height","_heightMin","_heightMax","_minHeight","_maxHeight","_aspectRatio","_overflow","_overflowX","_overflowY","_color","_background","_backgroundColor","_backgroundImage","_backgroundSize","_backgroundPosition","_backgroundRepeat","_backgroundAttachment","_backgroundBlendMode","_typography","_fontFamily","_fontSize","_fontWeight","_fontStyle","_lineHeight","_letterSpacing","_wordSpacing","_textAlign","_textTransform","_textDecoration","_textDecorationColor","_textShadow","_textIndent","_whiteSpace","_listStyleType","_listStylePosition","_border","_borderRadius","_borderColor","_borderStyle","_borderWidth","_outline","_outlineColor","_outlineStyle","_outlineWidth","_outlineOffset","_boxShadow","_filter","_backdropFilter","_opacity","_blendMode","_transform","_transformOrigin","_transition","_animation","_display","_flexDirection","_flexWrap","_flexGrow","_flexShrink","_flexBasis","_alignItems","_alignSelf","_alignContent","_justifyContent","_justifyItems","_justifySelf","_gap","_rowGap","_columnGap","_gridTemplateColumns","_gridTemplateRows","_gridGap","_gridAutoFlow","_gridAutoColumns","_gridAutoRows","_gridColumn","_gridRow","_gridArea","_position","_top","_right","_bottom","_left","_zIndex","_objectFit","_objectPosition","_cursor","_pointerEvents","_userSelect"]);function Ul(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))ur.has(n)&&t.push(n);return t.sort(),t}const Gl=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function Vl(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))ur.has(n)||Gl.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const Yl=new Set(["add","rename","replace","modifier","migrate"]),gi=new Set(["user","label"]);function ks({rootId:e,rows:t,mode:n}){if(!Yl.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(a=>a.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};const i=Mt(r.name);if(!i)return{ok:!1,ops:[],error:"Block name is empty."};const s=[];for(const a of t){if(!a.include)continue;const l=a.id===e;let c;if(l)c=i;else{const u=Mt(a.name);if(!u)continue;c=`${i}__${u}`}let h=c;if(n==="modifier"){const u=Mt(a.modifier);if(!u)continue;h=`${c}--${u}`}s.push({row:a,isRoot:l,finalClass:h,suggestedFrom:a.suggestedFrom||"fallback"})}if(s.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const o=Zl(s,n);return o.ok?{ok:!0,ops:s}:{ok:!1,ops:[],error:o.error}}function Jl({rootId:e,rows:t,mode:n,syncLabels:r}){const i=ks({rootId:e,rows:t,mode:n});if(!i.ok)return{ok:!1,error:i.error};const s=i.ops,o=t.find(u=>u.id===e),a=Mt(o?.name??""),l=bs();if(n==="migrate"){const u=Xl(s,l);if(!u.ok)return u}const c=new Map;for(const u of s){const d=ct(u.row.id);if(!d)continue;const _={classIds:mi(d.settings).slice(),label:r&&n!=="modifier"?d.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const b of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(d.settings||{},b)&&(v[b]=JSON.parse(JSON.stringify(d.settings[b])));_.migrateKeys=v}c.set(u.row.id,_)}let h=0;try{xl(()=>{for(const u of s){const d=ct(u.row.id);if(!d)continue;const _=mi(d.settings);let v={};if(n==="rename"&&_.length>0){const m=l.find(w=>w&&w.id===_[0]);m&&m.settings&&(v=JSON.parse(JSON.stringify(m.settings)))}else n==="migrate"&&(v=Ss(d.settings,u.row.migrateKeys));if(n==="migrate"){const m=l.find(w=>w&&w.name===u.finalClass);if(m){(!m.settings||typeof m.settings!="object")&&(m.settings={});for(const[w,C]of Object.entries(v))Object.prototype.hasOwnProperty.call(m.settings,w)||(m.settings[w]=C)}}const b=yr(u.finalClass,v);let p;switch(n){case"add":case"migrate":p=_.includes(b)?_:[..._,b];break;case"modifier":{const m=u.finalClass.indexOf("--"),w=m>=0?u.finalClass.slice(0,m):null;let C=[..._];if(w){const T=yr(w,{});C.includes(T)||C.push(T)}p=C.includes(b)?C:[...C,b];break}case"rename":{const m=[b],w=_.length>0?l.find(C=>C&&C.id===_[0]):null;if(w){const C=w.name+"--";for(let T=1;T<_.length;T++){const H=l.find(ee=>ee&&ee.id===_[T]);if(H)if(H.name.startsWith(C)){const ee=H.name.slice(w.name.length),Y=H.settings?JSON.parse(JSON.stringify(H.settings)):{};m.push(yr(u.finalClass+ee,Y))}else m.push(_[T])}}p=m;break}case"replace":p=[b];break}if(vi(u.row.id,p),n==="migrate"&&Ql(d.settings,u.row.migrateKeys),r&&n!=="modifier"){const m=$l(u.finalClass,a);m&&pi(u.row.id,m)}h++}})}catch(u){for(const[_,v]of c)try{if(vi(_,v.classIds),v.migrateKeys){const b=ct(_);b&&b.settings&&Object.assign(b.settings,v.migrateKeys)}v.label!==null&&pi(_,v.label)}catch{}const d=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",h,"mutation(s), rolled back:",d),{ok:!1,error:`Operation failed and was rolled back: ${d}`}}return h===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:h}}function Xl(e,t){for(const n of e){const r=t.find(l=>l&&l.name===n.finalClass);if(!r)continue;const i=ct(n.row.id);if(!i)continue;const s=Ss(i.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},a=[];for(const[l,c]of Object.entries(s))Object.prototype.hasOwnProperty.call(o,l)&&JSON.stringify(o[l])!==JSON.stringify(c)&&a.push(l.replace(/^_/,""));if(a.length>0){const l=a.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${l}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Zl(e,t){const n=new Map;for(const r of e){const i=n.get(r.finalClass)||[];i.push(r),n.set(r.finalClass,i)}for(const[r,i]of n){if(i.length===1||t==="modifier")continue;const s=i.filter(a=>gi.has(a.suggestedFrom));if(s.length>1)return{ok:!1,error:`"${r}" is used by ${s.length} rows. Edit one to make it unique.`};let o=1;for(const a of i)gi.has(a.suggestedFrom)||(a.finalClass=`${r}-${o++}`,a.suggestedFrom="auto-number")}if(t!=="modifier"){const r=new Map;for(const i of e){const s=r.get(i.finalClass);if(s)return{ok:!1,error:`"${i.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${i.suggestedFrom}). Pick a different name for one of them.`};r.set(i.finalClass,i.suggestedFrom)}}return{ok:!0}}function Ss(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)ur.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Ql(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)ur.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function mi(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function $l(e,t){let n=e;return n===t?bi(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),bi(n.replace(/-/g," ")))}function bi(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const ea=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),Cs=new Set(["section","container","block","div"]);function ta(e,t="item"){return!e||typeof e!="string"||Cs.has(e)?t:ea[e]||t}function wr(e){return typeof e=="string"&&Cs.has(e)}const na=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function ra(e,t,n){const r=new Set(e.filter(Boolean)),i=(..._)=>_.some(v=>r.has(v)),s=i("button","button-group"),o=i("heading"),a=i("text-basic","text"),l=i("image"),c=i("nav-nested","nav-menu"),h=i("form"),u=i("icon","icon-box"),d=i("list");return h?"form":c?"nav":s&&!o&&!a?"actions":l&&!a&&!o&&!s?"media":o&&!a&&!s?"header":a&&!o&&!s?"body":o&&a?"content":o&&s?"header":u&&!a&&!o?"icon-group":d?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var ia=V('suggested'),sa=V(' '),oa=V(''),la=V('

    Enter a modifier name — the base class will be added automatically if absent.

    '),aa=V('

    This element has no existing classes. Rename will create a new class instead.

    '),fa=V('

    '),ua=V(`A class named already exists. +var Fs=Object.defineProperty;var fi=e=>{throw TypeError(e)};var Bs=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>Bs(e,typeof t!="symbol"?t+"":t,n),yr=(e,t,n)=>t.has(e)||fi("Cannot "+n);var f=(e,t,n)=>(yr(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?fi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),E=(e,t,n,r)=>(yr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),I=(e,t,n)=>(yr(e,t,"access private method"),n);var Jr=Array.isArray,js=Array.prototype.indexOf,St=Array.prototype.includes,fr=Array.from,Hs=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors,Ks=Object.prototype,Ws=Array.prototype,Li=Object.getPrototypeOf,ui=Object.isExtensible;const zs=()=>{};function Us(e){for(var t=0;t{e=r,t=i});return{promise:n,resolve:e,reject:t}}const ne=2,Xt=4,ur=8,Pi=1<<24,De=16,je=32,dt=64,Tr=128,Me=512,Q=1024,te=2048,Ue=4096,le=8192,Ie=16384,Pt=32768,Or=1<<25,Zt=65536,Zn=1<<17,Gs=1<<18,tn=1<<19,Vs=1<<20,ze=1<<25,Nt=65536,$n=1<<21,qt=1<<22,at=1<<23,Ct=Symbol("$state"),Ys=Symbol("legacy props"),Js=Symbol(""),Hn=Symbol("attributes"),Mr=Symbol("class"),Ir=Symbol("style"),ln=Symbol("text"),qn=Symbol("form reset"),cr=new class extends Error{constructor(){super(...arguments);ae(this,"name","StaleReactionError");ae(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Xs(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function $s(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Qs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function eo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function to(e){throw new Error("https://svelte.dev/e/effect_orphan")}function no(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ro(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function io(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function so(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function oo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function lo(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ao=1,fo=2,Di=4,uo=8,co=16,ho=1,_o=4,vo=8,po=16,go=1,mo=2,Z=Symbol("uninitialized"),Fi="http://www.w3.org/1999/xhtml";function bo(){console.warn("https://svelte.dev/e/derived_inert")}function yo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function wo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Bi(e){return e===this.v}function Eo(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ji(e){return!Eo(e,this.v)}let he=null;function $t(e){he=e}function An(e,t=!1,n){he={p:he,i:!1,c:null,e:null,s:e,x:null,r:M,l:null}}function xn(e){var t=he,n=t.e;if(n!==null){t.e=null;for(var r of n)os(r)}return t.i=!0,he=t.p,{}}function Hi(){return!0}let vt=[];function qi(){var e=vt;vt=[],Us(e)}function ft(e){if(vt.length===0&&!cn){var t=vt;queueMicrotask(()=>{t===vt&&qi()})}vt.push(e)}function ko(){for(;vt.length>0;)qi()}function Ki(e){var t=M;if(t===null)return O.f|=at,e;if((t.f&Pt)===0&&(t.f&Xt)===0)throw e;ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&Tr)!==0){if((t.f&Pt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const So=-7169;function z(e,t){e.f=e.f&So|t}function Xr(e){(e.f&Me)!==0||e.deps===null?z(e,Q):z(e,Ue)}function Wi(e){if(e!==null)for(const t of e)(t.f&ne)===0||(t.f&Nt)===0||(t.f^=Nt,Wi(t.deps))}function zi(e,t,n){(e.f&te)!==0?t.add(e):(e.f&Ue)!==0&&n.add(e),Wi(e.deps),z(e,Q)}let Fn=!1;function Co(e){var t=Fn;try{return Fn=!1,[e(),Fn]}finally{Fn=t}}let wr=null,Ft=null,A=null,Nr=null,Fe=null,Lr=null,cn=!1,Er=!1,jt=null,Kn=null;var ci=0;let Ao=1;var zt,rt,mt,Ut,Gt,bt,Vt,Ye,yn,pe,wn,it,qe,Ke,Yt,yt,L,Rr,an,Pr,Ui,Gi,Wn,xo,Dr,Bt;const or=class or{constructor(){S(this,L);ae(this,"id",Ao++);S(this,zt,!1);ae(this,"linked",!0);S(this,rt,null);S(this,mt,null);ae(this,"async_deriveds",new Map);ae(this,"current",new Map);ae(this,"previous",new Map);ae(this,"unblocked",new Set);S(this,Ut,new Set);S(this,Gt,new Set);S(this,bt,new Set);S(this,Vt,0);S(this,Ye,new Map);S(this,yn,null);S(this,pe,[]);S(this,wn,[]);S(this,it,new Set);S(this,qe,new Set);S(this,Ke,new Map);S(this,Yt,new Set);ae(this,"is_fork",!1);S(this,yt,!1)}skip_effect(t){f(this,Ke).has(t)||f(this,Ke).set(t,{d:[],m:[]}),f(this,Yt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=f(this,Ke).get(t);if(r){f(this,Ke).delete(t);for(var i of r.d)z(i,te),n(i);for(i of r.m)z(i,Ue),n(i)}f(this,Yt).add(t)}capture(t,n,r=!1){t.v!==Z&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&at)===0&&(this.current.set(t,[n,r]),Fe?.set(t,n)),this.is_fork||(t.v=n)}activate(){A=this}deactivate(){A=null,Fe=null}flush(){try{Er=!0,A=this,I(this,L,an).call(this)}finally{ci=0,Lr=null,jt=null,Kn=null,Er=!1,A=null,Fe=null,At.clear()}}discard(){for(const t of f(this,Gt))t(this);f(this,Gt).clear(),f(this,bt).clear(),I(this,L,Bt).call(this)}register_created_effect(t){f(this,wn).push(t)}increment(t,n){if(E(this,Vt,f(this,Vt)+1),t){let r=f(this,Ye).get(n)??0;f(this,Ye).set(n,r+1)}}decrement(t,n){if(E(this,Vt,f(this,Vt)-1),t){let r=f(this,Ye).get(n)??0;r===1?f(this,Ye).delete(n):f(this,Ye).set(n,r-1)}f(this,yt)||(E(this,yt,!0),ft(()=>{E(this,yt,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)f(this,it).add(r);for(const r of n)f(this,qe).add(r);t.clear(),n.clear()}oncommit(t){f(this,Ut).add(t)}ondiscard(t){f(this,Gt).add(t)}on_fork_commit(t){f(this,bt).add(t)}run_fork_commit_callbacks(){for(const t of f(this,bt))t(this);f(this,bt).clear()}settled(){return(f(this,yn)??E(this,yn,Ri())).promise}static ensure(){var t;if(A===null){const n=A=new or;I(t=n,L,Dr).call(t),!Er&&!cn&&ft(()=>{f(n,zt)||n.flush()})}return A}apply(){{Fe=null;return}}schedule(t){if(Lr=t,t.b?.is_pending&&(t.f&(Xt|ur|Pi))!==0&&(t.f&Pt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(jt!==null&&n===M&&(O===null||(O.f&ne)===0))return;if((r&(dt|je))!==0){if((r&Q)===0)return;n.f^=Q}}f(this,pe).push(n)}};zt=new WeakMap,rt=new WeakMap,mt=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,bt=new WeakMap,Vt=new WeakMap,Ye=new WeakMap,yn=new WeakMap,pe=new WeakMap,wn=new WeakMap,it=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Yt=new WeakMap,yt=new WeakMap,L=new WeakSet,Rr=function(){if(this.is_fork)return!0;for(const r of f(this,Ye).keys()){for(var t=r,n=!1;t.parent!==null;){if(f(this,Ke).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},an=function(){var l,c,h;if(E(this,zt,!0),ci++>1e3&&(I(this,L,Bt).call(this),Oo()),!I(this,L,Rr).call(this)){for(const u of f(this,it))f(this,qe).delete(u),z(u,te),this.schedule(u);for(const u of f(this,qe))z(u,Ue),this.schedule(u)}const t=f(this,pe);E(this,pe,[]),this.apply();var n=jt=[],r=[],i=Kn=[];for(const u of t)try{I(this,L,Pr).call(this,u,n,r)}catch(d){throw Ji(u),d}if(A=null,i.length>0){var s=or.ensure();for(const u of i)s.schedule(u)}if(jt=null,Kn=null,I(this,L,Rr).call(this)){I(this,L,Wn).call(this,r),I(this,L,Wn).call(this,n);for(const[u,d]of f(this,Ke))Yi(u,d);i.length>0&&I(l=A,L,an).call(l);return}const o=I(this,L,Ui).call(this);if(o){I(c=o,L,Gi).call(c,this);return}f(this,it).clear(),f(this,qe).clear();for(const u of f(this,Ut))u(this);f(this,Ut).clear(),Nr=this,di(r),di(n),Nr=null,f(this,yn)?.resolve();var a=A;if(this.linked&&f(this,Vt)===0&&I(this,L,Bt).call(this),f(this,pe).length>0){a===null&&(a=this,I(this,L,Dr).call(this));const u=a;f(u,pe).push(...f(this,pe).filter(d=>!f(u,pe).includes(d)))}a!==null&&I(h=a,L,an).call(h)},Pr=function(t,n,r){t.f^=Q;for(var i=t.first;i!==null;){var s=i.f,o=(s&(je|dt))!==0,a=o&&(s&Q)!==0,l=a||(s&le)!==0||f(this,Ke).has(i);if(!l&&i.fn!==null){o?i.f^=Q:(s&Xt)!==0?n.push(i):On(i)&&((s&De)!==0&&f(this,qe).add(i),en(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var h=i.next;if(h!==null){i=h;break}i=i.parent}}},Ui=function(){for(var t=f(this,rt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=f(t,rt)}return null},Gi=function(t){var r;for(const[i,s]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,s);for(const[i,s]of t.async_deriveds){const o=this.async_deriveds.get(i);o&&s.promise.then(o.resolve)}const n=i=>{var s=i.reactions;if(s!==null)for(const l of s){var o=l.f;if((o&ne)!==0)n(l);else{var a=l;o&(qt|De)&&!this.async_deriveds.has(a)&&(f(this,qe).delete(a),z(a,te),this.schedule(a))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),I(r=t,L,Bt).call(r),A=this,I(this,L,an).call(this)},Wn=function(t){for(var n=0;n!this.current.has(d));if(i.length===0)t&&u.discard();else if(n.length>0){if(t)for(const d of f(this,Yt))u.unskip_effect(d,_=>{var v;(_.f&(De|qt))!==0?u.schedule(_):I(v=u,L,Wn).call(v,[_])});u.activate();var s=new Set,o=new Map;for(var a of n)Vi(a,i,s,o);o=new Map;var l=[...u.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(l.length>0)for(const d of f(this,wn))(d.f&(Ie|le|Zn))===0&&Zr(d,l,o)&&((d.f&(qt|De))!==0?(z(d,te),u.schedule(d)):f(u,it).add(d));if(f(u,pe).length>0&&!f(u,yt)){u.apply();for(var c of f(u,pe))I(h=u,L,Pr).call(h,c,[],[]);E(u,pe,[])}u.deactivate()}}}},Dr=function(){Ft===null?wr=Ft=this:(E(Ft,mt,this),E(this,rt,Ft)),Ft=this},Bt=function(){var t=f(this,rt),n=f(this,mt);t===null?wr=n:E(t,mt,n),n===null?Ft=t:E(n,rt,t),this.linked=!1};let Lt=or;function To(e){var t=cn;cn=!0;try{for(var n;;){if(ko(),A===null)return n;A.flush()}}finally{cn=t}}function Oo(){try{no()}catch(e){ot(e,Lr)}}let Ve=null;function di(e){var t=e.length;if(t!==0){for(var n=0;n0)){At.clear();for(const i of Ve){if((i.f&(Ie|le))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)Ve.has(o)&&(Ve.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Ie|le))===0&&en(l)}}Ve.clear()}}Ve=null}}function Vi(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&ne)!==0?Vi(i,t,n,r):(s&(qt|De))!==0&&(s&te)===0&&Zr(i,t,r)&&(z(i,te),$r(i))}}function Zr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(St.call(t,i))return!0;if((i.f&ne)!==0&&Zr(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function $r(e){A.schedule(e)}function Yi(e,t){if(!((e.f&je)!==0&&(e.f&Q)!==0)){(e.f&te)!==0?t.d.push(e):(e.f&Ue)!==0&&t.m.push(e),z(e,Q);for(var n=e.first;n!==null;)Yi(n,t),n=n.next}}function Ji(e){z(e,Q);for(var t=e.first;t!==null;)Ji(t),t=t.next}function Mo(e){let t=0,n=Rt(0),r;return()=>{ti()&&(g(n),hr(()=>(t===0&&(r=nn(()=>e(()=>dn(n)))),t+=1,()=>{ft(()=>{t-=1,t===0&&(r?.(),r=void 0,dn(n))})})))}}var Io=Zt|tn;function No(e,t,n,r){new Lo(e,t,n,r)}var Ce,Yr,Ae,wt,fe,xe,re,ge,Je,Et,st,Jt,En,kn,Xe,lr,U,Ro,Po,Do,Fr,zn,Un,Br,jr;class Lo{constructor(t,n,r,i){S(this,U);ae(this,"parent");ae(this,"is_pending",!1);ae(this,"transform_error");S(this,Ce);S(this,Yr,null);S(this,Ae);S(this,wt);S(this,fe);S(this,xe,null);S(this,re,null);S(this,ge,null);S(this,Je,null);S(this,Et,0);S(this,st,0);S(this,Jt,!1);S(this,En,new Set);S(this,kn,new Set);S(this,Xe,null);S(this,lr,Mo(()=>(E(this,Xe,Rt(f(this,Et))),()=>{E(this,Xe,null)})));E(this,Ce,t),E(this,Ae,n),E(this,wt,s=>{var o=M;o.b=this,o.f|=Tr,r(s)}),this.parent=M.b,this.transform_error=i??this.parent?.transform_error??(s=>s),E(this,fe,ii(()=>{I(this,U,Fr).call(this)},Io))}defer_effect(t){zi(t,f(this,En),f(this,kn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!f(this,Ae).pending}update_pending_count(t,n){I(this,U,Br).call(this,t,n),E(this,Et,f(this,Et)+t),!(!f(this,Xe)||f(this,Jt))&&(E(this,Jt,!0),ft(()=>{E(this,Jt,!1),f(this,Xe)&&Qt(f(this,Xe),f(this,Et))}))}get_effect_pending(){return f(this,lr).call(this),g(f(this,Xe))}error(t){if(!f(this,Ae).onerror&&!f(this,Ae).failed)throw t;A?.is_fork?(f(this,xe)&&A.skip_effect(f(this,xe)),f(this,re)&&A.skip_effect(f(this,re)),f(this,ge)&&A.skip_effect(f(this,ge)),A.on_fork_commit(()=>{I(this,U,jr).call(this,t)})):I(this,U,jr).call(this,t)}}Ce=new WeakMap,Yr=new WeakMap,Ae=new WeakMap,wt=new WeakMap,fe=new WeakMap,xe=new WeakMap,re=new WeakMap,ge=new WeakMap,Je=new WeakMap,Et=new WeakMap,st=new WeakMap,Jt=new WeakMap,En=new WeakMap,kn=new WeakMap,Xe=new WeakMap,lr=new WeakMap,U=new WeakSet,Ro=function(){try{E(this,xe,Te(()=>f(this,wt).call(this,f(this,Ce))))}catch(t){this.error(t)}},Po=function(t){const n=f(this,Ae).failed;n&&E(this,ge,Te(()=>{n(f(this,Ce),()=>t,()=>()=>{})}))},Do=function(){const t=f(this,Ae).pending;t&&(this.is_pending=!0,E(this,re,Te(()=>t(f(this,Ce)))),ft(()=>{var n=E(this,Je,document.createDocumentFragment()),r=$e();n.append(r),E(this,xe,I(this,U,Un).call(this,()=>Te(()=>f(this,wt).call(this,r)))),f(this,st)===0&&(f(this,Ce).before(n),E(this,Je,null),xt(f(this,re),()=>{E(this,re,null)}),I(this,U,zn).call(this,A))}))},Fr=function(){try{if(this.is_pending=this.has_pending_snippet(),E(this,st,0),E(this,Et,0),E(this,xe,Te(()=>{f(this,wt).call(this,f(this,Ce))})),f(this,st)>0){var t=E(this,Je,document.createDocumentFragment());li(f(this,xe),t);const n=f(this,Ae).pending;E(this,re,Te(()=>n(f(this,Ce))))}else I(this,U,zn).call(this,A)}catch(n){this.error(n)}},zn=function(t){this.is_pending=!1,t.transfer_effects(f(this,En),f(this,kn))},Un=function(t){var n=M,r=O,i=he;Ge(f(this,fe)),Le(f(this,fe)),$t(f(this,fe).ctx);try{return Lt.ensure(),t()}catch(s){return Ki(s),null}finally{Ge(n),Le(r),$t(i)}},Br=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&I(r=this.parent,U,Br).call(r,t,n);return}E(this,st,f(this,st)+t),f(this,st)===0&&(I(this,U,zn).call(this,n),f(this,re)&&xt(f(this,re),()=>{E(this,re,null)}),f(this,Je)&&(f(this,Ce).before(f(this,Je)),E(this,Je,null)))},jr=function(t){f(this,xe)&&(de(f(this,xe)),E(this,xe,null)),f(this,re)&&(de(f(this,re)),E(this,re,null)),f(this,ge)&&(de(f(this,ge)),E(this,ge,null));var n=f(this,Ae).onerror;let r=f(this,Ae).failed;var i=!1,s=!1;const o=()=>{if(i){wo();return}i=!0,s&&lo(),f(this,ge)!==null&&xt(f(this,ge),()=>{E(this,ge,null)}),I(this,U,Un).call(this,()=>{I(this,U,Fr).call(this)})},a=l=>{try{s=!0,n?.(l,o),s=!1}catch(c){ot(c,f(this,fe)&&f(this,fe).parent)}r&&E(this,ge,I(this,U,Un).call(this,()=>{try{return Te(()=>{var c=M;c.b=this,c.f|=Tr,r(f(this,Ce),()=>l,()=>o)})}catch(c){return ot(c,f(this,fe).parent),null}}))};ft(()=>{var l;try{l=this.transform_error(t)}catch(c){ot(c,f(this,fe)&&f(this,fe).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>ot(c,f(this,fe)&&f(this,fe).parent)):a(l)})};function Fo(e,t,n,r){const i=mn;var s=e.filter(d=>!d.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var o=M,a=Bo(),l=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function c(d){if((o.f&Ie)===0){a();try{r(d)}catch(_){ot(_,o)}Qn()}}var h=Xi();if(n.length===0){l.then(()=>c(t.map(i))).finally(h);return}function u(){Promise.all(n.map(d=>jo(d))).then(d=>c([...t.map(i),...d])).catch(d=>ot(d,o)).finally(h)}l?l.then(()=>{a(),u(),Qn()}):u()}function Bo(){var e=M,t=O,n=he,r=A;return function(s=!0){Ge(e),Le(t),$t(n),s&&(e.f&Ie)===0&&(r?.activate(),r?.apply())}}function Qn(e=!0){Ge(null),Le(null),$t(null),e&&A?.deactivate()}function Xi(){var e=M,t=e.b,n=A,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),()=>{t.update_pending_count(-1,n),n.decrement(r,e)}}function mn(e){var t=ne|te;return M!==null&&(M.f|=tn),{ctx:he,deps:null,effects:null,equals:Bi,f:t,fn:e,reactions:null,rv:0,v:Z,wv:0,parent:M,ac:null}}const Bn=Symbol("obsolete");function jo(e,t,n){let r=M;r===null&&Zs();var i=void 0,s=Rt(Z),o=!O,a=new Set;return $o(()=>{var l=M,c=Ri();i=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==cr&&c.reject(_)}).finally(Qn)}catch(_){c.reject(_),Qn()}var h=A;if(o){if((l.f&Pt)!==0)var u=Xi();if(r.b.is_rendered())h.async_deriveds.get(l)?.reject(Bn);else for(const _ of a.values())_.reject(Bn);a.add(c),h.async_deriveds.set(l,c)}const d=(_,v=void 0)=>{u?.(),a.delete(c),v!==Bn&&(h.activate(),v?(s.f|=at,Qt(s,v)):((s.f&at)!==0&&(s.f^=at),Qt(s,_)),h.deactivate())};c.promise.then(d,_=>d(null,_||"unknown"))}),ni(()=>{for(const l of a)l.reject(Bn)}),new Promise(l=>{function c(h){function u(){h===i?l(s):c(i)}h.then(u,u)}c(i)})}function be(e){const t=mn(e);return ds(t),t}function Zi(e){const t=mn(e);return t.equals=ji,t}function Ho(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!es&&Wo()}return t}function Wo(){es=!1;for(const e of er){(e.f&Q)!==0&&z(e,Ue);let t;try{t=On(e)}catch{t=!0}t&&en(e)}er.clear()}function dn(e){$(e,e.v+1)}function ts(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s{if(Tt===s)return a();var l=O,c=Tt;Le(null),pi(s);var h=a();return Le(l),pi(c),h};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&io();var h=n.get(l);return h===void 0?o(()=>{var u=oe(c.value);return n.set(l,u),u}):$(h,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const h=o(()=>oe(Z));n.set(l,h),dn(i)}}else $(c,Z),dn(i);return!0},get(a,l,c){if(l===Ct)return e;var h=n.get(l),u=l in a;if(h===void 0&&(!u||Ht(a,l)?.writable)&&(h=o(()=>{var _=lt(u?a[l]:Z),v=oe(_);return v}),n.set(l,h)),h!==void 0){var d=g(h);return d===Z?void 0:d}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var h=n.get(l);h&&(c.value=g(h))}else if(c===void 0){var u=n.get(l),d=u?.v;if(u!==void 0&&d!==Z)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(a,l){if(l===Ct)return!0;var c=n.get(l),h=c!==void 0&&c.v!==Z||Reflect.has(a,l);if(c!==void 0||M!==null&&(!h||Ht(a,l)?.writable)){c===void 0&&(c=o(()=>{var d=h?lt(a[l]):Z,_=oe(d);return _}),n.set(l,c));var u=g(c);if(u===Z)return!1}return h},set(a,l,c,h){var u=n.get(l),d=l in a;if(r&&l==="length")for(var _=c;_oe(Z)),n.set(_+"",v))}if(u===void 0)(!d||Ht(a,l)?.writable)&&(u=o(()=>oe(void 0)),$(u,lt(c)),n.set(l,u));else{d=u.v!==Z;var b=o(()=>lt(c));$(u,b)}var p=Reflect.getOwnPropertyDescriptor(a,l);if(p?.set&&p.set.call(h,c),!d){if(r&&typeof l=="string"){var m=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=m.v&&$(m,w+1)}dn(i)}return!0},ownKeys(a){g(i);var l=Reflect.ownKeys(a).filter(u=>{var d=n.get(u);return d===void 0||d.v!==Z});for(var[c,h]of n)h.v!==Z&&!(c in a)&&l.push(c);return l},setPrototypeOf(){so()}})}function hi(e){try{if(e!==null&&typeof e=="object"&&Ct in e)return e[Ct]}catch{}return e}function zo(e,t){return Object.is(hi(e),hi(t))}var Hr,ns,rs,is;function Uo(){if(Hr===void 0){Hr=window,ns=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;rs=Ht(t,"firstChild").get,is=Ht(t,"nextSibling").get,ui(e)&&(e[Mr]=void 0,e[Hn]=null,e[Ir]=void 0,e.__e=void 0),ui(n)&&(n[ln]=void 0)}}function $e(e=""){return document.createTextNode(e)}function tr(e){return rs.call(e)}function Tn(e){return is.call(e)}function R(e,t){return tr(e)}function Kt(e,t=!1){{var n=tr(e);return n instanceof Comment&&n.data===""?Tn(n):n}}function N(e,t=1,n=!1){let r=e;for(;t--;)r=Tn(r);return r}function Go(e){e.textContent=""}function ss(){return!1}function Vo(e,t,n){return document.createElementNS(Fi,e,void 0)}let _i=!1;function Yo(){_i||(_i=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[qn]?.()})},{capture:!0}))}function dr(e){var t=O,n=M;Le(null),Ge(null);try{return e()}finally{Le(t),Ge(n)}}function ei(e,t,n,r=n){e.addEventListener(t,()=>dr(n));const i=e[qn];i?e[qn]=()=>{i(),r(!0)}:e[qn]=()=>r(!0),Yo()}function Jo(e){M===null&&(O===null&&to(),eo()),Qe&&Qs()}function Xo(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function et(e,t){var n=M;n!==null&&(n.f&le)!==0&&(e|=le);var r={ctx:he,deps:null,nodes:null,f:e|te|Me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if((e&Xt)!==0)jt!==null?jt.push(r):Lt.ensure().schedule(r);else if(t!==null){try{en(r)}catch(o){throw de(r),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&tn)===0&&(i=i.first,(e&De)!==0&&(e&Zt)!==0&&i!==null&&(i.f|=Zt))}if(i!==null&&(i.parent=n,n!==null&&Xo(i,n),O!==null&&(O.f&ne)!==0&&(e&dt)===0)){var s=O;(s.effects??(s.effects=[])).push(i)}return r}function ti(){return O!==null&&!Be}function ni(e){const t=et(ur,null);return z(t,Q),t.teardown=e,t}function ri(e){Jo();var t=M.f,n=!O&&(t&je)!==0&&(t&Pt)===0;if(n){var r=he;(r.e??(r.e=[])).push(e)}else return os(e)}function os(e){return et(Xt|Vs,e)}function Zo(e){Lt.ensure();const t=et(dt|tn,e);return(n={})=>new Promise(r=>{n.outro?xt(t,()=>{de(t),r(void 0)}):(de(t),r(void 0))})}function ls(e){return et(Xt,e)}function $o(e){return et(qt|tn,e)}function hr(e,t=0){return et(ur|t,e)}function se(e,t=[],n=[],r=[]){Fo(r,t,n,i=>{et(ur,()=>e(...i.map(g)))})}function ii(e,t=0){var n=et(De|t,e);return n}function Te(e){return et(je|tn,e)}function as(e){var t=e.teardown;if(t!==null){const n=Qe,r=O;vi(!0),Le(null);try{t.call(null)}finally{vi(n),Le(r)}}}function si(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&dr(()=>{i.abort(cr)});var r=n.next;(n.f&dt)!==0?n.parent=null:de(n,t),n=r}}function Qo(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&je)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Gs)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(el(e.nodes.start,e.nodes.end),n=!0),z(e,Or),si(e,t&&!n),bn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();as(e),e.f^=Or,e.f|=Ie;var i=e.parent;i!==null&&i.first!==null&&fs(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function el(e,t){for(;e!==null;){var n=e===t?null:Tn(e);e.remove(),e=n}}function fs(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function xt(e,t,n=!0){var r=[];us(e,r,!0);var i=()=>{n&&de(e),t&&t()},s=r.length;if(s>0){var o=()=>--s||i();for(var a of r)a.out(o)}else i()}function us(e,t,n){if((e.f&le)===0){e.f^=le;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next;if((i.f&dt)===0){var o=(i.f&Zt)!==0||(i.f&je)!==0&&(e.f&De)!==0;us(i,t,o?n:!1)}i=s}}}function oi(e){cs(e,!0)}function cs(e,t){if((e.f&le)!==0){e.f^=le,(e.f&Q)===0&&(z(e,te),Lt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Zt)!==0||(n.f&je)!==0;cs(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const o of s)(o.is_global||t)&&o.in()}}function li(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Tn(n);t.append(n),n=i}}let Gn=!1,Qe=!1;function vi(e){Qe=e}let O=null,Be=!1;function Le(e){O=e}let M=null;function Ge(e){M=e}let Ne=null;function ds(e){O!==null&&(Ne===null?Ne=[e]:Ne.push(e))}let ue=null,ve=0,Se=null;function tl(e){Se=e}let hs=1,pt=0,Tt=pt;function pi(e){Tt=e}function _s(){return++hs}function On(e){var t=e.f;if((t&te)!==0)return!0;if(t&ne&&(e.f&=~Nt),(t&Ue)!==0){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}(t&Me)!==0&&Fe===null&&z(e,Q)}return!1}function vs(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ne!==null&&St.call(Ne,e)))for(var i=0;i{e.ac.abort(cr)}),e.ac=null);try{e.f|=$n;var h=e.fn,u=h();e.f|=Pt;var d=e.deps,_=A?.is_fork;if(ue!==null){var v;if(_||bn(e,ve),d!==null&&ve>0)for(d.length=ve+ue.length,v=0;vn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ft(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ll(e,t,n,r,i){var s={capture:r,passive:i},o=ol(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ni(()=>{t.removeEventListener(e,o,s)})}function ut(e,t,n){(t[gt]??(t[gt]={}))[e]=n}function _r(e){for(var t=0;t{throw p});throw d}}finally{e[gt]=t,delete e.currentTarget,Le(h),Ge(u)}}}const al=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function fl(e){return al?.createHTML(e)??e}function ul(e){var t=Vo("template");return t.innerHTML=fl(e.replaceAll("","")),t.content}function nr(e,t){var n=M;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=(t&go)!==0,r=(t&mo)!==0,i,s=!e.startsWith("");return()=>{i===void 0&&(i=ul(s?e:""+e),n||(i=tr(i)));var o=r||ns?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=tr(o),l=o.lastChild;nr(a,l)}else nr(o,o);return o}}function cl(e=""){{var t=$e(e+"");return nr(t,t),t}}function dl(){var e=document.createDocumentFragment(),t=document.createComment(""),n=$e();return e.append(t,n),nr(t,n),e}function W(e,t){e!==null&&e.before(t)}function ce(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[ln]??(e[ln]=e.nodeValue))&&(e[ln]=n,e.nodeValue=`${n}`)}function ys(e,t){return hl(e,t)}const jn=new Map;function hl(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:o=!0,transformError:a}){Uo();var l=void 0,c=Zo(()=>{var h=n??t.appendChild($e());No(h,{pending:()=>{}},_=>{An({});var v=he;s&&(v.c=s),i&&(r.$$events=i),l=e(_,r)||{},xn()},a);var u=new Set,d=_=>{for(var v=0;v<_.length;v++){var b=_[v];if(!u.has(b)){u.add(b);var p=sl(b);for(const C of[t,document]){var m=jn.get(C);m===void 0&&(m=new Map,jn.set(C,m));var w=m.get(b);w===void 0?(C.addEventListener(b,Kr,{passive:p}),m.set(b,1)):m.set(b,w+1)}}}};return d(fr(bs)),qr.add(d),()=>{for(var _ of u)for(const p of[t,document]){var v=jn.get(p),b=v.get(_);--b==0?(p.removeEventListener(_,Kr),v.delete(_),v.size===0&&jn.delete(p)):v.set(_,b)}qr.delete(d),h!==n&&h.parentNode?.removeChild(h)}});return Wr.set(l,c),l}let Wr=new WeakMap;function vr(e,t){const n=Wr.get(e);return n?(Wr.delete(e),n(t)):Promise.resolve()}var Pe,We,me,kt,Sn,Cn,ar;class _l{constructor(t,n=!0){ae(this,"anchor");S(this,Pe,new Map);S(this,We,new Map);S(this,me,new Map);S(this,kt,new Set);S(this,Sn,!0);S(this,Cn,t=>{if(f(this,Pe).has(t)){var n=f(this,Pe).get(t),r=f(this,We).get(n);if(r)oi(r),f(this,kt).delete(n);else{var i=f(this,me).get(n);i&&(f(this,We).set(n,i.effect),f(this,me).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,o]of f(this,Pe)){if(f(this,Pe).delete(s),s===t)break;const a=f(this,me).get(o);a&&(de(a.effect),f(this,me).delete(o))}for(const[s,o]of f(this,We)){if(s===n||f(this,kt).has(s))continue;const a=()=>{if(Array.from(f(this,Pe).values()).includes(s)){var c=document.createDocumentFragment();li(o,c),c.append($e()),f(this,me).set(s,{effect:o,fragment:c})}else de(o);f(this,kt).delete(s),f(this,We).delete(s)};f(this,Sn)||!r?(f(this,kt).add(s),xt(o,a,!1)):a()}}});S(this,ar,t=>{f(this,Pe).delete(t);const n=Array.from(f(this,Pe).values());for(const[r,i]of f(this,me))n.includes(r)||(de(i.effect),f(this,me).delete(r))});this.anchor=t,E(this,Sn,n)}ensure(t,n){var r=A,i=ss();if(n&&!f(this,We).has(t)&&!f(this,me).has(t))if(i){var s=document.createDocumentFragment(),o=$e();s.append(o),f(this,me).set(t,{effect:Te(()=>n(o)),fragment:s})}else f(this,We).set(t,Te(()=>n(this.anchor)));if(f(this,Pe).set(r,t),i){for(const[a,l]of f(this,We))a===t?r.unskip_effect(l):r.skip_effect(l);for(const[a,l]of f(this,me))a===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(f(this,Cn)),r.ondiscard(f(this,ar))}else f(this,Cn).call(this,r)}}Pe=new WeakMap,We=new WeakMap,me=new WeakMap,kt=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,ar=new WeakMap;function ie(e,t,n=!1){var r=new _l(e),i=n?Zt:0;function s(o,a){r.ensure(o,a)}ii(()=>{var o=!1;t((a,l=0)=>{o=!0,s(l,a)}),o||s(-1,null)},i)}function vl(e,t){return t}function pl(e,t,n){for(var r=[],i=t.length,s,o=t.length,a=0;a{if(s){if(s.pending.delete(u),s.done.add(u),s.pending.size===0){var d=e.outrogroups;zr(e,fr(s.done)),d.delete(s),d.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var c=n,h=c.parentNode;Go(h),h.append(c),e.items.clear()}zr(e,t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function zr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const a of o)r.add(e.items.get(a).e)}for(var i=0;i{var C=n();return Jr(C)?C:C==null?[]:fr(C)}),d,_=new Map,v=!0;function b(C){(w.effect.f&Ie)===0&&(w.pending.delete(C),w.fallback=h,gl(w,d,o,t,r),h!==null&&(d.length===0?(h.f&ze)===0?oi(h):(h.f^=ze,fn(h,null,o)):xt(h,()=>{h=null})))}function p(C){w.pending.delete(C)}var m=ii(()=>{d=g(u);for(var C=d.length,T=new Set,H=A,ee=ss(),Y=0;Ys(o)):(h=Te(()=>s(mi??(mi=$e()))),h.f|=ze)),C>T.size&&$s(),!v)if(_.set(H,T),ee){for(const[_t,He]of a)T.has(_t)||H.skip_effect(He.e);H.oncommit(b),H.ondiscard(p)}else b(H);g(u)}),w={effect:m,items:a,pending:_,outrogroups:null,fallback:h};v=!1}function on(e){for(;e!==null&&(e.f&je)===0;)e=e.next;return e}function gl(e,t,n,r,i){var s=(r&uo)!==0,o=t.length,a=e.items,l=on(e.effect.first),c,h=null,u,d=[],_=[],v,b,p,m;if(s)for(m=0;m0){var we=(r&Di)!==0&&o===0?n:null;if(s){for(m=0;m<_e;m+=1)Y[m].nodes?.a?.measure();for(m=0;m<_e;m+=1)Y[m].nodes?.a?.fix()}pl(e,Y,we)}}s&&ft(()=>{if(u!==void 0)for(p of u)p.nodes?.a?.apply()})}function ml(e,t,n,r,i,s,o,a){var l=(o&ao)!==0?(o&co)===0?Ko(n,!1,!1):Rt(n):null,c=(o&fo)!==0?Rt(i):null;return{v:l,i:c,e:Te(()=>(s(t,l??n,c??i,a),()=>{e.delete(r)}))}}function fn(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,s=t&&(t.f&ze)===0?t.nodes.start:n;r!==null;){var o=Tn(r);if(s.before(r),r===i)return;r=o}}function nt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const bi=[...` +\r\f \v\uFEFF`];function bl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+s;(o===0||bi.includes(r[o-1]))&&(a===r.length||bi.includes(r[a]))?r=(o===0?"":r.substring(0,o))+r.substring(a+1):o=a}}return r===""?null:r}function yl(e,t){return e==null?null:String(e)}function ai(e,t,n,r,i,s){var o=e[Mr];if(o!==n||o===void 0){var a=bl(n,r,s);a==null?e.removeAttribute("class"):e.className=a,e[Mr]=n}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function wl(e,t,n,r){var i=e[Ir];if(i!==t){var s=yl(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e[Ir]=t}return r}function Es(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Jr(t))return yo();for(var r of e.options)r.selected=t.includes(hn(r));return}for(r of e.options){var i=hn(r);if(zo(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function El(e){var t=new MutationObserver(()=>{Es(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ni(()=>{t.disconnect()})}function kl(e,t,n=t){var r=new WeakSet,i=!0;ei(e,"change",s=>{var o=s?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(o),hn);else{var l=e.querySelector(o)??e.querySelector("option:not([disabled])");a=l&&hn(l)}n(a),e.__value=a,A!==null&&r.add(A)}),ls(()=>{var s=t();if(e===document.activeElement){var o=A;if(r.has(o))return}if(Es(e,s,i),i&&s===void 0){var a=e.querySelector(":checked");a!==null&&(s=hn(a),n(s))}e.__value=s,i=!1}),El(e)}function hn(e){return"__value"in e?e.__value:e.value}const Sl=Symbol("is custom element"),Cl=Symbol("is html");function Ot(e,t,n,r){var i=Al(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[Js]=n),n==null?e.removeAttribute(t):typeof n!="string"&&xl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Al(e){return e[Hn]??(e[Hn]={[Sl]:e.nodeName.includes("-"),[Cl]:e.namespaceURI===Fi})}var yi=new Map;function xl(e){var t=e.getAttribute("is")||e.nodeName,n=yi.get(t);if(n)return n;yi.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=qs(i);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);i=Li(i)}return n}function wi(e,t,n=t){var r=new WeakSet;ei(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=kr(e)?Sr(s):s,n(s),A!==null&&r.add(A),await rl(),s!==(s=t())){var o=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=s??"",a!==null){var c=e.value.length;o===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(a,c))}}}),nn(t)==null&&e.value&&(n(kr(e)?Sr(e.value):e.value),A!==null&&r.add(A)),hr(()=>{var i=t();if(e===document.activeElement){var s=A;if(r.has(s))return}kr(e)&&i===Sr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function ks(e,t,n=t){ei(e,"change",r=>{var i=r?e.defaultChecked:e.checked;n(i)}),nn(t)==null&&n(e.checked),hr(()=>{var r=t();e.checked=!!r})}function kr(e){var t=e.type;return t==="number"||t==="range"}function Sr(e){return e===""?null:+e}function Cr(e,t){return e===t||e?.[Ct]===t}function Tl(e={},t,n,r){var i=he.r,s=M;return ls(()=>{var o,a;return hr(()=>{o=a,a=[],nn(()=>{Cr(n(...a),e)||(t(e,...a),o&&Cr(n(...o),e)&&t(null,...o))})}),()=>{let l=s;for(;l!==i&&l.parent!==null&&l.parent.f⩔)l=l.parent;const c=()=>{a&&Cr(n(...a),e)&&t(null,...a)},h=l.teardown;l.teardown=()=>{c(),h?.()}}}),e}function _n(e,t,n,r){var i=!0,s=(n&vo)!==0,o=(n&po)!==0,a=r,l=!0,c=void 0,h=()=>o&&i?(c??(c=mn(r)),g(c)):(l&&(l=!1,a=o?nn(r):r),a);let u;if(s){var d=Ct in e||Ys in e;u=Ht(e,t)?.set??(d&&t in e?T=>e[t]=T:void 0)}var _,v=!1;s?[_,v]=Co(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),u&&(ro(),u(_)));var b;if(b=()=>{var T=e[t];return T===void 0?h():(l=!0,T)},(n&_o)===0)return b;if(u){var p=e.$$legacy;return(function(T,H){return arguments.length>0?((!H||p||v)&&u(H?b():T),T):b()})}var m=!1,w=((n&ho)!==0?mn:Zi)(()=>(m=!1,b()));s&&g(w);var C=M;return(function(T,H){if(arguments.length>0){const ee=H?g(w):s?lt(T):T;return $(w,ee),m=!0,a!==void 0&&(a=ee),T}return Qe&&m||(C.f&Ie)!==0?w.v:g(w)})}function Ol(e){he===null&&Xs(),ri(()=>{const t=nn(e);if(typeof t=="function")return t})}const Ss="[data-v-app]",Ml=["header","content","footer"];let Oe=null,Re=null;function Il(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Nl(){if(typeof document>"u")return!1;const t=document.querySelector(Ss)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Oe=null,!1):(Oe=t,Re=null,!0)}function Ll(){if(Re!==null)return Re;const e=typeof document<"u"?document.querySelector(Ss)?.__vue_app__:null;if(!e)return Re=!1,!1;const t=e.config?.globalProperties??{};if(typeof Oe?.$history?.pause=="function"&&typeof Oe?.$history?.resume=="function")return Re={pause:()=>Oe.$history.pause(),resume:()=>Oe.$history.resume()},Re;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(Re={pause:()=>n.history.pause(),resume:()=>n.history.resume()},Re):typeof t.pauseHistory=="function"&&typeof t.resumeHistory=="function"?(Re={pause:()=>t.pauseHistory(),resume:()=>t.resumeHistory()},Re):(Re=!1,!1)}function Rl(e){const t=Ll();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function ct(e){if(!Oe||!e)return null;for(const t of Ml){const n=Oe[t];if(!Array.isArray(n))continue;const r=n.find(i=>i&&i.id===e);if(r)return r}return null}function Pl(e){const t=ct(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Cs(t,1,n),n}function Cs(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const i=ct(r);i&&(n.push({id:i.id,depth:t,label:i.label,name:i.name,settings:i.settings}),Cs(i,t+1,n))}}function As(){return Oe?Oe.globalClasses:[]}function Ar(e,t){if(!Oe)throw new Error("rebemer: not ready");const n=Oe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const i=new Set(n.map(o=>o?.id).filter(Boolean)),s=Il(i);return n.push({id:s,name:e,settings:t||{}}),s}function Ei(e,t){const n=ct(e);if(!n)return;n.settings||(n.settings={});const r=Array.isArray(t)?t:[];Array.isArray(n.settings._cssGlobalClasses)?n.settings._cssGlobalClasses.splice(0,n.settings._cssGlobalClasses.length,...r):n.settings._cssGlobalClasses=[...r]}function ki(e,t){const n=ct(e);n&&(n.label=t)}const rr="slashed-rebemer-host",Dl="slashed-class-hint",xs=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],Fl=3;function Bl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n[0]==="."&&(n=n.slice(1)),!n.startsWith("sf-")&&!n.startsWith("is-"))||!Object.prototype.hasOwnProperty.call(t,n))return null;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let Ur=!1,ir={},Ze=null,vn=null,ye=null;function jl(){if(Ze&&Ze.isConnected)return Ze;let e=document.getElementById(rr);e||(e=document.createElement("div"),e.id=rr,document.body.appendChild(e));const t=document.createElement("div");return t.id=Dl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

    ',e.appendChild(t),Ze=t,t}function Ts(e){let t=e;for(let n=0;t&&na&&n.top-s-i>=0&&(l=n.top-s-i);let c=n.left;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(l)}px`,e.style.left=`${Math.round(c)}px`}function Os(e,t){const n=jl();n.querySelector(".rebemer-class-hint__name").textContent=`.${t.name}`;const r=n.querySelector(".rebemer-class-hint__cat");r.textContent=t.category||"",r.hidden=!t.category,n.querySelector(".rebemer-class-hint__desc").textContent=t.description,n.hidden=!1,Hl(n,e),ye=e}function ht(){Ze&&(Ze.hidden=!0),ye=null}function ql(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${rr}`))return;if(!t.closest(xs.join(","))){ye&&ht();return}const n=Ts(t);if(!n){ye&&ht();return}n.el!==ye&&Os(n.el,n.hint)}function Kl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Wl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${rr}`))return;if(!t.closest(xs.join(","))){ye&&ht();return}const n=Ts(t);if(!n){ye&&ht();return}n.el!==ye&&Os(n.el,n.hint)}function zl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Ul(e){e.key==="Escape"&&ht()}function Gl(e,t,n={}){if(Vn(),Ur=!!e,ir=t&&typeof t=="object"?t:{},!Ur||Object.keys(ir).length===0)return;vn=new AbortController;const{signal:r}=vn,i={passive:!0,signal:r};document.addEventListener("mouseover",ql,i),document.addEventListener("mouseout",Kl,i),document.addEventListener("focusin",Wl,i),document.addEventListener("focusout",zl,i),document.addEventListener("keydown",Ul,i),window.addEventListener("scroll",ht,{capture:!0,passive:!0,signal:r}),n.signal&&(n.signal.aborted?Vn():n.signal.addEventListener("abort",Vn,{once:!0}))}function Vn(){vn&&(vn.abort(),vn=null),Ze&&(Ze.remove(),Ze=null),ye=null,Ur=!1,ir={}}const Vl="li.variable-picker-item",Yn="slashed-var-swatch",Yl=50,Jl=(e,...t)=>console[e]("[slashed-swatches]",...t);function Xl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n.slice(0,2)!=="--"&&(n="--"+n.replace(/^-+/,"")),n.indexOf("--sf-color-")!==0))return null;const r=t[n];return typeof r=="string"&&r?r:null}let Gr=!1,sr={},pn=null,Wt=null,Jn=null;function Zl(e){const t=e.querySelector(":scope > span[title]")||e.querySelector(":scope > span");if(t){const n=t.getAttribute("title");return n&&n.trim()?n.trim():(t.textContent||"").trim()}return(e.textContent||"").trim()}function $l(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+Yn);r&&r.remove();return}const t=Xl(Zl(e),sr);let n=e.querySelector(":scope > ."+Yn);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=Yn,n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild)),n.dataset.color!==t&&(n.style.setProperty("--slashed-swatch-color",t),n.dataset.color=t)}function Ms(){try{const e=document.querySelectorAll(Vl);for(const t of e)$l(t)}catch(e){Jl("warn","swatch pass failed",e)}}function Ql(){Wt===null&&(Wt=setTimeout(()=>{Wt=null,Ms()},Yl))}function ea(e,t,n={}){Xn(),Gr=!!e,sr=t&&typeof t=="object"?t:{},!(!Gr||Object.keys(sr).length===0)&&(Jn=new AbortController,pn=new MutationObserver(Ql),pn.observe(document.body,{childList:!0,subtree:!0}),Ms(),n.signal&&(n.signal.aborted?Xn():n.signal.addEventListener("abort",Xn,{once:!0})))}function Xn(){Wt!==null&&(clearTimeout(Wt),Wt=null),pn&&(pn.disconnect(),pn=null),Jn&&(Jn.abort(),Jn=null);try{document.querySelectorAll("."+Yn).forEach(e=>e.remove())}catch{}Gr=!1,sr={}}const ta="5";var Ni;typeof window<"u"&&((Ni=window.__svelte??(window.__svelte={})).v??(Ni.v=new Set)).add(ta);var na=V('reBEM');function ra(e,t){An(t,!0);function n(i){i.stopPropagation(),i.preventDefault(),t.onActivate?.(t.elementId)}var r=na();se(()=>{Ot(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),Ot(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),ut("click",r,n),ut("keydown",r,i=>(i.key==="Enter"||i.key===" ")&&n(i)),W(e,r),xn()}_r(["click","keydown"]);function Mt(e){return e?String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x00-\x7f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}const ia=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,sa=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function oa(e){return e?sa.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:ia.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const pr=new Set(["_padding","_padding_top","_padding_right","_padding_bottom","_padding_left","_margin","_margin_top","_margin_right","_margin_bottom","_margin_left","_width","_widthMin","_widthMax","_minWidth","_maxWidth","_height","_heightMin","_heightMax","_minHeight","_maxHeight","_aspectRatio","_overflow","_overflowX","_overflowY","_color","_background","_backgroundColor","_backgroundImage","_backgroundSize","_backgroundPosition","_backgroundRepeat","_backgroundAttachment","_backgroundBlendMode","_typography","_fontFamily","_fontSize","_fontWeight","_fontStyle","_lineHeight","_letterSpacing","_wordSpacing","_textAlign","_textTransform","_textDecoration","_textDecorationColor","_textShadow","_textIndent","_whiteSpace","_listStyleType","_listStylePosition","_border","_borderRadius","_borderColor","_borderStyle","_borderWidth","_outline","_outlineColor","_outlineStyle","_outlineWidth","_outlineOffset","_boxShadow","_filter","_backdropFilter","_opacity","_blendMode","_transform","_transformOrigin","_transition","_animation","_display","_flexDirection","_flexWrap","_flexGrow","_flexShrink","_flexBasis","_alignItems","_alignSelf","_alignContent","_justifyContent","_justifyItems","_justifySelf","_gap","_rowGap","_columnGap","_gridTemplateColumns","_gridTemplateRows","_gridGap","_gridAutoFlow","_gridAutoColumns","_gridAutoRows","_gridColumn","_gridRow","_gridArea","_position","_top","_right","_bottom","_left","_zIndex","_objectFit","_objectPosition","_cursor","_pointerEvents","_userSelect"]);function la(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))pr.has(n)&&t.push(n);return t.sort(),t}const aa=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function fa(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))pr.has(n)||aa.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const ua=new Set(["add","rename","replace","modifier","migrate"]),Si=new Set(["user","label"]);function Is({rootId:e,rows:t,mode:n}){if(!ua.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(a=>a.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};const i=Mt(r.name);if(!i)return{ok:!1,ops:[],error:"Block name is empty."};const s=[];for(const a of t){if(!a.include)continue;const l=a.id===e;let c;if(l)c=i;else{const u=Mt(a.name);if(!u)continue;c=`${i}__${u}`}let h=c;if(n==="modifier"){const u=Mt(a.modifier);if(!u)continue;h=`${c}--${u}`}s.push({row:a,isRoot:l,finalClass:h,suggestedFrom:a.suggestedFrom||"fallback"})}if(s.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const o=ha(s,n);return o.ok?{ok:!0,ops:s}:{ok:!1,ops:[],error:o.error}}function ca({rootId:e,rows:t,mode:n,syncLabels:r}){const i=Is({rootId:e,rows:t,mode:n});if(!i.ok)return{ok:!1,error:i.error};const s=i.ops,o=t.find(u=>u.id===e),a=Mt(o?.name??""),l=As();if(n==="migrate"){const u=da(s,l);if(!u.ok)return u}const c=new Map;for(const u of s){const d=ct(u.row.id);if(!d)continue;const _={classIds:Ci(d.settings).slice(),label:r&&n!=="modifier"?d.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const b of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(d.settings||{},b)&&(v[b]=JSON.parse(JSON.stringify(d.settings[b])));_.migrateKeys=v}c.set(u.row.id,_)}let h=0;try{Rl(()=>{for(const u of s){const d=ct(u.row.id);if(!d)continue;const _=Ci(d.settings);let v={};if(n==="rename"&&_.length>0){const m=l.find(w=>w&&w.id===_[0]);m&&m.settings&&(v=JSON.parse(JSON.stringify(m.settings)))}else n==="migrate"&&(v=Ns(d.settings,u.row.migrateKeys));if(n==="migrate"){const m=l.find(w=>w&&w.name===u.finalClass);if(m){(!m.settings||typeof m.settings!="object")&&(m.settings={});for(const[w,C]of Object.entries(v))Object.prototype.hasOwnProperty.call(m.settings,w)||(m.settings[w]=C)}}const b=Ar(u.finalClass,v);let p;switch(n){case"add":case"migrate":p=_.includes(b)?_:[..._,b];break;case"modifier":{const m=u.finalClass.indexOf("--"),w=m>=0?u.finalClass.slice(0,m):null;let C=[..._];if(w){const T=Ar(w,{});C.includes(T)||C.push(T)}p=C.includes(b)?C:[...C,b];break}case"rename":{const m=[b],w=_.length>0?l.find(C=>C&&C.id===_[0]):null;if(w){const C=w.name+"--";for(let T=1;T<_.length;T++){const H=l.find(ee=>ee&&ee.id===_[T]);if(H)if(H.name.startsWith(C)){const ee=H.name.slice(w.name.length),Y=H.settings?JSON.parse(JSON.stringify(H.settings)):{};m.push(Ar(u.finalClass+ee,Y))}else m.push(_[T])}}p=m;break}case"replace":p=[b];break}if(Ei(u.row.id,p),n==="migrate"&&_a(d.settings,u.row.migrateKeys),r&&n!=="modifier"){const m=va(u.finalClass,a);m&&ki(u.row.id,m)}h++}})}catch(u){for(const[_,v]of c)try{if(Ei(_,v.classIds),v.migrateKeys){const b=ct(_);b&&b.settings&&Object.assign(b.settings,v.migrateKeys)}v.label!==null&&ki(_,v.label)}catch{}const d=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",h,"mutation(s), rolled back:",d),{ok:!1,error:`Operation failed and was rolled back: ${d}`}}return h===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:h}}function da(e,t){for(const n of e){const r=t.find(l=>l&&l.name===n.finalClass);if(!r)continue;const i=ct(n.row.id);if(!i)continue;const s=Ns(i.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},a=[];for(const[l,c]of Object.entries(s))Object.prototype.hasOwnProperty.call(o,l)&&JSON.stringify(o[l])!==JSON.stringify(c)&&a.push(l.replace(/^_/,""));if(a.length>0){const l=a.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${l}. Pick a different name or use Add mode.`}}}return{ok:!0}}function ha(e,t){const n=new Map;for(const r of e){const i=n.get(r.finalClass)||[];i.push(r),n.set(r.finalClass,i)}for(const[r,i]of n){if(i.length===1||t==="modifier")continue;const s=i.filter(a=>Si.has(a.suggestedFrom));if(s.length>1)return{ok:!1,error:`"${r}" is used by ${s.length} rows. Edit one to make it unique.`};let o=1;for(const a of i)Si.has(a.suggestedFrom)||(a.finalClass=`${r}-${o++}`,a.suggestedFrom="auto-number")}if(t!=="modifier"){const r=new Map;for(const i of e){const s=r.get(i.finalClass);if(s)return{ok:!1,error:`"${i.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${i.suggestedFrom}). Pick a different name for one of them.`};r.set(i.finalClass,i.suggestedFrom)}}return{ok:!0}}function Ns(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)pr.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function _a(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)pr.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function Ci(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function va(e,t){let n=e;return n===t?Ai(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),Ai(n.replace(/-/g," ")))}function Ai(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const pa=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),Ls=new Set(["section","container","block","div"]);function ga(e,t="item"){return!e||typeof e!="string"||Ls.has(e)?t:pa[e]||t}function xr(e){return typeof e=="string"&&Ls.has(e)}const ma=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function ba(e,t,n){const r=new Set(e.filter(Boolean)),i=(..._)=>_.some(v=>r.has(v)),s=i("button","button-group"),o=i("heading"),a=i("text-basic","text"),l=i("image"),c=i("nav-nested","nav-menu"),h=i("form"),u=i("icon","icon-box"),d=i("list");return h?"form":c?"nav":s&&!o&&!a?"actions":l&&!a&&!o&&!s?"media":o&&!a&&!s?"header":a&&!o&&!s?"body":o&&a?"content":o&&s?"header":u&&!a&&!o?"icon-group":d?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var ya=V('suggested'),wa=V(' '),Ea=V(''),ka=V('

    Enter a modifier name — the base class will be added automatically if absent.

    '),Sa=V('

    This element has no existing classes. Rename will create a new class instead.

    '),Ca=V('

    '),Aa=V(`A class named already exists. On Apply, missing style keys will be merged into it. Conflicting - values block the migration — pick a different name or use Add.`,1),ca=V(`A class named already exists + values block the migration — pick a different name or use Add.`,1),xa=V(`A class named already exists globally. Apply will attach the existing class instead of - creating a duplicate.`,1),da=V('

    '),ha=V(' '),_a=V('Migrate: ',1),va=V('No migratable keys on this element.'),pa=V(' '),ga=V('
    '),ma=V('
    ');function ba(e,t){kn(t,!0);let n=hn(t,"row",15),r=hn(t,"globalClasses",19,()=>[]),i=hn(t,"finalClassName",3,"");const s=be(()=>t.mode==="modifier"),o=be(()=>t.mode==="migrate"),a=be(()=>t.mode==="rename"),l=be(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),c=be(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),h=be(()=>!i()||!Array.isArray(r())||!n().include?null:r().find(y=>y&&y.name===i())||null);function u(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function d(y){return y.startsWith("_")?y.slice(1):y}var _=ma();let v;var b=L(_),p=L(b),m=N(b,2),w=L(m),C=L(w),T=N(w,2),H=L(T),ee=N(T,2);{var Y=y=>{var F=ia();se(()=>Ot(F,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),W(y,F)};ie(ee,y=>{g(c)&&n().include&&y(Y)})}var _e=N(m,2),we=L(_e),q=L(we);{var _t=y=>{var F=sa(),Ee=L(F);se(()=>ce(Ee,g(l))),W(y,F)};ie(q,y=>{g(l)&&y(_t)})}var He=N(q,2),nn=N(we,2);{var An=y=>{var F=oa();se(()=>F.disabled=!n().include),ut("input",F,u),_i(F,()=>n().modifier,Ee=>n(n().modifier=Ee,!0)),W(y,F)};ie(nn,y=>{g(s)&&y(An)})}var Tn=N(_e,2);{var On=y=>{var F=la();W(y,F)};ie(Tn,y=>{g(s)&&n().include&&!n().modifier&&y(On)})}var rn=N(Tn,2);{var dr=y=>{var F=aa();W(y,F)},Mn=y=>{var F=fa(),Ee=L(F);se(()=>ce(Ee,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),W(y,F)};ie(rn,y=>{g(a)&&n().include&&n().currentClassCount===0?y(dr):g(a)&&n().include&&n().currentClassCount>1&&y(Mn,1)})}var In=N(rn,2);{var Nn=y=>{var F=da(),Ee=L(F);{var k=A=>{var K=ua(),P=N(Kt(K)),J=L(P);se(()=>ce(J,i())),W(A,K)},B=A=>{var K=ca(),P=N(Kt(K)),J=L(P);se(()=>ce(J,i())),W(A,K)};ie(Ee,A=>{g(o)?A(k):A(B,-1)})}W(y,F)};ie(In,y=>{g(h)&&y(Nn)})}var hr=N(In,2);{var Rn=y=>{var F=ga(),Ee=L(F);{var k=P=>{var J=_a(),j=N(Kt(J),2);_s(j,17,()=>n().migrateKeys,ll,(ke,G)=>{var D=ha(),X=L(D);se(tt=>{Ot(D,"title",`Will be lifted into ${(i()||"the new class")??""}`),ce(X,tt)},[()=>d(g(G))]),W(ke,D)}),W(P,J)},B=P=>{var J=va();W(P,J)};ie(Ee,P=>{n().migrateKeys?.length?P(k):P(B,-1)})}var A=N(Ee,2);{var K=P=>{var J=pa(),j=L(J);se(()=>ce(j,`${n().skippedKeys.length??""} skipped`)),W(P,J)};ie(A,P=>{n().skippedKeys?.length&&P(K)})}W(y,F)};ie(hr,y=>{g(o)&&n().include&&y(Rn)})}se(y=>{v=ti(_,1,"rebemer-row",null,v,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":g(c)}),hl(_,`--rebemer-row-depth: ${n().depth??0??""}`),ce(C,n().originalLabel),ce(H,y),Ot(He,"placeholder",t.isRoot?"block-name":"element-name"),He.disabled=!n().include},[()=>t.isRoot?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),ps(p,()=>n().include,y=>n(n().include=y,!0)),ut("input",He,u),_i(He,()=>n().name,y=>n(n().name=y,!0)),W(e,_),Sn()}ar(["input"]);var ya=V(" ");function wa(e,t){kn(t,!0);let n=hn(t,"kind",3,"info"),r=hn(t,"duration",3,3e3),i=oe(!0);Xr(()=>{if(!g(i)||r()<=0)return;const c=setTimeout(()=>{Q(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const s=be(()=>n()==="error"?"alert":"status");var o=il(),a=Kt(o);{var l=c=>{var h=ya(),u=L(h);se(()=>{ti(h,1,`rebemer-toast rebemer-toast--${n()??""}`),Ot(h,"role",g(s)),Ot(h,"aria-live",n()==="error"?"assertive":"polite"),ce(u,t.message)}),ut("click",h,()=>{Q(i,!1),t.onDismiss?.()}),W(c,h)};ie(a,c=>{g(i)&&c(l)})}W(e,o),Sn()}ar(["click"]);var Ea=V("Will migrate ",1),ka=V(' '),Sa=V(''),Ca=V(' ',1);function xa(e,t){kn(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",modifier:"Appends a --modifier variant. The base class is auto-added to the element if absent.",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class."};let r=oe("add"),i=oe(!0),s=oe(lt([])),o=oe(lt([])),a=oe(null),l=oe(null);const c=be(()=>Mt(g(s)[0]?.name??"")),h=be(()=>g(s)[0]?.originalLabel??""),u=be(()=>{if(g(r)!=="migrate")return null;let k=0,B=0;for(const A of g(s))A.include&&(k+=A.migrateKeys?.length??0,B+=A.skippedKeys?.length??0);return{willMigrate:k,willSkip:B}}),d=be(()=>{if(g(s).length===0)return new Map;const k=ks({rootId:t.rootId,rows:g(s),mode:g(r)}),B=new Map;if(!k.ok)return B;for(const A of k.ops)B.set(A.row.id,A.finalClass);return B});wl(()=>{const k=Al(t.rootId);Q(o,bs().slice(),!0);const B=k.map((A,K)=>{const P=K===0,J=A.label||"",j=Mt(J),ke=A.name||"";let G,D;return j?(G=j,D="label"):P?(G="block",D="fallback"):ke&&!wr(ke)?(G=ta(ke,"item"),D="element-type"):(G="item",D="fallback"),{id:A.id,depth:A.depth,bricksType:ke,originalLabel:J||(P?"block":"element"),name:G,modifier:"",include:!0,suggestedFrom:D,migrateKeys:Ul(A.settings),skippedKeys:Vl(A.settings),currentClassCount:Array.isArray(A.settings?._cssGlobalClasses)?A.settings._cssGlobalClasses.filter(X=>typeof X=="string"&&X.length>0).length:0}});if(B.length>1){const A=new Map(k.map(j=>[j.id,[]])),K=[];for(const j of k){for(;K.length&&K[K.length-1].depth>=j.depth;)K.pop();K.length&&A.get(K[K.length-1].id).push(j.id),K.push(j)}const P=new Map(k.map(j=>[j.id,j])),J=new Map(B.map(j=>[j.id,j]));for(const[,j]of A){if(!j.length)continue;const ke=new Map;for(const D of j){const X=P.get(D)?.name;X&&ke.set(X,(ke.get(X)??0)+1)}const G=j.filter(D=>wr(P.get(D)?.name??""));for(const D of j){const X=J.get(D),tt=P.get(D);if(!(!X||!tt||X.suggestedFrom==="label")){if(wr(tt.name)){const Dt=(A.get(D)??[]).map(Ts=>P.get(Ts)?.name??"").filter(Boolean),As=G.indexOf(D);X.name=ra(Dt,As,G.length),X.suggestedFrom="element-type"}else if((ke.get(tt.name)??0)===1){const Dt=na[tt.name];Dt&&(X.name=Dt,X.suggestedFrom="element-type")}}}}}Q(s,B,!0)});function _(k){if(k.key==="Escape"){t.onClose?.();return}g(l)&&k.target instanceof Node&&g(l).contains(k.target)&&k.key==="Enter"&&(k.target?.tagName==="INPUT"||k.target?.tagName==="SELECT")&&(k.preventDefault(),b())}let v=null;function b(){const k=Mt(g(s)[0]?.name??""),B=zl(k);if(!B.ok){Q(a,{kind:"error",message:B.reason},!0);return}const A=Jl({rootId:t.rootId,rows:g(s),mode:g(r),syncLabels:g(i)});A.ok?(Q(a,{kind:"success",message:`Applied to ${A.count} element${A.count!==1?"s":""}.`},!0),v&&clearTimeout(v),v=setTimeout(()=>t.onClose?.(),800)):Q(a,{kind:"error",message:A.error},!0)}Xr(()=>()=>{v&&clearTimeout(v)});var p=Ca();$o("keydown",Lr,_);var m=Kt(p),w=L(m),C=L(w),T=N(L(C)),H=L(T),ee=N(C,2),Y=N(w,2),_e=L(Y),we=N(L(_e),2),q=L(we);q.value=q.__value="add";var _t=N(q);_t.value=_t.__value="rename";var He=N(_t);He.value=He.__value="replace";var nn=N(He);nn.value=nn.__value="modifier";var An=N(nn);An.value=An.__value="migrate";var Tn=N(_e,2),On=L(Tn),rn=N(Y,2),dr=L(rn),Mn=N(rn,2);{var In=k=>{var B=Sa();let A;var K=L(B);{var P=G=>{var D=rl("No migratable style keys found on any included element. Apply will attach empty classes.");W(G,D)},J=G=>{var D=Ea(),X=N(Kt(D)),tt=L(X),Dt=N(X);se(()=>{ce(tt,g(u).willMigrate),ce(Dt,` style key${g(u).willMigrate===1?"":"s"} into new classes.`)}),W(G,D)};ie(K,G=>{g(u).willMigrate===0?G(P):G(J,-1)})}var j=N(K,2);{var ke=G=>{var D=ka(),X=L(D);se(()=>ce(X,`${g(u).willSkip??""} key${g(u).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),W(G,D)};ie(j,G=>{g(u).willSkip>0&&G(ke)})}se(()=>A=ti(B,1,"rebemer-panel__notice",null,A,{"rebemer-panel__notice--warn":g(u).willSkip>0||g(u).willMigrate===0})),W(k,B)};ie(Mn,k=>{g(u)&&k(In)})}var Nn=N(Mn,2);_s(Nn,23,()=>g(s),k=>k.id,(k,B,A)=>{{let K=be(()=>g(B).id===t.rootId),P=be(()=>g(d).get(g(B).id)??"");ba(k,{get mode(){return g(r)},get blockName(){return g(c)},get isRoot(){return g(K)},get globalClasses(){return g(o)},get finalClassName(){return g(P)},get row(){return g(s)[g(A)]},set row(J){g(s)[g(A)]=J}})}});var hr=N(Nn,2),Rn=L(hr),y=N(Rn,2);yl(m,k=>Q(l,k),()=>g(l));var F=N(m,2);{var Ee=k=>{wa(k,{get kind(){return g(a).kind},get message(){return g(a).message},onDismiss:()=>{Q(a,null)}})};ie(F,k=>{g(a)&&k(Ee)})}se(()=>{ce(H,g(h)),On.disabled=g(r)==="modifier",ce(dr,n[g(r)])}),ut("click",ee,()=>t.onClose?.()),vl(we,()=>g(r),k=>Q(r,k)),ps(On,()=>g(i),k=>Q(i,k)),ut("click",Rn,()=>t.onClose?.()),ut("click",y,b),W(e,p),Sn()}ar(["click"]);const yi="#bricks-structure",Aa="li[data-id]",wi="slashed-rebemer-host",Ta=400,Oa=25,cr=(e,...t)=>console[e]("[reBEMer]",...t),xs=new AbortController,{signal:$n}=xs,It=new Map;let fn=null;function Ma(){let e=document.getElementById(wi);return e||(e=document.createElement("div"),e.id=wi,document.body.appendChild(e)),e}function Ei(){const e=window.slashedBricksEditor;e&&typeof e=="object"&&Bl(e.showClassHints,e.classHints,{signal:$n});let t=0;const n=()=>{if(!$n.aborted){if(Sl()){Ia();return}if(++t>=Oa){cr("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(n,Ta)}};n()}function Ia(){const e=document.querySelector(yi);if(e){ki(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(yi);n&&(t.disconnect(),ki(n))});t.observe(document.body,{childList:!0,subtree:!0}),$n.addEventListener("abort",()=>t.disconnect(),{once:!0})}function ki(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Si(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),$n.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),Si(e)}function Si(e){for(const[n,r]of It)if(!r.host.isConnected){try{fr(r.instance)}catch(i){cr("warn","badge unmount failed",i)}It.delete(n)}const t=e.querySelectorAll(Aa);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const i=It.get(r);i&&i.host.isConnected&&n.contains(i.host)||Na(n)}}function Na(e){const t=e.getAttribute("data-id");if(!t)return;const n=e.querySelector(":scope > .structure-item")||e,r=n.querySelector(":scope > ul.actions")||n.querySelector(":scope > .actions")||n.querySelector(":scope > .structure-item-actions"),i=document.createElement("span");i.className="rebemer-badge-host",r?n.insertBefore(i,r):n.appendChild(i);const s=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),o=s?s.textContent.trim():"",a=hs(ql,{target:i,props:{elementId:t,label:o,onActivate:Ra}}),l=It.get(t);if(l){try{fr(l.instance)}catch(c){cr("warn","badge remount cleanup failed",c)}l.host.isConnected&&l.host.remove()}It.set(t,{instance:a,host:i})}function Ra(e){Hr();const t=document.createElement("div");Ma().appendChild(t),fn={instance:hs(xa,{target:t,props:{rootId:e,onClose:Hr}}),node:t}}function Hr(){if(fn){try{fr(fn.instance)}catch(e){cr("warn","panel unmount failed",e)}fn.node.remove(),fn=null}}window.addEventListener("beforeunload",()=>{xs.abort(),Hr(),zn();for(const{instance:e}of It.values())try{fr(e)}catch{}It.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ei,{once:!0}):Ei(); + creating a duplicate.`,1),Ta=V('

    '),Oa=V(' '),Ma=V('Migrate: ',1),Ia=V('No migratable keys on this element.'),Na=V(' '),La=V('
    '),Ra=V('
    ');function Pa(e,t){An(t,!0);let n=_n(t,"row",15),r=_n(t,"globalClasses",19,()=>[]),i=_n(t,"finalClassName",3,"");const s=be(()=>t.mode==="modifier"),o=be(()=>t.mode==="migrate"),a=be(()=>t.mode==="rename"),l=be(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),c=be(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),h=be(()=>!i()||!Array.isArray(r())||!n().include?null:r().find(y=>y&&y.name===i())||null);function u(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function d(y){return y.startsWith("_")?y.slice(1):y}var _=Ra();let v;var b=R(_),p=R(b),m=N(b,2),w=R(m),C=R(w),T=N(w,2),H=R(T),ee=N(T,2);{var Y=y=>{var F=ya();se(()=>Ot(F,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),W(y,F)};ie(ee,y=>{g(c)&&n().include&&y(Y)})}var _e=N(m,2),we=R(_e),q=R(we);{var _t=y=>{var F=wa(),Ee=R(F);se(()=>ce(Ee,g(l))),W(y,F)};ie(q,y=>{g(l)&&y(_t)})}var He=N(q,2),rn=N(we,2);{var Mn=y=>{var F=Ea();se(()=>F.disabled=!n().include),ut("input",F,u),wi(F,()=>n().modifier,Ee=>n(n().modifier=Ee,!0)),W(y,F)};ie(rn,y=>{g(s)&&y(Mn)})}var In=N(_e,2);{var Nn=y=>{var F=ka();W(y,F)};ie(In,y=>{g(s)&&n().include&&!n().modifier&&y(Nn)})}var sn=N(In,2);{var mr=y=>{var F=Sa();W(y,F)},Ln=y=>{var F=Ca(),Ee=R(F);se(()=>ce(Ee,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),W(y,F)};ie(sn,y=>{g(a)&&n().include&&n().currentClassCount===0?y(mr):g(a)&&n().include&&n().currentClassCount>1&&y(Ln,1)})}var Rn=N(sn,2);{var Pn=y=>{var F=Ta(),Ee=R(F);{var k=x=>{var K=Aa(),P=N(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)},B=x=>{var K=xa(),P=N(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)};ie(Ee,x=>{g(o)?x(k):x(B,-1)})}W(y,F)};ie(Rn,y=>{g(h)&&y(Pn)})}var br=N(Rn,2);{var Dn=y=>{var F=La(),Ee=R(F);{var k=P=>{var J=Ma(),j=N(Kt(J),2);ws(j,17,()=>n().migrateKeys,vl,(ke,G)=>{var D=Oa(),X=R(D);se(tt=>{Ot(D,"title",`Will be lifted into ${(i()||"the new class")??""}`),ce(X,tt)},[()=>d(g(G))]),W(ke,D)}),W(P,J)},B=P=>{var J=Ia();W(P,J)};ie(Ee,P=>{n().migrateKeys?.length?P(k):P(B,-1)})}var x=N(Ee,2);{var K=P=>{var J=Na(),j=R(J);se(()=>ce(j,`${n().skippedKeys.length??""} skipped`)),W(P,J)};ie(x,P=>{n().skippedKeys?.length&&P(K)})}W(y,F)};ie(br,y=>{g(o)&&n().include&&y(Dn)})}se(y=>{v=ai(_,1,"rebemer-row",null,v,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":g(c)}),wl(_,`--rebemer-row-depth: ${n().depth??0??""}`),ce(C,n().originalLabel),ce(H,y),Ot(He,"placeholder",t.isRoot?"block-name":"element-name"),He.disabled=!n().include},[()=>t.isRoot?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),ks(p,()=>n().include,y=>n(n().include=y,!0)),ut("input",He,u),wi(He,()=>n().name,y=>n(n().name=y,!0)),W(e,_),xn()}_r(["input"]);var Da=V(" ");function Fa(e,t){An(t,!0);let n=_n(t,"kind",3,"info"),r=_n(t,"duration",3,3e3),i=oe(!0);ri(()=>{if(!g(i)||r()<=0)return;const c=setTimeout(()=>{$(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const s=be(()=>n()==="error"?"alert":"status");var o=dl(),a=Kt(o);{var l=c=>{var h=Da(),u=R(h);se(()=>{ai(h,1,`rebemer-toast rebemer-toast--${n()??""}`),Ot(h,"role",g(s)),Ot(h,"aria-live",n()==="error"?"assertive":"polite"),ce(u,t.message)}),ut("click",h,()=>{$(i,!1),t.onDismiss?.()}),W(c,h)};ie(a,c=>{g(i)&&c(l)})}W(e,o),xn()}_r(["click"]);var Ba=V("Will migrate ",1),ja=V(' '),Ha=V(''),qa=V(' ',1);function Ka(e,t){An(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",modifier:"Appends a --modifier variant. The base class is auto-added to the element if absent.",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class."};let r=oe("add"),i=oe(!0),s=oe(lt([])),o=oe(lt([])),a=oe(null),l=oe(null);const c=be(()=>Mt(g(s)[0]?.name??"")),h=be(()=>g(s)[0]?.originalLabel??""),u=be(()=>{if(g(r)!=="migrate")return null;let k=0,B=0;for(const x of g(s))x.include&&(k+=x.migrateKeys?.length??0,B+=x.skippedKeys?.length??0);return{willMigrate:k,willSkip:B}}),d=be(()=>{if(g(s).length===0)return new Map;const k=Is({rootId:t.rootId,rows:g(s),mode:g(r)}),B=new Map;if(!k.ok)return B;for(const x of k.ops)B.set(x.row.id,x.finalClass);return B});Ol(()=>{const k=Pl(t.rootId);$(o,As().slice(),!0);const B=k.map((x,K)=>{const P=K===0,J=x.label||"",j=Mt(J),ke=x.name||"";let G,D;return j?(G=j,D="label"):P?(G="block",D="fallback"):ke&&!xr(ke)?(G=ga(ke,"item"),D="element-type"):(G="item",D="fallback"),{id:x.id,depth:x.depth,bricksType:ke,originalLabel:J||(P?"block":"element"),name:G,modifier:"",include:!0,suggestedFrom:D,migrateKeys:la(x.settings),skippedKeys:fa(x.settings),currentClassCount:Array.isArray(x.settings?._cssGlobalClasses)?x.settings._cssGlobalClasses.filter(X=>typeof X=="string"&&X.length>0).length:0}});if(B.length>1){const x=new Map(k.map(j=>[j.id,[]])),K=[];for(const j of k){for(;K.length&&K[K.length-1].depth>=j.depth;)K.pop();K.length&&x.get(K[K.length-1].id).push(j.id),K.push(j)}const P=new Map(k.map(j=>[j.id,j])),J=new Map(B.map(j=>[j.id,j]));for(const[,j]of x){if(!j.length)continue;const ke=new Map;for(const D of j){const X=P.get(D)?.name;X&&ke.set(X,(ke.get(X)??0)+1)}const G=j.filter(D=>xr(P.get(D)?.name??""));for(const D of j){const X=J.get(D),tt=P.get(D);if(!(!X||!tt||X.suggestedFrom==="label")){if(xr(tt.name)){const Dt=(x.get(D)??[]).map(Ds=>P.get(Ds)?.name??"").filter(Boolean),Ps=G.indexOf(D);X.name=ba(Dt,Ps,G.length),X.suggestedFrom="element-type"}else if((ke.get(tt.name)??0)===1){const Dt=ma[tt.name];Dt&&(X.name=Dt,X.suggestedFrom="element-type")}}}}}$(s,B,!0)});function _(k){if(k.key==="Escape"){t.onClose?.();return}g(l)&&k.target instanceof Node&&g(l).contains(k.target)&&k.key==="Enter"&&(k.target?.tagName==="INPUT"||k.target?.tagName==="SELECT")&&(k.preventDefault(),b())}let v=null;function b(){const k=Mt(g(s)[0]?.name??""),B=oa(k);if(!B.ok){$(a,{kind:"error",message:B.reason},!0);return}const x=ca({rootId:t.rootId,rows:g(s),mode:g(r),syncLabels:g(i)});x.ok?($(a,{kind:"success",message:`Applied to ${x.count} element${x.count!==1?"s":""}.`},!0),v&&clearTimeout(v),v=setTimeout(()=>t.onClose?.(),800)):$(a,{kind:"error",message:x.error},!0)}ri(()=>()=>{v&&clearTimeout(v)});var p=qa();ll("keydown",Hr,_);var m=Kt(p),w=R(m),C=R(w),T=N(R(C)),H=R(T),ee=N(C,2),Y=N(w,2),_e=R(Y),we=N(R(_e),2),q=R(we);q.value=q.__value="add";var _t=N(q);_t.value=_t.__value="rename";var He=N(_t);He.value=He.__value="replace";var rn=N(He);rn.value=rn.__value="modifier";var Mn=N(rn);Mn.value=Mn.__value="migrate";var In=N(_e,2),Nn=R(In),sn=N(Y,2),mr=R(sn),Ln=N(sn,2);{var Rn=k=>{var B=Ha();let x;var K=R(B);{var P=G=>{var D=cl("No migratable style keys found on any included element. Apply will attach empty classes.");W(G,D)},J=G=>{var D=Ba(),X=N(Kt(D)),tt=R(X),Dt=N(X);se(()=>{ce(tt,g(u).willMigrate),ce(Dt,` style key${g(u).willMigrate===1?"":"s"} into new classes.`)}),W(G,D)};ie(K,G=>{g(u).willMigrate===0?G(P):G(J,-1)})}var j=N(K,2);{var ke=G=>{var D=ja(),X=R(D);se(()=>ce(X,`${g(u).willSkip??""} key${g(u).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),W(G,D)};ie(j,G=>{g(u).willSkip>0&&G(ke)})}se(()=>x=ai(B,1,"rebemer-panel__notice",null,x,{"rebemer-panel__notice--warn":g(u).willSkip>0||g(u).willMigrate===0})),W(k,B)};ie(Ln,k=>{g(u)&&k(Rn)})}var Pn=N(Ln,2);ws(Pn,23,()=>g(s),k=>k.id,(k,B,x)=>{{let K=be(()=>g(B).id===t.rootId),P=be(()=>g(d).get(g(B).id)??"");Pa(k,{get mode(){return g(r)},get blockName(){return g(c)},get isRoot(){return g(K)},get globalClasses(){return g(o)},get finalClassName(){return g(P)},get row(){return g(s)[g(x)]},set row(J){g(s)[g(x)]=J}})}});var br=N(Pn,2),Dn=R(br),y=N(Dn,2);Tl(m,k=>$(l,k),()=>g(l));var F=N(m,2);{var Ee=k=>{Fa(k,{get kind(){return g(a).kind},get message(){return g(a).message},onDismiss:()=>{$(a,null)}})};ie(F,k=>{g(a)&&k(Ee)})}se(()=>{ce(H,g(h)),Nn.disabled=g(r)==="modifier",ce(mr,n[g(r)])}),ut("click",ee,()=>t.onClose?.()),kl(we,()=>g(r),k=>$(r,k)),ks(Nn,()=>g(i),k=>$(i,k)),ut("click",Dn,()=>t.onClose?.()),ut("click",y,b),W(e,p),xn()}_r(["click"]);const xi="#bricks-structure",Wa="li[data-id]",Ti="slashed-rebemer-host",za=400,Ua=25,gr=(e,...t)=>console[e]("[reBEMer]",...t),Rs=new AbortController,{signal:gn}=Rs,It=new Map;let un=null;function Ga(){let e=document.getElementById(Ti);return e||(e=document.createElement("div"),e.id=Ti,document.body.appendChild(e)),e}function Oi(){const e=window.slashedBricksEditor;e&&typeof e=="object"&&(Gl(e.showClassHints,e.classHints,{signal:gn}),ea(e.showColorSwatches,e.colorHexMap,{signal:gn}));let t=0;const n=()=>{if(!gn.aborted){if(Nl()){Va();return}if(++t>=Ua){gr("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(n,za)}};n()}function Va(){const e=document.querySelector(xi);if(e){Mi(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(xi);n&&(t.disconnect(),Mi(n))});t.observe(document.body,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>t.disconnect(),{once:!0})}function Mi(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Ii(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),Ii(e)}function Ii(e){for(const[n,r]of It)if(!r.host.isConnected){try{vr(r.instance)}catch(i){gr("warn","badge unmount failed",i)}It.delete(n)}const t=e.querySelectorAll(Wa);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const i=It.get(r);i&&i.host.isConnected&&n.contains(i.host)||Ya(n)}}function Ya(e){const t=e.getAttribute("data-id");if(!t)return;const n=e.querySelector(":scope > .structure-item")||e,r=n.querySelector(":scope > ul.actions")||n.querySelector(":scope > .actions")||n.querySelector(":scope > .structure-item-actions"),i=document.createElement("span");i.className="rebemer-badge-host",r?n.insertBefore(i,r):n.appendChild(i);const s=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),o=s?s.textContent.trim():"",a=ys(ra,{target:i,props:{elementId:t,label:o,onActivate:Ja}}),l=It.get(t);if(l){try{vr(l.instance)}catch(c){gr("warn","badge remount cleanup failed",c)}l.host.isConnected&&l.host.remove()}It.set(t,{instance:a,host:i})}function Ja(e){Vr();const t=document.createElement("div");Ga().appendChild(t),un={instance:ys(Ka,{target:t,props:{rootId:e,onClose:Vr}}),node:t}}function Vr(){if(un){try{vr(un.instance)}catch(e){gr("warn","panel unmount failed",e)}un.node.remove(),un=null}}window.addEventListener("beforeunload",()=>{Rs.abort(),Vr(),Vn(),Xn();for(const{instance:e}of It.values())try{vr(e)}catch{}It.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oi,{once:!0}):Oi(); //# sourceMappingURL=app.js.map diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js new file mode 100644 index 00000000..d55bb5fa --- /dev/null +++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js @@ -0,0 +1,220 @@ +/** + * Color swatches for the Bricks variable-picker dropdown. + * + * SLASHED color tokens are registered with Bricks' Variable Manager as + * empty-valued variables (see includes/class-variables.php) so the + * framework's adaptive `light-dark()` definitions in `:root` stay the + * single source of truth and nothing the plugin injects competes with + * them. The cost of that fidelity is that Bricks has no value to render + * a colour swatch from in the variable picker — entries show as plain + * text. + * + * This module paints the swatch back in, builder-side only, without ever + * touching `:root`. Each `--sf-color-*` entry in the picker dropdown gets + * a small coloured square using a server-resolved hex map (localised from + * `Slashed_Bricks_Inventory::get_color_hex_map()`), because the builder + * panel does not load the SLASHED stylesheet and so cannot resolve + * `var(--sf-color-*)` itself. + * + * Design notes — mirrors the rest of the integration's philosophy: + * + * - **Additive and fail-silent.** Bricks renders the list, names and + * the canvas hover-preview natively; we only prepend a swatch. If the + * markup ever changes or anything throws, you lose the square — never + * the picker. + * + * - **Reconcile, don't stamp-once.** Bricks (Vue) reuses `
  • ` nodes + * when the list is filtered via the search box, so a row that was + * "sf-color-action" can become "sf-color-primary" — or a non-colour + * variable — while keeping the same DOM node. Every pass recomputes + * each row's desired colour and adds / updates / removes its swatch + * accordingly, which is reuse-safe where a one-time marker would go + * stale. + * + * - **Scoped to colour tokens only.** `resolveSwatchColor()` returns a + * colour only for `--sf-color-*` names present in the hex map, so the + * same observer is harmless in the spacing / typography pickers. + * + * @module color-swatches + */ + +const ITEM_SELECTOR = 'li.variable-picker-item'; +const SWATCH_CLASS = 'slashed-var-swatch'; +const DEBOUNCE_MS = 50; + +const log = (level, ...args) => console[level]('[slashed-swatches]', ...args); + +/** + * Resolve the swatch colour for a variable label, or null. + * + * Pure and DOM-free so it can be unit tested with `node --test`. Accepts + * the variable name as shown in the picker (Bricks omits the leading + * `--`, e.g. "sf-color-primary") and returns the resolved hex from the + * map, or null when the name is not a single known `--sf-color-*` token. + * + * @param {string} rawName - e.g. "sf-color-primary" or "--sf-color-primary". + * @param {Record} hexMap - Map keyed by "--sf-color-*". + * @returns {string | null} + */ +export function resolveSwatchColor(rawName, hexMap) { + if (!rawName || !hexMap) return null; + + let name = String(rawName).trim(); + if (!name || /\s/.test(name)) return null; + + // The picker renders names without the leading `--`; normalise so the + // lookup key matches the hex map (which is keyed by the full property). + if (name.slice(0, 2) !== '--') name = '--' + name.replace(/^-+/, ''); + + if (name.indexOf('--sf-color-') !== 0) return null; + + const hex = hexMap[name]; + return typeof hex === 'string' && hex ? hex : null; +} + +// ----- DOM glue (only runs in the browser) --------------------------- + +let _enabled = false; +let _hexMap = {}; +let _observer = null; +let _debounce = null; +let _controller = null; + +/** + * Read the variable name a picker row represents. + * + * The row layout is: + *
  • + * sf-color-primary + * + *
  • + * The first span's `title` holds the canonical name; fall back to its + * text, then the row text, so a minor markup shift still resolves. + * + * @param {Element} li + * @returns {string} + */ +function itemName(li) { + const span = + li.querySelector(':scope > span[title]') || li.querySelector(':scope > span'); + if (span) { + const title = span.getAttribute('title'); + if (title && title.trim()) return title.trim(); + return (span.textContent || '').trim(); + } + return (li.textContent || '').trim(); +} + +/** + * Add, update, or remove a single row's swatch to match its current + * variable. Idempotent and safe to run on every pass. + * + * @param {Element} li + */ +function reconcile(li) { + // Category / group headers (`.title`, `.category`) are not variables. + if (li.classList.contains('title') || li.classList.contains('category')) { + const stale = li.querySelector(':scope > .' + SWATCH_CLASS); + if (stale) stale.remove(); + return; + } + + const color = resolveSwatchColor(itemName(li), _hexMap); + let swatch = li.querySelector(':scope > .' + SWATCH_CLASS); + + if (!color) { + if (swatch) swatch.remove(); + return; + } + + if (!swatch) { + swatch = document.createElement('span'); + swatch.className = SWATCH_CLASS; + swatch.setAttribute('aria-hidden', 'true'); + li.insertBefore(swatch, li.firstChild); + } + + if (swatch.dataset.color !== color) { + swatch.style.setProperty('--slashed-swatch-color', color); + swatch.dataset.color = color; + } +} + +function runPass() { + try { + const items = document.querySelectorAll(ITEM_SELECTOR); + for (const li of items) reconcile(li); + } catch (err) { + log('warn', 'swatch pass failed', err); + } +} + +function schedule() { + if (_debounce !== null) return; + _debounce = setTimeout(() => { + _debounce = null; + runPass(); + }, DEBOUNCE_MS); +} + +/** + * Initialise variable-picker swatches. + * + * Safe to call when disabled (no-ops) and idempotent (a second call + * tears down the first). Pass an `AbortSignal` to have the observer + * disconnected automatically when the host aborts, matching how the + * reBEMer entry point manages its own lifecycle. + * + * @param {boolean} enabled + * @param {Record} hexMap - Map keyed by "--sf-color-*". + * @param {{ signal?: AbortSignal }} [options] + */ +export function init(enabled, hexMap, options = {}) { + destroy(); + + _enabled = !!enabled; + _hexMap = hexMap && typeof hexMap === 'object' ? hexMap : {}; + if (!_enabled || Object.keys(_hexMap).length === 0) return; + + _controller = new AbortController(); + + // The picker dropdown is created, destroyed, and re-rendered (on search) + // by Bricks, so a persistent observer that re-decorates on any DOM + // churn is simpler and more robust than trying to hook open/close. + // The callback only schedules a cheap debounced pass; our own swatch + // insertions trigger at most one extra no-op pass before settling. + _observer = new MutationObserver(schedule); + _observer.observe(document.body, { childList: true, subtree: true }); + + runPass(); + + if (options.signal) { + if (options.signal.aborted) destroy(); + else options.signal.addEventListener('abort', destroy, { once: true }); + } +} + +/** + * Tear down the observer and remove every swatch we injected. + */ +export function destroy() { + if (_debounce !== null) { + clearTimeout(_debounce); + _debounce = null; + } + if (_observer) { + _observer.disconnect(); + _observer = null; + } + if (_controller) { + _controller.abort(); + _controller = null; + } + try { + document.querySelectorAll('.' + SWATCH_CLASS).forEach((node) => node.remove()); + } catch { + /* ignore */ + } + _enabled = false; + _hexMap = {}; +} diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js index ca20ae92..05c8eae7 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js +++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js @@ -19,6 +19,7 @@ import { mount, unmount } from 'svelte'; import * as api from './lib/bricks-api.js'; import * as classHints from './lib/class-hints.js'; +import * as colorSwatches from './lib/color-swatches.js'; import BemBadge from './components/BemBadge.svelte'; import BemPanel from './components/BemPanel.svelte'; import './styles/panel.css'; @@ -59,6 +60,7 @@ function start() { const cfg = window.slashedBricksEditor; if (cfg && typeof cfg === 'object') { classHints.init(cfg.showClassHints, cfg.classHints, { signal }); + colorSwatches.init(cfg.showColorSwatches, cfg.colorHexMap, { signal }); } let attempts = 0; @@ -237,6 +239,7 @@ window.addEventListener('beforeunload', () => { controller.abort(); closePanel(); classHints.destroy(); + colorSwatches.destroy(); for (const { instance } of badgeInstances.values()) { try { unmount(instance); } catch { /* ignore */ } } diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css index 0366aeee..a73108d0 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css +++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css @@ -353,3 +353,29 @@ li[data-id]:focus-within > .rebemer-badge-host { } .rebemer-class-hint__cat[hidden] { display: none; } .rebemer-class-hint__desc { margin: 4px 0 0; color: var(--rebemer-fg); } + +/* Variable-picker colour swatch — a small square prepended to each + `--sf-color-*` row in the Bricks variable dropdown by + color-swatches.js. The colour is set inline via the + `--slashed-swatch-color` custom property; everything else lives here. + The checkerboard underlay shows through translucent (alpha) tokens. */ +.slashed-var-swatch { + flex: 0 0 auto; + display: inline-block; + width: 12px; + height: 12px; + margin-right: 7px; + vertical-align: middle; + border-radius: 3px; + border: 1px solid rgba(127, 127, 127, .45); + /* Layer order: the resolved colour sits on top (opaque tokens hide the + checkerboard entirely); translucent/alpha tokens let the checkerboard + show through so transparency reads at a glance. */ + background-color: #fff; + background-image: + linear-gradient(var(--slashed-swatch-color, transparent), var(--slashed-swatch-color, transparent)), + linear-gradient(45deg, rgba(127, 127, 127, .35) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .35) 75%), + linear-gradient(45deg, rgba(127, 127, 127, .35) 25%, transparent 25%, transparent 75%, rgba(127, 127, 127, .35) 75%); + background-position: 0 0, 0 0, 4px 4px; + background-size: auto, 8px 8px, 8px 8px; +} diff --git a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-rebemer-enqueue.php b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-rebemer-enqueue.php index 709b3274..d8a1b164 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/includes/class-rebemer-enqueue.php +++ b/plugins/SLASHED-for-WP/integrations/bricks/includes/class-rebemer-enqueue.php @@ -45,12 +45,31 @@ public function enqueue() { wp_enqueue_script( self::SCRIPT_HANDLE, $base_url . 'app.js', array(), $js_ver, true ); $plugin_settings = Slashed_Token_Store::get_plugin_settings(); + + /** + * Toggle the variable-picker colour swatches. + * + * Swatches are painted builder-side onto each `--sf-color-*` entry + * in the Bricks variable dropdown (see editor-app color-swatches.js) + * and never touch `:root`, so dark/light stays framework-driven. + * Filter to false to disable them. + * + * @param bool $enabled Default true. + */ + $show_color_swatches = (bool) apply_filters( 'slashed_bricks/show_color_swatches', true ); + + $color_hex_map = ( $show_color_swatches && class_exists( 'Slashed_Bricks_Inventory' ) ) + ? Slashed_Bricks_Inventory::get_color_hex_map() + : array(); + wp_localize_script( self::SCRIPT_HANDLE, 'slashedBricksEditor', array( - 'showClassHints' => ! empty( $plugin_settings['show_class_hints'] ), - 'classHints' => Slashed_Token_Page::get_class_hints(), + 'showClassHints' => ! empty( $plugin_settings['show_class_hints'] ), + 'classHints' => Slashed_Token_Page::get_class_hints(), + 'showColorSwatches' => $show_color_swatches, + 'colorHexMap' => $color_hex_map, ) ); } From 6a49975d6d1f1053953bc855f50c6cae2eec7ccb Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 09:47:47 +0000 Subject: [PATCH 2/2] perf(bricks): scope swatch observer to picker mutations Filter the body-level MutationObserver with touchesPicker() so only mutations inside the variable picker (a row patch or the dropdown subtree being added) schedule a reconcile pass. Unrelated builder churn (canvas edits, structure-panel rebuilds) no longer wakes the reconciler. Keeps the robust body scope (the picker has no container that's stable across its whole lifecycle) while removing the wasted passes CodeRabbit flagged. Co-Authored-By: Jack Granatowski --- .../bricks/assets/editor-app/app.js | 8 +-- .../editor-app/src/lib/color-swatches.js | 53 +++++++++++++++++-- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js index 9886c614..62700b72 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js +++ b/plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js @@ -1,7 +1,7 @@ -var Fs=Object.defineProperty;var fi=e=>{throw TypeError(e)};var Bs=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>Bs(e,typeof t!="symbol"?t+"":t,n),yr=(e,t,n)=>t.has(e)||fi("Cannot "+n);var f=(e,t,n)=>(yr(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?fi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),E=(e,t,n,r)=>(yr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),I=(e,t,n)=>(yr(e,t,"access private method"),n);var Jr=Array.isArray,js=Array.prototype.indexOf,St=Array.prototype.includes,fr=Array.from,Hs=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,qs=Object.getOwnPropertyDescriptors,Ks=Object.prototype,Ws=Array.prototype,Li=Object.getPrototypeOf,ui=Object.isExtensible;const zs=()=>{};function Us(e){for(var t=0;t{e=r,t=i});return{promise:n,resolve:e,reject:t}}const ne=2,Xt=4,ur=8,Pi=1<<24,De=16,je=32,dt=64,Tr=128,Me=512,Q=1024,te=2048,Ue=4096,le=8192,Ie=16384,Pt=32768,Or=1<<25,Zt=65536,Zn=1<<17,Gs=1<<18,tn=1<<19,Vs=1<<20,ze=1<<25,Nt=65536,$n=1<<21,qt=1<<22,at=1<<23,Ct=Symbol("$state"),Ys=Symbol("legacy props"),Js=Symbol(""),Hn=Symbol("attributes"),Mr=Symbol("class"),Ir=Symbol("style"),ln=Symbol("text"),qn=Symbol("form reset"),cr=new class extends Error{constructor(){super(...arguments);ae(this,"name","StaleReactionError");ae(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Xs(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function $s(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Qs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function eo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function to(e){throw new Error("https://svelte.dev/e/effect_orphan")}function no(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ro(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function io(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function so(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function oo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function lo(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ao=1,fo=2,Di=4,uo=8,co=16,ho=1,_o=4,vo=8,po=16,go=1,mo=2,Z=Symbol("uninitialized"),Fi="http://www.w3.org/1999/xhtml";function bo(){console.warn("https://svelte.dev/e/derived_inert")}function yo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function wo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Bi(e){return e===this.v}function Eo(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ji(e){return!Eo(e,this.v)}let he=null;function $t(e){he=e}function An(e,t=!1,n){he={p:he,i:!1,c:null,e:null,s:e,x:null,r:M,l:null}}function xn(e){var t=he,n=t.e;if(n!==null){t.e=null;for(var r of n)os(r)}return t.i=!0,he=t.p,{}}function Hi(){return!0}let vt=[];function qi(){var e=vt;vt=[],Us(e)}function ft(e){if(vt.length===0&&!cn){var t=vt;queueMicrotask(()=>{t===vt&&qi()})}vt.push(e)}function ko(){for(;vt.length>0;)qi()}function Ki(e){var t=M;if(t===null)return O.f|=at,e;if((t.f&Pt)===0&&(t.f&Xt)===0)throw e;ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&Tr)!==0){if((t.f&Pt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const So=-7169;function z(e,t){e.f=e.f&So|t}function Xr(e){(e.f&Me)!==0||e.deps===null?z(e,Q):z(e,Ue)}function Wi(e){if(e!==null)for(const t of e)(t.f&ne)===0||(t.f&Nt)===0||(t.f^=Nt,Wi(t.deps))}function zi(e,t,n){(e.f&te)!==0?t.add(e):(e.f&Ue)!==0&&n.add(e),Wi(e.deps),z(e,Q)}let Fn=!1;function Co(e){var t=Fn;try{return Fn=!1,[e(),Fn]}finally{Fn=t}}let wr=null,Ft=null,A=null,Nr=null,Fe=null,Lr=null,cn=!1,Er=!1,jt=null,Kn=null;var ci=0;let Ao=1;var zt,rt,mt,Ut,Gt,bt,Vt,Ye,yn,pe,wn,it,qe,Ke,Yt,yt,L,Rr,an,Pr,Ui,Gi,Wn,xo,Dr,Bt;const or=class or{constructor(){S(this,L);ae(this,"id",Ao++);S(this,zt,!1);ae(this,"linked",!0);S(this,rt,null);S(this,mt,null);ae(this,"async_deriveds",new Map);ae(this,"current",new Map);ae(this,"previous",new Map);ae(this,"unblocked",new Set);S(this,Ut,new Set);S(this,Gt,new Set);S(this,bt,new Set);S(this,Vt,0);S(this,Ye,new Map);S(this,yn,null);S(this,pe,[]);S(this,wn,[]);S(this,it,new Set);S(this,qe,new Set);S(this,Ke,new Map);S(this,Yt,new Set);ae(this,"is_fork",!1);S(this,yt,!1)}skip_effect(t){f(this,Ke).has(t)||f(this,Ke).set(t,{d:[],m:[]}),f(this,Yt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=f(this,Ke).get(t);if(r){f(this,Ke).delete(t);for(var i of r.d)z(i,te),n(i);for(i of r.m)z(i,Ue),n(i)}f(this,Yt).add(t)}capture(t,n,r=!1){t.v!==Z&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&at)===0&&(this.current.set(t,[n,r]),Fe?.set(t,n)),this.is_fork||(t.v=n)}activate(){A=this}deactivate(){A=null,Fe=null}flush(){try{Er=!0,A=this,I(this,L,an).call(this)}finally{ci=0,Lr=null,jt=null,Kn=null,Er=!1,A=null,Fe=null,At.clear()}}discard(){for(const t of f(this,Gt))t(this);f(this,Gt).clear(),f(this,bt).clear(),I(this,L,Bt).call(this)}register_created_effect(t){f(this,wn).push(t)}increment(t,n){if(E(this,Vt,f(this,Vt)+1),t){let r=f(this,Ye).get(n)??0;f(this,Ye).set(n,r+1)}}decrement(t,n){if(E(this,Vt,f(this,Vt)-1),t){let r=f(this,Ye).get(n)??0;r===1?f(this,Ye).delete(n):f(this,Ye).set(n,r-1)}f(this,yt)||(E(this,yt,!0),ft(()=>{E(this,yt,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)f(this,it).add(r);for(const r of n)f(this,qe).add(r);t.clear(),n.clear()}oncommit(t){f(this,Ut).add(t)}ondiscard(t){f(this,Gt).add(t)}on_fork_commit(t){f(this,bt).add(t)}run_fork_commit_callbacks(){for(const t of f(this,bt))t(this);f(this,bt).clear()}settled(){return(f(this,yn)??E(this,yn,Ri())).promise}static ensure(){var t;if(A===null){const n=A=new or;I(t=n,L,Dr).call(t),!Er&&!cn&&ft(()=>{f(n,zt)||n.flush()})}return A}apply(){{Fe=null;return}}schedule(t){if(Lr=t,t.b?.is_pending&&(t.f&(Xt|ur|Pi))!==0&&(t.f&Pt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(jt!==null&&n===M&&(O===null||(O.f&ne)===0))return;if((r&(dt|je))!==0){if((r&Q)===0)return;n.f^=Q}}f(this,pe).push(n)}};zt=new WeakMap,rt=new WeakMap,mt=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,bt=new WeakMap,Vt=new WeakMap,Ye=new WeakMap,yn=new WeakMap,pe=new WeakMap,wn=new WeakMap,it=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Yt=new WeakMap,yt=new WeakMap,L=new WeakSet,Rr=function(){if(this.is_fork)return!0;for(const r of f(this,Ye).keys()){for(var t=r,n=!1;t.parent!==null;){if(f(this,Ke).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},an=function(){var l,c,h;if(E(this,zt,!0),ci++>1e3&&(I(this,L,Bt).call(this),Oo()),!I(this,L,Rr).call(this)){for(const u of f(this,it))f(this,qe).delete(u),z(u,te),this.schedule(u);for(const u of f(this,qe))z(u,Ue),this.schedule(u)}const t=f(this,pe);E(this,pe,[]),this.apply();var n=jt=[],r=[],i=Kn=[];for(const u of t)try{I(this,L,Pr).call(this,u,n,r)}catch(d){throw Ji(u),d}if(A=null,i.length>0){var s=or.ensure();for(const u of i)s.schedule(u)}if(jt=null,Kn=null,I(this,L,Rr).call(this)){I(this,L,Wn).call(this,r),I(this,L,Wn).call(this,n);for(const[u,d]of f(this,Ke))Yi(u,d);i.length>0&&I(l=A,L,an).call(l);return}const o=I(this,L,Ui).call(this);if(o){I(c=o,L,Gi).call(c,this);return}f(this,it).clear(),f(this,qe).clear();for(const u of f(this,Ut))u(this);f(this,Ut).clear(),Nr=this,di(r),di(n),Nr=null,f(this,yn)?.resolve();var a=A;if(this.linked&&f(this,Vt)===0&&I(this,L,Bt).call(this),f(this,pe).length>0){a===null&&(a=this,I(this,L,Dr).call(this));const u=a;f(u,pe).push(...f(this,pe).filter(d=>!f(u,pe).includes(d)))}a!==null&&I(h=a,L,an).call(h)},Pr=function(t,n,r){t.f^=Q;for(var i=t.first;i!==null;){var s=i.f,o=(s&(je|dt))!==0,a=o&&(s&Q)!==0,l=a||(s&le)!==0||f(this,Ke).has(i);if(!l&&i.fn!==null){o?i.f^=Q:(s&Xt)!==0?n.push(i):On(i)&&((s&De)!==0&&f(this,qe).add(i),en(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var h=i.next;if(h!==null){i=h;break}i=i.parent}}},Ui=function(){for(var t=f(this,rt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=f(t,rt)}return null},Gi=function(t){var r;for(const[i,s]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,s);for(const[i,s]of t.async_deriveds){const o=this.async_deriveds.get(i);o&&s.promise.then(o.resolve)}const n=i=>{var s=i.reactions;if(s!==null)for(const l of s){var o=l.f;if((o&ne)!==0)n(l);else{var a=l;o&(qt|De)&&!this.async_deriveds.has(a)&&(f(this,qe).delete(a),z(a,te),this.schedule(a))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),I(r=t,L,Bt).call(r),A=this,I(this,L,an).call(this)},Wn=function(t){for(var n=0;n!this.current.has(d));if(i.length===0)t&&u.discard();else if(n.length>0){if(t)for(const d of f(this,Yt))u.unskip_effect(d,_=>{var v;(_.f&(De|qt))!==0?u.schedule(_):I(v=u,L,Wn).call(v,[_])});u.activate();var s=new Set,o=new Map;for(var a of n)Vi(a,i,s,o);o=new Map;var l=[...u.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(l.length>0)for(const d of f(this,wn))(d.f&(Ie|le|Zn))===0&&Zr(d,l,o)&&((d.f&(qt|De))!==0?(z(d,te),u.schedule(d)):f(u,it).add(d));if(f(u,pe).length>0&&!f(u,yt)){u.apply();for(var c of f(u,pe))I(h=u,L,Pr).call(h,c,[],[]);E(u,pe,[])}u.deactivate()}}}},Dr=function(){Ft===null?wr=Ft=this:(E(Ft,mt,this),E(this,rt,Ft)),Ft=this},Bt=function(){var t=f(this,rt),n=f(this,mt);t===null?wr=n:E(t,mt,n),n===null?Ft=t:E(n,rt,t),this.linked=!1};let Lt=or;function To(e){var t=cn;cn=!0;try{for(var n;;){if(ko(),A===null)return n;A.flush()}}finally{cn=t}}function Oo(){try{no()}catch(e){ot(e,Lr)}}let Ve=null;function di(e){var t=e.length;if(t!==0){for(var n=0;n0)){At.clear();for(const i of Ve){if((i.f&(Ie|le))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)Ve.has(o)&&(Ve.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Ie|le))===0&&en(l)}}Ve.clear()}}Ve=null}}function Vi(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&ne)!==0?Vi(i,t,n,r):(s&(qt|De))!==0&&(s&te)===0&&Zr(i,t,r)&&(z(i,te),$r(i))}}function Zr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(St.call(t,i))return!0;if((i.f&ne)!==0&&Zr(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function $r(e){A.schedule(e)}function Yi(e,t){if(!((e.f&je)!==0&&(e.f&Q)!==0)){(e.f&te)!==0?t.d.push(e):(e.f&Ue)!==0&&t.m.push(e),z(e,Q);for(var n=e.first;n!==null;)Yi(n,t),n=n.next}}function Ji(e){z(e,Q);for(var t=e.first;t!==null;)Ji(t),t=t.next}function Mo(e){let t=0,n=Rt(0),r;return()=>{ti()&&(g(n),hr(()=>(t===0&&(r=nn(()=>e(()=>dn(n)))),t+=1,()=>{ft(()=>{t-=1,t===0&&(r?.(),r=void 0,dn(n))})})))}}var Io=Zt|tn;function No(e,t,n,r){new Lo(e,t,n,r)}var Ce,Yr,Ae,wt,fe,xe,re,ge,Je,Et,st,Jt,En,kn,Xe,lr,U,Ro,Po,Do,Fr,zn,Un,Br,jr;class Lo{constructor(t,n,r,i){S(this,U);ae(this,"parent");ae(this,"is_pending",!1);ae(this,"transform_error");S(this,Ce);S(this,Yr,null);S(this,Ae);S(this,wt);S(this,fe);S(this,xe,null);S(this,re,null);S(this,ge,null);S(this,Je,null);S(this,Et,0);S(this,st,0);S(this,Jt,!1);S(this,En,new Set);S(this,kn,new Set);S(this,Xe,null);S(this,lr,Mo(()=>(E(this,Xe,Rt(f(this,Et))),()=>{E(this,Xe,null)})));E(this,Ce,t),E(this,Ae,n),E(this,wt,s=>{var o=M;o.b=this,o.f|=Tr,r(s)}),this.parent=M.b,this.transform_error=i??this.parent?.transform_error??(s=>s),E(this,fe,ii(()=>{I(this,U,Fr).call(this)},Io))}defer_effect(t){zi(t,f(this,En),f(this,kn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!f(this,Ae).pending}update_pending_count(t,n){I(this,U,Br).call(this,t,n),E(this,Et,f(this,Et)+t),!(!f(this,Xe)||f(this,Jt))&&(E(this,Jt,!0),ft(()=>{E(this,Jt,!1),f(this,Xe)&&Qt(f(this,Xe),f(this,Et))}))}get_effect_pending(){return f(this,lr).call(this),g(f(this,Xe))}error(t){if(!f(this,Ae).onerror&&!f(this,Ae).failed)throw t;A?.is_fork?(f(this,xe)&&A.skip_effect(f(this,xe)),f(this,re)&&A.skip_effect(f(this,re)),f(this,ge)&&A.skip_effect(f(this,ge)),A.on_fork_commit(()=>{I(this,U,jr).call(this,t)})):I(this,U,jr).call(this,t)}}Ce=new WeakMap,Yr=new WeakMap,Ae=new WeakMap,wt=new WeakMap,fe=new WeakMap,xe=new WeakMap,re=new WeakMap,ge=new WeakMap,Je=new WeakMap,Et=new WeakMap,st=new WeakMap,Jt=new WeakMap,En=new WeakMap,kn=new WeakMap,Xe=new WeakMap,lr=new WeakMap,U=new WeakSet,Ro=function(){try{E(this,xe,Te(()=>f(this,wt).call(this,f(this,Ce))))}catch(t){this.error(t)}},Po=function(t){const n=f(this,Ae).failed;n&&E(this,ge,Te(()=>{n(f(this,Ce),()=>t,()=>()=>{})}))},Do=function(){const t=f(this,Ae).pending;t&&(this.is_pending=!0,E(this,re,Te(()=>t(f(this,Ce)))),ft(()=>{var n=E(this,Je,document.createDocumentFragment()),r=$e();n.append(r),E(this,xe,I(this,U,Un).call(this,()=>Te(()=>f(this,wt).call(this,r)))),f(this,st)===0&&(f(this,Ce).before(n),E(this,Je,null),xt(f(this,re),()=>{E(this,re,null)}),I(this,U,zn).call(this,A))}))},Fr=function(){try{if(this.is_pending=this.has_pending_snippet(),E(this,st,0),E(this,Et,0),E(this,xe,Te(()=>{f(this,wt).call(this,f(this,Ce))})),f(this,st)>0){var t=E(this,Je,document.createDocumentFragment());li(f(this,xe),t);const n=f(this,Ae).pending;E(this,re,Te(()=>n(f(this,Ce))))}else I(this,U,zn).call(this,A)}catch(n){this.error(n)}},zn=function(t){this.is_pending=!1,t.transfer_effects(f(this,En),f(this,kn))},Un=function(t){var n=M,r=O,i=he;Ge(f(this,fe)),Le(f(this,fe)),$t(f(this,fe).ctx);try{return Lt.ensure(),t()}catch(s){return Ki(s),null}finally{Ge(n),Le(r),$t(i)}},Br=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&I(r=this.parent,U,Br).call(r,t,n);return}E(this,st,f(this,st)+t),f(this,st)===0&&(I(this,U,zn).call(this,n),f(this,re)&&xt(f(this,re),()=>{E(this,re,null)}),f(this,Je)&&(f(this,Ce).before(f(this,Je)),E(this,Je,null)))},jr=function(t){f(this,xe)&&(de(f(this,xe)),E(this,xe,null)),f(this,re)&&(de(f(this,re)),E(this,re,null)),f(this,ge)&&(de(f(this,ge)),E(this,ge,null));var n=f(this,Ae).onerror;let r=f(this,Ae).failed;var i=!1,s=!1;const o=()=>{if(i){wo();return}i=!0,s&&lo(),f(this,ge)!==null&&xt(f(this,ge),()=>{E(this,ge,null)}),I(this,U,Un).call(this,()=>{I(this,U,Fr).call(this)})},a=l=>{try{s=!0,n?.(l,o),s=!1}catch(c){ot(c,f(this,fe)&&f(this,fe).parent)}r&&E(this,ge,I(this,U,Un).call(this,()=>{try{return Te(()=>{var c=M;c.b=this,c.f|=Tr,r(f(this,Ce),()=>l,()=>o)})}catch(c){return ot(c,f(this,fe).parent),null}}))};ft(()=>{var l;try{l=this.transform_error(t)}catch(c){ot(c,f(this,fe)&&f(this,fe).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>ot(c,f(this,fe)&&f(this,fe).parent)):a(l)})};function Fo(e,t,n,r){const i=mn;var s=e.filter(d=>!d.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var o=M,a=Bo(),l=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function c(d){if((o.f&Ie)===0){a();try{r(d)}catch(_){ot(_,o)}Qn()}}var h=Xi();if(n.length===0){l.then(()=>c(t.map(i))).finally(h);return}function u(){Promise.all(n.map(d=>jo(d))).then(d=>c([...t.map(i),...d])).catch(d=>ot(d,o)).finally(h)}l?l.then(()=>{a(),u(),Qn()}):u()}function Bo(){var e=M,t=O,n=he,r=A;return function(s=!0){Ge(e),Le(t),$t(n),s&&(e.f&Ie)===0&&(r?.activate(),r?.apply())}}function Qn(e=!0){Ge(null),Le(null),$t(null),e&&A?.deactivate()}function Xi(){var e=M,t=e.b,n=A,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),()=>{t.update_pending_count(-1,n),n.decrement(r,e)}}function mn(e){var t=ne|te;return M!==null&&(M.f|=tn),{ctx:he,deps:null,effects:null,equals:Bi,f:t,fn:e,reactions:null,rv:0,v:Z,wv:0,parent:M,ac:null}}const Bn=Symbol("obsolete");function jo(e,t,n){let r=M;r===null&&Zs();var i=void 0,s=Rt(Z),o=!O,a=new Set;return $o(()=>{var l=M,c=Ri();i=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==cr&&c.reject(_)}).finally(Qn)}catch(_){c.reject(_),Qn()}var h=A;if(o){if((l.f&Pt)!==0)var u=Xi();if(r.b.is_rendered())h.async_deriveds.get(l)?.reject(Bn);else for(const _ of a.values())_.reject(Bn);a.add(c),h.async_deriveds.set(l,c)}const d=(_,v=void 0)=>{u?.(),a.delete(c),v!==Bn&&(h.activate(),v?(s.f|=at,Qt(s,v)):((s.f&at)!==0&&(s.f^=at),Qt(s,_)),h.deactivate())};c.promise.then(d,_=>d(null,_||"unknown"))}),ni(()=>{for(const l of a)l.reject(Bn)}),new Promise(l=>{function c(h){function u(){h===i?l(s):c(i)}h.then(u,u)}c(i)})}function be(e){const t=mn(e);return ds(t),t}function Zi(e){const t=mn(e);return t.equals=ji,t}function Ho(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!es&&Wo()}return t}function Wo(){es=!1;for(const e of er){(e.f&Q)!==0&&z(e,Ue);let t;try{t=On(e)}catch{t=!0}t&&en(e)}er.clear()}function dn(e){$(e,e.v+1)}function ts(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s{if(Tt===s)return a();var l=O,c=Tt;Le(null),pi(s);var h=a();return Le(l),pi(c),h};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&io();var h=n.get(l);return h===void 0?o(()=>{var u=oe(c.value);return n.set(l,u),u}):$(h,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const h=o(()=>oe(Z));n.set(l,h),dn(i)}}else $(c,Z),dn(i);return!0},get(a,l,c){if(l===Ct)return e;var h=n.get(l),u=l in a;if(h===void 0&&(!u||Ht(a,l)?.writable)&&(h=o(()=>{var _=lt(u?a[l]:Z),v=oe(_);return v}),n.set(l,h)),h!==void 0){var d=g(h);return d===Z?void 0:d}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var h=n.get(l);h&&(c.value=g(h))}else if(c===void 0){var u=n.get(l),d=u?.v;if(u!==void 0&&d!==Z)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(a,l){if(l===Ct)return!0;var c=n.get(l),h=c!==void 0&&c.v!==Z||Reflect.has(a,l);if(c!==void 0||M!==null&&(!h||Ht(a,l)?.writable)){c===void 0&&(c=o(()=>{var d=h?lt(a[l]):Z,_=oe(d);return _}),n.set(l,c));var u=g(c);if(u===Z)return!1}return h},set(a,l,c,h){var u=n.get(l),d=l in a;if(r&&l==="length")for(var _=c;_oe(Z)),n.set(_+"",v))}if(u===void 0)(!d||Ht(a,l)?.writable)&&(u=o(()=>oe(void 0)),$(u,lt(c)),n.set(l,u));else{d=u.v!==Z;var b=o(()=>lt(c));$(u,b)}var p=Reflect.getOwnPropertyDescriptor(a,l);if(p?.set&&p.set.call(h,c),!d){if(r&&typeof l=="string"){var m=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=m.v&&$(m,w+1)}dn(i)}return!0},ownKeys(a){g(i);var l=Reflect.ownKeys(a).filter(u=>{var d=n.get(u);return d===void 0||d.v!==Z});for(var[c,h]of n)h.v!==Z&&!(c in a)&&l.push(c);return l},setPrototypeOf(){so()}})}function hi(e){try{if(e!==null&&typeof e=="object"&&Ct in e)return e[Ct]}catch{}return e}function zo(e,t){return Object.is(hi(e),hi(t))}var Hr,ns,rs,is;function Uo(){if(Hr===void 0){Hr=window,ns=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;rs=Ht(t,"firstChild").get,is=Ht(t,"nextSibling").get,ui(e)&&(e[Mr]=void 0,e[Hn]=null,e[Ir]=void 0,e.__e=void 0),ui(n)&&(n[ln]=void 0)}}function $e(e=""){return document.createTextNode(e)}function tr(e){return rs.call(e)}function Tn(e){return is.call(e)}function R(e,t){return tr(e)}function Kt(e,t=!1){{var n=tr(e);return n instanceof Comment&&n.data===""?Tn(n):n}}function N(e,t=1,n=!1){let r=e;for(;t--;)r=Tn(r);return r}function Go(e){e.textContent=""}function ss(){return!1}function Vo(e,t,n){return document.createElementNS(Fi,e,void 0)}let _i=!1;function Yo(){_i||(_i=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[qn]?.()})},{capture:!0}))}function dr(e){var t=O,n=M;Le(null),Ge(null);try{return e()}finally{Le(t),Ge(n)}}function ei(e,t,n,r=n){e.addEventListener(t,()=>dr(n));const i=e[qn];i?e[qn]=()=>{i(),r(!0)}:e[qn]=()=>r(!0),Yo()}function Jo(e){M===null&&(O===null&&to(),eo()),Qe&&Qs()}function Xo(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function et(e,t){var n=M;n!==null&&(n.f&le)!==0&&(e|=le);var r={ctx:he,deps:null,nodes:null,f:e|te|Me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if((e&Xt)!==0)jt!==null?jt.push(r):Lt.ensure().schedule(r);else if(t!==null){try{en(r)}catch(o){throw de(r),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&tn)===0&&(i=i.first,(e&De)!==0&&(e&Zt)!==0&&i!==null&&(i.f|=Zt))}if(i!==null&&(i.parent=n,n!==null&&Xo(i,n),O!==null&&(O.f&ne)!==0&&(e&dt)===0)){var s=O;(s.effects??(s.effects=[])).push(i)}return r}function ti(){return O!==null&&!Be}function ni(e){const t=et(ur,null);return z(t,Q),t.teardown=e,t}function ri(e){Jo();var t=M.f,n=!O&&(t&je)!==0&&(t&Pt)===0;if(n){var r=he;(r.e??(r.e=[])).push(e)}else return os(e)}function os(e){return et(Xt|Vs,e)}function Zo(e){Lt.ensure();const t=et(dt|tn,e);return(n={})=>new Promise(r=>{n.outro?xt(t,()=>{de(t),r(void 0)}):(de(t),r(void 0))})}function ls(e){return et(Xt,e)}function $o(e){return et(qt|tn,e)}function hr(e,t=0){return et(ur|t,e)}function se(e,t=[],n=[],r=[]){Fo(r,t,n,i=>{et(ur,()=>e(...i.map(g)))})}function ii(e,t=0){var n=et(De|t,e);return n}function Te(e){return et(je|tn,e)}function as(e){var t=e.teardown;if(t!==null){const n=Qe,r=O;vi(!0),Le(null);try{t.call(null)}finally{vi(n),Le(r)}}}function si(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&dr(()=>{i.abort(cr)});var r=n.next;(n.f&dt)!==0?n.parent=null:de(n,t),n=r}}function Qo(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&je)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Gs)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(el(e.nodes.start,e.nodes.end),n=!0),z(e,Or),si(e,t&&!n),bn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();as(e),e.f^=Or,e.f|=Ie;var i=e.parent;i!==null&&i.first!==null&&fs(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function el(e,t){for(;e!==null;){var n=e===t?null:Tn(e);e.remove(),e=n}}function fs(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function xt(e,t,n=!0){var r=[];us(e,r,!0);var i=()=>{n&&de(e),t&&t()},s=r.length;if(s>0){var o=()=>--s||i();for(var a of r)a.out(o)}else i()}function us(e,t,n){if((e.f&le)===0){e.f^=le;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next;if((i.f&dt)===0){var o=(i.f&Zt)!==0||(i.f&je)!==0&&(e.f&De)!==0;us(i,t,o?n:!1)}i=s}}}function oi(e){cs(e,!0)}function cs(e,t){if((e.f&le)!==0){e.f^=le,(e.f&Q)===0&&(z(e,te),Lt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Zt)!==0||(n.f&je)!==0;cs(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const o of s)(o.is_global||t)&&o.in()}}function li(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Tn(n);t.append(n),n=i}}let Gn=!1,Qe=!1;function vi(e){Qe=e}let O=null,Be=!1;function Le(e){O=e}let M=null;function Ge(e){M=e}let Ne=null;function ds(e){O!==null&&(Ne===null?Ne=[e]:Ne.push(e))}let ue=null,ve=0,Se=null;function tl(e){Se=e}let hs=1,pt=0,Tt=pt;function pi(e){Tt=e}function _s(){return++hs}function On(e){var t=e.f;if((t&te)!==0)return!0;if(t&ne&&(e.f&=~Nt),(t&Ue)!==0){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}(t&Me)!==0&&Fe===null&&z(e,Q)}return!1}function vs(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ne!==null&&St.call(Ne,e)))for(var i=0;i{e.ac.abort(cr)}),e.ac=null);try{e.f|=$n;var h=e.fn,u=h();e.f|=Pt;var d=e.deps,_=A?.is_fork;if(ue!==null){var v;if(_||bn(e,ve),d!==null&&ve>0)for(d.length=ve+ue.length,v=0;vn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ft(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ll(e,t,n,r,i){var s={capture:r,passive:i},o=ol(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ni(()=>{t.removeEventListener(e,o,s)})}function ut(e,t,n){(t[gt]??(t[gt]={}))[e]=n}function _r(e){for(var t=0;t{throw p});throw d}}finally{e[gt]=t,delete e.currentTarget,Le(h),Ge(u)}}}const al=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function fl(e){return al?.createHTML(e)??e}function ul(e){var t=Vo("template");return t.innerHTML=fl(e.replaceAll("","")),t.content}function nr(e,t){var n=M;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=(t&go)!==0,r=(t&mo)!==0,i,s=!e.startsWith("");return()=>{i===void 0&&(i=ul(s?e:""+e),n||(i=tr(i)));var o=r||ns?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=tr(o),l=o.lastChild;nr(a,l)}else nr(o,o);return o}}function cl(e=""){{var t=$e(e+"");return nr(t,t),t}}function dl(){var e=document.createDocumentFragment(),t=document.createComment(""),n=$e();return e.append(t,n),nr(t,n),e}function W(e,t){e!==null&&e.before(t)}function ce(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[ln]??(e[ln]=e.nodeValue))&&(e[ln]=n,e.nodeValue=`${n}`)}function ys(e,t){return hl(e,t)}const jn=new Map;function hl(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:o=!0,transformError:a}){Uo();var l=void 0,c=Zo(()=>{var h=n??t.appendChild($e());No(h,{pending:()=>{}},_=>{An({});var v=he;s&&(v.c=s),i&&(r.$$events=i),l=e(_,r)||{},xn()},a);var u=new Set,d=_=>{for(var v=0;v<_.length;v++){var b=_[v];if(!u.has(b)){u.add(b);var p=sl(b);for(const C of[t,document]){var m=jn.get(C);m===void 0&&(m=new Map,jn.set(C,m));var w=m.get(b);w===void 0?(C.addEventListener(b,Kr,{passive:p}),m.set(b,1)):m.set(b,w+1)}}}};return d(fr(bs)),qr.add(d),()=>{for(var _ of u)for(const p of[t,document]){var v=jn.get(p),b=v.get(_);--b==0?(p.removeEventListener(_,Kr),v.delete(_),v.size===0&&jn.delete(p)):v.set(_,b)}qr.delete(d),h!==n&&h.parentNode?.removeChild(h)}});return Wr.set(l,c),l}let Wr=new WeakMap;function vr(e,t){const n=Wr.get(e);return n?(Wr.delete(e),n(t)):Promise.resolve()}var Pe,We,me,kt,Sn,Cn,ar;class _l{constructor(t,n=!0){ae(this,"anchor");S(this,Pe,new Map);S(this,We,new Map);S(this,me,new Map);S(this,kt,new Set);S(this,Sn,!0);S(this,Cn,t=>{if(f(this,Pe).has(t)){var n=f(this,Pe).get(t),r=f(this,We).get(n);if(r)oi(r),f(this,kt).delete(n);else{var i=f(this,me).get(n);i&&(f(this,We).set(n,i.effect),f(this,me).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,o]of f(this,Pe)){if(f(this,Pe).delete(s),s===t)break;const a=f(this,me).get(o);a&&(de(a.effect),f(this,me).delete(o))}for(const[s,o]of f(this,We)){if(s===n||f(this,kt).has(s))continue;const a=()=>{if(Array.from(f(this,Pe).values()).includes(s)){var c=document.createDocumentFragment();li(o,c),c.append($e()),f(this,me).set(s,{effect:o,fragment:c})}else de(o);f(this,kt).delete(s),f(this,We).delete(s)};f(this,Sn)||!r?(f(this,kt).add(s),xt(o,a,!1)):a()}}});S(this,ar,t=>{f(this,Pe).delete(t);const n=Array.from(f(this,Pe).values());for(const[r,i]of f(this,me))n.includes(r)||(de(i.effect),f(this,me).delete(r))});this.anchor=t,E(this,Sn,n)}ensure(t,n){var r=A,i=ss();if(n&&!f(this,We).has(t)&&!f(this,me).has(t))if(i){var s=document.createDocumentFragment(),o=$e();s.append(o),f(this,me).set(t,{effect:Te(()=>n(o)),fragment:s})}else f(this,We).set(t,Te(()=>n(this.anchor)));if(f(this,Pe).set(r,t),i){for(const[a,l]of f(this,We))a===t?r.unskip_effect(l):r.skip_effect(l);for(const[a,l]of f(this,me))a===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(f(this,Cn)),r.ondiscard(f(this,ar))}else f(this,Cn).call(this,r)}}Pe=new WeakMap,We=new WeakMap,me=new WeakMap,kt=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,ar=new WeakMap;function ie(e,t,n=!1){var r=new _l(e),i=n?Zt:0;function s(o,a){r.ensure(o,a)}ii(()=>{var o=!1;t((a,l=0)=>{o=!0,s(l,a)}),o||s(-1,null)},i)}function vl(e,t){return t}function pl(e,t,n){for(var r=[],i=t.length,s,o=t.length,a=0;a{if(s){if(s.pending.delete(u),s.done.add(u),s.pending.size===0){var d=e.outrogroups;zr(e,fr(s.done)),d.delete(s),d.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var c=n,h=c.parentNode;Go(h),h.append(c),e.items.clear()}zr(e,t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function zr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const a of o)r.add(e.items.get(a).e)}for(var i=0;i{var C=n();return Jr(C)?C:C==null?[]:fr(C)}),d,_=new Map,v=!0;function b(C){(w.effect.f&Ie)===0&&(w.pending.delete(C),w.fallback=h,gl(w,d,o,t,r),h!==null&&(d.length===0?(h.f&ze)===0?oi(h):(h.f^=ze,fn(h,null,o)):xt(h,()=>{h=null})))}function p(C){w.pending.delete(C)}var m=ii(()=>{d=g(u);for(var C=d.length,T=new Set,H=A,ee=ss(),Y=0;Ys(o)):(h=Te(()=>s(mi??(mi=$e()))),h.f|=ze)),C>T.size&&$s(),!v)if(_.set(H,T),ee){for(const[_t,He]of a)T.has(_t)||H.skip_effect(He.e);H.oncommit(b),H.ondiscard(p)}else b(H);g(u)}),w={effect:m,items:a,pending:_,outrogroups:null,fallback:h};v=!1}function on(e){for(;e!==null&&(e.f&je)===0;)e=e.next;return e}function gl(e,t,n,r,i){var s=(r&uo)!==0,o=t.length,a=e.items,l=on(e.effect.first),c,h=null,u,d=[],_=[],v,b,p,m;if(s)for(m=0;m0){var we=(r&Di)!==0&&o===0?n:null;if(s){for(m=0;m<_e;m+=1)Y[m].nodes?.a?.measure();for(m=0;m<_e;m+=1)Y[m].nodes?.a?.fix()}pl(e,Y,we)}}s&&ft(()=>{if(u!==void 0)for(p of u)p.nodes?.a?.apply()})}function ml(e,t,n,r,i,s,o,a){var l=(o&ao)!==0?(o&co)===0?Ko(n,!1,!1):Rt(n):null,c=(o&fo)!==0?Rt(i):null;return{v:l,i:c,e:Te(()=>(s(t,l??n,c??i,a),()=>{e.delete(r)}))}}function fn(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,s=t&&(t.f&ze)===0?t.nodes.start:n;r!==null;){var o=Tn(r);if(s.before(r),r===i)return;r=o}}function nt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const bi=[...` -\r\f \v\uFEFF`];function bl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+s;(o===0||bi.includes(r[o-1]))&&(a===r.length||bi.includes(r[a]))?r=(o===0?"":r.substring(0,o))+r.substring(a+1):o=a}}return r===""?null:r}function yl(e,t){return e==null?null:String(e)}function ai(e,t,n,r,i,s){var o=e[Mr];if(o!==n||o===void 0){var a=bl(n,r,s);a==null?e.removeAttribute("class"):e.className=a,e[Mr]=n}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function wl(e,t,n,r){var i=e[Ir];if(i!==t){var s=yl(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e[Ir]=t}return r}function Es(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Jr(t))return yo();for(var r of e.options)r.selected=t.includes(hn(r));return}for(r of e.options){var i=hn(r);if(zo(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function El(e){var t=new MutationObserver(()=>{Es(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ni(()=>{t.disconnect()})}function kl(e,t,n=t){var r=new WeakSet,i=!0;ei(e,"change",s=>{var o=s?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(o),hn);else{var l=e.querySelector(o)??e.querySelector("option:not([disabled])");a=l&&hn(l)}n(a),e.__value=a,A!==null&&r.add(A)}),ls(()=>{var s=t();if(e===document.activeElement){var o=A;if(r.has(o))return}if(Es(e,s,i),i&&s===void 0){var a=e.querySelector(":checked");a!==null&&(s=hn(a),n(s))}e.__value=s,i=!1}),El(e)}function hn(e){return"__value"in e?e.__value:e.value}const Sl=Symbol("is custom element"),Cl=Symbol("is html");function Ot(e,t,n,r){var i=Al(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[Js]=n),n==null?e.removeAttribute(t):typeof n!="string"&&xl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Al(e){return e[Hn]??(e[Hn]={[Sl]:e.nodeName.includes("-"),[Cl]:e.namespaceURI===Fi})}var yi=new Map;function xl(e){var t=e.getAttribute("is")||e.nodeName,n=yi.get(t);if(n)return n;yi.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=qs(i);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);i=Li(i)}return n}function wi(e,t,n=t){var r=new WeakSet;ei(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=kr(e)?Sr(s):s,n(s),A!==null&&r.add(A),await rl(),s!==(s=t())){var o=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=s??"",a!==null){var c=e.value.length;o===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(a,c))}}}),nn(t)==null&&e.value&&(n(kr(e)?Sr(e.value):e.value),A!==null&&r.add(A)),hr(()=>{var i=t();if(e===document.activeElement){var s=A;if(r.has(s))return}kr(e)&&i===Sr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function ks(e,t,n=t){ei(e,"change",r=>{var i=r?e.defaultChecked:e.checked;n(i)}),nn(t)==null&&n(e.checked),hr(()=>{var r=t();e.checked=!!r})}function kr(e){var t=e.type;return t==="number"||t==="range"}function Sr(e){return e===""?null:+e}function Cr(e,t){return e===t||e?.[Ct]===t}function Tl(e={},t,n,r){var i=he.r,s=M;return ls(()=>{var o,a;return hr(()=>{o=a,a=[],nn(()=>{Cr(n(...a),e)||(t(e,...a),o&&Cr(n(...o),e)&&t(null,...o))})}),()=>{let l=s;for(;l!==i&&l.parent!==null&&l.parent.f⩔)l=l.parent;const c=()=>{a&&Cr(n(...a),e)&&t(null,...a)},h=l.teardown;l.teardown=()=>{c(),h?.()}}}),e}function _n(e,t,n,r){var i=!0,s=(n&vo)!==0,o=(n&po)!==0,a=r,l=!0,c=void 0,h=()=>o&&i?(c??(c=mn(r)),g(c)):(l&&(l=!1,a=o?nn(r):r),a);let u;if(s){var d=Ct in e||Ys in e;u=Ht(e,t)?.set??(d&&t in e?T=>e[t]=T:void 0)}var _,v=!1;s?[_,v]=Co(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),u&&(ro(),u(_)));var b;if(b=()=>{var T=e[t];return T===void 0?h():(l=!0,T)},(n&_o)===0)return b;if(u){var p=e.$$legacy;return(function(T,H){return arguments.length>0?((!H||p||v)&&u(H?b():T),T):b()})}var m=!1,w=((n&ho)!==0?mn:Zi)(()=>(m=!1,b()));s&&g(w);var C=M;return(function(T,H){if(arguments.length>0){const ee=H?g(w):s?lt(T):T;return $(w,ee),m=!0,a!==void 0&&(a=ee),T}return Qe&&m||(C.f&Ie)!==0?w.v:g(w)})}function Ol(e){he===null&&Xs(),ri(()=>{const t=nn(e);if(typeof t=="function")return t})}const Ss="[data-v-app]",Ml=["header","content","footer"];let Oe=null,Re=null;function Il(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Nl(){if(typeof document>"u")return!1;const t=document.querySelector(Ss)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Oe=null,!1):(Oe=t,Re=null,!0)}function Ll(){if(Re!==null)return Re;const e=typeof document<"u"?document.querySelector(Ss)?.__vue_app__:null;if(!e)return Re=!1,!1;const t=e.config?.globalProperties??{};if(typeof Oe?.$history?.pause=="function"&&typeof Oe?.$history?.resume=="function")return Re={pause:()=>Oe.$history.pause(),resume:()=>Oe.$history.resume()},Re;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(Re={pause:()=>n.history.pause(),resume:()=>n.history.resume()},Re):typeof t.pauseHistory=="function"&&typeof t.resumeHistory=="function"?(Re={pause:()=>t.pauseHistory(),resume:()=>t.resumeHistory()},Re):(Re=!1,!1)}function Rl(e){const t=Ll();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function ct(e){if(!Oe||!e)return null;for(const t of Ml){const n=Oe[t];if(!Array.isArray(n))continue;const r=n.find(i=>i&&i.id===e);if(r)return r}return null}function Pl(e){const t=ct(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Cs(t,1,n),n}function Cs(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const i=ct(r);i&&(n.push({id:i.id,depth:t,label:i.label,name:i.name,settings:i.settings}),Cs(i,t+1,n))}}function As(){return Oe?Oe.globalClasses:[]}function Ar(e,t){if(!Oe)throw new Error("rebemer: not ready");const n=Oe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const i=new Set(n.map(o=>o?.id).filter(Boolean)),s=Il(i);return n.push({id:s,name:e,settings:t||{}}),s}function Ei(e,t){const n=ct(e);if(!n)return;n.settings||(n.settings={});const r=Array.isArray(t)?t:[];Array.isArray(n.settings._cssGlobalClasses)?n.settings._cssGlobalClasses.splice(0,n.settings._cssGlobalClasses.length,...r):n.settings._cssGlobalClasses=[...r]}function ki(e,t){const n=ct(e);n&&(n.label=t)}const rr="slashed-rebemer-host",Dl="slashed-class-hint",xs=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],Fl=3;function Bl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n[0]==="."&&(n=n.slice(1)),!n.startsWith("sf-")&&!n.startsWith("is-"))||!Object.prototype.hasOwnProperty.call(t,n))return null;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let Ur=!1,ir={},Ze=null,vn=null,ye=null;function jl(){if(Ze&&Ze.isConnected)return Ze;let e=document.getElementById(rr);e||(e=document.createElement("div"),e.id=rr,document.body.appendChild(e));const t=document.createElement("div");return t.id=Dl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

    ',e.appendChild(t),Ze=t,t}function Ts(e){let t=e;for(let n=0;t&&na&&n.top-s-i>=0&&(l=n.top-s-i);let c=n.left;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(l)}px`,e.style.left=`${Math.round(c)}px`}function Os(e,t){const n=jl();n.querySelector(".rebemer-class-hint__name").textContent=`.${t.name}`;const r=n.querySelector(".rebemer-class-hint__cat");r.textContent=t.category||"",r.hidden=!t.category,n.querySelector(".rebemer-class-hint__desc").textContent=t.description,n.hidden=!1,Hl(n,e),ye=e}function ht(){Ze&&(Ze.hidden=!0),ye=null}function ql(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${rr}`))return;if(!t.closest(xs.join(","))){ye&&ht();return}const n=Ts(t);if(!n){ye&&ht();return}n.el!==ye&&Os(n.el,n.hint)}function Kl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Wl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${rr}`))return;if(!t.closest(xs.join(","))){ye&&ht();return}const n=Ts(t);if(!n){ye&&ht();return}n.el!==ye&&Os(n.el,n.hint)}function zl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Ul(e){e.key==="Escape"&&ht()}function Gl(e,t,n={}){if(Vn(),Ur=!!e,ir=t&&typeof t=="object"?t:{},!Ur||Object.keys(ir).length===0)return;vn=new AbortController;const{signal:r}=vn,i={passive:!0,signal:r};document.addEventListener("mouseover",ql,i),document.addEventListener("mouseout",Kl,i),document.addEventListener("focusin",Wl,i),document.addEventListener("focusout",zl,i),document.addEventListener("keydown",Ul,i),window.addEventListener("scroll",ht,{capture:!0,passive:!0,signal:r}),n.signal&&(n.signal.aborted?Vn():n.signal.addEventListener("abort",Vn,{once:!0}))}function Vn(){vn&&(vn.abort(),vn=null),Ze&&(Ze.remove(),Ze=null),ye=null,Ur=!1,ir={}}const Vl="li.variable-picker-item",Yn="slashed-var-swatch",Yl=50,Jl=(e,...t)=>console[e]("[slashed-swatches]",...t);function Xl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n.slice(0,2)!=="--"&&(n="--"+n.replace(/^-+/,"")),n.indexOf("--sf-color-")!==0))return null;const r=t[n];return typeof r=="string"&&r?r:null}let Gr=!1,sr={},pn=null,Wt=null,Jn=null;function Zl(e){const t=e.querySelector(":scope > span[title]")||e.querySelector(":scope > span");if(t){const n=t.getAttribute("title");return n&&n.trim()?n.trim():(t.textContent||"").trim()}return(e.textContent||"").trim()}function $l(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+Yn);r&&r.remove();return}const t=Xl(Zl(e),sr);let n=e.querySelector(":scope > ."+Yn);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=Yn,n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild)),n.dataset.color!==t&&(n.style.setProperty("--slashed-swatch-color",t),n.dataset.color=t)}function Ms(){try{const e=document.querySelectorAll(Vl);for(const t of e)$l(t)}catch(e){Jl("warn","swatch pass failed",e)}}function Ql(){Wt===null&&(Wt=setTimeout(()=>{Wt=null,Ms()},Yl))}function ea(e,t,n={}){Xn(),Gr=!!e,sr=t&&typeof t=="object"?t:{},!(!Gr||Object.keys(sr).length===0)&&(Jn=new AbortController,pn=new MutationObserver(Ql),pn.observe(document.body,{childList:!0,subtree:!0}),Ms(),n.signal&&(n.signal.aborted?Xn():n.signal.addEventListener("abort",Xn,{once:!0})))}function Xn(){Wt!==null&&(clearTimeout(Wt),Wt=null),pn&&(pn.disconnect(),pn=null),Jn&&(Jn.abort(),Jn=null);try{document.querySelectorAll("."+Yn).forEach(e=>e.remove())}catch{}Gr=!1,sr={}}const ta="5";var Ni;typeof window<"u"&&((Ni=window.__svelte??(window.__svelte={})).v??(Ni.v=new Set)).add(ta);var na=V('reBEM');function ra(e,t){An(t,!0);function n(i){i.stopPropagation(),i.preventDefault(),t.onActivate?.(t.elementId)}var r=na();se(()=>{Ot(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),Ot(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),ut("click",r,n),ut("keydown",r,i=>(i.key==="Enter"||i.key===" ")&&n(i)),W(e,r),xn()}_r(["click","keydown"]);function Mt(e){return e?String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x00-\x7f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}const ia=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,sa=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function oa(e){return e?sa.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:ia.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const pr=new Set(["_padding","_padding_top","_padding_right","_padding_bottom","_padding_left","_margin","_margin_top","_margin_right","_margin_bottom","_margin_left","_width","_widthMin","_widthMax","_minWidth","_maxWidth","_height","_heightMin","_heightMax","_minHeight","_maxHeight","_aspectRatio","_overflow","_overflowX","_overflowY","_color","_background","_backgroundColor","_backgroundImage","_backgroundSize","_backgroundPosition","_backgroundRepeat","_backgroundAttachment","_backgroundBlendMode","_typography","_fontFamily","_fontSize","_fontWeight","_fontStyle","_lineHeight","_letterSpacing","_wordSpacing","_textAlign","_textTransform","_textDecoration","_textDecorationColor","_textShadow","_textIndent","_whiteSpace","_listStyleType","_listStylePosition","_border","_borderRadius","_borderColor","_borderStyle","_borderWidth","_outline","_outlineColor","_outlineStyle","_outlineWidth","_outlineOffset","_boxShadow","_filter","_backdropFilter","_opacity","_blendMode","_transform","_transformOrigin","_transition","_animation","_display","_flexDirection","_flexWrap","_flexGrow","_flexShrink","_flexBasis","_alignItems","_alignSelf","_alignContent","_justifyContent","_justifyItems","_justifySelf","_gap","_rowGap","_columnGap","_gridTemplateColumns","_gridTemplateRows","_gridGap","_gridAutoFlow","_gridAutoColumns","_gridAutoRows","_gridColumn","_gridRow","_gridArea","_position","_top","_right","_bottom","_left","_zIndex","_objectFit","_objectPosition","_cursor","_pointerEvents","_userSelect"]);function la(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))pr.has(n)&&t.push(n);return t.sort(),t}const aa=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function fa(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))pr.has(n)||aa.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const ua=new Set(["add","rename","replace","modifier","migrate"]),Si=new Set(["user","label"]);function Is({rootId:e,rows:t,mode:n}){if(!ua.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(a=>a.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};const i=Mt(r.name);if(!i)return{ok:!1,ops:[],error:"Block name is empty."};const s=[];for(const a of t){if(!a.include)continue;const l=a.id===e;let c;if(l)c=i;else{const u=Mt(a.name);if(!u)continue;c=`${i}__${u}`}let h=c;if(n==="modifier"){const u=Mt(a.modifier);if(!u)continue;h=`${c}--${u}`}s.push({row:a,isRoot:l,finalClass:h,suggestedFrom:a.suggestedFrom||"fallback"})}if(s.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const o=ha(s,n);return o.ok?{ok:!0,ops:s}:{ok:!1,ops:[],error:o.error}}function ca({rootId:e,rows:t,mode:n,syncLabels:r}){const i=Is({rootId:e,rows:t,mode:n});if(!i.ok)return{ok:!1,error:i.error};const s=i.ops,o=t.find(u=>u.id===e),a=Mt(o?.name??""),l=As();if(n==="migrate"){const u=da(s,l);if(!u.ok)return u}const c=new Map;for(const u of s){const d=ct(u.row.id);if(!d)continue;const _={classIds:Ci(d.settings).slice(),label:r&&n!=="modifier"?d.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const b of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(d.settings||{},b)&&(v[b]=JSON.parse(JSON.stringify(d.settings[b])));_.migrateKeys=v}c.set(u.row.id,_)}let h=0;try{Rl(()=>{for(const u of s){const d=ct(u.row.id);if(!d)continue;const _=Ci(d.settings);let v={};if(n==="rename"&&_.length>0){const m=l.find(w=>w&&w.id===_[0]);m&&m.settings&&(v=JSON.parse(JSON.stringify(m.settings)))}else n==="migrate"&&(v=Ns(d.settings,u.row.migrateKeys));if(n==="migrate"){const m=l.find(w=>w&&w.name===u.finalClass);if(m){(!m.settings||typeof m.settings!="object")&&(m.settings={});for(const[w,C]of Object.entries(v))Object.prototype.hasOwnProperty.call(m.settings,w)||(m.settings[w]=C)}}const b=Ar(u.finalClass,v);let p;switch(n){case"add":case"migrate":p=_.includes(b)?_:[..._,b];break;case"modifier":{const m=u.finalClass.indexOf("--"),w=m>=0?u.finalClass.slice(0,m):null;let C=[..._];if(w){const T=Ar(w,{});C.includes(T)||C.push(T)}p=C.includes(b)?C:[...C,b];break}case"rename":{const m=[b],w=_.length>0?l.find(C=>C&&C.id===_[0]):null;if(w){const C=w.name+"--";for(let T=1;T<_.length;T++){const H=l.find(ee=>ee&&ee.id===_[T]);if(H)if(H.name.startsWith(C)){const ee=H.name.slice(w.name.length),Y=H.settings?JSON.parse(JSON.stringify(H.settings)):{};m.push(Ar(u.finalClass+ee,Y))}else m.push(_[T])}}p=m;break}case"replace":p=[b];break}if(Ei(u.row.id,p),n==="migrate"&&_a(d.settings,u.row.migrateKeys),r&&n!=="modifier"){const m=va(u.finalClass,a);m&&ki(u.row.id,m)}h++}})}catch(u){for(const[_,v]of c)try{if(Ei(_,v.classIds),v.migrateKeys){const b=ct(_);b&&b.settings&&Object.assign(b.settings,v.migrateKeys)}v.label!==null&&ki(_,v.label)}catch{}const d=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",h,"mutation(s), rolled back:",d),{ok:!1,error:`Operation failed and was rolled back: ${d}`}}return h===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:h}}function da(e,t){for(const n of e){const r=t.find(l=>l&&l.name===n.finalClass);if(!r)continue;const i=ct(n.row.id);if(!i)continue;const s=Ns(i.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},a=[];for(const[l,c]of Object.entries(s))Object.prototype.hasOwnProperty.call(o,l)&&JSON.stringify(o[l])!==JSON.stringify(c)&&a.push(l.replace(/^_/,""));if(a.length>0){const l=a.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${l}. Pick a different name or use Add mode.`}}}return{ok:!0}}function ha(e,t){const n=new Map;for(const r of e){const i=n.get(r.finalClass)||[];i.push(r),n.set(r.finalClass,i)}for(const[r,i]of n){if(i.length===1||t==="modifier")continue;const s=i.filter(a=>Si.has(a.suggestedFrom));if(s.length>1)return{ok:!1,error:`"${r}" is used by ${s.length} rows. Edit one to make it unique.`};let o=1;for(const a of i)Si.has(a.suggestedFrom)||(a.finalClass=`${r}-${o++}`,a.suggestedFrom="auto-number")}if(t!=="modifier"){const r=new Map;for(const i of e){const s=r.get(i.finalClass);if(s)return{ok:!1,error:`"${i.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${i.suggestedFrom}). Pick a different name for one of them.`};r.set(i.finalClass,i.suggestedFrom)}}return{ok:!0}}function Ns(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)pr.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function _a(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)pr.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function Ci(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function va(e,t){let n=e;return n===t?Ai(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),Ai(n.replace(/-/g," ")))}function Ai(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const pa=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),Ls=new Set(["section","container","block","div"]);function ga(e,t="item"){return!e||typeof e!="string"||Ls.has(e)?t:pa[e]||t}function xr(e){return typeof e=="string"&&Ls.has(e)}const ma=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function ba(e,t,n){const r=new Set(e.filter(Boolean)),i=(..._)=>_.some(v=>r.has(v)),s=i("button","button-group"),o=i("heading"),a=i("text-basic","text"),l=i("image"),c=i("nav-nested","nav-menu"),h=i("form"),u=i("icon","icon-box"),d=i("list");return h?"form":c?"nav":s&&!o&&!a?"actions":l&&!a&&!o&&!s?"media":o&&!a&&!s?"header":a&&!o&&!s?"body":o&&a?"content":o&&s?"header":u&&!a&&!o?"icon-group":d?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var ya=V('suggested'),wa=V(' '),Ea=V(''),ka=V('

    Enter a modifier name — the base class will be added automatically if absent.

    '),Sa=V('

    This element has no existing classes. Rename will create a new class instead.

    '),Ca=V('

    '),Aa=V(`A class named already exists. +var Bs=Object.defineProperty;var ui=e=>{throw TypeError(e)};var js=(e,t,n)=>t in e?Bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>js(e,typeof t!="symbol"?t+"":t,n),wr=(e,t,n)=>t.has(e)||ui("Cannot "+n);var f=(e,t,n)=>(wr(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?ui("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),E=(e,t,n,r)=>(wr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),N=(e,t,n)=>(wr(e,t,"access private method"),n);var Xr=Array.isArray,qs=Array.prototype.indexOf,St=Array.prototype.includes,ur=Array.from,Hs=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,Ks=Object.getOwnPropertyDescriptors,Ws=Object.prototype,zs=Array.prototype,Ri=Object.getPrototypeOf,ci=Object.isExtensible;const Us=()=>{};function Gs(e){for(var t=0;t{e=r,t=i});return{promise:n,resolve:e,reject:t}}const ne=2,Xt=4,cr=8,Di=1<<24,De=16,je=32,dt=64,Or=128,Me=512,Q=1024,te=2048,Ue=4096,le=8192,Ne=16384,Pt=32768,Mr=1<<25,Zt=65536,$n=1<<17,Vs=1<<18,tn=1<<19,Ys=1<<20,ze=1<<25,It=65536,Qn=1<<21,Ht=1<<22,at=1<<23,Ct=Symbol("$state"),Js=Symbol("legacy props"),Xs=Symbol(""),qn=Symbol("attributes"),Nr=Symbol("class"),Ir=Symbol("style"),ln=Symbol("text"),Hn=Symbol("form reset"),dr=new class extends Error{constructor(){super(...arguments);ae(this,"name","StaleReactionError");ae(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Zs(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function $s(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Qs(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function eo(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function to(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function no(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ro(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function io(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function so(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function oo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function lo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ao(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const fo=1,uo=2,Fi=4,co=8,ho=16,_o=1,vo=4,po=8,go=16,mo=1,bo=2,Z=Symbol("uninitialized"),Bi="http://www.w3.org/1999/xhtml";function yo(){console.warn("https://svelte.dev/e/derived_inert")}function wo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Eo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ji(e){return e===this.v}function ko(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function qi(e){return!ko(e,this.v)}let he=null;function $t(e){he=e}function An(e,t=!1,n){he={p:he,i:!1,c:null,e:null,s:e,x:null,r:M,l:null}}function xn(e){var t=he,n=t.e;if(n!==null){t.e=null;for(var r of n)ls(r)}return t.i=!0,he=t.p,{}}function Hi(){return!0}let vt=[];function Ki(){var e=vt;vt=[],Gs(e)}function ft(e){if(vt.length===0&&!cn){var t=vt;queueMicrotask(()=>{t===vt&&Ki()})}vt.push(e)}function So(){for(;vt.length>0;)Ki()}function Wi(e){var t=M;if(t===null)return O.f|=at,e;if((t.f&Pt)===0&&(t.f&Xt)===0)throw e;ot(e,t)}function ot(e,t){for(;t!==null;){if((t.f&Or)!==0){if((t.f&Pt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Co=-7169;function z(e,t){e.f=e.f&Co|t}function Zr(e){(e.f&Me)!==0||e.deps===null?z(e,Q):z(e,Ue)}function zi(e){if(e!==null)for(const t of e)(t.f&ne)===0||(t.f&It)===0||(t.f^=It,zi(t.deps))}function Ui(e,t,n){(e.f&te)!==0?t.add(e):(e.f&Ue)!==0&&n.add(e),zi(e.deps),z(e,Q)}let Fn=!1;function Ao(e){var t=Fn;try{return Fn=!1,[e(),Fn]}finally{Fn=t}}let Er=null,Ft=null,A=null,Lr=null,Fe=null,Rr=null,cn=!1,kr=!1,jt=null,Kn=null;var di=0;let xo=1;var zt,rt,mt,Ut,Gt,bt,Vt,Ye,yn,pe,wn,it,He,Ke,Yt,yt,L,Pr,an,Dr,Gi,Vi,Wn,To,Fr,Bt;const lr=class lr{constructor(){S(this,L);ae(this,"id",xo++);S(this,zt,!1);ae(this,"linked",!0);S(this,rt,null);S(this,mt,null);ae(this,"async_deriveds",new Map);ae(this,"current",new Map);ae(this,"previous",new Map);ae(this,"unblocked",new Set);S(this,Ut,new Set);S(this,Gt,new Set);S(this,bt,new Set);S(this,Vt,0);S(this,Ye,new Map);S(this,yn,null);S(this,pe,[]);S(this,wn,[]);S(this,it,new Set);S(this,He,new Set);S(this,Ke,new Map);S(this,Yt,new Set);ae(this,"is_fork",!1);S(this,yt,!1)}skip_effect(t){f(this,Ke).has(t)||f(this,Ke).set(t,{d:[],m:[]}),f(this,Yt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=f(this,Ke).get(t);if(r){f(this,Ke).delete(t);for(var i of r.d)z(i,te),n(i);for(i of r.m)z(i,Ue),n(i)}f(this,Yt).add(t)}capture(t,n,r=!1){t.v!==Z&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&at)===0&&(this.current.set(t,[n,r]),Fe?.set(t,n)),this.is_fork||(t.v=n)}activate(){A=this}deactivate(){A=null,Fe=null}flush(){try{kr=!0,A=this,N(this,L,an).call(this)}finally{di=0,Rr=null,jt=null,Kn=null,kr=!1,A=null,Fe=null,At.clear()}}discard(){for(const t of f(this,Gt))t(this);f(this,Gt).clear(),f(this,bt).clear(),N(this,L,Bt).call(this)}register_created_effect(t){f(this,wn).push(t)}increment(t,n){if(E(this,Vt,f(this,Vt)+1),t){let r=f(this,Ye).get(n)??0;f(this,Ye).set(n,r+1)}}decrement(t,n){if(E(this,Vt,f(this,Vt)-1),t){let r=f(this,Ye).get(n)??0;r===1?f(this,Ye).delete(n):f(this,Ye).set(n,r-1)}f(this,yt)||(E(this,yt,!0),ft(()=>{E(this,yt,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)f(this,it).add(r);for(const r of n)f(this,He).add(r);t.clear(),n.clear()}oncommit(t){f(this,Ut).add(t)}ondiscard(t){f(this,Gt).add(t)}on_fork_commit(t){f(this,bt).add(t)}run_fork_commit_callbacks(){for(const t of f(this,bt))t(this);f(this,bt).clear()}settled(){return(f(this,yn)??E(this,yn,Pi())).promise}static ensure(){var t;if(A===null){const n=A=new lr;N(t=n,L,Fr).call(t),!kr&&!cn&&ft(()=>{f(n,zt)||n.flush()})}return A}apply(){{Fe=null;return}}schedule(t){if(Rr=t,t.b?.is_pending&&(t.f&(Xt|cr|Di))!==0&&(t.f&Pt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(jt!==null&&n===M&&(O===null||(O.f&ne)===0))return;if((r&(dt|je))!==0){if((r&Q)===0)return;n.f^=Q}}f(this,pe).push(n)}};zt=new WeakMap,rt=new WeakMap,mt=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,bt=new WeakMap,Vt=new WeakMap,Ye=new WeakMap,yn=new WeakMap,pe=new WeakMap,wn=new WeakMap,it=new WeakMap,He=new WeakMap,Ke=new WeakMap,Yt=new WeakMap,yt=new WeakMap,L=new WeakSet,Pr=function(){if(this.is_fork)return!0;for(const r of f(this,Ye).keys()){for(var t=r,n=!1;t.parent!==null;){if(f(this,Ke).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},an=function(){var l,c,h;if(E(this,zt,!0),di++>1e3&&(N(this,L,Bt).call(this),Mo()),!N(this,L,Pr).call(this)){for(const u of f(this,it))f(this,He).delete(u),z(u,te),this.schedule(u);for(const u of f(this,He))z(u,Ue),this.schedule(u)}const t=f(this,pe);E(this,pe,[]),this.apply();var n=jt=[],r=[],i=Kn=[];for(const u of t)try{N(this,L,Dr).call(this,u,n,r)}catch(d){throw Xi(u),d}if(A=null,i.length>0){var s=lr.ensure();for(const u of i)s.schedule(u)}if(jt=null,Kn=null,N(this,L,Pr).call(this)){N(this,L,Wn).call(this,r),N(this,L,Wn).call(this,n);for(const[u,d]of f(this,Ke))Ji(u,d);i.length>0&&N(l=A,L,an).call(l);return}const o=N(this,L,Gi).call(this);if(o){N(c=o,L,Vi).call(c,this);return}f(this,it).clear(),f(this,He).clear();for(const u of f(this,Ut))u(this);f(this,Ut).clear(),Lr=this,hi(r),hi(n),Lr=null,f(this,yn)?.resolve();var a=A;if(this.linked&&f(this,Vt)===0&&N(this,L,Bt).call(this),f(this,pe).length>0){a===null&&(a=this,N(this,L,Fr).call(this));const u=a;f(u,pe).push(...f(this,pe).filter(d=>!f(u,pe).includes(d)))}a!==null&&N(h=a,L,an).call(h)},Dr=function(t,n,r){t.f^=Q;for(var i=t.first;i!==null;){var s=i.f,o=(s&(je|dt))!==0,a=o&&(s&Q)!==0,l=a||(s&le)!==0||f(this,Ke).has(i);if(!l&&i.fn!==null){o?i.f^=Q:(s&Xt)!==0?n.push(i):On(i)&&((s&De)!==0&&f(this,He).add(i),en(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var h=i.next;if(h!==null){i=h;break}i=i.parent}}},Gi=function(){for(var t=f(this,rt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=f(t,rt)}return null},Vi=function(t){var r;for(const[i,s]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,s);for(const[i,s]of t.async_deriveds){const o=this.async_deriveds.get(i);o&&s.promise.then(o.resolve)}const n=i=>{var s=i.reactions;if(s!==null)for(const l of s){var o=l.f;if((o&ne)!==0)n(l);else{var a=l;o&(Ht|De)&&!this.async_deriveds.has(a)&&(f(this,He).delete(a),z(a,te),this.schedule(a))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),N(r=t,L,Bt).call(r),A=this,N(this,L,an).call(this)},Wn=function(t){for(var n=0;n!this.current.has(d));if(i.length===0)t&&u.discard();else if(n.length>0){if(t)for(const d of f(this,Yt))u.unskip_effect(d,_=>{var v;(_.f&(De|Ht))!==0?u.schedule(_):N(v=u,L,Wn).call(v,[_])});u.activate();var s=new Set,o=new Map;for(var a of n)Yi(a,i,s,o);o=new Map;var l=[...u.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(l.length>0)for(const d of f(this,wn))(d.f&(Ne|le|$n))===0&&$r(d,l,o)&&((d.f&(Ht|De))!==0?(z(d,te),u.schedule(d)):f(u,it).add(d));if(f(u,pe).length>0&&!f(u,yt)){u.apply();for(var c of f(u,pe))N(h=u,L,Dr).call(h,c,[],[]);E(u,pe,[])}u.deactivate()}}}},Fr=function(){Ft===null?Er=Ft=this:(E(Ft,mt,this),E(this,rt,Ft)),Ft=this},Bt=function(){var t=f(this,rt),n=f(this,mt);t===null?Er=n:E(t,mt,n),n===null?Ft=t:E(n,rt,t),this.linked=!1};let Lt=lr;function Oo(e){var t=cn;cn=!0;try{for(var n;;){if(So(),A===null)return n;A.flush()}}finally{cn=t}}function Mo(){try{ro()}catch(e){ot(e,Rr)}}let Ve=null;function hi(e){var t=e.length;if(t!==0){for(var n=0;n0)){At.clear();for(const i of Ve){if((i.f&(Ne|le))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)Ve.has(o)&&(Ve.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Ne|le))===0&&en(l)}}Ve.clear()}}Ve=null}}function Yi(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&ne)!==0?Yi(i,t,n,r):(s&(Ht|De))!==0&&(s&te)===0&&$r(i,t,r)&&(z(i,te),Qr(i))}}function $r(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(St.call(t,i))return!0;if((i.f&ne)!==0&&$r(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function Qr(e){A.schedule(e)}function Ji(e,t){if(!((e.f&je)!==0&&(e.f&Q)!==0)){(e.f&te)!==0?t.d.push(e):(e.f&Ue)!==0&&t.m.push(e),z(e,Q);for(var n=e.first;n!==null;)Ji(n,t),n=n.next}}function Xi(e){z(e,Q);for(var t=e.first;t!==null;)Xi(t),t=t.next}function No(e){let t=0,n=Rt(0),r;return()=>{ni()&&(g(n),_r(()=>(t===0&&(r=nn(()=>e(()=>dn(n)))),t+=1,()=>{ft(()=>{t-=1,t===0&&(r?.(),r=void 0,dn(n))})})))}}var Io=Zt|tn;function Lo(e,t,n,r){new Ro(e,t,n,r)}var Ce,Jr,Ae,wt,fe,xe,re,ge,Je,Et,st,Jt,En,kn,Xe,ar,U,Po,Do,Fo,Br,zn,Un,jr,qr;class Ro{constructor(t,n,r,i){S(this,U);ae(this,"parent");ae(this,"is_pending",!1);ae(this,"transform_error");S(this,Ce);S(this,Jr,null);S(this,Ae);S(this,wt);S(this,fe);S(this,xe,null);S(this,re,null);S(this,ge,null);S(this,Je,null);S(this,Et,0);S(this,st,0);S(this,Jt,!1);S(this,En,new Set);S(this,kn,new Set);S(this,Xe,null);S(this,ar,No(()=>(E(this,Xe,Rt(f(this,Et))),()=>{E(this,Xe,null)})));E(this,Ce,t),E(this,Ae,n),E(this,wt,s=>{var o=M;o.b=this,o.f|=Or,r(s)}),this.parent=M.b,this.transform_error=i??this.parent?.transform_error??(s=>s),E(this,fe,si(()=>{N(this,U,Br).call(this)},Io))}defer_effect(t){Ui(t,f(this,En),f(this,kn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!f(this,Ae).pending}update_pending_count(t,n){N(this,U,jr).call(this,t,n),E(this,Et,f(this,Et)+t),!(!f(this,Xe)||f(this,Jt))&&(E(this,Jt,!0),ft(()=>{E(this,Jt,!1),f(this,Xe)&&Qt(f(this,Xe),f(this,Et))}))}get_effect_pending(){return f(this,ar).call(this),g(f(this,Xe))}error(t){if(!f(this,Ae).onerror&&!f(this,Ae).failed)throw t;A?.is_fork?(f(this,xe)&&A.skip_effect(f(this,xe)),f(this,re)&&A.skip_effect(f(this,re)),f(this,ge)&&A.skip_effect(f(this,ge)),A.on_fork_commit(()=>{N(this,U,qr).call(this,t)})):N(this,U,qr).call(this,t)}}Ce=new WeakMap,Jr=new WeakMap,Ae=new WeakMap,wt=new WeakMap,fe=new WeakMap,xe=new WeakMap,re=new WeakMap,ge=new WeakMap,Je=new WeakMap,Et=new WeakMap,st=new WeakMap,Jt=new WeakMap,En=new WeakMap,kn=new WeakMap,Xe=new WeakMap,ar=new WeakMap,U=new WeakSet,Po=function(){try{E(this,xe,Te(()=>f(this,wt).call(this,f(this,Ce))))}catch(t){this.error(t)}},Do=function(t){const n=f(this,Ae).failed;n&&E(this,ge,Te(()=>{n(f(this,Ce),()=>t,()=>()=>{})}))},Fo=function(){const t=f(this,Ae).pending;t&&(this.is_pending=!0,E(this,re,Te(()=>t(f(this,Ce)))),ft(()=>{var n=E(this,Je,document.createDocumentFragment()),r=$e();n.append(r),E(this,xe,N(this,U,Un).call(this,()=>Te(()=>f(this,wt).call(this,r)))),f(this,st)===0&&(f(this,Ce).before(n),E(this,Je,null),xt(f(this,re),()=>{E(this,re,null)}),N(this,U,zn).call(this,A))}))},Br=function(){try{if(this.is_pending=this.has_pending_snippet(),E(this,st,0),E(this,Et,0),E(this,xe,Te(()=>{f(this,wt).call(this,f(this,Ce))})),f(this,st)>0){var t=E(this,Je,document.createDocumentFragment());ai(f(this,xe),t);const n=f(this,Ae).pending;E(this,re,Te(()=>n(f(this,Ce))))}else N(this,U,zn).call(this,A)}catch(n){this.error(n)}},zn=function(t){this.is_pending=!1,t.transfer_effects(f(this,En),f(this,kn))},Un=function(t){var n=M,r=O,i=he;Ge(f(this,fe)),Le(f(this,fe)),$t(f(this,fe).ctx);try{return Lt.ensure(),t()}catch(s){return Wi(s),null}finally{Ge(n),Le(r),$t(i)}},jr=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&N(r=this.parent,U,jr).call(r,t,n);return}E(this,st,f(this,st)+t),f(this,st)===0&&(N(this,U,zn).call(this,n),f(this,re)&&xt(f(this,re),()=>{E(this,re,null)}),f(this,Je)&&(f(this,Ce).before(f(this,Je)),E(this,Je,null)))},qr=function(t){f(this,xe)&&(de(f(this,xe)),E(this,xe,null)),f(this,re)&&(de(f(this,re)),E(this,re,null)),f(this,ge)&&(de(f(this,ge)),E(this,ge,null));var n=f(this,Ae).onerror;let r=f(this,Ae).failed;var i=!1,s=!1;const o=()=>{if(i){Eo();return}i=!0,s&&ao(),f(this,ge)!==null&&xt(f(this,ge),()=>{E(this,ge,null)}),N(this,U,Un).call(this,()=>{N(this,U,Br).call(this)})},a=l=>{try{s=!0,n?.(l,o),s=!1}catch(c){ot(c,f(this,fe)&&f(this,fe).parent)}r&&E(this,ge,N(this,U,Un).call(this,()=>{try{return Te(()=>{var c=M;c.b=this,c.f|=Or,r(f(this,Ce),()=>l,()=>o)})}catch(c){return ot(c,f(this,fe).parent),null}}))};ft(()=>{var l;try{l=this.transform_error(t)}catch(c){ot(c,f(this,fe)&&f(this,fe).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>ot(c,f(this,fe)&&f(this,fe).parent)):a(l)})};function Bo(e,t,n,r){const i=mn;var s=e.filter(d=>!d.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var o=M,a=jo(),l=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function c(d){if((o.f&Ne)===0){a();try{r(d)}catch(_){ot(_,o)}er()}}var h=Zi();if(n.length===0){l.then(()=>c(t.map(i))).finally(h);return}function u(){Promise.all(n.map(d=>qo(d))).then(d=>c([...t.map(i),...d])).catch(d=>ot(d,o)).finally(h)}l?l.then(()=>{a(),u(),er()}):u()}function jo(){var e=M,t=O,n=he,r=A;return function(s=!0){Ge(e),Le(t),$t(n),s&&(e.f&Ne)===0&&(r?.activate(),r?.apply())}}function er(e=!0){Ge(null),Le(null),$t(null),e&&A?.deactivate()}function Zi(){var e=M,t=e.b,n=A,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),()=>{t.update_pending_count(-1,n),n.decrement(r,e)}}function mn(e){var t=ne|te;return M!==null&&(M.f|=tn),{ctx:he,deps:null,effects:null,equals:ji,f:t,fn:e,reactions:null,rv:0,v:Z,wv:0,parent:M,ac:null}}const Bn=Symbol("obsolete");function qo(e,t,n){let r=M;r===null&&$s();var i=void 0,s=Rt(Z),o=!O,a=new Set;return Qo(()=>{var l=M,c=Pi();i=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==dr&&c.reject(_)}).finally(er)}catch(_){c.reject(_),er()}var h=A;if(o){if((l.f&Pt)!==0)var u=Zi();if(r.b.is_rendered())h.async_deriveds.get(l)?.reject(Bn);else for(const _ of a.values())_.reject(Bn);a.add(c),h.async_deriveds.set(l,c)}const d=(_,v=void 0)=>{u?.(),a.delete(c),v!==Bn&&(h.activate(),v?(s.f|=at,Qt(s,v)):((s.f&at)!==0&&(s.f^=at),Qt(s,_)),h.deactivate())};c.promise.then(d,_=>d(null,_||"unknown"))}),ri(()=>{for(const l of a)l.reject(Bn)}),new Promise(l=>{function c(h){function u(){h===i?l(s):c(i)}h.then(u,u)}c(i)})}function be(e){const t=mn(e);return hs(t),t}function $i(e){const t=mn(e);return t.equals=qi,t}function Ho(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!ts&&zo()}return t}function zo(){ts=!1;for(const e of tr){(e.f&Q)!==0&&z(e,Ue);let t;try{t=On(e)}catch{t=!0}t&&en(e)}tr.clear()}function dn(e){$(e,e.v+1)}function ns(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s{if(Tt===s)return a();var l=O,c=Tt;Le(null),gi(s);var h=a();return Le(l),gi(c),h};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&so();var h=n.get(l);return h===void 0?o(()=>{var u=oe(c.value);return n.set(l,u),u}):$(h,c.value,!0),!0},deleteProperty(a,l){var c=n.get(l);if(c===void 0){if(l in a){const h=o(()=>oe(Z));n.set(l,h),dn(i)}}else $(c,Z),dn(i);return!0},get(a,l,c){if(l===Ct)return e;var h=n.get(l),u=l in a;if(h===void 0&&(!u||qt(a,l)?.writable)&&(h=o(()=>{var _=lt(u?a[l]:Z),v=oe(_);return v}),n.set(l,h)),h!==void 0){var d=g(h);return d===Z?void 0:d}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var h=n.get(l);h&&(c.value=g(h))}else if(c===void 0){var u=n.get(l),d=u?.v;if(u!==void 0&&d!==Z)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(a,l){if(l===Ct)return!0;var c=n.get(l),h=c!==void 0&&c.v!==Z||Reflect.has(a,l);if(c!==void 0||M!==null&&(!h||qt(a,l)?.writable)){c===void 0&&(c=o(()=>{var d=h?lt(a[l]):Z,_=oe(d);return _}),n.set(l,c));var u=g(c);if(u===Z)return!1}return h},set(a,l,c,h){var u=n.get(l),d=l in a;if(r&&l==="length")for(var _=c;_oe(Z)),n.set(_+"",v))}if(u===void 0)(!d||qt(a,l)?.writable)&&(u=o(()=>oe(void 0)),$(u,lt(c)),n.set(l,u));else{d=u.v!==Z;var b=o(()=>lt(c));$(u,b)}var p=Reflect.getOwnPropertyDescriptor(a,l);if(p?.set&&p.set.call(h,c),!d){if(r&&typeof l=="string"){var m=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=m.v&&$(m,w+1)}dn(i)}return!0},ownKeys(a){g(i);var l=Reflect.ownKeys(a).filter(u=>{var d=n.get(u);return d===void 0||d.v!==Z});for(var[c,h]of n)h.v!==Z&&!(c in a)&&l.push(c);return l},setPrototypeOf(){oo()}})}function _i(e){try{if(e!==null&&typeof e=="object"&&Ct in e)return e[Ct]}catch{}return e}function Uo(e,t){return Object.is(_i(e),_i(t))}var Hr,rs,is,ss;function Go(){if(Hr===void 0){Hr=window,rs=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;is=qt(t,"firstChild").get,ss=qt(t,"nextSibling").get,ci(e)&&(e[Nr]=void 0,e[qn]=null,e[Ir]=void 0,e.__e=void 0),ci(n)&&(n[ln]=void 0)}}function $e(e=""){return document.createTextNode(e)}function nr(e){return is.call(e)}function Tn(e){return ss.call(e)}function R(e,t){return nr(e)}function Kt(e,t=!1){{var n=nr(e);return n instanceof Comment&&n.data===""?Tn(n):n}}function I(e,t=1,n=!1){let r=e;for(;t--;)r=Tn(r);return r}function Vo(e){e.textContent=""}function os(){return!1}function Yo(e,t,n){return document.createElementNS(Bi,e,void 0)}let vi=!1;function Jo(){vi||(vi=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Hn]?.()})},{capture:!0}))}function hr(e){var t=O,n=M;Le(null),Ge(null);try{return e()}finally{Le(t),Ge(n)}}function ti(e,t,n,r=n){e.addEventListener(t,()=>hr(n));const i=e[Hn];i?e[Hn]=()=>{i(),r(!0)}:e[Hn]=()=>r(!0),Jo()}function Xo(e){M===null&&(O===null&&no(),to()),Qe&&eo()}function Zo(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function et(e,t){var n=M;n!==null&&(n.f&le)!==0&&(e|=le);var r={ctx:he,deps:null,nodes:null,f:e|te|Me,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if((e&Xt)!==0)jt!==null?jt.push(r):Lt.ensure().schedule(r);else if(t!==null){try{en(r)}catch(o){throw de(r),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&tn)===0&&(i=i.first,(e&De)!==0&&(e&Zt)!==0&&i!==null&&(i.f|=Zt))}if(i!==null&&(i.parent=n,n!==null&&Zo(i,n),O!==null&&(O.f&ne)!==0&&(e&dt)===0)){var s=O;(s.effects??(s.effects=[])).push(i)}return r}function ni(){return O!==null&&!Be}function ri(e){const t=et(cr,null);return z(t,Q),t.teardown=e,t}function ii(e){Xo();var t=M.f,n=!O&&(t&je)!==0&&(t&Pt)===0;if(n){var r=he;(r.e??(r.e=[])).push(e)}else return ls(e)}function ls(e){return et(Xt|Ys,e)}function $o(e){Lt.ensure();const t=et(dt|tn,e);return(n={})=>new Promise(r=>{n.outro?xt(t,()=>{de(t),r(void 0)}):(de(t),r(void 0))})}function as(e){return et(Xt,e)}function Qo(e){return et(Ht|tn,e)}function _r(e,t=0){return et(cr|t,e)}function se(e,t=[],n=[],r=[]){Bo(r,t,n,i=>{et(cr,()=>e(...i.map(g)))})}function si(e,t=0){var n=et(De|t,e);return n}function Te(e){return et(je|tn,e)}function fs(e){var t=e.teardown;if(t!==null){const n=Qe,r=O;pi(!0),Le(null);try{t.call(null)}finally{pi(n),Le(r)}}}function oi(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&hr(()=>{i.abort(dr)});var r=n.next;(n.f&dt)!==0?n.parent=null:de(n,t),n=r}}function el(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&je)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Vs)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(tl(e.nodes.start,e.nodes.end),n=!0),z(e,Mr),oi(e,t&&!n),bn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();fs(e),e.f^=Mr,e.f|=Ne;var i=e.parent;i!==null&&i.first!==null&&us(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function tl(e,t){for(;e!==null;){var n=e===t?null:Tn(e);e.remove(),e=n}}function us(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function xt(e,t,n=!0){var r=[];cs(e,r,!0);var i=()=>{n&&de(e),t&&t()},s=r.length;if(s>0){var o=()=>--s||i();for(var a of r)a.out(o)}else i()}function cs(e,t,n){if((e.f&le)===0){e.f^=le;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next;if((i.f&dt)===0){var o=(i.f&Zt)!==0||(i.f&je)!==0&&(e.f&De)!==0;cs(i,t,o?n:!1)}i=s}}}function li(e){ds(e,!0)}function ds(e,t){if((e.f&le)!==0){e.f^=le,(e.f&Q)===0&&(z(e,te),Lt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Zt)!==0||(n.f&je)!==0;ds(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const o of s)(o.is_global||t)&&o.in()}}function ai(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Tn(n);t.append(n),n=i}}let Gn=!1,Qe=!1;function pi(e){Qe=e}let O=null,Be=!1;function Le(e){O=e}let M=null;function Ge(e){M=e}let Ie=null;function hs(e){O!==null&&(Ie===null?Ie=[e]:Ie.push(e))}let ue=null,ve=0,Se=null;function nl(e){Se=e}let _s=1,pt=0,Tt=pt;function gi(e){Tt=e}function vs(){return++_s}function On(e){var t=e.f;if((t&te)!==0)return!0;if(t&ne&&(e.f&=~It),(t&Ue)!==0){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}(t&Me)!==0&&Fe===null&&z(e,Q)}return!1}function ps(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ie!==null&&St.call(Ie,e)))for(var i=0;i{e.ac.abort(dr)}),e.ac=null);try{e.f|=Qn;var h=e.fn,u=h();e.f|=Pt;var d=e.deps,_=A?.is_fork;if(ue!==null){var v;if(_||bn(e,ve),d!==null&&ve>0)for(d.length=ve+ue.length,v=0;vn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ft(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function al(e,t,n,r,i){var s={capture:r,passive:i},o=ll(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ri(()=>{t.removeEventListener(e,o,s)})}function ut(e,t,n){(t[gt]??(t[gt]={}))[e]=n}function vr(e){for(var t=0;t{throw p});throw d}}finally{e[gt]=t,delete e.currentTarget,Le(h),Ge(u)}}}const fl=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function ul(e){return fl?.createHTML(e)??e}function cl(e){var t=Yo("template");return t.innerHTML=ul(e.replaceAll("","")),t.content}function rr(e,t){var n=M;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=(t&mo)!==0,r=(t&bo)!==0,i,s=!e.startsWith("");return()=>{i===void 0&&(i=cl(s?e:""+e),n||(i=nr(i)));var o=r||rs?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=nr(o),l=o.lastChild;rr(a,l)}else rr(o,o);return o}}function dl(e=""){{var t=$e(e+"");return rr(t,t),t}}function hl(){var e=document.createDocumentFragment(),t=document.createComment(""),n=$e();return e.append(t,n),rr(t,n),e}function W(e,t){e!==null&&e.before(t)}function ce(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[ln]??(e[ln]=e.nodeValue))&&(e[ln]=n,e.nodeValue=`${n}`)}function ws(e,t){return _l(e,t)}const jn=new Map;function _l(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:o=!0,transformError:a}){Go();var l=void 0,c=$o(()=>{var h=n??t.appendChild($e());Lo(h,{pending:()=>{}},_=>{An({});var v=he;s&&(v.c=s),i&&(r.$$events=i),l=e(_,r)||{},xn()},a);var u=new Set,d=_=>{for(var v=0;v<_.length;v++){var b=_[v];if(!u.has(b)){u.add(b);var p=ol(b);for(const C of[t,document]){var m=jn.get(C);m===void 0&&(m=new Map,jn.set(C,m));var w=m.get(b);w===void 0?(C.addEventListener(b,Wr,{passive:p}),m.set(b,1)):m.set(b,w+1)}}}};return d(ur(ys)),Kr.add(d),()=>{for(var _ of u)for(const p of[t,document]){var v=jn.get(p),b=v.get(_);--b==0?(p.removeEventListener(_,Wr),v.delete(_),v.size===0&&jn.delete(p)):v.set(_,b)}Kr.delete(d),h!==n&&h.parentNode?.removeChild(h)}});return zr.set(l,c),l}let zr=new WeakMap;function pr(e,t){const n=zr.get(e);return n?(zr.delete(e),n(t)):Promise.resolve()}var Pe,We,me,kt,Sn,Cn,fr;class vl{constructor(t,n=!0){ae(this,"anchor");S(this,Pe,new Map);S(this,We,new Map);S(this,me,new Map);S(this,kt,new Set);S(this,Sn,!0);S(this,Cn,t=>{if(f(this,Pe).has(t)){var n=f(this,Pe).get(t),r=f(this,We).get(n);if(r)li(r),f(this,kt).delete(n);else{var i=f(this,me).get(n);i&&(f(this,We).set(n,i.effect),f(this,me).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,o]of f(this,Pe)){if(f(this,Pe).delete(s),s===t)break;const a=f(this,me).get(o);a&&(de(a.effect),f(this,me).delete(o))}for(const[s,o]of f(this,We)){if(s===n||f(this,kt).has(s))continue;const a=()=>{if(Array.from(f(this,Pe).values()).includes(s)){var c=document.createDocumentFragment();ai(o,c),c.append($e()),f(this,me).set(s,{effect:o,fragment:c})}else de(o);f(this,kt).delete(s),f(this,We).delete(s)};f(this,Sn)||!r?(f(this,kt).add(s),xt(o,a,!1)):a()}}});S(this,fr,t=>{f(this,Pe).delete(t);const n=Array.from(f(this,Pe).values());for(const[r,i]of f(this,me))n.includes(r)||(de(i.effect),f(this,me).delete(r))});this.anchor=t,E(this,Sn,n)}ensure(t,n){var r=A,i=os();if(n&&!f(this,We).has(t)&&!f(this,me).has(t))if(i){var s=document.createDocumentFragment(),o=$e();s.append(o),f(this,me).set(t,{effect:Te(()=>n(o)),fragment:s})}else f(this,We).set(t,Te(()=>n(this.anchor)));if(f(this,Pe).set(r,t),i){for(const[a,l]of f(this,We))a===t?r.unskip_effect(l):r.skip_effect(l);for(const[a,l]of f(this,me))a===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(f(this,Cn)),r.ondiscard(f(this,fr))}else f(this,Cn).call(this,r)}}Pe=new WeakMap,We=new WeakMap,me=new WeakMap,kt=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,fr=new WeakMap;function ie(e,t,n=!1){var r=new vl(e),i=n?Zt:0;function s(o,a){r.ensure(o,a)}si(()=>{var o=!1;t((a,l=0)=>{o=!0,s(l,a)}),o||s(-1,null)},i)}function pl(e,t){return t}function gl(e,t,n){for(var r=[],i=t.length,s,o=t.length,a=0;a{if(s){if(s.pending.delete(u),s.done.add(u),s.pending.size===0){var d=e.outrogroups;Ur(e,ur(s.done)),d.delete(s),d.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var c=n,h=c.parentNode;Vo(h),h.append(c),e.items.clear()}Ur(e,t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function Ur(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const a of o)r.add(e.items.get(a).e)}for(var i=0;i{var C=n();return Xr(C)?C:C==null?[]:ur(C)}),d,_=new Map,v=!0;function b(C){(w.effect.f&Ne)===0&&(w.pending.delete(C),w.fallback=h,ml(w,d,o,t,r),h!==null&&(d.length===0?(h.f&ze)===0?li(h):(h.f^=ze,fn(h,null,o)):xt(h,()=>{h=null})))}function p(C){w.pending.delete(C)}var m=si(()=>{d=g(u);for(var C=d.length,T=new Set,q=A,ee=os(),Y=0;Ys(o)):(h=Te(()=>s(bi??(bi=$e()))),h.f|=ze)),C>T.size&&Qs(),!v)if(_.set(q,T),ee){for(const[_t,qe]of a)T.has(_t)||q.skip_effect(qe.e);q.oncommit(b),q.ondiscard(p)}else b(q);g(u)}),w={effect:m,items:a,pending:_,outrogroups:null,fallback:h};v=!1}function on(e){for(;e!==null&&(e.f&je)===0;)e=e.next;return e}function ml(e,t,n,r,i){var s=(r&co)!==0,o=t.length,a=e.items,l=on(e.effect.first),c,h=null,u,d=[],_=[],v,b,p,m;if(s)for(m=0;m0){var we=(r&Fi)!==0&&o===0?n:null;if(s){for(m=0;m<_e;m+=1)Y[m].nodes?.a?.measure();for(m=0;m<_e;m+=1)Y[m].nodes?.a?.fix()}gl(e,Y,we)}}s&&ft(()=>{if(u!==void 0)for(p of u)p.nodes?.a?.apply()})}function bl(e,t,n,r,i,s,o,a){var l=(o&fo)!==0?(o&ho)===0?Wo(n,!1,!1):Rt(n):null,c=(o&uo)!==0?Rt(i):null;return{v:l,i:c,e:Te(()=>(s(t,l??n,c??i,a),()=>{e.delete(r)}))}}function fn(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,s=t&&(t.f&ze)===0?t.nodes.start:n;r!==null;){var o=Tn(r);if(s.before(r),r===i)return;r=o}}function nt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const yi=[...` +\r\f \v\uFEFF`];function yl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+s;(o===0||yi.includes(r[o-1]))&&(a===r.length||yi.includes(r[a]))?r=(o===0?"":r.substring(0,o))+r.substring(a+1):o=a}}return r===""?null:r}function wl(e,t){return e==null?null:String(e)}function fi(e,t,n,r,i,s){var o=e[Nr];if(o!==n||o===void 0){var a=yl(n,r,s);a==null?e.removeAttribute("class"):e.className=a,e[Nr]=n}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return s}function El(e,t,n,r){var i=e[Ir];if(i!==t){var s=wl(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e[Ir]=t}return r}function ks(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Xr(t))return wo();for(var r of e.options)r.selected=t.includes(hn(r));return}for(r of e.options){var i=hn(r);if(Uo(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function kl(e){var t=new MutationObserver(()=>{ks(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ri(()=>{t.disconnect()})}function Sl(e,t,n=t){var r=new WeakSet,i=!0;ti(e,"change",s=>{var o=s?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(o),hn);else{var l=e.querySelector(o)??e.querySelector("option:not([disabled])");a=l&&hn(l)}n(a),e.__value=a,A!==null&&r.add(A)}),as(()=>{var s=t();if(e===document.activeElement){var o=A;if(r.has(o))return}if(ks(e,s,i),i&&s===void 0){var a=e.querySelector(":checked");a!==null&&(s=hn(a),n(s))}e.__value=s,i=!1}),kl(e)}function hn(e){return"__value"in e?e.__value:e.value}const Cl=Symbol("is custom element"),Al=Symbol("is html");function Ot(e,t,n,r){var i=xl(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[Xs]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Tl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function xl(e){return e[qn]??(e[qn]={[Cl]:e.nodeName.includes("-"),[Al]:e.namespaceURI===Bi})}var wi=new Map;function Tl(e){var t=e.getAttribute("is")||e.nodeName,n=wi.get(t);if(n)return n;wi.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=Ks(i);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);i=Ri(i)}return n}function Ei(e,t,n=t){var r=new WeakSet;ti(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=Sr(e)?Cr(s):s,n(s),A!==null&&r.add(A),await il(),s!==(s=t())){var o=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=s??"",a!==null){var c=e.value.length;o===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(a,c))}}}),nn(t)==null&&e.value&&(n(Sr(e)?Cr(e.value):e.value),A!==null&&r.add(A)),_r(()=>{var i=t();if(e===document.activeElement){var s=A;if(r.has(s))return}Sr(e)&&i===Cr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function Ss(e,t,n=t){ti(e,"change",r=>{var i=r?e.defaultChecked:e.checked;n(i)}),nn(t)==null&&n(e.checked),_r(()=>{var r=t();e.checked=!!r})}function Sr(e){var t=e.type;return t==="number"||t==="range"}function Cr(e){return e===""?null:+e}function Ar(e,t){return e===t||e?.[Ct]===t}function Ol(e={},t,n,r){var i=he.r,s=M;return as(()=>{var o,a;return _r(()=>{o=a,a=[],nn(()=>{Ar(n(...a),e)||(t(e,...a),o&&Ar(n(...o),e)&&t(null,...o))})}),()=>{let l=s;for(;l!==i&&l.parent!==null&&l.parent.f&Mr;)l=l.parent;const c=()=>{a&&Ar(n(...a),e)&&t(null,...a)},h=l.teardown;l.teardown=()=>{c(),h?.()}}}),e}function _n(e,t,n,r){var i=!0,s=(n&po)!==0,o=(n&go)!==0,a=r,l=!0,c=void 0,h=()=>o&&i?(c??(c=mn(r)),g(c)):(l&&(l=!1,a=o?nn(r):r),a);let u;if(s){var d=Ct in e||Js in e;u=qt(e,t)?.set??(d&&t in e?T=>e[t]=T:void 0)}var _,v=!1;s?[_,v]=Ao(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),u&&(io(),u(_)));var b;if(b=()=>{var T=e[t];return T===void 0?h():(l=!0,T)},(n&vo)===0)return b;if(u){var p=e.$$legacy;return(function(T,q){return arguments.length>0?((!q||p||v)&&u(q?b():T),T):b()})}var m=!1,w=((n&_o)!==0?mn:$i)(()=>(m=!1,b()));s&&g(w);var C=M;return(function(T,q){if(arguments.length>0){const ee=q?g(w):s?lt(T):T;return $(w,ee),m=!0,a!==void 0&&(a=ee),T}return Qe&&m||(C.f&Ne)!==0?w.v:g(w)})}function Ml(e){he===null&&Zs(),ii(()=>{const t=nn(e);if(typeof t=="function")return t})}const Cs="[data-v-app]",Nl=["header","content","footer"];let Oe=null,Re=null;function Il(e){const t=e instanceof Set?e:new Set(e||[]);for(let n=0;n<16;n++){const r=crypto.randomUUID().replace(/-/g,"").slice(0,8);if(!t.has(r))return r}throw new Error("rebemer: id collision exhausted")}function Ll(){if(typeof document>"u")return!1;const t=document.querySelector(Cs)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Oe=null,!1):(Oe=t,Re=null,!0)}function Rl(){if(Re!==null)return Re;const e=typeof document<"u"?document.querySelector(Cs)?.__vue_app__:null;if(!e)return Re=!1,!1;const t=e.config?.globalProperties??{};if(typeof Oe?.$history?.pause=="function"&&typeof Oe?.$history?.resume=="function")return Re={pause:()=>Oe.$history.pause(),resume:()=>Oe.$history.resume()},Re;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(Re={pause:()=>n.history.pause(),resume:()=>n.history.resume()},Re):typeof t.pauseHistory=="function"&&typeof t.resumeHistory=="function"?(Re={pause:()=>t.pauseHistory(),resume:()=>t.resumeHistory()},Re):(Re=!1,!1)}function Pl(e){const t=Rl();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function ct(e){if(!Oe||!e)return null;for(const t of Nl){const n=Oe[t];if(!Array.isArray(n))continue;const r=n.find(i=>i&&i.id===e);if(r)return r}return null}function Dl(e){const t=ct(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return As(t,1,n),n}function As(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const i=ct(r);i&&(n.push({id:i.id,depth:t,label:i.label,name:i.name,settings:i.settings}),As(i,t+1,n))}}function xs(){return Oe?Oe.globalClasses:[]}function xr(e,t){if(!Oe)throw new Error("rebemer: not ready");const n=Oe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const i=new Set(n.map(o=>o?.id).filter(Boolean)),s=Il(i);return n.push({id:s,name:e,settings:t||{}}),s}function ki(e,t){const n=ct(e);if(!n)return;n.settings||(n.settings={});const r=Array.isArray(t)?t:[];Array.isArray(n.settings._cssGlobalClasses)?n.settings._cssGlobalClasses.splice(0,n.settings._cssGlobalClasses.length,...r):n.settings._cssGlobalClasses=[...r]}function Si(e,t){const n=ct(e);n&&(n.label=t)}const ir="slashed-rebemer-host",Fl="slashed-class-hint",Ts=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],Bl=3;function jl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n[0]==="."&&(n=n.slice(1)),!n.startsWith("sf-")&&!n.startsWith("is-"))||!Object.prototype.hasOwnProperty.call(t,n))return null;const r=t[n];return!r||typeof r.description!="string"?null:{name:n,description:r.description,category:r.category}}let Gr=!1,sr={},Ze=null,vn=null,ye=null;function ql(){if(Ze&&Ze.isConnected)return Ze;let e=document.getElementById(ir);e||(e=document.createElement("div"),e.id=ir,document.body.appendChild(e));const t=document.createElement("div");return t.id=Fl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

    ',e.appendChild(t),Ze=t,t}function Os(e){let t=e;for(let n=0;t&&na&&n.top-s-i>=0&&(l=n.top-s-i);let c=n.left;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(l)}px`,e.style.left=`${Math.round(c)}px`}function Ms(e,t){const n=ql();n.querySelector(".rebemer-class-hint__name").textContent=`.${t.name}`;const r=n.querySelector(".rebemer-class-hint__cat");r.textContent=t.category||"",r.hidden=!t.category,n.querySelector(".rebemer-class-hint__desc").textContent=t.description,n.hidden=!1,Hl(n,e),ye=e}function ht(){Ze&&(Ze.hidden=!0),ye=null}function Kl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${ir}`))return;if(!t.closest(Ts.join(","))){ye&&ht();return}const n=Os(t);if(!n){ye&&ht();return}n.el!==ye&&Ms(n.el,n.hint)}function Wl(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function zl(e){const t=e.target;if(!(t instanceof Element)||t.closest(`#${ir}`))return;if(!t.closest(Ts.join(","))){ye&&ht();return}const n=Os(t);if(!n){ye&&ht();return}n.el!==ye&&Ms(n.el,n.hint)}function Ul(e){if(!ye)return;const t=e.relatedTarget;t instanceof Node&&ye.contains(t)||ht()}function Gl(e){e.key==="Escape"&&ht()}function Vl(e,t,n={}){if(Vn(),Gr=!!e,sr=t&&typeof t=="object"?t:{},!Gr||Object.keys(sr).length===0)return;vn=new AbortController;const{signal:r}=vn,i={passive:!0,signal:r};document.addEventListener("mouseover",Kl,i),document.addEventListener("mouseout",Wl,i),document.addEventListener("focusin",zl,i),document.addEventListener("focusout",Ul,i),document.addEventListener("keydown",Gl,i),window.addEventListener("scroll",ht,{capture:!0,passive:!0,signal:r}),n.signal&&(n.signal.aborted?Vn():n.signal.addEventListener("abort",Vn,{once:!0}))}function Vn(){vn&&(vn.abort(),vn=null),Ze&&(Ze.remove(),Ze=null),ye=null,Gr=!1,sr={}}const Yn="li.variable-picker-item",Jn="slashed-var-swatch",Yl=50,Jl=(e,...t)=>console[e]("[slashed-swatches]",...t);function Xl(e,t){if(!e||!t)return null;let n=String(e).trim();if(!n||/\s/.test(n)||(n.slice(0,2)!=="--"&&(n="--"+n.replace(/^-+/,"")),n.indexOf("--sf-color-")!==0))return null;const r=t[n];return typeof r=="string"&&r?r:null}let Vr=!1,or={},pn=null,Wt=null,Xn=null;function Zl(e){const t=e.querySelector(":scope > span[title]")||e.querySelector(":scope > span");if(t){const n=t.getAttribute("title");return n&&n.trim()?n.trim():(t.textContent||"").trim()}return(e.textContent||"").trim()}function $l(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+Jn);r&&r.remove();return}const t=Xl(Zl(e),or);let n=e.querySelector(":scope > ."+Jn);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=Jn,n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild)),n.dataset.color!==t&&(n.style.setProperty("--slashed-swatch-color",t),n.dataset.color=t)}function Ns(){try{const e=document.querySelectorAll(Yn);for(const t of e)$l(t)}catch(e){Jl("warn","swatch pass failed",e)}}function Ql(){Wt===null&&(Wt=setTimeout(()=>{Wt=null,Ns()},Yl))}function ea(e){for(const t of e){const n=t.target;if(n&&n.nodeType===1&&n.closest&&n.closest(Yn))return!0;for(const r of t.addedNodes)if(r.nodeType===1&&(r.matches&&r.matches(Yn)||r.querySelector&&r.querySelector(Yn)))return!0}return!1}function ta(e,t,n={}){Zn(),Vr=!!e,or=t&&typeof t=="object"?t:{},!(!Vr||Object.keys(or).length===0)&&(Xn=new AbortController,pn=new MutationObserver(r=>{ea(r)&&Ql()}),pn.observe(document.body,{childList:!0,subtree:!0}),Ns(),n.signal&&(n.signal.aborted?Zn():n.signal.addEventListener("abort",Zn,{once:!0})))}function Zn(){Wt!==null&&(clearTimeout(Wt),Wt=null),pn&&(pn.disconnect(),pn=null),Xn&&(Xn.abort(),Xn=null);try{document.querySelectorAll("."+Jn).forEach(e=>e.remove())}catch{}Vr=!1,or={}}const na="5";var Li;typeof window<"u"&&((Li=window.__svelte??(window.__svelte={})).v??(Li.v=new Set)).add(na);var ra=V('reBEM');function ia(e,t){An(t,!0);function n(i){i.stopPropagation(),i.preventDefault(),t.onActivate?.(t.elementId)}var r=ra();se(()=>{Ot(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),Ot(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),ut("click",r,n),ut("keydown",r,i=>(i.key==="Enter"||i.key===" ")&&n(i)),W(e,r),xn()}vr(["click","keydown"]);function Mt(e){return e?String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x00-\x7f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}const sa=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,oa=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function la(e){return e?oa.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:sa.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const gr=new Set(["_padding","_padding_top","_padding_right","_padding_bottom","_padding_left","_margin","_margin_top","_margin_right","_margin_bottom","_margin_left","_width","_widthMin","_widthMax","_minWidth","_maxWidth","_height","_heightMin","_heightMax","_minHeight","_maxHeight","_aspectRatio","_overflow","_overflowX","_overflowY","_color","_background","_backgroundColor","_backgroundImage","_backgroundSize","_backgroundPosition","_backgroundRepeat","_backgroundAttachment","_backgroundBlendMode","_typography","_fontFamily","_fontSize","_fontWeight","_fontStyle","_lineHeight","_letterSpacing","_wordSpacing","_textAlign","_textTransform","_textDecoration","_textDecorationColor","_textShadow","_textIndent","_whiteSpace","_listStyleType","_listStylePosition","_border","_borderRadius","_borderColor","_borderStyle","_borderWidth","_outline","_outlineColor","_outlineStyle","_outlineWidth","_outlineOffset","_boxShadow","_filter","_backdropFilter","_opacity","_blendMode","_transform","_transformOrigin","_transition","_animation","_display","_flexDirection","_flexWrap","_flexGrow","_flexShrink","_flexBasis","_alignItems","_alignSelf","_alignContent","_justifyContent","_justifyItems","_justifySelf","_gap","_rowGap","_columnGap","_gridTemplateColumns","_gridTemplateRows","_gridGap","_gridAutoFlow","_gridAutoColumns","_gridAutoRows","_gridColumn","_gridRow","_gridArea","_position","_top","_right","_bottom","_left","_zIndex","_objectFit","_objectPosition","_cursor","_pointerEvents","_userSelect"]);function aa(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))gr.has(n)&&t.push(n);return t.sort(),t}const fa=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function ua(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))gr.has(n)||fa.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const ca=new Set(["add","rename","replace","modifier","migrate"]),Ci=new Set(["user","label"]);function Is({rootId:e,rows:t,mode:n}){if(!ca.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(a=>a.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};const i=Mt(r.name);if(!i)return{ok:!1,ops:[],error:"Block name is empty."};const s=[];for(const a of t){if(!a.include)continue;const l=a.id===e;let c;if(l)c=i;else{const u=Mt(a.name);if(!u)continue;c=`${i}__${u}`}let h=c;if(n==="modifier"){const u=Mt(a.modifier);if(!u)continue;h=`${c}--${u}`}s.push({row:a,isRoot:l,finalClass:h,suggestedFrom:a.suggestedFrom||"fallback"})}if(s.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const o=_a(s,n);return o.ok?{ok:!0,ops:s}:{ok:!1,ops:[],error:o.error}}function da({rootId:e,rows:t,mode:n,syncLabels:r}){const i=Is({rootId:e,rows:t,mode:n});if(!i.ok)return{ok:!1,error:i.error};const s=i.ops,o=t.find(u=>u.id===e),a=Mt(o?.name??""),l=xs();if(n==="migrate"){const u=ha(s,l);if(!u.ok)return u}const c=new Map;for(const u of s){const d=ct(u.row.id);if(!d)continue;const _={classIds:Ai(d.settings).slice(),label:r&&n!=="modifier"?d.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const b of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(d.settings||{},b)&&(v[b]=JSON.parse(JSON.stringify(d.settings[b])));_.migrateKeys=v}c.set(u.row.id,_)}let h=0;try{Pl(()=>{for(const u of s){const d=ct(u.row.id);if(!d)continue;const _=Ai(d.settings);let v={};if(n==="rename"&&_.length>0){const m=l.find(w=>w&&w.id===_[0]);m&&m.settings&&(v=JSON.parse(JSON.stringify(m.settings)))}else n==="migrate"&&(v=Ls(d.settings,u.row.migrateKeys));if(n==="migrate"){const m=l.find(w=>w&&w.name===u.finalClass);if(m){(!m.settings||typeof m.settings!="object")&&(m.settings={});for(const[w,C]of Object.entries(v))Object.prototype.hasOwnProperty.call(m.settings,w)||(m.settings[w]=C)}}const b=xr(u.finalClass,v);let p;switch(n){case"add":case"migrate":p=_.includes(b)?_:[..._,b];break;case"modifier":{const m=u.finalClass.indexOf("--"),w=m>=0?u.finalClass.slice(0,m):null;let C=[..._];if(w){const T=xr(w,{});C.includes(T)||C.push(T)}p=C.includes(b)?C:[...C,b];break}case"rename":{const m=[b],w=_.length>0?l.find(C=>C&&C.id===_[0]):null;if(w){const C=w.name+"--";for(let T=1;T<_.length;T++){const q=l.find(ee=>ee&&ee.id===_[T]);if(q)if(q.name.startsWith(C)){const ee=q.name.slice(w.name.length),Y=q.settings?JSON.parse(JSON.stringify(q.settings)):{};m.push(xr(u.finalClass+ee,Y))}else m.push(_[T])}}p=m;break}case"replace":p=[b];break}if(ki(u.row.id,p),n==="migrate"&&va(d.settings,u.row.migrateKeys),r&&n!=="modifier"){const m=pa(u.finalClass,a);m&&Si(u.row.id,m)}h++}})}catch(u){for(const[_,v]of c)try{if(ki(_,v.classIds),v.migrateKeys){const b=ct(_);b&&b.settings&&Object.assign(b.settings,v.migrateKeys)}v.label!==null&&Si(_,v.label)}catch{}const d=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",h,"mutation(s), rolled back:",d),{ok:!1,error:`Operation failed and was rolled back: ${d}`}}return h===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:h}}function ha(e,t){for(const n of e){const r=t.find(l=>l&&l.name===n.finalClass);if(!r)continue;const i=ct(n.row.id);if(!i)continue;const s=Ls(i.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},a=[];for(const[l,c]of Object.entries(s))Object.prototype.hasOwnProperty.call(o,l)&&JSON.stringify(o[l])!==JSON.stringify(c)&&a.push(l.replace(/^_/,""));if(a.length>0){const l=a.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${l}. Pick a different name or use Add mode.`}}}return{ok:!0}}function _a(e,t){const n=new Map;for(const r of e){const i=n.get(r.finalClass)||[];i.push(r),n.set(r.finalClass,i)}for(const[r,i]of n){if(i.length===1||t==="modifier")continue;const s=i.filter(a=>Ci.has(a.suggestedFrom));if(s.length>1)return{ok:!1,error:`"${r}" is used by ${s.length} rows. Edit one to make it unique.`};let o=1;for(const a of i)Ci.has(a.suggestedFrom)||(a.finalClass=`${r}-${o++}`,a.suggestedFrom="auto-number")}if(t!=="modifier"){const r=new Map;for(const i of e){const s=r.get(i.finalClass);if(s)return{ok:!1,error:`"${i.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${i.suggestedFrom}). Pick a different name for one of them.`};r.set(i.finalClass,i.suggestedFrom)}}return{ok:!0}}function Ls(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)gr.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function va(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)gr.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function Ai(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function pa(e,t){let n=e;return n===t?xi(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),xi(n.replace(/-/g," ")))}function xi(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const ga=Object.freeze({heading:"heading","text-basic":"text",text:"text","text-link":"link",code:"code",image:"image",icon:"icon","icon-box":"icon",video:"video",audio:"audio",svg:"svg",logo:"logo",shape:"shape",button:"button","button-group":"buttons","nav-nested":"nav","nav-menu":"nav",list:"list",accordion:"accordion",tabs:"tabs",slider:"slider",carousel:"carousel",countdown:"countdown",counter:"counter",testimonials:"testimonials",pricing:"pricing",team:"team",form:"form",posts:"posts",template:"item"}),Rs=new Set(["section","container","block","div"]);function ma(e,t="item"){return!e||typeof e!="string"||Rs.has(e)?t:ga[e]||t}function Tr(e){return typeof e=="string"&&Rs.has(e)}const ba=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function ya(e,t,n){const r=new Set(e.filter(Boolean)),i=(..._)=>_.some(v=>r.has(v)),s=i("button","button-group"),o=i("heading"),a=i("text-basic","text"),l=i("image"),c=i("nav-nested","nav-menu"),h=i("form"),u=i("icon","icon-box"),d=i("list");return h?"form":c?"nav":s&&!o&&!a?"actions":l&&!a&&!o&&!s?"media":o&&!a&&!s?"header":a&&!o&&!s?"body":o&&a?"content":o&&s?"header":u&&!a&&!o?"icon-group":d?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var wa=V('suggested'),Ea=V(' '),ka=V(''),Sa=V('

    Enter a modifier name — the base class will be added automatically if absent.

    '),Ca=V('

    This element has no existing classes. Rename will create a new class instead.

    '),Aa=V('

    '),xa=V(`A class named already exists. On Apply, missing style keys will be merged into it. Conflicting - values block the migration — pick a different name or use Add.`,1),xa=V(`A class named already exists + values block the migration — pick a different name or use Add.`,1),Ta=V(`A class named already exists globally. Apply will attach the existing class instead of - creating a duplicate.`,1),Ta=V('

    '),Oa=V(' '),Ma=V('Migrate: ',1),Ia=V('No migratable keys on this element.'),Na=V(' '),La=V('
    '),Ra=V('
    ');function Pa(e,t){An(t,!0);let n=_n(t,"row",15),r=_n(t,"globalClasses",19,()=>[]),i=_n(t,"finalClassName",3,"");const s=be(()=>t.mode==="modifier"),o=be(()=>t.mode==="migrate"),a=be(()=>t.mode==="rename"),l=be(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),c=be(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),h=be(()=>!i()||!Array.isArray(r())||!n().include?null:r().find(y=>y&&y.name===i())||null);function u(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function d(y){return y.startsWith("_")?y.slice(1):y}var _=Ra();let v;var b=R(_),p=R(b),m=N(b,2),w=R(m),C=R(w),T=N(w,2),H=R(T),ee=N(T,2);{var Y=y=>{var F=ya();se(()=>Ot(F,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),W(y,F)};ie(ee,y=>{g(c)&&n().include&&y(Y)})}var _e=N(m,2),we=R(_e),q=R(we);{var _t=y=>{var F=wa(),Ee=R(F);se(()=>ce(Ee,g(l))),W(y,F)};ie(q,y=>{g(l)&&y(_t)})}var He=N(q,2),rn=N(we,2);{var Mn=y=>{var F=Ea();se(()=>F.disabled=!n().include),ut("input",F,u),wi(F,()=>n().modifier,Ee=>n(n().modifier=Ee,!0)),W(y,F)};ie(rn,y=>{g(s)&&y(Mn)})}var In=N(_e,2);{var Nn=y=>{var F=ka();W(y,F)};ie(In,y=>{g(s)&&n().include&&!n().modifier&&y(Nn)})}var sn=N(In,2);{var mr=y=>{var F=Sa();W(y,F)},Ln=y=>{var F=Ca(),Ee=R(F);se(()=>ce(Ee,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),W(y,F)};ie(sn,y=>{g(a)&&n().include&&n().currentClassCount===0?y(mr):g(a)&&n().include&&n().currentClassCount>1&&y(Ln,1)})}var Rn=N(sn,2);{var Pn=y=>{var F=Ta(),Ee=R(F);{var k=x=>{var K=Aa(),P=N(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)},B=x=>{var K=xa(),P=N(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)};ie(Ee,x=>{g(o)?x(k):x(B,-1)})}W(y,F)};ie(Rn,y=>{g(h)&&y(Pn)})}var br=N(Rn,2);{var Dn=y=>{var F=La(),Ee=R(F);{var k=P=>{var J=Ma(),j=N(Kt(J),2);ws(j,17,()=>n().migrateKeys,vl,(ke,G)=>{var D=Oa(),X=R(D);se(tt=>{Ot(D,"title",`Will be lifted into ${(i()||"the new class")??""}`),ce(X,tt)},[()=>d(g(G))]),W(ke,D)}),W(P,J)},B=P=>{var J=Ia();W(P,J)};ie(Ee,P=>{n().migrateKeys?.length?P(k):P(B,-1)})}var x=N(Ee,2);{var K=P=>{var J=Na(),j=R(J);se(()=>ce(j,`${n().skippedKeys.length??""} skipped`)),W(P,J)};ie(x,P=>{n().skippedKeys?.length&&P(K)})}W(y,F)};ie(br,y=>{g(o)&&n().include&&y(Dn)})}se(y=>{v=ai(_,1,"rebemer-row",null,v,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":g(c)}),wl(_,`--rebemer-row-depth: ${n().depth??0??""}`),ce(C,n().originalLabel),ce(H,y),Ot(He,"placeholder",t.isRoot?"block-name":"element-name"),He.disabled=!n().include},[()=>t.isRoot?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),ks(p,()=>n().include,y=>n(n().include=y,!0)),ut("input",He,u),wi(He,()=>n().name,y=>n(n().name=y,!0)),W(e,_),xn()}_r(["input"]);var Da=V(" ");function Fa(e,t){An(t,!0);let n=_n(t,"kind",3,"info"),r=_n(t,"duration",3,3e3),i=oe(!0);ri(()=>{if(!g(i)||r()<=0)return;const c=setTimeout(()=>{$(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const s=be(()=>n()==="error"?"alert":"status");var o=dl(),a=Kt(o);{var l=c=>{var h=Da(),u=R(h);se(()=>{ai(h,1,`rebemer-toast rebemer-toast--${n()??""}`),Ot(h,"role",g(s)),Ot(h,"aria-live",n()==="error"?"assertive":"polite"),ce(u,t.message)}),ut("click",h,()=>{$(i,!1),t.onDismiss?.()}),W(c,h)};ie(a,c=>{g(i)&&c(l)})}W(e,o),xn()}_r(["click"]);var Ba=V("Will migrate ",1),ja=V(' '),Ha=V(''),qa=V(' ',1);function Ka(e,t){An(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",modifier:"Appends a --modifier variant. The base class is auto-added to the element if absent.",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class."};let r=oe("add"),i=oe(!0),s=oe(lt([])),o=oe(lt([])),a=oe(null),l=oe(null);const c=be(()=>Mt(g(s)[0]?.name??"")),h=be(()=>g(s)[0]?.originalLabel??""),u=be(()=>{if(g(r)!=="migrate")return null;let k=0,B=0;for(const x of g(s))x.include&&(k+=x.migrateKeys?.length??0,B+=x.skippedKeys?.length??0);return{willMigrate:k,willSkip:B}}),d=be(()=>{if(g(s).length===0)return new Map;const k=Is({rootId:t.rootId,rows:g(s),mode:g(r)}),B=new Map;if(!k.ok)return B;for(const x of k.ops)B.set(x.row.id,x.finalClass);return B});Ol(()=>{const k=Pl(t.rootId);$(o,As().slice(),!0);const B=k.map((x,K)=>{const P=K===0,J=x.label||"",j=Mt(J),ke=x.name||"";let G,D;return j?(G=j,D="label"):P?(G="block",D="fallback"):ke&&!xr(ke)?(G=ga(ke,"item"),D="element-type"):(G="item",D="fallback"),{id:x.id,depth:x.depth,bricksType:ke,originalLabel:J||(P?"block":"element"),name:G,modifier:"",include:!0,suggestedFrom:D,migrateKeys:la(x.settings),skippedKeys:fa(x.settings),currentClassCount:Array.isArray(x.settings?._cssGlobalClasses)?x.settings._cssGlobalClasses.filter(X=>typeof X=="string"&&X.length>0).length:0}});if(B.length>1){const x=new Map(k.map(j=>[j.id,[]])),K=[];for(const j of k){for(;K.length&&K[K.length-1].depth>=j.depth;)K.pop();K.length&&x.get(K[K.length-1].id).push(j.id),K.push(j)}const P=new Map(k.map(j=>[j.id,j])),J=new Map(B.map(j=>[j.id,j]));for(const[,j]of x){if(!j.length)continue;const ke=new Map;for(const D of j){const X=P.get(D)?.name;X&&ke.set(X,(ke.get(X)??0)+1)}const G=j.filter(D=>xr(P.get(D)?.name??""));for(const D of j){const X=J.get(D),tt=P.get(D);if(!(!X||!tt||X.suggestedFrom==="label")){if(xr(tt.name)){const Dt=(x.get(D)??[]).map(Ds=>P.get(Ds)?.name??"").filter(Boolean),Ps=G.indexOf(D);X.name=ba(Dt,Ps,G.length),X.suggestedFrom="element-type"}else if((ke.get(tt.name)??0)===1){const Dt=ma[tt.name];Dt&&(X.name=Dt,X.suggestedFrom="element-type")}}}}}$(s,B,!0)});function _(k){if(k.key==="Escape"){t.onClose?.();return}g(l)&&k.target instanceof Node&&g(l).contains(k.target)&&k.key==="Enter"&&(k.target?.tagName==="INPUT"||k.target?.tagName==="SELECT")&&(k.preventDefault(),b())}let v=null;function b(){const k=Mt(g(s)[0]?.name??""),B=oa(k);if(!B.ok){$(a,{kind:"error",message:B.reason},!0);return}const x=ca({rootId:t.rootId,rows:g(s),mode:g(r),syncLabels:g(i)});x.ok?($(a,{kind:"success",message:`Applied to ${x.count} element${x.count!==1?"s":""}.`},!0),v&&clearTimeout(v),v=setTimeout(()=>t.onClose?.(),800)):$(a,{kind:"error",message:x.error},!0)}ri(()=>()=>{v&&clearTimeout(v)});var p=qa();ll("keydown",Hr,_);var m=Kt(p),w=R(m),C=R(w),T=N(R(C)),H=R(T),ee=N(C,2),Y=N(w,2),_e=R(Y),we=N(R(_e),2),q=R(we);q.value=q.__value="add";var _t=N(q);_t.value=_t.__value="rename";var He=N(_t);He.value=He.__value="replace";var rn=N(He);rn.value=rn.__value="modifier";var Mn=N(rn);Mn.value=Mn.__value="migrate";var In=N(_e,2),Nn=R(In),sn=N(Y,2),mr=R(sn),Ln=N(sn,2);{var Rn=k=>{var B=Ha();let x;var K=R(B);{var P=G=>{var D=cl("No migratable style keys found on any included element. Apply will attach empty classes.");W(G,D)},J=G=>{var D=Ba(),X=N(Kt(D)),tt=R(X),Dt=N(X);se(()=>{ce(tt,g(u).willMigrate),ce(Dt,` style key${g(u).willMigrate===1?"":"s"} into new classes.`)}),W(G,D)};ie(K,G=>{g(u).willMigrate===0?G(P):G(J,-1)})}var j=N(K,2);{var ke=G=>{var D=ja(),X=R(D);se(()=>ce(X,`${g(u).willSkip??""} key${g(u).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),W(G,D)};ie(j,G=>{g(u).willSkip>0&&G(ke)})}se(()=>x=ai(B,1,"rebemer-panel__notice",null,x,{"rebemer-panel__notice--warn":g(u).willSkip>0||g(u).willMigrate===0})),W(k,B)};ie(Ln,k=>{g(u)&&k(Rn)})}var Pn=N(Ln,2);ws(Pn,23,()=>g(s),k=>k.id,(k,B,x)=>{{let K=be(()=>g(B).id===t.rootId),P=be(()=>g(d).get(g(B).id)??"");Pa(k,{get mode(){return g(r)},get blockName(){return g(c)},get isRoot(){return g(K)},get globalClasses(){return g(o)},get finalClassName(){return g(P)},get row(){return g(s)[g(x)]},set row(J){g(s)[g(x)]=J}})}});var br=N(Pn,2),Dn=R(br),y=N(Dn,2);Tl(m,k=>$(l,k),()=>g(l));var F=N(m,2);{var Ee=k=>{Fa(k,{get kind(){return g(a).kind},get message(){return g(a).message},onDismiss:()=>{$(a,null)}})};ie(F,k=>{g(a)&&k(Ee)})}se(()=>{ce(H,g(h)),Nn.disabled=g(r)==="modifier",ce(mr,n[g(r)])}),ut("click",ee,()=>t.onClose?.()),kl(we,()=>g(r),k=>$(r,k)),ks(Nn,()=>g(i),k=>$(i,k)),ut("click",Dn,()=>t.onClose?.()),ut("click",y,b),W(e,p),xn()}_r(["click"]);const xi="#bricks-structure",Wa="li[data-id]",Ti="slashed-rebemer-host",za=400,Ua=25,gr=(e,...t)=>console[e]("[reBEMer]",...t),Rs=new AbortController,{signal:gn}=Rs,It=new Map;let un=null;function Ga(){let e=document.getElementById(Ti);return e||(e=document.createElement("div"),e.id=Ti,document.body.appendChild(e)),e}function Oi(){const e=window.slashedBricksEditor;e&&typeof e=="object"&&(Gl(e.showClassHints,e.classHints,{signal:gn}),ea(e.showColorSwatches,e.colorHexMap,{signal:gn}));let t=0;const n=()=>{if(!gn.aborted){if(Nl()){Va();return}if(++t>=Ua){gr("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(n,za)}};n()}function Va(){const e=document.querySelector(xi);if(e){Mi(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(xi);n&&(t.disconnect(),Mi(n))});t.observe(document.body,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>t.disconnect(),{once:!0})}function Mi(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Ii(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),Ii(e)}function Ii(e){for(const[n,r]of It)if(!r.host.isConnected){try{vr(r.instance)}catch(i){gr("warn","badge unmount failed",i)}It.delete(n)}const t=e.querySelectorAll(Wa);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const i=It.get(r);i&&i.host.isConnected&&n.contains(i.host)||Ya(n)}}function Ya(e){const t=e.getAttribute("data-id");if(!t)return;const n=e.querySelector(":scope > .structure-item")||e,r=n.querySelector(":scope > ul.actions")||n.querySelector(":scope > .actions")||n.querySelector(":scope > .structure-item-actions"),i=document.createElement("span");i.className="rebemer-badge-host",r?n.insertBefore(i,r):n.appendChild(i);const s=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),o=s?s.textContent.trim():"",a=ys(ra,{target:i,props:{elementId:t,label:o,onActivate:Ja}}),l=It.get(t);if(l){try{vr(l.instance)}catch(c){gr("warn","badge remount cleanup failed",c)}l.host.isConnected&&l.host.remove()}It.set(t,{instance:a,host:i})}function Ja(e){Vr();const t=document.createElement("div");Ga().appendChild(t),un={instance:ys(Ka,{target:t,props:{rootId:e,onClose:Vr}}),node:t}}function Vr(){if(un){try{vr(un.instance)}catch(e){gr("warn","panel unmount failed",e)}un.node.remove(),un=null}}window.addEventListener("beforeunload",()=>{Rs.abort(),Vr(),Vn(),Xn();for(const{instance:e}of It.values())try{vr(e)}catch{}It.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oi,{once:!0}):Oi(); + creating a duplicate.`,1),Oa=V('

    '),Ma=V(' '),Na=V('Migrate: ',1),Ia=V('No migratable keys on this element.'),La=V(' '),Ra=V('
    '),Pa=V('
    ');function Da(e,t){An(t,!0);let n=_n(t,"row",15),r=_n(t,"globalClasses",19,()=>[]),i=_n(t,"finalClassName",3,"");const s=be(()=>t.mode==="modifier"),o=be(()=>t.mode==="migrate"),a=be(()=>t.mode==="rename"),l=be(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),c=be(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),h=be(()=>!i()||!Array.isArray(r())||!n().include?null:r().find(y=>y&&y.name===i())||null);function u(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function d(y){return y.startsWith("_")?y.slice(1):y}var _=Pa();let v;var b=R(_),p=R(b),m=I(b,2),w=R(m),C=R(w),T=I(w,2),q=R(T),ee=I(T,2);{var Y=y=>{var F=wa();se(()=>Ot(F,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),W(y,F)};ie(ee,y=>{g(c)&&n().include&&y(Y)})}var _e=I(m,2),we=R(_e),H=R(we);{var _t=y=>{var F=Ea(),Ee=R(F);se(()=>ce(Ee,g(l))),W(y,F)};ie(H,y=>{g(l)&&y(_t)})}var qe=I(H,2),rn=I(we,2);{var Mn=y=>{var F=ka();se(()=>F.disabled=!n().include),ut("input",F,u),Ei(F,()=>n().modifier,Ee=>n(n().modifier=Ee,!0)),W(y,F)};ie(rn,y=>{g(s)&&y(Mn)})}var Nn=I(_e,2);{var In=y=>{var F=Sa();W(y,F)};ie(Nn,y=>{g(s)&&n().include&&!n().modifier&&y(In)})}var sn=I(Nn,2);{var br=y=>{var F=Ca();W(y,F)},Ln=y=>{var F=Aa(),Ee=R(F);se(()=>ce(Ee,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),W(y,F)};ie(sn,y=>{g(a)&&n().include&&n().currentClassCount===0?y(br):g(a)&&n().include&&n().currentClassCount>1&&y(Ln,1)})}var Rn=I(sn,2);{var Pn=y=>{var F=Oa(),Ee=R(F);{var k=x=>{var K=xa(),P=I(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)},B=x=>{var K=Ta(),P=I(Kt(K)),J=R(P);se(()=>ce(J,i())),W(x,K)};ie(Ee,x=>{g(o)?x(k):x(B,-1)})}W(y,F)};ie(Rn,y=>{g(h)&&y(Pn)})}var yr=I(Rn,2);{var Dn=y=>{var F=Ra(),Ee=R(F);{var k=P=>{var J=Na(),j=I(Kt(J),2);Es(j,17,()=>n().migrateKeys,pl,(ke,G)=>{var D=Ma(),X=R(D);se(tt=>{Ot(D,"title",`Will be lifted into ${(i()||"the new class")??""}`),ce(X,tt)},[()=>d(g(G))]),W(ke,D)}),W(P,J)},B=P=>{var J=Ia();W(P,J)};ie(Ee,P=>{n().migrateKeys?.length?P(k):P(B,-1)})}var x=I(Ee,2);{var K=P=>{var J=La(),j=R(J);se(()=>ce(j,`${n().skippedKeys.length??""} skipped`)),W(P,J)};ie(x,P=>{n().skippedKeys?.length&&P(K)})}W(y,F)};ie(yr,y=>{g(o)&&n().include&&y(Dn)})}se(y=>{v=fi(_,1,"rebemer-row",null,v,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":g(c)}),El(_,`--rebemer-row-depth: ${n().depth??0??""}`),ce(C,n().originalLabel),ce(q,y),Ot(qe,"placeholder",t.isRoot?"block-name":"element-name"),qe.disabled=!n().include},[()=>t.isRoot?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),Ss(p,()=>n().include,y=>n(n().include=y,!0)),ut("input",qe,u),Ei(qe,()=>n().name,y=>n(n().name=y,!0)),W(e,_),xn()}vr(["input"]);var Fa=V(" ");function Ba(e,t){An(t,!0);let n=_n(t,"kind",3,"info"),r=_n(t,"duration",3,3e3),i=oe(!0);ii(()=>{if(!g(i)||r()<=0)return;const c=setTimeout(()=>{$(i,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const s=be(()=>n()==="error"?"alert":"status");var o=hl(),a=Kt(o);{var l=c=>{var h=Fa(),u=R(h);se(()=>{fi(h,1,`rebemer-toast rebemer-toast--${n()??""}`),Ot(h,"role",g(s)),Ot(h,"aria-live",n()==="error"?"assertive":"polite"),ce(u,t.message)}),ut("click",h,()=>{$(i,!1),t.onDismiss?.()}),W(c,h)};ie(a,c=>{g(i)&&c(l)})}W(e,o),xn()}vr(["click"]);var ja=V("Will migrate ",1),qa=V(' '),Ha=V(''),Ka=V(' ',1);function Wa(e,t){An(t,!0);const n={add:"Attaches a new BEM class to each element without removing any existing classes.",rename:"Replaces the first existing class with a new name, seeding its settings from the old class.",replace:"Replaces ALL existing classes with a single new BEM class (clean slate, no settings carried over).",modifier:"Appends a --modifier variant. The base class is auto-added to the element if absent.",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class."};let r=oe("add"),i=oe(!0),s=oe(lt([])),o=oe(lt([])),a=oe(null),l=oe(null);const c=be(()=>Mt(g(s)[0]?.name??"")),h=be(()=>g(s)[0]?.originalLabel??""),u=be(()=>{if(g(r)!=="migrate")return null;let k=0,B=0;for(const x of g(s))x.include&&(k+=x.migrateKeys?.length??0,B+=x.skippedKeys?.length??0);return{willMigrate:k,willSkip:B}}),d=be(()=>{if(g(s).length===0)return new Map;const k=Is({rootId:t.rootId,rows:g(s),mode:g(r)}),B=new Map;if(!k.ok)return B;for(const x of k.ops)B.set(x.row.id,x.finalClass);return B});Ml(()=>{const k=Dl(t.rootId);$(o,xs().slice(),!0);const B=k.map((x,K)=>{const P=K===0,J=x.label||"",j=Mt(J),ke=x.name||"";let G,D;return j?(G=j,D="label"):P?(G="block",D="fallback"):ke&&!Tr(ke)?(G=ma(ke,"item"),D="element-type"):(G="item",D="fallback"),{id:x.id,depth:x.depth,bricksType:ke,originalLabel:J||(P?"block":"element"),name:G,modifier:"",include:!0,suggestedFrom:D,migrateKeys:aa(x.settings),skippedKeys:ua(x.settings),currentClassCount:Array.isArray(x.settings?._cssGlobalClasses)?x.settings._cssGlobalClasses.filter(X=>typeof X=="string"&&X.length>0).length:0}});if(B.length>1){const x=new Map(k.map(j=>[j.id,[]])),K=[];for(const j of k){for(;K.length&&K[K.length-1].depth>=j.depth;)K.pop();K.length&&x.get(K[K.length-1].id).push(j.id),K.push(j)}const P=new Map(k.map(j=>[j.id,j])),J=new Map(B.map(j=>[j.id,j]));for(const[,j]of x){if(!j.length)continue;const ke=new Map;for(const D of j){const X=P.get(D)?.name;X&&ke.set(X,(ke.get(X)??0)+1)}const G=j.filter(D=>Tr(P.get(D)?.name??""));for(const D of j){const X=J.get(D),tt=P.get(D);if(!(!X||!tt||X.suggestedFrom==="label")){if(Tr(tt.name)){const Dt=(x.get(D)??[]).map(Fs=>P.get(Fs)?.name??"").filter(Boolean),Ds=G.indexOf(D);X.name=ya(Dt,Ds,G.length),X.suggestedFrom="element-type"}else if((ke.get(tt.name)??0)===1){const Dt=ba[tt.name];Dt&&(X.name=Dt,X.suggestedFrom="element-type")}}}}}$(s,B,!0)});function _(k){if(k.key==="Escape"){t.onClose?.();return}g(l)&&k.target instanceof Node&&g(l).contains(k.target)&&k.key==="Enter"&&(k.target?.tagName==="INPUT"||k.target?.tagName==="SELECT")&&(k.preventDefault(),b())}let v=null;function b(){const k=Mt(g(s)[0]?.name??""),B=la(k);if(!B.ok){$(a,{kind:"error",message:B.reason},!0);return}const x=da({rootId:t.rootId,rows:g(s),mode:g(r),syncLabels:g(i)});x.ok?($(a,{kind:"success",message:`Applied to ${x.count} element${x.count!==1?"s":""}.`},!0),v&&clearTimeout(v),v=setTimeout(()=>t.onClose?.(),800)):$(a,{kind:"error",message:x.error},!0)}ii(()=>()=>{v&&clearTimeout(v)});var p=Ka();al("keydown",Hr,_);var m=Kt(p),w=R(m),C=R(w),T=I(R(C)),q=R(T),ee=I(C,2),Y=I(w,2),_e=R(Y),we=I(R(_e),2),H=R(we);H.value=H.__value="add";var _t=I(H);_t.value=_t.__value="rename";var qe=I(_t);qe.value=qe.__value="replace";var rn=I(qe);rn.value=rn.__value="modifier";var Mn=I(rn);Mn.value=Mn.__value="migrate";var Nn=I(_e,2),In=R(Nn),sn=I(Y,2),br=R(sn),Ln=I(sn,2);{var Rn=k=>{var B=Ha();let x;var K=R(B);{var P=G=>{var D=dl("No migratable style keys found on any included element. Apply will attach empty classes.");W(G,D)},J=G=>{var D=ja(),X=I(Kt(D)),tt=R(X),Dt=I(X);se(()=>{ce(tt,g(u).willMigrate),ce(Dt,` style key${g(u).willMigrate===1?"":"s"} into new classes.`)}),W(G,D)};ie(K,G=>{g(u).willMigrate===0?G(P):G(J,-1)})}var j=I(K,2);{var ke=G=>{var D=qa(),X=R(D);se(()=>ce(X,`${g(u).willSkip??""} key${g(u).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),W(G,D)};ie(j,G=>{g(u).willSkip>0&&G(ke)})}se(()=>x=fi(B,1,"rebemer-panel__notice",null,x,{"rebemer-panel__notice--warn":g(u).willSkip>0||g(u).willMigrate===0})),W(k,B)};ie(Ln,k=>{g(u)&&k(Rn)})}var Pn=I(Ln,2);Es(Pn,23,()=>g(s),k=>k.id,(k,B,x)=>{{let K=be(()=>g(B).id===t.rootId),P=be(()=>g(d).get(g(B).id)??"");Da(k,{get mode(){return g(r)},get blockName(){return g(c)},get isRoot(){return g(K)},get globalClasses(){return g(o)},get finalClassName(){return g(P)},get row(){return g(s)[g(x)]},set row(J){g(s)[g(x)]=J}})}});var yr=I(Pn,2),Dn=R(yr),y=I(Dn,2);Ol(m,k=>$(l,k),()=>g(l));var F=I(m,2);{var Ee=k=>{Ba(k,{get kind(){return g(a).kind},get message(){return g(a).message},onDismiss:()=>{$(a,null)}})};ie(F,k=>{g(a)&&k(Ee)})}se(()=>{ce(q,g(h)),In.disabled=g(r)==="modifier",ce(br,n[g(r)])}),ut("click",ee,()=>t.onClose?.()),Sl(we,()=>g(r),k=>$(r,k)),Ss(In,()=>g(i),k=>$(i,k)),ut("click",Dn,()=>t.onClose?.()),ut("click",y,b),W(e,p),xn()}vr(["click"]);const Ti="#bricks-structure",za="li[data-id]",Oi="slashed-rebemer-host",Ua=400,Ga=25,mr=(e,...t)=>console[e]("[reBEMer]",...t),Ps=new AbortController,{signal:gn}=Ps,Nt=new Map;let un=null;function Va(){let e=document.getElementById(Oi);return e||(e=document.createElement("div"),e.id=Oi,document.body.appendChild(e)),e}function Mi(){const e=window.slashedBricksEditor;e&&typeof e=="object"&&(Vl(e.showClassHints,e.classHints,{signal:gn}),ta(e.showColorSwatches,e.colorHexMap,{signal:gn}));let t=0;const n=()=>{if(!gn.aborted){if(Ll()){Ya();return}if(++t>=Ga){mr("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(n,Ua)}};n()}function Ya(){const e=document.querySelector(Ti);if(e){Ni(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(Ti);n&&(t.disconnect(),Ni(n))});t.observe(document.body,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>t.disconnect(),{once:!0})}function Ni(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Ii(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),gn.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),Ii(e)}function Ii(e){for(const[n,r]of Nt)if(!r.host.isConnected){try{pr(r.instance)}catch(i){mr("warn","badge unmount failed",i)}Nt.delete(n)}const t=e.querySelectorAll(za);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const i=Nt.get(r);i&&i.host.isConnected&&n.contains(i.host)||Ja(n)}}function Ja(e){const t=e.getAttribute("data-id");if(!t)return;const n=e.querySelector(":scope > .structure-item")||e,r=n.querySelector(":scope > ul.actions")||n.querySelector(":scope > .actions")||n.querySelector(":scope > .structure-item-actions"),i=document.createElement("span");i.className="rebemer-badge-host",r?n.insertBefore(i,r):n.appendChild(i);const s=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),o=s?s.textContent.trim():"",a=ws(ia,{target:i,props:{elementId:t,label:o,onActivate:Xa}}),l=Nt.get(t);if(l){try{pr(l.instance)}catch(c){mr("warn","badge remount cleanup failed",c)}l.host.isConnected&&l.host.remove()}Nt.set(t,{instance:a,host:i})}function Xa(e){Yr();const t=document.createElement("div");Va().appendChild(t),un={instance:ws(Wa,{target:t,props:{rootId:e,onClose:Yr}}),node:t}}function Yr(){if(un){try{pr(un.instance)}catch(e){mr("warn","panel unmount failed",e)}un.node.remove(),un=null}}window.addEventListener("beforeunload",()=>{Ps.abort(),Yr(),Vn(),Zn();for(const{instance:e}of Nt.values())try{pr(e)}catch{}Nt.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Mi,{once:!0}):Mi(); //# sourceMappingURL=app.js.map diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js index d55bb5fa..17018a1c 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js +++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-swatches.js @@ -157,6 +157,43 @@ function schedule() { }, DEBOUNCE_MS); } +/** + * Cheap pre-filter for the body-level observer: only schedule a pass when + * a mutation actually touches the variable picker. + * + * We observe `document.body` (the picker dropdown is created, destroyed, + * and re-rendered by Bricks, with no container that's stable across its + * whole lifecycle), but the vast majority of builder mutations — canvas + * edits, structure-panel rebuilds — are irrelevant. Bailing here keeps + * those from waking the reconciler at all. + * + * - A text/markup patch inside an existing row (Bricks reuses `
  • ` + * nodes when filtering) shows up as a mutation whose target is within + * a `.variable-picker-item`. + * - Opening the dropdown adds a subtree that contains the rows. + * + * @param {MutationRecord[]} records + * @returns {boolean} + */ +function touchesPicker(records) { + for (const m of records) { + const t = m.target; + if (t && t.nodeType === 1 && t.closest && t.closest(ITEM_SELECTOR)) { + return true; + } + for (const node of m.addedNodes) { + if (node.nodeType !== 1) continue; + if ( + (node.matches && node.matches(ITEM_SELECTOR)) || + (node.querySelector && node.querySelector(ITEM_SELECTOR)) + ) { + return true; + } + } + } + return false; +} + /** * Initialise variable-picker swatches. * @@ -179,11 +216,17 @@ export function init(enabled, hexMap, options = {}) { _controller = new AbortController(); // The picker dropdown is created, destroyed, and re-rendered (on search) - // by Bricks, so a persistent observer that re-decorates on any DOM - // churn is simpler and more robust than trying to hook open/close. - // The callback only schedules a cheap debounced pass; our own swatch - // insertions trigger at most one extra no-op pass before settling. - _observer = new MutationObserver(schedule); + // by Bricks, so a persistent observer is simpler and more robust than + // trying to hook open/close. We watch `document.body` because there's no + // container that stays mounted across the picker's whole lifecycle, but + // `touchesPicker()` filters out unrelated builder churn so canvas edits + // and structure-panel rebuilds never wake the reconciler. When a + // relevant mutation lands we schedule a single cheap debounced pass; + // our own swatch insertions trigger at most one extra no-op pass before + // settling. + _observer = new MutationObserver((records) => { + if (touchesPicker(records)) schedule(); + }); _observer.observe(document.body, { childList: true, subtree: true }); runPass();