From 7e822f23abcfd28f4c2e8c0bd84a8a36121b6606 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 5 Jun 2026 12:10:46 +0000 Subject: [PATCH] fix(bricks): SF color picker on touch + reset swatch on external color change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picker mode panel only stopped click/mousedown propagation, so on touch devices the pointerdown/touchstart bubbled to document and Bricks' outside- interaction handling dismissed the panel before the swatch click landed — closing it with nothing written to the input. Extend the propagation guard to pointerdown/touchstart. The SF button dot was armed from the live input value only on fresh injection, so picking a colour through Bricks' own palette (which leaves our foreign button in place) left a stale SF swatch. Sync the dot state on every reconcile pass, resetting to the default colourful dot when the value is no longer an --sf-color-* variable. --- .../bricks/assets/editor-app/app.js | 10 +- .../src/components/ColorPanel.svelte | 2 + .../editor-app/src/lib/color-swatches.js | 102 +++++++++++------- 3 files changed, 70 insertions(+), 44 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 1df16455..894ec93c 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,8 +1,8 @@ -var ii=Object.defineProperty;var ga=e=>{throw TypeError(e)};var li=(e,t,n)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>li(e,typeof t!="symbol"?t+"":t,n),As=(e,t,n)=>t.has(e)||ga("Cannot "+n);var d=(e,t,n)=>(As(e,t,"read from private field"),n?n.call(e):t.get(e)),D=(e,t,n)=>t.has(e)?ga("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(As(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Y=(e,t,n)=>(As(e,t,"access private method"),n);var aa=Array.isArray,ci=Array.prototype.indexOf,gn=Array.prototype.includes,ms=Array.from,ui=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,fi=Object.getOwnPropertyDescriptors,di=Object.prototype,hi=Array.prototype,Qa=Object.getPrototypeOf,ba=Object.isExtensible;const Xa=()=>{};function vi(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const Ce=2,Jn=4,gs=8,eo=1<<24,it=16,ut=32,Xt=64,Fs=128,Ze=512,be=1024,Ee=2048,yt=4096,Oe=8192,et=16384,An=32768,Ds=1<<25,Qn=65536,os=1<<17,_i=1<<18,sr=1<<19,pi=1<<20,bt=1<<25,En=65536,is=1<<21,Hn=1<<22,$t=1<<23,bn=Symbol("$state"),mi=Symbol("legacy props"),gi=Symbol(""),Gr=Symbol("attributes"),qs=Symbol("class"),js=Symbol("style"),hr=Symbol("text"),Yr=Symbol("form reset"),bs=new class extends Error{constructor(){super(...arguments);Pe(this,"name","StaleReactionError");Pe(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function bi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function yi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function wi(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ki(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Si(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ei(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ci(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ai(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ti(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Oi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ii(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Mi=1,Li=2,to=4,Pi=8,Ri=16,Ni=1,Bi=4,Fi=8,Di=16,qi=1,ji=2,ge=Symbol("uninitialized"),no="http://www.w3.org/1999/xhtml";function Hi(){console.warn("https://svelte.dev/e/derived_inert")}function Wi(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ui(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ro(e){return e===this.v}function Ki(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function so(e){return!Ki(e,this.v)}let Fe=null;function Xn(e){Fe=e}function Tn(e,t=!1,n){Fe={p:Fe,i:!1,c:null,e:null,s:e,x:null,r:z,l:null}}function On(e){var t=Fe,n=t.e;if(n!==null){t.e=null;for(var r of n)xo(r)}return t.i=!0,Fe=t.p,{}}function ao(){return!0}let cn=[];function oo(){var e=cn;cn=[],vi(e)}function Jt(e){if(cn.length===0&&!br){var t=cn;queueMicrotask(()=>{t===cn&&oo()})}cn.push(e)}function zi(){for(;cn.length>0;)oo()}function io(e){var t=z;if(t===null)return K.f|=$t,e;if((t.f&An)===0&&(t.f&Jn)===0)throw e;Gt(e,t)}function Gt(e,t){for(;t!==null;){if((t.f&Fs)!==0){if((t.f&An)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Vi=-7169;function ue(e,t){e.f=e.f&Vi|t}function oa(e){(e.f&Ze)!==0||e.deps===null?ue(e,be):ue(e,yt)}function lo(e){if(e!==null)for(const t of e)(t.f&Ce)===0||(t.f&En)===0||(t.f^=En,lo(t.deps))}function co(e,t,n){(e.f&Ee)!==0?t.add(e):(e.f&yt)!==0&&n.add(e),lo(e.deps),ue(e,be)}let Wr=!1;function Gi(e){var t=Wr;try{return Wr=!1,[e(),Wr]}finally{Wr=t}}let Ts=null,Bn=null,q=null,Hs=null,lt=null,Ws=null,br=!1,Os=!1,Dn=null,$r=null;var ya=0;let Yi=1;var Kn,Kt,dn,zn,Vn,hn,Gn,Ot,Ir,je,Mr,zt,pt,mt,Yn,vn,J,Us,vr,Ks,uo,fo,Jr,$i,zs,Fn;const vs=class vs{constructor(){D(this,J);Pe(this,"id",Yi++);D(this,Kn,!1);Pe(this,"linked",!0);D(this,Kt,null);D(this,dn,null);Pe(this,"async_deriveds",new Map);Pe(this,"current",new Map);Pe(this,"previous",new Map);Pe(this,"unblocked",new Set);D(this,zn,new Set);D(this,Vn,new Set);D(this,hn,new Set);D(this,Gn,0);D(this,Ot,new Map);D(this,Ir,null);D(this,je,[]);D(this,Mr,[]);D(this,zt,new Set);D(this,pt,new Set);D(this,mt,new Map);D(this,Yn,new Set);Pe(this,"is_fork",!1);D(this,vn,!1)}skip_effect(t){d(this,mt).has(t)||d(this,mt).set(t,{d:[],m:[]}),d(this,Yn).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=d(this,mt).get(t);if(r){d(this,mt).delete(t);for(var s of r.d)ue(s,Ee),n(s);for(s of r.m)ue(s,yt),n(s)}d(this,Yn).add(t)}capture(t,n,r=!1){t.v!==ge&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&$t)===0&&(this.current.set(t,[n,r]),lt?.set(t,n)),this.is_fork||(t.v=n)}activate(){q=this}deactivate(){q=null,lt=null}flush(){try{Os=!0,q=this,Y(this,J,vr).call(this)}finally{ya=0,Ws=null,Dn=null,$r=null,Os=!1,q=null,lt=null,yn.clear()}}discard(){for(const t of d(this,Vn))t(this);d(this,Vn).clear(),d(this,hn).clear(),Y(this,J,Fn).call(this)}register_created_effect(t){d(this,Mr).push(t)}increment(t,n){if(N(this,Gn,d(this,Gn)+1),t){let r=d(this,Ot).get(n)??0;d(this,Ot).set(n,r+1)}}decrement(t,n){if(N(this,Gn,d(this,Gn)-1),t){let r=d(this,Ot).get(n)??0;r===1?d(this,Ot).delete(n):d(this,Ot).set(n,r-1)}d(this,vn)||(N(this,vn,!0),Jt(()=>{N(this,vn,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)d(this,zt).add(r);for(const r of n)d(this,pt).add(r);t.clear(),n.clear()}oncommit(t){d(this,zn).add(t)}ondiscard(t){d(this,Vn).add(t)}on_fork_commit(t){d(this,hn).add(t)}run_fork_commit_callbacks(){for(const t of d(this,hn))t(this);d(this,hn).clear()}settled(){return(d(this,Ir)??N(this,Ir,Za())).promise}static ensure(){var t;if(q===null){const n=q=new vs;Y(t=n,J,zs).call(t),!Os&&!br&&Jt(()=>{d(n,Kn)||n.flush()})}return q}apply(){{lt=null;return}}schedule(t){if(Ws=t,t.b?.is_pending&&(t.f&(Jn|gs|eo))!==0&&(t.f&An)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(Dn!==null&&n===z&&(K===null||(K.f&Ce)===0))return;if((r&(Xt|ut))!==0){if((r&be)===0)return;n.f^=be}}d(this,je).push(n)}};Kn=new WeakMap,Kt=new WeakMap,dn=new WeakMap,zn=new WeakMap,Vn=new WeakMap,hn=new WeakMap,Gn=new WeakMap,Ot=new WeakMap,Ir=new WeakMap,je=new WeakMap,Mr=new WeakMap,zt=new WeakMap,pt=new WeakMap,mt=new WeakMap,Yn=new WeakMap,vn=new WeakMap,J=new WeakSet,Us=function(){if(this.is_fork)return!0;for(const r of d(this,Ot).keys()){for(var t=r,n=!1;t.parent!==null;){if(d(this,mt).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},vr=function(){var u,c,h;if(N(this,Kn,!0),ya++>1e3&&(Y(this,J,Fn).call(this),Qi()),!Y(this,J,Us).call(this)){for(const f of d(this,zt))d(this,pt).delete(f),ue(f,Ee),this.schedule(f);for(const f of d(this,pt))ue(f,yt),this.schedule(f)}const t=d(this,je);N(this,je,[]),this.apply();var n=Dn=[],r=[],s=$r=[];for(const f of t)try{Y(this,J,Ks).call(this,f,n,r)}catch(v){throw _o(f),v}if(q=null,s.length>0){var a=vs.ensure();for(const f of s)a.schedule(f)}if(Dn=null,$r=null,Y(this,J,Us).call(this)){Y(this,J,Jr).call(this,r),Y(this,J,Jr).call(this,n);for(const[f,v]of d(this,mt))vo(f,v);s.length>0&&Y(u=q,J,vr).call(u);return}const o=Y(this,J,uo).call(this);if(o){Y(c=o,J,fo).call(c,this);return}d(this,zt).clear(),d(this,pt).clear();for(const f of d(this,zn))f(this);d(this,zn).clear(),Hs=this,wa(r),wa(n),Hs=null,d(this,Ir)?.resolve();var i=q;if(this.linked&&d(this,Gn)===0&&Y(this,J,Fn).call(this),d(this,je).length>0){i===null&&(i=this,Y(this,J,zs).call(this));const f=i;d(f,je).push(...d(this,je).filter(v=>!d(f,je).includes(v)))}i!==null&&Y(h=i,J,vr).call(h)},Ks=function(t,n,r){t.f^=be;for(var s=t.first;s!==null;){var a=s.f,o=(a&(ut|Xt))!==0,i=o&&(a&be)!==0,u=i||(a&Oe)!==0||d(this,mt).has(s);if(!u&&s.fn!==null){o?s.f^=be:(a&Jn)!==0?n.push(s):Fr(s)&&((a&it)!==0&&d(this,pt).add(s),er(s));var c=s.first;if(c!==null){s=c;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},uo=function(){for(var t=d(this,Kt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=d(t,Kt)}return null},fo=function(t){var r;for(const[s,a]of t.current)!this.previous.has(s)&&t.previous.has(s)&&this.previous.set(s,t.previous.get(s)),this.current.set(s,a);for(const[s,a]of t.async_deriveds){const o=this.async_deriveds.get(s);o&&a.promise.then(o.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const u of a){var o=u.f;if((o&Ce)!==0)n(u);else{var i=u;o&(Hn|it)&&!this.async_deriveds.has(i)&&(d(this,pt).delete(i),ue(i,Ee),this.schedule(i))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>t.discard()),Y(r=t,J,Fn).call(r),q=this,Y(this,J,vr).call(this)},Jr=function(t){for(var n=0;n!this.current.has(v));if(s.length===0)t&&f.discard();else if(n.length>0){if(t)for(const v of d(this,Yn))f.unskip_effect(v,_=>{var b;(_.f&(it|Hn))!==0?f.schedule(_):Y(b=f,J,Jr).call(b,[_])});f.activate();var a=new Set,o=new Map;for(var i of n)ho(i,s,a,o);o=new Map;var u=[...f.current.keys()].filter(v=>this.current.has(v)?this.current.get(v)[0]!==v.v:!0);if(u.length>0)for(const v of d(this,Mr))(v.f&(et|Oe|os))===0&&ia(v,u,o)&&((v.f&(Hn|it))!==0?(ue(v,Ee),f.schedule(v)):d(f,zt).add(v));if(d(f,je).length>0&&!d(f,vn)){f.apply();for(var c of d(f,je))Y(h=f,J,Ks).call(h,c,[],[]);N(f,je,[])}f.deactivate()}}}},zs=function(){Bn===null?Ts=Bn=this:(N(Bn,dn,this),N(this,Kt,Bn)),Bn=this},Fn=function(){var t=d(this,Kt),n=d(this,dn);t===null?Ts=n:N(t,dn,n),n===null?Bn=t:N(n,Kt,t),this.linked=!1};let Cn=vs;function Ji(e){var t=br;br=!0;try{for(var n;;){if(zi(),q===null)return n;q.flush()}}finally{br=t}}function Qi(){try{Ci()}catch(e){Gt(e,Ws)}}let At=null;function wa(e){var t=e.length;if(t!==0){for(var n=0;n0)){yn.clear();for(const s of At){if((s.f&(et|Oe))!==0)continue;const a=[s];let o=s.parent;for(;o!==null;)At.has(o)&&(At.delete(o),a.push(o)),o=o.parent;for(let i=a.length-1;i>=0;i--){const u=a[i];(u.f&(et|Oe))===0&&er(u)}}At.clear()}}At=null}}function ho(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const a=s.f;(a&Ce)!==0?ho(s,t,n,r):(a&(Hn|it))!==0&&(a&Ee)===0&&ia(s,t,r)&&(ue(s,Ee),la(s))}}function ia(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(gn.call(t,s))return!0;if((s.f&Ce)!==0&&ia(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function la(e){q.schedule(e)}function vo(e,t){if(!((e.f&ut)!==0&&(e.f&be)!==0)){(e.f&Ee)!==0?t.d.push(e):(e.f&yt)!==0&&t.m.push(e),ue(e,be);for(var n=e.first;n!==null;)vo(n,t),n=n.next}}function _o(e){ue(e,be);for(var t=e.first;t!==null;)_o(t),t=t.next}function Xi(e){let t=0,n=xn(0),r;return()=>{fa()&&(l(n),ks(()=>(t===0&&(r=ar(()=>e(()=>yr(n)))),t+=1,()=>{Jt(()=>{t-=1,t===0&&(r?.(),r=void 0,yr(n))})})))}}var Zi=Qn|sr;function el(e,t,n,r){new tl(e,t,n,r)}var Ye,sa,$e,_n,Re,Je,Te,He,It,pn,Vt,$n,Lr,Pr,Mt,_s,fe,nl,rl,sl,Vs,Qr,Xr,Gs,Ys;class tl{constructor(t,n,r,s){D(this,fe);Pe(this,"parent");Pe(this,"is_pending",!1);Pe(this,"transform_error");D(this,Ye);D(this,sa,null);D(this,$e);D(this,_n);D(this,Re);D(this,Je,null);D(this,Te,null);D(this,He,null);D(this,It,null);D(this,pn,0);D(this,Vt,0);D(this,$n,!1);D(this,Lr,new Set);D(this,Pr,new Set);D(this,Mt,null);D(this,_s,Xi(()=>(N(this,Mt,xn(d(this,pn))),()=>{N(this,Mt,null)})));N(this,Ye,t),N(this,$e,n),N(this,_n,a=>{var o=z;o.b=this,o.f|=Fs,r(a)}),this.parent=z.b,this.transform_error=s??this.parent?.transform_error??(a=>a),N(this,Re,ha(()=>{Y(this,fe,Vs).call(this)},Zi))}defer_effect(t){co(t,d(this,Lr),d(this,Pr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!d(this,$e).pending}update_pending_count(t,n){Y(this,fe,Gs).call(this,t,n),N(this,pn,d(this,pn)+t),!(!d(this,Mt)||d(this,$n))&&(N(this,$n,!0),Jt(()=>{N(this,$n,!1),d(this,Mt)&&Zn(d(this,Mt),d(this,pn))}))}get_effect_pending(){return d(this,_s).call(this),l(d(this,Mt))}error(t){if(!d(this,$e).onerror&&!d(this,$e).failed)throw t;q?.is_fork?(d(this,Je)&&q.skip_effect(d(this,Je)),d(this,Te)&&q.skip_effect(d(this,Te)),d(this,He)&&q.skip_effect(d(this,He)),q.on_fork_commit(()=>{Y(this,fe,Ys).call(this,t)})):Y(this,fe,Ys).call(this,t)}}Ye=new WeakMap,sa=new WeakMap,$e=new WeakMap,_n=new WeakMap,Re=new WeakMap,Je=new WeakMap,Te=new WeakMap,He=new WeakMap,It=new WeakMap,pn=new WeakMap,Vt=new WeakMap,$n=new WeakMap,Lr=new WeakMap,Pr=new WeakMap,Mt=new WeakMap,_s=new WeakMap,fe=new WeakSet,nl=function(){try{N(this,Je,Qe(()=>d(this,_n).call(this,d(this,Ye))))}catch(t){this.error(t)}},rl=function(t){const n=d(this,$e).failed;n&&N(this,He,Qe(()=>{n(d(this,Ye),()=>t,()=>()=>{})}))},sl=function(){const t=d(this,$e).pending;t&&(this.is_pending=!0,N(this,Te,Qe(()=>t(d(this,Ye)))),Jt(()=>{var n=N(this,It,document.createDocumentFragment()),r=Nt();n.append(r),N(this,Je,Y(this,fe,Xr).call(this,()=>Qe(()=>d(this,_n).call(this,r)))),d(this,Vt)===0&&(d(this,Ye).before(n),N(this,It,null),wn(d(this,Te),()=>{N(this,Te,null)}),Y(this,fe,Qr).call(this,q))}))},Vs=function(){try{if(this.is_pending=this.has_pending_snippet(),N(this,Vt,0),N(this,pn,0),N(this,Je,Qe(()=>{d(this,_n).call(this,d(this,Ye))})),d(this,Vt)>0){var t=N(this,It,document.createDocumentFragment());pa(d(this,Je),t);const n=d(this,$e).pending;N(this,Te,Qe(()=>n(d(this,Ye))))}else Y(this,fe,Qr).call(this,q)}catch(n){this.error(n)}},Qr=function(t){this.is_pending=!1,t.transfer_effects(d(this,Lr),d(this,Pr))},Xr=function(t){var n=z,r=K,s=Fe;wt(d(this,Re)),nt(d(this,Re)),Xn(d(this,Re).ctx);try{return Cn.ensure(),t()}catch(a){return io(a),null}finally{wt(n),nt(r),Xn(s)}},Gs=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&Y(r=this.parent,fe,Gs).call(r,t,n);return}N(this,Vt,d(this,Vt)+t),d(this,Vt)===0&&(Y(this,fe,Qr).call(this,n),d(this,Te)&&wn(d(this,Te),()=>{N(this,Te,null)}),d(this,It)&&(d(this,Ye).before(d(this,It)),N(this,It,null)))},Ys=function(t){d(this,Je)&&(Be(d(this,Je)),N(this,Je,null)),d(this,Te)&&(Be(d(this,Te)),N(this,Te,null)),d(this,He)&&(Be(d(this,He)),N(this,He,null));var n=d(this,$e).onerror;let r=d(this,$e).failed;var s=!1,a=!1;const o=()=>{if(s){Ui();return}s=!0,a&&Ii(),d(this,He)!==null&&wn(d(this,He),()=>{N(this,He,null)}),Y(this,fe,Xr).call(this,()=>{Y(this,fe,Vs).call(this)})},i=u=>{try{a=!0,n?.(u,o),a=!1}catch(c){Gt(c,d(this,Re)&&d(this,Re).parent)}r&&N(this,He,Y(this,fe,Xr).call(this,()=>{try{return Qe(()=>{var c=z;c.b=this,c.f|=Fs,r(d(this,Ye),()=>u,()=>o)})}catch(c){return Gt(c,d(this,Re).parent),null}}))};Jt(()=>{var u;try{u=this.transform_error(t)}catch(c){Gt(c,d(this,Re)&&d(this,Re).parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(i,c=>Gt(c,d(this,Re)&&d(this,Re).parent)):i(u)})};function al(e,t,n,r){const s=xr;var a=e.filter(v=>!v.settled);if(n.length===0&&a.length===0){r(t.map(s));return}var o=z,i=ol(),u=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(v=>v.promise)):null;function c(v){if((o.f&et)===0){i();try{r(v)}catch(_){Gt(_,o)}ls()}}var h=po();if(n.length===0){u.then(()=>c(t.map(s))).finally(h);return}function f(){Promise.all(n.map(v=>il(v))).then(v=>c([...t.map(s),...v])).catch(v=>Gt(v,o)).finally(h)}u?u.then(()=>{i(),f(),ls()}):f()}function ol(){var e=z,t=K,n=Fe,r=q;return function(a=!0){wt(e),nt(t),Xn(n),a&&(e.f&et)===0&&(r?.activate(),r?.apply())}}function ls(e=!0){wt(null),nt(null),Xn(null),e&&q?.deactivate()}function po(){var e=z,t=e.b,n=q,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 xr(e){var t=Ce|Ee;return z!==null&&(z.f|=sr),{ctx:Fe,deps:null,effects:null,equals:ro,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:z,ac:null}}const Ur=Symbol("obsolete");function il(e,t,n){let r=z;r===null&&yi();var s=void 0,a=xn(ge),o=!K,i=new Set;return yl(()=>{var u=z,c=Za();s=c.promise;try{Promise.resolve(e()).then(c.resolve,_=>{_!==bs&&c.reject(_)}).finally(ls)}catch(_){c.reject(_),ls()}var h=q;if(o){if((u.f&An)!==0)var f=po();if(r.b.is_rendered())h.async_deriveds.get(u)?.reject(Ur);else for(const _ of i.values())_.reject(Ur);i.add(c),h.async_deriveds.set(u,c)}const v=(_,b=void 0)=>{f?.(),i.delete(c),b!==Ur&&(h.activate(),b?(a.f|=$t,Zn(a,b)):((a.f&$t)!==0&&(a.f^=$t),Zn(a,_)),h.deactivate())};c.promise.then(v,_=>v(null,_||"unknown"))}),da(()=>{for(const u of i)u.reject(Ur)}),new Promise(u=>{function c(h){function f(){h===s?u(a):c(s)}h.then(f,f)}c(s)})}function U(e){const t=xr(e);return Lo(t),t}function mo(e){const t=xr(e);return t.equals=so,t}function ll(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!yo&&fl()}return t}function fl(){yo=!1;for(const e of cs){(e.f&be)!==0&&ue(e,yt);let t;try{t=Fr(e)}catch{t=!0}t&&er(e)}cs.clear()}function yr(e){X(e,e.v+1)}function wo(e,t,n){var r=e.reactions;if(r!==null)for(var s=r.length,a=0;a{if(kn===a)return i();var u=K,c=kn;nt(null),Ca(a);var h=i();return nt(u),Ca(c),h};return r&&n.set("length",de(e.length)),new Proxy(e,{defineProperty(i,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ai();var h=n.get(u);return h===void 0?o(()=>{var f=de(c.value);return n.set(u,f),f}):X(h,c.value,!0),!0},deleteProperty(i,u){var c=n.get(u);if(c===void 0){if(u in i){const h=o(()=>de(ge));n.set(u,h),yr(s)}}else X(c,ge),yr(s);return!0},get(i,u,c){if(u===bn)return e;var h=n.get(u),f=u in i;if(h===void 0&&(!f||jn(i,u)?.writable)&&(h=o(()=>{var _=Lt(f?i[u]:ge),b=de(_);return b}),n.set(u,h)),h!==void 0){var v=l(h);return v===ge?void 0:v}return Reflect.get(i,u,c)},getOwnPropertyDescriptor(i,u){var c=Reflect.getOwnPropertyDescriptor(i,u);if(c&&"value"in c){var h=n.get(u);h&&(c.value=l(h))}else if(c===void 0){var f=n.get(u),v=f?.v;if(f!==void 0&&v!==ge)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return c},has(i,u){if(u===bn)return!0;var c=n.get(u),h=c!==void 0&&c.v!==ge||Reflect.has(i,u);if(c!==void 0||z!==null&&(!h||jn(i,u)?.writable)){c===void 0&&(c=o(()=>{var v=h?Lt(i[u]):ge,_=de(v);return _}),n.set(u,c));var f=l(c);if(f===ge)return!1}return h},set(i,u,c,h){var f=n.get(u),v=u in i;if(r&&u==="length")for(var _=c;_de(ge)),n.set(_+"",b))}if(f===void 0)(!v||jn(i,u)?.writable)&&(f=o(()=>de(void 0)),X(f,Lt(c)),n.set(u,f));else{v=f.v!==ge;var O=o(()=>Lt(c));X(f,O)}var m=Reflect.getOwnPropertyDescriptor(i,u);if(m?.set&&m.set.call(h,c),!v){if(r&&typeof u=="string"){var A=n.get("length"),T=Number(u);Number.isInteger(T)&&T>=A.v&&X(A,T+1)}yr(s)}return!0},ownKeys(i){l(s);var u=Reflect.ownKeys(i).filter(f=>{var v=n.get(f);return v===void 0||v.v!==ge});for(var[c,h]of n)h.v!==ge&&!(c in i)&&u.push(c);return u},setPrototypeOf(){Ti()}})}function ka(e){try{if(e!==null&&typeof e=="object"&&bn in e)return e[bn]}catch{}return e}function dl(e,t){return Object.is(ka(e),ka(t))}var us,ko,So,Eo;function hl(){if(us===void 0){us=window,ko=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;So=jn(t,"firstChild").get,Eo=jn(t,"nextSibling").get,ba(e)&&(e[qs]=void 0,e[Gr]=null,e[js]=void 0,e.__e=void 0),ba(n)&&(n[hr]=void 0)}}function Nt(e=""){return document.createTextNode(e)}function fs(e){return So.call(e)}function Br(e){return Eo.call(e)}function w(e,t){return fs(e)}function Se(e,t=!1){{var n=fs(e);return n instanceof Comment&&n.data===""?Br(n):n}}function k(e,t=1,n=!1){let r=e;for(;t--;)r=Br(r);return r}function vl(e){e.textContent=""}function Co(){return!1}function _l(e,t,n){return document.createElementNS(no,e,void 0)}let Sa=!1;function pl(){Sa||(Sa=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Yr]?.()})},{capture:!0}))}function ys(e){var t=K,n=z;nt(null),wt(null);try{return e()}finally{nt(t),wt(n)}}function ua(e,t,n,r=n){e.addEventListener(t,()=>ys(n));const s=e[Yr];s?e[Yr]=()=>{s(),r(!0)}:e[Yr]=()=>r(!0),pl()}function ml(e){z===null&&(K===null&&Ei(),Si()),Ft&&ki()}function gl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Dt(e,t){var n=z;n!==null&&(n.f&Oe)!==0&&(e|=Oe);var r={ctx:Fe,deps:null,nodes:null,f:e|Ee|Ze,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};q?.register_created_effect(r);var s=r;if((e&Jn)!==0)Dn!==null?Dn.push(r):Cn.ensure().schedule(r);else if(t!==null){try{er(r)}catch(o){throw Be(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&sr)===0&&(s=s.first,(e&it)!==0&&(e&Qn)!==0&&s!==null&&(s.f|=Qn))}if(s!==null&&(s.parent=n,n!==null&&gl(s,n),K!==null&&(K.f&Ce)!==0&&(e&Xt)===0)){var a=K;(a.effects??(a.effects=[])).push(s)}return r}function fa(){return K!==null&&!ct}function da(e){const t=Dt(gs,null);return ue(t,be),t.teardown=e,t}function ws(e){ml();var t=z.f,n=!K&&(t&ut)!==0&&(t&An)===0;if(n){var r=Fe;(r.e??(r.e=[])).push(e)}else return xo(e)}function xo(e){return Dt(Jn|pi,e)}function bl(e){Cn.ensure();const t=Dt(Xt|sr,e);return(n={})=>new Promise(r=>{n.outro?wn(t,()=>{Be(t),r(void 0)}):(Be(t),r(void 0))})}function Ao(e){return Dt(Jn,e)}function yl(e){return Dt(Hn|sr,e)}function ks(e,t=0){return Dt(gs|t,e)}function B(e,t=[],n=[],r=[]){al(r,t,n,s=>{Dt(gs,()=>e(...s.map(l)))})}function ha(e,t=0){var n=Dt(it|t,e);return n}function Qe(e){return Dt(ut|sr,e)}function To(e){var t=e.teardown;if(t!==null){const n=Ft,r=K;Ea(!0),nt(null);try{t.call(null)}finally{Ea(n),nt(r)}}}function va(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&ys(()=>{s.abort(bs)});var r=n.next;(n.f&Xt)!==0?n.parent=null:Be(n,t),n=r}}function wl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ut)===0&&Be(t),t=n}}function Be(e,t=!0){var n=!1;(t||(e.f&_i)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(kl(e.nodes.start,e.nodes.end),n=!0),ue(e,Ds),va(e,t&&!n),Ar(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)a.stop();To(e),e.f^=Ds,e.f|=et;var s=e.parent;s!==null&&s.first!==null&&Oo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function kl(e,t){for(;e!==null;){var n=e===t?null:Br(e);e.remove(),e=n}}function Oo(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 wn(e,t,n=!0){var r=[];Io(e,r,!0);var s=()=>{n&&Be(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||s();for(var i of r)i.out(o)}else s()}function Io(e,t,n){if((e.f&Oe)===0){e.f^=Oe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)(i.is_global||n)&&t.push(i);for(var s=e.first;s!==null;){var a=s.next;if((s.f&Xt)===0){var o=(s.f&Qn)!==0||(s.f&ut)!==0&&(e.f&it)!==0;Io(s,t,o?n:!1)}s=a}}}function _a(e){Mo(e,!0)}function Mo(e,t){if((e.f&Oe)!==0){e.f^=Oe,(e.f&be)===0&&(ue(e,Ee),Cn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Qn)!==0||(n.f&ut)!==0;Mo(n,s?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(const o of a)(o.is_global||t)&&o.in()}}function pa(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Br(n);t.append(n),n=s}}let Zr=!1,Ft=!1;function Ea(e){Ft=e}let K=null,ct=!1;function nt(e){K=e}let z=null;function wt(e){z=e}let tt=null;function Lo(e){K!==null&&(tt===null?tt=[e]:tt.push(e))}let Ne=null,qe=0,Ge=null;function Sl(e){Ge=e}let Po=1,un=0,kn=un;function Ca(e){kn=e}function Ro(){return++Po}function Fr(e){var t=e.f;if((t&Ee)!==0)return!0;if(t&Ce&&(e.f&=~En),(t&yt)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&Ze)!==0&<===null&&ue(e,be)}return!1}function No(e,t,n=!0){var r=e.reactions;if(r!==null&&!(tt!==null&&gn.call(tt,e)))for(var s=0;s{e.ac.abort(bs)}),e.ac=null);try{e.f|=is;var h=e.fn,f=h();e.f|=An;var v=e.deps,_=q?.is_fork;if(Ne!==null){var b;if(_||Ar(e,qe),v!==null&&qe>0)for(v.length=qe+Ne.length,b=0;bn?.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Jt(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function jo(e,t,n,r,s){var a={capture:r,passive:s},o=Tl(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&da(()=>{t.removeEventListener(e,o,a)})}function se(e,t,n){(t[fn]??(t[fn]={}))[e]=n}function In(e){for(var t=0;t{throw m});throw v}}finally{e[fn]=t,delete e.currentTarget,nt(h),wt(f)}}}const Ol=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Il(e){return Ol?.createHTML(e)??e}function Ml(e){var t=_l("template");return t.innerHTML=Il(e.replaceAll("","")),t.content}function ds(e,t){var n=z;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function x(e,t){var n=(t&qi)!==0,r=(t&ji)!==0,s,a=!e.startsWith("");return()=>{s===void 0&&(s=Ml(a?e:""+e),n||(s=fs(s)));var o=r||ko?document.importNode(s,!0):s.cloneNode(!0);if(n){var i=fs(o),u=o.lastChild;ds(i,u)}else ds(o,o);return o}}function Ll(e=""){{var t=Nt(e+"");return ds(t,t),t}}function Ho(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Nt();return e.append(t,n),ds(t,n),e}function S(e,t){e!==null&&e.before(t)}function H(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[hr]??(e[hr]=e.nodeValue))&&(e[hr]=n,e.nodeValue=`${n}`)}function Ss(e,t){return Pl(e,t)}const Kr=new Map;function Pl(e,{target:t,anchor:n,props:r={},events:s,context:a,intro:o=!0,transformError:i}){hl();var u=void 0,c=bl(()=>{var h=n??t.appendChild(Nt());el(h,{pending:()=>{}},_=>{Tn({});var b=Fe;a&&(b.c=a),s&&(r.$$events=s),u=e(_,r)||{},On()},i);var f=new Set,v=_=>{for(var b=0;b<_.length;b++){var O=_[b];if(!f.has(O)){f.add(O);var m=Al(O);for(const M of[t,document]){var A=Kr.get(M);A===void 0&&(A=new Map,Kr.set(M,A));var T=A.get(O);T===void 0?(M.addEventListener(O,Js,{passive:m}),A.set(O,1)):A.set(O,T+1)}}}};return v(ms(qo)),$s.add(v),()=>{for(var _ of f)for(const m of[t,document]){var b=Kr.get(m),O=b.get(_);--O==0?(m.removeEventListener(_,Js),b.delete(_),b.size===0&&Kr.delete(m)):b.set(_,O)}$s.delete(v),h!==n&&h.parentNode?.removeChild(h)}});return Qs.set(u,c),u}let Qs=new WeakMap;function or(e,t){const n=Qs.get(e);return n?(Qs.delete(e),n(t)):Promise.resolve()}var ot,gt,We,mn,Rr,Nr,ps;class Rl{constructor(t,n=!0){Pe(this,"anchor");D(this,ot,new Map);D(this,gt,new Map);D(this,We,new Map);D(this,mn,new Set);D(this,Rr,!0);D(this,Nr,t=>{if(d(this,ot).has(t)){var n=d(this,ot).get(t),r=d(this,gt).get(n);if(r)_a(r),d(this,mn).delete(n);else{var s=d(this,We).get(n);s&&(d(this,gt).set(n,s.effect),d(this,We).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,o]of d(this,ot)){if(d(this,ot).delete(a),a===t)break;const i=d(this,We).get(o);i&&(Be(i.effect),d(this,We).delete(o))}for(const[a,o]of d(this,gt)){if(a===n||d(this,mn).has(a))continue;const i=()=>{if(Array.from(d(this,ot).values()).includes(a)){var c=document.createDocumentFragment();pa(o,c),c.append(Nt()),d(this,We).set(a,{effect:o,fragment:c})}else Be(o);d(this,mn).delete(a),d(this,gt).delete(a)};d(this,Rr)||!r?(d(this,mn).add(a),wn(o,i,!1)):i()}}});D(this,ps,t=>{d(this,ot).delete(t);const n=Array.from(d(this,ot).values());for(const[r,s]of d(this,We))n.includes(r)||(Be(s.effect),d(this,We).delete(r))});this.anchor=t,N(this,Rr,n)}ensure(t,n){var r=q,s=Co();if(n&&!d(this,gt).has(t)&&!d(this,We).has(t))if(s){var a=document.createDocumentFragment(),o=Nt();a.append(o),d(this,We).set(t,{effect:Qe(()=>n(o)),fragment:a})}else d(this,gt).set(t,Qe(()=>n(this.anchor)));if(d(this,ot).set(r,t),s){for(const[i,u]of d(this,gt))i===t?r.unskip_effect(u):r.skip_effect(u);for(const[i,u]of d(this,We))i===t?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(d(this,Nr)),r.ondiscard(d(this,ps))}else d(this,Nr).call(this,r)}}ot=new WeakMap,gt=new WeakMap,We=new WeakMap,mn=new WeakMap,Rr=new WeakMap,Nr=new WeakMap,ps=new WeakMap;function W(e,t,n=!1){var r=new Rl(e),s=n?Qn:0;function a(o,i){r.ensure(o,i)}ha(()=>{var o=!1;t((i,u=0)=>{o=!0,a(u,i)}),o||a(-1,null)},s)}function zr(e,t){return t}function Nl(e,t,n){for(var r=[],s=t.length,a,o=t.length,i=0;i{if(a){if(a.pending.delete(f),a.done.add(f),a.pending.size===0){var v=e.outrogroups;Xs(e,ms(a.done)),v.delete(a),v.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=r.length===0&&n!==null;if(u){var c=n,h=c.parentNode;vl(h),h.append(c),e.items.clear()}Xs(e,t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(a)}function Xs(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const o of e.pending.values())for(const i of o)r.add(e.items.get(i).e)}for(var s=0;s{var M=n();return aa(M)?M:M==null?[]:ms(M)}),v,_=new Map,b=!0;function O(M){(T.effect.f&et)===0&&(T.pending.delete(M),T.fallback=h,Bl(T,v,o,t,r),h!==null&&(v.length===0?(h.f&bt)===0?_a(h):(h.f^=bt,_r(h,null,o)):wn(h,()=>{h=null})))}function m(M){T.pending.delete(M)}var A=ha(()=>{v=l(f);for(var M=v.length,F=new Set,Z=q,ae=Co(),re=0;rea(o)):(h=Qe(()=>a(Aa??(Aa=Nt()))),h.f|=bt)),M>F.size&&wi(),!b)if(_.set(Z,F),ae){for(const[qt,De]of i)F.has(qt)||Z.skip_effect(De.e);Z.oncommit(O),Z.ondiscard(m)}else O(Z);l(f)}),T={effect:A,items:i,pending:_,outrogroups:null,fallback:h};b=!1}function dr(e){for(;e!==null&&(e.f&ut)===0;)e=e.next;return e}function Bl(e,t,n,r,s){var a=(r&Pi)!==0,o=t.length,i=e.items,u=dr(e.effect.first),c,h=null,f,v=[],_=[],b,O,m,A;if(a)for(A=0;A0){var pe=(r&to)!==0&&o===0?n:null;if(a){for(A=0;A{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function Fl(e,t,n,r,s,a,o,i){var u=(o&Mi)!==0?(o&Ri)===0?ul(n,!1,!1):xn(n):null,c=(o&Li)!==0?xn(s):null;return{v:u,i:c,e:Qe(()=>(a(t,u??n,c??s,i),()=>{e.delete(r)}))}}function _r(e,t,n){if(e.nodes)for(var r=e.nodes.start,s=e.nodes.end,a=t&&(t.f&bt)===0?t.nodes.start:n;r!==null;){var o=Br(r);if(a.before(r),r===s)return;r=o}}function Ut(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const Ta=[...` -\r\f \v\uFEFF`];function Dl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,o=0;(o=r.indexOf(s,o))>=0;){var i=o+a;(o===0||Ta.includes(r[o-1]))&&(i===r.length||Ta.includes(r[i]))?r=(o===0?"":r.substring(0,o))+r.substring(i+1):o=i}}return r===""?null:r}function ql(e,t){return e==null?null:String(e)}function Ke(e,t,n,r,s,a){var o=e[qs];if(o!==n||o===void 0){var i=Dl(n,r,a);i==null?e.removeAttribute("class"):e.className=i,e[qs]=n}else if(a&&s!==a)for(var u in a){var c=!!a[u];(s==null||c!==!!s[u])&&e.classList.toggle(u,c)}return a}function Tt(e,t,n,r){var s=e[js];if(s!==t){var a=ql(t);a==null?e.removeAttribute("style"):e.style.cssText=a,e[js]=t}return r}function Wo(e,t,n=!1){if(e.multiple){if(t==null)return;if(!aa(t))return Wi();for(var r of e.options)r.selected=t.includes(wr(r));return}for(r of e.options){var s=wr(r);if(dl(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function jl(e){var t=new MutationObserver(()=>{Wo(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),da(()=>{t.disconnect()})}function Zs(e,t,n=t){var r=new WeakSet,s=!0;ua(e,"change",a=>{var o=a?"[selected]":":checked",i;if(e.multiple)i=[].map.call(e.querySelectorAll(o),wr);else{var u=e.querySelector(o)??e.querySelector("option:not([disabled])");i=u&&wr(u)}n(i),e.__value=i,q!==null&&r.add(q)}),Ao(()=>{var a=t();if(e===document.activeElement){var o=q;if(r.has(o))return}if(Wo(e,a,s),s&&a===void 0){var i=e.querySelector(":checked");i!==null&&(a=wr(i),n(a))}e.__value=a,s=!1}),jl(e)}function wr(e){return"__value"in e?e.__value:e.value}const Hl=Symbol("is custom element"),Wl=Symbol("is html");function ie(e,t,n,r){var s=Ul(e);s[t]!==(s[t]=n)&&(t==="loading"&&(e[gi]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Kl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ul(e){return e[Gr]??(e[Gr]={[Hl]:e.nodeName.includes("-"),[Wl]:e.namespaceURI===no})}var Oa=new Map;function Kl(e){var t=e.getAttribute("is")||e.nodeName,n=Oa.get(t);if(n)return n;Oa.set(t,n=[]);for(var r,s=e,a=Element.prototype;a!==s;){r=fi(s);for(var o in r)r[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&n.push(o);s=Qa(s)}return n}function ea(e,t,n=t){var r=new WeakSet;ua(e,"input",async s=>{var a=s?e.defaultValue:e.value;if(a=Is(e)?Ms(a):a,n(a),q!==null&&r.add(q),await Cl(),a!==(a=t())){var o=e.selectionStart,i=e.selectionEnd,u=e.value.length;if(e.value=a??"",i!==null){var c=e.value.length;o===i&&i===u&&c>u?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(i,c))}}}),ar(t)==null&&e.value&&(n(Is(e)?Ms(e.value):e.value),q!==null&&r.add(q)),ks(()=>{var s=t();if(e===document.activeElement){var a=q;if(r.has(a))return}Is(e)&&s===Ms(e.value)||e.type==="date"&&!s&&!e.value||s!==e.value&&(e.value=s??"")})}function Uo(e,t,n=t){ua(e,"change",r=>{var s=r?e.defaultChecked:e.checked;n(s)}),ar(t)==null&&n(e.checked),ks(()=>{var r=t();e.checked=!!r})}function Is(e){var t=e.type;return t==="number"||t==="range"}function Ms(e){return e===""?null:+e}function Ls(e,t){return e===t||e?.[bn]===t}function zl(e={},t,n,r){var s=Fe.r,a=z;return Ao(()=>{var o,i;return ks(()=>{o=i,i=[],ar(()=>{Ls(n(...i),e)||(t(e,...i),o&&Ls(n(...o),e)&&t(null,...o))})}),()=>{let u=a;for(;u!==s&&u.parent!==null&&u.parent.f&Ds;)u=u.parent;const c=()=>{i&&Ls(n(...i),e)&&t(null,...i)},h=u.teardown;u.teardown=()=>{c(),h?.()}}}),e}function Yt(e,t,n,r){var s=!0,a=(n&Fi)!==0,o=(n&Di)!==0,i=r,u=!0,c=void 0,h=()=>o&&s?(c??(c=xr(r)),l(c)):(u&&(u=!1,i=o?ar(r):r),i);let f;if(a){var v=bn in e||mi in e;f=jn(e,t)?.set??(v&&t in e?F=>e[t]=F:void 0)}var _,b=!1;a?[_,b]=Gi(()=>e[t]):_=e[t],_===void 0&&r!==void 0&&(_=h(),f&&(xi(),f(_)));var O;if(O=()=>{var F=e[t];return F===void 0?h():(u=!0,F)},(n&Bi)===0)return O;if(f){var m=e.$$legacy;return(function(F,Z){return arguments.length>0?((!Z||m||b)&&f(Z?O():F),F):O()})}var A=!1,T=((n&Ni)!==0?xr:mo)(()=>(A=!1,O()));a&&l(T);var M=z;return(function(F,Z){if(arguments.length>0){const ae=Z?l(T):a?Lt(F):F;return X(T,ae),A=!0,i!==void 0&&(i=ae),F}return Ft&&A||(M.f&et)!==0?T.v:l(T)})}function Ko(e){Fe===null&&bi(),ws(()=>{const t=ar(e);if(typeof t=="function")return t})}const zo="[data-v-app]",Vl=["header","content","footer"];let Xe=null,xt=null;function Gl(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 Yl(){if(typeof document>"u")return!1;const t=document.querySelector(zo)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Xe=null,!1):(Xe=t,xt=null,!0)}function $l(){if(xt!==null)return xt;const e=typeof document<"u"?document.querySelector(zo)?.__vue_app__:null;if(!e)return xt=!1,!1;const t=e.config?.globalProperties??{};if(typeof Xe?.$history?.pause=="function"&&typeof Xe?.$history?.resume=="function")return xt={pause:()=>Xe.$history.pause(),resume:()=>Xe.$history.resume()},xt;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(xt={pause:()=>n.history.pause(),resume:()=>n.history.resume()},xt):(xt=!1,!1)}function Jl(e){const t=$l();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function Qt(e){if(!Xe||!e)return null;for(const t of Vl){const n=Xe[t];if(!Array.isArray(n))continue;const r=n.find(s=>s&&s.id===e);if(r)return r}return null}function Ql(e){const t=Qt(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Vo(t,1,n),n}function Vo(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const s=Qt(r);s&&(n.push({id:s.id,depth:t,label:s.label,name:s.name,settings:s.settings}),Vo(s,t+1,n))}}function Go(){return Xe?Xe.globalClasses:[]}function Ps(e,t){if(!Xe)throw new Error("rebemer: not ready");const n=Xe.globalClasses,r=n.find(o=>o&&o.name===e);if(r)return r.id;const s=new Set(n.map(o=>o?.id).filter(Boolean)),a=Gl(s);return n.push({id:a,name:e,settings:t||{}}),a}function Ia(e,t){const n=Qt(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 Ma(e,t){const n=Qt(e);n&&(n.label=t)}const La="slashed-rebemer-host",Xl="slashed-class-hint",Yo=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],tr="rebemer-class-hint-btn",Zl=50;function ta(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 nr={},Pt=null,kr=null,Sr=null,Wn=null,rr=null;function ec(){if(Pt&&Pt.isConnected)return Pt;let e=document.getElementById(La);e||(e=document.createElement("div"),e.id=La,document.body.appendChild(e));const t=document.createElement("div");return t.id=Xl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

',e.appendChild(t),Pt=t,t}function tc(e,t){const n=t.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight,a=8,o=document.documentElement.clientWidth,i=document.documentElement.clientHeight;let u=n.bottom+a;u+s>i&&n.top-a-s>=0&&(u=n.top-a-s);let c=n.left+n.width/2-r/2;c+r>o-4&&(c=Math.max(4,o-4-r)),c<4&&(c=4),e.style.top=`${Math.round(u)}px`,e.style.left=`${Math.round(c)}px`}function nc(e){const t=e.dataset.sfClass,n=t?ta(t,nr):null;if(!n)return;const r=ec();r.querySelector(".rebemer-class-hint__name").textContent=`.${n.name}`;const s=r.querySelector(".rebemer-class-hint__cat");s.textContent=n.category||"",s.hidden=!n.category,r.querySelector(".rebemer-class-hint__desc").textContent=n.description,r.hidden=!1,tc(r,e),rr=e}function Tr(){Pt&&(Pt.hidden=!0),rr=null}function Pa(e){nc(e.currentTarget)}function Ra(){Tr()}function rc(e){e.preventDefault(),e.stopPropagation()}function sc(e){e.key==="Escape"&&Tr()}function Na(e){const t=ta(e.textContent,nr);if(t)return t;const n=e.querySelectorAll("span, [contenteditable], .name, .label, a");for(const r of n){const s=ta(r.textContent,nr);if(s)return s}return null}function ac(e){return e.querySelector('.actions, [class*="action"], [class*="icons"], [class*="controls"]')||e}function oc(){const e=document.createElement("span");return e.className=tr,e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","What does this class do?"),e.addEventListener("mouseenter",Pa),e.addEventListener("mouseleave",Ra),e.addEventListener("focus",Pa),e.addEventListener("blur",Ra),e.addEventListener("click",rc),e}function $o(){for(const t of document.querySelectorAll("."+tr)){const n=t.closest("li"),r=n?Na(n):null;r?t.dataset.sfClass!==r.name&&(t.dataset.sfClass=r.name):(rr===t&&Tr(),t.remove())}const e=document.querySelectorAll(Yo.join(","));for(const t of e)for(const n of t.querySelectorAll("li")){if(n.querySelector("."+tr)||n.querySelector("li"))continue;const r=Na(n);if(!r)continue;const s=oc();s.dataset.sfClass=r.name,ac(n).appendChild(s)}}function ic(){Wn===null&&(Wn=setTimeout(()=>{Wn=null,$o()},Zl))}function lc(e){const t=Yo.join(",");for(const n of e){const r=n.target;if(r&&r.nodeType===1){if(r.classList&&r.classList.contains(tr))continue;if(r.closest&&r.closest(t))return!0}for(const s of n.addedNodes)if(s.nodeType===1&&!(s.classList&&s.classList.contains(tr))&&(s.matches&&s.matches(t)||s.closest&&s.closest(t)||s.querySelector&&s.querySelector(t)))return!0}return!1}function cc(e,t,n={}){if(es(),nr=t&&typeof t=="object"?t:{},!e||Object.keys(nr).length===0)return;kr=new AbortController;const{signal:r}=kr;document.addEventListener("keydown",sc,{passive:!0,signal:r}),window.addEventListener("scroll",Tr,{capture:!0,passive:!0,signal:r}),Sr=new MutationObserver(s=>{rr&&!rr.isConnected&&Tr(),lc(s)&&ic()}),Sr.observe(document.body,{childList:!0,subtree:!0}),$o(),n.signal&&(n.signal.aborted?es():n.signal.addEventListener("abort",es,{once:!0}))}function es(){Wn!==null&&(clearTimeout(Wn),Wn=null),Sr&&(Sr.disconnect(),Sr=null),kr&&(kr.abort(),kr=null);try{document.querySelectorAll("."+tr).forEach(e=>e.remove())}catch{}Pt&&(Pt.remove(),Pt=null),rr=null,nr={}}const ts="li.variable-picker-item",ns="slashed-var-swatch",pr="slashed-sf-color-btn",uc=50,Ba=(e,...t)=>console[e]("[slashed-swatches]",...t);function fc(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 na=!1,Or={},Bt=null,Er=null,Un=null,rs=null;function dc(e){if(!Bt)return;const t=e.querySelector('[data-control="text"].color-input');if(!t||t.querySelector("."+pr))return;const n=document.createElement("div");n.className=pr,n.setAttribute("data-balloon","SLASHED Colors"),n.setAttribute("data-balloon-pos","top-right"),n.setAttribute("role","button"),n.setAttribute("tabindex","0");const r=document.createElement("span");r.className=pr+"__dot",r.setAttribute("aria-hidden","true"),n.appendChild(r),n.addEventListener("click",c=>{c.stopPropagation(),Bt&&Bt(t)}),n.addEventListener("keydown",c=>{c.key===" "?(c.preventDefault(),n.click()):c.key==="Enter"&&n.click()});const s=t.querySelector(".variable-picker-button");s&&s.nextSibling?t.insertBefore(n,s.nextSibling):t.appendChild(n);const i=((t.querySelector('input[type="text"]')??t.querySelector('input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])'))?.value??"").match(/^var\((--[^)]+)\)/)?.[1],u=i?Or[i]??null:null;u&&(r.style.background=u,r.style.removeProperty("box-shadow"),n.classList.add(pr+"--active"))}function hc(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 vc(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+ns);r&&r.remove();return}const t=fc(hc(e),Or);let n=e.querySelector(":scope > ."+ns);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=ns,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 Jo(){try{const e=document.querySelectorAll(ts);for(const t of e)vc(t)}catch(e){Ba("warn","swatch pass failed",e)}if(Bt)try{document.querySelectorAll('[data-control="color"]').forEach(dc)}catch(e){Ba("warn","SF button inject failed",e)}}function _c(){Un===null&&(Un=setTimeout(()=>{Un=null,Jo()},uc))}function pc(e){for(const t of e){const n=t.target;if(n&&n.nodeType===1&&n.closest&&(n.closest(ts)||Bt&&n.closest('[data-control="color"]')))return!0;for(const r of t.addedNodes)if(r.nodeType===1&&(r.matches&&r.matches(ts)||r.querySelector&&r.querySelector(ts)||Bt&&(r.matches&&r.matches('[data-control="color"]')||r.querySelector&&r.querySelector('[data-control="color"]'))))return!0}return!1}function mc(e,t,n={}){ss(),na=!!e,Or=t&&typeof t=="object"?t:{},Bt=typeof n.onOpenPanel=="function"?n.onOpenPanel:null,!(!(na&&Object.keys(Or).length>0)&&!Bt)&&(rs=new AbortController,Er=new MutationObserver(s=>{pc(s)&&_c()}),Er.observe(document.body,{childList:!0,subtree:!0}),Jo(),n.signal&&(n.signal.aborted?ss():n.signal.addEventListener("abort",ss,{once:!0})))}function ss(){Un!==null&&(clearTimeout(Un),Un=null),Er&&(Er.disconnect(),Er=null),rs&&(rs.abort(),rs=null);try{document.querySelectorAll("."+ns).forEach(e=>e.remove()),document.querySelectorAll("."+pr).forEach(e=>e.remove())}catch{}na=!1,Or={},Bt=null}const gc="5";var Ja;typeof window<"u"&&((Ja=window.__svelte??(window.__svelte={})).v??(Ja.v=new Set)).add(gc);var bc=x('reBEM');function yc(e,t){Tn(t,!0);function n(s){s.stopPropagation(),s.preventDefault(),t.onActivate?.(t.elementId)}var r=bc();B(()=>{ie(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),ie(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),se("click",r,n),se("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&n(s)),S(e,r),On()}In(["click","keydown"]);function Rt(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 wc=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,kc=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function Fa(e){return e?kc.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:wc.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const Es=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 Sc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)&&t.push(n);return t.sort(),t}const Ec=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function Cc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)||Ec.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const xc=new Set(["add","rename","replace","migrate","mixed"]),Da=new Set(["user","label"]);function Qo(e,t){const n=new Map,r=[];for(const s of e){for(;r.length&&r[r.length-1].depth>=s.depth;)r.pop();const a=s.id===t,o=!a&&s.isBlockRoot===!0;if(a||o){const i=Rt(s.name);i&&s.include!==!1&&(r.push({depth:s.depth,blockName:i}),n.set(s.id,i))}else{const i=r.length?r[r.length-1].blockName:"";i&&n.set(s.id,i)}}return n}function Xo({rootId:e,rows:t,mode:n}){if(!xc.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(c=>c.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};if(!Rt(r.name))return{ok:!1,ops:[],error:"Block name is empty."};const a=[];for(const c of t)!c.isBlockRoot||!c.include||c.id===e||Rt(c.name)||a.push(c.originalLabel||c.id);if(a.length>0)return{ok:!1,ops:[],error:`Block name is empty for: ${a.join(", ")}.`};const o=Qo(t,e),i=[];for(const c of t){if(!c.include)continue;const h=c.id===e,f=!h&&c.isBlockRoot===!0,v=o.get(c.id);if(!v)continue;let _;if(h||f)_=v;else{const b=Rt(c.name);if(!b)continue;_=`${v}__${b}`}i.push({row:c,isRoot:h||f,blockName:v,finalClass:_,modifierSlugs:[],suggestedFrom:c.suggestedFrom||"fallback"})}if(i.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const u=Oc(i);if(!u.ok)return{ok:!1,ops:[],error:u.error};if(n!=="migrate")for(const c of i){const h=Array.isArray(c.row.modifiers)?c.row.modifiers:[];c.modifierSlugs=h.map(f=>Rt(f)).filter(Boolean)}return{ok:!0,ops:i}}function Ac({rootId:e,rows:t,mode:n,syncLabels:r}){const s=Xo({rootId:e,rows:t,mode:n});if(!s.ok)return{ok:!1,error:s.error};const a=s.ops,o=Go();if(n==="migrate"){const c=Tc(a,o);if(!c.ok)return c}const i=new Map;for(const c of a){if(i.has(c.row.id))continue;const h=Qt(c.row.id);if(!h)continue;const f={classIds:qa(h.settings).slice(),label:r?h.label??"":null};if(n==="migrate"&&Array.isArray(c.row.migrateKeys)){const v={};for(const _ of c.row.migrateKeys)Object.prototype.hasOwnProperty.call(h.settings||{},_)&&(v[_]=JSON.parse(JSON.stringify(h.settings[_])));f.migrateKeys=v}i.set(c.row.id,f)}let u=0;try{Jl(()=>{for(const c of a){const h=Qt(c.row.id);if(!h)continue;const f=qa(h.settings),v=c.row.op??"add",_=n==="mixed"?["add","rename","replace"].includes(v)?v:"add":n;let b={};if(_==="rename"&&f.length>0){const A=n==="mixed"&&c.row.renameFamilyId||f[0],T=o.find(M=>M&&M.id===A);T&&T.settings&&(b=JSON.parse(JSON.stringify(T.settings)))}else _==="migrate"&&(b=Zo(h.settings,c.row.migrateKeys));if(_==="migrate"){const A=o.find(T=>T&&T.name===c.finalClass);if(A){(!A.settings||typeof A.settings!="object")&&(A.settings={});for(const[T,M]of Object.entries(b))Object.prototype.hasOwnProperty.call(A.settings,T)||(A.settings[T]=M)}}const O=Ps(c.finalClass,b);let m;switch(_){case"add":case"migrate":m=f.includes(O)?f:[...f,O];break;case"rename":{const A=n==="mixed"&&c.row.renameFamilyId||(f[0]??null),T=[O],M=A?o.find(F=>F&&F.id===A):null;if(M){const F=M.name+"--";for(const Z of f){if(Z===A)continue;const ae=o.find(re=>re&&re.id===Z);if(ae)if(ae.name.startsWith(F)){const re=ae.name.slice(M.name.length),xe=ae.settings?JSON.parse(JSON.stringify(ae.settings)):{};T.push(Ps(c.finalClass+re,xe))}else T.push(Z)}}m=T;break}case"replace":if(n==="mixed"&&c.row.renameFamilyId){const A=o.find(T=>T&&T.id===c.row.renameFamilyId);if(A){const T=A.name+"--",M=f.filter(F=>{if(F===c.row.renameFamilyId)return!1;const Z=o.find(ae=>ae&&ae.id===F);return!Z||!Z.name.startsWith(T)});m=[O,...M]}else m=[O]}else m=[O];break}for(const A of c.modifierSlugs){const T=`${c.finalClass}--${A}`,M=Ps(T,{});m.includes(M)||m.push(M)}if(Ia(c.row.id,m),_==="migrate"&&Ic(h.settings,c.row.migrateKeys),r){const A=Mc(c.finalClass,c.blockName);A&&Ma(c.row.id,A)}u++}})}catch(c){for(const[f,v]of i)try{if(Ia(f,v.classIds),v.migrateKeys){const _=Qt(f);_&&_.settings&&Object.assign(_.settings,v.migrateKeys)}v.label!==null&&Ma(f,v.label)}catch{}const h=c instanceof Error?c.message:String(c);return console.warn("[reBEMer] apply failed after",u,"mutation(s), rolled back:",h),{ok:!1,error:`Operation failed and was rolled back: ${h}`}}return u===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:u}}function Tc(e,t){for(const n of e){const r=t.find(u=>u&&u.name===n.finalClass);if(!r)continue;const s=Qt(n.row.id);if(!s)continue;const a=Zo(s.settings,n.row.migrateKeys),o=r.settings&&typeof r.settings=="object"?r.settings:{},i=[];for(const[u,c]of Object.entries(a))Object.prototype.hasOwnProperty.call(o,u)&&JSON.stringify(o[u])!==JSON.stringify(c)&&i.push(u.replace(/^_/,""));if(i.length>0){const u=i.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${u}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Oc(e){const t=new Map;for(const r of e){const s=t.get(r.finalClass)||[];s.push(r),t.set(r.finalClass,s)}for(const[r,s]of t){if(s.length===1)continue;const a=s.filter(i=>Da.has(i.suggestedFrom));if(a.length>1)return{ok:!1,error:`"${r}" is used by ${a.length} rows. Edit one to make it unique.`};let o=1;for(const i of s)Da.has(i.suggestedFrom)||(i.finalClass=`${r}-${o++}`,i.suggestedFrom="auto-number")}const n=new Map;for(const r of e){const s=n.get(r.finalClass);if(s)return{ok:!1,error:`"${r.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${r.suggestedFrom}). Pick a different name for one of them.`};n.set(r.finalClass,r.suggestedFrom)}return{ok:!0}}function Zo(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)Es.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Ic(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)Es.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function qa(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function Mc(e,t){let n=e;return n===t?ja(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),ja(n.replace(/-/g," ")))}function ja(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const Lc=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"}),ei=new Set(["section","container","block","div"]);function Pc(e,t="item"){return!e||typeof e!="string"||ei.has(e)?t:Lc[e]||t}function Rs(e){return typeof e=="string"&&ei.has(e)}const Rc=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function Nc(e,t,n){const r=new Set(e.filter(Boolean)),s=(..._)=>_.some(b=>r.has(b)),a=s("button","button-group"),o=s("heading"),i=s("text-basic","text"),u=s("image"),c=s("nav-nested","nav-menu"),h=s("form"),f=s("icon","icon-box"),v=s("list");return h?"form":c?"nav":a&&!o&&!i?"actions":u&&!i&&!o&&!a?"media":o&&!i&&!a?"header":i&&!o&&!a?"body":o&&i?"content":o&&a?"header":f&&!i&&!o?"icon-group":v?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var Bc=x(''),Fc=x('BLOCK'),Dc=x('suggested'),qc=x(' '),jc=x(''),Hc=x('
'),Wc=x(''),Uc=x('
'),Kc=x('

