@rulecms/widget-svelte 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/index.cjs +10 -9
- package/dist/index.d.ts +27 -5
- package/dist/index.js +2230 -1733
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,20 @@ Pass extra props — a click handler, a callback — to one component instance b
|
|
|
67
67
|
|
|
68
68
|
`r-button` reads `onClick` from the bag. The renderer never inspects the contents. In development, a key that addresses no column in the widget is printed once so typos are visible while building.
|
|
69
69
|
|
|
70
|
+
## Host `mounts`
|
|
71
|
+
|
|
72
|
+
Register a Svelte component from your app so a Custom (`r-mount`) slot in the composer can render it by name. The name is a map key, not a string that becomes code. A miss is a placeholder.
|
|
73
|
+
|
|
74
|
+
```svelte
|
|
75
|
+
<RuleCMSWidget publishedKey={publishedKey} {mounts} />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const mounts = { 'booking-form': BookingForm };
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Tell the marketer the exact name and the props the component reads. Event handlers still go through `componentProps` at that column's id — authored prop rows cannot become `onClick`. See `__docs__/CONTRACT_mounts.md` and [Mount Your Own Components](https://rulecms.com/docs/widget-mounts).
|
|
83
|
+
|
|
70
84
|
## Develop locally
|
|
71
85
|
|
|
72
86
|
```bash
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
"use strict";var ns=Object.defineProperty;var _r=e=>{throw TypeError(e)};var rs=(e,t,n)=>t in e?ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pe=(e,t,n)=>rs(e,typeof t!="symbol"?t+"":t,n),Pn=(e,t,n)=>t.has(e)||_r("Cannot "+n);var v=(e,t,n)=>(Pn(e,t,"read from private field"),n?n.call(e):t.get(e)),O=(e,t,n)=>t.has(e)?_r("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Z=(e,t,n,r)=>(Pn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),j=(e,t,n)=>(Pn(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fn=require("svelte"),os="5";var Wr;typeof window<"u"&&((Wr=window.__svelte??(window.__svelte={})).v??(Wr.v=new Set)).add(os);const is=1,ss=2,Vr=4,ls=8,as=16,us=1,cs=2,K=Symbol("uninitialized"),jr="http://www.w3.org/1999/xhtml",fs="http://www.w3.org/2000/svg",Br=!1;var Ur=Array.isArray,ds=Array.prototype.indexOf,nn=Array.prototype.includes,zn=Array.from,Tt=Object.getOwnPropertyDescriptor,ps=Object.getOwnPropertyDescriptors,hs=Object.prototype,gs=Array.prototype,Kr=Object.getPrototypeOf;function wt(e){return typeof e=="function"}const vs=()=>{};function ms(e){for(var t=0;t<e.length;t++)e[t]()}function Hr(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}const Y=2,kt=4,qn=8,Yr=1<<24,ye=16,fe=32,je=64,ys=128,ae=512,H=1024,B=2048,we=4096,X=8192,ue=16384,mt=32768,wr=1<<25,Be=65536,rn=1<<17,_s=1<<18,mn=1<<19,ws=1<<20,Se=1<<25,Ze=65536,on=1<<21,at=1<<22,Fe=1<<23,Zt=Symbol("$state"),bs=Symbol("legacy props"),Cs=Symbol(""),kn=Symbol("attributes"),br=Symbol("class"),Cr=Symbol("style"),qt=Symbol("text"),Bt=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 As(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ss(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Es(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Is(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ts(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ds(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ps(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ks(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function xs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Rs(){console.warn("https://svelte.dev/e/derived_inert")}function Gr(e){return e===this.v}function Ls(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function zr(e){return!Ls(e,this.v)}let Ms=!1,ce=null;function sn(e){ce=e}function Re(e,t=!1,n){ce={p:ce,i:!1,c:null,e:null,s:e,x:null,r:k,l:null}}function Le(e){var t=ce,n=t.e;if(n!==null){t.e=null;for(var r of n)co(r)}return t.i=!0,ce=t.p,{}}function qr(){return!0}let it=[];function Ns(){var e=it;it=[],ms(e)}function Vn(e){if(it.length===0){var t=it;queueMicrotask(()=>{t===it&&Ns()})}it.push(e)}function Os(e){var t=k;if(t===null)return E.f|=Fe,e;if((t.f&mt)===0&&(t.f&kt)===0)throw e;ln(e,t)}function ln(e,t){if(!(t!==null&&(t.f&ue)!==0)){for(;t!==null;){if((t.f&ys)!==0){if((t.f&mt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}const Ws=-7169;function F(e,t){e.f=e.f&Ws|t}function Xn(e){(e.f&ae)!==0||e.deps===null?F(e,H):F(e,we)}function Xr(e){if(e!==null)for(const t of e)(t.f&Y)===0||(t.f&Ze)===0||(t.f^=Ze,Xr(t.deps))}function Fs(e,t,n){(e.f&B)!==0?t.add(e):(e.f&we)!==0&&n.add(e),Xr(e.deps),F(e,H)}function yn(e){var t=E,n=k;Ke(null),gt(null);try{return e()}finally{Ke(t),gt(n)}}function Vs(e,t,n,r){const o=Zn;var i=e.filter(d=>!d.settled),s=t.map(o);if(n.length===0&&i.length===0){r(s);return}var l=k,a=js(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function f(d){if((l.f&ue)===0){a();try{r([...s,...d])}catch(m){ln(m,l)}an()}}var h=Zr();if(n.length===0){c.then(()=>f([])).finally(h);return}function u(){Promise.all(n.map(d=>Bs(d))).then(f).catch(d=>ln(d,l)).finally(h)}c?c.then(()=>{a(),u(),an()}):u()}function js(){var e=k,t=E,n=ce,r=T;return function(i=!0){gt(e),Ke(t),sn(n),i&&(e.f&ue)===0&&(r==null||r.activate(),r==null||r.apply())}}function an(e=!0){gt(null),Ke(null),sn(null),e&&(T==null||T.deactivate())}function Zr(){var e=k,t=e.b,n=T,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}function Zn(e){var t=Y|B;return k!==null&&(k.f|=mn),{ctx:ce,deps:null,effects:null,equals:Gr,f:t,fn:e,reactions:null,rv:0,v:K,wv:0,parent:k,ac:null}}const Ct=Symbol("obsolete");function Bs(e,t,n){let r=k;r===null&&As();var o=void 0,i=Rt(K),s=!E,l=new Set;return nl(()=>{var d,m;var a=k,c=Hr();o=c.promise;try{Promise.resolve(e()).then(c.resolve,y=>{y!==Bt&&c.reject(y)}).finally(an)}catch(y){c.reject(y),an()}var f=T;if(s){if((a.f&mt)!==0)var h=Zr();if((d=r.b)!=null&&d.is_rendered())(m=f.async_deriveds.get(a))==null||m.reject(Ct);else for(const y of l.values())y.reject(Ct);l.add(c),f.async_deriveds.set(a,c)}const u=(y,g=void 0)=>{h==null||h(),l.delete(c),g!==Ct&&(f.activate(),g?(i.f|=Fe,Lt(i,g)):((i.f&Fe)!==0&&(i.f^=Fe),Lt(i,y)),f.deactivate())};c.promise.then(u,y=>u(null,y||"unknown"))}),uo(()=>{for(const a of l)a.reject(Ct)}),new Promise(a=>{function c(f){function h(){f===o?a(i):c(o)}f.then(h,h)}c(o)})}function A(e){const t=Zn(e);return mo(t),t}function Us(e){const t=Zn(e);return t.equals=zr,t}function Ks(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ke(t[n])}}function Jn(e){var t,n=k,r=e.parent;if(!Ue&&r!==null&&e.v!==K&&(r.f&(ue|X))!==0)return Rs(),e.v;gt(r);try{e.f&=~Ze,Ks(e),t=bo(e)}finally{gt(n)}return t}function Jr(e){var t=Jn(e);if(!e.equals(t)&&(e.wv=_o(),(!(T!=null&&T.is_fork)||e.deps===null)&&(T!==null?(T.capture(e,t,!0),Dt==null||Dt.capture(e,t,!0)):e.v=t,e.deps===null))){F(e,H);return}Ue||(z!==null?(ao()||T!=null&&T.is_fork)&&z.set(e,t):Xn(e))}function Hs(e){var t;if(e.effects!==null)for(const n of e.effects)(n.teardown||n.ac)&&((t=n.teardown)==null||t.call(n),n.ac!==null&&yn(()=>{n.ac.abort(Bt),n.ac=null}),n.fn!==null&&(n.teardown=vs),Nt(n,0),tr(n))}function Qr(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&vt(t)}let xn=null,rt=null,T=null,Dt=null,z=null,jn=null,Rn=!1,st=null,Jt=null;var Ar=0;let Ys=1;var ut,Oe,Ye,ct,ft,dt,De,pt,J,Ft,Pe,ge,Ce,ht,Ge,x,Bn,At,Un,$r,eo,ot,Gs,St;const gn=class gn{constructor(){O(this,x);pe(this,"id",Ys++);O(this,ut,!1);pe(this,"linked",!0);O(this,Oe,null);O(this,Ye,null);pe(this,"async_deriveds",new Map);pe(this,"current",new Map);pe(this,"previous",new Map);O(this,ct,new Set);O(this,ft,new Set);O(this,dt,0);O(this,De,new Map);O(this,pt,null);O(this,J,[]);O(this,Ft,[]);O(this,Pe,new Set);O(this,ge,new Set);O(this,Ce,new Map);O(this,ht,new Set);pe(this,"is_fork",!1);O(this,Ge,!1);rt===null?xn=rt=this:(Z(rt,Ye,this),Z(this,Oe,rt)),rt=this}skip_effect(t){v(this,Ce).has(t)||v(this,Ce).set(t,{d:[],m:[]}),v(this,ht).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=v(this,Ce).get(t);if(r){v(this,Ce).delete(t);for(var o of r.d)F(o,B),n(o);for(o of r.m)F(o,we),n(o)}v(this,ht).add(t)}capture(t,n,r=!1){t.v!==K&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&Fe)===0&&(this.current.set(t,[n,r]),z==null||z.set(t,n)),this.is_fork||(t.v=n)}activate(){T=this}deactivate(){T=null,z=null}flush(){try{Rn=!0,T=this,j(this,x,At).call(this)}finally{Ar=0,jn=null,st=null,Jt=null,Rn=!1,T=null,z=null,qe.clear()}}discard(){var t;for(const n of v(this,ft))n(this);v(this,ft).clear();for(const n of this.async_deriveds.values())n.reject(Ct);j(this,x,St).call(this),(t=v(this,pt))==null||t.resolve()}register_created_effect(t){v(this,Ft).push(t)}increment(t,n){if(Z(this,dt,v(this,dt)+1),t){let r=v(this,De).get(n)??0;v(this,De).set(n,r+1)}}decrement(t,n){if(Z(this,dt,v(this,dt)-1),t){let r=v(this,De).get(n)??0;r===1?v(this,De).delete(n):v(this,De).set(n,r-1)}v(this,Ge)||(Z(this,Ge,!0),Vn(()=>{Z(this,Ge,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)v(this,Pe).add(r);for(const r of n)v(this,ge).add(r);t.clear(),n.clear()}oncommit(t){v(this,ct).add(t)}ondiscard(t){v(this,ft).add(t)}settled(){return(v(this,pt)??Z(this,pt,Hr())).promise}static ensure(){if(T===null){const t=T=new gn;Rn||Vn(()=>{v(t,ut)||t.flush()})}return T}apply(){{z=null;return}}schedule(t){var o;if(jn=t,(o=t.b)!=null&&o.is_pending&&(t.f&(kt|qn|Yr))!==0&&(t.f&mt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(st!==null&&n===k&&(E===null||(E.f&Y)===0))return;if((r&(je|fe))!==0){if((r&H)===0)return;n.f^=H}}v(this,J).push(n)}};ut=new WeakMap,Oe=new WeakMap,Ye=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,De=new WeakMap,pt=new WeakMap,J=new WeakMap,Ft=new WeakMap,Pe=new WeakMap,ge=new WeakMap,Ce=new WeakMap,ht=new WeakMap,Ge=new WeakMap,x=new WeakSet,Bn=function(){if(this.is_fork)return!0;for(const r of v(this,De).keys()){for(var t=r,n=!1;t.parent!==null;){if(v(this,Ce).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},At=function(){var a,c,f,h;Z(this,ut,!0),Ar++>1e3&&(j(this,x,St).call(this),zs());for(const u of v(this,Pe))v(this,ge).delete(u),F(u,B),this.schedule(u);for(const u of v(this,ge))F(u,we),this.schedule(u);const t=v(this,J);Z(this,J,[]),this.apply();var n=st=[],r=[],o=Jt=[];for(const u of t)try{j(this,x,Un).call(this,u,n,r)}catch(d){throw ro(u),j(this,x,Bn).call(this)||this.discard(),d}if(T=null,o.length>0){var i=gn.ensure();for(const u of o)i.schedule(u)}if(st=null,Jt=null,j(this,x,Bn).call(this)){j(this,x,ot).call(this,r),j(this,x,ot).call(this,n);for(const[u,d]of v(this,Ce))no(u,d);o.length>0&&j(a=T,x,At).call(a);return}const s=j(this,x,$r).call(this);if(s){j(this,x,ot).call(this,r),j(this,x,ot).call(this,n),j(c=s,x,eo).call(c,this);return}v(this,Pe).clear(),v(this,ge).clear();for(const u of v(this,ct))u(this);v(this,ct).clear(),Dt=this,Sr(r),Sr(n),Dt=null,(f=v(this,pt))==null||f.resolve();var l=T;if(v(this,dt)===0&&(v(this,J).length===0||l!==null)&&j(this,x,St).call(this),v(this,J).length>0)if(l!==null){const u=l;v(u,J).push(...v(this,J).filter(d=>!v(u,J).includes(d)))}else l=this;l!==null&&j(h=l,x,At).call(h)},Un=function(t,n,r){t.f^=H;for(var o=t.first;o!==null;){var i=o.f,s=(i&(fe|je))!==0,l=s&&(i&H)!==0,a=l||(i&X)!==0||v(this,Ce).has(o);if(!a&&o.fn!==null){s?o.f^=H:(i&kt)!==0?n.push(o):Ht(o)&&((i&ye)!==0&&v(this,ge).add(o),vt(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var f=o.next;if(f!==null){o=f;break}o=o.parent}}},$r=function(){for(var t=v(this,Oe);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=v(t,Oe)}return null},eo=function(t){var r;for(const[o,i]of t.current)!this.previous.has(o)&&t.previous.has(o)&&this.previous.set(o,t.previous.get(o)),this.current.set(o,i);for(const[o,i]of t.async_deriveds){const s=this.async_deriveds.get(o);s&&i.promise.then(s.resolve).catch(s.reject)}t.async_deriveds.clear(),this.transfer_effects(v(t,Pe),v(t,ge));const n=o=>{var i=o.reactions;if(i!==null&&!((o.f&Y)!==0&&(o.f&(B|we))===0))for(const a of i){var s=a.f;if((s&Y)!==0)n(a);else{var l=a;s&(at|ye)&&!this.async_deriveds.has(l)&&(v(this,ge).delete(l),F(l,B),this.schedule(l))}}};for(const o of this.current.keys())n(o);this.oncommit(()=>t.discard()),j(r=t,x,St).call(r),T=this,j(this,x,At).call(this)},ot=function(t){for(var n=0;n<t.length;n+=1)Fs(t[n],v(this,Pe),v(this,ge))},Gs=function(){var h;for(let u=xn;u!==null;u=v(u,Ye)){var t=u.id<this.id,n=[];for(const[d,[m,y]]of this.current){if(u.current.has(d)){var r=u.current.get(d)[0];if(t&&m!==r)u.current.set(d,[m,y]);else continue}n.push(d)}if(t)for(const[d,m]of this.async_deriveds){const y=u.async_deriveds.get(d);y&&m.promise.then(y.resolve).catch(y.reject)}var o=[...u.current.keys()].filter(d=>!u.current.get(d)[1]);if(!(!v(u,ut)||o.length===0)){var i=o.filter(d=>!this.current.has(d));if(i.length===0)t&&u.discard();else if(n.length>0){if(t)for(const d of v(this,ht))u.unskip_effect(d,m=>{var y;(m.f&(ye|at))!==0?u.schedule(m):j(y=u,x,ot).call(y,[m])});u.activate();var s=new Set,l=new Map;for(var a of n)to(a,i,s,l);l=new Map;var c=[...u.current].filter(([d,m])=>{const y=this.current.get(d);return y?y[0]!==m[0]||y[1]!==m[1]:!0}).map(([d])=>d);if(c.length>0)for(const d of v(this,Ft))(d.f&(ue|X|rn))===0&&Qn(d,c,l)&&((d.f&(at|ye))!==0?(F(d,B),u.schedule(d)):v(u,Pe).add(d));if(v(u,J).length>0&&!v(u,Ge)){u.apply();for(var f of v(u,J))j(h=u,x,Un).call(h,f,[],[]);Z(u,J,[])}u.deactivate()}}}},St=function(){if(this.linked){var t=v(this,Oe),n=v(this,Ye);t===null?xn=n:Z(t,Ye,n),n===null?rt=t:Z(n,Oe,t),this.linked=!1}};let xt=gn;function zs(){try{Ds()}catch(e){ln(e,jn)}}let he=null;function Sr(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(ue|X))===0&&Ht(r)&&(he=new Set,vt(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&po(r),(he==null?void 0:he.size)>0)){qe.clear();for(const o of he){if((o.f&(ue|X))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)he.has(s)&&(he.delete(s),i.push(s)),s=s.parent;for(let l=i.length-1;l>=0;l--){const a=i[l];(a.f&(ue|X))===0&&vt(a)}}he.clear()}}he=null}}function to(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&Y)!==0?to(o,t,n,r):(i&(at|ye))!==0&&(i&B)===0&&Qn(o,t,r)&&(F(o,B),$n(o))}}function Qn(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const o of e.deps){if(nn.call(t,o))return!0;if((o.f&Y)!==0&&Qn(o,t,n))return n.set(o,!0),!0}return n.set(e,!1),!1}function $n(e){T.schedule(e)}function no(e,t){if(!((e.f&fe)!==0&&(e.f&H)!==0)){(e.f&B)!==0?t.d.push(e):(e.f&we)!==0&&t.m.push(e),F(e,H);for(var n=e.first;n!==null;)no(n,t),n=n.next}}function ro(e){F(e,H);for(var t=e.first;t!==null;)ro(t),t=t.next}let un=new Set;const qe=new Map;let oo=!1;function Rt(e,t){var n={f:0,v:e,reactions:null,equals:Gr,rv:0,wv:0};return n}function ne(e,t){const n=Rt(e);return mo(n),n}function qs(e,t=!1,n=!0){const r=Rt(e);return t||(r.equals=zr),r}function N(e,t,n=!1){E!==null&&(!We||(E.f&rn)!==0)&&qr()&&(E.f&(Y|ye|at|rn))!==0&&(Ee===null||!Ee.has(e))&&xs();let r=n?lt(t):t;return Lt(e,r,Jt)}function Lt(e,t,n=null){if(!e.equals(t)){qe.set(e,Ue?t:e.v);var r=xt.ensure();if(r.capture(e,t),(e.f&Y)!==0){const o=e;(e.f&B)!==0&&Jn(o),z===null&&Xn(o)}e.wv=_o(),io(e,B,n),k!==null&&(k.f&H)!==0&&(k.f&(fe|je))===0&&(oe===null?il([e]):oe.push(e)),!r.is_fork&&un.size>0&&!oo&&Xs()}return t}function Xs(){oo=!1;for(const e of un){(e.f&H)!==0&&F(e,we);let t;try{t=Ht(e)}catch{t=!0}t&&vt(e)}un.clear()}function Ln(e){N(e,e.v+1)}function io(e,t,n){var r=e.reactions;if(r!==null)for(var o=r.length,i=0;i<o;i++){var s=r[i],l=s.f,a=(l&B)===0;if(a&&F(s,t),(l&rn)!==0)un.add(s);else if((l&Y)!==0){var c=s;z==null||z.delete(c),(l&Ze)===0&&(l&ae&&(k===null||(k.f&on)===0)&&(s.f|=Ze),io(c,we,n))}else if(a){var f=s;(l&ye)!==0&&he!==null&&he.add(f),n!==null?n.push(f):$n(f)}}}function lt(e){if(typeof e!="object"||e===null||Zt in e)return e;const t=Kr(e);if(t!==hs&&t!==gs)return e;var n=new Map,r=Ur(e),o=ne(0),i=Xe,s=l=>{if(Xe===i)return l();var a=E,c=Xe;Ke(null),Ir(i);var f=l();return Ke(a),Ir(c),f};return r&&n.set("length",ne(e.length)),new Proxy(e,{defineProperty(l,a,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ps();var f=n.get(a);return f===void 0?s(()=>{var h=ne(c.value);return n.set(a,h),h}):N(f,c.value,!0),!0},deleteProperty(l,a){var c=n.get(a);if(c===void 0){if(a in l){const f=s(()=>ne(K));n.set(a,f),Ln(o)}}else N(c,K),Ln(o);return!0},get(l,a,c){var d;if(a===Zt)return e;var f=n.get(a),h=a in l;if(f===void 0&&(!h||(d=Tt(l,a))!=null&&d.writable)&&(f=s(()=>{var m=lt(h?l[a]:K),y=ne(m);return y}),n.set(a,f)),f!==void 0){var u=p(f);return u===K?void 0:u}return Reflect.get(l,a,c)},getOwnPropertyDescriptor(l,a){var c=Reflect.getOwnPropertyDescriptor(l,a);if(c&&"value"in c){var f=n.get(a);f&&(c.value=p(f))}else if(c===void 0){var h=n.get(a),u=h==null?void 0:h.v;if(h!==void 0&&u!==K)return{enumerable:!0,configurable:!0,value:u,writable:!0}}return c},has(l,a){var u;if(a===Zt)return!0;var c=n.get(a),f=c!==void 0&&c.v!==K||Reflect.has(l,a);if(c!==void 0||k!==null&&(!f||(u=Tt(l,a))!=null&&u.writable)){c===void 0&&(c=s(()=>{var d=f?lt(l[a]):K,m=ne(d);return m}),n.set(a,c));var h=p(c);if(h===K)return!1}return f},set(l,a,c,f){var I;var h=n.get(a),u=a in l;if(r&&a==="length")for(var d=c;d<h.v;d+=1){var m=n.get(d+"");m!==void 0?N(m,K):d in l&&(m=s(()=>ne(K)),n.set(d+"",m))}if(h===void 0)(!u||(I=Tt(l,a))!=null&&I.writable)&&(h=s(()=>ne(void 0)),N(h,lt(c)),n.set(a,h));else{u=h.v!==K;var y=s(()=>lt(c));N(h,y)}var g=Reflect.getOwnPropertyDescriptor(l,a);if(g!=null&&g.set&&g.set.call(f,c),!u){if(r&&typeof a=="string"){var _=n.get("length"),R=Number(a);Number.isInteger(R)&&R>=_.v&&N(_,R+1)}Ln(o)}return!0},ownKeys(l){p(o);var a=Reflect.ownKeys(l).filter(h=>{var u=n.get(h);return u===void 0||u.v!==K});for(var[c,f]of n)f.v!==K&&!(c in l)&&a.push(c);return a},setPrototypeOf(){ks()}})}var Zs,Js,Qs;function Ve(e=""){return document.createTextNode(e)}function cn(e){return Js.call(e)}function Ut(e){return Qs.call(e)}function me(e,t){return cn(e)}function re(e,t=!1){{var n=cn(e);return n instanceof Comment&&n.data===""?Ut(n):n}}function fn(e,t=1,n=!1){let r=e;for(;t--;)r=Ut(r);return r}function $s(e){e.textContent=""}function so(){return!1}function lo(e,t,n){return t==null||t===jr?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function el(e){k===null&&(E===null&&Ts(),Is()),Ue&&Es()}function tl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function yt(e,t){var n=k;n!==null&&(n.f&X)!==0&&(e|=X);var r={ctx:ce,deps:null,nodes:null,f:e|B|ae,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};T==null||T.register_created_effect(r);var o=r;if((e&kt)!==0)st!==null?st.push(r):xt.ensure().schedule(r);else if(t!==null){try{vt(r)}catch(s){throw ke(r),s}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&mn)===0&&(o=o.first,(e&ye)!==0&&(e&Be)!==0&&o!==null&&(o.f|=Be))}if(o!==null&&(o.parent=n,n!==null&&tl(o,n),E!==null&&(E.f&Y)!==0&&(e&je)===0)){var i=E;(i.effects??(i.effects=[])).push(o)}return r}function ao(){return E!==null&&!We}function uo(e){const t=yt(qn,null);return F(t,H),t.teardown=e,t}function er(e){el();var t=k.f,n=!E&&(t&fe)!==0&&ce!==null&&!ce.i;if(n){var r=ce;(r.e??(r.e=[])).push(e)}else return co(e)}function co(e){return yt(kt|ws,e)}function nl(e){return yt(at|mn,e)}function _e(e,t=[],n=[],r=[]){Vs(r,t,n,o=>{yt(qn,()=>{e(...o.map(p))})})}function Kt(e,t=0){var n=yt(ye|t,e);return n}function Mt(e){return yt(fe|mn,e)}function fo(e){var t=e.teardown;if(t!==null){const n=Ue,r=E;Er(!0),Ke(null);try{t.call(null)}finally{Er(n),Ke(r)}}}function tr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const o=n.ac;o!==null&&yn(()=>{o.abort(Bt)});var r=n.next;(n.f&je)!==0?n.parent=null:ke(n,t),n=r}}function rl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&fe)===0&&ke(t),t=n}}function ke(e,t=!0){var n=!1;(t||(e.f&_s)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ol(e.nodes.start,e.nodes.end),n=!0),e.f|=wr,tr(e,t&&!n),Nt(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();fo(e),e.f^=wr,e.f|=ue;var o=e.parent;o!==null&&o.first!==null&&po(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ol(e,t){for(;e!==null;){var n=e===t?null:Ut(e);e.remove(),e=n}}function po(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 nr(e,t,n=!0){var r=[];ho(e,r,!0);var o=()=>{n&&ke(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||o();for(var l of r)l.out(s)}else o()}function ho(e,t,n){if((e.f&X)===0){e.f^=X;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var o=e.first;o!==null;){var i=o.next;if((o.f&je)===0){var s=(o.f&Be)!==0||(o.f&fe)!==0&&(e.f&ye)!==0;ho(o,t,s?n:!1)}o=i}}}function dn(e){go(e,!0)}function go(e,t){if((e.f&X)!==0){e.f^=X,(e.f&H)===0&&(F(e,B),xt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Be)!==0||(n.f&fe)!==0;go(n,o?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function vo(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var o=n===r?null:Ut(n);t.append(n),n=o}}let Qt=!1,Ue=!1;function Er(e){Ue=e}let E=null,We=!1;function Ke(e){E=e}let k=null;function gt(e){k=e}let Ee=null;function mo(e){E!==null&&(Ee??(Ee=new Set)).add(e)}let Q=null,$=0,oe=null;function il(e){oe=e}let yo=1,He=0,Xe=He;function Ir(e){Xe=e}function _o(){return++yo}function Ht(e){var t=e.f;if((t&B)!==0)return!0;if(t&Y&&(e.f&=~Ze),(t&we)!==0){for(var n=e.deps,r=n.length,o=0;o<r;o++){var i=n[o];if(Ht(i)&&Jr(i),i.wv>e.wv)return!0}(t&ae)!==0&&z===null&&F(e,H)}return!1}function wo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ee!==null&&Ee.has(e)))for(var o=0;o<r.length;o++){var i=r[o];(i.f&Y)!==0?wo(i,t,!1):t===i&&(n?F(i,B):(i.f&H)!==0&&F(i,we),$n(i))}}function bo(e){var y;var t=Q,n=$,r=oe,o=E,i=Ee,s=ce,l=We,a=Xe,c=e.f;Q=null,$=0,oe=null,E=(c&(fe|je))===0?e:null,Ee=null,sn(e.ctx),We=!1,Xe=++He,e.ac!==null&&(yn(()=>{e.ac.abort(Bt)}),e.ac=null);try{e.f|=on;var f=e.fn,h=f();e.f|=mt;var u=e.deps,d=T==null?void 0:T.is_fork;if(Q!==null){var m;if(d||Nt(e,$),u!==null&&$>0)for(u.length=$+Q.length,m=0;m<Q.length;m++)u[$+m]=Q[m];else e.deps=u=Q;if(ao()&&(e.f&ae)!==0)for(m=$;m<u.length;m++)((y=u[m]).reactions??(y.reactions=[])).push(e)}else!d&&u!==null&&$<u.length&&(Nt(e,$),u.length=$);if(qr()&&oe!==null&&!We&&u!==null&&(e.f&(Y|we|B))===0)for(m=0;m<oe.length;m++)wo(oe[m],e);if(o!==null&&o!==e){if(He++,o.deps!==null)for(let g=0;g<n;g+=1)o.deps[g].rv=He;if(t!==null)for(const g of t)g.rv=He;oe!==null&&(r===null?r=oe:r.push(...oe))}return(e.f&Fe)!==0&&(e.f^=Fe),h}catch(g){return Os(g)}finally{e.f^=on,Q=t,$=n,oe=r,E=o,Ee=i,sn(s),We=l,Xe=a}}function sl(e,t){let n=t.reactions;if(n!==null){var r=ds.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}if(n===null&&(t.f&Y)!==0&&(Q===null||!nn.call(Q,t))){var i=t;(i.f&ae)!==0&&(i.f^=ae,i.f&=~Ze),i.v!==K&&Xn(i),i.ac!==null&&yn(()=>{i.ac.abort(Bt),i.ac=null,F(i,B)}),Hs(i),Nt(i,0)}}function Nt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)sl(e,n[r])}function vt(e){var t=e.f;if((t&ue)===0){F(e,H);var n=k,r=Qt;k=e,Qt=(t&(fe|je))===0;try{(t&(ye|Yr))!==0?rl(e):tr(e),fo(e);var o=bo(e);e.teardown=typeof o=="function"?o:null,e.wv=yo;var i;Br&&Ms&&(e.f&B)!==0&&e.deps}finally{Qt=r,k=n}}}function p(e){var t=e.f,n=(t&Y)!==0;if(E!==null&&!We){var r=k!==null&&(k.f&ue)!==0;if(!r&&(Ee===null||!Ee.has(e))){var o=E.deps;if((E.f&on)!==0)e.rv<He&&(e.rv=He,Q===null&&o!==null&&o[$]===e?$++:Q===null?Q=[e]:Q.push(e));else{E.deps??(E.deps=[]),nn.call(E.deps,e)||E.deps.push(e);var i=e.reactions;i===null?e.reactions=[E]:nn.call(i,E)||i.push(E)}}}if(Ue&&qe.has(e))return qe.get(e);if(n){var s=e;if(Ue){var l=s.v;return((s.f&H)===0&&s.reactions!==null||Ao(s))&&(l=Jn(s)),qe.set(s,l),l}var a=(s.f&ae)===0&&!We&&E!==null&&(Qt||(E.f&ae)!==0),c=(s.f&mt)===0;Ht(s)&&(a&&(s.f|=ae),Jr(s)),a&&!c&&(Qr(s),Co(s))}if(z!=null&&z.has(e))return z.get(e);if((e.f&Fe)!==0)throw e.v;return e.v}function Co(e){if(e.f|=ae,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&Y)!==0&&(t.f&ae)===0&&(Qr(t),Co(t))}function Ao(e){if(e.v===K)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(qe.has(t)||(t.f&Y)!==0&&Ao(t))return!0;return!1}var Fr;const Mn=((Fr=globalThis==null?void 0:globalThis.window)==null?void 0:Fr.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function ll(e){return(Mn==null?void 0:Mn.createHTML(e))??e}function al(e){var t=lo("template");return t.innerHTML=ll(e.replaceAll("<!>","<!---->")),t.content}function Ot(e,t){var n=k;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Me(e,t){var n=(t&us)!==0,r=(t&cs)!==0,o,i=!e.startsWith("<!>");return()=>{o===void 0&&(o=al(i?e:"<!>"+e),n||(o=cn(o)));var s=r||Zs?document.importNode(o,!0):o.cloneNode(!0);if(n){var l=cn(s),a=s.lastChild;Ot(l,a)}else Ot(s,s);return s}}function So(e=""){{var t=Ve(e+"");return Ot(t,t),t}}function se(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Ve();return e.append(t,n),Ot(t,n),e}function W(e,t){e!==null&&e.before(t)}function rr(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[qt]??(e[qt]=e.nodeValue))&&(e[qt]=n,e.nodeValue=`${n}`)}var ve,Ae,ee,ze,Vt,jt,vn;class _n{constructor(t,n=!0){pe(this,"anchor");O(this,ve,new Map);O(this,Ae,new Map);O(this,ee,new Map);O(this,ze,new Set);O(this,Vt,!0);O(this,jt,t=>{if(v(this,ve).has(t)){var n=v(this,ve).get(t),r=v(this,Ae).get(n);if(r)dn(r),v(this,ze).delete(n);else{var o=v(this,ee).get(n);o&&(dn(o.effect),v(this,Ae).set(n,o.effect),v(this,ee).delete(n),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),r=o.effect)}for(const[i,s]of v(this,ve)){if(v(this,ve).delete(i),i===t)break;const l=v(this,ee).get(s);l&&(ke(l.effect),v(this,ee).delete(s))}for(const[i,s]of v(this,Ae)){if(i===n||v(this,ze).has(i))continue;const l=()=>{if(Array.from(v(this,ve).values()).includes(i)){var c=document.createDocumentFragment();vo(s,c),c.append(Ve()),v(this,ee).set(i,{effect:s,fragment:c})}else ke(s);v(this,ze).delete(i),v(this,Ae).delete(i)};v(this,Vt)||!r?(v(this,ze).add(i),nr(s,l,!1)):l()}}});O(this,vn,t=>{v(this,ve).delete(t);const n=Array.from(v(this,ve).values());for(const[r,o]of v(this,ee))n.includes(r)||(ke(o.effect),v(this,ee).delete(r))});this.anchor=t,Z(this,Vt,n)}ensure(t,n){var r=T,o=so();if(n&&!v(this,Ae).has(t)&&!v(this,ee).has(t))if(o){var i=document.createDocumentFragment(),s=Ve();i.append(s),v(this,ee).set(t,{effect:Mt(()=>n(s)),fragment:i})}else v(this,Ae).set(t,Mt(()=>n(this.anchor)));if(v(this,ve).set(r,t),o){for(const[l,a]of v(this,Ae))l===t?r.unskip_effect(a):r.skip_effect(a);for(const[l,a]of v(this,ee))l===t?r.unskip_effect(a.effect):r.skip_effect(a.effect);r.oncommit(v(this,jt)),r.ondiscard(v(this,vn))}else v(this,jt).call(this,r)}}ve=new WeakMap,Ae=new WeakMap,ee=new WeakMap,ze=new WeakMap,Vt=new WeakMap,jt=new WeakMap,vn=new WeakMap;function or(e,t,...n){var r=new _n(e);Kt(()=>{const o=t()??null;r.ensure(o,o&&(i=>o(i,...n)))},Be)}function xe(e,t,n=!1){var r=new _n(e),o=n?Be:0;function i(s,l){r.ensure(s,l)}Kt(()=>{var s=!1;t((l,a=0)=>{s=!0,i(a,l)}),s||i(-1,null)},o)}function ul(e,t,n){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let h=t[l];nr(h,()=>{if(i){if(i.pending.delete(h),i.done.add(h),i.pending.size===0){var u=e.outrogroups;Kn(e,zn(i.done)),u.delete(i),u.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var a=r.length===0&&n!==null&&e.pending.size===0;if(a){var c=n,f=c.parentNode;$s(f),f.append(c),e.items.clear()}Kn(e,t,!a)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function Kn(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const s of e.pending.values())for(const l of s)r.add(e.items.get(l).e)}for(var o=0;o<t.length;o++){var i=t[o];if(r!=null&&r.has(i)){i.f|=Se;const s=document.createDocumentFragment();vo(i,s)}else ke(t[o],n)}}var Tr;function Hn(e,t,n,r,o,i=null){var s=e,l=new Map,a=(t&Vr)!==0;if(a){var c=e;s=c.appendChild(Ve())}var f=null,h=Us(()=>{var I=n();return Ur(I)?I:I==null?[]:zn(I)}),u,d=new Map,m=!0;function y(I){(R.effect.f&ue)===0&&(R.pending.delete(I),R.fallback=f,cl(R,u,s,t,r),f!==null&&(u.length===0?(f.f&Se)===0?dn(f):(f.f^=Se,Et(f,null,s)):nr(f,()=>{f=null})))}function g(I){R.pending.delete(I)}var _=Kt(()=>{u=p(h);for(var I=u.length,V=new Set,P=T,D=so(),S=0;S<I;S+=1){var w=u[S],C=r(w,S),b=m?null:l.get(C);b?(b.v&&Lt(b.v,w),b.i&&Lt(b.i,S),D&&P.unskip_effect(b.e)):(b=fl(l,m?s:Tr??(Tr=Ve()),w,C,S,o,t,n),m||(b.e.f|=Se),l.set(C,b)),V.add(C)}if(I===0&&i&&!f&&(m?f=Mt(()=>i(s)):(f=Mt(()=>i(Tr??(Tr=Ve()))),f.f|=Se)),I>V.size&&Ss(),!m)if(d.set(P,V),D){for(const[L,G]of l)V.has(L)||P.skip_effect(G.e);P.oncommit(y),P.ondiscard(g)}else y(P);p(h)}),R={effect:_,items:l,pending:d,outrogroups:null,fallback:f};m=!1}function bt(e){for(;e!==null&&(e.f&fe)===0;)e=e.next;return e}function cl(e,t,n,r,o){var b,L,G,M,q,tt,Gt,Te,nt;var i=(r&ls)!==0,s=t.length,l=e.items,a=bt(e.effect.first),c,f=null,h,u=[],d=[],m,y,g,_;if(i)for(_=0;_<s;_+=1)m=t[_],y=o(m,_),g=l.get(y).e,(g.f&Se)===0&&((L=(b=g.nodes)==null?void 0:b.a)==null||L.measure(),(h??(h=new Set)).add(g));for(_=0;_<s;_+=1){if(m=t[_],y=o(m,_),g=l.get(y).e,e.outrogroups!==null)for(const de of e.outrogroups)de.pending.delete(g),de.done.delete(g);if((g.f&X)!==0&&(dn(g),i&&((M=(G=g.nodes)==null?void 0:G.a)==null||M.unfix(),(h??(h=new Set)).delete(g))),(g.f&Se)!==0)if(g.f^=Se,g===a)Et(g,null,n);else{var R=f?f.next:a;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Ne(e,f,g),Ne(e,g,R),Et(g,R,n),f=g,u=[],d=[],a=bt(f.next);continue}if(g!==a){if(c!==void 0&&c.has(g)){if(u.length<d.length){var I=d[0],V;f=I.prev;var P=u[0],D=u[u.length-1];for(V=0;V<u.length;V+=1)Et(u[V],I,n);for(V=0;V<d.length;V+=1)c.delete(d[V]);Ne(e,P.prev,D.next),Ne(e,f,P),Ne(e,D,I),a=I,f=D,_-=1,u=[],d=[]}else c.delete(g),Et(g,a,n),Ne(e,g.prev,g.next),Ne(e,g,f===null?e.effect.first:f.next),Ne(e,f,g),f=g;continue}for(u=[],d=[];a!==null&&a!==g;)(c??(c=new Set)).add(a),d.push(a),a=bt(a.next);if(a===null)continue}(g.f&Se)===0&&u.push(g),f=g,a=bt(g.next)}if(e.outrogroups!==null){for(const de of e.outrogroups)de.pending.size===0&&(Kn(e,zn(de.done)),(q=e.outrogroups)==null||q.delete(de));e.outrogroups.size===0&&(e.outrogroups=null)}if(a!==null||c!==void 0){var S=[];if(c!==void 0)for(g of c)(g.f&X)===0&&S.push(g);for(;a!==null;)(a.f&X)===0&&a!==e.fallback&&S.push(a),a=bt(a.next);var w=S.length;if(w>0){var C=(r&Vr)!==0&&s===0?n:null;if(i){for(_=0;_<w;_+=1)(Gt=(tt=S[_].nodes)==null?void 0:tt.a)==null||Gt.measure();for(_=0;_<w;_+=1)(nt=(Te=S[_].nodes)==null?void 0:Te.a)==null||nt.fix()}ul(e,S,C)}}i&&Vn(()=>{var de,zt;if(h!==void 0)for(g of h)(zt=(de=g.nodes)==null?void 0:de.a)==null||zt.apply()})}function fl(e,t,n,r,o,i,s,l){var a=(s&is)!==0?(s&as)===0?qs(n,!1,!1):Rt(n):null,c=(s&ss)!==0?Rt(o):null;return{v:a,i:c,e:Mt(()=>(i(t,a??n,c??o,l),()=>{e.delete(r)}))}}function Et(e,t,n){if(e.nodes)for(var r=e.nodes.start,o=e.nodes.end,i=t&&(t.f&Se)===0?t.nodes.start:n;r!==null;){var s=Ut(r);if(i.before(r),r===o)return;r=s}}function Ne(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Nn(e,t,n){var r=new _n(e);Kt(()=>{var o=t()??null;r.ensure(o,o&&(i=>n(i,o)))},Be)}function Eo(e,t,n,r,o,i){var s=null,l=e,a=new _n(l,!1);Kt(()=>{const c=t()||null;var f=c==="svg"?fs:void 0;if(c===null){a.ensure(null,null);return}return a.ensure(c,h=>{if(c){if(s=lo(c,f),Ot(s,s),r){var u=null,d=s.appendChild(Ve());r(s,d),u==null||u.remove()}k.nodes.end=s,h.before(s)}}),()=>{}},Be),uo(()=>{})}function Io(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Io(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Io(e))&&(r&&(r+=" "),r+=t);return r}function pn(e){return typeof e=="object"?dl(e):e??""}function pl(e,t,n){var r=e==null?"":""+e;return r===""?null:r}function hl(e,t){return e==null?null:String(e)}function Wt(e,t,n,r,o,i){var s=e[br];if(s!==n||s===void 0){var l=pl(n);l==null?e.removeAttribute("class"):e.className=l,e[br]=n}return i}function ie(e,t,n,r){var o=e[Cr];if(o!==t){var i=hl(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e[Cr]=t}return r}const gl=Symbol("is custom element"),vl=Symbol("is html");function ir(e,t,n,r){var o=ml(e);o[t]!==(o[t]=n)&&(t==="loading"&&(e[Cs]=n),n==null?e.removeAttribute(t):typeof n!="string"&&yl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ml(e){return e[kn]??(e[kn]={[gl]:e.nodeName.includes("-"),[vl]:e.namespaceURI===jr})}var Dr=new Map;function yl(e){var t=e.getAttribute("is")||e.nodeName,n=Dr.get(t);if(n)return n;Dr.set(t,n=[]);for(var r,o=e,i=Element.prototype;i!==o;){r=ps(o);for(var s in r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.push(s);o=Kr(o)}return n}const _l={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(wt(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];wt(o)&&(o=o());const i=Tt(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(wt(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Tt(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===Zt||t===bs)return!1;for(let n of e.props)if(wt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(wt(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function On(...e){return new Proxy({props:e},_l)}function le(e,t,n,r){var o=r,i=!0,s=()=>(i&&(i=!1,o=r),o),l;l=e[t],l===void 0&&r!==void 0&&(l=s());var a;return a=()=>{var c=e[t];return c===void 0?s():(i=!0,c)},a}const _t="default";function sr(e,t){return!(e!=null&&e.length)||e===_t?t:`${e}/${t}`}const wl=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function Pr(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function bl(e){if(Pr(e))return e;const t=e;return Pr(t==null?void 0:t.default)?t.default:null}function Wn(e){return e.usesDefaultLibrary?[_t,...e.libraryIds]:[...e.libraryIds]}function kr({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[_t]))throw new Error(wl)}function To(e){const t={};for(const[n,r]of e){const o=n===_t;for(const[i,s]of Object.entries(r.components))t[o?i:`${n}/${i}`]=s}return{components:t}}function Yt(){const e=new Map,t=new Map,n=new Map,r=new Map;let o=0;function i(c,f){var h;e.get(c)!==f&&((h=f.manifest)!=null&&h.id&&f.manifest.id!==c&&console.warn(`RuleCMS widget: component library registered as "${c}" declares manifest id "${f.manifest.id}". The registered id wins for resolution.`),e.set(c,f),o+=1)}function s(c){const f=Wn(c),h=[...f].sort().join("|"),u=r.get(h);if(u&&u.loadedVersion===o)return u.plugin;const d=new Map;for(const y of f){const g=e.get(y);g&&d.set(y,g)}const m=To(d);return r.set(h,{loadedVersion:o,plugin:m}),m}function l(c){kr(c);const{registrations:f,referenced:h}=c;for(const u of Wn(h)){if(e.has(u)||n.has(u))continue;const d=f==null?void 0:f[u];if(!d){console.error(`RuleCMS widget: no component library registered for libraryId "${u}"; its components will not render.`),n.set(u,new Error(`No registration for libraryId "${u}"`));continue}if(typeof d=="function")return null;i(u,d)}return s(h)}async function a(c){kr(c);const{registrations:f,referenced:h}=c,u=Wn(h);return await Promise.all(u.map(async d=>{if(e.has(d)||n.has(d))return;const m=f==null?void 0:f[d];if(!m){console.error(`RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`),n.set(d,new Error(`No registration for libraryId "${d}"`));return}if(typeof m!="function"){i(d,m);return}let y=t.get(d);y||(y=m().then(g=>{const _=bl(g);if(!_)throw new Error(`Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);i(d,_)}).catch(g=>{n.set(d,g),console.error(`RuleCMS widget: failed to load component library "${d}":`,g)}).finally(()=>{t.delete(d)}),t.set(d,y)),await y})),s(h)}return{resolveSync:l,resolve:a}}const Cl={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},wn={DroppableBox:"droppable-box"},Yn={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},Al={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},$t="cssAttrArray",Sl={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},lr={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},ar=`${lr.Collection}_`,Do="dev.",Po="https://rulecms.com",ko="https://widget-cache.rulecms.com",xo="/api/v1/c/widget/get",Ro="/api/v1/c/dev/widget/get";function Je(e){return typeof e=="string"&&e.startsWith(Do)}function Lo(e,t){return t?t.replace(/\/$/,""):Je(e)?Po:ko}function ur({publishedKey:e,token:t,endpoint:n}){const r=Je(t),o=r?Ro:xo,i=r?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${Lo(t,n)}${o}?${i.toString()}`}const El=({id:e,prefix:t})=>`${t}_${e}`,Mo=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return No(e)},cr=e=>e.includes("_"),No=e=>{const t=e.indexOf("_"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:n,id:r}},fr=e=>{if(!cr(e))return;const n=Mo(e);return(n==null?void 0:n.prefix)===lr.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),n==null?void 0:n.id},Il=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const n=t[0];if(!t[1].includes("@"))return{name:n,instanceId:t[1]};const o=t[1].split("@");return{name:n,instanceId:o[0],parentId:o[1]}},Tl=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},Oo=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.id)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${r}`}},Wo=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.publishedKey)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${r}`}},Dl=e=>{const t=Oo(e);return`${ar}${t.data}`},Pl=e=>{const t=Wo(e);return`${ar}${t.data}`},Fo="---",Vo="___";function jo(e,t){return`${e}${Fo}${t}`}function kl(e,t,n){return`${jo(e,t)}${Vo}${n}`}function xl(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const n=t[0],r=t[1],o=parseInt(t[2],10);if(isNaN(o))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${n}.${r}.${o+1}`}function bn({displayItemList:e,widgetCollections:t}){const n=new Set;let r=!1;const o=i=>{var s,l,a;if((s=i==null?void 0:i.rows)!=null&&s.length){for(const c of i.rows)if((l=c==null?void 0:c.columns)!=null&&l.length)for(const f of c.columns)f.collection&&o(f.collection.collectionRows),!(!f.type||f.type===wn.DroppableBox)&&(cr(f.type)||(!((a=f.libraryId)!=null&&a.length)||f.libraryId===_t?r=!0:n.add(f.libraryId)))}};o(e);for(const i of Object.values(t??{}))o(i==null?void 0:i.collectionRows);return{libraryIds:Array.from(n),usesDefaultLibrary:r}}const dr=Symbol("rulecms-widget-context");function Rl(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:Yt()}}function Ll(e,t){Re(t,!0);const n=lt(Rl());er(()=>{n.token=t.token,n.endpoint=t.endpoint,n.libraries=t.libraries}),Fn.setContext(dr,n);var r=se(),o=re(r);or(o,()=>t.children),W(e,r),Le()}const Bo="1200px",pr="500px",hr="820px",Ml=Bo,Uo="rulecms",Nl=1920,Ol={f:"auto",q:"auto",c:"limit"},Wl=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,Fl=300,Vl=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,jl=100,Bl=/^https:\/\/[^\s"'()\\<>]+$/,Ul=2e3,Kl=/^[A-Za-z0-9_,.:\-/]*$/,Hl=300,Ko=e=>typeof e=="string"&&e.length<=Fl&&Wl.test(e),Ho=e=>typeof e=="string"&&e.length<=jl&&Vl.test(e),Yo=e=>typeof e=="string"&&e.length<=Ul&&Bl.test(e),Go=e=>typeof e=="string"&&e.length<=Hl&&Kl.test(e),Yl=e=>Object.entries(e).map(([t,n])=>`${t}_${n}`).join(","),Gl=e=>{const t={};for(const n of e.split(",")){const r=n.trim(),o=r.indexOf("_");o<=0||(t[r.slice(0,o)]=r.slice(o+1))}return t},zo=({publicId:e,cloudName:t=Uo,transformations:n,width:r=Nl})=>{const o=typeof n=="string"?Gl(n):n,i={...Ol,...o,w:r};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${Yl(i)}/${e}`)},qo=/^--[A-Za-z0-9_-]+$/,Xo=200,gr=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=Xo&&qo.test(t)},be=e=>`var(${e.trim()})`,U=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return gr(t)?t.trim():void 0},Ie=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!gr(t)},zl=(e,t)=>{const n=U(e);return n?{[t]:be(n)}:void 0},Zo=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||Ie(e))return!1;if(U(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?Yo(t.url):t.source==="cloudinary"?!Ko(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!Ho(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||Go(t.transformations):!1},Jo=["px","%","em","rem","vh","vw"],Cn=["inherit","unset"],Qo=["allSides","top","right","bottom","left"],Qe=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return Ie(e)?!1:U(e)?!0:n.unit==="auto"?t.allowAuto!==!1:n.unit==="keyword"?t.allowKeywords!==!1&&Cn.includes(n.keyword):Jo.includes(n.unit)?typeof n.value!="number"||!Number.isFinite(n.value)?!1:t.allowNegative!==!1||n.value>=0:!1},$o=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;for(const r of Qo){const o=n[r];if(o!=null&&!Qe(o,t))return!1}return!0},ql=[...Cn,"transparent","currentColor"],Xl=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,An=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Ie(e)?!1:U(e)?!0:t.unit==="keyword"?ql.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&Xl.test(t.value.trim()):!1},Sn=e=>{const t=U(e);return t?be(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},ei=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Ie(e)&&!!U(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Cn.includes(e),ti=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],ni=["normal","bold","100","200","300","400","500","600","700","800","900"],ri=["normal","italic","oblique"],oi=["left","center","right","justify","start","end"],ii=["none","underline","line-through","overline"],si=["none","uppercase","lowercase","capitalize"],en=["visible","hidden","scroll","auto","clip"],li=["flex-start","flex-end","center","space-between","space-around","space-evenly"],ai=["flex-start","flex-end","center","baseline","stretch"],ui=["wrap","nowrap"],ci=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],fi=["row","row-reverse","column","column-reverse"],di=["cover","contain","auto"],pi=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],hi=["no-repeat","repeat","repeat-x","repeat-y","space","round"],gi=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],vi=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],mi=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Ie(e)&&!!U(e):vi.includes(e),yi=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Ie(e)?!1:U(e)?!0:!(t.width!==void 0&&t.width!==null&&!Qe(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!mi(t.style)||t.color!==void 0&&t.color!==null&&!An(t.color))},Zl={allowAuto:!1,allowKeywords:!1,allowNegative:!0},Jl={allowAuto:!1,allowKeywords:!1,allowNegative:!1},_i=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(Ie(e))return!1;if(U(e))return!0;for(const n of["offsetX","offsetY","spread"]){const r=t[n];if(r!=null&&!Qe(r,Zl))return!1}return!(t.blur!==void 0&&t.blur!==null&&!Qe(t.blur,Jl)||t.color!==void 0&&t.color!==null&&!An(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},wi=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,bi=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Ie(e)?!1:U(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:Qe(e,{allowAuto:!1,allowNegative:!1})},Ci=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Ie(e)&&!!U(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,Ai=e=>{if(!Zo(e))return{};const t=U(e);if(t)return{backgroundImage:be(t)};const n=e;return n.source==="none"?{backgroundImage:"none"}:n.source==="url"?{backgroundImage:`url("${n.url}")`}:{backgroundImage:`url("${zo({publicId:n.publicId,cloudName:n.cloudName,transformations:n.transformations})}")`}},$e=e=>{const t=U(e);return t?be(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},Si=e=>{if(!yi(e))return{};const t=U(e);if(t)return{border:be(t)};const n={};if(e.width&&(n.borderWidth=$e(e.width)),e.style){const r=U(e.style);n.borderStyle=r?be(r):e.style}return e.color&&(n.borderColor=Sn(e.color)),n},Xt=e=>e?$e(e):"0px",Ei=e=>{if(!_i(e)||!wi(e))return{};const t=U(e);if(t)return{boxShadow:be(t)};const n=[Xt(e.offsetX),Xt(e.offsetY),Xt(e.blur),Xt(e.spread)];return e.color&&n.push(Sn(e.color)),e.inset&&n.unshift("inset"),{boxShadow:n.join(" ")}},Ql=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,Ii=(e,t)=>{if(!$o(e))return{};if(e.allSides)return{[t]:$e(e.allSides)};const n={};for(const r of["top","right","bottom","left"]){const o=e[r];o&&(n[`${t}${Ql(r)}`]=$e(o))}return n},Ti=(e,t)=>An(e)?{[t]:Sn(e)}:{},Di=(e,t,n)=>{if(!ei(e,n))return{};const r=U(e);return r?{[t]:be(r)}:{[t]:e}},Pi=(e,t,n={})=>Qe(e,n)?{[t]:$e(e)}:{},ki=e=>{if(!bi(e))return{};const t=U(e);return t?{lineHeight:be(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:$e(e)}},xi=e=>{if(!Ci(e))return{};const t=U(e);return t?{opacity:be(t)}:{opacity:e}},En={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:li},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:ai},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:ui},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:ci},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:fi},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:en},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:en},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:en},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:di},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:pi},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:hi},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:ti},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:ni},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:ri},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:oi},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:ii},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:si}},Ri=(e,t)=>{const n=En[e];if(!n)return{};switch(n.kind){case"boxSpacing":return Ii(t,n.cssProperty);case"length":return Pi(t,n.cssProperty,n.capabilities);case"border":return Si(t);case"boxShadow":return Ei(t);case"color":return Ti(t,n.cssProperty);case"opacity":return xi(t);case"enum":return Di(t,n.cssProperty,n.allowedValues);case"lineHeight":return ki(t);case"backgroundImage":return Ai(t);default:return{}}},$l=Object.fromEntries(Object.entries(En).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),ea=e=>e!=null&&e!=="",Li=e=>e?!gi.some(n=>ea(e[n]))||e.display==="flex"?e:{...e,display:"flex"}:{},Mi=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:n})=>{if(!(e!=null&&e.length))return;const r=n.components[sr(t,e)];if(!r||!("defaultAttributeValues"in r))return;const i=r.defaultAttributeValues;if(i!=null&&i.length)return i.reduce((s,l)=>({...s,[l.name]:l.defaultValues}),{})},et=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const n={},r={};for(const[o,i]of Object.entries(t)){if(!o.includes("3-resolutions")||!i)continue;const s=i.all,l=s??i[e.toLowerCase()];r[o]=l,En[o]&&Object.assign(n,Ri(o,l))}return Object.keys(n).length||Object.keys(r).length?{styles:Object.keys(n).length?n:void 0,componentAttributesSpecificToDeviceType:Object.keys(r).length?r:void 0}:void 0},Ni=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function Pt(e){return e.componentAttributes??e.widgetAttributes}function Gn({col:e,deviceDisplayType:t,isComposeMode:n,sourceComponentsPlugin:r}){const o=Pt(e),i=Mi({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:r})||[],s=Ni({defaultAttributes:i,userModifiedAttributes:o}),{styles:l,componentAttributesSpecificToDeviceType:a}=et({deviceDisplayType:t,componentAttributes:s})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let c={};const f={};if(l)for(const[u,d]of Object.entries(l))n&&f[u]||(c={...c,[u]:d});let h=Pt(e);for(const u in a)if(u.includes("3-resolutions")){h={...Pt(e)||{},...a||{}};break}return{componentAttributesBasedOnDevice:h,componentStyles:Li(c)}}const Oi=e=>{const t=(e==null?void 0:e.rows)||[];for(const n of t)if(((n==null?void 0:n.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},Wi="var(--sl-spacing-x-small)";function Fi(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function Vi({row:e,deviceDisplayType:t}){var r;const n=et({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r["hide-component-3-resolutions"])==="true"}function ji({row:e,deviceDisplayType:t,isComposeMode:n}){var d;const r=((d=et({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:d.styles)||{},o=r.justifyContent??e.horizontalAlignment??Yn.Center,i=r.alignItems??e.verticalAlignment??Yn.Center,s=r.flexDirection??"row",l=r.gap??e.gap??Wi,a=n?"nowrap":r.flexWrap??e.flexWrap??"nowrap",c=r.alignContent??e.alignContent??void 0,f=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),h={};for(const[m,y]of Object.entries(r))f.has(m)||(h[m]=y);const u={display:"flex",flexDirection:s,gap:l,flexWrap:a,justifyContent:o,alignItems:i,...h};return c!==void 0&&(u.alignContent=c),u}const In="css-classes-3-resolutions",ta=500,na=/[\x00-\x1f\x7f]/g,Tn=e=>{if(typeof e!="string")return;const t=new Set,n=[];for(const o of e.split(/\s+/)){const i=o.replace(na,"");i&&(t.has(i)||(t.add(i),n.push(i)))}if(!n.length)return;let r="";for(const o of n){const i=r?`${r} ${o}`:o;if(i.length>ta)break;r=i}return r.length?r:void 0},vr="hide-component-3-resolutions",Bi=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",vr],ra=new Set(Bi);function Ui({containerAttributes:e,deviceDisplayType:t}){var r;const n=et({deviceDisplayType:t,componentAttributes:e});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r[vr])==="true"}function Ki({containerAttributes:e,deviceDisplayType:t,isComposeMode:n}){var i;if(!e)return{styles:{}};const r=n?Object.fromEntries(Object.entries(e).filter(([s])=>!ra.has(s))):e,o=et({deviceDisplayType:t,componentAttributes:r});return{styles:(o==null?void 0:o.styles)??{},cssClasses:Tn((i=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:i[In])}}function Hi(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function te(e){if(!e)return;const t=[];for(const[n,r]of Object.entries(e)){if(r==null||r==="")continue;const o=n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t.push(`${o}: ${r}`)}return t.length>0?t.join("; "):void 0}const Dn="/";function Yi({componentProps:e,ancestorColumnIds:t,columnId:n}){if(!e||!n)return;const r=[...t??[],n];for(let o=0;o<r.length;o+=1){const i=r.slice(o).join(Dn),s=e[i];if(s)return s}}function Gi({displayItemList:e,widgetCollections:t}){const n=[],r=(o,i)=>{var s;if((s=o==null?void 0:o.rows)!=null&&s.length)for(const l of o.rows)for(const a of l.columns){if(!a.id||a.type===wn.DroppableBox)continue;const c=fr(a.type);if(c!=null&&c.length){const f=a.collection??(t==null?void 0:t[c]);f&&!i.includes(a.id)&&r(f.collectionRows,[...i,a.id]);continue}n.push([...i,a.id].join(Dn))}};return r(e,[]),n}function oa(e,t){const n=`${Dn}${e}`;return t.some(r=>r===e||r.endsWith(n))}function zi({componentProps:e,displayItemList:t,widgetCollections:n}){const r=e?Object.keys(e):[];if(!r.length)return[];const o=Gi({displayItemList:t,widgetCollections:n});return r.filter(i=>!oa(i,o))}function qi({componentProps:e,displayItemList:t,widgetCollections:n,publishedKey:r}){if(process.env.NODE_ENV==="production")return;const o=zi({componentProps:e,displayItemList:t,widgetCollections:n});o.length&&console.warn(`RuleCMSWidget "${r}": componentProps ${o.map(i=>`"${i}"`).join(", ")} ${o.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function ia(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sa(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,n=e.tablet,r=e.desktop;return t!==n||t!==r||n!==r}function xr(e){var t;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;for(const n of e.rows){if(Rr(n.rowAttributes))return!0;for(const r of n.columns)if(Rr(Pt(r)))return!0}return!1}function Rr(e){if(!e)return!1;for(const[t,n]of Object.entries(e))if(!(!t.includes("3-resolutions")||!ia(n))){if(t==="hide-component-3-resolutions"){const r=n,o=i=>i==="true"||i===!0;if(o(r.phone)!==o(r.tablet)||o(r.phone)!==o(r.desktop))return!0;continue}if(sa(n))return!0}return!1}function Xi(e,t){if(xr(e))return!0;for(const n of Object.values(t))if(xr(n.collectionRows))return!0;return!1}const Zi=parseInt(pr,10),Ji=parseInt(hr,10),la=Zi+1,aa=Ji+1;function ua(e){const t=`.${e}-phone`,n=`.${e}-tablet`,r=`.${e}-desktop`;return`
|
|
1
|
+
"use strict";var Ss=Object.defineProperty;var Lr=e=>{throw TypeError(e)};var Es=(e,t,n)=>t in e?Ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>Es(e,typeof t!="symbol"?t+"":t,n),On=(e,t,n)=>t.has(e)||Lr("Cannot "+n);var v=(e,t,n)=>(On(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?Lr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),J=(e,t,n,r)=>(On(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),j=(e,t,n)=>(On(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zn=require("svelte"),Ts="5";var to;typeof window<"u"&&((to=window.__svelte??(window.__svelte={})).v??(to.v=new Set)).add(Ts);const Is=1,Ds=2,oo=4,Ps=8,ks=16,Ls=1,Rs=2,B=Symbol("uninitialized"),io="http://www.w3.org/1999/xhtml",xs="http://www.w3.org/2000/svg",Ms="@attach",so=!1;var tr=Array.isArray,Ns=Array.prototype.indexOf,fn=Array.prototype.includes,nr=Array.from,Os=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,Ws=Object.getOwnPropertyDescriptors,Fs=Object.prototype,Vs=Array.prototype,lo=Object.getPrototypeOf;function It(e){return typeof e=="function"}const js=()=>{};function Bs(e){for(var t=0;t<e.length;t++)e[t]()}function ao(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}const G=2,wt=4,rr=8,or=1<<24,be=16,pe=32,Be=64,Us=128,ue=512,H=1024,U=2048,we=4096,Z=8192,ce=16384,Et=32768,Rr=1<<25,Ue=65536,dn=1<<17,Ks=1<<18,Sn=1<<19,Hs=1<<20,Ee=1<<25,$e=65536,pn=1<<21,dt=1<<22,Ve=1<<23,pt=Symbol("$state"),Gs=Symbol("legacy props"),Ys=Symbol(""),Wn=Symbol("attributes"),xr=Symbol("class"),Mr=Symbol("style"),rn=Symbol("text"),Xt=new class extends Error{constructor(){super(...arguments);ge(this,"name","StaleReactionError");ge(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var no;const ir=!!((no=globalThis.document)!=null&&no.contentType)&&globalThis.document.contentType.includes("xml");function zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function qs(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Xs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Js(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Qs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $s(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function el(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function tl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function nl(){console.warn("https://svelte.dev/e/derived_inert")}function rl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function uo(e){return e===this.v}function ol(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function co(e){return!ol(e,this.v)}let il=!1,fe=null;function hn(e){fe=e}function Me(e,t=!1,n){fe={p:fe,i:!1,c:null,e:null,s:e,x:null,r:R,l:null}}function Ne(e){var t=fe,n=t.e;if(n!==null){t.e=null;for(var r of n)Do(r)}return t.i=!0,fe=t.p,{}}function fo(){return!0}let ut=[];function sl(){var e=ut;ut=[],Bs(e)}function Vt(e){if(ut.length===0){var t=ut;queueMicrotask(()=>{t===ut&&sl()})}ut.push(e)}function ll(e){var t=R;if(t===null)return k.f|=Ve,e;if((t.f&Et)===0&&(t.f&wt)===0)throw e;gn(e,t)}function gn(e,t){if(!(t!==null&&(t.f&ce)!==0)){for(;t!==null;){if((t.f&Us)!==0){if((t.f&Et)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}const al=-7169;function V(e,t){e.f=e.f&al|t}function sr(e){(e.f&ue)!==0||e.deps===null?V(e,H):V(e,we)}function po(e){if(e!==null)for(const t of e)(t.f&G)===0||(t.f&$e)===0||(t.f^=$e,po(t.deps))}function ul(e,t,n){(e.f&U)!==0?t.add(e):(e.f&we)!==0&&n.add(e),po(e.deps),V(e,H)}function cl(e,t){if(t){const n=document.body;e.autofocus=!0,Vt(()=>{document.activeElement===n&&e.focus()})}}function Zt(e){var t=k,n=R;Ie(null),He(null);try{return e()}finally{Ie(t),He(n)}}function ho(e,t,n,r){const o=lr;var i=e.filter(d=>!d.settled),s=t.map(o);if(n.length===0&&i.length===0){r(s);return}var l=R,u=fl(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function f(d){if((l.f&ce)===0){u();try{r([...s,...d])}catch(y){gn(y,l)}vn()}}var p=go();if(n.length===0){c.then(()=>f([])).finally(p);return}function a(){Promise.all(n.map(d=>dl(d))).then(f).catch(d=>gn(d,l)).finally(p)}c?c.then(()=>{u(),a(),vn()}):a()}function fl(){var e=R,t=k,n=fe,r=L;return function(i=!0){He(e),Ie(t),hn(n),i&&(e.f&ce)===0&&(r==null||r.activate(),r==null||r.apply())}}function vn(e=!0){He(null),Ie(null),hn(null),e&&(L==null||L.deactivate())}function go(){var e=R,t=e.b,n=L,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}function lr(e){var t=G|U;return R!==null&&(R.f|=Sn),{ctx:fe,deps:null,effects:null,equals:uo,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:R,ac:null}}const Lt=Symbol("obsolete");function dl(e,t,n){let r=R;r===null&&zs();var o=void 0,i=Bt(B),s=!k,l=new Set;return Dl(()=>{var d,y;var u=R,c=ao();o=c.promise;try{Promise.resolve(e()).then(c.resolve,m=>{m!==Xt&&c.reject(m)}).finally(vn)}catch(m){c.reject(m),vn()}var f=L;if(s){if((u.f&Et)!==0)var p=go();if((d=r.b)!=null&&d.is_rendered())(y=f.async_deriveds.get(u))==null||y.reject(Lt);else for(const m of l.values())m.reject(Lt);l.add(c),f.async_deriveds.set(u,c)}const a=(m,h=void 0)=>{p==null||p(),l.delete(c),h!==Lt&&(f.activate(),h?(i.f|=Ve,Ut(i,h)):((i.f&Ve)!==0&&(i.f^=Ve),Ut(i,m)),f.deactivate())};c.promise.then(a,m=>a(null,m||"unknown"))}),fr(()=>{for(const u of l)u.reject(Lt)}),new Promise(u=>{function c(f){function p(){f===o?u(i):c(o)}f.then(p,p)}c(o)})}function D(e){const t=lr(e);return Oo(t),t}function pl(e){const t=lr(e);return t.equals=co,t}function hl(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)de(t[n])}}function ar(e){var t,n=R,r=e.parent;if(!Ke&&r!==null&&e.v!==B&&(r.f&(ce|Z))!==0)return nl(),e.v;He(r);try{e.f&=~$e,hl(e),t=jo(e)}finally{He(n)}return t}function vo(e){var t=ar(e);if(!e.equals(t)&&(e.wv=Fo(),(!(L!=null&&L.is_fork)||e.deps===null)&&(L!==null?(L.capture(e,t,!0),Wt==null||Wt.capture(e,t,!0)):e.v=t,e.deps===null))){V(e,H);return}Ke||(z!==null?(Io()||L!=null&&L.is_fork)&&z.set(e,t):sr(e))}function gl(e){var t;if(e.effects!==null)for(const n of e.effects)(n.teardown||n.ac)&&((t=n.teardown)==null||t.call(n),n.ac!==null&&Zt(()=>{n.ac.abort(Xt),n.ac=null}),n.fn!==null&&(n.teardown=js),Kt(n,0),pr(n))}function yo(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&At(t)}let Fn=null,lt=null,L=null,Wt=null,z=null,qn=null,Vn=!1,ct=null,sn=null;var Nr=0;let vl=1;var gt,We,qe,vt,yt,mt,Re,_t,Q,Yt,xe,ye,Ae,bt,Xe,x,Xn,Rt,Zn,mo,_o,at,yl,xt;const Cn=class Cn{constructor(){F(this,x);ge(this,"id",vl++);F(this,gt,!1);ge(this,"linked",!0);F(this,We,null);F(this,qe,null);ge(this,"async_deriveds",new Map);ge(this,"current",new Map);ge(this,"previous",new Map);F(this,vt,new Set);F(this,yt,new Set);F(this,mt,0);F(this,Re,new Map);F(this,_t,null);F(this,Q,[]);F(this,Yt,[]);F(this,xe,new Set);F(this,ye,new Set);F(this,Ae,new Map);F(this,bt,new Set);ge(this,"is_fork",!1);F(this,Xe,!1);lt===null?Fn=lt=this:(J(lt,qe,this),J(this,We,lt)),lt=this}skip_effect(t){v(this,Ae).has(t)||v(this,Ae).set(t,{d:[],m:[]}),v(this,bt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=v(this,Ae).get(t);if(r){v(this,Ae).delete(t);for(var o of r.d)V(o,U),n(o);for(o of r.m)V(o,we),n(o)}v(this,bt).add(t)}capture(t,n,r=!1){t.v!==B&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&Ve)===0&&(this.current.set(t,[n,r]),z==null||z.set(t,n)),this.is_fork||(t.v=n)}activate(){L=this}deactivate(){L=null,z=null}flush(){try{Vn=!0,L=this,j(this,x,Rt).call(this)}finally{Nr=0,qn=null,ct=null,sn=null,Vn=!1,L=null,z=null,Je.clear()}}discard(){var t;for(const n of v(this,yt))n(this);v(this,yt).clear();for(const n of this.async_deriveds.values())n.reject(Lt);j(this,x,xt).call(this),(t=v(this,_t))==null||t.resolve()}register_created_effect(t){v(this,Yt).push(t)}increment(t,n){if(J(this,mt,v(this,mt)+1),t){let r=v(this,Re).get(n)??0;v(this,Re).set(n,r+1)}}decrement(t,n){if(J(this,mt,v(this,mt)-1),t){let r=v(this,Re).get(n)??0;r===1?v(this,Re).delete(n):v(this,Re).set(n,r-1)}v(this,Xe)||(J(this,Xe,!0),Vt(()=>{J(this,Xe,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)v(this,xe).add(r);for(const r of n)v(this,ye).add(r);t.clear(),n.clear()}oncommit(t){v(this,vt).add(t)}ondiscard(t){v(this,yt).add(t)}settled(){return(v(this,_t)??J(this,_t,ao())).promise}static ensure(){if(L===null){const t=L=new Cn;Vn||Vt(()=>{v(t,gt)||t.flush()})}return L}apply(){{z=null;return}}schedule(t){var o;if(qn=t,(o=t.b)!=null&&o.is_pending&&(t.f&(wt|rr|or))!==0&&(t.f&Et)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(ct!==null&&n===R&&(k===null||(k.f&G)===0))return;if((r&(Be|pe))!==0){if((r&H)===0)return;n.f^=H}}v(this,Q).push(n)}};gt=new WeakMap,We=new WeakMap,qe=new WeakMap,vt=new WeakMap,yt=new WeakMap,mt=new WeakMap,Re=new WeakMap,_t=new WeakMap,Q=new WeakMap,Yt=new WeakMap,xe=new WeakMap,ye=new WeakMap,Ae=new WeakMap,bt=new WeakMap,Xe=new WeakMap,x=new WeakSet,Xn=function(){if(this.is_fork)return!0;for(const r of v(this,Re).keys()){for(var t=r,n=!1;t.parent!==null;){if(v(this,Ae).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},Rt=function(){var u,c,f,p;J(this,gt,!0),Nr++>1e3&&(j(this,x,xt).call(this),ml());for(const a of v(this,xe))v(this,ye).delete(a),V(a,U),this.schedule(a);for(const a of v(this,ye))V(a,we),this.schedule(a);const t=v(this,Q);J(this,Q,[]),this.apply();var n=ct=[],r=[],o=sn=[];for(const a of t)try{j(this,x,Zn).call(this,a,n,r)}catch(d){throw Co(a),j(this,x,Xn).call(this)||this.discard(),d}if(L=null,o.length>0){var i=Cn.ensure();for(const a of o)i.schedule(a)}if(ct=null,sn=null,j(this,x,Xn).call(this)){j(this,x,at).call(this,r),j(this,x,at).call(this,n);for(const[a,d]of v(this,Ae))wo(a,d);o.length>0&&j(u=L,x,Rt).call(u);return}const s=j(this,x,mo).call(this);if(s){j(this,x,at).call(this,r),j(this,x,at).call(this,n),j(c=s,x,_o).call(c,this);return}v(this,xe).clear(),v(this,ye).clear();for(const a of v(this,vt))a(this);v(this,vt).clear(),Wt=this,Or(r),Or(n),Wt=null,(f=v(this,_t))==null||f.resolve();var l=L;if(v(this,mt)===0&&(v(this,Q).length===0||l!==null)&&j(this,x,xt).call(this),v(this,Q).length>0)if(l!==null){const a=l;v(a,Q).push(...v(this,Q).filter(d=>!v(a,Q).includes(d)))}else l=this;l!==null&&j(p=l,x,Rt).call(p)},Zn=function(t,n,r){t.f^=H;for(var o=t.first;o!==null;){var i=o.f,s=(i&(pe|Be))!==0,l=s&&(i&H)!==0,u=l||(i&Z)!==0||v(this,Ae).has(o);if(!u&&o.fn!==null){s?o.f^=H:(i&wt)!==0?n.push(o):$t(o)&&((i&be)!==0&&v(this,ye).add(o),At(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var f=o.next;if(f!==null){o=f;break}o=o.parent}}},mo=function(){for(var t=v(this,We);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=v(t,We)}return null},_o=function(t){var r;for(const[o,i]of t.current)!this.previous.has(o)&&t.previous.has(o)&&this.previous.set(o,t.previous.get(o)),this.current.set(o,i);for(const[o,i]of t.async_deriveds){const s=this.async_deriveds.get(o);s&&i.promise.then(s.resolve).catch(s.reject)}t.async_deriveds.clear(),this.transfer_effects(v(t,xe),v(t,ye));const n=o=>{var i=o.reactions;if(i!==null&&!((o.f&G)!==0&&(o.f&(U|we))===0))for(const u of i){var s=u.f;if((s&G)!==0)n(u);else{var l=u;s&(dt|be)&&!this.async_deriveds.has(l)&&(v(this,ye).delete(l),V(l,U),this.schedule(l))}}};for(const o of this.current.keys())n(o);this.oncommit(()=>t.discard()),j(r=t,x,xt).call(r),L=this,j(this,x,Rt).call(this)},at=function(t){for(var n=0;n<t.length;n+=1)ul(t[n],v(this,xe),v(this,ye))},yl=function(){var p;for(let a=Fn;a!==null;a=v(a,qe)){var t=a.id<this.id,n=[];for(const[d,[y,m]]of this.current){if(a.current.has(d)){var r=a.current.get(d)[0];if(t&&y!==r)a.current.set(d,[y,m]);else continue}n.push(d)}if(t)for(const[d,y]of this.async_deriveds){const m=a.async_deriveds.get(d);m&&y.promise.then(m.resolve).catch(m.reject)}var o=[...a.current.keys()].filter(d=>!a.current.get(d)[1]);if(!(!v(a,gt)||o.length===0)){var i=o.filter(d=>!this.current.has(d));if(i.length===0)t&&a.discard();else if(n.length>0){if(t)for(const d of v(this,bt))a.unskip_effect(d,y=>{var m;(y.f&(be|dt))!==0?a.schedule(y):j(m=a,x,at).call(m,[y])});a.activate();var s=new Set,l=new Map;for(var u of n)bo(u,i,s,l);l=new Map;var c=[...a.current].filter(([d,y])=>{const m=this.current.get(d);return m?m[0]!==y[0]||m[1]!==y[1]:!0}).map(([d])=>d);if(c.length>0)for(const d of v(this,Yt))(d.f&(ce|Z|dn))===0&&ur(d,c,l)&&((d.f&(dt|be))!==0?(V(d,U),a.schedule(d)):v(a,xe).add(d));if(v(a,Q).length>0&&!v(a,Xe)){a.apply();for(var f of v(a,Q))j(p=a,x,Zn).call(p,f,[],[]);J(a,Q,[])}a.deactivate()}}}},xt=function(){if(this.linked){var t=v(this,We),n=v(this,qe);t===null?Fn=n:J(t,qe,n),n===null?lt=t:J(n,We,t),this.linked=!1}};let jt=Cn;function ml(){try{Qs()}catch(e){gn(e,qn)}}let ve=null;function Or(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(ce|Z))===0&&$t(r)&&(ve=new Set,At(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Ro(r),(ve==null?void 0:ve.size)>0)){Je.clear();for(const o of ve){if((o.f&(ce|Z))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)ve.has(s)&&(ve.delete(s),i.push(s)),s=s.parent;for(let l=i.length-1;l>=0;l--){const u=i[l];(u.f&(ce|Z))===0&&At(u)}}ve.clear()}}ve=null}}function bo(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&G)!==0?bo(o,t,n,r):(i&(dt|be))!==0&&(i&U)===0&&ur(o,t,r)&&(V(o,U),cr(o))}}function ur(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const o of e.deps){if(fn.call(t,o))return!0;if((o.f&G)!==0&&ur(o,t,n))return n.set(o,!0),!0}return n.set(e,!1),!1}function cr(e){L.schedule(e)}function wo(e,t){if(!((e.f&pe)!==0&&(e.f&H)!==0)){(e.f&U)!==0?t.d.push(e):(e.f&we)!==0&&t.m.push(e),V(e,H);for(var n=e.first;n!==null;)wo(n,t),n=n.next}}function Co(e){V(e,H);for(var t=e.first;t!==null;)Co(t),t=t.next}let yn=new Set;const Je=new Map;let Ao=!1;function Bt(e,t){var n={f:0,v:e,reactions:null,equals:uo,rv:0,wv:0};return n}function oe(e,t){const n=Bt(e);return Oo(n),n}function _l(e,t=!1,n=!0){const r=Bt(e);return t||(r.equals=co),r}function W(e,t,n=!1){k!==null&&(!Fe||(k.f&dn)!==0)&&fo()&&(k.f&(G|be|dt|dn))!==0&&(Te===null||!Te.has(e))&&tl();let r=n?ft(t):t;return Ut(e,r,sn)}function Ut(e,t,n=null){if(!e.equals(t)){Je.set(e,Ke?t:e.v);var r=jt.ensure();if(r.capture(e,t),(e.f&G)!==0){const o=e;(e.f&U)!==0&&ar(o),z===null&&sr(o)}e.wv=Fo(),So(e,U,n),R!==null&&(R.f&H)!==0&&(R.f&(pe|Be))===0&&(se===null?Ll([e]):se.push(e)),!r.is_fork&&yn.size>0&&!Ao&&bl()}return t}function bl(){Ao=!1;for(const e of yn){(e.f&H)!==0&&V(e,we);let t;try{t=$t(e)}catch{t=!0}t&&At(e)}yn.clear()}function jn(e){W(e,e.v+1)}function So(e,t,n){var r=e.reactions;if(r!==null)for(var o=r.length,i=0;i<o;i++){var s=r[i],l=s.f,u=(l&U)===0;if(u&&V(s,t),(l&dn)!==0)yn.add(s);else if((l&G)!==0){var c=s;z==null||z.delete(c),(l&$e)===0&&(l&ue&&(R===null||(R.f&pn)===0)&&(s.f|=$e),So(c,we,n))}else if(u){var f=s;(l&be)!==0&&ve!==null&&ve.add(f),n!==null?n.push(f):cr(f)}}}function ft(e){if(typeof e!="object"||e===null||pt in e)return e;const t=lo(e);if(t!==Fs&&t!==Vs)return e;var n=new Map,r=tr(e),o=oe(0),i=Qe,s=l=>{if(Qe===i)return l();var u=k,c=Qe;Ie(null),Vr(i);var f=l();return Ie(u),Vr(c),f};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(l,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&$s();var f=n.get(u);return f===void 0?s(()=>{var p=oe(c.value);return n.set(u,p),p}):W(f,c.value,!0),!0},deleteProperty(l,u){var c=n.get(u);if(c===void 0){if(u in l){const f=s(()=>oe(B));n.set(u,f),jn(o)}}else W(c,B),jn(o);return!0},get(l,u,c){var d;if(u===pt)return e;var f=n.get(u),p=u in l;if(f===void 0&&(!p||(d=Ot(l,u))!=null&&d.writable)&&(f=s(()=>{var y=ft(p?l[u]:B),m=oe(y);return m}),n.set(u,f)),f!==void 0){var a=g(f);return a===B?void 0:a}return Reflect.get(l,u,c)},getOwnPropertyDescriptor(l,u){var c=Reflect.getOwnPropertyDescriptor(l,u);if(c&&"value"in c){var f=n.get(u);f&&(c.value=g(f))}else if(c===void 0){var p=n.get(u),a=p==null?void 0:p.v;if(p!==void 0&&a!==B)return{enumerable:!0,configurable:!0,value:a,writable:!0}}return c},has(l,u){var a;if(u===pt)return!0;var c=n.get(u),f=c!==void 0&&c.v!==B||Reflect.has(l,u);if(c!==void 0||R!==null&&(!f||(a=Ot(l,u))!=null&&a.writable)){c===void 0&&(c=s(()=>{var d=f?ft(l[u]):B,y=oe(d);return y}),n.set(u,c));var p=g(c);if(p===B)return!1}return f},set(l,u,c,f){var P;var p=n.get(u),a=u in l;if(r&&u==="length")for(var d=c;d<p.v;d+=1){var y=n.get(d+"");y!==void 0?W(y,B):d in l&&(y=s(()=>oe(B)),n.set(d+"",y))}if(p===void 0)(!a||(P=Ot(l,u))!=null&&P.writable)&&(p=s(()=>oe(void 0)),W(p,ft(c)),n.set(u,p));else{a=p.v!==B;var m=s(()=>ft(c));W(p,m)}var h=Reflect.getOwnPropertyDescriptor(l,u);if(h!=null&&h.set&&h.set.call(f,c),!a){if(r&&typeof u=="string"){var _=n.get("length"),A=Number(u);Number.isInteger(A)&&A>=_.v&&W(_,A+1)}jn(o)}return!0},ownKeys(l){g(o);var u=Reflect.ownKeys(l).filter(p=>{var a=n.get(p);return a===void 0||a.v!==B});for(var[c,f]of n)f.v!==B&&!(c in l)&&u.push(c);return u},setPrototypeOf(){el()}})}function Wr(e){try{if(e!==null&&typeof e=="object"&&pt in e)return e[pt]}catch{}return e}function wl(e,t){return Object.is(Wr(e),Wr(t))}var Cl,Al,Sl;function je(e=""){return document.createTextNode(e)}function mn(e){return Al.call(e)}function Jt(e){return Sl.call(e)}function _e(e,t){return mn(e)}function q(e,t=!1){{var n=mn(e);return n instanceof Comment&&n.data===""?Jt(n):n}}function Ct(e,t=1,n=!1){let r=e;for(;t--;)r=Jt(r);return r}function El(e){e.textContent=""}function Eo(){return!1}function To(e,t,n){return t==null||t===io?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Tl(e){R===null&&(k===null&&Js(),Zs()),Ke&&Xs()}function Il(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Ge(e,t){var n=R;n!==null&&(n.f&Z)!==0&&(e|=Z);var r={ctx:fe,deps:null,nodes:null,f:e|U|ue,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};L==null||L.register_created_effect(r);var o=r;if((e&wt)!==0)ct!==null?ct.push(r):jt.ensure().schedule(r);else if(t!==null){try{At(r)}catch(s){throw de(r),s}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&Sn)===0&&(o=o.first,(e&be)!==0&&(e&Ue)!==0&&o!==null&&(o.f|=Ue))}if(o!==null&&(o.parent=n,n!==null&&Il(o,n),k!==null&&(k.f&G)!==0&&(e&Be)===0)){var i=k;(i.effects??(i.effects=[])).push(o)}return r}function Io(){return k!==null&&!Fe}function fr(e){const t=Ge(rr,null);return V(t,H),t.teardown=e,t}function dr(e){Tl();var t=R.f,n=!k&&(t&pe)!==0&&fe!==null&&!fe.i;if(n){var r=fe;(r.e??(r.e=[])).push(e)}else return Do(e)}function Do(e){return Ge(wt|Hs,e)}function Po(e){return Ge(wt,e)}function Dl(e){return Ge(dt|Sn,e)}function le(e,t=[],n=[],r=[]){ho(r,t,n,o=>{Ge(rr,()=>{e(...o.map(g))})})}function Qt(e,t=0){var n=Ge(be|t,e);return n}function ko(e,t=0){var n=Ge(or|t,e);return n}function et(e){return Ge(pe|Sn,e)}function Lo(e){var t=e.teardown;if(t!==null){const n=Ke,r=k;Fr(!0),Ie(null);try{t.call(null)}finally{Fr(n),Ie(r)}}}function pr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const o=n.ac;o!==null&&Zt(()=>{o.abort(Xt)});var r=n.next;(n.f&Be)!==0?n.parent=null:de(n,t),n=r}}function Pl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&pe)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Ks)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(kl(e.nodes.start,e.nodes.end),n=!0),e.f|=Rr,pr(e,t&&!n),Kt(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Lo(e),e.f^=Rr,e.f|=ce;var o=e.parent;o!==null&&o.first!==null&&Ro(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:Jt(e);e.remove(),e=n}}function Ro(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 hr(e,t,n=!0){var r=[];xo(e,r,!0);var o=()=>{n&&de(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||o();for(var l of r)l.out(s)}else o()}function xo(e,t,n){if((e.f&Z)===0){e.f^=Z;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var o=e.first;o!==null;){var i=o.next;if((o.f&Be)===0){var s=(o.f&Ue)!==0||(o.f&pe)!==0&&(e.f&be)!==0;xo(o,t,s?n:!1)}o=i}}}function _n(e){Mo(e,!0)}function Mo(e,t){if((e.f&Z)!==0){e.f^=Z,(e.f&H)===0&&(V(e,U),jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Ue)!==0||(n.f&pe)!==0;Mo(n,o?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function No(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var o=n===r?null:Jt(n);t.append(n),n=o}}let ln=!1,Ke=!1;function Fr(e){Ke=e}let k=null,Fe=!1;function Ie(e){k=e}let R=null;function He(e){R=e}let Te=null;function Oo(e){k!==null&&(Te??(Te=new Set)).add(e)}let $=null,ee=0,se=null;function Ll(e){se=e}let Wo=1,Ye=0,Qe=Ye;function Vr(e){Qe=e}function Fo(){return++Wo}function $t(e){var t=e.f;if((t&U)!==0)return!0;if(t&G&&(e.f&=~$e),(t&we)!==0){for(var n=e.deps,r=n.length,o=0;o<r;o++){var i=n[o];if($t(i)&&vo(i),i.wv>e.wv)return!0}(t&ue)!==0&&z===null&&V(e,H)}return!1}function Vo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Te!==null&&Te.has(e)))for(var o=0;o<r.length;o++){var i=r[o];(i.f&G)!==0?Vo(i,t,!1):t===i&&(n?V(i,U):(i.f&H)!==0&&V(i,we),cr(i))}}function jo(e){var m;var t=$,n=ee,r=se,o=k,i=Te,s=fe,l=Fe,u=Qe,c=e.f;$=null,ee=0,se=null,k=(c&(pe|Be))===0?e:null,Te=null,hn(e.ctx),Fe=!1,Qe=++Ye,e.ac!==null&&(Zt(()=>{e.ac.abort(Xt)}),e.ac=null);try{e.f|=pn;var f=e.fn,p=f();e.f|=Et;var a=e.deps,d=L==null?void 0:L.is_fork;if($!==null){var y;if(d||Kt(e,ee),a!==null&&ee>0)for(a.length=ee+$.length,y=0;y<$.length;y++)a[ee+y]=$[y];else e.deps=a=$;if(Io()&&(e.f&ue)!==0)for(y=ee;y<a.length;y++)((m=a[y]).reactions??(m.reactions=[])).push(e)}else!d&&a!==null&&ee<a.length&&(Kt(e,ee),a.length=ee);if(fo()&&se!==null&&!Fe&&a!==null&&(e.f&(G|we|U))===0)for(y=0;y<se.length;y++)Vo(se[y],e);if(o!==null&&o!==e){if(Ye++,o.deps!==null)for(let h=0;h<n;h+=1)o.deps[h].rv=Ye;if(t!==null)for(const h of t)h.rv=Ye;se!==null&&(r===null?r=se:r.push(...se))}return(e.f&Ve)!==0&&(e.f^=Ve),p}catch(h){return ll(h)}finally{e.f^=pn,$=t,ee=n,se=r,k=o,Te=i,hn(s),Fe=l,Qe=u}}function Rl(e,t){let n=t.reactions;if(n!==null){var r=Ns.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}if(n===null&&(t.f&G)!==0&&($===null||!fn.call($,t))){var i=t;(i.f&ue)!==0&&(i.f^=ue,i.f&=~$e),i.v!==B&&sr(i),i.ac!==null&&Zt(()=>{i.ac.abort(Xt),i.ac=null,V(i,U)}),gl(i),Kt(i,0)}}function Kt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Rl(e,n[r])}function At(e){var t=e.f;if((t&ce)===0){V(e,H);var n=R,r=ln;R=e,ln=(t&(pe|Be))===0;try{(t&(be|or))!==0?Pl(e):pr(e),Lo(e);var o=jo(e);e.teardown=typeof o=="function"?o:null,e.wv=Wo;var i;so&&il&&(e.f&U)!==0&&e.deps}finally{ln=r,R=n}}}function g(e){var t=e.f,n=(t&G)!==0;if(k!==null&&!Fe){var r=R!==null&&(R.f&ce)!==0;if(!r&&(Te===null||!Te.has(e))){var o=k.deps;if((k.f&pn)!==0)e.rv<Ye&&(e.rv=Ye,$===null&&o!==null&&o[ee]===e?ee++:$===null?$=[e]:$.push(e));else{k.deps??(k.deps=[]),fn.call(k.deps,e)||k.deps.push(e);var i=e.reactions;i===null?e.reactions=[k]:fn.call(i,k)||i.push(k)}}}if(Ke&&Je.has(e))return Je.get(e);if(n){var s=e;if(Ke){var l=s.v;return((s.f&H)===0&&s.reactions!==null||Uo(s))&&(l=ar(s)),Je.set(s,l),l}var u=(s.f&ue)===0&&!Fe&&k!==null&&(ln||(k.f&ue)!==0),c=(s.f&Et)===0;$t(s)&&(u&&(s.f|=ue),vo(s)),u&&!c&&(yo(s),Bo(s))}if(z!=null&&z.has(e))return z.get(e);if((e.f&Ve)!==0)throw e.v;return e.v}function Bo(e){if(e.f|=ue,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&G)!==0&&(t.f&ue)===0&&(yo(t),Bo(t))}function Uo(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Je.has(t)||(t.f&G)!==0&&Uo(t))return!0;return!1}const ze=Symbol("events"),xl=new Set,Ml=new Set;function Nl(e,t,n,r={}){function o(i){if(r.capture||Fl.call(t,i),!i.cancelBubble)return Zt(()=>n==null?void 0:n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Vt(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function Ol(e,t,n){(t[ze]??(t[ze]={}))[e]=n}function Wl(e){for(var t=0;t<e.length;t++)xl.add(e[t]);for(var n of Ml)n(e)}let jr=null;function Fl(e){var m,h;var t=this,n=t.ownerDocument,r=e.type,o=((m=e.composedPath)==null?void 0:m.call(e))||[],i=o[0]||e.target;jr=e;var s=0,l=jr===e&&e[ze];if(l){var u=o.indexOf(l);if(u!==-1&&(t===document||t===window)){e[ze]=t;return}var c=o.indexOf(t);if(c===-1)return;u<=c&&(s=u)}if(i=o[s]||e.target,i!==t){Os(e,"currentTarget",{configurable:!0,get(){return i||n}});var f=k,p=R;Ie(null),He(null);try{for(var a,d=[];i!==null&&i!==t;){try{var y=(h=i[ze])==null?void 0:h[r];y!=null&&(!i.disabled||e.target===i)&&y.call(i,e)}catch(_){a?d.push(_):a=_}if(e.cancelBubble)break;s++,i=s<o.length?o[s]:null}if(a){for(let _ of d)queueMicrotask(()=>{throw _});throw a}}finally{e[ze]=t,delete e.currentTarget,Ie(f),He(p)}}}var ro;const Bn=((ro=globalThis==null?void 0:globalThis.window)==null?void 0:ro.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Vl(e){return(Bn==null?void 0:Bn.createHTML(e))??e}function jl(e){var t=To("template");return t.innerHTML=Vl(e.replaceAll("<!>","<!---->")),t.content}function Ht(e,t){var n=R;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Pe(e,t){var n=(t&Ls)!==0,r=(t&Rs)!==0,o,i=!e.startsWith("<!>");return()=>{o===void 0&&(o=jl(i?e:"<!>"+e),n||(o=mn(o)));var s=r||Cl?document.importNode(o,!0):o.cloneNode(!0);if(n){var l=mn(s),u=s.lastChild;Ht(l,u)}else Ht(s,s);return s}}function gr(e=""){{var t=je(e+"");return Ht(t,t),t}}function ie(){var e=document.createDocumentFragment(),t=document.createComment(""),n=je();return e.append(t,n),Ht(t,n),e}function M(e,t){e!==null&&e.before(t)}function Bl(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Ul=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Kl(e){return Ul.includes(e)}const Hl={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Gl(e){return e=e.toLowerCase(),Hl[e]??e}function En(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[rn]??(e[rn]=e.nodeValue))&&(e[rn]=n,e.nodeValue=`${n}`)}var me,Se,te,Ze,zt,qt,An;class Tn{constructor(t,n=!0){ge(this,"anchor");F(this,me,new Map);F(this,Se,new Map);F(this,te,new Map);F(this,Ze,new Set);F(this,zt,!0);F(this,qt,t=>{if(v(this,me).has(t)){var n=v(this,me).get(t),r=v(this,Se).get(n);if(r)_n(r),v(this,Ze).delete(n);else{var o=v(this,te).get(n);o&&(_n(o.effect),v(this,Se).set(n,o.effect),v(this,te).delete(n),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),r=o.effect)}for(const[i,s]of v(this,me)){if(v(this,me).delete(i),i===t)break;const l=v(this,te).get(s);l&&(de(l.effect),v(this,te).delete(s))}for(const[i,s]of v(this,Se)){if(i===n||v(this,Ze).has(i))continue;const l=()=>{if(Array.from(v(this,me).values()).includes(i)){var c=document.createDocumentFragment();No(s,c),c.append(je()),v(this,te).set(i,{effect:s,fragment:c})}else de(s);v(this,Ze).delete(i),v(this,Se).delete(i)};v(this,zt)||!r?(v(this,Ze).add(i),hr(s,l,!1)):l()}}});F(this,An,t=>{v(this,me).delete(t);const n=Array.from(v(this,me).values());for(const[r,o]of v(this,te))n.includes(r)||(de(o.effect),v(this,te).delete(r))});this.anchor=t,J(this,zt,n)}ensure(t,n){var r=L,o=Eo();if(n&&!v(this,Se).has(t)&&!v(this,te).has(t))if(o){var i=document.createDocumentFragment(),s=je();i.append(s),v(this,te).set(t,{effect:et(()=>n(s)),fragment:i})}else v(this,Se).set(t,et(()=>n(this.anchor)));if(v(this,me).set(r,t),o){for(const[l,u]of v(this,Se))l===t?r.unskip_effect(u):r.skip_effect(u);for(const[l,u]of v(this,te))l===t?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(v(this,qt)),r.ondiscard(v(this,An))}else v(this,qt).call(this,r)}}me=new WeakMap,Se=new WeakMap,te=new WeakMap,Ze=new WeakMap,zt=new WeakMap,qt=new WeakMap,An=new WeakMap;function vr(e,t,...n){var r=new Tn(e);Qt(()=>{const o=t()??null;r.ensure(o,o&&(i=>o(i,...n)))},Ue)}function De(e,t,n=!1){var r=new Tn(e),o=n?Ue:0;function i(s,l){r.ensure(s,l)}Qt(()=>{var s=!1;t((l,u=0)=>{s=!0,i(u,l)}),s||i(-1,null)},o)}function Yl(e,t,n){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let p=t[l];hr(p,()=>{if(i){if(i.pending.delete(p),i.done.add(p),i.pending.size===0){var a=e.outrogroups;Jn(e,nr(i.done)),a.delete(i),a.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var u=r.length===0&&n!==null&&e.pending.size===0;if(u){var c=n,f=c.parentNode;El(f),f.append(c),e.items.clear()}Jn(e,t,!u)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function Jn(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const s of e.pending.values())for(const l of s)r.add(e.items.get(l).e)}for(var o=0;o<t.length;o++){var i=t[o];if(r!=null&&r.has(i)){i.f|=Ee;const s=document.createDocumentFragment();No(i,s)}else de(t[o],n)}}var Br;function bn(e,t,n,r,o,i=null){var s=e,l=new Map,u=(t&oo)!==0;if(u){var c=e;s=c.appendChild(je())}var f=null,p=pl(()=>{var P=n();return tr(P)?P:P==null?[]:nr(P)}),a,d=new Map,y=!0;function m(P){(A.effect.f&ce)===0&&(A.pending.delete(P),A.fallback=f,zl(A,a,s,t,r),f!==null&&(a.length===0?(f.f&Ee)===0?_n(f):(f.f^=Ee,Mt(f,null,s)):hr(f,()=>{f=null})))}function h(P){A.pending.delete(P)}var _=Qt(()=>{a=g(p);for(var P=a.length,C=new Set,w=L,S=Eo(),E=0;E<P;E+=1){var b=a[E],I=r(b,E),T=y?null:l.get(I);T?(T.v&&Ut(T.v,b),T.i&&Ut(T.i,E),S&&w.unskip_effect(T.e)):(T=ql(l,y?s:Br??(Br=je()),b,I,E,o,t,n),y||(T.e.f|=Ee),l.set(I,T)),C.add(I)}if(P===0&&i&&!f&&(y?f=et(()=>i(s)):(f=et(()=>i(Br??(Br=je()))),f.f|=Ee)),P>C.size&&qs(),!y)if(d.set(w,C),S){for(const[N,Y]of l)C.has(N)||w.skip_effect(Y.e);w.oncommit(m),w.ondiscard(h)}else m(w);g(p)}),A={effect:_,items:l,pending:d,outrogroups:null,fallback:f};y=!1}function Dt(e){for(;e!==null&&(e.f&pe)===0;)e=e.next;return e}function zl(e,t,n,r,o){var T,N,Y,O,X,it,tn,Le,st;var i=(r&Ps)!==0,s=t.length,l=e.items,u=Dt(e.effect.first),c,f=null,p,a=[],d=[],y,m,h,_;if(i)for(_=0;_<s;_+=1)y=t[_],m=o(y,_),h=l.get(m).e,(h.f&Ee)===0&&((N=(T=h.nodes)==null?void 0:T.a)==null||N.measure(),(p??(p=new Set)).add(h));for(_=0;_<s;_+=1){if(y=t[_],m=o(y,_),h=l.get(m).e,e.outrogroups!==null)for(const he of e.outrogroups)he.pending.delete(h),he.done.delete(h);if((h.f&Z)!==0&&(_n(h),i&&((O=(Y=h.nodes)==null?void 0:Y.a)==null||O.unfix(),(p??(p=new Set)).delete(h))),(h.f&Ee)!==0)if(h.f^=Ee,h===u)Mt(h,null,n);else{var A=f?f.next:u;h===e.effect.last&&(e.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),Oe(e,f,h),Oe(e,h,A),Mt(h,A,n),f=h,a=[],d=[],u=Dt(f.next);continue}if(h!==u){if(c!==void 0&&c.has(h)){if(a.length<d.length){var P=d[0],C;f=P.prev;var w=a[0],S=a[a.length-1];for(C=0;C<a.length;C+=1)Mt(a[C],P,n);for(C=0;C<d.length;C+=1)c.delete(d[C]);Oe(e,w.prev,S.next),Oe(e,f,w),Oe(e,S,P),u=P,f=S,_-=1,a=[],d=[]}else c.delete(h),Mt(h,u,n),Oe(e,h.prev,h.next),Oe(e,h,f===null?e.effect.first:f.next),Oe(e,f,h),f=h;continue}for(a=[],d=[];u!==null&&u!==h;)(c??(c=new Set)).add(u),d.push(u),u=Dt(u.next);if(u===null)continue}(h.f&Ee)===0&&a.push(h),f=h,u=Dt(h.next)}if(e.outrogroups!==null){for(const he of e.outrogroups)he.pending.size===0&&(Jn(e,nr(he.done)),(X=e.outrogroups)==null||X.delete(he));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||c!==void 0){var E=[];if(c!==void 0)for(h of c)(h.f&Z)===0&&E.push(h);for(;u!==null;)(u.f&Z)===0&&u!==e.fallback&&E.push(u),u=Dt(u.next);var b=E.length;if(b>0){var I=(r&oo)!==0&&s===0?n:null;if(i){for(_=0;_<b;_+=1)(tn=(it=E[_].nodes)==null?void 0:it.a)==null||tn.measure();for(_=0;_<b;_+=1)(st=(Le=E[_].nodes)==null?void 0:Le.a)==null||st.fix()}Yl(e,E,I)}}i&&Vt(()=>{var he,nn;if(p!==void 0)for(h of p)(nn=(he=h.nodes)==null?void 0:he.a)==null||nn.apply()})}function ql(e,t,n,r,o,i,s,l){var u=(s&Is)!==0?(s&ks)===0?_l(n,!1,!1):Bt(n):null,c=(s&Ds)!==0?Bt(o):null;return{v:u,i:c,e:et(()=>(i(t,u??n,c??o,l),()=>{e.delete(r)}))}}function Mt(e,t,n){if(e.nodes)for(var r=e.nodes.start,o=e.nodes.end,i=t&&(t.f&Ee)===0?t.nodes.start:n;r!==null;){var s=Jt(r);if(i.before(r),r===o)return;r=s}}function Oe(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Un(e,t,n){var r=new Tn(e);Qt(()=>{var o=t()??null;r.ensure(o,o&&(i=>n(i,o)))},Ue)}function yr(e,t,n,r,o,i){var s=null,l=e,u=new Tn(l,!1);Qt(()=>{const c=t()||null;var f=c==="svg"?xs:void 0;if(c===null){u.ensure(null,null);return}return u.ensure(c,p=>{if(c){if(s=To(c,f),Ht(s,s),r){var a=null,d=s.appendChild(je());r(s,d),a==null||a.remove()}R.nodes.end=s,p.before(s)}}),()=>{}},Ue),fr(()=>{})}function Xl(e,t){var n=void 0,r;ko(()=>{n!==(n=t())&&(r&&(de(r),r=null),n&&(r=et(()=>{Po(()=>n(e))})))})}function Ko(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ko(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ko(e))&&(r&&(r+=" "),r+=t);return r}function Gt(e){return typeof e=="object"?Zl(e):e??""}const Ur=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Jl(e,t,n){var r=e==null?"":""+e;if(n){for(var o of Object.keys(n))if(n[o])r=r?r+" "+o:o;else if(r.length)for(var i=o.length,s=0;(s=r.indexOf(o,s))>=0;){var l=s+i;(s===0||Ur.includes(r[s-1]))&&(l===r.length||Ur.includes(r[l]))?r=(s===0?"":r.substring(0,s))+r.substring(l+1):s=l}}return r===""?null:r}function Kr(e,t=!1){var n=t?" !important;":";",r="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(r+=" "+o+": "+i+n)}return r}function Kn(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ql(e,t){if(t){var n="",r,o;if(Array.isArray(t)?(r=t[0],o=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,l=!1,u=[];r&&u.push(...Object.keys(r).map(Kn)),o&&u.push(...Object.keys(o).map(Kn));var c=0,f=-1;const m=e.length;for(var p=0;p<m;p++){var a=e[p];if(l?a==="/"&&e[p-1]==="*"&&(l=!1):i?i===a&&(i=!1):a==="/"&&e[p+1]==="*"?l=!0:a==='"'||a==="'"?i=a:a==="("?s++:a===")"&&s--,!l&&i===!1&&s===0){if(a===":"&&f===-1)f=p;else if(a===";"||p===m-1){if(f!==-1){var d=Kn(e.substring(c,f).trim());if(!u.includes(d)){a!==";"&&p++;var y=e.substring(c,p).trim();n+=" "+y+";"}}c=p+1,f=-1}}}}return r&&(n+=Kr(r)),o&&(n+=Kr(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function St(e,t,n,r,o,i){var s=e[xr];if(s!==n||s===void 0){var l=Jl(n,r,i);l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l),e[xr]=n}else if(i&&o!==i)for(var u in i){var c=!!i[u];(o==null||c!==!!o[u])&&e.classList.toggle(u,c)}return i}function Hn(e,t={},n,r){for(var o in n){var i=n[o];t[o]!==i&&(n[o]==null?e.style.removeProperty(o):e.style.setProperty(o,i,r))}}function ne(e,t,n,r){var o=e[Mr];if(o!==t){var i=Ql(t,r);i==null?e.removeAttribute("style"):e.style.cssText=i,e[Mr]=t}else r&&(Array.isArray(r)?(Hn(e,n==null?void 0:n[0],r[0]),Hn(e,n==null?void 0:n[1],r[1],"important")):Hn(e,n,r));return r}function Qn(e,t,n=!1){if(e.multiple){if(t==null)return;if(!tr(t))return rl();for(var r of e.options)r.selected=t.includes(Hr(r));return}for(r of e.options){var o=Hr(r);if(wl(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function $l(e){var t=new MutationObserver(()=>{"__value"in e&&Qn(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),fr(()=>{t.disconnect()})}function Hr(e){return"__value"in e?e.__value:e.value}const Pt=Symbol("class"),kt=Symbol("style"),Ho=Symbol("is custom element"),Go=Symbol("is html"),ea=ir?"input":"INPUT",ta=ir?"option":"OPTION",na=ir?"select":"SELECT";function ra(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ht(e,t,n,r){var o=Yo(e);o[t]!==(o[t]=n)&&(t==="loading"&&(e[Ys]=n),n==null?e.removeAttribute(t):typeof n!="string"&&zo(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function oa(e,t,n,r,o=!1,i=!1){var s=Yo(e),l=s[Ho],u=!s[Go],c=t||{},f=e.nodeName===ta;for(var p in t)p in n||(n[p]=null);n.class?n.class=Gt(n.class):n[Pt]&&(n.class=null),n[kt]&&(n.style??(n.style=null));var a=zo(e);if(e.nodeName===ea&&"type"in n&&("value"in n||"__value"in n)){var d=n.type;(d!==c.type||d===void 0&&e.hasAttribute("type"))&&(c.type=d,ht(e,"type",d))}for(const C in n){let w=n[C];if(f&&C==="value"&&w==null){e.value=e.__value="",c[C]=w;continue}if(C==="class"){var y=e.namespaceURI==="http://www.w3.org/1999/xhtml";St(e,y,w,r,t==null?void 0:t[Pt],n[Pt]),c[C]=w,c[Pt]=n[Pt];continue}if(C==="style"){ne(e,w,t==null?void 0:t[kt],n[kt]),c[C]=w,c[kt]=n[kt];continue}var m=c[C];if(!(w===m&&!(w===void 0&&e.hasAttribute(C)))){c[C]=w;var h=C[0]+C[1];if(h!=="$$")if(h==="on"){const S={},E="$$"+C;let b=C.slice(2);var _=Kl(b);if(Bl(b)&&(b=b.slice(0,-7),S.capture=!0),!_&&m){if(w!=null)continue;e.removeEventListener(b,c[E],S),c[E]=null}if(_)Ol(b,e,w),Wl([b]);else if(w!=null){let I=function(T){c[C].call(this,T)};c[E]=Nl(b,e,I,S)}}else if(C==="style")ht(e,C,w);else if(C==="autofocus")cl(e,!!w);else if(!l&&(C==="__value"||C==="value"&&w!=null))e.value=e.__value=w;else if(C==="selected"&&f)ra(e,w);else{var A=C;u||(A=Gl(A));var P=A==="defaultValue"||A==="defaultChecked";if(w==null&&!l&&!P)if(s[C]=null,A==="value"||A==="checked"){let S=e;const E=t===void 0;if(A==="value"){let b=S.defaultValue;S.removeAttribute(A),S.defaultValue=b,S.value=S.__value=E?b:null}else{let b=S.defaultChecked;S.removeAttribute(A),S.defaultChecked=b,S.checked=E?b:!1}}else e.removeAttribute(C);else P||a.includes(A)&&(l||typeof w!="string")?(e[A]=w,A in s&&(s[A]=B)):typeof w!="function"&&ht(e,A,w)}}}return c}function ia(e,t,n=[],r=[],o=[],i,s=!1,l=!1){ho(o,n,r,u=>{var c=void 0,f={},p=e.nodeName===na,a=!1;if(ko(()=>{var y=t(...u.map(g)),m=oa(e,c,y,i,s,l);a&&p&&"value"in y&&Qn(e,y.value);for(let _ of Object.getOwnPropertySymbols(f))y[_]||de(f[_]);for(let _ of Object.getOwnPropertySymbols(y)){var h=y[_];_.description===Ms&&(!c||h!==c[_])&&(f[_]&&de(f[_]),f[_]=et(()=>Xl(e,()=>h))),m[_]=h}c=m}),p){var d=e;Po(()=>{Qn(d,c.value,!0),$l(d)})}a=!0})}function Yo(e){return e[Wn]??(e[Wn]={[Ho]:e.nodeName.includes("-"),[Go]:e.namespaceURI===io})}var Gr=new Map;function zo(e){var t=e.getAttribute("is")||e.nodeName,n=Gr.get(t);if(n)return n;Gr.set(t,n=[]);for(var r,o=e,i=Element.prototype;i!==o;){r=Ws(o);for(var s in r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.push(s);o=lo(o)}return n}const sa={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(It(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];It(o)&&(o=o());const i=Ot(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(It(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Ot(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===pt||t===Gs)return!1;for(let n of e.props)if(It(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(It(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function Gn(...e){return new Proxy({props:e},sa)}function ae(e,t,n,r){var o=r,i=!0,s=()=>(i&&(i=!1,o=r),o),l;l=e[t],l===void 0&&r!==void 0&&(l=s());var u;return u=()=>{var c=e[t];return c===void 0?s():(i=!0,c)},u}const Tt="default";function mr(e,t){return!(e!=null&&e.length)||e===Tt?t:`${e}/${t}`}const la=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function Yr(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function aa(e){if(Yr(e))return e;const t=e;return Yr(t==null?void 0:t.default)?t.default:null}function Yn(e){return e.usesDefaultLibrary?[Tt,...e.libraryIds]:[...e.libraryIds]}function zr({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[Tt]))throw new Error(la)}function ua(e){const t=[],n=new Set;for(const r of e.values()){if(typeof r.stylesheet!="string")continue;const o=r.stylesheet.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function qo(e){const t={};for(const[r,o]of e){const i=r===Tt;for(const[s,l]of Object.entries(o.components))t[i?s:`${r}/${s}`]=l}const n=ua(e);return n?{components:t,stylesheets:n}:{components:t}}function en(){const e=new Map,t=new Map,n=new Map,r=new Map;let o=0;function i(c,f){var p;e.get(c)!==f&&((p=f.manifest)!=null&&p.id&&f.manifest.id!==c&&console.warn(`RuleCMS widget: component library registered as "${c}" declares manifest id "${f.manifest.id}". The registered id wins for resolution.`),e.set(c,f),o+=1)}function s(c){const f=Yn(c),p=[...f].sort().join("|"),a=r.get(p);if(a&&a.loadedVersion===o)return a.plugin;const d=new Map;for(const m of f){const h=e.get(m);h&&d.set(m,h)}const y=qo(d);return r.set(p,{loadedVersion:o,plugin:y}),y}function l(c){zr(c);const{registrations:f,referenced:p}=c;for(const a of Yn(p)){if(e.has(a)||n.has(a))continue;const d=f==null?void 0:f[a];if(!d){console.error(`RuleCMS widget: no component library registered for libraryId "${a}"; its components will not render.`),n.set(a,new Error(`No registration for libraryId "${a}"`));continue}if(typeof d=="function")return null;i(a,d)}return s(p)}async function u(c){zr(c);const{registrations:f,referenced:p}=c,a=Yn(p);return await Promise.all(a.map(async d=>{if(e.has(d)||n.has(d))return;const y=f==null?void 0:f[d];if(!y){console.error(`RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`),n.set(d,new Error(`No registration for libraryId "${d}"`));return}if(typeof y!="function"){i(d,y);return}let m=t.get(d);m||(m=y().then(h=>{const _=aa(h);if(!_)throw new Error(`Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);i(d,_)}).catch(h=>{n.set(d,h),console.error(`RuleCMS widget: failed to load component library "${d}":`,h)}).finally(()=>{t.delete(d)}),t.set(d,m)),await m})),s(p)}return{resolveSync:l,resolve:u}}const ca={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},In={DroppableBox:"droppable-box"},$n={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},fa={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},an="cssAttrArray",da={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},_r={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},br=`${_r.Collection}_`,Xo="dev.",Zo="https://rulecms.com",Jo="https://widget-cache.rulecms.com",Qo="/api/v1/c/widget/get",$o="/api/v1/c/dev/widget/get";function tt(e){return typeof e=="string"&&e.startsWith(Xo)}function ei(e,t){return t?t.replace(/\/$/,""):tt(e)?Zo:Jo}function wr({publishedKey:e,token:t,endpoint:n}){const r=tt(t),o=r?$o:Qo,i=r?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${ei(t,n)}${o}?${i.toString()}`}const pa=({id:e,prefix:t})=>`${t}_${e}`,ti=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return ni(e)},Cr=e=>e.includes("_"),ni=e=>{const t=e.indexOf("_"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:n,id:r}},Ar=e=>{if(!Cr(e))return;const n=ti(e);return(n==null?void 0:n.prefix)===_r.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),n==null?void 0:n.id},ha=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const n=t[0];if(!t[1].includes("@"))return{name:n,instanceId:t[1]};const o=t[1].split("@");return{name:n,instanceId:o[0],parentId:o[1]}},ga=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},ri=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.id)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${r}`}},oi=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.publishedKey)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${r}`}},va=e=>{const t=ri(e);return`${br}${t.data}`},ya=e=>{const t=oi(e);return`${br}${t.data}`},ii="---",si="___";function li(e,t){return`${e}${ii}${t}`}function ma(e,t,n){return`${li(e,t)}${si}${n}`}function _a(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const n=t[0],r=t[1],o=parseInt(t[2],10);if(isNaN(o))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${n}.${r}.${o+1}`}function Dn({displayItemList:e,widgetCollections:t}){const n=new Set;let r=!1;const o=i=>{var s,l,u;if((s=i==null?void 0:i.rows)!=null&&s.length){for(const c of i.rows)if((l=c==null?void 0:c.columns)!=null&&l.length)for(const f of c.columns)f.collection&&o(f.collection.collectionRows),!(!f.type||f.type===In.DroppableBox)&&(Cr(f.type)||(!((u=f.libraryId)!=null&&u.length)||f.libraryId===Tt?r=!0:n.add(f.libraryId)))}};o(e);for(const i of Object.values(t??{}))o(i==null?void 0:i.collectionRows);return{libraryIds:Array.from(n),usesDefaultLibrary:r}}const Sr=Symbol("rulecms-widget-context");function ba(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:en()}}function wa(e,t){Me(t,!0);const n=ft(ba());dr(()=>{n.token=t.token,n.endpoint=t.endpoint,n.libraries=t.libraries}),zn.setContext(Sr,n);var r=ie(),o=q(r);vr(o,()=>t.children),M(e,r),Ne()}const ai="1200px",Er="500px",Tr="820px",Ca=ai,ui="rulecms",Aa=1920,Sa={f:"auto",q:"auto",c:"limit"},Ea=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,Ta=300,Ia=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,Da=100,Pa=/^https:\/\/[^\s"'()\\<>]+$/,ka=2e3,La=/^[A-Za-z0-9_,.:\-/]*$/,Ra=300,ci=e=>typeof e=="string"&&e.length<=Ta&&Ea.test(e),fi=e=>typeof e=="string"&&e.length<=Da&&Ia.test(e),di=e=>typeof e=="string"&&e.length<=ka&&Pa.test(e),pi=e=>typeof e=="string"&&e.length<=Ra&&La.test(e),xa=e=>Object.entries(e).map(([t,n])=>`${t}_${n}`).join(","),Ma=e=>{const t={};for(const n of e.split(",")){const r=n.trim(),o=r.indexOf("_");o<=0||(t[r.slice(0,o)]=r.slice(o+1))}return t},hi=({publicId:e,cloudName:t=ui,transformations:n,width:r=Aa})=>{const o=typeof n=="string"?Ma(n):n,i={...Sa,...o,w:r};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${xa(i)}/${e}`)},gi=/^--[A-Za-z0-9_-]+$/,vi=200,Ir=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=vi&&gi.test(t)},Ce=e=>`var(${e.trim()})`,K=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return Ir(t)?t.trim():void 0},ke=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!Ir(t)},Na=(e,t)=>{const n=K(e);return n?{[t]:Ce(n)}:void 0},yi=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||ke(e))return!1;if(K(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?di(t.url):t.source==="cloudinary"?!ci(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!fi(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||pi(t.transformations):!1},mi=["px","%","em","rem","vh","vw"],Pn=["inherit","unset"],_i=["allSides","top","right","bottom","left"],nt=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return ke(e)?!1:K(e)?!0:n.unit==="auto"?t.allowAuto!==!1:n.unit==="keyword"?t.allowKeywords!==!1&&Pn.includes(n.keyword):mi.includes(n.unit)?typeof n.value!="number"||!Number.isFinite(n.value)?!1:t.allowNegative!==!1||n.value>=0:!1},bi=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;for(const r of _i){const o=n[r];if(o!=null&&!nt(o,t))return!1}return!0},Oa=[...Pn,"transparent","currentColor"],Wa=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,kn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:t.unit==="keyword"?Oa.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&Wa.test(t.value.trim()):!1},Ln=e=>{const t=K(e);return t?Ce(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},wi=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Pn.includes(e),Ci=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],Ai=["normal","bold","100","200","300","400","500","600","700","800","900"],Si=["normal","italic","oblique"],Ei=["left","center","right","justify","start","end"],Ti=["none","underline","line-through","overline"],Ii=["none","uppercase","lowercase","capitalize"],un=["visible","hidden","scroll","auto","clip"],Di=["flex-start","flex-end","center","space-between","space-around","space-evenly"],Pi=["flex-start","flex-end","center","baseline","stretch"],ki=["wrap","nowrap"],Li=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],Ri=["row","row-reverse","column","column-reverse"],xi=["cover","contain","auto"],Mi=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],Ni=["no-repeat","repeat","repeat-x","repeat-y","space","round"],Oi=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],Wi=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],Fi=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):Wi.includes(e),Vi=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:!(t.width!==void 0&&t.width!==null&&!nt(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!Fi(t.style)||t.color!==void 0&&t.color!==null&&!kn(t.color))},Fa={allowAuto:!1,allowKeywords:!1,allowNegative:!0},Va={allowAuto:!1,allowKeywords:!1,allowNegative:!1},ji=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(ke(e))return!1;if(K(e))return!0;for(const n of["offsetX","offsetY","spread"]){const r=t[n];if(r!=null&&!nt(r,Fa))return!1}return!(t.blur!==void 0&&t.blur!==null&&!nt(t.blur,Va)||t.color!==void 0&&t.color!==null&&!kn(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},Bi=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,Ui=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:nt(e,{allowAuto:!1,allowNegative:!1})},Ki=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,Hi=e=>{if(!yi(e))return{};const t=K(e);if(t)return{backgroundImage:Ce(t)};const n=e;return n.source==="none"?{backgroundImage:"none"}:n.source==="url"?{backgroundImage:`url("${n.url}")`}:{backgroundImage:`url("${hi({publicId:n.publicId,cloudName:n.cloudName,transformations:n.transformations})}")`}},rt=e=>{const t=K(e);return t?Ce(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},Gi=e=>{if(!Vi(e))return{};const t=K(e);if(t)return{border:Ce(t)};const n={};if(e.width&&(n.borderWidth=rt(e.width)),e.style){const r=K(e.style);n.borderStyle=r?Ce(r):e.style}return e.color&&(n.borderColor=Ln(e.color)),n},on=e=>e?rt(e):"0px",Yi=e=>{if(!ji(e)||!Bi(e))return{};const t=K(e);if(t)return{boxShadow:Ce(t)};const n=[on(e.offsetX),on(e.offsetY),on(e.blur),on(e.spread)];return e.color&&n.push(Ln(e.color)),e.inset&&n.unshift("inset"),{boxShadow:n.join(" ")}},ja=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,zi=(e,t)=>{if(!bi(e))return{};if(e.allSides)return{[t]:rt(e.allSides)};const n={};for(const r of["top","right","bottom","left"]){const o=e[r];o&&(n[`${t}${ja(r)}`]=rt(o))}return n},qi=(e,t)=>kn(e)?{[t]:Ln(e)}:{},Xi=(e,t,n)=>{if(!wi(e,n))return{};const r=K(e);return r?{[t]:Ce(r)}:{[t]:e}},Zi=(e,t,n={})=>nt(e,n)?{[t]:rt(e)}:{},Ji=e=>{if(!Ui(e))return{};const t=K(e);return t?{lineHeight:Ce(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:rt(e)}},Qi=e=>{if(!Ki(e))return{};const t=K(e);return t?{opacity:Ce(t)}:{opacity:e}},Rn={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:Di},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:Pi},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:ki},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:Li},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:Ri},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:un},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:un},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:un},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:xi},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:Mi},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:Ni},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:Ci},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:Ai},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:Si},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:Ei},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:Ti},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:Ii}},$i=(e,t)=>{const n=Rn[e];if(!n)return{};switch(n.kind){case"boxSpacing":return zi(t,n.cssProperty);case"length":return Zi(t,n.cssProperty,n.capabilities);case"border":return Gi(t);case"boxShadow":return Yi(t);case"color":return qi(t,n.cssProperty);case"opacity":return Qi(t);case"enum":return Xi(t,n.cssProperty,n.allowedValues);case"lineHeight":return Ji(t);case"backgroundImage":return Hi(t);default:return{}}},Ba=Object.fromEntries(Object.entries(Rn).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),Ua=e=>e!=null&&e!=="",es=e=>e?!Oi.some(n=>Ua(e[n]))||e.display==="flex"?e:{...e,display:"flex"}:{},ts=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:n})=>{if(!(e!=null&&e.length))return;const r=n.components[mr(t,e)];if(!r||!("defaultAttributeValues"in r))return;const i=r.defaultAttributeValues;if(i!=null&&i.length)return i.reduce((s,l)=>({...s,[l.name]:l.defaultValues}),{})},ot=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const n={},r={};for(const[o,i]of Object.entries(t)){if(!o.includes("3-resolutions")||!i)continue;const s=i.all,l=s??i[e.toLowerCase()];r[o]=l,Rn[o]&&Object.assign(n,$i(o,l))}return Object.keys(n).length||Object.keys(r).length?{styles:Object.keys(n).length?n:void 0,componentAttributesSpecificToDeviceType:Object.keys(r).length?r:void 0}:void 0},ns=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function Ft(e){return e.componentAttributes??e.widgetAttributes}function er({col:e,deviceDisplayType:t,isComposeMode:n,sourceComponentsPlugin:r}){const o=Ft(e),i=ts({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:r})||[],s=ns({defaultAttributes:i,userModifiedAttributes:o}),{styles:l,componentAttributesSpecificToDeviceType:u}=ot({deviceDisplayType:t,componentAttributes:s})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let c={};const f={};if(l)for(const[a,d]of Object.entries(l))n&&f[a]||(c={...c,[a]:d});let p=Ft(e);for(const a in u)if(a.includes("3-resolutions")){p={...Ft(e)||{},...u||{}};break}return{componentAttributesBasedOnDevice:p,componentStyles:es(c)}}const rs=e=>{const t=(e==null?void 0:e.rows)||[];for(const n of t)if(((n==null?void 0:n.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},os="var(--sl-spacing-x-small)";function is(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function ss({row:e,deviceDisplayType:t}){var r;const n=ot({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r["hide-component-3-resolutions"])==="true"}function ls({row:e,deviceDisplayType:t,isComposeMode:n}){var d;const r=((d=ot({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:d.styles)||{},o=r.justifyContent??e.horizontalAlignment??$n.Center,i=r.alignItems??e.verticalAlignment??$n.Center,s=r.flexDirection??"row",l=r.gap??e.gap??os,u=n?"nowrap":r.flexWrap??e.flexWrap??"nowrap",c=r.alignContent??e.alignContent??void 0,f=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),p={};for(const[y,m]of Object.entries(r))f.has(y)||(p[y]=m);const a={display:"flex",flexDirection:s,gap:l,flexWrap:u,justifyContent:o,alignItems:i,...p};return c!==void 0&&(a.alignContent=c),a}const xn="css-classes-3-resolutions",Ka=500,Ha=/[\x00-\x1f\x7f]/g,Mn=e=>{if(typeof e!="string")return;const t=new Set,n=[];for(const o of e.split(/\s+/)){const i=o.replace(Ha,"");i&&(t.has(i)||(t.add(i),n.push(i)))}if(!n.length)return;let r="";for(const o of n){const i=r?`${r} ${o}`:o;if(i.length>Ka)break;r=i}return r.length?r:void 0},Dr="hide-component-3-resolutions",as=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",Dr],Ga=new Set(as);function us({containerAttributes:e,deviceDisplayType:t}){var r;const n=ot({deviceDisplayType:t,componentAttributes:e});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r[Dr])==="true"}function cs({containerAttributes:e,deviceDisplayType:t,isComposeMode:n}){var i;if(!e)return{styles:{}};const r=n?Object.fromEntries(Object.entries(e).filter(([s])=>!Ga.has(s))):e,o=ot({deviceDisplayType:t,componentAttributes:r});return{styles:(o==null?void 0:o.styles)??{},cssClasses:Mn((i=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:i[xn])}}function fs(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function re(e){if(!e)return;const t=[];for(const[n,r]of Object.entries(e)){if(r==null||r==="")continue;const o=n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t.push(`${o}: ${r}`)}return t.length>0?t.join("; "):void 0}const Nn="/";function ds({componentProps:e,ancestorColumnIds:t,columnId:n}){if(!e||!n)return;const r=[...t??[],n];for(let o=0;o<r.length;o+=1){const i=r.slice(o).join(Nn),s=e[i];if(s)return s}}function ps({displayItemList:e,widgetCollections:t}){const n=[],r=(o,i)=>{var s;if((s=o==null?void 0:o.rows)!=null&&s.length)for(const l of o.rows)for(const u of l.columns){if(!u.id||u.type===In.DroppableBox)continue;const c=Ar(u.type);if(c!=null&&c.length){const f=u.collection??(t==null?void 0:t[c]);f&&!i.includes(u.id)&&r(f.collectionRows,[...i,u.id]);continue}n.push([...i,u.id].join(Nn))}};return r(e,[]),n}function Ya(e,t){const n=`${Nn}${e}`;return t.some(r=>r===e||r.endsWith(n))}function hs({componentProps:e,displayItemList:t,widgetCollections:n}){const r=e?Object.keys(e):[];if(!r.length)return[];const o=ps({displayItemList:t,widgetCollections:n});return r.filter(i=>!Ya(i,o))}function gs({componentProps:e,displayItemList:t,widgetCollections:n,publishedKey:r}){if(process.env.NODE_ENV==="production")return;const o=hs({componentProps:e,displayItemList:t,widgetCollections:n});o.length&&console.warn(`RuleCMSWidget "${r}": componentProps ${o.map(i=>`"${i}"`).join(", ")} ${o.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function za(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qa(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,n=e.tablet,r=e.desktop;return t!==n||t!==r||n!==r}function qr(e){var t;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;for(const n of e.rows){if(Xr(n.rowAttributes))return!0;for(const r of n.columns)if(Xr(Ft(r)))return!0}return!1}function Xr(e){if(!e)return!1;for(const[t,n]of Object.entries(e))if(!(!t.includes("3-resolutions")||!za(n))){if(t==="hide-component-3-resolutions"){const r=n,o=i=>i==="true"||i===!0;if(o(r.phone)!==o(r.tablet)||o(r.phone)!==o(r.desktop))return!0;continue}if(qa(n))return!0}return!1}function vs(e,t){if(qr(e))return!0;for(const n of Object.values(t))if(qr(n.collectionRows))return!0;return!1}const ys=parseInt(Er,10),ms=parseInt(Tr,10),Xa=ys+1,Za=ms+1;function Ja(e){const t=`.${e}-phone`,n=`.${e}-tablet`,r=`.${e}-desktop`;return`
|
|
2
3
|
${t}, ${n}, ${r} { display: none; }
|
|
3
|
-
@media (max-width: ${
|
|
4
|
-
@media (min-width: ${
|
|
5
|
-
@media (min-width: ${
|
|
6
|
-
`.trim()}function
|
|
7
|
-
`)}),c=
|
|
8
|
-
${
|
|
9
|
-
}`:""),f=A(()=>!n()&&Ui({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i()})),h=A(()=>Ki({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i(),isComposeMode:n()})),u=A(()=>{var S;const P=((S=t.displayItemList.containerAttributes)==null?void 0:S[$t])||[],D=Hi(p(h));return n()&&!o()||r()||P.length>0||D||l(n(),t.displayItemList.rows,o())}),d=A(()=>[p(a)?s:void 0,p(h).cssClasses].filter(Boolean).join(" ")),m=A(()=>{var D;return{...(((D=t.displayItemList.containerAttributes)==null?void 0:D[$t])||[]).some(S=>S.toLowerCase().startsWith("height:"))?{}:{height:o()?"auto":"100%"},display:"flex",flexDirection:"column",...p(h).styles}}),y=A(()=>p(u)?p(d):""),g=A(()=>p(f)?{display:"none"}:p(u)?p(m):{display:"contents"});var _=fa(),R=me(_);{var I=P=>{var D=se(),S=re(D);Eo(S,()=>"style",!1,(w,C)=>{var b=So();_e(()=>rr(b,p(c))),W(C,b)}),W(P,D)};xe(R,P=>{p(a)&&P(I)})}var V=fn(R,2);or(V,()=>t.children),_e(P=>{ir(_,"hidden",p(f)||void 0),Wt(_,1,pn(p(y)||void 0)),ie(_,P)},[()=>te(p(g))]),W(e,_),Le()}var pa=Me("<div><!></div>");function ha(e,t){Re(t,!0);let n=le(t,"isComposeMode",3,!1),r=le(t,"showDropContainers",3,!1),o=le(t,"isWithinCollection",3,!1),i=le(t,"deviceDisplayType",3,"Desktop");function s(y,g,_){var I;const R=y&&!_?3:1;return!!((I=g==null?void 0:g.columns)!=null&&I.length)&&g.columns.length>R}const l=A(()=>!n()&&Vi({row:t.row,deviceDisplayType:i()})),a=A(()=>r()||Fi(t.row)||s(n(),t.row,o())),c=A(()=>ji({row:t.row,deviceDisplayType:i(),isComposeMode:n()})),f=A(()=>{var g;const y=et({deviceDisplayType:i(),componentAttributes:t.row.rowAttributes});return Tn((g=y==null?void 0:y.componentAttributesSpecificToDeviceType)==null?void 0:g[In])??""}),h=A(()=>p(a)?p(f):""),u=A(()=>p(l)?{display:"none"}:p(a)?p(c):{display:"contents"});var d=pa(),m=me(d);or(m,()=>t.children),_e(y=>{ir(d,"hidden",p(l)||void 0),Wt(d,1,pn(p(h)||void 0)),ie(d,y)},[()=>te(p(u))]),W(e,d),Le()}const Qi=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],ga=e=>e!=null&&e!=="",va=e=>e?Qi.reduce((t,n)=>{const r=e[n];return ga(r)&&(t[n]=r),t},{}):{},ma=e=>{if(!e)return;const t={...e};for(const n of Qi)delete t[n];return Object.keys(t).length?t:void 0},ya=e=>Object.keys(e).length>0,_a=(e,t)=>{const n=(e==null?void 0:e.noContainer)??!1,r=e==null?void 0:e.resolveNoContainer;if(typeof r!="function")return n;try{const o=r(t);if(typeof o=="boolean")return o;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof o} instead of a boolean; falling back to noContainer=${n}`)}catch(o){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${n}`,o)}return n},wa=(e,t)=>{const n=e==null?void 0:e.resolveRendersOwnElement;if(typeof n!="function")return!1;try{const r=n(t);if(typeof r=="boolean")return r;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof r} instead of a boolean; falling back to false`)}catch(r){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,r)}return!1};var Lr=Me("<div><!></div>");function $i(e,t){Re(t,!0);const n=A(()=>t.components[sr(t.libraryId,t.componentType)]),r=A(()=>{var _;const g=(_=p(n))==null?void 0:_.card;return g||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),o=A(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),i=A(()=>p(n)?_a(p(n),p(o)):!1),s=A(()=>va(t.styleProps)),l=A(()=>p(i)?ma(t.styleProps):t.styleProps),a=A(()=>{var g;return Tn((g=t.componentAttributes)==null?void 0:g[In])}),c=A(()=>p(i)&&ya(p(s))),f=A(()=>!p(i)||(p(n)?wa(p(n),p(o)):!1)),h=A(()=>!p(c)&&p(f)?p(a):void 0),u=A(()=>({componentAttributes:t.componentAttributes,styleProps:p(l),className:p(h),widgetInstanceProps:t.widgetInstanceProps}));var d=se(),m=re(d);{var y=g=>{const _=A(()=>p(r));var R=se(),I=re(R);{var V=S=>{var w=Lr(),C=me(w);Nn(C,()=>p(_),(b,L)=>{L(b,On(()=>p(u)))}),_e(b=>{Wt(w,1,pn(p(a)||void 0)),ie(w,b)},[()=>te(p(s))]),W(S,w)},P=S=>{var w=Lr(),C=me(w);Nn(C,()=>p(_),(b,L)=>{L(b,On(()=>p(u)))}),_e(()=>Wt(w,1,pn(p(a)))),W(S,w)},D=S=>{var w=se(),C=re(w);Nn(C,()=>p(_),(b,L)=>{L(b,On(()=>p(u)))}),W(S,w)};xe(I,S=>{p(c)?S(V):!p(f)&&p(a)?S(P,1):S(D,-1)})}W(g,R)};xe(m,g=>{p(r)&&g(y)})}W(e,d),Le()}function mr(e,t){Re(t,!0);let n=le(t,"isComposeMode",3,!1),r=le(t,"isWithinCollection",3,!1),o=le(t,"showDropContainers",3,!1);const i=A(()=>tn(t.plugins).components);function s(h){if(n()&&h.type===wn.DroppableBox)return!1;const{componentAttributesBasedOnDevice:u}=Gn({col:h,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:tn(t.plugins)}),d=!!u&&u["hide-component-3-resolutions"]==="true";return!(!n()&&d)}function l(h){const{componentAttributesBasedOnDevice:u,componentStyles:d}=Gn({col:h,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:tn(t.plugins)});return{componentAttributes:u,styleProps:d}}function a(h){const u=fr(h.type);if(!(u!=null&&u.length))return null;const d=h.collection??t.widgetCollections[u];if(!d)throw new Error(`DisplayCollection - Collection with ID ${u} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!d.collectionRows||!Oi(d.collectionRows)?null:d.collectionRows}function c(h){return[...t.ancestorColumnIds??[],h]}function f(h){return Yi({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:h})}da(e,{get displayItemList(){return t.displayItemList},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(h,u)=>{var d=se(),m=re(d);Hn(m,17,()=>t.displayItemList.rows,y=>y.id,(y,g)=>{ha(y,{get row(){return p(g)},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(_,R)=>{var I=se(),V=re(I);Hn(V,17,()=>p(g).columns,P=>P.id,(P,D)=>{var S=se(),w=re(S);{var C=L=>{const G=A(()=>a(p(D)));var M=se(),q=re(M);{var tt=Te=>{{let nt=A(()=>c(p(D).id));mr(Te,{get displayItemList(){return p(G)},get isComposeMode(){return n()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return o()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get ancestorColumnIds(){return p(nt)}})}},Gt=Te=>{{let nt=A(()=>l(p(D)).componentAttributes),de=A(()=>l(p(D)).styleProps),zt=A(()=>f(p(D).id));$i(Te,{get componentType(){return p(D).type},get libraryId(){return p(D).libraryId},get componentAttributes(){return p(nt)},get components(){return p(i)},get styleProps(){return p(de)},get widgetInstanceProps(){return p(zt)}})}};xe(q,Te=>{p(G)?Te(tt):Te(Gt,-1)})}W(L,M)},b=A(()=>s(p(D)));xe(w,L=>{p(b)&&L(C)})}W(P,S)}),W(_,I)},$$slots:{default:!0}})}),W(h,d)},$$slots:{default:!0}}),Le()}function hn(e,t){Re(t,!0);var n=se(),r=re(n);{var o=i=>{mr(i,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get ancestorColumnIds(){return t.ancestorColumnIds}})};xe(r,i=>{var s,l;(l=(s=t.displayItemList)==null?void 0:s.rows)!=null&&l.length&&i(o)})}W(e,n),Le()}let ba=0;var Ca=Me("<div><!></div>"),Aa=Me("<!> <!>",1);function es(e,t){Re(t,!0);const n=["Phone","Tablet","Desktop"],r=`rulecms-bp-${++ba}`,o=A(()=>t.scopeIdInput??r),i=A(()=>Xi(t.displayItemList,t.widgetCollections)),s=A(()=>ua(p(o)));var l=se(),a=re(l);{var c=h=>{hn(h,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps}})},f=h=>{var u=Aa(),d=re(u);Eo(d,()=>"style",!1,(y,g)=>{var _=So();_e(()=>rr(_,p(s))),W(g,_)});var m=fn(d,2);Hn(m,16,()=>n,y=>y,(y,g)=>{var _=Ca(),R=me(_);hn(R,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return g},get plugins(){return t.plugins},get componentProps(){return t.componentProps}}),_e(I=>Wt(_,1,I),[()=>`${p(o)}-${g.toLowerCase()}`]),W(y,_)}),W(h,u)};xe(a,h=>{p(i)?h(f,-1):h(c)})}W(e,l),Le()}function Sa(e,t,n){if(e)return"Phone";if(t)return"Tablet";const r=(n==null?void 0:n.toLowerCase())||"desktop";return r==="phone"?"Phone":r==="tablet"?"Tablet":"Desktop"}const Ea=`(max-width: ${pr})`,Ia=`(max-width: ${hr})`;function ts(e,t){Re(t,!0);let n=ne("Desktop"),r,o;function i(){N(n,Sa((r==null?void 0:r.matches)??!1,(o==null?void 0:o.matches)??!1,t.reduxDeviceDisplayType),!0)}er(()=>(typeof matchMedia=="function"&&(r=matchMedia(Ea),o=matchMedia(Ia),r.addEventListener("change",i),o.addEventListener("change",i)),i(),()=>{r==null||r.removeEventListener("change",i),o==null||o.removeEventListener("change",i)})),hn(e,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return p(n)},get plugins(){return t.plugins},get componentProps(){return t.componentProps}}),Le()}function Ta(e){const t={};return Object.entries(e).forEach(([n,r])=>{const o={...r};if(o.itemList)try{o.collectionRows=typeof o.itemList=="string"?JSON.parse(o.itemList):o.itemList}catch(s){console.error(`Failed to parse itemList for collection ${n}:`,s),o.collectionRows={rows:[]}}let i=`${o.name}$${n}`;o.parentId&&(i=`${i}@${o.parentId}`),t[i]=o}),t}function Da(e){return typeof e.itemList=="string"?JSON.parse(e.itemList):e.itemList}function yr(e){return{displayItemList:Da(e.widget),widgetCollections:Ta(e.childCollections),...e.libraries?{libraries:e.libraries}:{}}}function Pa(e){const t=e.registry??Yt(),n=bn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolveSync({registrations:e.libraries,referenced:n})}function ka(e){const t=e.registry??Yt(),n=bn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolve({registrations:e.libraries,referenced:n})}const xa={display:"flex",justifyContent:"center",alignItems:"center",padding:"3rem",color:"#e2e8f0"},Ra={display:"flex",alignItems:"center",gap:"1rem"},La={width:"40px",height:"40px",border:"4px solid #4a5568",borderTopColor:"#63b3ed",borderRadius:"50%",animation:"spin 1s linear infinite"},Mr={padding:"1.5rem",backgroundColor:"#742a2a",border:"1px solid #9b2c2c",borderRadius:"8px",color:"#fed7d7"},Nr={fontSize:"16px",fontWeight:"600",marginBottom:"0.5rem",color:"#feb2b2"},Or={fontSize:"14px",color:"#fed7d7"},Ma=`
|
|
4
|
+
@media (max-width: ${ys}px) { ${t} { display: block; } }
|
|
5
|
+
@media (min-width: ${Xa}px) and (max-width: ${ms}px) { ${n} { display: block; } }
|
|
6
|
+
@media (min-width: ${Za}px) { ${r} { display: block; } }
|
|
7
|
+
`.trim()}function cn(e){if(!e)throw new Error("Source components plugin is required, but no plugins were provided");const t=e.sourceComponents;if(!t)throw new Error("Source components plugin is required, but was not found in plugins object");if(!t.components)throw new Error("Source components plugin is missing required property: components");if(typeof t.components!="object"||t.components===null||Array.isArray(t.components))throw new Error("Source components plugin components must be an object (Record<string, LibraryComponentEntry>)");return t}let Qa=0;var $a=Pe("<div><!> <!></div>");function eu(e,t){Me(t,!0);let n=ae(t,"isComposeMode",3,!1),r=ae(t,"showDropContainers",3,!1),o=ae(t,"isWithinCollection",3,!1),i=ae(t,"deviceDisplayType",3,"Desktop");const s=`rulecms-vc-${++Qa}`;function l(w,S,E){const b=w&&!E?3:1;return!!(S!=null&&S.length)&&S.length>b}const u=D(()=>{var w;return(((w=t.displayItemList.containerAttributes)==null?void 0:w[an])||[]).join(`;
|
|
8
|
+
`)}),c=D(()=>g(u)?`.${s} {
|
|
9
|
+
${g(u)}
|
|
10
|
+
}`:""),f=D(()=>!n()&&us({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i()})),p=D(()=>cs({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i(),isComposeMode:n()})),a=D(()=>{var E;const w=((E=t.displayItemList.containerAttributes)==null?void 0:E[an])||[],S=fs(g(p));return n()&&!o()||r()||w.length>0||S||l(n(),t.displayItemList.rows,o())}),d=D(()=>[g(u)?s:void 0,g(p).cssClasses].filter(Boolean).join(" ")),y=D(()=>{var S;return{...(((S=t.displayItemList.containerAttributes)==null?void 0:S[an])||[]).some(E=>E.toLowerCase().startsWith("height:"))?{}:{height:o()?"auto":"100%"},display:"flex",flexDirection:"column",...g(p).styles}}),m=D(()=>g(a)?g(d):""),h=D(()=>g(f)?{display:"none"}:g(a)?g(y):{display:"contents"});var _=$a(),A=_e(_);{var P=w=>{var S=ie(),E=q(S);yr(E,()=>"style",!1,(b,I)=>{var T=gr();le(()=>En(T,g(c))),M(I,T)}),M(w,S)};De(A,w=>{g(u)&&w(P)})}var C=Ct(A,2);vr(C,()=>t.children),le(w=>{ht(_,"hidden",g(f)||void 0),St(_,1,Gt(g(m)||void 0)),ne(_,w)},[()=>re(g(h))]),M(e,_),Ne()}var tu=Pe("<div><!></div>");function nu(e,t){Me(t,!0);let n=ae(t,"isComposeMode",3,!1),r=ae(t,"showDropContainers",3,!1),o=ae(t,"isWithinCollection",3,!1),i=ae(t,"deviceDisplayType",3,"Desktop");function s(m,h,_){var P;const A=m&&!_?3:1;return!!((P=h==null?void 0:h.columns)!=null&&P.length)&&h.columns.length>A}const l=D(()=>!n()&&ss({row:t.row,deviceDisplayType:i()})),u=D(()=>r()||is(t.row)||s(n(),t.row,o())),c=D(()=>ls({row:t.row,deviceDisplayType:i(),isComposeMode:n()})),f=D(()=>{var h;const m=ot({deviceDisplayType:i(),componentAttributes:t.row.rowAttributes});return Mn((h=m==null?void 0:m.componentAttributesSpecificToDeviceType)==null?void 0:h[xn])??""}),p=D(()=>g(u)?g(f):""),a=D(()=>g(l)?{display:"none"}:g(u)?g(c):{display:"contents"});var d=tu(),y=_e(d);vr(y,()=>t.children),le(m=>{ht(d,"hidden",g(l)||void 0),St(d,1,Gt(g(p)||void 0)),ne(d,m)},[()=>re(g(a))]),M(e,d),Ne()}const _s=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],ru=e=>e!=null&&e!=="",ou=e=>e?_s.reduce((t,n)=>{const r=e[n];return ru(r)&&(t[n]=r),t},{}):{},iu=e=>{if(!e)return;const t={...e};for(const n of _s)delete t[n];return Object.keys(t).length?t:void 0},su=e=>Object.keys(e).length>0,lu=(e,t)=>{const n=(e==null?void 0:e.noContainer)??!1,r=e==null?void 0:e.resolveNoContainer;if(typeof r!="function")return n;try{const o=r(t);if(typeof o=="boolean")return o;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof o} instead of a boolean; falling back to noContainer=${n}`)}catch(o){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${n}`,o)}return n},au=(e,t)=>{const n=e==null?void 0:e.resolveRendersOwnElement;if(typeof n!="function")return!1;try{const r=n(t);if(typeof r=="boolean")return r;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof r} instead of a boolean; falling back to false`)}catch(r){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,r)}return!1};var Zr=Pe("<div><!></div>");function bs(e,t){Me(t,!0);const n=D(()=>t.components[mr(t.libraryId,t.componentType)]),r=D(()=>{var _;const h=(_=g(n))==null?void 0:_.card;return h||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),o=D(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),i=D(()=>g(n)?lu(g(n),g(o)):!1),s=D(()=>ou(t.styleProps)),l=D(()=>g(i)?iu(t.styleProps):t.styleProps),u=D(()=>{var h;return Mn((h=t.componentAttributes)==null?void 0:h[xn])}),c=D(()=>g(i)&&su(g(s))),f=D(()=>!g(i)||(g(n)?au(g(n),g(o)):!1)),p=D(()=>!g(c)&&g(f)?g(u):void 0),a=D(()=>({componentAttributes:t.componentAttributes,styleProps:g(l),className:g(p),widgetInstanceProps:t.widgetInstanceProps,mounts:t.mounts}));var d=ie(),y=q(d);{var m=h=>{const _=D(()=>g(r));var A=ie(),P=q(A);{var C=E=>{var b=Zr(),I=_e(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),le(T=>{St(b,1,Gt(g(u)||void 0)),ne(b,T)},[()=>re(g(s))]),M(E,b)},w=E=>{var b=Zr(),I=_e(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),le(()=>St(b,1,Gt(g(u)))),M(E,b)},S=E=>{var b=ie(),I=q(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),M(E,b)};De(P,E=>{g(c)?E(C):!g(f)&&g(u)?E(w,1):E(S,-1)})}M(h,A)};De(y,h=>{g(r)&&h(m)})}M(e,d),Ne()}function Pr(e,t){Me(t,!0);let n=ae(t,"isComposeMode",3,!1),r=ae(t,"isWithinCollection",3,!1),o=ae(t,"showDropContainers",3,!1);const i=D(()=>cn(t.plugins).components);function s(p){if(n()&&p.type===In.DroppableBox)return!1;const{componentAttributesBasedOnDevice:a}=er({col:p,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:cn(t.plugins)}),d=!!a&&a["hide-component-3-resolutions"]==="true";return!(!n()&&d)}function l(p){const{componentAttributesBasedOnDevice:a,componentStyles:d}=er({col:p,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:cn(t.plugins)});return{componentAttributes:a,styleProps:d}}function u(p){const a=Ar(p.type);if(!(a!=null&&a.length))return null;const d=p.collection??t.widgetCollections[a];if(!d)throw new Error(`DisplayCollection - Collection with ID ${a} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!d.collectionRows||!rs(d.collectionRows)?null:d.collectionRows}function c(p){return[...t.ancestorColumnIds??[],p]}function f(p){return ds({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:p})}eu(e,{get displayItemList(){return t.displayItemList},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(p,a)=>{var d=ie(),y=q(d);bn(y,17,()=>t.displayItemList.rows,m=>m.id,(m,h)=>{nu(m,{get row(){return g(h)},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(_,A)=>{var P=ie(),C=q(P);bn(C,17,()=>g(h).columns,w=>w.id,(w,S)=>{var E=ie(),b=q(E);{var I=N=>{const Y=D(()=>u(g(S)));var O=ie(),X=q(O);{var it=Le=>{{let st=D(()=>c(g(S).id));Pr(Le,{get displayItemList(){return g(Y)},get isComposeMode(){return n()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return o()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return g(st)}})}},tn=Le=>{{let st=D(()=>l(g(S)).componentAttributes),he=D(()=>l(g(S)).styleProps),nn=D(()=>f(g(S).id));bs(Le,{get componentType(){return g(S).type},get libraryId(){return g(S).libraryId},get componentAttributes(){return g(st)},get components(){return g(i)},get styleProps(){return g(he)},get widgetInstanceProps(){return g(nn)},get mounts(){return t.mounts}})}};De(X,Le=>{g(Y)?Le(it):Le(tn,-1)})}M(N,O)},T=D(()=>s(g(S)));De(b,N=>{g(T)&&N(I)})}M(w,E)}),M(_,P)},$$slots:{default:!0}})}),M(p,d)},$$slots:{default:!0}}),Ne()}function wn(e,t){Me(t,!0);var n=ie(),r=q(n);{var o=i=>{Pr(i,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return t.ancestorColumnIds}})};De(r,i=>{var s,l;(l=(s=t.displayItemList)==null?void 0:s.rows)!=null&&l.length&&i(o)})}M(e,n),Ne()}function ws(e,t){var n=ie(),r=q(n);bn(r,16,()=>t.stylesheets??[],o=>o,(o,i)=>{var s=ie(),l=q(s);yr(l,()=>"style",!1,(u,c)=>{ia(u,()=>({"data-rulecms-library-stylesheet":""}));var f=gr();le(()=>En(f,i)),M(c,f)}),M(o,s)}),M(e,n)}let uu=0;var cu=Pe("<div><!></div>"),Jr=Pe("<!> <!>",1);function Cs(e,t){Me(t,!0);const n=["Phone","Tablet","Desktop"],r=`rulecms-bp-${++uu}`,o=D(()=>t.scopeIdInput??r),i=D(()=>vs(t.displayItemList,t.widgetCollections)),s=D(()=>Ja(g(o)));var l=Jr(),u=q(l);{let a=D(()=>{var d;return(d=t.plugins.sourceComponents)==null?void 0:d.stylesheets});ws(u,{get stylesheets(){return g(a)}})}var c=Ct(u,2);{var f=a=>{wn(a,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})},p=a=>{var d=Jr(),y=q(d);yr(y,()=>"style",!1,(h,_)=>{var A=gr();le(()=>En(A,g(s))),M(_,A)});var m=Ct(y,2);bn(m,16,()=>n,h=>h,(h,_)=>{var A=cu(),P=_e(A);wn(P,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return _},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),le(C=>St(A,1,C),[()=>`${g(o)}-${_.toLowerCase()}`]),M(h,A)}),M(a,d)};De(c,a=>{g(i)?a(p,-1):a(f)})}M(e,l),Ne()}function fu(e,t,n){if(e)return"Phone";if(t)return"Tablet";const r=(n==null?void 0:n.toLowerCase())||"desktop";return r==="phone"?"Phone":r==="tablet"?"Tablet":"Desktop"}const du=`(max-width: ${Er})`,pu=`(max-width: ${Tr})`;var hu=Pe("<!> <!>",1);function As(e,t){Me(t,!0);let n=oe("Desktop"),r,o;function i(){W(n,fu((r==null?void 0:r.matches)??!1,(o==null?void 0:o.matches)??!1,t.reduxDeviceDisplayType),!0)}dr(()=>(typeof matchMedia=="function"&&(r=matchMedia(du),o=matchMedia(pu),r.addEventListener("change",i),o.addEventListener("change",i)),i(),()=>{r==null||r.removeEventListener("change",i),o==null||o.removeEventListener("change",i)}));var s=hu(),l=q(s);{var u=f=>{{let p=D(()=>{var a;return(a=t.plugins.sourceComponents)==null?void 0:a.stylesheets});ws(f,{get stylesheets(){return g(p)}})}};De(l,f=>{t.isWithinCollection||f(u)})}var c=Ct(l,2);wn(c,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return g(n)},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),M(e,s),Ne()}function gu(e){const t={};return Object.entries(e).forEach(([n,r])=>{const o={...r};if(o.itemList)try{o.collectionRows=typeof o.itemList=="string"?JSON.parse(o.itemList):o.itemList}catch(s){console.error(`Failed to parse itemList for collection ${n}:`,s),o.collectionRows={rows:[]}}let i=`${o.name}$${n}`;o.parentId&&(i=`${i}@${o.parentId}`),t[i]=o}),t}function vu(e){return typeof e.itemList=="string"?JSON.parse(e.itemList):e.itemList}function kr(e){return{displayItemList:vu(e.widget),widgetCollections:gu(e.childCollections),...e.libraries?{libraries:e.libraries}:{}}}function yu(e){const t=e.registry??en(),n=Dn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolveSync({registrations:e.libraries,referenced:n})}function mu(e){const t=e.registry??en(),n=Dn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolve({registrations:e.libraries,referenced:n})}const _u={display:"flex",justifyContent:"center",alignItems:"center",padding:"3rem",color:"#e2e8f0"},bu={display:"flex",alignItems:"center",gap:"1rem"},wu={width:"40px",height:"40px",border:"4px solid #4a5568",borderTopColor:"#63b3ed",borderRadius:"50%",animation:"spin 1s linear infinite"},Qr={padding:"1.5rem",backgroundColor:"#742a2a",border:"1px solid #9b2c2c",borderRadius:"8px",color:"#fed7d7"},$r={fontSize:"16px",fontWeight:"600",marginBottom:"0.5rem",color:"#feb2b2"},eo={fontSize:"14px",color:"#fed7d7"},Cu=`
|
|
10
11
|
@keyframes spin {
|
|
11
12
|
from {
|
|
12
13
|
transform: rotate(0deg);
|
|
@@ -15,4 +16,4 @@ ${p(a)}
|
|
|
15
16
|
transform: rotate(360deg);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
`,
|
|
19
|
+
`,Au="data-rulecms-published-key";var Su=Pe("<div><div><div></div></div></div>"),Eu=Pe("<div><div>Error Loading Widget</div> <div> </div></div>"),Tu=Pe("<div><div>No Widget Data</div> <div>No widget data available</div></div>"),Iu=Pe('<span style="display: contents"><!></span>');function Du(e,t){Me(t,!0);let n=ae(t,"mode",3,"client-fetch");const r=zn.getContext(Sr);let o=oe(!1),i=oe(null),s=oe(null),l=oe(null);const u=D(()=>n()==="pre-fetched"),c=D(()=>({sourceComponents:g(l)??void 0}));let f=null,p=null,a=!1;function d(){if(!g(s)){W(l,null);return}const b=t.libraries??(r==null?void 0:r.libraries),I=r==null?void 0:r.libraryRegistry,T=yu({displayItemList:g(s).displayItemList,widgetCollections:g(s).widgetCollections,libraries:b,registry:I});if(T){W(l,T,!0);return}mu({displayItemList:g(s).displayItemList,widgetCollections:g(s).widgetCollections,libraries:b,registry:I}).then(N=>{W(l,N,!0)})}function y(){g(s)&&gs({componentProps:t.componentProps,displayItemList:g(s).displayItemList,widgetCollections:g(s).widgetCollections,publishedKey:t.publishedKey})}function m(){if(a||typeof document>"u")return;const b="rulecms-widget-spinner-styles";if(!document.getElementById(b)){const I=document.createElement("style");I.id=b,I.textContent=Cu,document.head.appendChild(I)}a=!0}function h(){const b=t.token??(r==null?void 0:r.token),I=t.endpoint??(r==null?void 0:r.endpoint);if(!t.publishedKey||!b){W(i,t.publishedKey?"Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider.":tt(b)?"Widget key is required":"Published key is required",!0),W(s,null);return}const T=`${t.publishedKey}|${b}`;if(p===T&&g(s)){d();return}f==null||f.abort(),f=new AbortController;const N=f.signal;p=T,W(o,!0),W(i,null);const Y=wr({publishedKey:t.publishedKey,token:b,endpoint:I});fetch(Y,{method:"GET",headers:{"Content-Type":"application/json"},...tt(b)?{cache:"no-store"}:{},signal:N}).then(async O=>{if(O.ok){const X=await O.json();X.success?(W(s,kr(X.data),!0),W(i,null),d(),y()):(W(i,"Failed to fetch widget data"),W(s,null))}else{const X=await O.json().catch(()=>({error:"Unknown error"}));W(i,X.error||`Request failed with status ${O.status}`,!0),W(s,null)}}).catch(O=>{O instanceof DOMException&&O.name==="AbortError"||(console.error("Error fetching widget:",O),W(i,"Failed to fetch widget"),W(s,null))}).finally(()=>{W(o,!1)})}function _(){if(n()==="pre-fetched"){W(s,t.initialData??null,!0),W(o,!1),W(i,null),d(),y();return}m(),h()}dr(()=>(t.publishedKey,t.token,t.endpoint,n(),t.initialData,t.libraries,t.componentProps,zn.untrack(()=>_()),()=>{f==null||f.abort()}));var A=Iu(),P=_e(A);{var C=b=>{var I=Su(),T=_e(I),N=_e(T);le((Y,O,X)=>{ne(I,Y),ne(T,O),ne(N,X)},[()=>re(_u),()=>re(bu),()=>re(wu)]),M(b,I)},w=b=>{var I=Eu(),T=_e(I),N=Ct(T,2),Y=_e(N);le((O,X,it)=>{ne(I,O),ne(T,X),ne(N,it),En(Y,g(i))},[()=>re(Qr),()=>re($r),()=>re(eo)]),M(b,I)},S=b=>{var I=Tu(),T=_e(I),N=Ct(T,2);le((Y,O,X)=>{ne(I,Y),ne(T,O),ne(N,X)},[()=>re(Qr),()=>re($r),()=>re(eo)]),M(b,I)},E=b=>{var I=ie(),T=q(I);{var N=O=>{Cs(O,{get displayItemList(){return g(s).displayItemList},get widgetCollections(){return g(s).widgetCollections},get plugins(){return g(c)},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})},Y=O=>{As(O,{get displayItemList(){return g(s).displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return g(s).widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get plugins(){return g(c)},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})};De(T,O=>{g(u)?O(N):O(Y,-1)})}M(b,I)};De(P,b=>{n()!=="pre-fetched"&&g(o)?b(C):n()!=="pre-fetched"&&g(i)?b(w,1):n()!=="pre-fetched"&&!g(s)?b(S,2):g(l)&&g(s)&&b(E,3)})}le(()=>ht(A,"data-rulecms-published-key",t.publishedKey)),M(e,A),Ne()}class Nt extends Error{constructor(n,r){super(n);ge(this,"status");this.name="FetchRuleCMSWidgetError",this.status=r}}async function Pu(e){const{publishedKey:t,token:n,endpoint:r,fetchOptions:o}=e;if(!t)throw new Nt(tt(n)?"Widget key is required":"Published key is required");if(!n)throw new Nt("Token is required");const i=wr({publishedKey:t,token:n,endpoint:r}),s=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json"},...tt(n)?{cache:"no-store"}:{},...o});if(!s.ok){const u=await s.json().catch(()=>({error:"Unknown error"}));throw new Nt(u.error||`Request failed with status ${s.status}`,s.status)}const l=await s.json();if(!l.success)throw new Nt("Failed to fetch widget data");return kr(l.data)}async function ku(e){const{data:t,libraries:n}=e,r=Dn({displayItemList:t.displayItemList,widgetCollections:t.widgetCollections});return en().resolve({registrations:n,referenced:r})}exports.AlignContentTypes=fa;exports.BreakpointVariantRender=Cs;exports.COLLECTION_TYPE_PREFIX=br;exports.COMPONENT_PROPS_PATH_SEPARATOR=Nn;exports.CSS_CLASSES_ATTRIBUTE_NAME=xn;exports.CSS_VARIABLE_NAME_MAX_LENGTH=vi;exports.CSS_VARIABLE_NAME_PATTERN=gi;exports.DEFAULT_CLOUDINARY_CLOUD_NAME=ui;exports.DEFAULT_LIBRARY_ID=Tt;exports.DEFAULT_ROW_GAP=os;exports.DEV_CLIENT_TOKEN_PREFIX=Xo;exports.DEV_WIDGET_API_PATH=$o;exports.DeviceDisplayTypes=da;exports.DisplayComponent=bs;exports.DisplayItemTypes=In;exports.DragItemIdPrefixTypes=_r;exports.EMBEDDED_KEY_SEPARATOR=si;exports.FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY=Oi;exports.FetchRuleCMSWidgetError=Nt;exports.HIDE_WIDGET_ATTRIBUTE_NAME=Dr;exports.JustifyContentTypes=$n;exports.PUBLISHED_KEY_SEPARATOR=ii;exports.PUBLISHED_WIDGET_API_PATH=Qo;exports.PageViewTypes=ca;exports.RULECMS_API_ORIGIN=Zo;exports.RULECMS_PUBLISHED_KEY_ATTRIBUTE=Au;exports.RULECMS_WIDGET_CONTEXT_KEY=Sr;exports.RenderComponents=As;exports.RenderComponentsForDevice=wn;exports.RenderComponentsInner=Pr;exports.RuleCMSWidget=Du;exports.RuleCMSWidgetProvider=wa;exports.WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE=as;exports.WIDGET_CACHE_API_ORIGIN=Jo;exports.alignContentAllowlist=Li;exports.alignItemsAllowlist=Pi;exports.backgroundPositionAllowlist=Mi;exports.backgroundRepeatAllowlist=Ni;exports.backgroundSizeAllowlist=xi;exports.borderStyleKeywords=Wi;exports.boxSpacingSideKeys=_i;exports.boxSpacingStyleAttributeEntries=Ba;exports.buildCloudinaryBackgroundUrl=hi;exports.buildWidgetFetchUrl=wr;exports.collectComponentInstancePaths=ps;exports.collectReferencedLibraryIds=Dn;exports.composeSourceComponentsPlugin=qo;exports.createComponentLibraryRegistry=en;exports.cssAttrArrayKey=an;exports.defaultPageWidth=ai;exports.deriveDisplayFlexIfNeeded=es;exports.desktopModeWidth=Ca;exports.fetchRuleCMSWidget=Pu;exports.findUnmatchedComponentPropsKeys=hs;exports.flexDirectionAllowlist=Ri;exports.flexWrapAllowlist=ki;exports.fontFamilyAllowlist=Ci;exports.fontStyleAllowlist=Si;exports.fontWeightAllowlist=Ai;exports.formatBackgroundImageStyles=Hi;exports.formatBorderStyles=Gi;exports.formatBoxShadowStyles=Yi;exports.formatBoxSpacingStyles=zi;exports.formatCssColorStyles=qi;exports.formatCssColorValue=Ln;exports.formatCssEnumStyles=Xi;exports.formatCssLengthStyles=Zi;exports.formatCssVariable=Ce;exports.formatCssVariableStyles=Na;exports.formatLineHeightStyles=Ji;exports.formatObjectStyleAttribute=$i;exports.formatOpacityStyles=Qi;exports.formatSpacingSideValue=rt;exports.generatePublishedKey=li;exports.generatePublishedKeyForEmbedded=ma;exports.getCollectionIdForCollectionType=Ar;exports.getColumnAttributes=Ft;exports.getComponentAttributesAndStyles=er;exports.getComponentsPluginFromPlugins=cn;exports.getCssVariableFromLeaf=K;exports.getDefaultDimensionAttributes=ts;exports.getDeviceTypeBasedAttributes=ot;exports.getDragItemId=pa;exports.getDragItemPrefixAndId=ti;exports.getIdAndPrefix=ni;exports.getMergedAttributes=ns;exports.getNameAndInstanceIdFromWidgetKey=ha;exports.getNameFromWidgetKey=ga;exports.getWidgetKeyForCollection=ri;exports.getWidgetKeyForCollectionWithPrefix=va;exports.getWidgetKeyForPublishedCollection=oi;exports.getWidgetKeyForPublishedCollectionWithPrefix=ya;exports.hasBoxShadowLeaf=Bi;exports.hasDeviceDivergentValues=vs;exports.hasInvalidCssVariable=ke;exports.hasItems=rs;exports.incrementVersion=_a;exports.isBackgroundImageValue=yi;exports.isBorderStyleValue=Fi;exports.isBorderValue=Vi;exports.isBoxShadowValue=ji;exports.isBoxSpacingValue=bi;exports.isCloudinaryCloudName=fi;exports.isCloudinaryPublicId=ci;exports.isCloudinaryTransformationString=pi;exports.isCssColorValue=kn;exports.isCssEnumValue=wi;exports.isCssVariableName=Ir;exports.isDevClientToken=tt;exports.isLineHeightValue=Ui;exports.isOpacityValue=Ki;exports.isRowHiddenForDevice=ss;exports.isSafeImageUrl=di;exports.isSpacingSideValue=nt;exports.isWidgetHiddenForDevice=us;exports.justifyContentAllowlist=Di;exports.normalizeCssClasses=Mn;exports.objectStyleAttributeRegistry=Rn;exports.overflowAllowlist=un;exports.phoneModeWidth=Er;exports.prepareRuleCMSWidgetData=kr;exports.resolveKey=mr;exports.resolveRowStyles=ls;exports.resolveWidgetApiOrigin=ei;exports.resolveWidgetContainerStyles=cs;exports.resolveWidgetInstanceProps=ds;exports.resolveWidgetLibraries=ku;exports.rowBasedPropertiesAreAssigned=is;exports.spacingKeywords=Pn;exports.spacingLengthUnits=mi;exports.tabletModeWidth=Tr;exports.textAlignAllowlist=Ei;exports.textDecorationAllowlist=Ti;exports.textTransformAllowlist=Ii;exports.toStyleAttr=re;exports.typeHasPrefix=Cr;exports.warnUnmatchedComponentProps=gs;exports.widgetBasedPropertiesAreAssigned=fs;
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,12 @@ export declare interface ComponentLibraryModule {
|
|
|
217
217
|
manifest: ComponentLibraryManifest;
|
|
218
218
|
components: Record<string, LibraryComponentEntry>;
|
|
219
219
|
editor?: ComponentLibraryEditorSurface;
|
|
220
|
+
/**
|
|
221
|
+
* Optional SSR-safe CSS for pseudo-classes the library's cards cannot
|
|
222
|
+
* express as inline styles (`:hover`, `:focus-visible`, `:active`).
|
|
223
|
+
* widget-svelte injects each distinct sheet once per render tree.
|
|
224
|
+
*/
|
|
225
|
+
stylesheet?: string;
|
|
220
226
|
}
|
|
221
227
|
|
|
222
228
|
declare type ComponentLibraryModuleResolvable = ComponentLibraryModule | {
|
|
@@ -268,11 +274,6 @@ export declare type ComponentPropsMap = {
|
|
|
268
274
|
[key: string]: WidgetInstanceProps;
|
|
269
275
|
};
|
|
270
276
|
|
|
271
|
-
/**
|
|
272
|
-
* Composes loaded library modules into the single plugin the render pipeline
|
|
273
|
-
* consumes. Default library entries keep bare keys; all other libraries are
|
|
274
|
-
* namespaced "libraryId/type" (see resolve-key.ts).
|
|
275
|
-
*/
|
|
276
277
|
export declare function composeSourceComponentsPlugin(modules: Map<string, ComponentLibraryModule>): SourceComponentsPlugin;
|
|
277
278
|
|
|
278
279
|
export declare type ConfigLibrariesMap = Record<string, ConfigLibraryDescriptor>;
|
|
@@ -936,6 +937,12 @@ export declare interface LibraryCardInputs {
|
|
|
936
937
|
};
|
|
937
938
|
className?: string;
|
|
938
939
|
widgetInstanceProps?: WidgetInstanceProps;
|
|
940
|
+
/**
|
|
941
|
+
* Host-supplied map of mount name → Svelte component. Only `r-mount`
|
|
942
|
+
* reads this. Absent in the composer, and absent whenever the host
|
|
943
|
+
* passed no `mounts` on `RuleCMSWidget`.
|
|
944
|
+
*/
|
|
945
|
+
mounts?: MountsMap;
|
|
939
946
|
}
|
|
940
947
|
|
|
941
948
|
export declare type LibraryComponentEntry = {
|
|
@@ -961,6 +968,15 @@ export declare type LineHeightValue = ({
|
|
|
961
968
|
value: number;
|
|
962
969
|
} & CssVariableCarrier) | SpacingSideValue;
|
|
963
970
|
|
|
971
|
+
/**
|
|
972
|
+
* Host-app components `r-mount` can render, keyed by the name an author
|
|
973
|
+
* types in the composer. The name is a map lookup, not a string that
|
|
974
|
+
* becomes code. A miss is a placeholder.
|
|
975
|
+
*/
|
|
976
|
+
export declare type MountsMap = {
|
|
977
|
+
[name: string]: Component;
|
|
978
|
+
};
|
|
979
|
+
|
|
964
980
|
export declare type NoContainerResolverContext = {
|
|
965
981
|
componentAttributes?: {
|
|
966
982
|
[key: string]: any;
|
|
@@ -1190,6 +1206,12 @@ export declare interface RuleCMSWidgetRawData {
|
|
|
1190
1206
|
|
|
1191
1207
|
export declare interface SourceComponentsPlugin {
|
|
1192
1208
|
components: Record<string, LibraryComponentEntry>;
|
|
1209
|
+
/**
|
|
1210
|
+
* CSS strings collected from each loaded library's optional `stylesheet`.
|
|
1211
|
+
* Injected once per widget/composer tree as SSR `<style>` tags. Absent when
|
|
1212
|
+
* no referenced library shipped any CSS.
|
|
1213
|
+
*/
|
|
1214
|
+
stylesheets?: string[];
|
|
1193
1215
|
}
|
|
1194
1216
|
|
|
1195
1217
|
export declare type SpacingCapabilities = {
|