No existing classes — a new class will be added instead.

'),zc=x(""),Vc=x('
Family
'),Gc=x('

Will rename

'),Yc=x(""),$c=x('
Family
'),Jc=x('

Will remove the selected family and replace with the new class (empty settings). Other classes kept.

'),Qc=x('

No existing classes — a new class will be created.

'),Xc=x('

All existing classes will be removed from this element.

'),Zc=x(" ",1),eu=x('
',1),tu=x('

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

'),nu=x('

'),ru=x(`A class named already exists. +var ii=Object.defineProperty;var bo=e=>{throw TypeError(e)};var li=(e,t,n)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>li(e,typeof t!="symbol"?t+"":t,n),As=(e,t,n)=>t.has(e)||bo("Cannot "+n);var d=(e,t,n)=>(As(e,t,"read from private field"),n?n.call(e):t.get(e)),D=(e,t,n)=>t.has(e)?bo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(As(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Y=(e,t,n)=>(As(e,t,"access private method"),n);var oo=Array.isArray,ci=Array.prototype.indexOf,gn=Array.prototype.includes,ms=Array.from,ui=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,fi=Object.getOwnPropertyDescriptors,di=Object.prototype,hi=Array.prototype,Xo=Object.getPrototypeOf,yo=Object.isExtensible;const Zo=()=>{};function vi(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const Ce=2,Qn=4,gs=8,ta=1<<24,it=16,ut=32,Xt=64,Fs=128,et=512,be=1024,Ee=2048,yt=4096,Oe=8192,tt=16384,An=32768,Ds=1<<25,Xn=65536,as=1<<17,pi=1<<18,or=1<<19,_i=1<<20,bt=1<<25,En=65536,is=1<<21,Hn=1<<22,$t=1<<23,bn=Symbol("$state"),mi=Symbol("legacy props"),gi=Symbol(""),Gr=Symbol("attributes"),qs=Symbol("class"),js=Symbol("style"),vr=Symbol("text"),Yr=Symbol("form reset"),bs=new class extends Error{constructor(){super(...arguments);Pe(this,"name","StaleReactionError");Pe(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function bi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function yi(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function wi(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ki(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Si(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ei(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ci(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ai(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ti(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Oi(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ii(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Mi=1,Li=2,na=4,Pi=8,Ri=16,Ni=1,Bi=4,Fi=8,Di=16,qi=1,ji=2,ge=Symbol("uninitialized"),ra="http://www.w3.org/1999/xhtml";function Hi(){console.warn("https://svelte.dev/e/derived_inert")}function Wi(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ui(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function sa(e){return e===this.v}function Ki(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function oa(e){return!Ki(e,this.v)}let Fe=null;function Zn(e){Fe=e}function Tn(e,t=!1,n){Fe={p:Fe,i:!1,c:null,e:null,s:e,x:null,r:z,l:null}}function On(e){var t=Fe,n=t.e;if(n!==null){t.e=null;for(var r of n)xa(r)}return t.i=!0,Fe=t.p,{}}function aa(){return!0}let cn=[];function ia(){var e=cn;cn=[],vi(e)}function Jt(e){if(cn.length===0&&!br){var t=cn;queueMicrotask(()=>{t===cn&&ia()})}cn.push(e)}function zi(){for(;cn.length>0;)ia()}function la(e){var t=z;if(t===null)return K.f|=$t,e;if((t.f&An)===0&&(t.f&Qn)===0)throw e;Gt(e,t)}function Gt(e,t){for(;t!==null;){if((t.f&Fs)!==0){if((t.f&An)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Vi=-7169;function ue(e,t){e.f=e.f&Vi|t}function ao(e){(e.f&et)!==0||e.deps===null?ue(e,be):ue(e,yt)}function ca(e){if(e!==null)for(const t of e)(t.f&Ce)===0||(t.f&En)===0||(t.f^=En,ca(t.deps))}function ua(e,t,n){(e.f&Ee)!==0?t.add(e):(e.f&yt)!==0&&n.add(e),ca(e.deps),ue(e,be)}let Wr=!1;function Gi(e){var t=Wr;try{return Wr=!1,[e(),Wr]}finally{Wr=t}}let Ts=null,Bn=null,q=null,Hs=null,lt=null,Ws=null,br=!1,Os=!1,Dn=null,$r=null;var wo=0;let Yi=1;var zn,Kt,dn,Vn,Gn,hn,Yn,Ot,Ir,He,Mr,zt,_t,mt,$n,vn,J,Us,pr,Ks,fa,da,Jr,$i,zs,Fn;const vs=class vs{constructor(){D(this,J);Pe(this,"id",Yi++);D(this,zn,!1);Pe(this,"linked",!0);D(this,Kt,null);D(this,dn,null);Pe(this,"async_deriveds",new Map);Pe(this,"current",new Map);Pe(this,"previous",new Map);Pe(this,"unblocked",new Set);D(this,Vn,new Set);D(this,Gn,new Set);D(this,hn,new Set);D(this,Yn,0);D(this,Ot,new Map);D(this,Ir,null);D(this,He,[]);D(this,Mr,[]);D(this,zt,new Set);D(this,_t,new Set);D(this,mt,new Map);D(this,$n,new Set);Pe(this,"is_fork",!1);D(this,vn,!1)}skip_effect(t){d(this,mt).has(t)||d(this,mt).set(t,{d:[],m:[]}),d(this,$n).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=d(this,mt).get(t);if(r){d(this,mt).delete(t);for(var s of r.d)ue(s,Ee),n(s);for(s of r.m)ue(s,yt),n(s)}d(this,$n).add(t)}capture(t,n,r=!1){t.v!==ge&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&$t)===0&&(this.current.set(t,[n,r]),lt?.set(t,n)),this.is_fork||(t.v=n)}activate(){q=this}deactivate(){q=null,lt=null}flush(){try{Os=!0,q=this,Y(this,J,pr).call(this)}finally{wo=0,Ws=null,Dn=null,$r=null,Os=!1,q=null,lt=null,yn.clear()}}discard(){for(const t of d(this,Gn))t(this);d(this,Gn).clear(),d(this,hn).clear(),Y(this,J,Fn).call(this)}register_created_effect(t){d(this,Mr).push(t)}increment(t,n){if(N(this,Yn,d(this,Yn)+1),t){let r=d(this,Ot).get(n)??0;d(this,Ot).set(n,r+1)}}decrement(t,n){if(N(this,Yn,d(this,Yn)-1),t){let r=d(this,Ot).get(n)??0;r===1?d(this,Ot).delete(n):d(this,Ot).set(n,r-1)}d(this,vn)||(N(this,vn,!0),Jt(()=>{N(this,vn,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)d(this,zt).add(r);for(const r of n)d(this,_t).add(r);t.clear(),n.clear()}oncommit(t){d(this,Vn).add(t)}ondiscard(t){d(this,Gn).add(t)}on_fork_commit(t){d(this,hn).add(t)}run_fork_commit_callbacks(){for(const t of d(this,hn))t(this);d(this,hn).clear()}settled(){return(d(this,Ir)??N(this,Ir,ea())).promise}static ensure(){var t;if(q===null){const n=q=new vs;Y(t=n,J,zs).call(t),!Os&&!br&&Jt(()=>{d(n,zn)||n.flush()})}return q}apply(){{lt=null;return}}schedule(t){if(Ws=t,t.b?.is_pending&&(t.f&(Qn|gs|ta))!==0&&(t.f&An)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(Dn!==null&&n===z&&(K===null||(K.f&Ce)===0))return;if((r&(Xt|ut))!==0){if((r&be)===0)return;n.f^=be}}d(this,He).push(n)}};zn=new WeakMap,Kt=new WeakMap,dn=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,hn=new WeakMap,Yn=new WeakMap,Ot=new WeakMap,Ir=new WeakMap,He=new WeakMap,Mr=new WeakMap,zt=new WeakMap,_t=new WeakMap,mt=new WeakMap,$n=new WeakMap,vn=new WeakMap,J=new WeakSet,Us=function(){if(this.is_fork)return!0;for(const r of d(this,Ot).keys()){for(var t=r,n=!1;t.parent!==null;){if(d(this,mt).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},pr=function(){var c,u,h;if(N(this,zn,!0),wo++>1e3&&(Y(this,J,Fn).call(this),Qi()),!Y(this,J,Us).call(this)){for(const f of d(this,zt))d(this,_t).delete(f),ue(f,Ee),this.schedule(f);for(const f of d(this,_t))ue(f,yt),this.schedule(f)}const t=d(this,He);N(this,He,[]),this.apply();var n=Dn=[],r=[],s=$r=[];for(const f of t)try{Y(this,J,Ks).call(this,f,n,r)}catch(v){throw pa(f),v}if(q=null,s.length>0){var o=vs.ensure();for(const f of s)o.schedule(f)}if(Dn=null,$r=null,Y(this,J,Us).call(this)){Y(this,J,Jr).call(this,r),Y(this,J,Jr).call(this,n);for(const[f,v]of d(this,mt))va(f,v);s.length>0&&Y(c=q,J,pr).call(c);return}const a=Y(this,J,fa).call(this);if(a){Y(u=a,J,da).call(u,this);return}d(this,zt).clear(),d(this,_t).clear();for(const f of d(this,Vn))f(this);d(this,Vn).clear(),Hs=this,ko(r),ko(n),Hs=null,d(this,Ir)?.resolve();var i=q;if(this.linked&&d(this,Yn)===0&&Y(this,J,Fn).call(this),d(this,He).length>0){i===null&&(i=this,Y(this,J,zs).call(this));const f=i;d(f,He).push(...d(this,He).filter(v=>!d(f,He).includes(v)))}i!==null&&Y(h=i,J,pr).call(h)},Ks=function(t,n,r){t.f^=be;for(var s=t.first;s!==null;){var o=s.f,a=(o&(ut|Xt))!==0,i=a&&(o&be)!==0,c=i||(o&Oe)!==0||d(this,mt).has(s);if(!c&&s.fn!==null){a?s.f^=be:(o&Qn)!==0?n.push(s):Fr(s)&&((o&it)!==0&&d(this,_t).add(s),tr(s));var u=s.first;if(u!==null){s=u;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},fa=function(){for(var t=d(this,Kt);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=d(t,Kt)}return null},da=function(t){var r;for(const[s,o]of t.current)!this.previous.has(s)&&t.previous.has(s)&&this.previous.set(s,t.previous.get(s)),this.current.set(s,o);for(const[s,o]of t.async_deriveds){const a=this.async_deriveds.get(s);a&&o.promise.then(a.resolve)}const n=s=>{var o=s.reactions;if(o!==null)for(const c of o){var a=c.f;if((a&Ce)!==0)n(c);else{var i=c;a&(Hn|it)&&!this.async_deriveds.has(i)&&(d(this,_t).delete(i),ue(i,Ee),this.schedule(i))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>t.discard()),Y(r=t,J,Fn).call(r),q=this,Y(this,J,pr).call(this)},Jr=function(t){for(var n=0;n!this.current.has(v));if(s.length===0)t&&f.discard();else if(n.length>0){if(t)for(const v of d(this,$n))f.unskip_effect(v,p=>{var b;(p.f&(it|Hn))!==0?f.schedule(p):Y(b=f,J,Jr).call(b,[p])});f.activate();var o=new Set,a=new Map;for(var i of n)ha(i,s,o,a);a=new Map;var c=[...f.current.keys()].filter(v=>this.current.has(v)?this.current.get(v)[0]!==v.v:!0);if(c.length>0)for(const v of d(this,Mr))(v.f&(tt|Oe|as))===0&&io(v,c,a)&&((v.f&(Hn|it))!==0?(ue(v,Ee),f.schedule(v)):d(f,zt).add(v));if(d(f,He).length>0&&!d(f,vn)){f.apply();for(var u of d(f,He))Y(h=f,J,Ks).call(h,u,[],[]);N(f,He,[])}f.deactivate()}}}},zs=function(){Bn===null?Ts=Bn=this:(N(Bn,dn,this),N(this,Kt,Bn)),Bn=this},Fn=function(){var t=d(this,Kt),n=d(this,dn);t===null?Ts=n:N(t,dn,n),n===null?Bn=t:N(n,Kt,t),this.linked=!1};let Cn=vs;function Ji(e){var t=br;br=!0;try{for(var n;;){if(zi(),q===null)return n;q.flush()}}finally{br=t}}function Qi(){try{Ci()}catch(e){Gt(e,Ws)}}let At=null;function ko(e){var t=e.length;if(t!==0){for(var n=0;n0)){yn.clear();for(const s of At){if((s.f&(tt|Oe))!==0)continue;const o=[s];let a=s.parent;for(;a!==null;)At.has(a)&&(At.delete(a),o.push(a)),a=a.parent;for(let i=o.length-1;i>=0;i--){const c=o[i];(c.f&(tt|Oe))===0&&tr(c)}}At.clear()}}At=null}}function ha(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const o=s.f;(o&Ce)!==0?ha(s,t,n,r):(o&(Hn|it))!==0&&(o&Ee)===0&&io(s,t,r)&&(ue(s,Ee),lo(s))}}function io(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(gn.call(t,s))return!0;if((s.f&Ce)!==0&&io(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function lo(e){q.schedule(e)}function va(e,t){if(!((e.f&ut)!==0&&(e.f&be)!==0)){(e.f&Ee)!==0?t.d.push(e):(e.f&yt)!==0&&t.m.push(e),ue(e,be);for(var n=e.first;n!==null;)va(n,t),n=n.next}}function pa(e){ue(e,be);for(var t=e.first;t!==null;)pa(t),t=t.next}function Xi(e){let t=0,n=xn(0),r;return()=>{fo()&&(l(n),ks(()=>(t===0&&(r=ar(()=>e(()=>yr(n)))),t+=1,()=>{Jt(()=>{t-=1,t===0&&(r?.(),r=void 0,yr(n))})})))}}var Zi=Xn|or;function el(e,t,n,r){new tl(e,t,n,r)}var $e,so,Je,pn,Re,Qe,Te,We,It,_n,Vt,Jn,Lr,Pr,Mt,ps,fe,nl,rl,sl,Vs,Qr,Xr,Gs,Ys;class tl{constructor(t,n,r,s){D(this,fe);Pe(this,"parent");Pe(this,"is_pending",!1);Pe(this,"transform_error");D(this,$e);D(this,so,null);D(this,Je);D(this,pn);D(this,Re);D(this,Qe,null);D(this,Te,null);D(this,We,null);D(this,It,null);D(this,_n,0);D(this,Vt,0);D(this,Jn,!1);D(this,Lr,new Set);D(this,Pr,new Set);D(this,Mt,null);D(this,ps,Xi(()=>(N(this,Mt,xn(d(this,_n))),()=>{N(this,Mt,null)})));N(this,$e,t),N(this,Je,n),N(this,pn,o=>{var a=z;a.b=this,a.f|=Fs,r(o)}),this.parent=z.b,this.transform_error=s??this.parent?.transform_error??(o=>o),N(this,Re,vo(()=>{Y(this,fe,Vs).call(this)},Zi))}defer_effect(t){ua(t,d(this,Lr),d(this,Pr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!d(this,Je).pending}update_pending_count(t,n){Y(this,fe,Gs).call(this,t,n),N(this,_n,d(this,_n)+t),!(!d(this,Mt)||d(this,Jn))&&(N(this,Jn,!0),Jt(()=>{N(this,Jn,!1),d(this,Mt)&&er(d(this,Mt),d(this,_n))}))}get_effect_pending(){return d(this,ps).call(this),l(d(this,Mt))}error(t){if(!d(this,Je).onerror&&!d(this,Je).failed)throw t;q?.is_fork?(d(this,Qe)&&q.skip_effect(d(this,Qe)),d(this,Te)&&q.skip_effect(d(this,Te)),d(this,We)&&q.skip_effect(d(this,We)),q.on_fork_commit(()=>{Y(this,fe,Ys).call(this,t)})):Y(this,fe,Ys).call(this,t)}}$e=new WeakMap,so=new WeakMap,Je=new WeakMap,pn=new WeakMap,Re=new WeakMap,Qe=new WeakMap,Te=new WeakMap,We=new WeakMap,It=new WeakMap,_n=new WeakMap,Vt=new WeakMap,Jn=new WeakMap,Lr=new WeakMap,Pr=new WeakMap,Mt=new WeakMap,ps=new WeakMap,fe=new WeakSet,nl=function(){try{N(this,Qe,Xe(()=>d(this,pn).call(this,d(this,$e))))}catch(t){this.error(t)}},rl=function(t){const n=d(this,Je).failed;n&&N(this,We,Xe(()=>{n(d(this,$e),()=>t,()=>()=>{})}))},sl=function(){const t=d(this,Je).pending;t&&(this.is_pending=!0,N(this,Te,Xe(()=>t(d(this,$e)))),Jt(()=>{var n=N(this,It,document.createDocumentFragment()),r=Nt();n.append(r),N(this,Qe,Y(this,fe,Xr).call(this,()=>Xe(()=>d(this,pn).call(this,r)))),d(this,Vt)===0&&(d(this,$e).before(n),N(this,It,null),wn(d(this,Te),()=>{N(this,Te,null)}),Y(this,fe,Qr).call(this,q))}))},Vs=function(){try{if(this.is_pending=this.has_pending_snippet(),N(this,Vt,0),N(this,_n,0),N(this,Qe,Xe(()=>{d(this,pn).call(this,d(this,$e))})),d(this,Vt)>0){var t=N(this,It,document.createDocumentFragment());mo(d(this,Qe),t);const n=d(this,Je).pending;N(this,Te,Xe(()=>n(d(this,$e))))}else Y(this,fe,Qr).call(this,q)}catch(n){this.error(n)}},Qr=function(t){this.is_pending=!1,t.transfer_effects(d(this,Lr),d(this,Pr))},Xr=function(t){var n=z,r=K,s=Fe;wt(d(this,Re)),rt(d(this,Re)),Zn(d(this,Re).ctx);try{return Cn.ensure(),t()}catch(o){return la(o),null}finally{wt(n),rt(r),Zn(s)}},Gs=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&Y(r=this.parent,fe,Gs).call(r,t,n);return}N(this,Vt,d(this,Vt)+t),d(this,Vt)===0&&(Y(this,fe,Qr).call(this,n),d(this,Te)&&wn(d(this,Te),()=>{N(this,Te,null)}),d(this,It)&&(d(this,$e).before(d(this,It)),N(this,It,null)))},Ys=function(t){d(this,Qe)&&(Be(d(this,Qe)),N(this,Qe,null)),d(this,Te)&&(Be(d(this,Te)),N(this,Te,null)),d(this,We)&&(Be(d(this,We)),N(this,We,null));var n=d(this,Je).onerror;let r=d(this,Je).failed;var s=!1,o=!1;const a=()=>{if(s){Ui();return}s=!0,o&&Ii(),d(this,We)!==null&&wn(d(this,We),()=>{N(this,We,null)}),Y(this,fe,Xr).call(this,()=>{Y(this,fe,Vs).call(this)})},i=c=>{try{o=!0,n?.(c,a),o=!1}catch(u){Gt(u,d(this,Re)&&d(this,Re).parent)}r&&N(this,We,Y(this,fe,Xr).call(this,()=>{try{return Xe(()=>{var u=z;u.b=this,u.f|=Fs,r(d(this,$e),()=>c,()=>a)})}catch(u){return Gt(u,d(this,Re).parent),null}}))};Jt(()=>{var c;try{c=this.transform_error(t)}catch(u){Gt(u,d(this,Re)&&d(this,Re).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(i,u=>Gt(u,d(this,Re)&&d(this,Re).parent)):i(c)})};function ol(e,t,n,r){const s=xr;var o=e.filter(v=>!v.settled);if(n.length===0&&o.length===0){r(t.map(s));return}var a=z,i=al(),c=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(v=>v.promise)):null;function u(v){if((a.f&tt)===0){i();try{r(v)}catch(p){Gt(p,a)}ls()}}var h=_a();if(n.length===0){c.then(()=>u(t.map(s))).finally(h);return}function f(){Promise.all(n.map(v=>il(v))).then(v=>u([...t.map(s),...v])).catch(v=>Gt(v,a)).finally(h)}c?c.then(()=>{i(),f(),ls()}):f()}function al(){var e=z,t=K,n=Fe,r=q;return function(o=!0){wt(e),rt(t),Zn(n),o&&(e.f&tt)===0&&(r?.activate(),r?.apply())}}function ls(e=!0){wt(null),rt(null),Zn(null),e&&q?.deactivate()}function _a(){var e=z,t=e.b,n=q,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 xr(e){var t=Ce|Ee;return z!==null&&(z.f|=or),{ctx:Fe,deps:null,effects:null,equals:sa,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:z,ac:null}}const Ur=Symbol("obsolete");function il(e,t,n){let r=z;r===null&&yi();var s=void 0,o=xn(ge),a=!K,i=new Set;return yl(()=>{var c=z,u=ea();s=u.promise;try{Promise.resolve(e()).then(u.resolve,p=>{p!==bs&&u.reject(p)}).finally(ls)}catch(p){u.reject(p),ls()}var h=q;if(a){if((c.f&An)!==0)var f=_a();if(r.b.is_rendered())h.async_deriveds.get(c)?.reject(Ur);else for(const p of i.values())p.reject(Ur);i.add(u),h.async_deriveds.set(c,u)}const v=(p,b=void 0)=>{f?.(),i.delete(u),b!==Ur&&(h.activate(),b?(o.f|=$t,er(o,b)):((o.f&$t)!==0&&(o.f^=$t),er(o,p)),h.deactivate())};u.promise.then(v,p=>v(null,p||"unknown"))}),ho(()=>{for(const c of i)c.reject(Ur)}),new Promise(c=>{function u(h){function f(){h===s?c(o):u(s)}h.then(f,f)}u(s)})}function U(e){const t=xr(e);return La(t),t}function ma(e){const t=xr(e);return t.equals=oa,t}function ll(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!ya&&fl()}return t}function fl(){ya=!1;for(const e of cs){(e.f&be)!==0&&ue(e,yt);let t;try{t=Fr(e)}catch{t=!0}t&&tr(e)}cs.clear()}function yr(e){X(e,e.v+1)}function wa(e,t,n){var r=e.reactions;if(r!==null)for(var s=r.length,o=0;o{if(kn===o)return i();var c=K,u=kn;rt(null),xo(o);var h=i();return rt(c),xo(u),h};return r&&n.set("length",de(e.length)),new Proxy(e,{defineProperty(i,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ai();var h=n.get(c);return h===void 0?a(()=>{var f=de(u.value);return n.set(c,f),f}):X(h,u.value,!0),!0},deleteProperty(i,c){var u=n.get(c);if(u===void 0){if(c in i){const h=a(()=>de(ge));n.set(c,h),yr(s)}}else X(u,ge),yr(s);return!0},get(i,c,u){if(c===bn)return e;var h=n.get(c),f=c in i;if(h===void 0&&(!f||jn(i,c)?.writable)&&(h=a(()=>{var p=Lt(f?i[c]:ge),b=de(p);return b}),n.set(c,h)),h!==void 0){var v=l(h);return v===ge?void 0:v}return Reflect.get(i,c,u)},getOwnPropertyDescriptor(i,c){var u=Reflect.getOwnPropertyDescriptor(i,c);if(u&&"value"in u){var h=n.get(c);h&&(u.value=l(h))}else if(u===void 0){var f=n.get(c),v=f?.v;if(f!==void 0&&v!==ge)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(i,c){if(c===bn)return!0;var u=n.get(c),h=u!==void 0&&u.v!==ge||Reflect.has(i,c);if(u!==void 0||z!==null&&(!h||jn(i,c)?.writable)){u===void 0&&(u=a(()=>{var v=h?Lt(i[c]):ge,p=de(v);return p}),n.set(c,u));var f=l(u);if(f===ge)return!1}return h},set(i,c,u,h){var f=n.get(c),v=c in i;if(r&&c==="length")for(var p=u;pde(ge)),n.set(p+"",b))}if(f===void 0)(!v||jn(i,c)?.writable)&&(f=a(()=>de(void 0)),X(f,Lt(u)),n.set(c,f));else{v=f.v!==ge;var O=a(()=>Lt(u));X(f,O)}var m=Reflect.getOwnPropertyDescriptor(i,c);if(m?.set&&m.set.call(h,u),!v){if(r&&typeof c=="string"){var A=n.get("length"),T=Number(c);Number.isInteger(T)&&T>=A.v&&X(A,T+1)}yr(s)}return!0},ownKeys(i){l(s);var c=Reflect.ownKeys(i).filter(f=>{var v=n.get(f);return v===void 0||v.v!==ge});for(var[u,h]of n)h.v!==ge&&!(u in i)&&c.push(u);return c},setPrototypeOf(){Ti()}})}function So(e){try{if(e!==null&&typeof e=="object"&&bn in e)return e[bn]}catch{}return e}function dl(e,t){return Object.is(So(e),So(t))}var us,ka,Sa,Ea;function hl(){if(us===void 0){us=window,ka=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Sa=jn(t,"firstChild").get,Ea=jn(t,"nextSibling").get,yo(e)&&(e[qs]=void 0,e[Gr]=null,e[js]=void 0,e.__e=void 0),yo(n)&&(n[vr]=void 0)}}function Nt(e=""){return document.createTextNode(e)}function fs(e){return Sa.call(e)}function Br(e){return Ea.call(e)}function w(e,t){return fs(e)}function Se(e,t=!1){{var n=fs(e);return n instanceof Comment&&n.data===""?Br(n):n}}function k(e,t=1,n=!1){let r=e;for(;t--;)r=Br(r);return r}function vl(e){e.textContent=""}function Ca(){return!1}function pl(e,t,n){return document.createElementNS(ra,e,void 0)}let Eo=!1;function _l(){Eo||(Eo=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t[Yr]?.()})},{capture:!0}))}function ys(e){var t=K,n=z;rt(null),wt(null);try{return e()}finally{rt(t),wt(n)}}function uo(e,t,n,r=n){e.addEventListener(t,()=>ys(n));const s=e[Yr];s?e[Yr]=()=>{s(),r(!0)}:e[Yr]=()=>r(!0),_l()}function ml(e){z===null&&(K===null&&Ei(),Si()),Ft&&ki()}function gl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Dt(e,t){var n=z;n!==null&&(n.f&Oe)!==0&&(e|=Oe);var r={ctx:Fe,deps:null,nodes:null,f:e|Ee|et,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};q?.register_created_effect(r);var s=r;if((e&Qn)!==0)Dn!==null?Dn.push(r):Cn.ensure().schedule(r);else if(t!==null){try{tr(r)}catch(a){throw Be(r),a}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&or)===0&&(s=s.first,(e&it)!==0&&(e&Xn)!==0&&s!==null&&(s.f|=Xn))}if(s!==null&&(s.parent=n,n!==null&&gl(s,n),K!==null&&(K.f&Ce)!==0&&(e&Xt)===0)){var o=K;(o.effects??(o.effects=[])).push(s)}return r}function fo(){return K!==null&&!ct}function ho(e){const t=Dt(gs,null);return ue(t,be),t.teardown=e,t}function ws(e){ml();var t=z.f,n=!K&&(t&ut)!==0&&(t&An)===0;if(n){var r=Fe;(r.e??(r.e=[])).push(e)}else return xa(e)}function xa(e){return Dt(Qn|_i,e)}function bl(e){Cn.ensure();const t=Dt(Xt|or,e);return(n={})=>new Promise(r=>{n.outro?wn(t,()=>{Be(t),r(void 0)}):(Be(t),r(void 0))})}function Aa(e){return Dt(Qn,e)}function yl(e){return Dt(Hn|or,e)}function ks(e,t=0){return Dt(gs|t,e)}function B(e,t=[],n=[],r=[]){ol(r,t,n,s=>{Dt(gs,()=>e(...s.map(l)))})}function vo(e,t=0){var n=Dt(it|t,e);return n}function Xe(e){return Dt(ut|or,e)}function Ta(e){var t=e.teardown;if(t!==null){const n=Ft,r=K;Co(!0),rt(null);try{t.call(null)}finally{Co(n),rt(r)}}}function po(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&ys(()=>{s.abort(bs)});var r=n.next;(n.f&Xt)!==0?n.parent=null:Be(n,t),n=r}}function wl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ut)===0&&Be(t),t=n}}function Be(e,t=!0){var n=!1;(t||(e.f&pi)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(kl(e.nodes.start,e.nodes.end),n=!0),ue(e,Ds),po(e,t&&!n),Ar(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)o.stop();Ta(e),e.f^=Ds,e.f|=tt;var s=e.parent;s!==null&&s.first!==null&&Oa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function kl(e,t){for(;e!==null;){var n=e===t?null:Br(e);e.remove(),e=n}}function Oa(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 wn(e,t,n=!0){var r=[];Ia(e,r,!0);var s=()=>{n&&Be(e),t&&t()},o=r.length;if(o>0){var a=()=>--o||s();for(var i of r)i.out(a)}else s()}function Ia(e,t,n){if((e.f&Oe)===0){e.f^=Oe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)(i.is_global||n)&&t.push(i);for(var s=e.first;s!==null;){var o=s.next;if((s.f&Xt)===0){var a=(s.f&Xn)!==0||(s.f&ut)!==0&&(e.f&it)!==0;Ia(s,t,a?n:!1)}s=o}}}function _o(e){Ma(e,!0)}function Ma(e,t){if((e.f&Oe)!==0){e.f^=Oe,(e.f&be)===0&&(ue(e,Ee),Cn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Xn)!==0||(n.f&ut)!==0;Ma(n,s?t:!1),n=r}var o=e.nodes&&e.nodes.t;if(o!==null)for(const a of o)(a.is_global||t)&&a.in()}}function mo(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Br(n);t.append(n),n=s}}let Zr=!1,Ft=!1;function Co(e){Ft=e}let K=null,ct=!1;function rt(e){K=e}let z=null;function wt(e){z=e}let nt=null;function La(e){K!==null&&(nt===null?nt=[e]:nt.push(e))}let Ne=null,je=0,Ye=null;function Sl(e){Ye=e}let Pa=1,un=0,kn=un;function xo(e){kn=e}function Ra(){return++Pa}function Fr(e){var t=e.f;if((t&Ee)!==0)return!0;if(t&Ce&&(e.f&=~En),(t&yt)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&et)!==0&<===null&&ue(e,be)}return!1}function Na(e,t,n=!0){var r=e.reactions;if(r!==null&&!(nt!==null&&gn.call(nt,e)))for(var s=0;s{e.ac.abort(bs)}),e.ac=null);try{e.f|=is;var h=e.fn,f=h();e.f|=An;var v=e.deps,p=q?.is_fork;if(Ne!==null){var b;if(p||Ar(e,je),v!==null&&je>0)for(v.length=je+Ne.length,b=0;bn?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Jt(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function ja(e,t,n,r,s){var o={capture:r,passive:s},a=Tl(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ho(()=>{t.removeEventListener(e,a,o)})}function ne(e,t,n){(t[fn]??(t[fn]={}))[e]=n}function In(e){for(var t=0;t{throw m});throw v}}finally{e[fn]=t,delete e.currentTarget,rt(h),wt(f)}}}const Ol=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Il(e){return Ol?.createHTML(e)??e}function Ml(e){var t=pl("template");return t.innerHTML=Il(e.replaceAll("","")),t.content}function ds(e,t){var n=z;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function x(e,t){var n=(t&qi)!==0,r=(t&ji)!==0,s,o=!e.startsWith("");return()=>{s===void 0&&(s=Ml(o?e:""+e),n||(s=fs(s)));var a=r||ka?document.importNode(s,!0):s.cloneNode(!0);if(n){var i=fs(a),c=a.lastChild;ds(i,c)}else ds(a,a);return a}}function Ll(e=""){{var t=Nt(e+"");return ds(t,t),t}}function Ha(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Nt();return e.append(t,n),ds(t,n),e}function S(e,t){e!==null&&e.before(t)}function H(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[vr]??(e[vr]=e.nodeValue))&&(e[vr]=n,e.nodeValue=`${n}`)}function Ss(e,t){return Pl(e,t)}const Kr=new Map;function Pl(e,{target:t,anchor:n,props:r={},events:s,context:o,intro:a=!0,transformError:i}){hl();var c=void 0,u=bl(()=>{var h=n??t.appendChild(Nt());el(h,{pending:()=>{}},p=>{Tn({});var b=Fe;o&&(b.c=o),s&&(r.$$events=s),c=e(p,r)||{},On()},i);var f=new Set,v=p=>{for(var b=0;b{for(var p of f)for(const m of[t,document]){var b=Kr.get(m),O=b.get(p);--O==0?(m.removeEventListener(p,Js),b.delete(p),b.size===0&&Kr.delete(m)):b.set(p,O)}$s.delete(v),h!==n&&h.parentNode?.removeChild(h)}});return Qs.set(c,u),c}let Qs=new WeakMap;function ir(e,t){const n=Qs.get(e);return n?(Qs.delete(e),n(t)):Promise.resolve()}var at,gt,Ue,mn,Rr,Nr,_s;class Rl{constructor(t,n=!0){Pe(this,"anchor");D(this,at,new Map);D(this,gt,new Map);D(this,Ue,new Map);D(this,mn,new Set);D(this,Rr,!0);D(this,Nr,t=>{if(d(this,at).has(t)){var n=d(this,at).get(t),r=d(this,gt).get(n);if(r)_o(r),d(this,mn).delete(n);else{var s=d(this,Ue).get(n);s&&(d(this,gt).set(n,s.effect),d(this,Ue).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[o,a]of d(this,at)){if(d(this,at).delete(o),o===t)break;const i=d(this,Ue).get(a);i&&(Be(i.effect),d(this,Ue).delete(a))}for(const[o,a]of d(this,gt)){if(o===n||d(this,mn).has(o))continue;const i=()=>{if(Array.from(d(this,at).values()).includes(o)){var u=document.createDocumentFragment();mo(a,u),u.append(Nt()),d(this,Ue).set(o,{effect:a,fragment:u})}else Be(a);d(this,mn).delete(o),d(this,gt).delete(o)};d(this,Rr)||!r?(d(this,mn).add(o),wn(a,i,!1)):i()}}});D(this,_s,t=>{d(this,at).delete(t);const n=Array.from(d(this,at).values());for(const[r,s]of d(this,Ue))n.includes(r)||(Be(s.effect),d(this,Ue).delete(r))});this.anchor=t,N(this,Rr,n)}ensure(t,n){var r=q,s=Ca();if(n&&!d(this,gt).has(t)&&!d(this,Ue).has(t))if(s){var o=document.createDocumentFragment(),a=Nt();o.append(a),d(this,Ue).set(t,{effect:Xe(()=>n(a)),fragment:o})}else d(this,gt).set(t,Xe(()=>n(this.anchor)));if(d(this,at).set(r,t),s){for(const[i,c]of d(this,gt))i===t?r.unskip_effect(c):r.skip_effect(c);for(const[i,c]of d(this,Ue))i===t?r.unskip_effect(c.effect):r.skip_effect(c.effect);r.oncommit(d(this,Nr)),r.ondiscard(d(this,_s))}else d(this,Nr).call(this,r)}}at=new WeakMap,gt=new WeakMap,Ue=new WeakMap,mn=new WeakMap,Rr=new WeakMap,Nr=new WeakMap,_s=new WeakMap;function W(e,t,n=!1){var r=new Rl(e),s=n?Xn:0;function o(a,i){r.ensure(a,i)}vo(()=>{var a=!1;t((i,c=0)=>{a=!0,o(c,i)}),a||o(-1,null)},s)}function zr(e,t){return t}function Nl(e,t,n){for(var r=[],s=t.length,o,a=t.length,i=0;i{if(o){if(o.pending.delete(f),o.done.add(f),o.pending.size===0){var v=e.outrogroups;Xs(e,ms(o.done)),v.delete(o),v.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=r.length===0&&n!==null;if(c){var u=n,h=u.parentNode;vl(h),h.append(u),e.items.clear()}Xs(e,t,!c)}else o={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(o)}function Xs(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const a of e.pending.values())for(const i of a)r.add(e.items.get(i).e)}for(var s=0;s{var M=n();return oo(M)?M:M==null?[]:ms(M)}),v,p=new Map,b=!0;function O(M){(T.effect.f&tt)===0&&(T.pending.delete(M),T.fallback=h,Bl(T,v,a,t,r),h!==null&&(v.length===0?(h.f&bt)===0?_o(h):(h.f^=bt,_r(h,null,a)):wn(h,()=>{h=null})))}function m(M){T.pending.delete(M)}var A=vo(()=>{v=l(f);for(var M=v.length,F=new Set,Z=q,oe=Ca(),se=0;seo(a)):(h=Xe(()=>o(To??(To=Nt()))),h.f|=bt)),M>F.size&&wi(),!b)if(p.set(Z,F),oe){for(const[qt,De]of i)F.has(qt)||Z.skip_effect(De.e);Z.oncommit(O),Z.ondiscard(m)}else O(Z);l(f)}),T={effect:A,items:i,pending:p,outrogroups:null,fallback:h};b=!1}function hr(e){for(;e!==null&&(e.f&ut)===0;)e=e.next;return e}function Bl(e,t,n,r,s){var o=(r&Pi)!==0,a=t.length,i=e.items,c=hr(e.effect.first),u,h=null,f,v=[],p=[],b,O,m,A;if(o)for(A=0;A0){var _e=(r&na)!==0&&a===0?n:null;if(o){for(A=0;A{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function Fl(e,t,n,r,s,o,a,i){var c=(a&Mi)!==0?(a&Ri)===0?ul(n,!1,!1):xn(n):null,u=(a&Li)!==0?xn(s):null;return{v:c,i:u,e:Xe(()=>(o(t,c??n,u??s,i),()=>{e.delete(r)}))}}function _r(e,t,n){if(e.nodes)for(var r=e.nodes.start,s=e.nodes.end,o=t&&(t.f&bt)===0?t.nodes.start:n;r!==null;){var a=Br(r);if(o.before(r),r===s)return;r=a}}function Ut(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}const Oo=[...` +\r\f \v\uFEFF`];function Dl(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var o=s.length,a=0;(a=r.indexOf(s,a))>=0;){var i=a+o;(a===0||Oo.includes(r[a-1]))&&(i===r.length||Oo.includes(r[i]))?r=(a===0?"":r.substring(0,a))+r.substring(i+1):a=i}}return r===""?null:r}function ql(e,t){return e==null?null:String(e)}function ze(e,t,n,r,s,o){var a=e[qs];if(a!==n||a===void 0){var i=Dl(n,r,o);i==null?e.removeAttribute("class"):e.className=i,e[qs]=n}else if(o&&s!==o)for(var c in o){var u=!!o[c];(s==null||u!==!!s[c])&&e.classList.toggle(c,u)}return o}function Tt(e,t,n,r){var s=e[js];if(s!==t){var o=ql(t);o==null?e.removeAttribute("style"):e.style.cssText=o,e[js]=t}return r}function Wa(e,t,n=!1){if(e.multiple){if(t==null)return;if(!oo(t))return Wi();for(var r of e.options)r.selected=t.includes(wr(r));return}for(r of e.options){var s=wr(r);if(dl(s,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function jl(e){var t=new MutationObserver(()=>{Wa(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ho(()=>{t.disconnect()})}function Zs(e,t,n=t){var r=new WeakSet,s=!0;uo(e,"change",o=>{var a=o?"[selected]":":checked",i;if(e.multiple)i=[].map.call(e.querySelectorAll(a),wr);else{var c=e.querySelector(a)??e.querySelector("option:not([disabled])");i=c&&wr(c)}n(i),e.__value=i,q!==null&&r.add(q)}),Aa(()=>{var o=t();if(e===document.activeElement){var a=q;if(r.has(a))return}if(Wa(e,o,s),s&&o===void 0){var i=e.querySelector(":checked");i!==null&&(o=wr(i),n(o))}e.__value=o,s=!1}),jl(e)}function wr(e){return"__value"in e?e.__value:e.value}const Hl=Symbol("is custom element"),Wl=Symbol("is html");function ie(e,t,n,r){var s=Ul(e);s[t]!==(s[t]=n)&&(t==="loading"&&(e[gi]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Kl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ul(e){return e[Gr]??(e[Gr]={[Hl]:e.nodeName.includes("-"),[Wl]:e.namespaceURI===ra})}var Io=new Map;function Kl(e){var t=e.getAttribute("is")||e.nodeName,n=Io.get(t);if(n)return n;Io.set(t,n=[]);for(var r,s=e,o=Element.prototype;o!==s;){r=fi(s);for(var a in r)r[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&n.push(a);s=Xo(s)}return n}function eo(e,t,n=t){var r=new WeakSet;uo(e,"input",async s=>{var o=s?e.defaultValue:e.value;if(o=Is(e)?Ms(o):o,n(o),q!==null&&r.add(q),await Cl(),o!==(o=t())){var a=e.selectionStart,i=e.selectionEnd,c=e.value.length;if(e.value=o??"",i!==null){var u=e.value.length;a===i&&i===c&&u>c?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=a,e.selectionEnd=Math.min(i,u))}}}),ar(t)==null&&e.value&&(n(Is(e)?Ms(e.value):e.value),q!==null&&r.add(q)),ks(()=>{var s=t();if(e===document.activeElement){var o=q;if(r.has(o))return}Is(e)&&s===Ms(e.value)||e.type==="date"&&!s&&!e.value||s!==e.value&&(e.value=s??"")})}function Ua(e,t,n=t){uo(e,"change",r=>{var s=r?e.defaultChecked:e.checked;n(s)}),ar(t)==null&&n(e.checked),ks(()=>{var r=t();e.checked=!!r})}function Is(e){var t=e.type;return t==="number"||t==="range"}function Ms(e){return e===""?null:+e}function Ls(e,t){return e===t||e?.[bn]===t}function zl(e={},t,n,r){var s=Fe.r,o=z;return Aa(()=>{var a,i;return ks(()=>{a=i,i=[],ar(()=>{Ls(n(...i),e)||(t(e,...i),a&&Ls(n(...a),e)&&t(null,...a))})}),()=>{let c=o;for(;c!==s&&c.parent!==null&&c.parent.f&Ds;)c=c.parent;const u=()=>{i&&Ls(n(...i),e)&&t(null,...i)},h=c.teardown;c.teardown=()=>{u(),h?.()}}}),e}function Yt(e,t,n,r){var s=!0,o=(n&Fi)!==0,a=(n&Di)!==0,i=r,c=!0,u=void 0,h=()=>a&&s?(u??(u=xr(r)),l(u)):(c&&(c=!1,i=a?ar(r):r),i);let f;if(o){var v=bn in e||mi in e;f=jn(e,t)?.set??(v&&t in e?F=>e[t]=F:void 0)}var p,b=!1;o?[p,b]=Gi(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=h(),f&&(xi(),f(p)));var O;if(O=()=>{var F=e[t];return F===void 0?h():(c=!0,F)},(n&Bi)===0)return O;if(f){var m=e.$$legacy;return(function(F,Z){return arguments.length>0?((!Z||m||b)&&f(Z?O():F),F):O()})}var A=!1,T=((n&Ni)!==0?xr:ma)(()=>(A=!1,O()));o&&l(T);var M=z;return(function(F,Z){if(arguments.length>0){const oe=Z?l(T):o?Lt(F):F;return X(T,oe),A=!0,i!==void 0&&(i=oe),F}return Ft&&A||(M.f&tt)!==0?T.v:l(T)})}function Ka(e){Fe===null&&bi(),ws(()=>{const t=ar(e);if(typeof t=="function")return t})}const za="[data-v-app]",Vl=["header","content","footer"];let Ze=null,xt=null;function Gl(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 Yl(){if(typeof document>"u")return!1;const t=document.querySelector(za)?.__vue_app__?.config?.globalProperties?.$_state;return!t||typeof t!="object"||!Array.isArray(t.globalClasses)?(Ze=null,!1):(Ze=t,xt=null,!0)}function $l(){if(xt!==null)return xt;const e=typeof document<"u"?document.querySelector(za)?.__vue_app__:null;if(!e)return xt=!1,!1;const t=e.config?.globalProperties??{};if(typeof Ze?.$history?.pause=="function"&&typeof Ze?.$history?.resume=="function")return xt={pause:()=>Ze.$history.pause(),resume:()=>Ze.$history.resume()},xt;const n=t.$_bricksData??t.bricksData;return typeof n?.history?.pause=="function"&&typeof n?.history?.resume=="function"?(xt={pause:()=>n.history.pause(),resume:()=>n.history.resume()},xt):(xt=!1,!1)}function Jl(e){const t=$l();if(t)try{t.pause(),e()}finally{t.resume()}else e()}function Qt(e){if(!Ze||!e)return null;for(const t of Vl){const n=Ze[t];if(!Array.isArray(n))continue;const r=n.find(s=>s&&s.id===e);if(r)return r}return null}function Ql(e){const t=Qt(e);if(!t)return[];const n=[{id:t.id,depth:0,label:t.label,name:t.name,settings:t.settings}];return Va(t,1,n),n}function Va(e,t,n){if(!(!e||!Array.isArray(e.children)))for(const r of e.children){const s=Qt(r);s&&(n.push({id:s.id,depth:t,label:s.label,name:s.name,settings:s.settings}),Va(s,t+1,n))}}function Ga(){return Ze?Ze.globalClasses:[]}function Ps(e,t){if(!Ze)throw new Error("rebemer: not ready");const n=Ze.globalClasses,r=n.find(a=>a&&a.name===e);if(r)return r.id;const s=new Set(n.map(a=>a?.id).filter(Boolean)),o=Gl(s);return n.push({id:o,name:e,settings:t||{}}),o}function Mo(e,t){const n=Qt(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 Lo(e,t){const n=Qt(e);n&&(n.label=t)}const Po="slashed-rebemer-host",Xl="slashed-class-hint",Ya=["#bricks-panel",".bricks-class-manager","#bricks-class-manager",'[data-control="cssClasses"]'],nr="rebemer-class-hint-btn",Zl=50;function to(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 rr={},Pt=null,kr=null,Sr=null,Wn=null,sr=null;function ec(){if(Pt&&Pt.isConnected)return Pt;let e=document.getElementById(Po);e||(e=document.createElement("div"),e.id=Po,document.body.appendChild(e));const t=document.createElement("div");return t.id=Xl,t.className="rebemer-class-hint",t.setAttribute("role","tooltip"),t.hidden=!0,t.innerHTML='

',e.appendChild(t),Pt=t,t}function tc(e,t){const n=t.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight,o=8,a=document.documentElement.clientWidth,i=document.documentElement.clientHeight;let c=n.bottom+o;c+s>i&&n.top-o-s>=0&&(c=n.top-o-s);let u=n.left+n.width/2-r/2;u+r>a-4&&(u=Math.max(4,a-4-r)),u<4&&(u=4),e.style.top=`${Math.round(c)}px`,e.style.left=`${Math.round(u)}px`}function nc(e){const t=e.dataset.sfClass,n=t?to(t,rr):null;if(!n)return;const r=ec();r.querySelector(".rebemer-class-hint__name").textContent=`.${n.name}`;const s=r.querySelector(".rebemer-class-hint__cat");s.textContent=n.category||"",s.hidden=!n.category,r.querySelector(".rebemer-class-hint__desc").textContent=n.description,r.hidden=!1,tc(r,e),sr=e}function Tr(){Pt&&(Pt.hidden=!0),sr=null}function Ro(e){nc(e.currentTarget)}function No(){Tr()}function rc(e){e.preventDefault(),e.stopPropagation()}function sc(e){e.key==="Escape"&&Tr()}function Bo(e){const t=to(e.textContent,rr);if(t)return t;const n=e.querySelectorAll("span, [contenteditable], .name, .label, a");for(const r of n){const s=to(r.textContent,rr);if(s)return s}return null}function oc(e){return e.querySelector('.actions, [class*="action"], [class*="icons"], [class*="controls"]')||e}function ac(){const e=document.createElement("span");return e.className=nr,e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","What does this class do?"),e.addEventListener("mouseenter",Ro),e.addEventListener("mouseleave",No),e.addEventListener("focus",Ro),e.addEventListener("blur",No),e.addEventListener("click",rc),e}function $a(){for(const t of document.querySelectorAll("."+nr)){const n=t.closest("li"),r=n?Bo(n):null;r?t.dataset.sfClass!==r.name&&(t.dataset.sfClass=r.name):(sr===t&&Tr(),t.remove())}const e=document.querySelectorAll(Ya.join(","));for(const t of e)for(const n of t.querySelectorAll("li")){if(n.querySelector("."+nr)||n.querySelector("li"))continue;const r=Bo(n);if(!r)continue;const s=ac();s.dataset.sfClass=r.name,oc(n).appendChild(s)}}function ic(){Wn===null&&(Wn=setTimeout(()=>{Wn=null,$a()},Zl))}function lc(e){const t=Ya.join(",");for(const n of e){const r=n.target;if(r&&r.nodeType===1){if(r.classList&&r.classList.contains(nr))continue;if(r.closest&&r.closest(t))return!0}for(const s of n.addedNodes)if(s.nodeType===1&&!(s.classList&&s.classList.contains(nr))&&(s.matches&&s.matches(t)||s.closest&&s.closest(t)||s.querySelector&&s.querySelector(t)))return!0}return!1}function cc(e,t,n={}){if(es(),rr=t&&typeof t=="object"?t:{},!e||Object.keys(rr).length===0)return;kr=new AbortController;const{signal:r}=kr;document.addEventListener("keydown",sc,{passive:!0,signal:r}),window.addEventListener("scroll",Tr,{capture:!0,passive:!0,signal:r}),Sr=new MutationObserver(s=>{sr&&!sr.isConnected&&Tr(),lc(s)&&ic()}),Sr.observe(document.body,{childList:!0,subtree:!0}),$a(),n.signal&&(n.signal.aborted?es():n.signal.addEventListener("abort",es,{once:!0}))}function es(){Wn!==null&&(clearTimeout(Wn),Wn=null),Sr&&(Sr.disconnect(),Sr=null),kr&&(kr.abort(),kr=null);try{document.querySelectorAll("."+nr).forEach(e=>e.remove())}catch{}Pt&&(Pt.remove(),Pt=null),sr=null,rr={}}const ts="li.variable-picker-item",ns="slashed-var-swatch",Un="slashed-sf-color-btn",uc=50,Fo=(e,...t)=>console[e]("[slashed-swatches]",...t);function fc(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 no=!1,Or={},Bt=null,Er=null,Kn=null,rs=null;function dc(e){if(!Bt)return;const t=e.querySelector('[data-control="text"].color-input');if(!t)return;let n=t.querySelector("."+Un);if(!n){n=document.createElement("div"),n.className=Un,n.setAttribute("data-balloon","SLASHED Colors"),n.setAttribute("data-balloon-pos","top-right"),n.setAttribute("role","button"),n.setAttribute("tabindex","0");const r=document.createElement("span");r.className=Un+"__dot",r.setAttribute("aria-hidden","true"),n.appendChild(r),n.addEventListener("click",o=>{o.stopPropagation(),Bt&&Bt(t)}),n.addEventListener("keydown",o=>{o.key===" "?(o.preventDefault(),n.click()):o.key==="Enter"&&n.click()});const s=t.querySelector(".variable-picker-button");s&&s.nextSibling?t.insertBefore(n,s.nextSibling):t.appendChild(n)}hc(n,t)}function hc(e,t){const n=e.querySelector("."+Un+"__dot"),o=((t.querySelector('input[type="text"]')??t.querySelector('input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])'))?.value??"").match(/^var\((--[^)]+)\)/)?.[1],a=o?Or[o]??null:null;n&&(a?(n.style.background=a,n.style.removeProperty("box-shadow")):n.style.removeProperty("background")),e.classList.toggle(Un+"--active",!!a)}function vc(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 pc(e){if(e.classList.contains("title")||e.classList.contains("category")){const r=e.querySelector(":scope > ."+ns);r&&r.remove();return}const t=fc(vc(e),Or);let n=e.querySelector(":scope > ."+ns);if(!t){n&&n.remove();return}n||(n=document.createElement("span"),n.className=ns,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 Ja(){try{const e=document.querySelectorAll(ts);for(const t of e)pc(t)}catch(e){Fo("warn","swatch pass failed",e)}if(Bt)try{document.querySelectorAll('[data-control="color"]').forEach(dc)}catch(e){Fo("warn","SF button inject failed",e)}}function _c(){Kn===null&&(Kn=setTimeout(()=>{Kn=null,Ja()},uc))}function mc(e){for(const t of e){const n=t.target;if(n&&n.nodeType===1&&n.closest&&(n.closest(ts)||Bt&&n.closest('[data-control="color"]')))return!0;for(const r of t.addedNodes)if(r.nodeType===1&&(r.matches&&r.matches(ts)||r.querySelector&&r.querySelector(ts)||Bt&&(r.matches&&r.matches('[data-control="color"]')||r.querySelector&&r.querySelector('[data-control="color"]'))))return!0}return!1}function gc(e,t,n={}){ss(),no=!!e,Or=t&&typeof t=="object"?t:{},Bt=typeof n.onOpenPanel=="function"?n.onOpenPanel:null,!(!(no&&Object.keys(Or).length>0)&&!Bt)&&(rs=new AbortController,Er=new MutationObserver(s=>{mc(s)&&_c()}),Er.observe(document.body,{childList:!0,subtree:!0}),Ja(),n.signal&&(n.signal.aborted?ss():n.signal.addEventListener("abort",ss,{once:!0})))}function ss(){Kn!==null&&(clearTimeout(Kn),Kn=null),Er&&(Er.disconnect(),Er=null),rs&&(rs.abort(),rs=null);try{document.querySelectorAll("."+ns).forEach(e=>e.remove()),document.querySelectorAll("."+Un).forEach(e=>e.remove())}catch{}no=!1,Or={},Bt=null}const bc="5";var Qo;typeof window<"u"&&((Qo=window.__svelte??(window.__svelte={})).v??(Qo.v=new Set)).add(bc);var yc=x('reBEM');function wc(e,t){Tn(t,!0);function n(s){s.stopPropagation(),s.preventDefault(),t.onActivate?.(t.elementId)}var r=yc();B(()=>{ie(r,"title",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer"),ie(r,"aria-label",t.label?`Open reBEMer for ${t.label}`:"Open reBEMer")}),ne("click",r,n),ne("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&n(s)),S(e,r),On()}In(["click","keydown"]);function Rt(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 kc=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,Sc=new Set(["auto","inherit","initial","unset","revert","revert-layer","none"]);function Do(e){return e?Sc.has(e)?{ok:!1,reason:`"${e}" is a CSS keyword.`}:kc.test(e)?{ok:!0}:{ok:!1,reason:"Use lowercase letters, digits, and hyphens."}:{ok:!1,reason:"Name is empty."}}const Es=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 Ec(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)&&t.push(n);return t.sort(),t}const Cc=new Set(["_cssGlobalClasses","_cssClasses","_cssId","_attributes","_hidden","_hidden_lg","_hidden_md","_hidden_sm","_hidden_xl","_name","_label","_id","tag","children","parent"]);function xc(e){if(!e||typeof e!="object")return[];const t=[];for(const n of Object.keys(e))Es.has(n)||Cc.has(n)||n.startsWith("_hidden_")||t.push(n);return t.sort(),t}const Ac=new Set(["add","rename","replace","migrate","mixed"]),qo=new Set(["user","label"]);function Qa(e,t){const n=new Map,r=[];for(const s of e){for(;r.length&&r[r.length-1].depth>=s.depth;)r.pop();const o=s.id===t,a=!o&&s.isBlockRoot===!0;if(o||a){const i=Rt(s.name);i&&s.include!==!1&&(r.push({depth:s.depth,blockName:i}),n.set(s.id,i))}else{const i=r.length?r[r.length-1].blockName:"";i&&n.set(s.id,i)}}return n}function Xa({rootId:e,rows:t,mode:n}){if(!Ac.has(n))return{ok:!1,ops:[],error:`Invalid mode: ${n}`};const r=t.find(u=>u.id===e);if(!r)return{ok:!1,ops:[],error:"Root row missing."};if(!Rt(r.name))return{ok:!1,ops:[],error:"Block name is empty."};const o=[];for(const u of t)!u.isBlockRoot||!u.include||u.id===e||Rt(u.name)||o.push(u.originalLabel||u.id);if(o.length>0)return{ok:!1,ops:[],error:`Block name is empty for: ${o.join(", ")}.`};const a=Qa(t,e),i=[];for(const u of t){if(!u.include)continue;const h=u.id===e,f=!h&&u.isBlockRoot===!0,v=a.get(u.id);if(!v)continue;let p;if(h||f)p=v;else{const b=Rt(u.name);if(!b)continue;p=`${v}__${b}`}i.push({row:u,isRoot:h||f,blockName:v,finalClass:p,modifierSlugs:[],suggestedFrom:u.suggestedFrom||"fallback"})}if(i.length===0)return{ok:!1,ops:[],error:"No rows to apply. Include at least one row."};const c=Ic(i);if(!c.ok)return{ok:!1,ops:[],error:c.error};if(n!=="migrate")for(const u of i){const h=Array.isArray(u.row.modifiers)?u.row.modifiers:[];u.modifierSlugs=h.map(f=>Rt(f)).filter(Boolean)}return{ok:!0,ops:i}}function Tc({rootId:e,rows:t,mode:n,syncLabels:r}){const s=Xa({rootId:e,rows:t,mode:n});if(!s.ok)return{ok:!1,error:s.error};const o=s.ops,a=Ga();if(n==="migrate"){const u=Oc(o,a);if(!u.ok)return u}const i=new Map;for(const u of o){if(i.has(u.row.id))continue;const h=Qt(u.row.id);if(!h)continue;const f={classIds:jo(h.settings).slice(),label:r?h.label??"":null};if(n==="migrate"&&Array.isArray(u.row.migrateKeys)){const v={};for(const p of u.row.migrateKeys)Object.prototype.hasOwnProperty.call(h.settings||{},p)&&(v[p]=JSON.parse(JSON.stringify(h.settings[p])));f.migrateKeys=v}i.set(u.row.id,f)}let c=0;try{Jl(()=>{for(const u of o){const h=Qt(u.row.id);if(!h)continue;const f=jo(h.settings),v=u.row.op??"add",p=n==="mixed"?["add","rename","replace"].includes(v)?v:"add":n;let b={};if(p==="rename"&&f.length>0){const A=n==="mixed"&&u.row.renameFamilyId||f[0],T=a.find(M=>M&&M.id===A);T&&T.settings&&(b=JSON.parse(JSON.stringify(T.settings)))}else p==="migrate"&&(b=Za(h.settings,u.row.migrateKeys));if(p==="migrate"){const A=a.find(T=>T&&T.name===u.finalClass);if(A){(!A.settings||typeof A.settings!="object")&&(A.settings={});for(const[T,M]of Object.entries(b))Object.prototype.hasOwnProperty.call(A.settings,T)||(A.settings[T]=M)}}const O=Ps(u.finalClass,b);let m;switch(p){case"add":case"migrate":m=f.includes(O)?f:[...f,O];break;case"rename":{const A=n==="mixed"&&u.row.renameFamilyId||(f[0]??null),T=[O],M=A?a.find(F=>F&&F.id===A):null;if(M){const F=M.name+"--";for(const Z of f){if(Z===A)continue;const oe=a.find(se=>se&&se.id===Z);if(oe)if(oe.name.startsWith(F)){const se=oe.name.slice(M.name.length),xe=oe.settings?JSON.parse(JSON.stringify(oe.settings)):{};T.push(Ps(u.finalClass+se,xe))}else T.push(Z)}}m=T;break}case"replace":if(n==="mixed"&&u.row.renameFamilyId){const A=a.find(T=>T&&T.id===u.row.renameFamilyId);if(A){const T=A.name+"--",M=f.filter(F=>{if(F===u.row.renameFamilyId)return!1;const Z=a.find(oe=>oe&&oe.id===F);return!Z||!Z.name.startsWith(T)});m=[O,...M]}else m=[O]}else m=[O];break}for(const A of u.modifierSlugs){const T=`${u.finalClass}--${A}`,M=Ps(T,{});m.includes(M)||m.push(M)}if(Mo(u.row.id,m),p==="migrate"&&Mc(h.settings,u.row.migrateKeys),r){const A=Lc(u.finalClass,u.blockName);A&&Lo(u.row.id,A)}c++}})}catch(u){for(const[f,v]of i)try{if(Mo(f,v.classIds),v.migrateKeys){const p=Qt(f);p&&p.settings&&Object.assign(p.settings,v.migrateKeys)}v.label!==null&&Lo(f,v.label)}catch{}const h=u instanceof Error?u.message:String(u);return console.warn("[reBEMer] apply failed after",c,"mutation(s), rolled back:",h),{ok:!1,error:`Operation failed and was rolled back: ${h}`}}return c===0?{ok:!1,error:"No elements were modified. The subtree may have changed."}:{ok:!0,count:c}}function Oc(e,t){for(const n of e){const r=t.find(c=>c&&c.name===n.finalClass);if(!r)continue;const s=Qt(n.row.id);if(!s)continue;const o=Za(s.settings,n.row.migrateKeys),a=r.settings&&typeof r.settings=="object"?r.settings:{},i=[];for(const[c,u]of Object.entries(o))Object.prototype.hasOwnProperty.call(a,c)&&JSON.stringify(a[c])!==JSON.stringify(u)&&i.push(c.replace(/^_/,""));if(i.length>0){const c=i.join(", ");return{ok:!1,error:`Migrate blocked: existing class "${n.finalClass}" has conflicting values for ${c}. Pick a different name or use Add mode.`}}}return{ok:!0}}function Ic(e){const t=new Map;for(const r of e){const s=t.get(r.finalClass)||[];s.push(r),t.set(r.finalClass,s)}for(const[r,s]of t){if(s.length===1)continue;const o=s.filter(i=>qo.has(i.suggestedFrom));if(o.length>1)return{ok:!1,error:`"${r}" is used by ${o.length} rows. Edit one to make it unique.`};let a=1;for(const i of s)qo.has(i.suggestedFrom)||(i.finalClass=`${r}-${a++}`,i.suggestedFrom="auto-number")}const n=new Map;for(const r of e){const s=n.get(r.finalClass);if(s)return{ok:!1,error:`"${r.finalClass}" is produced by 2 rows after auto-numbering (one ${s}, one ${r.suggestedFrom}). Pick a different name for one of them.`};n.set(r.finalClass,r.suggestedFrom)}return{ok:!0}}function Za(e,t){if(!e||!Array.isArray(t))return{};const n={};for(const r of t)Es.has(r)&&Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=JSON.parse(JSON.stringify(e[r])));return n}function Mc(e,t){if(!(!e||!Array.isArray(t)))for(const n of t)Es.has(n)&&Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}function jo(e){const t=e?._cssGlobalClasses;return t?(Array.isArray(t)?t:Object.values(t)).filter(r=>typeof r=="string"&&r.length>0):[]}function Lc(e,t){let n=e;return n===t?Ho(t.replace(/-/g," ")):(n.startsWith(t+"__")&&(n=n.slice(t.length+2)),n=n.replace(/--.+$/,""),Ho(n.replace(/-/g," ")))}function Ho(e){return e.replace(/(^|\s)([a-z])/g,(t,n,r)=>n+r.toUpperCase())}const Pc=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"}),ei=new Set(["section","container","block","div"]);function Rc(e,t="item"){return!e||typeof e!="string"||ei.has(e)?t:Pc[e]||t}function Rs(e){return typeof e=="string"&&ei.has(e)}const Nc=Object.freeze({heading:"title","text-basic":"description",text:"description",button:"action","text-link":"link",logo:"logo",image:"image"});function Bc(e,t,n){const r=new Set(e.filter(Boolean)),s=(...p)=>p.some(b=>r.has(b)),o=s("button","button-group"),a=s("heading"),i=s("text-basic","text"),c=s("image"),u=s("nav-nested","nav-menu"),h=s("form"),f=s("icon","icon-box"),v=s("list");return h?"form":u?"nav":o&&!a&&!i?"actions":c&&!i&&!a&&!o?"media":a&&!i&&!o?"header":i&&!a&&!o?"body":a&&i?"content":a&&o?"header":f&&!i&&!a?"icon-group":v?"list-wrap":n>1?t===0?"header":t===n-1?"footer":"body":"content"}var Fc=x(''),Dc=x('BLOCK'),qc=x('suggested'),jc=x(' '),Hc=x(''),Wc=x('
'),Uc=x(''),Kc=x('
'),zc=x('

No existing classes — a new class will be added instead.

'),Vc=x(""),Gc=x('
Family
'),Yc=x('

Will rename

'),$c=x(""),Jc=x('
Family
'),Qc=x('

Will remove the selected family and replace with the new class (empty settings). Other classes kept.

'),Xc=x('

No existing classes — a new class will be created.

'),Zc=x('

All existing classes will be removed from this element.

'),eu=x(" ",1),tu=x('
',1),nu=x('

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

'),ru=x('

'),su=x(`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),su=x(`A class named already exists + values block the migration — pick a different name or use Add.`,1),ou=x(`A class named already exists globally. Apply will attach the existing class instead of - creating a duplicate.`,1),au=x('

'),ou=x(' '),iu=x('Migrate: ',1),lu=x('No migratable keys on this element.'),cu=x(' '),uu=x('
'),fu=x('
');function du(e,t){Tn(t,!0);let n=Yt(t,"row",15),r=Yt(t,"rootId",3,""),s=Yt(t,"globalClasses",19,()=>[]),a=Yt(t,"finalClassNames",19,()=>[]);const o=U(()=>t.mode!=="migrate"),i=U(()=>t.mode==="migrate"),u=U(()=>t.mode==="rename"),c=U(()=>t.mode==="mixed"),h=U(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),f=U(()=>{if(!l(c)||!Array.isArray(n().currentClassIds))return[];const g=[];for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||I.name.includes("--"))continue;const Q=n().currentClassIds.filter(R=>s().find(y=>y?.id===R)?.name.startsWith(I.name+"--")).length;g.push({id:I.id,name:I.name,modCount:Q})}for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||!I.name.includes("--"))continue;const Q=I.name.slice(0,I.name.indexOf("--"));g.some(R=>R.name===Q)||g.push({id:I.id,name:I.name,modCount:0})}return g});ws(()=>{!l(c)||n().op!=="rename"||!l(f).length||l(f).some(g=>g.id===n().renameFamilyId)||n(n().renameFamilyId=l(f)[0].id,!0)});const v=U(()=>n().isBlockRoot===!0&&n().id!==r()),_=U(()=>n().id!==r()),b=U(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),O=U(()=>{if(!a().length||!n().include||!Array.isArray(s()))return null;for(const g of a()){const E=s().find(I=>I&&I.name===g);if(E)return E}return null}),m=U(()=>!Array.isArray(n().modifiers)||n().modifiers.every(g=>!Rt(g)));function A(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function T(g){return g.startsWith("_")?g.slice(1):g}var M=fu();let F;var Z=w(M),ae=w(Z),re=k(Z,2),xe=w(re),pe=w(xe),oe=k(xe,2);{var qt=g=>{var E=Bc();let I;var Q=w(E);B(R=>{I=Ke(E,1,"rebemer-row__type rebemer-row__type--toggle",null,I,{"rebemer-row__type--block":l(v)}),ie(E,"title",l(v)?"Sub-block root — click to revert to element":"Click to promote to block root"),E.disabled=!n().include,H(Q,R)},[()=>l(v)?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),se("click",E,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),S(g,E)},De=g=>{var E=Fc();S(g,E)};W(oe,g=>{l(_)?g(qt):g(De,-1)})}var Zt=k(oe,2);{var en=g=>{var E=Dc();B(()=>ie(E,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),S(g,E)};W(Zt,g=>{l(b)&&n().include&&g(en)})}var jt=k(re,2),tn=w(jt),nn=w(tn);{var rt=g=>{var E=qc(),I=w(E);B(()=>H(I,l(h))),S(g,E)};W(nn,g=>{l(h)&&g(rt)})}var ft=k(nn,2),Mn=k(tn,2);{var rn=g=>{var E=Uc(),I=w(E);ke(I,17,()=>n().modifiers,zr,(p,y,C)=>{var L=Hc(),j=w(L),$=k(j,2);{var ce=G=>{var he=jc();B(()=>he.disabled=!n().include),se("click",he,()=>{n(n().modifiers=n().modifiers.filter((ye,Ie)=>Ie!==C),!0)}),S(G,he)};W($,G=>{n().modifiers.length>1&&G(ce)})}B(()=>j.disabled=!n().include),ea(j,()=>n().modifiers[C],G=>n(n().modifiers[C]=G,!0)),S(p,L)});var Q=k(I,2);{var R=p=>{var y=Wc();B(()=>y.disabled=!n().include),se("click",y,()=>{n(n().modifiers=[...n().modifiers,""],!0)}),S(p,y)};W(Q,p=>{l(m)||p(R)})}S(g,E)};W(Mn,g=>{l(o)&&g(rn)})}var Ln=k(jt,2);{var sn=g=>{var E=eu(),I=Se(E),Q=w(I);let R;var p=k(Q,2);let y;var C=k(p,2);let L;var j=k(I,2);{var $=G=>{var he=Ho(),ye=Se(he);{var Ie=ve=>{var le=Kc();S(ve,le)},st=ve=>{var le=Vc(),te=k(w(le),2);ke(te,21,()=>l(f),zr,(ee,ne)=>{var me=zc(),ze=w(me),dt={};B(()=>{H(ze,`${l(ne).name??""}${l(ne).modCount>0?` (+ ${l(ne).modCount} modifier${l(ne).modCount>1?"s":""})`:""}`),dt!==(dt=l(ne).id)&&(me.value=(me.__value=l(ne).id)??"")}),S(ee,me)}),Zs(te,()=>n().renameFamilyId,ee=>n(n().renameFamilyId=ee,!0)),S(ve,le)},kt=ve=>{const le=U(()=>l(f)[0]),te=U(()=>1+l(le).modCount);var ee=Gc(),ne=k(w(ee)),me=w(ne),ze=k(ne);B(()=>{H(me,l(le).name),H(ze,`${l(le).modCount>0?` (+ ${l(le).modCount} modifier${l(le).modCount>1?"s":""})`:""}${(n().currentClassIds?.length??0)>l(te)?" Other classes kept.":""}`)}),S(ve,ee)};W(ye,ve=>{l(f).length===0?ve(Ie):l(f).length>1?ve(st,1):ve(kt,-1)})}S(G,he)},ce=G=>{var he=Zc(),ye=Se(he);{var Ie=te=>{var ee=$c(),ne=k(w(ee),2),me=w(ne);me.value=me.__value="";var ze=k(me);ke(ze,17,()=>l(f),zr,(dt,ht)=>{var we=Yc(),Me=w(we),_e={};B(()=>{H(Me,`${l(ht).name??""}${l(ht).modCount>0?` (+ ${l(ht).modCount} modifier${l(ht).modCount>1?"s":""})`:""}`),_e!==(_e=l(ht).id)&&(we.value=(we.__value=l(ht).id)??"")}),S(dt,we)}),Zs(ne,()=>n().renameFamilyId,dt=>n(n().renameFamilyId=dt,!0)),S(te,ee)};W(ye,te=>{l(f).length>1&&te(Ie)})}var st=k(ye,2);{var kt=te=>{var ee=Jc();S(te,ee)},ve=te=>{var ee=Qc();S(te,ee)},le=te=>{var ee=Xc();S(te,ee)};W(st,te=>{n().renameFamilyId?te(kt):l(f).length===0?te(ve,1):te(le,-1)})}S(G,he)};W(j,G=>{n().op==="rename"?G($):n().op==="replace"&&G(ce,1)})}B(()=>{R=Ke(Q,1,"rebemer-row__op-btn",null,R,{"rebemer-row__op-btn--on":n().op==="add"}),ie(Q,"aria-pressed",n().op==="add"),y=Ke(p,1,"rebemer-row__op-btn",null,y,{"rebemer-row__op-btn--on":n().op==="rename"}),ie(p,"aria-pressed",n().op==="rename"),L=Ke(C,1,"rebemer-row__op-btn",null,L,{"rebemer-row__op-btn--on":n().op==="replace"}),ie(C,"aria-pressed",n().op==="replace")}),se("click",Q,()=>{n(n().op="add",!0)}),se("click",p,()=>{n(n().op="rename",!0),!n().renameFamilyId&&l(f).length&&n(n().renameFamilyId=l(f)[0].id,!0)}),se("click",C,()=>{n(n().op="replace",!0),n(n().renameFamilyId="",!0)}),S(g,E)};W(Ln,g=>{l(c)&&n().include&&g(sn)})}var an=k(Ln,2);{var on=g=>{var E=tu();S(g,E)},lr=g=>{var E=nu(),I=w(E);B(()=>H(I,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),S(g,E)};W(an,g=>{l(u)&&n().include&&n().currentClassCount===0?g(on):l(u)&&n().include&&n().currentClassCount>1&&g(lr,1)})}var Pn=k(an,2);{var cr=g=>{var E=au(),I=w(E);{var Q=p=>{var y=ru(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(p,y)},R=p=>{var y=su(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(p,y)};W(I,p=>{l(i)?p(Q):p(R,-1)})}S(g,E)};W(Pn,g=>{l(O)&&g(cr)})}var P=k(Pn,2);{var V=g=>{var E=uu(),I=w(E);{var Q=C=>{var L=iu(),j=k(Se(L),2);ke(j,17,()=>n().migrateKeys,zr,($,ce)=>{var G=ou(),he=w(G);B(ye=>{ie(G,"title",`Will be lifted into ${(a()[0]||"the new class")??""}`),H(he,ye)},[()=>T(l(ce))]),S($,G)}),S(C,L)},R=C=>{var L=lu();S(C,L)};W(I,C=>{n().migrateKeys?.length?C(Q):C(R,-1)})}var p=k(I,2);{var y=C=>{var L=cu(),j=w(L);B(()=>H(j,`${n().skippedKeys.length??""} skipped`)),S(C,L)};W(p,C=>{n().skippedKeys?.length&&C(y)})}S(g,E)};W(P,g=>{l(i)&&n().include&&g(V)})}B(()=>{F=Ke(M,1,"rebemer-row",null,F,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":l(b)}),Tt(M,`--rebemer-row-depth: ${n().depth??0??""}`),H(pe,n().originalLabel),ie(ft,"placeholder",t.isRoot?"block-name":"element-name"),ft.disabled=!n().include}),Uo(ae,()=>n().include,g=>n(n().include=g,!0)),se("input",ft,A),ea(ft,()=>n().name,g=>n(n().name=g,!0)),S(e,M),On()}In(["click","input"]);var hu=x(" ");function ti(e,t){Tn(t,!0);let n=Yt(t,"kind",3,"info"),r=Yt(t,"duration",3,3e3),s=de(!0);ws(()=>{if(!l(s)||r()<=0)return;const c=setTimeout(()=>{X(s,!1),t.onDismiss?.()},r());return()=>clearTimeout(c)});const a=U(()=>n()==="error"?"alert":"status");var o=Ho(),i=Se(o);{var u=c=>{var h=hu(),f=w(h);B(()=>{Ke(h,1,`rebemer-toast rebemer-toast--${n()??""}`),ie(h,"role",l(a)),ie(h,"aria-live",n()==="error"?"assertive":"polite"),H(f,t.message)}),se("click",h,()=>{X(s,!1),t.onDismiss?.()}),S(c,h)};W(i,c=>{l(s)&&c(u)})}S(e,o),On()}In(["click"]);var vu=x("Will migrate ",1),_u=x(' '),pu=x(''),mu=x(' ',1);function gu(e,t){Tn(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).",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class.",mixed:"Per-element control — every row defaults to Add. Switch any row to Rename (targets one class family, keeps others) or Replace (strips all existing classes, or just a selected family)."};function r(P){const V=P?._cssGlobalClasses;return V?(Array.isArray(V)?V:Object.values(V)).filter(E=>typeof E=="string"&&E.length>0):[]}function s(P,V){const g=r(P);for(const E of g){const I=V.find(Q=>Q&&Q.id===E);if(I&&!I.name.includes("--"))return E}return g[0]??""}let a=de("add"),o=de(!0),i=de(Lt([])),u=de(Lt([])),c=de(null),h=de(null);const f=U(()=>l(i)[0]?.originalLabel??""),v=U(()=>l(i).length===0?new Map:Qo(l(i),t.rootId)),_=U(()=>{if(l(a)!=="migrate")return null;let P=0,V=0;for(const g of l(i))g.include&&(P+=g.migrateKeys?.length??0,V+=g.skippedKeys?.length??0);return{willMigrate:P,willSkip:V}}),b=U(()=>{if(l(i).length===0)return new Map;const P=Xo({rootId:t.rootId,rows:l(i),mode:l(a)}),V=new Map;if(!P.ok)return V;for(const g of P.ops){const E=[g.finalClass];for(const I of g.modifierSlugs??[])E.push(`${g.finalClass}--${I}`);V.set(g.row.id,E)}return V});Ko(()=>{const P=Ql(t.rootId);X(u,Go().slice(),!0);const V=P.map((g,E)=>{const I=E===0,Q=g.label||"",R=Rt(Q),p=g.name||"";let y,C;R?(y=R,C="label"):I?(y="block",C="fallback"):p&&!Rs(p)?(y=Pc(p,"item"),C="element-type"):(y="item",C="fallback");const L=r(g.settings);return{id:g.id,depth:g.depth,bricksType:p,originalLabel:Q||(I?"block":"element"),name:y,modifiers:[""],isBlockRoot:!1,include:!0,suggestedFrom:C,migrateKeys:Sc(g.settings),skippedKeys:Cc(g.settings),currentClassCount:L.length,currentClassIds:L,op:"add",renameFamilyId:s(g.settings,l(u))}});if(V.length>1){const g=new Map(P.map(R=>[R.id,[]])),E=[];for(const R of P){for(;E.length&&E[E.length-1].depth>=R.depth;)E.pop();E.length&&g.get(E[E.length-1].id).push(R.id),E.push(R)}const I=new Map(P.map(R=>[R.id,R])),Q=new Map(V.map(R=>[R.id,R]));for(const[,R]of g){if(!R.length)continue;const p=new Map;for(const C of R){const L=I.get(C)?.name;L&&p.set(L,(p.get(L)??0)+1)}const y=R.filter(C=>Rs(I.get(C)?.name??""));for(const C of R){const L=Q.get(C),j=I.get(C);if(!(!L||!j||L.suggestedFrom==="label")){if(Rs(j.name)){const $=(g.get(C)??[]).map(G=>I.get(G)?.name??"").filter(Boolean),ce=y.indexOf(C);L.name=Nc($,ce,y.length),L.suggestedFrom="element-type"}else if((p.get(j.name)??0)===1){const $=Rc[j.name];$&&(L.name=$,L.suggestedFrom="element-type")}}}}}X(i,V,!0)});function O(P){if(P.key==="Escape"){t.onClose?.();return}l(h)&&P.target instanceof Node&&l(h).contains(P.target)&&P.key==="Enter"&&(P.target?.tagName==="INPUT"||P.target?.tagName==="SELECT")&&(P.preventDefault(),A())}let m=null;function A(){const P=Rt(l(i)[0]?.name??""),V=Fa(P);if(!V.ok){X(c,{kind:"error",message:V.reason},!0);return}for(const E of l(i)){if(!E.isBlockRoot||!E.include)continue;const I=Fa(Rt(E.name??""));if(!I.ok){X(c,{kind:"error",message:`Sub-block "${E.originalLabel}": ${I.reason}`},!0);return}}const g=Ac({rootId:t.rootId,rows:l(i),mode:l(a),syncLabels:l(o)});g.ok?(X(c,{kind:"success",message:`Applied to ${g.count} element${g.count!==1?"s":""}.`},!0),m&&clearTimeout(m),m=setTimeout(()=>t.onClose?.(),800)):X(c,{kind:"error",message:g.error},!0)}ws(()=>()=>{m&&clearTimeout(m)});var T=mu();jo("keydown",us,O);var M=Se(T),F=w(M),Z=w(F),ae=k(w(Z)),re=w(ae),xe=k(Z,2),pe=k(F,2),oe=w(pe),qt=k(w(oe),2),De=w(qt);De.value=De.__value="add";var Zt=k(De);Zt.value=Zt.__value="rename";var en=k(Zt);en.value=en.__value="replace";var jt=k(en);jt.value=jt.__value="migrate";var tn=k(jt);tn.value=tn.__value="mixed";var nn=k(oe,2),rt=w(nn),ft=k(pe,2),Mn=w(ft),rn=k(ft,2);{var Ln=P=>{var V=pu();let g;var E=w(V);{var I=y=>{var C=Ll("No migratable style keys found on any included element. Apply will attach empty classes.");S(y,C)},Q=y=>{var C=vu(),L=k(Se(C)),j=w(L),$=k(L);B(()=>{H(j,l(_).willMigrate),H($,` style key${l(_).willMigrate===1?"":"s"} into new classes.`)}),S(y,C)};W(E,y=>{l(_).willMigrate===0?y(I):y(Q,-1)})}var R=k(E,2);{var p=y=>{var C=_u(),L=w(C);B(()=>H(L,`${l(_).willSkip??""} key${l(_).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),S(y,C)};W(R,y=>{l(_).willSkip>0&&y(p)})}B(()=>g=Ke(V,1,"rebemer-panel__notice",null,g,{"rebemer-panel__notice--warn":l(_).willSkip>0||l(_).willMigrate===0})),S(P,V)};W(rn,P=>{l(_)&&P(Ln)})}var sn=k(rn,2);ke(sn,23,()=>l(i),P=>P.id,(P,V,g)=>{{let E=U(()=>l(v).get(l(V).id)??""),I=U(()=>l(V).id===t.rootId||l(V).isBlockRoot),Q=U(()=>l(b).get(l(V).id)??[]);du(P,{get mode(){return l(a)},get blockName(){return l(E)},get isRoot(){return l(I)},get rootId(){return t.rootId},get globalClasses(){return l(u)},get finalClassNames(){return l(Q)},get row(){return l(i)[l(g)]},set row(R){l(i)[l(g)]=R}})}});var an=k(sn,2),on=w(an),lr=k(on,2);zl(M,P=>X(h,P),()=>l(h));var Pn=k(M,2);{var cr=P=>{ti(P,{get kind(){return l(c).kind},get message(){return l(c).message},onDismiss:()=>{X(c,null)}})};W(Pn,P=>{l(c)&&P(cr)})}B(()=>{H(re,l(f)),H(Mn,n[l(a)])}),se("click",xe,()=>t.onClose?.()),Zs(qt,()=>l(a),P=>X(a,P)),Uo(rt,()=>l(o),P=>X(o,P)),se("click",on,()=>t.onClose?.()),se("click",lr,A),S(e,T),On()}In(["click"]);var bu=x('');function yu(e,t){var n=bu();let r;B(()=>{r=Ke(n,1,"slashed-cp-launch",null,r,{"slashed-cp-launch--on":t.open}),ie(n,"aria-pressed",t.open)}),se("click",n,function(...s){t.onToggle?.apply(this,s)}),S(e,n)}In(["click"]);const Ha="--sf-color-",ni=["primary","secondary","tertiary","action","neutral","base"],ri=["success","warning","error","info","danger"],Wa=["a5","a10","a20","a30","a40","a50","a60","a70","a80","a90","a95"],Ua=["superlight","xlight","lighter","darker","xdark","superdark","hover","active","strong","subtle","muted","ghost"],Vr=["text","heading","bg","surface","inset","raised","overlay","inverse","border","link","code","selection","mark","dim"],wu=e=>new Set(e),ku=wu([...ni,...ri]),Ka={primary:{tagline:"Brand identity & main emphasis",use:"Headlines, primary buttons, key brand moments."},secondary:{tagline:"Supporting brand tone",use:"Secondary surfaces and muted brand accents."},tertiary:{tagline:"Accent / highlight",use:"Badges, tags, decorative highlights."},action:{tagline:"Interactive & links",use:"Links, focus rings, anything clickable."},neutral:{tagline:"Text, icons & dividers",use:"Body text, borders, neutral UI chrome."},base:{tagline:"Page & surface backgrounds",use:"Page background and raised surfaces."},success:{tagline:"Positive / confirmation",use:"Success messages and valid state."},warning:{tagline:"Caution",use:"Warnings and at-risk / pending state."},error:{tagline:"Form & validation errors",use:"Invalid inputs and error messages."},info:{tagline:"Informational",use:"Tips and neutral notices."},danger:{tagline:"Destructive actions",use:"Delete / remove and irreversible actions."},semantic:{tagline:"Ready-made role tokens",use:"Pre-wired roles that already adapt to light/dark."}},Ns=[{id:"text-on",label:"Text on color",match:e=>e.startsWith("text--on")},{id:"text",label:"Text",match:e=>e==="text"||e==="heading"||e.startsWith("text-")},{id:"state",label:"Interactive states",match:e=>e.startsWith("bg--")},{id:"surface",label:"Surfaces & backgrounds",match:e=>["bg","surface","inset","raised","overlay","inverse"].some(t=>e===t||e.startsWith(t+"-"))},{id:"border",label:"Borders",match:e=>e==="border"||e.startsWith("border-")},{id:"link",label:"Links",match:e=>e==="link"||e.startsWith("link-")},{id:"select",label:"Selection & marks",match:e=>e.startsWith("selection")||e.startsWith("mark")||e==="dim"},{id:"code",label:"Code",match:e=>e.startsWith("code")}];function Su(e){if(typeof e!="string"||e.indexOf(Ha)!==0)return null;const t=e.slice(Ha.length);if(!t||t==="scheme")return null;const n=t.indexOf("-"),r=n===-1?t:t.slice(0,n);if(!ku.has(r))return{family:"semantic",kind:"semantic",step:null,key:t};const s=n===-1?"":t.slice(n+1);return s===""?{family:r,kind:"base",step:null,key:t}:s==="light"?null:/^[0-9]+$/.test(s)?{family:r,kind:"scale",step:Number(s),key:t}:/^a[0-9]+$/.test(s)?{family:r,kind:"alpha",step:s,key:t}:{family:r,kind:"alias",step:s,key:t}}function Eu(e){return e.kind==="alpha"?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function Cu(e){switch(e.kind){case"base":return hs(e.family);case"scale":return String(e.step);case"alpha":return String(e.step).toUpperCase();case"alias":return hs(String(e.step));case"semantic":default:return xu(e.key)}}function hs(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function xu(e){return e.split("--").map(n=>n.split("-").map(hs).join(" ")).join(" · ")}function Au(e,t,n,r){const s=n[e];if(typeof s!="string"||!s)return null;const a=typeof r[e]=="string"&&r[e]?r[e]:s;return{var:e,name:e.slice(2),label:Cu(t),light:s,dark:a,alpha:Eu(t)}}function Tu(e,t){const n={base:0,scale:1,alias:2,alpha:3};if(n[e.info.kind]!==n[t.info.kind])return n[e.info.kind]-n[t.info.kind];if(e.info.kind==="scale")return e.info.step-t.info.step;if(e.info.kind==="alpha")return Wa.indexOf(e.info.step)-Wa.indexOf(t.info.step);if(e.info.kind==="alias"){const r=Ua.indexOf(e.info.step),s=Ua.indexOf(t.info.step),a=r===-1?999:r,o=s===-1?999:s;return a!==o?a-o:String(e.info.step).localeCompare(String(t.info.step))}return 0}function Ou(e,t){const n=Vr.findIndex(o=>e.info.key===o||e.info.key.startsWith(o+"-")),r=Vr.findIndex(o=>t.info.key===o||t.info.key.startsWith(o+"-")),s=n===-1?Vr.length:n,a=r===-1?Vr.length:r;return s!==a?s-a:e.info.key.localeCompare(t.info.key)}function Iu(e,t,n){const r=Array.isArray(e)?e:[],s=t&&typeof t=="object"?t:{},a=n&&typeof n=="object"?n:{},o=new Map,i=[];for(const h of r){const f=Su(h);if(!f)continue;const v=Au(h,f,s,a);if(!v)continue;const _={swatch:v,info:f};if(f.family==="semantic"){i.push(_);continue}o.has(f.family)||o.set(f.family,[]),o.get(f.family).push(_)}const u=[],c=(h,f)=>{const v=o.get(h);if(!v||v.length===0)return;v.sort(Tu);const _=v.filter(T=>T.info.kind==="base"||T.info.kind==="scale"),b=v.filter(T=>T.info.kind==="alias"),O=v.filter(T=>T.info.kind==="alpha"),m=[];_.length&&m.push({id:"scale",label:"Shades & tints",swatches:_.map(T=>T.swatch)}),O.length&&m.push({id:"alpha",label:"Transparent",swatches:O.map(T=>T.swatch)}),b.length&&m.push({id:"alias",label:"Semantic",swatches:b.map(T=>T.swatch)});const A=Ka[h]||{};u.push({id:h,label:hs(h),type:f,count:v.length,tagline:A.tagline||"",use:A.use||"",sections:m})};for(const h of ni)c(h,"brand");for(const h of ri)c(h,"status");if(i.length){i.sort(Ou);const h=new Map(Ns.map(b=>[b.id,[]])),f=[];for(const b of i){const O=Ns.find(m=>m.match(b.info.key));O?h.get(O.id).push(b.swatch):f.push(b.swatch)}const v=[];for(const b of Ns){const O=h.get(b.id);O.length&&v.push({id:b.id,label:b.label,swatches:O})}f.length&&v.push({id:"other",label:"Other",swatches:f});const _=Ka.semantic||{};u.push({id:"semantic",label:"Semantic",type:"semantic",count:i.length,tagline:_.tagline||"",use:_.use||"",sections:v})}return{groups:u}}function Mu(e,t){const n=String(t||"").trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};const r=[];for(const s of e.groups){const a=[];for(const o of s.sections){const i=o.swatches.filter(u=>u.name.toLowerCase().includes(n)||u.label.toLowerCase().includes(n)||s.label.toLowerCase().includes(n));i.length&&a.push({...o,swatches:i})}if(a.length){const o=a.reduce((i,u)=>i+u.swatches.length,0);r.push({...s,sections:a,count:o})}}return{groups:r}}function Lu(e){return`var(${e.var})`}function Pu(e,t){return t==="dark"?e.dark:e.light}const Ru=[{id:"typography",label:"Typography",tokens:[{var:"--sf-color-heading",label:"Heading"},{var:"--sf-color-text",label:"Text"},{var:"--sf-color-text--muted",label:"Text · Muted"},{var:"--sf-color-text--secondary",label:"Text · Secondary"},{var:"--sf-color-text--on-primary",label:"On Primary"},{var:"--sf-color-text--on-secondary",label:"On Secondary"}]},{id:"surfaces",label:"Surfaces",tokens:[{var:"--sf-color-bg",label:"Background"},{var:"--sf-color-surface",label:"Surface"},{var:"--sf-color-raised",label:"Raised"},{var:"--sf-color-inset",label:"Inset"},{var:"--sf-color-overlay",label:"Overlay"},{var:"--sf-color-inverse",label:"Inverse"}]},{id:"structure",label:"Structure",tokens:[{var:"--sf-color-border",label:"Border"},{var:"--sf-color-border--subtle",label:"Border · Subtle"},{var:"--sf-color-border--strong",label:"Border · Strong"},{var:"--sf-color-link",label:"Link"},{var:"--sf-color-link--hover",label:"Link · Hover"}]},{id:"brand",label:"Brand",tokens:[{var:"--sf-color-primary",label:"Primary"},{var:"--sf-color-secondary",label:"Secondary"},{var:"--sf-color-tertiary",label:"Tertiary"},{var:"--sf-color-action",label:"Action"},{var:"--sf-color-neutral",label:"Neutral"},{var:"--sf-color-base",label:"Base"}]},{id:"feedback",label:"Feedback",tokens:[{var:"--sf-color-success",label:"Success"},{var:"--sf-color-success-subtle",label:"Success · Subtle"},{var:"--sf-color-warning",label:"Warning"},{var:"--sf-color-warning-subtle",label:"Warning · Subtle"},{var:"--sf-color-error",label:"Error"},{var:"--sf-color-error-subtle",label:"Error · Subtle"},{var:"--sf-color-info",label:"Info"},{var:"--sf-color-danger",label:"Danger"}]}];function Nu(e,t,n){const r=t&&typeof t=="object"?t:{},s=n&&typeof n=="object"?n:{},a=[];for(const o of Ru){const i=[];for(const u of o.tokens){const c=r[u.var];if(!c)continue;const h=s[u.var]||c;i.push({var:u.var,name:u.var.slice(2),label:u.label,light:c,dark:h,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(u.var)})}i.length&&a.push({id:o.id,label:o.label,swatches:i})}return{groups:a}}var Bu=x('');function Bs(e,t){Tn(t,!0);let n=Yt(t,"onPick",3,void 0);const r=U(()=>`${t.swatch.name} -light ${t.swatch.light} · dark ${t.swatch.dark}`);var s=Bu();let a;B(o=>{a=Ke(s,1,"slashed-cp-swatch",null,a,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode==="both"}),Tt(s,`--cp-l:${t.swatch.light??""}; --cp-d:${t.swatch.dark??""}; --cp-solid:${o??""};`),ie(s,"title",l(r)),ie(s,"aria-label",t.swatch.name)},[()=>Pu(t.swatch,t.mode==="dark"?"dark":"light")]),se("click",s,()=>n()?.(t.swatch)),S(e,s),On()}In(["click"]);var Fu=x(''),Du=x(''),qu=x(''),ju=x('
'),Hu=x('

',1),Wu=x(''),Uu=x('

Scale 50 → 950

',1),Ku=x(''),zu=x('
'),Vu=x(' ',1),Gu=x('
'),Yu=x('
'),$u=x('
'),Ju=x(''),Qu=x('

'),Xu=x(' '),Zu=x(''),ef=x('
  • '),tf=x('
      '),nf=x('
      '),rf=x('
      '),sf=x(" ",1),af=x('

      '),of=x(" ",1),lf=x(''),cf=x('

      '),uf=x('

      Quick Use

      Palette

      Brand

      Status

      ',1),ff=x(''),df=x('

      Color System

      var()
      ',1);function si(e,t){Tn(t,!0);const n=(p,y=Xa)=>{var C=$u();ke(C,21,y,L=>L.id,(L,j)=>{const $=U(()=>Zt(l(j))),ce=U(()=>en(l(j))),G=U(()=>l(h)===l(j).id);var he=Yu(),ye=w(he);let Ie;var st=w(ye);{var kt=we=>{var Me=Fu();B(()=>Tt(Me,`--sw-l: ${l($).light??""}; --sw-d: ${l($).dark??""}`)),S(we,Me)};W(st,we=>{l($)&&we(kt)})}var ve=k(st,2),le=w(ve),te=k(ve,2),ee=w(te),ne=k(te,2);ke(ne,21,()=>l(ce),we=>we.var,(we,Me)=>{var _e=Du();B(()=>{Tt(_e,`--sw-l: ${l(Me).light??""}; --sw-d: ${l(Me).dark??""}`),ie(_e,"title",l(Me).label)}),S(we,_e)});var me=k(ne,2),ze=w(me),dt=k(ye,2);{var ht=we=>{const Me=U(()=>De(l(j),"alias")),_e=U(()=>jt(l(j))),at=U(()=>De(l(j),"alpha"));var Ve=Gu(),St=w(Ve);{var ln=Ae=>{var Le=qu(),vt=w(Le),Et=w(vt);B(()=>{Tt(Le,`--sw-l: ${l($).light??""}; --sw-d: ${l($).dark??""}`),ie(Le,"title",`${l(j).label??""} base — ${l($).name??""}`),H(Et,l(j).label)}),se("click",Le,()=>pe(l($))),S(Ae,Le)};W(St,Ae=>{l($)&&Ae(ln)})}var Ht=k(St,2);{var Rn=Ae=>{var Le=Hu(),vt=Se(Le),Et=w(vt),Ct=k(vt,2);ke(Ct,21,()=>l(Me).swatches,_t=>_t.var,(_t,Dr)=>{var qr=ju(),Wt=w(qr);Bs(Wt,{get swatch(){return l(Dr)},get mode(){return l(i)},onPick:pe});var jr=k(Wt,2),ur=w(jr);B(()=>H(ur,l(Dr).label)),S(_t,qr)}),B(()=>H(Et,`Aliases · ${l(Me).swatches.length??""}`)),S(Ae,Le)};W(Ht,Ae=>{l(Me)?.swatches.length&&Ae(Rn)})}var Nn=k(Ht,2);{var Cs=Ae=>{var Le=Uu(),vt=k(Se(Le),2);ke(vt,21,()=>l(_e),Et=>Et.var,(Et,Ct)=>{var _t=Wu();B(()=>{ie(_t,"title",`${l(Ct).label??""} — ${l(Ct).name??""}`),Tt(_t,`--sw-l: ${l(Ct).light??""}; --sw-d: ${l(Ct).dark??""}`)}),se("click",_t,()=>pe(l(Ct))),S(Et,_t)}),S(Ae,Le)};W(Nn,Ae=>{l(_e).length&&Ae(Cs)})}var xs=k(Nn,2);{var oi=Ae=>{var Le=Vu(),vt=Se(Le),Et=w(vt),Ct=w(Et),_t=k(vt,2);{var Dr=Wt=>{var jr=zu();ke(jr,21,()=>l(at).swatches,ur=>ur.var,(ur,fr)=>{var Hr=Ku();B(()=>{ie(Hr,"title",`${l(fr).label??""} — ${l(fr).name??""}`),Tt(Hr,`--sw-l: ${l(fr).light??""}; --sw-d: ${l(fr).dark??""}`)}),se("click",Hr,()=>pe(l(fr))),S(ur,Hr)}),S(Wt,jr)},qr=U(()=>l(f).has(l(j).id));W(_t,Wt=>{l(qr)&&Wt(Dr)})}B(Wt=>H(Ct,Wt),[()=>l(f).has(l(j).id)?"▾":"▸"]),se("click",vt,()=>qt(l(j).id)),S(Ae,Le)};W(xs,Ae=>{l(at)?.swatches.length&&Ae(oi)})}S(we,Ve)};W(dt,we=>{l(G)&&we(ht)})}B(()=>{Ie=Ke(ye,1,"slashed-cp__scan-row",null,Ie,{"slashed-cp__scan-row--open":l(G)}),ie(ye,"aria-expanded",l(G)),H(le,l(j).label),H(ee,l(j).tagline),H(ze,l(G)?"▾":"▸")}),se("click",ye,()=>oe(l(j).id)),S(L,he)}),S(p,C)};let r=Yt(t,"dockedLeft",3,null);const s=U(()=>typeof t.onPickValue=="function"),a=[{id:"both",label:"Both"},{id:"light",label:"Light"},{id:"dark",label:"Dark"}],o=["Hover","Active","Subtle","Ghost","Superlight"];let i=de("both"),u=de(""),c=de(null),h=de(null),f=de(Lt(new Set));const v=U(()=>Iu(t.source?.variables,t.source?.light,t.source?.dark)),_=U(()=>l(u).trim()),b=U(()=>Mu(l(v),l(_))),O=U(()=>Nu(t.source?.variables,t.source?.light,t.source?.dark)),m=U(()=>l(v).groups.reduce((p,y)=>p+y.count,0)),A=U(()=>l(v).groups.filter(p=>p.type==="brand")),T=U(()=>l(v).groups.filter(p=>p.type==="status"));let M;function F(){if(typeof document>"u")return null;const p=document.querySelector('iframe#bricks-builder-iframe, iframe[name="bricks-builder-iframe"], #bricks-builder-area iframe');try{return p?.contentDocument?.documentElement??null}catch{return null}}function Z(p){const y=F();if(y)try{M===void 0&&(M=y.getAttribute("data-theme")),p==="light"||p==="dark"?y.setAttribute("data-theme",p):M===null?y.removeAttribute("data-theme"):y.setAttribute("data-theme",M)}catch{}}function ae(){const p=F();if(!(!p||M===void 0))try{M===null?p.removeAttribute("data-theme"):p.setAttribute("data-theme",M)}catch{}}function re(p){X(i,p,!0),Z(p)}Ko(()=>()=>ae());async function xe(p){try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(p),!0}catch{}try{const y=document.createElement("textarea");y.value=p,y.style.cssText="position:fixed;opacity:0",document.body.appendChild(y),y.select();const C=document.execCommand("copy");return y.remove(),C}catch{return!1}}async function pe(p){const y=Lu(p);if(l(s)){if(t.onPickValue(y)===!1){X(c,{kind:"error",message:`Couldn't apply ${y} — input not found`},!0);return}t.onPick?.();return}const C=await xe(y);X(c,C?{kind:"info",message:`Copied — ${p.name}`}:{kind:"error",message:`Couldn't copy ${y}`},!0)}function oe(p){X(h,l(h)===p?null:p,!0),X(f,new Set,!0)}function qt(p){const y=new Set(l(f));y.has(p)?y.delete(p):y.add(p),X(f,y,!0)}function De(p,y){return p.sections.find(C=>C.id===y)}function Zt(p){return De(p,"scale")?.swatches[0]??null}function en(p){const y=De(p,"alias");if(!y?.swatches.length)return[];const C=o.map(L=>y.swatches.find(j=>j.label===L)).filter(Boolean);return C.length?C:y.swatches.slice(0,5)}function jt(p){return De(p,"scale")?.swatches.slice(1)??[]}function tn(p){p.key==="Escape"&&t.onClose?.()}var nn=df();jo("keydown",us,tn);var rt=Se(nn);let ft;var Mn=w(rt),rn=k(w(Mn),2);ke(rn,21,()=>a,p=>p.id,(p,y)=>{var C=Ju();let L;var j=w(C);B(()=>{L=Ke(C,1,"slashed-cp__seg-btn",null,L,{"slashed-cp__seg-btn--on":l(i)===l(y).id}),ie(C,"aria-pressed",l(i)===l(y).id),H(j,l(y).label)}),se("click",C,()=>re(l(y).id)),S(p,C)});var Ln=k(rn,2),sn=k(Mn,2),an=w(sn),on=k(sn,2),lr=w(on);{var Pn=p=>{var y=of(),C=Se(y);{var L=$=>{var ce=Qu(),G=w(ce);B(()=>H(G,`No tokens match "${l(_)??""}".`)),S($,ce)};W(C,$=>{l(b).groups.length===0&&$(L)})}var j=k(C,2);ke(j,17,()=>l(b).groups,$=>$.id,($,ce)=>{var G=af(),he=w(G),ye=w(he),Ie=w(ye),st=k(Ie);{var kt=ee=>{var ne=Xu(),me=w(ne);B(()=>H(me,l(ce).tagline)),S(ee,ne)};W(st,ee=>{l(ce).tagline&&ee(kt)})}var ve=k(st,2),le=w(ve),te=k(he,2);ke(te,17,()=>l(ce).sections,ee=>ee.id,(ee,ne)=>{var me=sf(),ze=Se(me);{var dt=_e=>{var at=Zu(),Ve=w(at);B(()=>H(Ve,l(ne).label)),S(_e,at)};W(ze,_e=>{l(ne).label&&_e(dt)})}var ht=k(ze,2);{var we=_e=>{var at=tf();ke(at,21,()=>l(ne).swatches,Ve=>Ve.var,(Ve,St)=>{var ln=ef(),Ht=w(ln);Bs(Ht,{get swatch(){return l(St)},get mode(){return l(i)},onPick:pe});var Rn=k(Ht,2),Nn=w(Rn),Cs=k(Rn,2),xs=w(Cs);B(()=>{H(Nn,l(St).label),H(xs,l(St).name)}),S(Ve,ln)}),S(_e,at)},Me=_e=>{var at=rf();ke(at,21,()=>l(ne).swatches,Ve=>Ve.var,(Ve,St)=>{var ln=nf(),Ht=w(ln);Bs(Ht,{get swatch(){return l(St)},get mode(){return l(i)},onPick:pe});var Rn=k(Ht,2),Nn=w(Rn);B(()=>H(Nn,l(St).label)),S(Ve,ln)}),S(_e,at)};W(ht,_e=>{l(ce).type==="semantic"?_e(we):_e(Me,-1)})}S(ee,me)}),B(()=>{ie(G,"data-type",l(ce).type),H(Ie,`${l(ce).label??""} `),H(le,l(ce).count)}),S($,G)}),S(p,y)},cr=p=>{var y=uf(),C=Se(y),L=k(w(C),2);ke(L,17,()=>l(O).groups,G=>G.id,(G,he)=>{var ye=cf(),Ie=w(ye),st=w(Ie),kt=k(Ie,2);ke(kt,21,()=>l(he).swatches,ve=>ve.var,(ve,le)=>{var te=lf(),ee=w(te);let ne;var me=k(ee,2),ze=w(me);B(()=>{ie(te,"title",l(le).name),ne=Ke(ee,1,"slashed-cp__qu-sw",null,ne,{"slashed-cp__qu-sw--alpha":l(le).alpha}),Tt(ee,`--sw-l: ${l(le).light??""}; --sw-d: ${l(le).dark??""}`),H(ze,l(le).label)}),se("click",te,()=>pe(l(le))),S(ve,te)}),B(()=>H(st,l(he).label)),S(G,ye)});var j=k(C,2),$=k(w(j),4);n($,()=>l(A));var ce=k($,4);n(ce,()=>l(T)),S(p,y)};W(lr,p=>{l(_)?p(Pn):p(cr,-1)})}var P=k(on,2),V=w(P);{var g=p=>{var y=ff();S(p,y)};W(V,p=>{l(i)==="both"&&p(g)})}var E=k(V,2),I=w(E),Q=k(rt,2);{var R=p=>{ti(p,{get kind(){return l(c).kind},get message(){return l(c).message},onDismiss:()=>{X(c,null)}})};W(Q,p=>{l(c)&&p(R)})}B(()=>{ft=Ke(rt,1,"slashed-cp",null,ft,{"slashed-cp--docked":l(s)}),ie(rt,"data-mode",l(i)),Tt(rt,l(s)&&r()!=null?`--cp-dock-left: ${r()}px`:""),ie(an,"placeholder",`Search ${l(m)} tokens…`),H(I,`${l(s)?"Click to insert":"Click to copy"} `)}),se("click",rt,p=>p.stopPropagation()),se("mousedown",rt,p=>p.stopPropagation()),se("click",Ln,()=>t.onClose?.()),ea(an,()=>l(u),p=>X(u,p)),S(e,nn),On()}In(["click","mousedown"]);var hf=x(" ",1);function vf(e,t){let n=de(!1);var r=hf(),s=Se(r);yu(s,{get open(){return l(n)},onToggle:()=>X(n,!l(n))});var a=k(s,2);{var o=i=>{si(i,{get source(){return t.source},onClose:()=>X(n,!1)})};W(a,i=>{l(n)&&i(o)})}S(e,r)}const za="#bricks-structure",_f="li[data-id]",Va="slashed-rebemer-host",pf=400,mf=25,ir=(e,...t)=>console[e]("[reBEMer]",...t),ai=new AbortController,{signal:Cr}=ai,Sn=new Map;let mr=null,qn=null,gr=null;function ma(){let e=document.getElementById(Va);return e||(e=document.createElement("div"),e.id=Va,document.body.appendChild(e)),e}let Ue=null;function Ga(){Ue=window.slashedBricksEditor,Ue&&typeof Ue=="object"&&(cc(Ue.showClassHints,Ue.classHints,{signal:Cr}),mc(Ue.showColorSwatches,Ue.colorHexMap,{signal:Cr,onOpenPanel:Ue.showColorPanel?n=>Ef(n):void 0}));let e=0;const t=()=>{if(!Cr.aborted){if(Yl()){gf();return}if(++e>=mf){ir("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(t,pf)}};t()}function gf(){yf();const e=document.querySelector(za);if(e){Ya(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(za);n&&(t.disconnect(),Ya(n))});t.observe(document.body,{childList:!0,subtree:!0}),Cr.addEventListener("abort",()=>t.disconnect(),{once:!0})}function Ya(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,$a(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),Cr.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),$a(e)}function $a(e){for(const[n,r]of Sn)if(!r.host.isConnected){try{or(r.instance)}catch(s){ir("warn","badge unmount failed",s)}Sn.delete(n)}const t=e.querySelectorAll(_f);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const s=Sn.get(r);s&&s.host.isConnected&&n.contains(s.host)||bf(n)}}function bf(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"),s=document.createElement("span");s.className="rebemer-badge-host",r?n.insertBefore(s,r):n.appendChild(s);const a=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),o=a?a.textContent.trim():"",i=Ss(yc,{target:s,props:{elementId:t,label:o,onActivate:Cf}}),u=Sn.get(t);if(u){try{or(u.instance)}catch(c){ir("warn","badge remount cleanup failed",c)}u.host.isConnected&&u.host.remove()}Sn.set(t,{instance:i,host:s})}function yf(){if(qn)return;const e=Ue&&Ue.colorPanel;if(!Ue?.showColorPanel||!e||!Array.isArray(e.variables)||e.variables.length===0)return;const t=document.createElement("div");ma().appendChild(t),qn={instance:Ss(vf,{target:t,props:{source:e}}),node:t}}function wf(){if(qn){try{or(qn.instance)}catch(e){ir("warn","color app unmount failed",e)}qn.node.remove(),qn=null}}function kf(e,t){if(!e||!e.isConnected)return!1;try{const n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;return n?n.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),!0}catch{return!1}}function Sf(e){const t=["#bricks-panel-inner","#bricks-panel",'[id^="bricks-panel"]'];if(e)for(const n of t){const r=e.closest(n);if(r){const s=r.getBoundingClientRect();if(s.width>100)return Math.ceil(s.right)}}for(const n of t){const r=document.querySelector(n);if(r){const s=r.getBoundingClientRect();if(s.width>100)return Math.ceil(s.right)}}return null}function Ef(e){as();const t=Ue?.colorPanel;if(!t||!Array.isArray(t.variables)||t.variables.length===0)return;const n=Sf(e),r=document.createElement("div");ma().appendChild(r),gr={instance:Ss(si,{target:r,props:{source:t,dockedLeft:n,onPickValue:s=>{const a=e?.querySelector('input[type="text"]')??e?.querySelector('input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])'),o=kf(a,s);if(o){const i=s.match(/^var\((--[^)]+)\)/)?.[1],u=i?Ue?.colorHexMap?.[i]??null:null,c=e?.querySelector(".slashed-sf-color-btn");if(c){const h=c.querySelector(".slashed-sf-color-btn__dot");h&&(u?(h.style.background=u,h.style.removeProperty("box-shadow")):h.style.removeProperty("background")),c.classList.toggle("slashed-sf-color-btn--active",!!u)}if(u){const h=e?.closest('[data-control="color"]');requestAnimationFrame(()=>{if(!h)return;const f=h.querySelector(".bricks-control-preview");if(!f)return;const v=f.querySelector(":scope > span:not(.color-value-tooltip):not(.bricks-svg-wrapper)")??f.querySelectorAll(":scope > span")[1];v&&(v.style.display="block",v.style.background=u,v.style.setProperty("color",u,"important")),f.classList.remove("empty")})}}return o},onPick:as,onClose:as}}),node:r}}function as(){if(gr){try{or(gr.instance)}catch(e){ir("warn","color picker panel unmount failed",e)}gr.node.remove(),gr=null}}function Cf(e){ra();const t=document.createElement("div");ma().appendChild(t),mr={instance:Ss(gu,{target:t,props:{rootId:e,onClose:ra}}),node:t}}function ra(){if(mr){try{or(mr.instance)}catch(e){ir("warn","panel unmount failed",e)}mr.node.remove(),mr=null}}window.addEventListener("beforeunload",()=>{ai.abort(),ra(),wf(),as(),es(),ss();for(const{instance:e}of Sn.values())try{or(e)}catch{}Sn.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ga,{once:!0}):Ga(); + creating a duplicate.`,1),au=x('

      '),iu=x(' '),lu=x('Migrate: ',1),cu=x('No migratable keys on this element.'),uu=x(' '),fu=x('
      '),du=x('
      ');function hu(e,t){Tn(t,!0);let n=Yt(t,"row",15),r=Yt(t,"rootId",3,""),s=Yt(t,"globalClasses",19,()=>[]),o=Yt(t,"finalClassNames",19,()=>[]);const a=U(()=>t.mode!=="migrate"),i=U(()=>t.mode==="migrate"),c=U(()=>t.mode==="rename"),u=U(()=>t.mode==="mixed"),h=U(()=>!t.isRoot&&t.blockName?`${t.blockName}__`:""),f=U(()=>{if(!l(u)||!Array.isArray(n().currentClassIds))return[];const g=[];for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||I.name.includes("--"))continue;const Q=n().currentClassIds.filter(R=>s().find(y=>y?.id===R)?.name.startsWith(I.name+"--")).length;g.push({id:I.id,name:I.name,modCount:Q})}for(const E of n().currentClassIds){const I=s().find(R=>R?.id===E);if(!I||!I.name.includes("--"))continue;const Q=I.name.slice(0,I.name.indexOf("--"));g.some(R=>R.name===Q)||g.push({id:I.id,name:I.name,modCount:0})}return g});ws(()=>{!l(u)||n().op!=="rename"||!l(f).length||l(f).some(g=>g.id===n().renameFamilyId)||n(n().renameFamilyId=l(f)[0].id,!0)});const v=U(()=>n().isBlockRoot===!0&&n().id!==r()),p=U(()=>n().id!==r()),b=U(()=>n().suggestedFrom==="element-type"||n().suggestedFrom==="fallback"),O=U(()=>{if(!o().length||!n().include||!Array.isArray(s()))return null;for(const g of o()){const E=s().find(I=>I&&I.name===g);if(E)return E}return null}),m=U(()=>!Array.isArray(n().modifiers)||n().modifiers.every(g=>!Rt(g)));function A(){n().suggestedFrom!=="user"&&n(n().suggestedFrom="user",!0)}function T(g){return g.startsWith("_")?g.slice(1):g}var M=du();let F;var Z=w(M),oe=w(Z),se=k(Z,2),xe=w(se),_e=w(xe),ae=k(xe,2);{var qt=g=>{var E=Fc();let I;var Q=w(E);B(R=>{I=ze(E,1,"rebemer-row__type rebemer-row__type--toggle",null,I,{"rebemer-row__type--block":l(v)}),ie(E,"title",l(v)?"Sub-block root — click to revert to element":"Click to promote to block root"),E.disabled=!n().include,H(Q,R)},[()=>l(v)?"BLOCK":(n().bricksType||"ELEM").toUpperCase()]),ne("click",E,()=>{n(n().isBlockRoot=!n().isBlockRoot,!0)}),S(g,E)},De=g=>{var E=Dc();S(g,E)};W(ae,g=>{l(p)?g(qt):g(De,-1)})}var Zt=k(ae,2);{var en=g=>{var E=qc();B(()=>ie(E,"title",`Pre-filled from ${n().suggestedFrom==="element-type"?"Bricks element type":"fallback"}`)),S(g,E)};W(Zt,g=>{l(b)&&n().include&&g(en)})}var jt=k(se,2),tn=w(jt),nn=w(tn);{var qe=g=>{var E=jc(),I=w(E);B(()=>H(I,l(h))),S(g,E)};W(nn,g=>{l(h)&&g(qe)})}var ft=k(nn,2),Mn=k(tn,2);{var rn=g=>{var E=Kc(),I=w(E);ke(I,17,()=>n().modifiers,zr,(_,y,C)=>{var L=Wc(),j=w(L),$=k(j,2);{var ce=G=>{var he=Hc();B(()=>he.disabled=!n().include),ne("click",he,()=>{n(n().modifiers=n().modifiers.filter((ye,Ie)=>Ie!==C),!0)}),S(G,he)};W($,G=>{n().modifiers.length>1&&G(ce)})}B(()=>j.disabled=!n().include),eo(j,()=>n().modifiers[C],G=>n(n().modifiers[C]=G,!0)),S(_,L)});var Q=k(I,2);{var R=_=>{var y=Uc();B(()=>y.disabled=!n().include),ne("click",y,()=>{n(n().modifiers=[...n().modifiers,""],!0)}),S(_,y)};W(Q,_=>{l(m)||_(R)})}S(g,E)};W(Mn,g=>{l(a)&&g(rn)})}var Ln=k(jt,2);{var sn=g=>{var E=tu(),I=Se(E),Q=w(I);let R;var _=k(Q,2);let y;var C=k(_,2);let L;var j=k(I,2);{var $=G=>{var he=Ha(),ye=Se(he);{var Ie=ve=>{var le=zc();S(ve,le)},st=ve=>{var le=Gc(),te=k(w(le),2);ke(te,21,()=>l(f),zr,(ee,re)=>{var me=Vc(),Ve=w(me),dt={};B(()=>{H(Ve,`${l(re).name??""}${l(re).modCount>0?` (+ ${l(re).modCount} modifier${l(re).modCount>1?"s":""})`:""}`),dt!==(dt=l(re).id)&&(me.value=(me.__value=l(re).id)??"")}),S(ee,me)}),Zs(te,()=>n().renameFamilyId,ee=>n(n().renameFamilyId=ee,!0)),S(ve,le)},kt=ve=>{const le=U(()=>l(f)[0]),te=U(()=>1+l(le).modCount);var ee=Yc(),re=k(w(ee)),me=w(re),Ve=k(re);B(()=>{H(me,l(le).name),H(Ve,`${l(le).modCount>0?` (+ ${l(le).modCount} modifier${l(le).modCount>1?"s":""})`:""}${(n().currentClassIds?.length??0)>l(te)?" Other classes kept.":""}`)}),S(ve,ee)};W(ye,ve=>{l(f).length===0?ve(Ie):l(f).length>1?ve(st,1):ve(kt,-1)})}S(G,he)},ce=G=>{var he=eu(),ye=Se(he);{var Ie=te=>{var ee=Jc(),re=k(w(ee),2),me=w(re);me.value=me.__value="";var Ve=k(me);ke(Ve,17,()=>l(f),zr,(dt,ht)=>{var we=$c(),Me=w(we),pe={};B(()=>{H(Me,`${l(ht).name??""}${l(ht).modCount>0?` (+ ${l(ht).modCount} modifier${l(ht).modCount>1?"s":""})`:""}`),pe!==(pe=l(ht).id)&&(we.value=(we.__value=l(ht).id)??"")}),S(dt,we)}),Zs(re,()=>n().renameFamilyId,dt=>n(n().renameFamilyId=dt,!0)),S(te,ee)};W(ye,te=>{l(f).length>1&&te(Ie)})}var st=k(ye,2);{var kt=te=>{var ee=Qc();S(te,ee)},ve=te=>{var ee=Xc();S(te,ee)},le=te=>{var ee=Zc();S(te,ee)};W(st,te=>{n().renameFamilyId?te(kt):l(f).length===0?te(ve,1):te(le,-1)})}S(G,he)};W(j,G=>{n().op==="rename"?G($):n().op==="replace"&&G(ce,1)})}B(()=>{R=ze(Q,1,"rebemer-row__op-btn",null,R,{"rebemer-row__op-btn--on":n().op==="add"}),ie(Q,"aria-pressed",n().op==="add"),y=ze(_,1,"rebemer-row__op-btn",null,y,{"rebemer-row__op-btn--on":n().op==="rename"}),ie(_,"aria-pressed",n().op==="rename"),L=ze(C,1,"rebemer-row__op-btn",null,L,{"rebemer-row__op-btn--on":n().op==="replace"}),ie(C,"aria-pressed",n().op==="replace")}),ne("click",Q,()=>{n(n().op="add",!0)}),ne("click",_,()=>{n(n().op="rename",!0),!n().renameFamilyId&&l(f).length&&n(n().renameFamilyId=l(f)[0].id,!0)}),ne("click",C,()=>{n(n().op="replace",!0),n(n().renameFamilyId="",!0)}),S(g,E)};W(Ln,g=>{l(u)&&n().include&&g(sn)})}var on=k(Ln,2);{var an=g=>{var E=nu();S(g,E)},cr=g=>{var E=ru(),I=w(E);B(()=>H(I,`This element has ${n().currentClassCount??""} classes. Only the first will be renamed; modifiers matching it are renamed too.`)),S(g,E)};W(on,g=>{l(c)&&n().include&&n().currentClassCount===0?g(an):l(c)&&n().include&&n().currentClassCount>1&&g(cr,1)})}var Pn=k(on,2);{var ur=g=>{var E=au(),I=w(E);{var Q=_=>{var y=su(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(_,y)},R=_=>{var y=ou(),C=k(Se(y)),L=w(C);B(()=>H(L,l(O).name)),S(_,y)};W(I,_=>{l(i)?_(Q):_(R,-1)})}S(g,E)};W(Pn,g=>{l(O)&&g(ur)})}var P=k(Pn,2);{var V=g=>{var E=fu(),I=w(E);{var Q=C=>{var L=lu(),j=k(Se(L),2);ke(j,17,()=>n().migrateKeys,zr,($,ce)=>{var G=iu(),he=w(G);B(ye=>{ie(G,"title",`Will be lifted into ${(o()[0]||"the new class")??""}`),H(he,ye)},[()=>T(l(ce))]),S($,G)}),S(C,L)},R=C=>{var L=cu();S(C,L)};W(I,C=>{n().migrateKeys?.length?C(Q):C(R,-1)})}var _=k(I,2);{var y=C=>{var L=uu(),j=w(L);B(()=>H(j,`${n().skippedKeys.length??""} skipped`)),S(C,L)};W(_,C=>{n().skippedKeys?.length&&C(y)})}S(g,E)};W(P,g=>{l(i)&&n().include&&g(V)})}B(()=>{F=ze(M,1,"rebemer-row",null,F,{"rebemer-row--disabled":!n().include,"rebemer-row--suggested":l(b)}),Tt(M,`--rebemer-row-depth: ${n().depth??0??""}`),H(_e,n().originalLabel),ie(ft,"placeholder",t.isRoot?"block-name":"element-name"),ft.disabled=!n().include}),Ua(oe,()=>n().include,g=>n(n().include=g,!0)),ne("input",ft,A),eo(ft,()=>n().name,g=>n(n().name=g,!0)),S(e,M),On()}In(["click","input"]);var vu=x(" ");function ti(e,t){Tn(t,!0);let n=Yt(t,"kind",3,"info"),r=Yt(t,"duration",3,3e3),s=de(!0);ws(()=>{if(!l(s)||r()<=0)return;const u=setTimeout(()=>{X(s,!1),t.onDismiss?.()},r());return()=>clearTimeout(u)});const o=U(()=>n()==="error"?"alert":"status");var a=Ha(),i=Se(a);{var c=u=>{var h=vu(),f=w(h);B(()=>{ze(h,1,`rebemer-toast rebemer-toast--${n()??""}`),ie(h,"role",l(o)),ie(h,"aria-live",n()==="error"?"assertive":"polite"),H(f,t.message)}),ne("click",h,()=>{X(s,!1),t.onDismiss?.()}),S(u,h)};W(i,u=>{l(s)&&u(c)})}S(e,a),On()}In(["click"]);var pu=x("Will migrate ",1),_u=x(' '),mu=x(''),gu=x(' ',1);function bu(e,t){Tn(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).",migrate:"Lifts inline element styles (padding, color, typography, etc.) into a new global class.",mixed:"Per-element control — every row defaults to Add. Switch any row to Rename (targets one class family, keeps others) or Replace (strips all existing classes, or just a selected family)."};function r(P){const V=P?._cssGlobalClasses;return V?(Array.isArray(V)?V:Object.values(V)).filter(E=>typeof E=="string"&&E.length>0):[]}function s(P,V){const g=r(P);for(const E of g){const I=V.find(Q=>Q&&Q.id===E);if(I&&!I.name.includes("--"))return E}return g[0]??""}let o=de("add"),a=de(!0),i=de(Lt([])),c=de(Lt([])),u=de(null),h=de(null);const f=U(()=>l(i)[0]?.originalLabel??""),v=U(()=>l(i).length===0?new Map:Qa(l(i),t.rootId)),p=U(()=>{if(l(o)!=="migrate")return null;let P=0,V=0;for(const g of l(i))g.include&&(P+=g.migrateKeys?.length??0,V+=g.skippedKeys?.length??0);return{willMigrate:P,willSkip:V}}),b=U(()=>{if(l(i).length===0)return new Map;const P=Xa({rootId:t.rootId,rows:l(i),mode:l(o)}),V=new Map;if(!P.ok)return V;for(const g of P.ops){const E=[g.finalClass];for(const I of g.modifierSlugs??[])E.push(`${g.finalClass}--${I}`);V.set(g.row.id,E)}return V});Ka(()=>{const P=Ql(t.rootId);X(c,Ga().slice(),!0);const V=P.map((g,E)=>{const I=E===0,Q=g.label||"",R=Rt(Q),_=g.name||"";let y,C;R?(y=R,C="label"):I?(y="block",C="fallback"):_&&!Rs(_)?(y=Rc(_,"item"),C="element-type"):(y="item",C="fallback");const L=r(g.settings);return{id:g.id,depth:g.depth,bricksType:_,originalLabel:Q||(I?"block":"element"),name:y,modifiers:[""],isBlockRoot:!1,include:!0,suggestedFrom:C,migrateKeys:Ec(g.settings),skippedKeys:xc(g.settings),currentClassCount:L.length,currentClassIds:L,op:"add",renameFamilyId:s(g.settings,l(c))}});if(V.length>1){const g=new Map(P.map(R=>[R.id,[]])),E=[];for(const R of P){for(;E.length&&E[E.length-1].depth>=R.depth;)E.pop();E.length&&g.get(E[E.length-1].id).push(R.id),E.push(R)}const I=new Map(P.map(R=>[R.id,R])),Q=new Map(V.map(R=>[R.id,R]));for(const[,R]of g){if(!R.length)continue;const _=new Map;for(const C of R){const L=I.get(C)?.name;L&&_.set(L,(_.get(L)??0)+1)}const y=R.filter(C=>Rs(I.get(C)?.name??""));for(const C of R){const L=Q.get(C),j=I.get(C);if(!(!L||!j||L.suggestedFrom==="label")){if(Rs(j.name)){const $=(g.get(C)??[]).map(G=>I.get(G)?.name??"").filter(Boolean),ce=y.indexOf(C);L.name=Bc($,ce,y.length),L.suggestedFrom="element-type"}else if((_.get(j.name)??0)===1){const $=Nc[j.name];$&&(L.name=$,L.suggestedFrom="element-type")}}}}}X(i,V,!0)});function O(P){if(P.key==="Escape"){t.onClose?.();return}l(h)&&P.target instanceof Node&&l(h).contains(P.target)&&P.key==="Enter"&&(P.target?.tagName==="INPUT"||P.target?.tagName==="SELECT")&&(P.preventDefault(),A())}let m=null;function A(){const P=Rt(l(i)[0]?.name??""),V=Do(P);if(!V.ok){X(u,{kind:"error",message:V.reason},!0);return}for(const E of l(i)){if(!E.isBlockRoot||!E.include)continue;const I=Do(Rt(E.name??""));if(!I.ok){X(u,{kind:"error",message:`Sub-block "${E.originalLabel}": ${I.reason}`},!0);return}}const g=Tc({rootId:t.rootId,rows:l(i),mode:l(o),syncLabels:l(a)});g.ok?(X(u,{kind:"success",message:`Applied to ${g.count} element${g.count!==1?"s":""}.`},!0),m&&clearTimeout(m),m=setTimeout(()=>t.onClose?.(),800)):X(u,{kind:"error",message:g.error},!0)}ws(()=>()=>{m&&clearTimeout(m)});var T=gu();ja("keydown",us,O);var M=Se(T),F=w(M),Z=w(F),oe=k(w(Z)),se=w(oe),xe=k(Z,2),_e=k(F,2),ae=w(_e),qt=k(w(ae),2),De=w(qt);De.value=De.__value="add";var Zt=k(De);Zt.value=Zt.__value="rename";var en=k(Zt);en.value=en.__value="replace";var jt=k(en);jt.value=jt.__value="migrate";var tn=k(jt);tn.value=tn.__value="mixed";var nn=k(ae,2),qe=w(nn),ft=k(_e,2),Mn=w(ft),rn=k(ft,2);{var Ln=P=>{var V=mu();let g;var E=w(V);{var I=y=>{var C=Ll("No migratable style keys found on any included element. Apply will attach empty classes.");S(y,C)},Q=y=>{var C=pu(),L=k(Se(C)),j=w(L),$=k(L);B(()=>{H(j,l(p).willMigrate),H($,` style key${l(p).willMigrate===1?"":"s"} into new classes.`)}),S(y,C)};W(E,y=>{l(p).willMigrate===0?y(I):y(Q,-1)})}var R=k(E,2);{var _=y=>{var C=_u(),L=w(C);B(()=>H(L,`${l(p).willSkip??""} key${l(p).willSkip===1?"":"s"} not on the allowlist will stay on the element.`)),S(y,C)};W(R,y=>{l(p).willSkip>0&&y(_)})}B(()=>g=ze(V,1,"rebemer-panel__notice",null,g,{"rebemer-panel__notice--warn":l(p).willSkip>0||l(p).willMigrate===0})),S(P,V)};W(rn,P=>{l(p)&&P(Ln)})}var sn=k(rn,2);ke(sn,23,()=>l(i),P=>P.id,(P,V,g)=>{{let E=U(()=>l(v).get(l(V).id)??""),I=U(()=>l(V).id===t.rootId||l(V).isBlockRoot),Q=U(()=>l(b).get(l(V).id)??[]);hu(P,{get mode(){return l(o)},get blockName(){return l(E)},get isRoot(){return l(I)},get rootId(){return t.rootId},get globalClasses(){return l(c)},get finalClassNames(){return l(Q)},get row(){return l(i)[l(g)]},set row(R){l(i)[l(g)]=R}})}});var on=k(sn,2),an=w(on),cr=k(an,2);zl(M,P=>X(h,P),()=>l(h));var Pn=k(M,2);{var ur=P=>{ti(P,{get kind(){return l(u).kind},get message(){return l(u).message},onDismiss:()=>{X(u,null)}})};W(Pn,P=>{l(u)&&P(ur)})}B(()=>{H(se,l(f)),H(Mn,n[l(o)])}),ne("click",xe,()=>t.onClose?.()),Zs(qt,()=>l(o),P=>X(o,P)),Ua(qe,()=>l(a),P=>X(a,P)),ne("click",an,()=>t.onClose?.()),ne("click",cr,A),S(e,T),On()}In(["click"]);var yu=x('');function wu(e,t){var n=yu();let r;B(()=>{r=ze(n,1,"slashed-cp-launch",null,r,{"slashed-cp-launch--on":t.open}),ie(n,"aria-pressed",t.open)}),ne("click",n,function(...s){t.onToggle?.apply(this,s)}),S(e,n)}In(["click"]);const Wo="--sf-color-",ni=["primary","secondary","tertiary","action","neutral","base"],ri=["success","warning","error","info","danger"],Uo=["a5","a10","a20","a30","a40","a50","a60","a70","a80","a90","a95"],Ko=["superlight","xlight","lighter","darker","xdark","superdark","hover","active","strong","subtle","muted","ghost"],Vr=["text","heading","bg","surface","inset","raised","overlay","inverse","border","link","code","selection","mark","dim"],ku=e=>new Set(e),Su=ku([...ni,...ri]),zo={primary:{tagline:"Brand identity & main emphasis",use:"Headlines, primary buttons, key brand moments."},secondary:{tagline:"Supporting brand tone",use:"Secondary surfaces and muted brand accents."},tertiary:{tagline:"Accent / highlight",use:"Badges, tags, decorative highlights."},action:{tagline:"Interactive & links",use:"Links, focus rings, anything clickable."},neutral:{tagline:"Text, icons & dividers",use:"Body text, borders, neutral UI chrome."},base:{tagline:"Page & surface backgrounds",use:"Page background and raised surfaces."},success:{tagline:"Positive / confirmation",use:"Success messages and valid state."},warning:{tagline:"Caution",use:"Warnings and at-risk / pending state."},error:{tagline:"Form & validation errors",use:"Invalid inputs and error messages."},info:{tagline:"Informational",use:"Tips and neutral notices."},danger:{tagline:"Destructive actions",use:"Delete / remove and irreversible actions."},semantic:{tagline:"Ready-made role tokens",use:"Pre-wired roles that already adapt to light/dark."}},Ns=[{id:"text-on",label:"Text on color",match:e=>e.startsWith("text--on")},{id:"text",label:"Text",match:e=>e==="text"||e==="heading"||e.startsWith("text-")},{id:"state",label:"Interactive states",match:e=>e.startsWith("bg--")},{id:"surface",label:"Surfaces & backgrounds",match:e=>["bg","surface","inset","raised","overlay","inverse"].some(t=>e===t||e.startsWith(t+"-"))},{id:"border",label:"Borders",match:e=>e==="border"||e.startsWith("border-")},{id:"link",label:"Links",match:e=>e==="link"||e.startsWith("link-")},{id:"select",label:"Selection & marks",match:e=>e.startsWith("selection")||e.startsWith("mark")||e==="dim"},{id:"code",label:"Code",match:e=>e.startsWith("code")}];function Eu(e){if(typeof e!="string"||e.indexOf(Wo)!==0)return null;const t=e.slice(Wo.length);if(!t||t==="scheme")return null;const n=t.indexOf("-"),r=n===-1?t:t.slice(0,n);if(!Su.has(r))return{family:"semantic",kind:"semantic",step:null,key:t};const s=n===-1?"":t.slice(n+1);return s===""?{family:r,kind:"base",step:null,key:t}:s==="light"?null:/^[0-9]+$/.test(s)?{family:r,kind:"scale",step:Number(s),key:t}:/^a[0-9]+$/.test(s)?{family:r,kind:"alpha",step:s,key:t}:{family:r,kind:"alias",step:s,key:t}}function Cu(e){return e.kind==="alpha"?!0:/(?:^|-)(?:subtle|muted|ghost|translucent|overlay|dim|underline)$/.test(e.key)}function xu(e){switch(e.kind){case"base":return hs(e.family);case"scale":return String(e.step);case"alpha":return String(e.step).toUpperCase();case"alias":return hs(String(e.step));case"semantic":default:return Au(e.key)}}function hs(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Au(e){return e.split("--").map(n=>n.split("-").map(hs).join(" ")).join(" · ")}function Tu(e,t,n,r){const s=n[e];if(typeof s!="string"||!s)return null;const o=typeof r[e]=="string"&&r[e]?r[e]:s;return{var:e,name:e.slice(2),label:xu(t),light:s,dark:o,alpha:Cu(t)}}function Ou(e,t){const n={base:0,scale:1,alias:2,alpha:3};if(n[e.info.kind]!==n[t.info.kind])return n[e.info.kind]-n[t.info.kind];if(e.info.kind==="scale")return e.info.step-t.info.step;if(e.info.kind==="alpha")return Uo.indexOf(e.info.step)-Uo.indexOf(t.info.step);if(e.info.kind==="alias"){const r=Ko.indexOf(e.info.step),s=Ko.indexOf(t.info.step),o=r===-1?999:r,a=s===-1?999:s;return o!==a?o-a:String(e.info.step).localeCompare(String(t.info.step))}return 0}function Iu(e,t){const n=Vr.findIndex(a=>e.info.key===a||e.info.key.startsWith(a+"-")),r=Vr.findIndex(a=>t.info.key===a||t.info.key.startsWith(a+"-")),s=n===-1?Vr.length:n,o=r===-1?Vr.length:r;return s!==o?s-o:e.info.key.localeCompare(t.info.key)}function Mu(e,t,n){const r=Array.isArray(e)?e:[],s=t&&typeof t=="object"?t:{},o=n&&typeof n=="object"?n:{},a=new Map,i=[];for(const h of r){const f=Eu(h);if(!f)continue;const v=Tu(h,f,s,o);if(!v)continue;const p={swatch:v,info:f};if(f.family==="semantic"){i.push(p);continue}a.has(f.family)||a.set(f.family,[]),a.get(f.family).push(p)}const c=[],u=(h,f)=>{const v=a.get(h);if(!v||v.length===0)return;v.sort(Ou);const p=v.filter(T=>T.info.kind==="base"||T.info.kind==="scale"),b=v.filter(T=>T.info.kind==="alias"),O=v.filter(T=>T.info.kind==="alpha"),m=[];p.length&&m.push({id:"scale",label:"Shades & tints",swatches:p.map(T=>T.swatch)}),O.length&&m.push({id:"alpha",label:"Transparent",swatches:O.map(T=>T.swatch)}),b.length&&m.push({id:"alias",label:"Semantic",swatches:b.map(T=>T.swatch)});const A=zo[h]||{};c.push({id:h,label:hs(h),type:f,count:v.length,tagline:A.tagline||"",use:A.use||"",sections:m})};for(const h of ni)u(h,"brand");for(const h of ri)u(h,"status");if(i.length){i.sort(Iu);const h=new Map(Ns.map(b=>[b.id,[]])),f=[];for(const b of i){const O=Ns.find(m=>m.match(b.info.key));O?h.get(O.id).push(b.swatch):f.push(b.swatch)}const v=[];for(const b of Ns){const O=h.get(b.id);O.length&&v.push({id:b.id,label:b.label,swatches:O})}f.length&&v.push({id:"other",label:"Other",swatches:f});const p=zo.semantic||{};c.push({id:"semantic",label:"Semantic",type:"semantic",count:i.length,tagline:p.tagline||"",use:p.use||"",sections:v})}return{groups:c}}function Lu(e,t){const n=String(t||"").trim().toLowerCase();if(!n)return e;if(!e||!Array.isArray(e.groups))return{groups:[]};const r=[];for(const s of e.groups){const o=[];for(const a of s.sections){const i=a.swatches.filter(c=>c.name.toLowerCase().includes(n)||c.label.toLowerCase().includes(n)||s.label.toLowerCase().includes(n));i.length&&o.push({...a,swatches:i})}if(o.length){const a=o.reduce((i,c)=>i+c.swatches.length,0);r.push({...s,sections:o,count:a})}}return{groups:r}}function Pu(e){return`var(${e.var})`}function Ru(e,t){return t==="dark"?e.dark:e.light}const Nu=[{id:"typography",label:"Typography",tokens:[{var:"--sf-color-heading",label:"Heading"},{var:"--sf-color-text",label:"Text"},{var:"--sf-color-text--muted",label:"Text · Muted"},{var:"--sf-color-text--secondary",label:"Text · Secondary"},{var:"--sf-color-text--on-primary",label:"On Primary"},{var:"--sf-color-text--on-secondary",label:"On Secondary"}]},{id:"surfaces",label:"Surfaces",tokens:[{var:"--sf-color-bg",label:"Background"},{var:"--sf-color-surface",label:"Surface"},{var:"--sf-color-raised",label:"Raised"},{var:"--sf-color-inset",label:"Inset"},{var:"--sf-color-overlay",label:"Overlay"},{var:"--sf-color-inverse",label:"Inverse"}]},{id:"structure",label:"Structure",tokens:[{var:"--sf-color-border",label:"Border"},{var:"--sf-color-border--subtle",label:"Border · Subtle"},{var:"--sf-color-border--strong",label:"Border · Strong"},{var:"--sf-color-link",label:"Link"},{var:"--sf-color-link--hover",label:"Link · Hover"}]},{id:"brand",label:"Brand",tokens:[{var:"--sf-color-primary",label:"Primary"},{var:"--sf-color-secondary",label:"Secondary"},{var:"--sf-color-tertiary",label:"Tertiary"},{var:"--sf-color-action",label:"Action"},{var:"--sf-color-neutral",label:"Neutral"},{var:"--sf-color-base",label:"Base"}]},{id:"feedback",label:"Feedback",tokens:[{var:"--sf-color-success",label:"Success"},{var:"--sf-color-success-subtle",label:"Success · Subtle"},{var:"--sf-color-warning",label:"Warning"},{var:"--sf-color-warning-subtle",label:"Warning · Subtle"},{var:"--sf-color-error",label:"Error"},{var:"--sf-color-error-subtle",label:"Error · Subtle"},{var:"--sf-color-info",label:"Info"},{var:"--sf-color-danger",label:"Danger"}]}];function Bu(e,t,n){const r=t&&typeof t=="object"?t:{},s=n&&typeof n=="object"?n:{},o=[];for(const a of Nu){const i=[];for(const c of a.tokens){const u=r[c.var];if(!u)continue;const h=s[c.var]||u;i.push({var:c.var,name:c.var.slice(2),label:c.label,light:u,dark:h,alpha:/overlay|subtle|ghost|muted|dim|alpha/i.test(c.var)})}i.length&&o.push({id:a.id,label:a.label,swatches:i})}return{groups:o}}var Fu=x('');function Bs(e,t){Tn(t,!0);let n=Yt(t,"onPick",3,void 0);const r=U(()=>`${t.swatch.name} +light ${t.swatch.light} · dark ${t.swatch.dark}`);var s=Fu();let o;B(a=>{o=ze(s,1,"slashed-cp-swatch",null,o,{"slashed-cp-swatch--alpha":t.swatch.alpha,"slashed-cp-swatch--split":t.mode==="both"}),Tt(s,`--cp-l:${t.swatch.light??""}; --cp-d:${t.swatch.dark??""}; --cp-solid:${a??""};`),ie(s,"title",l(r)),ie(s,"aria-label",t.swatch.name)},[()=>Ru(t.swatch,t.mode==="dark"?"dark":"light")]),ne("click",s,()=>n()?.(t.swatch)),S(e,s),On()}In(["click"]);var Du=x(''),qu=x(''),ju=x(''),Hu=x('
      '),Wu=x('

      ',1),Uu=x(''),Ku=x('

      Scale 50 → 950

      ',1),zu=x(''),Vu=x('
      '),Gu=x(' ',1),Yu=x('
      '),$u=x('
      '),Ju=x('
      '),Qu=x(''),Xu=x('

      '),Zu=x(' '),ef=x(''),tf=x('
    • '),nf=x('
        '),rf=x('
        '),sf=x('
        '),of=x(" ",1),af=x('

        '),lf=x(" ",1),cf=x(''),uf=x('

        '),ff=x('

        Quick Use

        Palette

        Brand

        Status

        ',1),df=x(''),hf=x('

        Color System

        var()
        ',1);function si(e,t){Tn(t,!0);const n=(_,y=Zo)=>{var C=Ju();ke(C,21,y,L=>L.id,(L,j)=>{const $=U(()=>Zt(l(j))),ce=U(()=>en(l(j))),G=U(()=>l(h)===l(j).id);var he=$u(),ye=w(he);let Ie;var st=w(ye);{var kt=we=>{var Me=Du();B(()=>Tt(Me,`--sw-l: ${l($).light??""}; --sw-d: ${l($).dark??""}`)),S(we,Me)};W(st,we=>{l($)&&we(kt)})}var ve=k(st,2),le=w(ve),te=k(ve,2),ee=w(te),re=k(te,2);ke(re,21,()=>l(ce),we=>we.var,(we,Me)=>{var pe=qu();B(()=>{Tt(pe,`--sw-l: ${l(Me).light??""}; --sw-d: ${l(Me).dark??""}`),ie(pe,"title",l(Me).label)}),S(we,pe)});var me=k(re,2),Ve=w(me),dt=k(ye,2);{var ht=we=>{const Me=U(()=>De(l(j),"alias")),pe=U(()=>jt(l(j))),ot=U(()=>De(l(j),"alpha"));var Ge=Yu(),St=w(Ge);{var ln=Ae=>{var Le=ju(),vt=w(Le),Et=w(vt);B(()=>{Tt(Le,`--sw-l: ${l($).light??""}; --sw-d: ${l($).dark??""}`),ie(Le,"title",`${l(j).label??""} base — ${l($).name??""}`),H(Et,l(j).label)}),ne("click",Le,()=>_e(l($))),S(Ae,Le)};W(St,Ae=>{l($)&&Ae(ln)})}var Ht=k(St,2);{var Rn=Ae=>{var Le=Wu(),vt=Se(Le),Et=w(vt),Ct=k(vt,2);ke(Ct,21,()=>l(Me).swatches,pt=>pt.var,(pt,Dr)=>{var qr=Hu(),Wt=w(qr);Bs(Wt,{get swatch(){return l(Dr)},get mode(){return l(i)},onPick:_e});var jr=k(Wt,2),fr=w(jr);B(()=>H(fr,l(Dr).label)),S(pt,qr)}),B(()=>H(Et,`Aliases · ${l(Me).swatches.length??""}`)),S(Ae,Le)};W(Ht,Ae=>{l(Me)?.swatches.length&&Ae(Rn)})}var Nn=k(Ht,2);{var Cs=Ae=>{var Le=Ku(),vt=k(Se(Le),2);ke(vt,21,()=>l(pe),Et=>Et.var,(Et,Ct)=>{var pt=Uu();B(()=>{ie(pt,"title",`${l(Ct).label??""} — ${l(Ct).name??""}`),Tt(pt,`--sw-l: ${l(Ct).light??""}; --sw-d: ${l(Ct).dark??""}`)}),ne("click",pt,()=>_e(l(Ct))),S(Et,pt)}),S(Ae,Le)};W(Nn,Ae=>{l(pe).length&&Ae(Cs)})}var xs=k(Nn,2);{var ai=Ae=>{var Le=Gu(),vt=Se(Le),Et=w(vt),Ct=w(Et),pt=k(vt,2);{var Dr=Wt=>{var jr=Vu();ke(jr,21,()=>l(ot).swatches,fr=>fr.var,(fr,dr)=>{var Hr=zu();B(()=>{ie(Hr,"title",`${l(dr).label??""} — ${l(dr).name??""}`),Tt(Hr,`--sw-l: ${l(dr).light??""}; --sw-d: ${l(dr).dark??""}`)}),ne("click",Hr,()=>_e(l(dr))),S(fr,Hr)}),S(Wt,jr)},qr=U(()=>l(f).has(l(j).id));W(pt,Wt=>{l(qr)&&Wt(Dr)})}B(Wt=>H(Ct,Wt),[()=>l(f).has(l(j).id)?"▾":"▸"]),ne("click",vt,()=>qt(l(j).id)),S(Ae,Le)};W(xs,Ae=>{l(ot)?.swatches.length&&Ae(ai)})}S(we,Ge)};W(dt,we=>{l(G)&&we(ht)})}B(()=>{Ie=ze(ye,1,"slashed-cp__scan-row",null,Ie,{"slashed-cp__scan-row--open":l(G)}),ie(ye,"aria-expanded",l(G)),H(le,l(j).label),H(ee,l(j).tagline),H(Ve,l(G)?"▾":"▸")}),ne("click",ye,()=>ae(l(j).id)),S(L,he)}),S(_,C)};let r=Yt(t,"dockedLeft",3,null);const s=U(()=>typeof t.onPickValue=="function"),o=[{id:"both",label:"Both"},{id:"light",label:"Light"},{id:"dark",label:"Dark"}],a=["Hover","Active","Subtle","Ghost","Superlight"];let i=de("both"),c=de(""),u=de(null),h=de(null),f=de(Lt(new Set));const v=U(()=>Mu(t.source?.variables,t.source?.light,t.source?.dark)),p=U(()=>l(c).trim()),b=U(()=>Lu(l(v),l(p))),O=U(()=>Bu(t.source?.variables,t.source?.light,t.source?.dark)),m=U(()=>l(v).groups.reduce((_,y)=>_+y.count,0)),A=U(()=>l(v).groups.filter(_=>_.type==="brand")),T=U(()=>l(v).groups.filter(_=>_.type==="status"));let M;function F(){if(typeof document>"u")return null;const _=document.querySelector('iframe#bricks-builder-iframe, iframe[name="bricks-builder-iframe"], #bricks-builder-area iframe');try{return _?.contentDocument?.documentElement??null}catch{return null}}function Z(_){const y=F();if(y)try{M===void 0&&(M=y.getAttribute("data-theme")),_==="light"||_==="dark"?y.setAttribute("data-theme",_):M===null?y.removeAttribute("data-theme"):y.setAttribute("data-theme",M)}catch{}}function oe(){const _=F();if(!(!_||M===void 0))try{M===null?_.removeAttribute("data-theme"):_.setAttribute("data-theme",M)}catch{}}function se(_){X(i,_,!0),Z(_)}Ka(()=>()=>oe());async function xe(_){try{if(navigator?.clipboard?.writeText)return await navigator.clipboard.writeText(_),!0}catch{}try{const y=document.createElement("textarea");y.value=_,y.style.cssText="position:fixed;opacity:0",document.body.appendChild(y),y.select();const C=document.execCommand("copy");return y.remove(),C}catch{return!1}}async function _e(_){const y=Pu(_);if(l(s)){if(t.onPickValue(y)===!1){X(u,{kind:"error",message:`Couldn't apply ${y} — input not found`},!0);return}t.onPick?.();return}const C=await xe(y);X(u,C?{kind:"info",message:`Copied — ${_.name}`}:{kind:"error",message:`Couldn't copy ${y}`},!0)}function ae(_){X(h,l(h)===_?null:_,!0),X(f,new Set,!0)}function qt(_){const y=new Set(l(f));y.has(_)?y.delete(_):y.add(_),X(f,y,!0)}function De(_,y){return _.sections.find(C=>C.id===y)}function Zt(_){return De(_,"scale")?.swatches[0]??null}function en(_){const y=De(_,"alias");if(!y?.swatches.length)return[];const C=a.map(L=>y.swatches.find(j=>j.label===L)).filter(Boolean);return C.length?C:y.swatches.slice(0,5)}function jt(_){return De(_,"scale")?.swatches.slice(1)??[]}function tn(_){_.key==="Escape"&&t.onClose?.()}var nn=hf();ja("keydown",us,tn);var qe=Se(nn);let ft;var Mn=w(qe),rn=k(w(Mn),2);ke(rn,21,()=>o,_=>_.id,(_,y)=>{var C=Qu();let L;var j=w(C);B(()=>{L=ze(C,1,"slashed-cp__seg-btn",null,L,{"slashed-cp__seg-btn--on":l(i)===l(y).id}),ie(C,"aria-pressed",l(i)===l(y).id),H(j,l(y).label)}),ne("click",C,()=>se(l(y).id)),S(_,C)});var Ln=k(rn,2),sn=k(Mn,2),on=w(sn),an=k(sn,2),cr=w(an);{var Pn=_=>{var y=lf(),C=Se(y);{var L=$=>{var ce=Xu(),G=w(ce);B(()=>H(G,`No tokens match "${l(p)??""}".`)),S($,ce)};W(C,$=>{l(b).groups.length===0&&$(L)})}var j=k(C,2);ke(j,17,()=>l(b).groups,$=>$.id,($,ce)=>{var G=af(),he=w(G),ye=w(he),Ie=w(ye),st=k(Ie);{var kt=ee=>{var re=Zu(),me=w(re);B(()=>H(me,l(ce).tagline)),S(ee,re)};W(st,ee=>{l(ce).tagline&&ee(kt)})}var ve=k(st,2),le=w(ve),te=k(he,2);ke(te,17,()=>l(ce).sections,ee=>ee.id,(ee,re)=>{var me=of(),Ve=Se(me);{var dt=pe=>{var ot=ef(),Ge=w(ot);B(()=>H(Ge,l(re).label)),S(pe,ot)};W(Ve,pe=>{l(re).label&&pe(dt)})}var ht=k(Ve,2);{var we=pe=>{var ot=nf();ke(ot,21,()=>l(re).swatches,Ge=>Ge.var,(Ge,St)=>{var ln=tf(),Ht=w(ln);Bs(Ht,{get swatch(){return l(St)},get mode(){return l(i)},onPick:_e});var Rn=k(Ht,2),Nn=w(Rn),Cs=k(Rn,2),xs=w(Cs);B(()=>{H(Nn,l(St).label),H(xs,l(St).name)}),S(Ge,ln)}),S(pe,ot)},Me=pe=>{var ot=sf();ke(ot,21,()=>l(re).swatches,Ge=>Ge.var,(Ge,St)=>{var ln=rf(),Ht=w(ln);Bs(Ht,{get swatch(){return l(St)},get mode(){return l(i)},onPick:_e});var Rn=k(Ht,2),Nn=w(Rn);B(()=>H(Nn,l(St).label)),S(Ge,ln)}),S(pe,ot)};W(ht,pe=>{l(ce).type==="semantic"?pe(we):pe(Me,-1)})}S(ee,me)}),B(()=>{ie(G,"data-type",l(ce).type),H(Ie,`${l(ce).label??""} `),H(le,l(ce).count)}),S($,G)}),S(_,y)},ur=_=>{var y=ff(),C=Se(y),L=k(w(C),2);ke(L,17,()=>l(O).groups,G=>G.id,(G,he)=>{var ye=uf(),Ie=w(ye),st=w(Ie),kt=k(Ie,2);ke(kt,21,()=>l(he).swatches,ve=>ve.var,(ve,le)=>{var te=cf(),ee=w(te);let re;var me=k(ee,2),Ve=w(me);B(()=>{ie(te,"title",l(le).name),re=ze(ee,1,"slashed-cp__qu-sw",null,re,{"slashed-cp__qu-sw--alpha":l(le).alpha}),Tt(ee,`--sw-l: ${l(le).light??""}; --sw-d: ${l(le).dark??""}`),H(Ve,l(le).label)}),ne("click",te,()=>_e(l(le))),S(ve,te)}),B(()=>H(st,l(he).label)),S(G,ye)});var j=k(C,2),$=k(w(j),4);n($,()=>l(A));var ce=k($,4);n(ce,()=>l(T)),S(_,y)};W(cr,_=>{l(p)?_(Pn):_(ur,-1)})}var P=k(an,2),V=w(P);{var g=_=>{var y=df();S(_,y)};W(V,_=>{l(i)==="both"&&_(g)})}var E=k(V,2),I=w(E),Q=k(qe,2);{var R=_=>{ti(_,{get kind(){return l(u).kind},get message(){return l(u).message},onDismiss:()=>{X(u,null)}})};W(Q,_=>{l(u)&&_(R)})}B(()=>{ft=ze(qe,1,"slashed-cp",null,ft,{"slashed-cp--docked":l(s)}),ie(qe,"data-mode",l(i)),Tt(qe,l(s)&&r()!=null?`--cp-dock-left: ${r()}px`:""),ie(on,"placeholder",`Search ${l(m)} tokens…`),H(I,`${l(s)?"Click to insert":"Click to copy"} `)}),ne("click",qe,_=>_.stopPropagation()),ne("mousedown",qe,_=>_.stopPropagation()),ne("pointerdown",qe,_=>_.stopPropagation()),ne("touchstart",qe,_=>_.stopPropagation()),ne("click",Ln,()=>t.onClose?.()),eo(on,()=>l(c),_=>X(c,_)),S(e,nn),On()}In(["click","mousedown","pointerdown","touchstart"]);var vf=x(" ",1);function pf(e,t){let n=de(!1);var r=vf(),s=Se(r);wu(s,{get open(){return l(n)},onToggle:()=>X(n,!l(n))});var o=k(s,2);{var a=i=>{si(i,{get source(){return t.source},onClose:()=>X(n,!1)})};W(o,i=>{l(n)&&i(a)})}S(e,r)}const Vo="#bricks-structure",_f="li[data-id]",Go="slashed-rebemer-host",mf=400,gf=25,lr=(e,...t)=>console[e]("[reBEMer]",...t),oi=new AbortController,{signal:Cr}=oi,Sn=new Map;let mr=null,qn=null,gr=null;function go(){let e=document.getElementById(Go);return e||(e=document.createElement("div"),e.id=Go,document.body.appendChild(e)),e}let Ke=null;function Yo(){Ke=window.slashedBricksEditor,Ke&&typeof Ke=="object"&&(cc(Ke.showClassHints,Ke.classHints,{signal:Cr}),gc(Ke.showColorSwatches,Ke.colorHexMap,{signal:Cr,onOpenPanel:Ke.showColorPanel?n=>Cf(n):void 0}));let e=0;const t=()=>{if(!Cr.aborted){if(Yl()){bf();return}if(++e>=gf){lr("warn","Bricks Vue app not detected after grace window — reBEMer disabled on this page.");return}setTimeout(t,mf)}};t()}function bf(){wf();const e=document.querySelector(Vo);if(e){$o(e);return}const t=new MutationObserver(()=>{const n=document.querySelector(Vo);n&&(t.disconnect(),$o(n))});t.observe(document.body,{childList:!0,subtree:!0}),Cr.addEventListener("abort",()=>t.disconnect(),{once:!0})}function $o(e){let t=null;const n=()=>{t===null&&(t=setTimeout(()=>{t=null,Jo(e)},50))},r=new MutationObserver(n);r.observe(e,{childList:!0,subtree:!0}),Cr.addEventListener("abort",()=>{r.disconnect(),t!==null&&clearTimeout(t)},{once:!0}),Jo(e)}function Jo(e){for(const[n,r]of Sn)if(!r.host.isConnected){try{ir(r.instance)}catch(s){lr("warn","badge unmount failed",s)}Sn.delete(n)}const t=e.querySelectorAll(_f);for(const n of t){const r=n.getAttribute("data-id");if(!r)continue;const s=Sn.get(r);s&&s.host.isConnected&&n.contains(s.host)||yf(n)}}function yf(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"),s=document.createElement("span");s.className="rebemer-badge-host",r?n.insertBefore(s,r):n.appendChild(s);const o=n.querySelector(":scope > .title, :scope > .structure-item-title, :scope > .name, :scope .label"),a=o?o.textContent.trim():"",i=Ss(wc,{target:s,props:{elementId:t,label:a,onActivate:xf}}),c=Sn.get(t);if(c){try{ir(c.instance)}catch(u){lr("warn","badge remount cleanup failed",u)}c.host.isConnected&&c.host.remove()}Sn.set(t,{instance:i,host:s})}function wf(){if(qn)return;const e=Ke&&Ke.colorPanel;if(!Ke?.showColorPanel||!e||!Array.isArray(e.variables)||e.variables.length===0)return;const t=document.createElement("div");go().appendChild(t),qn={instance:Ss(pf,{target:t,props:{source:e}}),node:t}}function kf(){if(qn){try{ir(qn.instance)}catch(e){lr("warn","color app unmount failed",e)}qn.node.remove(),qn=null}}function Sf(e,t){if(!e||!e.isConnected)return!1;try{const n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;return n?n.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),!0}catch{return!1}}function Ef(e){const t=["#bricks-panel-inner","#bricks-panel",'[id^="bricks-panel"]'];if(e)for(const n of t){const r=e.closest(n);if(r){const s=r.getBoundingClientRect();if(s.width>100)return Math.ceil(s.right)}}for(const n of t){const r=document.querySelector(n);if(r){const s=r.getBoundingClientRect();if(s.width>100)return Math.ceil(s.right)}}return null}function Cf(e){os();const t=Ke?.colorPanel;if(!t||!Array.isArray(t.variables)||t.variables.length===0)return;const n=Ef(e),r=document.createElement("div");go().appendChild(r),gr={instance:Ss(si,{target:r,props:{source:t,dockedLeft:n,onPickValue:s=>{const o=e?.querySelector('input[type="text"]')??e?.querySelector('input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])'),a=Sf(o,s);if(a){const i=s.match(/^var\((--[^)]+)\)/)?.[1],c=i?Ke?.colorHexMap?.[i]??null:null,u=e?.querySelector(".slashed-sf-color-btn");if(u){const h=u.querySelector(".slashed-sf-color-btn__dot");h&&(c?(h.style.background=c,h.style.removeProperty("box-shadow")):h.style.removeProperty("background")),u.classList.toggle("slashed-sf-color-btn--active",!!c)}if(c){const h=e?.closest('[data-control="color"]');requestAnimationFrame(()=>{if(!h)return;const f=h.querySelector(".bricks-control-preview");if(!f)return;const v=f.querySelector(":scope > span:not(.color-value-tooltip):not(.bricks-svg-wrapper)")??f.querySelectorAll(":scope > span")[1];v&&(v.style.display="block",v.style.background=c,v.style.setProperty("color",c,"important")),f.classList.remove("empty")})}}return a},onPick:os,onClose:os}}),node:r}}function os(){if(gr){try{ir(gr.instance)}catch(e){lr("warn","color picker panel unmount failed",e)}gr.node.remove(),gr=null}}function xf(e){ro();const t=document.createElement("div");go().appendChild(t),mr={instance:Ss(bu,{target:t,props:{rootId:e,onClose:ro}}),node:t}}function ro(){if(mr){try{ir(mr.instance)}catch(e){lr("warn","panel unmount failed",e)}mr.node.remove(),mr=null}}window.addEventListener("beforeunload",()=>{oi.abort(),ro(),kf(),os(),es(),ss();for(const{instance:e}of Sn.values())try{ir(e)}catch{}Sn.clear()},{once:!0});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Yo,{once:!0}):Yo(); //# sourceMappingURL=app.js.map diff --git a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte index 6f181c12..9303cf2f 100644 --- a/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte +++ b/plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte @@ -304,6 +304,8 @@ tabindex="-1" onclick={(e) => e.stopPropagation()} onmousedown={(e) => e.stopPropagation()} + onpointerdown={(e) => e.stopPropagation()} + ontouchstart={(e) => e.stopPropagation()} >

        Color System

        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 058ade3e..d6eca62d 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 @@ -107,54 +107,78 @@ function injectSFButton(colorControl) { if (!_onOpenPanel) return; const colorInput = colorControl.querySelector('[data-control="text"].color-input'); if (!colorInput) return; - if (colorInput.querySelector('.' + SF_BTN_CLASS)) return; // already present - - const btn = document.createElement('div'); - btn.className = SF_BTN_CLASS; - btn.setAttribute('data-balloon', 'SLASHED Colors'); - btn.setAttribute('data-balloon-pos', 'top-right'); - btn.setAttribute('role', 'button'); - btn.setAttribute('tabindex', '0'); - const dot = document.createElement('span'); - dot.className = SF_BTN_CLASS + '__dot'; - dot.setAttribute('aria-hidden', 'true'); - btn.appendChild(dot); - - btn.addEventListener('click', (e) => { - e.stopPropagation(); - // Pass the wrapper so the picker re-queries the live input at pick time, - // avoiding a stale reference if Bricks re-renders the control. - if (_onOpenPanel) _onOpenPanel(colorInput); - }); - btn.addEventListener('keydown', (e) => { - if (e.key === ' ') { e.preventDefault(); btn.click(); } - else if (e.key === 'Enter') btn.click(); - }); - // Insert right after the Variables icon, before Dynamic data (if present). - // Falls back to appending when there's no Variables icon or it's the last child. - const varBtn = colorInput.querySelector('.variable-picker-button'); - if (varBtn && varBtn.nextSibling) { - colorInput.insertBefore(btn, varBtn.nextSibling); - } else { - colorInput.appendChild(btn); + let btn = colorInput.querySelector('.' + SF_BTN_CLASS); + if (!btn) { + btn = document.createElement('div'); + btn.className = SF_BTN_CLASS; + btn.setAttribute('data-balloon', 'SLASHED Colors'); + btn.setAttribute('data-balloon-pos', 'top-right'); + btn.setAttribute('role', 'button'); + btn.setAttribute('tabindex', '0'); + const dot = document.createElement('span'); + dot.className = SF_BTN_CLASS + '__dot'; + dot.setAttribute('aria-hidden', 'true'); + btn.appendChild(dot); + + btn.addEventListener('click', (e) => { + e.stopPropagation(); + // Pass the wrapper so the picker re-queries the live input at pick time, + // avoiding a stale reference if Bricks re-renders the control. + if (_onOpenPanel) _onOpenPanel(colorInput); + }); + btn.addEventListener('keydown', (e) => { + if (e.key === ' ') { e.preventDefault(); btn.click(); } + else if (e.key === 'Enter') btn.click(); + }); + + // Insert right after the Variables icon, before Dynamic data (if present). + // Falls back to appending when there's no Variables icon or it's the last child. + const varBtn = colorInput.querySelector('.variable-picker-button'); + if (varBtn && varBtn.nextSibling) { + colorInput.insertBefore(btn, varBtn.nextSibling); + } else { + colorInput.appendChild(btn); + } } - // Restore active state if the input already holds an SF color variable. - // Bricks' Vue re-renders the control after each value change, which tears - // out our old button and causes injectSFButton to re-run with a fresh one. - // Reading the current input value here re-arms the swatch on every injection. + // Sync the dot to the live input value on every pass — not just on fresh + // injection. The colour can change through paths that don't tear out our + // button (Bricks' own colour palette, dynamic data, a manual edit); when it + // does, the swatch must follow. If the value is no longer one of our + // `--sf-color-*` variables the dot resets to the default colourful state. + syncSFButtonState(btn, colorInput); +} + +/** + * Reflect the colour input's current value on the SF button's dot. + * + * When the input holds a known `--sf-color-*` variable the dot becomes the + * solid resolved-hex square (active). Otherwise it resets to the default + * colourful conic-gradient dot, so picking a colour through Bricks' own UI + * no longer leaves a stale SF swatch behind. + * + * @param {Element} btn the `.slashed-sf-color-btn` element + * @param {Element} colorInput the `[data-control="text"].color-input` wrapper + */ +function syncSFButtonState(btn, colorInput) { + const dot = btn.querySelector('.' + SF_BTN_CLASS + '__dot'); const liveInput = colorInput.querySelector('input[type="text"]') ?? colorInput.querySelector('input:not([type="hidden"],[type="submit"],[type="button"],[type="checkbox"],[type="radio"],[type="file"])'); const currentVal = liveInput?.value ?? ''; const varName = currentVal.match(/^var\((--[^)]+)\)/)?.[1]; - const initHex = varName ? (_hexMap[varName] ?? null) : null; - if (initHex) { - dot.style.background = initHex; - dot.style.removeProperty('box-shadow'); - btn.classList.add(SF_BTN_CLASS + '--active'); + const hex = varName ? (_hexMap[varName] ?? null) : null; + + if (dot) { + if (hex) { + dot.style.background = hex; + dot.style.removeProperty('box-shadow'); + } else { + dot.style.removeProperty('background'); + } } + btn.classList.toggle(SF_BTN_CLASS + '--active', !!hex); } /**