@plitzi/plitzi-sdk 0.35.1 → 0.35.2
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/CHANGELOG.md +32 -0
- package/dist/plitzi-sdk.js +58 -58
- package/dist/plitzi-sdk.js.gz +0 -0
- package/dist/withElement-Nj-YY2Rh.js +5 -0
- package/package.json +12 -12
- package/dist/withElement-aG4S-kGR.js +0 -5
package/dist/plitzi-sdk.js.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-CxhCXM28.js";import{Component as t,Fragment as r,Profiler as n,Suspense as i,createContext as a,createElement as s,isValidElement as o,lazy as l,use as u,useCallback as c,useContext as d,useEffect as h,useId as f,useLayoutEffect as p,useMemo as m,useRef as y,useState as g,useSyncExternalStore as b}from"react";import{jsx as w}from"react/jsx-runtime";var v=a(void 0);v.displayName="ElementContext";var x=e=>!1!==e&&"false"!==e,k=(e,t)=>{let r=new Set(t),n={};for(let i in e)!r.has(i)&&Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},S=()=>{},M=class{items=[];notifying=0;dead=0;get length(){return this.items.length-this.dead}add(e){return this.items.push(e),()=>this.remove(e)}remove(e){let t=this.items.indexOf(e);if(-1===t)return;if(this.notifying>0)return this.items[t]=S,void this.dead++;let r=this.items.pop();t<this.items.length&&(this.items[t]=r)}begin(){this.notifying++}end(){0===--this.notifying&&this.dead>0&&this.compact()}forEach(e,t){this.begin();try{let r,{items:n}=this,i=n.length,a=0,s=!1;for(;a<i;)try{for(;a<i;a++)e(n[a])}catch(e){s||(s=!0,r=e),a++}if(s){if(!t)throw r;t(r)}}finally{this.end()}}clear(){if(this.notifying>0){let{items:e}=this;for(let t=0,r=e.length;t<r;t++)e[t]=S;return void(this.dead=e.length)}this.items.length=0,this.dead=0}compact(){let{items:e}=this,t=0;for(let r=0;r<e.length;r++)e[r]!==S&&(e[t++]=e[r]);e.length=t,this.dead=0}},A=(e,t)=>"function"==typeof e?!e(t):!1===e,P=e=>"object"==typeof e&&!!e&&!Array.isArray(e),T=(e,t)=>{if(!P(e)||!P(t))return t;let r={...e};for(let n of Object.keys(t))"__proto__"!==n&&(r[n]=n in e?T(e[n],t[n]):t[n]);return r},_=/* @__PURE__ */new Map,N=e=>{let t=_.get(e);return void 0===t&&(t=e.split("."),_.size>=512&&_.delete(_.keys().next().value),_.set(e,t)),t},D=/* @__PURE__ */new Map;function j(e,t){let r=Array.isArray(t);if("string"!=typeof t&&!r||r&&!t.length||"string"==typeof t&&!t)return e;if("string"==typeof t&&-1===t.indexOf("."))return"object"==typeof e&&e&&t in e?e[t]:void 0;if("string"==typeof t)return(e=>{let t=D.get(e);if(!t){if(t=(e=>{if(1===e.length){let t=e[0];return e=>"object"==typeof e&&e&&t in e?e[t]:void 0}return t=>{let r=t;for(let n=0;n<e.length;n++){if("object"!=typeof r||!r)return;r=r[e[n]]}return r}})(N(e)),D.size>=512){let e=D.keys().next().value;D.delete(e)}D.set(e,t)}return t})(t)(e);let n=e;for(let i of t){if("object"!=typeof n||!n||!(i in n))return;n=n[i]}return n}var C,O=Symbol("unchanged"),W=e=>/^\d+$/.test(e),E=e=>Array.isArray(e)?e.slice():{...e},$=(e,t,r,n,i)=>{let a=t[r],s="object"==typeof e&&e?e:{};if(r===t.length-1){let e=s[a],t=i?n(e):n;if(e===t)return O;let r=E(s);return r[a]=t,r}let o=$(s[a],t,r+1,n,i);if(o===O)return O;let l=E(s);return l[a]=o,l},F=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,z=e=>F.test(e)?`.${e}`:`[${JSON.stringify(e)}]`,I=e=>F.test(e)?e:JSON.stringify(e),Y=e=>{let t=e.length,r="";for(let a=0;a<t-1;a++){let t=0===a?"o":"_"+(a-1);r+=`var _${a}=${t}==null?void 0:${t}${z(e[a])};\n`}let n=t>1?"_"+(t-2):"o";r+=`var _p=${n}==null?void 0:${n}${z(e[t-1])};\n`,r+="var _v=f?v(_p):v;\nif(_p===_v)return null;\n";let i="_v";for(let a=t-1;a>=0;a--)i=`{...${0===a?"o":`(_${a-1}||{})`},${I(e[a])}:${i}}`;return r+=`return ${i};`,Function("o","v","f",r)},H=/* @__PURE__ */new Map,q=(e,t,r)=>{if("object"!=typeof e||!e)return O;let n=e,i=t[r];if(!Object.hasOwn(n,i))return O;if(r===t.length-1){let e=E(n);return Array.isArray(e)?e.splice(Number(i),1):delete e[i],e}let a=q(n[i],t,r+1);if(a===O)return O;let s=E(n);return s[i]=a,s},L=(e,t,r,n,i)=>{let a=((e,t)=>{if(!(()=>{if(typeof window>"u")return!1;if(void 0===C)try{Y(["x","y"])({x:{}},1,!1),C=!0}catch{C=!1}return C})())return;let r=H.get(e);if(r)return r;if(t.some(W))return;let n=Y(t);return H.size>=256&&H.delete(H.keys().next().value),H.set(e,n),n})(t,r);if(a){let t=a(e,n,i);return null===t?O:t}return $(e,r,0,n,i)},B=Symbol("@plitzi/nexus/cancel"),U=(()=>{try{return"production"}catch{}return"production"})(),V="production"===U,R=!V,X="test"===U;var Z=e=>"number"==typeof e||""===e||isNaN(Number(e))?e:Number(e),Q=e=>Array.isArray(e)?e.slice():{...e},G=(e,t,r,n)=>{let i=Z(t[r]),a=Q(e);return a[i]=r===t.length-1?n:G(e[i]??{},t,r+1,n),a},J=Symbol("no-error"),K=(e,t,r)=>{let n=0,i=J;for(;n<r;)try{for(;n<r;n++)e[n](t)}catch(e){i===J&&(i=e),n++}return i},ee="__proto__";var te=class{subscribers=null;children=null},re=class{direct=/* @__PURE__ */new Map;descendants=/* @__PURE__ */new Map;root=new te;size=0;add(e,t){let r=N(e),n=this.direct.get(e);if(!n){n=new M,this.direct.set(e,n);let t=this.root;for(let e of r){t.children||(t.children=/* @__PURE__ */new Map);let r=t.children.get(e);r||(r=new te,t.children.set(e,r)),t=r}t.subscribers=n,this.size++;let i="";for(let n=0;n<r.length-1;n++){i=i?`${i}.${r[n]}`:r[n];let t=this.descendants.get(i);t||(t=/* @__PURE__ */new Set,this.descendants.set(i,t)),t.add(e)}}return n.add(t),()=>this.remove(e,n,t,r)}remove(e,t,r,n){if(this.direct.get(e)!==t||(t.remove(r),t.length>0))return;this.direct.delete(e),this.size--;let i=this.root;for(let s of n){if(!i.children)return;let e=i.children.get(s);if(!e)return;i=e}i.subscribers===t&&(i.subscribers=null);let a="";for(let s=0;s<n.length-1;s++){a=a?`${a}.${n[s]}`:n[s];let t=this.descendants.get(a);t&&(t.delete(e),0===t.size&&this.descendants.delete(a))}}walkAncestors(e,t){let r=this.root;for(let n of e){if(!r.children)return;let e=r.children.get(n);if(!e)return;r=e,r.subscribers&&t(r.subscribers)}}getDescendants(e){return this.descendants.get(e)}forEachAffected(e,t,r){let n=e=>{e&&e.forEach(t,r)};if("string"!=typeof e)return void this.direct.forEach(n);let i=N(e);this.walkAncestors(i,n),this.descendants.get(e)?.forEach(e=>n(this.direct.get(e)))}clear(){this.direct.clear(),this.descendants.clear(),this.root.children=null,this.root.subscribers=null,this.size=0}},ne=0;function ie(e,t){let r,n,i,a={},s=new M,o=new M,l=new re,u=new M,c=()=>{0!==u.length&&u.forEach(e=>e())},d=[],h=[],f=[],p=t?.parent,m=++ne,y=(e,t,r)=>{if(0===h.length)throw e;let n={error:e,phase:t,path:r};for(let i=0,a=h.length;i<a;i++)h[i](n)},g=()=>a,b=()=>r??={...a},{getState:w,getPath:v,invalidate:x,resetCache:k,getMergeCount:S}=function(e,t,r,n){if(!r)return{getState:t,getPath:t=>j(e(),t),invalidate:()=>{},resetCache:()=>{},getMergeCount:()=>0};let i,a=r,s=n&&n.length>0?new Set(n):void 0,o=!0,l=!1,u=0,c=/* @__PURE__ */new Map,d=()=>((o||void 0===i)&&(i=(()=>{u++;let e=t(),r=T(a.getState(),e);if(s)for(let t of s)void 0!==e[t]&&(r[t]=e[t]);return r})(),o=!1),i);return{getState:d,getPath:t=>{if(l)c.clear(),l=!1;else if(c.has(t))return c.get(t);let r=(t=>{if(s){let r=t.indexOf("."),n=-1===r?t:t.slice(0,r);if(s.has(n)&&void 0!==e()[n])return j(e(),t)}let r=j(e(),t);if(void 0===r)return a.getPath(t);let n=a.getPath(t);return void 0!==n&&P(r)&&P(n)?j(d(),t):r})(t);return c.set(t,r),r},invalidate:()=>{o=!0,l=!0},resetCache:()=>{c.clear(),i=void 0,o=!0,l=!1},getMergeCount:()=>u}}(g,b,p,t?.exclusive),A=()=>{x(),c()},_=!1;p&&(k(),i=p.subscribeInvalidate?.(A));let{setState:D,batch:C}=function(e){let{getOwnState:t,getOwnSnapshot:r,setOwnState:n,mutateOwnKey:i,deleteOwnKey:a,parent:s,listeners:o,pathListeners:l,changeListeners:u,interceptors:c,readOnly:d,reportError:h,invalidateDescendants:f,onDelegateToParent:p}=e,m=e=>{if(0===d.length||!(e=>{for(let t=0,r=d.length;t<r;t++){let r=d[t];if(e===r||e.startsWith(`${r}.`)||r.startsWith(`${e}.`))return!0}return!1})(e))return!1;if(R)throw Error(`@plitzi/nexus: refused to write to read-only path "${e}"`);return!0},y=(e,t,r)=>{let n=t;for(let i=0,a=c.length;i<a;i++){let a;try{a=c[i]({path:e,value:n,prev:r})}catch(t){return h(t,"beforeChange",e),B}if(a===B)return B;void 0!==a&&(n=a)}return n},g=0,b=/* @__PURE__ */new Set,w=(e,t)=>{let{items:r}=e;if(g>0)for(let n=0,i=r.length;n<i;n++)b.add(r[n]);else if(0!==r.length){e.begin();try{let e=K(r,t,r.length);e!==J&&h(e,"notify",t)}finally{e.end()}}},v=(e,t,r)=>{let n={path:e,prev:t,next:r,prevValue:void 0===e?t:j(t,e),nextValue:void 0===e?r:j(r,e)},{items:i}=u;u.begin();try{let t=K(i,n,i.length);t!==J&&h(t,"onChange",e)}finally{u.end()}},x=(e,t,r,n)=>{let i=l.getDescendants(e);if(i)for(let a of i){let i=l.direct.get(a);if(!i)continue;let s=N(a).slice(n);j(t,s)!==j(r,s)&&w(i,e)}},k=(e,t,r,i,a)=>{let s=e?j(r,e):void 0,h=e?a?t(s):t:void 0;if(e&&c.length>0){let t=y(e,h,s);if(t===B)return;h=t}if(e&&s===h)return;let p=e?((e,t,r)=>{if("string"==typeof t){if(!t)return r;let n=N(t);if(1===n.length){let t=Q(e);return t[Z(n[0])]=r,t}return G(e,n,0,r)}return Array.isArray(t)&&t.length?G(e,t,0,r):r})(r,e,h):a?t(r):{...r,...t};if(!e&&c.length>0){let e=y(void 0,p,r);if(e===B)return;p=e}if(p!==r){if(d.length>0)for(let e=0,t=d.length;e<t;e++){let t=d[e];if(j(r,t)!==j(p,t)){if(R)throw Error(`@plitzi/nexus: refused to write to read-only path "${d[e]}"`);return}}n(p),u.length>0&&v(e,r,p),f(),i&&(w(o,e),l.size>0&&l.direct.forEach((t,n)=>{j(r,n)!==j(p,n)&&w(t,e)}))}};return{setState:(e,d,h={})=>{let{canPropagate:g=!0,unmount:b=!1,raw:S=!1}=h,M=t(),A=!S&&"function"==typeof d;if("string"==typeof e&&-1!==e.indexOf(ee)&&-1!==N(e).indexOf(ee))throw Error(`@plitzi/nexus: refused to write to unsafe path "${e}" (\`__proto__\` segment)`);if("string"==typeof e&&m(e))return;if(s&&"string"==typeof e&&!(-1===e.indexOf(".")?Object.hasOwn(M,e):((e,t)=>{let r=e;for(let n=0,i=t.length;n<i;n++){if("object"!=typeof r||!r||!Object.hasOwn(r,t[n]))return!1;r=r[t[n]]}return!0})(M,N(e))))return p?.(e),void s.setState(e,d,{canPropagate:g,unmount:b,raw:S});if("string"!=typeof e)return void k(e,d,M,g,A);if(-1===e.indexOf(".")){if(b){if(!Object.hasOwn(M,e))return;let t=M[e];if(c.length>0&&y(e,void 0,t)===B)return;let n=u.length>0?r():void 0;if(a(e),void 0!==n&&v(e,n,r()),g&&(w(o,e),l.size>0)){let r=l.direct.get(e);r&&w(r,e),x(e,t,void 0,1)}return void f()}let t=M[e],n=A?d(t):d,s=n;if(c.length>0){let r=y(e,n,t);if(r===B)return;s=r}if(t===s)return;let h=u.length>0?r():void 0;if(i(e,s),void 0!==h&&v(e,h,r()),g&&(w(o,e),l.size>0)){let r=l.direct.get(e);r&&w(r,e),x(e,t,s,1)}return void f()}let P,T=N(e);if(b){if(c.length>0&&y(e,void 0,j(M,e))===B)return;P=((e,t)=>q(e,t,0))(M,T)}else if(c.length>0){let t=j(M,e),r=A?d(t):d,n=y(e,r,t);if(n===B)return;P=L(M,e,T,n,!1)}else P=L(M,e,T,d,A);if(P===O)return;let _=P;n(_),u.length>0&&v(e,M,_),g&&(w(o,e),l.size>0&&(((e,t)=>{l.walkAncestors(t,t=>w(t,e))})(e,T),x(e,M,_,0))),f()},batch:e=>{g++;try{return e()}finally{if(g--,0===g&&b.size>0){let e=[...b];b.clear();let t=K(e,void 0,e.length);t!==J&&h(t,"notify",void 0)}}}}}({getOwnState:g,getOwnSnapshot:b,setOwnState:e=>{a=e,r=void 0,x()},mutateOwnKey:(e,t)=>{a[e]=t,x(),r=void 0},deleteOwnKey:e=>{delete a[e],x(),r=void 0},parent:p,listeners:s,pathListeners:l,changeListeners:o,interceptors:d,readOnly:t?.readOnly??[],reportError:y,invalidateDescendants:c,onDelegateToParent:R&&p?e=>p.scopeClaims?.claimDelegatedWrite(e,m):void 0}),W=()=>{n&&(n.unsubscribe(),n=void 0,k())},E=()=>{p&&(!_&&(s.length>0||l.size>0||o.length>0)?!n&&p&&(x(),k(),n=function(e,t,r,n,i,a,s){let o;return{unsubscribe:e.subscribe(e=>{s();let l=e;if(t.forEach(t=>t(e),e=>a(e,"notify",l)),r.size>0&&r.forEachAffected(e,t=>t(e),e=>a(e,"notify",l)),n.length>0){let e=i(),t=o??e,r={path:l,prev:t,next:e,prevValue:void 0===l?t:j(t,l),nextValue:void 0===l?e:j(e,l)};o=e,n.forEach(e=>e(r),e=>a(e,"onChange",l))}}),seedBaseline:()=>{o??=i()}}}(p,s,l,o,w,y,x),o.length>0&&n.seedBaseline()):W())},$=e=>(E(),()=>{e(),E()}),F=e=>$(s.add(e)),z=(e,t)=>$(l.add(e,t)),I=e=>{let t=$(o.add(e));return n?.seedBaseline(),t};a="function"==typeof e?e(D,w):e;let Y={id:t?.id,scopePath:t?.scopePath,getState:w,getOwnState:b,getPath:v,setState:D,get:e=>void 0===e?w():v(e),set:D,watch:(e,t)=>"function"==typeof e?F(e):z(e,t),withBase:e=>{let t=(t,r,n)=>D(void 0===t?e:`${e}.${t}`,r,n);return{getState:t=>{let r=v(e);return void 0===r&&void 0!==t?t:r},getPath:(t,r)=>{let n=v(`${e}.${t}`);return void 0===n&&void 0!==r?r:n},setState:t,subscribe:t=>z(e,t),subscribePath:(t,r)=>z(`${e}.${t}`,r),get:t=>v(void 0===t?e:`${e}.${t}`),set:t,watch:(t,r)=>"function"==typeof t?z(e,t):z(`${e}.${t}`,r)}},batch:C,subscribe:F,subscribePath:z,subscribeChange:I,destroy:()=>{_=!0,W(),s.clear(),l.clear(),o.clear(),u.clear(),i?.(),R&&p&&p.scopeClaims?.releaseScope(m)},reconnect:()=>{_=!1,p&&(i?.(),i=p.subscribeInvalidate?.(A)),E()},subscribeInvalidate:e=>u.add(e),hydrate:()=>{for(let e of f)e()}};if(t?.middlewares)for(let M of t.middlewares){let e=M(Y);e?.beforeChange&&d.push(e.beforeChange),e?.onChange&&I(e.onChange),e?.onError&&h.push(e.onError);let r=e?.hydrate;r&&(t.deferHydrate?f.push(()=>r(Y)):r(Y))}return R&&(Y.scopeClaims=(()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map;return{claimDelegatedWrite(r,n){let i=e.get(r);if(void 0!==i){if(i===n)return;if(X)throw Error((e=>`@plitzi/nexus: scope collision — two sibling scopes under the same parent both delegate a write to "${e}", clobbering each other through the shared parent. Write to a path each scope owns, or move the shared value into the parent and update it there.`)(r));return}e.set(r,n);let a=t.get(n);a?a.add(r):t.set(n,/* @__PURE__ */new Set([r]))},releaseScope(r){let n=t.get(r);if(n){for(let t of n)e.delete(t);t.delete(r)}}}})()),X&&(Y.listeners=s,Y.pathListeners=l,Y.changeListeners=o,Y.interceptors=d,Y.errorHandlers=h,Y.invalidateListeners=u,Y.getMergeCount=S),Y}var ae=a(void 0);ae.displayName="StoreContext";var se=a(void 0);se.displayName="StoreRegistryContext";var oe=(e,t)=>{for(let r=e;r;r=r.parent)if(r.id===t)return r.store},le=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0};function ue(e,t,r){let n=d(ae),i=d(se);if(e)return e;if(void 0!==r){let e=oe(i,r);if(!e)throw Error(`${t}: no store registered with id "${r}" in any ancestor StoreProvider`);return e}if(!n)throw Error(`${t} must be used inside a StoreProvider`);return n}function ce(e,t,r){let n=t.current.length;return m(()=>Array.from({length:n},(r,n)=>(r,i)=>{let a=t.current[n],s="function"==typeof a?a(e.getState()):a;e.setState(s,r,i)}),[e,r])}var de=typeof window<"u"?p:h,he=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(!Object.is(e[i],t[i]))return!1;return!0};function fe(e,t,r={}){let n=r,i=ue(n.store,"useStoreSync",n.storeId);Array.isArray(e)?function(e,t,r,n){let{mode:i="sync",enabled:a=!0,syncStrategy:s="afterRender",raw:o=!1}=n,l=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),u=y(!1),c=!u.current;u.current=!0;let d=y(void 0),h=a&&(c||"sync"===i&&r.some((e,t)=>!Object.is(d.current?.[t],e))),f=(n=!0)=>{d.current=r,e.batch(()=>{t.forEach((t,i)=>{let a="function"==typeof t?t(e.getState()):t;e.setState(a,r[i],{canPropagate:n,raw:o})})})};"render"===s?h&&f():(h&&c&&f(!1),de(()=>{h&&!c&&f()},[h,r,l]))}(i,e,t,r):function(e,t,r,n){let i=void 0===t,a="function"==typeof t,s=i?he:Object.is,{mode:o="sync",enabled:l=!0,equalityFn:u=s,syncStrategy:c="afterRender",raw:d=!1}=n,h=y(void 0),f=y(!1),p=!f.current;f.current=!0;let m=h.current,g=l&&(p||"sync"===o&&(void 0===m||!u(m,r))),b=(n=!0)=>{if(h.current=r,i)e.setState(void 0,e=>({...e,...r}),{canPropagate:n});else if(a){let i=t(e.getState());e.setState(i,r,{canPropagate:n,raw:d})}else e.setState(t,r,{canPropagate:n,raw:d})};"render"===c?g&&b():(g&&p&&b(!1),de(()=>{g&&!p&&b()},[g,r,t]))}(i,e,t,r)}var pe=[];var me=()=>({useStore:function(e,t){return function(e,t={}){let r=ue(t.store,"useStore",t.storeId),n=Array.isArray(e),i=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=void 0===t,s=r.equalityFn??(a?he:Object.is),o=r.transformer,l=y(o);l.current=o;let u=m(()=>function(e,t){return()=>{if("string"==typeof t)return e.getPath(t);if("function"==typeof t){let r=e.getState();return j(r,t(r))}return e.getState()}}(e,t),[e,t]),d=y(u()),h=m(()=>r=>i&&"mount"!==n?"string"==typeof t?e.subscribePath(t,r):e.subscribe(r):()=>{},[i,n,t,e]),f=()=>{if(!i)return d.current;if("mount"===n)return u();let e=u();return s(d.current,e)?d.current:(d.current=e,e)},p=b(h,f,f);return[m(()=>l.current?l.current(p):p,[p]),c((r,n)=>{a?e.setState(void 0,r,n):"function"==typeof t?e.setState(t(e.getState()),r,n):e.setState(t,r,n)},[e,t])]}(r,n?void 0:e,n?{...t,enabled:!1,transformer:void 0}:t),a=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=r.equalityFn??le,s=r.transformer,o=y(s);o.current=s;let l=y(t);l.current=t;let u=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),d=y(null),h=m(()=>function(e,t,r,n={}){let{equalityFn:i=le}=n;return()=>{let n=t.current,a=n.some(e=>"function"==typeof e)?e.getState():void 0,s=n.map(t=>"function"==typeof t?j(a,t(a)):e.getPath(t)),o=r.current;return null!==o&&i(o,s)?o:(r.current=s,s)}}(e,l,d,{equalityFn:a}),[e,u,a]),f=function(e,t,r,n,i){return m(()=>r=>{if(!n||"mount"===i)return()=>{};let a=t.current;if(a.some(e=>"function"==typeof e))return e.subscribe(r);let s=a.map(t=>e.subscribePath(t,r));return()=>s.forEach(e=>e())},[e,r,n,i])}(e,l,u,i,n),p=function(e,t,r,n){let i=c(()=>{if(!r){let e=n.current??t();return n.current=e,e}return t()},[r,t,n]);return b(e,i,i)}(f,h,i,d);return[m(()=>o.current?o.current(p):p,[p]),...ce(e,l,u)]}(r,n?e:pe,n?t:{...t,enabled:!1,transformer:void 0});return n?a:i}(e,t)},useStoreSync:function(e,t,r){fe(e,t,r)},useStoreGetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n=Array.isArray(e)?e:void 0,i="object"!=typeof e||Array.isArray(e)?t:e,a=ue(i?.store,"useStoreGetter",i?.storeId),s=n?.map(e=>"function"==typeof e?e.toString():e).join("|");return m(()=>{if(n)return n.map(e=>(t,r)=>{let n="function"==typeof e?e(a.getState()):j(a.getState(),e);if(void 0!==t){let e=j(n,t);return void 0===e&&void 0!==r?r:e}return void 0===n&&void 0!==r?r:n});if(void 0!==r){let e=a.withBase(r);return(t,r)=>void 0===t?void 0===r?e.getState():e.getState(r):void 0===r?e.getPath(t):e.getPath(t,r)}return(e,t)=>{let r=a.getState();if(void 0!==e){let n=j(r,e);return void 0===n&&void 0!==t?t:n}return r}},[a,r,s])}(e,t)},useStoreSetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n="object"==typeof e?e:t,i=ue(n?.store,"useStoreSetter",n?.storeId);return m(()=>void 0===r?i.setState:i.withBase(r).setState,[i,r])}(e,t)}});function ye(e){return ue(void 0,"useStoreById",e)}var{useStore:ge,useStoreSync:be,useStoreGetter:we,useStoreSetter:ve}=me(),{useStore:xe,useStoreSync:ke,useStoreGetter:Se,useStoreSetter:Me}=me(),{useStore:Ae,useStoreSync:Pe,useStoreGetter:Te,useStoreSetter:_e}=me(),Ne=Symbol("twigArrowParams"),De=(e,t)=>e===t?0:null==e?-1:null==t?1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t)),je=e=>null==e?"":String(e),Ce=e=>"object"==typeof e&&!!e&&"__PLITZI_RAW__"===e.__marker,Oe=e=>Ce(e)?e.__raw:e,We={raw:e=>(e=>({__raw:e,__marker:"__PLITZI_RAW__"}))(e),to_json:e=>"object"==typeof e&&e?JSON.stringify(e):je(e),json_encode:e=>"object"==typeof e&&e?JSON.stringify(e):je(e),object_as_json:e=>"object"==typeof e&&e?JSON.stringify(e):e,default:(e,t)=>(e=>null==e||""===e)(e)?t[0]:e,upper:e=>"string"==typeof e?e.toUpperCase():e,lower:e=>"string"==typeof e?e.toLowerCase():e,trim:e=>"string"==typeof e?e.trim():e,capitalize:e=>"string"==typeof e&&e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():e,title:e=>"string"==typeof e?e.replace(/\b\w/g,e=>e.toUpperCase()):e,camelize:e=>"string"==typeof e?e.replace(/[-_]+(.)?/g,(e,t)=>t?t.toUpperCase():""):e,kebab:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e,snake:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():e,ltrim:e=>"string"==typeof e?e.trimStart():e,rtrim:e=>"string"==typeof e?e.trimEnd():e,pad:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?je(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return n.repeat(a).slice(0,i)+e},padRight:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?je(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return e+n.repeat(a).slice(0,i)},number:(e,t)=>{if("number"==typeof e){let r=Number(t[0])||0;return e.toFixed(r)}if("string"!=typeof e)return e;let r=e.match(/-?\d+(?:\.\d+)?/);return r?Number(r[0]):0},replace:(e,t)=>"string"!=typeof e||0===t.length?e:e.split(je(t[0])).join(je(t[1])),slice:(e,t)=>{if(0===t.length)return e;let r=Number(t[0])||0,n=t.length>1&&Number.isFinite(Number(t[1]))?r+Number(t[1]):void 0;return"string"==typeof e||Array.isArray(e)?e.slice(r,n):e},split:(e,t)=>"string"==typeof e&&t.length>0?e.split(je(t[0])):e,join:(e,t)=>Array.isArray(e)?e.join(0===t.length?"":je(t[0])):e,reverse:e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e,length:e=>"string"==typeof e||Array.isArray(e)?e.length:"number"==typeof e?je(e).length:"object"==typeof e&&e?Object.keys(e).length:0,first:e=>"string"==typeof e?e.length>0?e[0]:"":Array.isArray(e)?e.length>0?e[0]:void 0:e,last:e=>"string"==typeof e?e.length>0?e[e.length-1]:"":Array.isArray(e)?e.length>0?e[e.length-1]:void 0:e,contains:(e,t)=>{if(0===t.length)return!1;let r=t[0];return"string"==typeof e?e.includes(je(r)):!!Array.isArray(e)&&e.includes(r)},startswith:(e,t)=>"string"==typeof e&&t.length>0&&e.startsWith(je(t[0])),endswith:(e,t)=>"string"==typeof e&&t.length>0&&e.endsWith(je(t[0])),number_format:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?".":je(t[1]),i=null==t[2]?"":je(t[2]),a=e.toFixed(r);if(""===i)return a.replace(".",n);let s=a.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),s.join(n)},sort:(e,t)=>{if(!Array.isArray(e))return e;let r=[...e],n=t[0];if("function"==typeof n){let e=n;return(e[Ne]??1)>=2?r.sort((t,r)=>Number(e(t,r))):r.sort((t,r)=>De(e(t),e(r)))}return r.sort(De)},batch:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},map:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];return"function"==typeof r?e.map((e,t)=>r(e,t)):e},reduce:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];if("function"!=typeof r)return e;let n=t[1],i=+(void 0===n),a=void 0===n?e[0]:n;for(let s=i;s<e.length;s++)a=r(a,e[s],s);return a},merge:(e,t)=>{if(0===t.length)return e;let r=t[0];return Array.isArray(e)&&Array.isArray(r)?[...e,...r]:"object"==typeof e&&e&&"object"==typeof r&&r&&!Array.isArray(r)?{...e,...r}:e},keys:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e):e,values:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.values(e):e,filter:(e,t)=>{if(!Array.isArray(e))return e;if(0===t.length)return e.filter(Boolean);let r=t[0];if("function"==typeof r)return e.filter((e,t)=>r(e,t));let n=je(r);return e.filter(e=>{if("object"==typeof e&&e){let t=e[n];return null!=t&&!1!==t&&""!==t}return!!e})},column:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=je(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},url_encode:e=>"string"==typeof e?encodeURIComponent(e):"object"==typeof e&&e&&!Array.isArray(e)?new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,je(t)]))).toString():e,nl2br:e=>"string"==typeof e?e.replace(/\n/g,"<br>"):e,striptags:(e,t)=>{if("string"!=typeof e)return e;let r=t.length>0?je(t[0]).trim():"";if(r){let t=r.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map(e=>e.replace(/[/>]/g,"").trim());if(t.length>0){let r=RegExp(`<(?!/?(?:${t.join("|")})\\b)[^>]+>`,"gi");return e.replace(r,"").replace(/\s+/g," ").trim()}}return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()},abs:e=>"number"==typeof e?Math.abs(e):e,round:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?"common":je(t[1]),i=10**r;return"ceil"===n?Math.ceil(e*i)/i:"floor"===n?Math.floor(e*i)/i:Math.round(e*i)/i},format:(e,t)=>{if("string"!=typeof e)return e;let r=0;return e.replace(/%s|%d|%f|%%/g,e=>{if("%%"===e)return"%";let n=t[r];return r++,void 0===n?e:"%d"===e?String(Math.floor(Number(n))):"%f"===e?String(Number(n)):je(n)})},spaceless:e=>"string"==typeof e?e.replace(/>\s+</g,"><").trim():e,random:e=>Array.isArray(e)?e.length>0?e[Math.floor(Math.random()*e.length)]:void 0:"string"==typeof e?e.length>0?e[Math.floor(Math.random()*e.length)]:"":"number"==typeof e?Math.floor(Math.random()*e):e,date:(e,t)=>{if(0===t.length)return e;let r=je(t[0]),n=e instanceof Date?e:new Date(String(e));if(Number.isNaN(n.getTime()))return"";let i=e=>String(e).padStart(2,"0"),a={Y:String(n.getFullYear()),m:i(n.getMonth()+1),d:i(n.getDate()),H:i(n.getHours()),i:i(n.getMinutes()),s:i(n.getSeconds()),l:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][n.getDay()],F:["January","February","March","April","May","June","July","August","September","October","November","December"][n.getMonth()],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()]},s="";for(let o of r)s+=Object.prototype.hasOwnProperty.call(a,o)?a[o]:o;return s},base64_encode:e=>"string"==typeof e?(e=>{let t=(new TextEncoder).encode(e),r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)})(e):e,base64_decode:e=>"string"==typeof e?(e=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return(new TextDecoder).decode(r)})(e):e,md5:e=>"string"==typeof e?(e=>{let t=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],r=/* @__PURE__ */new Uint32Array(64);for(let p=0;p<64;p++)r[p]=Math.floor(4294967296*Math.abs(Math.sin(p+1)));let n=(new TextEncoder).encode(e),i=8*n.length,a=1+(n.length+8>>6)<<6,s=new Uint8Array(a);s.set(n),s[n.length]=128;let o=new DataView(s.buffer);o.setUint32(a-8,i>>>0,!0),o.setUint32(a-4,Math.floor(i/4294967296)>>>0,!0);let l=1732584193,u=4023233417,c=2562383102,d=271733878,h=(e,t)=>e<<t|e>>>32-t;for(let p=0;p<a;p+=64){let e=/* @__PURE__ */new Uint32Array(16);for(let t=0;t<16;t++)e[t]=o.getUint32(p+4*t,!0);let n=l,i=u,a=c,s=d;for(let o=0;o<64;o++){let l,u;o<16?(l=i&a|~i&s,u=o):o<32?(l=s&i|~s&a,u=(5*o+1)%16):o<48?(l=i^a^s,u=(3*o+5)%16):(l=a^(i|~s),u=7*o%16),l=l+n+r[o]+e[u]|0,n=s,s=a,a=i,i=i+h(l,t[o])|0}l=l+n|0,u=u+i|0,c=c+a|0,d=d+s|0}let f=e=>{let t="";for(let r=0;r<4;r++)t+=(e>>>8*r&255).toString(16).padStart(2,"0");return t};return f(l)+f(u)+f(c)+f(d)})(e):e,without:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(je),n={};for(let[i,a]of Object.entries(e))r.includes(i)||(n[i]=a);return n},only:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(je),n={};for(let[i,a]of Object.entries(e))r.includes(i)&&(n[i]=a);return n},find:(e,t)=>{if(!Array.isArray(e)||0===t.length)return;let r=t[0];if("function"==typeof r)return e.find((e,t)=>r(e,t));if(t.length<2)return;let n=je(r),i=t[1];return e.find(e=>"object"==typeof e&&e?e[n]===i:e===i)},pluck:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=je(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},unique:e=>Array.isArray(e)?[...new Set(e)]:e,flatten:e=>Array.isArray(e)?e.flat():e,sum:e=>Array.isArray(e)?e.reduce((e,t)=>e+("number"==typeof t?t:0),0):e,chunk:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},index_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=je(t[0]),n={};for(let i of e)"object"==typeof i&&i&&(n[String(i[r]??"")]=i);return n},group_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=je(t[0]),n={};for(let i of e)if("object"==typeof i&&i){let e=String(i[r]??"");n[e]=n[e]??[],n[e].push(i)}return n}},Ee=e=>!(null==e||!1===e||""===e||0===e||Array.isArray(e)&&0===e.length),$e=(e,t)=>"string"==typeof t?t.includes(String(e)):Array.isArray(t)?t.includes(e):!("object"!=typeof t||!t)&&String(e)in t,Fe=[],ze=class e{variables;keepEmptyTokens;breakFlag=!1;continueFlag=!1;hasSet=!1;constructor(e,t=!1){this.variables={...e},this.keepEmptyTokens=t}evalNodes(e){let t=e.length;if(0===t)return"";if(1===t)return this.evalNode(e[0]);let r="";for(let n=0;n<t&&(r+=this.evalNode(e[n]),!this.breakFlag&&!this.continueFlag);n++);return r}evalNode(e){switch(e.type){case"text":return e.value;case"variable":return this.evalVariable(e);case"if":return this.evalIf(e);case"for":return this.evalFor(e);case"set":return this.evalSet(e);case"apply":return this.evalApply(e);case"break":return this.breakFlag=!0,"";case"continue":return this.continueFlag=!0,""}}evalVariable(e){let t=this.evalExpression(e.expression);return!this.keepEmptyTokens||null!=t&&""!==t?Ce(t)?String(Oe(t)):"function"==typeof t?"":null!=t&&"object"!=typeof t?String(t):e.raw?null==t?"":String(t):"object"==typeof t&&t?JSON.stringify(t):"":e.source}evalIf(e){if(Ee(this.evalExpression(e.condition)))return this.evalNodes(e.body);for(let t of e.elseifClauses)if(Ee(this.evalExpression(t.condition)))return this.evalNodes(t.body);return e.elseBody?this.evalNodes(e.elseBody):""}evalFor(e){let t=this.evalExpression(e.collection);if(void 0!==e.source&&void 0===t)return e.source;let r,n=null;if(null!==e.keyVar){let i=(e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e):null)(t);if(!i||0===i.length)return e.elseBody?this.evalNodes(e.elseBody):"";let a=i.length;n=Array(a),r=Array(a);for(let e=0;e<a;e++)n[e]=i[e][0],r[e]=i[e][1]}else{let n=(e=>Array.isArray(e)?e:"object"==typeof e&&e?Object.values(e):null)(t);if(!n||0===n.length)return e.elseBody?this.evalNodes(e.elseBody):"";r=n}return this.runLoop(e,r,n)}runLoop(e,t,r){let{valueVar:n,keyVar:i,body:a}=e,s=t.length,o=this.variables.loop,l={index:0,index0:0,first:!1,last:!1,length:s,revindex:0};this.variables.loop=l;let u="";for(let c=0;c<s;c++){if(l.index=c+1,l.index0=c,l.first=0===c,l.last=c===s-1,l.revindex=s-c,null!==r&&null!==i&&(this.variables[i]=r[c]),this.variables[n]=t[c],u+=this.evalNodes(a),this.breakFlag){this.breakFlag=!1;break}this.continueFlag&&=!1}return void 0===o?delete this.variables.loop:this.variables.loop=o,u}evalSet(e){return this.hasSet=!0,this.variables[e.name]=Array.isArray(e.value)?this.evalNodes(e.value):this.evalExpression(e.value),""}evalApply(e){let t=this.applyFilters(this.evalNodes(e.body),e.filters);return Ce(t)?String(Oe(t)):"object"==typeof t&&t?JSON.stringify(t):null==t?"":String(t)}applyFilters(e,t){let r=e;for(let n of t){let e=We[n.name];void 0!==e&&(r=e(r,0===n.args.length?Fe:this.evalArgs(n.args)))}return r}evalArgs(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[n]=this.evalExpression(e[n]);return r}evalExpression(e){switch(e.type){case"literal":return e.value;case"array":{let t=e.elements,r=Array(t.length);for(let e=0;e<t.length;e++)r[e]=this.evalExpression(t[e]);return r}case"object":{let t={};for(let r of e.entries){let e=this.evalExpression(r.key);t["string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):""]=this.evalExpression(r.value)}return t}case"range":return this.evalRange(e.start,e.end);case"path":return this.resolvePath(e.segments);case"index":return this.resolveIndex(e.object,e.index);case"function":return this.evalFunction(e.name,e.args);case"filter":return this.applyFilters(this.evalExpression(e.subject),e.filters);case"concat":{let t=e.parts,r=t.length,n="";for(let e=0;e<r;e++){let r=this.evalExpression(t[e]);n+=null==r?"":String(r)}return n}case"unary":return"-"===e.operator?-Number(this.evalExpression(e.operand)):!Ee(this.evalExpression(e.operand));case"binary":return this.evalBinary(e.operator,e.left,e.right);case"default":return this.evalExpression(e.value)??this.evalExpression(e.defaultExpr);case"ternary":return Ee(this.evalExpression(e.condition))?this.evalExpression(e.trueExpr):this.evalExpression(e.falseExpr);case"arrow":return this.createArrowFunction(e.params,e.body)}}createArrowFunction(t,r){let n={...this.variables},i=this.keepEmptyTokens,a=(...a)=>{let s=new e(n,i);for(let e=0;e<t.length;e++)s.variables[t[e]]=a[e];return s.evalExpression(r)};return a[Ne]=t.length,a}resolvePath(e){let t=e.length;if(0===t)return;let r=this.variables[e[0]];for(let n=1;n<t;n++){if(null==r)return;r=r[e[n]]}return r}resolveIndex(e,t){let r=this.evalExpression(e);if(null==r)return;let n=this.evalExpression(t);return null!=n?r[String(n)]:void 0}evalRange(e,t){let r=Number(this.evalExpression(e)),n=Number(this.evalExpression(t)),i=r<=n,a=1+(i?n-r:r-n),s=Array(a);for(let o=0;o<a;o++)s[o]=i?r+o:r-o;return s}evalFunction(e,t){let r=this.evalArgs(t);switch(e){case"cycle":{let e=r[0],t=r[1];return Array.isArray(e)&&"number"==typeof t?e[t%e.length]:""}case"max":return this.minMax(r,Math.max);case"min":return this.minMax(r,Math.min);case"range":return this.rangeFunction(r);default:return""}}minMax(e,t){return 0===e.length?void 0:t(...1===e.length&&Array.isArray(e[0])?e[0]:e)}rangeFunction(e){if(0===e.length)return[];if(1===e.length){let t=Number(e[0]),r=Array(t+1);for(let e=0;e<=t;e++)r[e]=e;return r}let t=Number(e[0]),r=Number(e[1]),n=e.length>2?Number(e[2]):t<=r?1:-1;if(0===n)return[];let i=Math.floor((n>0?r-t:t-r)/Math.abs(n))+1;if(i<=0)return[];let a=Array(i);for(let s=0;s<i;s++)a[s]=t+s*n;return a}evalBinary(e,t,r){if("or"===e)return Ee(this.evalExpression(t))||Ee(this.evalExpression(r));if("and"===e)return Ee(this.evalExpression(t))&&Ee(this.evalExpression(r));let n=this.evalExpression(t),i=this.evalExpression(r),a="number"==typeof n&&"number"==typeof i;switch(e){case"+":return a?n+i:Number(n)+Number(i);case"-":return a?n-i:Number(n)-Number(i);case"*":return a?n*i:Number(n)*Number(i);case"/":return a?n/i:Number(n)/Number(i);case"%":return a?n%i:Number(n)%Number(i);case"==":return n===i||String(n)===String(i);case"!=":return n!==i&&String(n)!==String(i);case">":return a?n>i:Number(n)>Number(i);case"<":return a?n<i:Number(n)<Number(i);case">=":return a?n>=i:Number(n)>=Number(i);case"<=":return a?n<=i:Number(n)<=Number(i);case"in":return $e(n,i);case"not in":return!$e(n,i);case"is":return n===i;case"is not":return n!==i;default:return!1}}},Ie=(e,t)=>e[t],Ye=(e,t)=>{let r=t.indexOf(".");if(-1===r)return e[t];let n=e[t.slice(0,r)],i=r+1,a=t.length;for(;i<a;){if(null==n)return;let e=t.indexOf(".",i);if(-1===e)return n[t.slice(i)];n=n[t.slice(i,e)],i=e+1}return n},He=e=>null==e?"":"object"==typeof e?JSON.stringify(e):String(e),qe=e=>{try{return JSON.parse(e)||e}catch{return e}},Le=41,Be=e=>e>=97&&e<=122||e>=65&&e<=90||95===e,Ue=e=>Be(e)||e>=48&&e<=57,Ve=e=>Ue(e)||45===e,Re=e=>e>=48&&e<=57,Xe=e=>32===e||9===e||10===e||13===e,Ze=e=>{let t=e.length;if(0===t||!Be(e.charCodeAt(0)))return!1;for(let r=1;r<t;r++)if(!Ue(e.charCodeAt(r)))return!1;return!0},Qe=e=>{let t=e.length;if(0===t||!Be(e.charCodeAt(0)))return!1;let r=!1,n=!1;for(let i=1;i<t;i++){let t=e.charCodeAt(i);if(46!==t){if(r){if(n=Re(t),!n&&!Be(t))return!1;r=!1}else if(n?!Re(t):!Ue(t))return!1}else{if(r)return!1;r=!0,n=!1}}return!r},Ge=e=>Ze(e),Je=(e,t)=>t?`{{{${e}}}}`:`{{${e}}}`,Ke=e=>{switch(e.type){case"text":return e.value;case"variable":return Je(e.content,e.raw);case"tag":return`{%${e.content}%}`}},et=class{src;pos=0;constructor(e){this.src=e}eof(){return this.pos>=this.src.length}peek(){return this.pos<this.src.length?this.src.charCodeAt(this.pos):-1}at(e){let t=this.pos+e;return t<this.src.length?this.src.charCodeAt(t):-1}skipWs(){for(;this.pos<this.src.length&&Xe(this.src.charCodeAt(this.pos));)this.pos++}scanName(){let e=this.pos;if(!this.eof()&&Be(this.src.charCodeAt(this.pos)))for(this.pos++;!this.eof()&&Ve(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanIndex(){let e=this.pos;for(;!this.eof()&&Re(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanStringLiteral(){let e=this.src.charCodeAt(this.pos);this.pos++;let t="";for(;this.pos<this.src.length&&this.src.charCodeAt(this.pos)!==e;)if(92===this.src.charCodeAt(this.pos)&&this.pos+1<this.src.length){this.pos++;let r=this.src.charCodeAt(this.pos);t+=110===r?"\n":116===r?"\t":114===r?"\r":92===r?"\\":r===e?String.fromCharCode(r):String.fromCharCode(92)+String.fromCharCode(r),this.pos++}else t+=this.src[this.pos],this.pos++;return this.pos<this.src.length&&this.pos++,t}scanNumber(){let e=this.pos;for(45===this.src.charCodeAt(this.pos)&&this.pos++;this.pos<this.src.length&&Re(this.src.charCodeAt(this.pos));)this.pos++;if(46===this.src.charCodeAt(this.pos))for(this.pos++;this.pos<this.src.length&&Re(this.src.charCodeAt(this.pos));)this.pos++;return Number(this.src.slice(e,this.pos))}matchKeyword(e){let t=this.pos+e.length;if(t>this.src.length)return!1;for(let r=0;r<e.length;r++)if(this.src.charCodeAt(this.pos+r)!==e.charCodeAt(r))return!1;return!(t<this.src.length&&Ue(this.src.charCodeAt(t))||(this.pos=t,this.skipWs(),0))}matchBinaryOp(){this.skipWs();let e=this.peek();if(61===this.at(1)){if(61===e)return this.pos+=2,"==";if(33===e)return this.pos+=2,"!=";if(62===e)return this.pos+=2,">=";if(60===e)return this.pos+=2,"<="}return 62===e?(this.pos++,">"):60===e?(this.pos++,"<"):null}},tt=e=>new rt(e).parseTernary(),rt=class extends et{parseTernary(){let e=this.parseOr();if(this.skipWs(),63===this.peek()){this.pos++,this.skipWs();let t=this.parseOr();if(this.skipWs(),58===this.peek())return this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:t,falseExpr:this.parseTernary()}}return e}parseOr(){let e=this.parseAnd();for(this.skipWs();this.matchKeyword("or");)e={type:"binary",operator:"or",left:e,right:this.parseAnd()},this.skipWs();return e}parseAnd(){let e=this.parseNot();for(this.skipWs();this.matchKeyword("and");)e={type:"binary",operator:"and",left:e,right:this.parseNot()},this.skipWs();return e}parseNot(){return this.skipWs(),this.matchKeyword("not")?{type:"unary",operator:"not",operand:this.parseComparison()}:this.parseComparison()}parseComparison(){let e=this.parseConcat();for(this.skipWs();!this.eof();){if(this.matchKeyword("is")){this.skipWs(),e={type:"binary",operator:this.matchKeyword("not")?"is not":"is",left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("not")){if(this.skipWs(),this.matchKeyword("in")){e={type:"binary",operator:"not in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.src.slice(this.pos-4);return this.pos=this.src.length,{type:"unary",operator:"not",operand:tt(t)}}if(this.matchKeyword("in")){e={type:"binary",operator:"in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.matchBinaryOp();if(!t)break;e={type:"binary",operator:t,left:e,right:this.parseConcat()},this.skipWs()}return e}parseConcat(){let e=this.parseAdditive();for(this.skipWs();126===this.peek();){this.pos++;let t=this.parseAdditive();e="concat"===e.type?{type:"concat",parts:[...e.parts,t]}:{type:"concat",parts:[e,t]},this.skipWs()}return e}parseAdditive(){let e=this.parseMultiplicative();this.skipWs();for(let t=this.peek();43===t||45===t;t=this.peek())this.pos++,e={type:"binary",operator:43===t?"+":"-",left:e,right:this.parseMultiplicative()},this.skipWs();return e}parseMultiplicative(){let e=this.parseDefault();this.skipWs();for(let t=this.peek();42===t||47===t||37===t;t=this.peek())this.pos++,e={type:"binary",operator:42===t?"*":47===t?"/":"%",left:e,right:this.parseDefault()},this.skipWs();return e}parseDefault(){if(this.skipWs(),45===this.peek()&&Re(this.at(1)))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(45===this.peek())return this.pos++,{type:"unary",operator:"-",operand:this.parseDefault()};let e=this.parseAtom();for(this.skipWs();63===this.peek()&&63===this.at(1);)this.pos+=2,this.skipWs(),e={type:"default",value:e,defaultExpr:this.parseAtom()},this.skipWs();return e}parseAtom(){this.skipWs();let e=this.peek();if(40===e){this.pos++,this.skipWs();let e=this.pos,t=this.tryParseArrowParams();if(null!==t)return this.maybeTrailingFilters({type:"arrow",params:t,body:this.parseTernary()});this.pos=e;let r=this.parseTernary();return this.skipWs(),this.peek()===Le&&this.pos++,this.maybeTrailingFilters(r)}return 39===e||34===e?this.maybeTrailingFilters({type:"literal",value:this.scanStringLiteral()}):Re(e)?this.maybeTrailingFilters({type:"literal",value:this.scanNumber()}):91===e?(this.pos++,this.maybeTrailingFilters({type:"array",elements:this.parseArgList(93)})):123===e?(this.pos++,this.maybeTrailingFilters(this.parseObjectLiteral())):this.parsePathOrFunctionOrArrow()}tryParseArrowParams(){let e=this.pos,t=[];for(this.skipWs();this.peek()!==Le;){let r=this.scanName();if(!r)return this.pos=e,null;if(t.push(r),this.skipWs(),44!==this.peek())break;this.pos++,this.skipWs()}return this.skipWs(),this.peek()===Le&&(this.pos++,this.skipWs(),61===this.peek()&&62===this.at(1))?(this.pos+=2,t):(this.pos=e,null)}parsePathOrFunctionOrArrow(){let e=this.scanName();if(!e)return this.pos++,{type:"literal",value:""};if("true"===e||"false"===e)return this.maybeTrailingFilters({type:"literal",value:"true"===e});if(this.skipWs(),61===this.peek()&&62===this.at(1))return this.pos+=2,this.maybeTrailingFilters({type:"arrow",params:[e],body:this.parseTernary()});if(40===this.peek()){this.pos++;let t=this.parseArgList(Le);return this.maybeTrailingFilters(this.parseAccessChain({type:"function",name:e,args:t},null))}let t=[e];return this.maybeTrailingFilters(this.parseAccessChain({type:"path",segments:t},t))}parseAccessChain(e,t){let r=e,n=t;for(;;){let e=this.peek();if(46===e){let e=this.pos;this.pos++;let t=this.scanName()||this.scanIndex();if(!t){this.pos=e;break}n?n.push(t):r={type:"index",object:r,index:{type:"literal",value:t}};continue}if(91!==e)break;this.pos++;let t=this.parseTernary();this.skipWs(),93===this.peek()&&this.pos++,n&&"literal"===t.type&&"boolean"!=typeof t.value?n.push(String(t.value)):(n&&=(r={type:"path",segments:n},null),r={type:"index",object:r,index:t})}return n?{type:"path",segments:n}:r}maybeTrailingFilters(e){return this.skipWs(),124===this.peek()?{type:"filter",subject:e,filters:this.parseTrailingFilters()}:e}parseObjectLiteral(){let e=[];for(this.skipWs();!this.eof()&&125!==this.peek();){let t=this.parseObjectKey();this.skipWs(),58===this.peek()&&this.pos++,this.skipWs(),e.push({key:t,value:this.parseTernary()}),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs())}return 125===this.peek()&&this.pos++,{type:"object",entries:e}}parseObjectKey(){let e=this.peek();if(39===e||34===e)return{type:"literal",value:this.scanStringLiteral()};if(Re(e))return{type:"literal",value:this.scanNumber()};if(40===e){this.pos++,this.skipWs();let e=this.parseTernary();return this.skipWs(),this.peek()===Le&&this.pos++,e}return{type:"literal",value:this.scanName()}}parseArgList(e){let t=[];for(this.skipWs();!this.eof()&&this.peek()!==e;)t.push(this.parseTernary()),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs());return this.peek()===e&&this.pos++,t}parseTrailingFilters(){let e=[];for(;124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}parseApplyChain(){this.skipWs();let e=[this.readFilter()];for(this.skipWs();124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}readFilter(){let e=this.scanName();return this.skipWs(),40===this.peek()?(this.pos++,{name:e,args:this.parseArgList(Le)}):{name:e,args:[]}}},nt=e=>{let t=0;for(;t<e.length&&!Xe(e.charCodeAt(t));)t++;return e.slice(0,t)},it=(e,t=!1)=>{let r=new st(e,t),n=r.parseBody();if(!r.error){let e=r.peek();if(e&&"tag"===e.type){let t=nt(e.content.trim());at.has(t)&&(r.error=`Orphan closing tag: {% ${t} %} without matching opening tag`)}}return{nodes:n,error:r.error}},at=/* @__PURE__ */new Set(["endif","endfor","endset","endapply","else","elseif"]),st=class{tokens;keepEmptyTokens;pos=0;error=null;constructor(e,t=!1){this.tokens=e,this.keepEmptyTokens=t}peek(){return this.tokens[this.pos]}advance(){let e=this.tokens[this.pos];return e&&this.pos++,e}isTag(e){let t=this.peek();if(!t||"tag"!==t.type)return!1;let r=t.content.trim();return r===e||r.startsWith(e+" ")||r.startsWith(e+"\t")}parseBody(){let e=[];for(;this.pos<this.tokens.length;){let t=this.peek();if(!t||"tag"===t.type&&at.has(nt(t.content.trim())))break;let r=this.parseNode();r&&e.push(r)}return e}parseNode(){let e=this.peek();return e?"text"===e.type?(this.advance(),{type:"text",value:e.value}):"variable"===e.type?this.parseVariable():this.parseTag():null}parseVariable(){let e=this.advance();if(!e||"variable"!==e.type)return{type:"variable",raw:!1,expression:{type:"literal",value:""},source:""};let t=e.content.trim(),r=this.keepEmptyTokens?Je(e.content,e.raw):"";if(Ze(t))return{type:"variable",raw:e.raw,expression:{type:"path",segments:[t]},source:r};let n=tt(t);return{type:"variable",raw:e.raw,expression:n,source:r}}parseTag(){let e=this.peek();if(!e||"tag"!==e.type)return null;let t=e.content.trim();switch(nt(t)){case"if":return this.parseIf();case"for":return this.parseFor();case"set":return this.parseSet();case"apply":return this.parseApply();case"break":return this.advance(),{type:"break"};case"continue":return this.advance(),{type:"continue"};default:return this.advance(),null}}parseIf(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return this.error="Malformed {% if %} tag",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let t=e.content.trim(),r=-1===t.indexOf(" ")?"":t.slice(t.indexOf(" ")+1).trim();if(!r)return this.error="Malformed {% if %} tag: missing condition",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let n=tt(r),i=this.parseBody(),a=[],s=null,o=!1;for(;this.peek();){let e=this.peek();if(!e||"tag"!==e.type)break;let t=nt(e.content.trim());if("elseif"===t){this.advance();let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=tt(r),i=this.parseBody();a.push({condition:n,body:i})}else{if("else"!==t){if("endif"===t){this.advance(),o=!0;break}break}this.advance(),s=this.parseBody()}}return o||(this.error="Malformed {% if %} block: missing {% endif %}"),{type:"if",condition:n,body:i,elseifClauses:a,elseBody:s}}parseFor(){let e=this.pos;this.advance();let t=this.tokens[this.pos-1];if("tag"!==t.type)return{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let r=t.content.trim(),n=r.slice(r.indexOf(" ")+1).trim(),i=/\sin\s/.exec(n);if(!i)return this.error="Invalid {% for %} syntax: missing the `in` keyword",{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let a=n.slice(0,i.index).trim(),s=n.slice(i.index+i[0].length).trim(),o=(e=>{let t=0;for(let r=0;r+1<e.length;r++){let n=e.charCodeAt(r);if(0!==t)n===t&&(t=0);else if(39===n||34===n)t=n;else if(46===n&&46===e.charCodeAt(r+1))return[e.slice(0,r).trim(),e.slice(r+2).trim()]}return null})(s),l=o?{type:"range",start:tt(o[0]),end:tt(o[1])}:tt(s),u=a.indexOf(","),c=-1===u?null:a.slice(0,u).trim(),d=-1===u?a:a.slice(u+1).trim();if(!Ge(d))return this.error=`Invalid {% for %} variable name: "${d}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};if(null!==c&&!Ge(c))return this.error=`Invalid {% for %} key variable name: "${c}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let h=this.parseBody(),f=null;if(this.peek()){let e=this.peek();e&&"tag"===e.type&&"else"===nt(e.content.trim())&&(this.advance(),f=this.parseBody())}let p=this.peek();return p&&"tag"===p.type&&"endfor"===nt(p.content.trim())?this.advance():this.error="Malformed {% for %} block: missing {% endfor %}",{type:"for",valueVar:d,keyVar:c,collection:l,body:h,elseBody:f,source:this.keepEmptyTokens?this.reconstructRange(e,this.pos):void 0}}reconstructRange(e,t){let r="";for(let n=e;n<t;n++)r+=Ke(this.tokens[n]);return r}parseSet(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"set",name:"_unknown",value:{type:"literal",value:""}};let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=r.indexOf("=");if(-1===n){let e=r.trim(),t=this.parseBody(),n=this.peek();return n&&"tag"===n.type&&this.advance(),{type:"set",name:e,value:t}}let i=r.slice(0,n).trim(),a=r.slice(n+1).trim();return{type:"set",name:i,value:tt(a)}}parseApply(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"apply",filters:[],body:[]};let t=e.content.trim(),r=(e=>new rt(e).parseApplyChain())(t.slice(t.indexOf(" ")+1).trim()),n=this.parseBody(),i=this.peek();return i&&"tag"===i.type&&this.advance(),{type:"apply",filters:r,body:n}}},ot=/* @__PURE__ */new Map,lt={hits:0,misses:0},ut=e=>{let t=ot.get(e);if(t)return lt.hits++,t;lt.misses++;let r=(e=>{let t=(e=>{let t=[],r=0;for(;r<e.length;){let n,i,a=e.indexOf("{{",r),s=e.indexOf("{%",r);if(-1===a&&-1===s)break;if(-1===a?(n=s,i=!0):-1===s||a<s?(n=a,i=!1):(n=s,i=!0),n>r&&t.push({type:"text",value:e.slice(r,n)}),i||123!==e.charCodeAt(n+2))if(i){let i=e.indexOf("%}",n+2);if(-1===i)return{tokens:t,error:"Unclosed tag"};t.push({type:"tag",content:e.slice(n+2,i)}),r=i+2}else{let i=e.indexOf("}}",n+2);if(-1===i)return{tokens:t,error:"Unclosed double-brace token"};t.push({type:"variable",content:e.slice(n+2,i),raw:!1}),r=i+2}else{let i=e.indexOf("}}}",n+3);if(-1===i)return{tokens:t,error:"Unclosed triple-brace token"};t.push({type:"variable",content:e.slice(n+3,i),raw:!0}),r=i+3}}return r<e.length&&t.push({type:"text",value:e.slice(r)}),{tokens:t,error:null}})(e);if(t.error)return null;let r=t.tokens,{hasTags:n,allSimpleOrDotted:i}=(e=>{let t=!1,r=!0;for(let n=0;n<e.length;n++){let i=e[n];if("tag"===i.type){t=!0;break}if("variable"===i.type&&!Qe(i.content.trim())){r=!1;break}}return{hasTags:t,allSimpleOrDotted:r}})(r),a=null,s=null;if(n||!i){let e=it(r,!1);if(e.error)return null;a=e.nodes;let t=it(r,!0);t.error||(s=t.nodes)}else{let e=it(r,!0);e.error||(s=e.nodes)}return{tokens:r,hasTags:n,allSimpleOrDotted:i,nodes:a,nodesWithSource:s}})(e);return r?((()=>{if(ot.size>=256){let e=ot.keys().next().value;void 0!==e&&ot.delete(e)}})(),ot.set(e,r),r):null},ct=(e,t={},r=!1,n=!1)=>{if("string"!=typeof e)return e;try{if(-1===e.indexOf("{%")&&-1===e.indexOf("{{"))return e;let i="variables"in t?(e=>{let t={},r=e.variables;for(let n in r)t[n]=r[n];for(let n in e)t[n]=e[n];return t})(t):t,a=ut(e);if(!a)return e;if(!r&&!a.hasTags&&a.allSimpleOrDotted){let e=((e,t)=>{let r="";for(let n of e.tokens)if("text"===n.type)r+=n.value;else if("variable"===n.type){let e=n.content.trim(),i=-1===n.content.indexOf(".")?Ie(t,e):Ye(t,e);r+=n.raw?null==i?"":String(i):He(i)}return r})(a,i);return n?qe(e):e}let s=((e,t)=>t?e.nodesWithSource:e.nodes)(a,r);if(!s)return e;let{output:o,variables:l,hasSet:u}=((e,t,r=!1)=>{let n=new ze(t,r);return{output:n.evalNodes(e),variables:n.variables,hasSet:n.hasSet}})(s,i,r);return u&&Object.assign(t,l),r&&o===e?e:n?qe(o):o}catch{return e}},dt="[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*",ht=`(?:${dt}|\\d+)`,ft=`\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${dt}(?:\\.${ht})*)\\s*\\]`,pt=`${dt}(?:${ft})*(?:\\??\\.${ht}(?:${ft})*)*(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`,mt=`(?:\\{\\{\\{\\s*${pt}\\s*\\}\\}\\}|\\{\\{\\s*${pt}\\s*\\}\\})`,yt=new RegExp(mt,"g"),gt=RegExp(`^${mt}$`),bt=(e,t=!1)=>{if("string"!=typeof e)return!1;let r=t?gt:yt;return r.lastIndex=0,r.test(e.trim())},wt=(e,t)=>{if(Array.isArray(e))for(let r of e)wt(r,t);else if("object"==typeof e&&e){if("type"in e&&"path"===e.type&&"segments"in e&&Array.isArray(e.segments)){let r=e.segments[0];return void("string"==typeof r&&t.add(r))}for(let r of Object.values(e))wt(r,t)}},vt=e=>{let t=ut(e);if(!t)return[];let r=/* @__PURE__ */new Set;return wt(t.nodes??t.nodesWithSource,r),[...r]},xt=({source:e,transformers:t})=>{let r=[];if(e){let t=e.indexOf(".");r.push(t>-1?e.substring(0,t):e)}for(let{action:n,params:i}of t??[])"twigTemplate"===n&&i.template&&r.push(...vt(i.template));return r};function kt(e){if("string"==typeof e||"number"==typeof e){let t=String(e);return""===t?null:/^[a-zA-Z0-9_-]+$/.test(t)||/^\d+$/.test(t)?t:null}return null}function St(e,t=!0){return e?"string"==typeof e?function(e,t){if(!e||e.startsWith(".")||e.endsWith(".")||/[^a-zA-Z0-9_.[\]-]/.test(e)||t&&(/\.\.|(\[\])/g.test(e)||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||/\][^.[]/.test(e)))return[];let r,n=[],i=/([^.[\]]+)|\[(\d+)\]/g;for(;r=i.exec(e);)if(r[1]){if(!t&&""===r[1])continue;let e=kt(r[1]);if(null!==e)n.push(e);else if(t)return[]}else if(r[2]){let e=kt(r[2]);if(null!==e)n.push(e);else if(t)return[]}return n.length?n:[]}(e,t):Array.isArray(e)?function(e,t){if(!Array.isArray(e))return[];let r=[];for(let n of e){let e=kt(n);if(null!==e)r.push(e);else if(t)return[]}return r}(e,t):[]:[]}function Mt(e,t,r){if(null==e||!t)return r;let n=St(t);if(!n.length)return r;let i=e;for(let a of n){if("object"!=typeof i||!i)return r;i=Array.isArray(i)?i[Number(a)]:i[a]}return void 0===i?r:i}function At(e,t,r){let n=St(t);if(!n.length)return e;let i=e;for(let s=0;s<n.length-1;s++){let t=n[s],r=n[s+1];if("object"!=typeof i||!i)return e;let a=i;(null==a[t]||"object"!=typeof a[t])&&(a[t]=/^\d+$/.test(r)?[]:{}),i=a[t]}let a=n[n.length-1];return"object"==typeof i&&i&&(i[a]=r),e}function Pt(e,t=/* @__PURE__ */new WeakMap){if("object"!=typeof e||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let r=/* @__PURE__ */new Map;return t.set(e,r),e.forEach((e,n)=>r.set(n,Pt(e,t))),r}if(e instanceof Set){let r=/* @__PURE__ */new Set;return t.set(e,r),e.forEach(e=>r.add(Pt(e,t))),r}if(ArrayBuffer.isView(e)){if(e instanceof DataView){let r=new DataView(Pt(e.buffer,t),e.byteOffset,e.byteLength);return t.set(e,r),r}let r=new(0,e.constructor)(e.buffer.slice(0),e.byteOffset,e.length);return t.set(e,r),r}if(e instanceof ArrayBuffer){let r=e.slice(0);return t.set(e,r),r}if(Array.isArray(e)){let r=[];return t.set(e,r),e.forEach((e,n)=>r[n]=Pt(e,t)),r}let r=Object.getPrototypeOf(e),n=Object.create(r);t.set(e,n);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Pt(e[i],t));return n}var Tt=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),e);function _t(e,t){let r=St(t),n=Array.isArray(e)?[...e]:Tt(e);if(!r.length)return n;let i=e,a=n;for(let s=0;s<r.length;s++){let e=r[s],t=i?.[e];if(!t||"object"!=typeof t){a[e]=t;break}let n=Array.isArray(t)?[...t]:Tt(t);a[e]=n,i=t,a=n}return n}function Nt(e,t){if(null===e)return!1;let r=St(t),n=e;for(let i of r){if(null==n||!(i in n))return!1;n=n[i]}return!0}function Dt(e,t){let r=Array.isArray(t)?t:t?[t]:[];if(0===r.length)return{...e};let n=[],i=[];for(let s of r){let e=St(s);0!==e.length&&(1===e.length?n.push(e[0]):i.push(s))}let a=e;if(n.length){let e;for(let t of n)Object.prototype.hasOwnProperty.call(a,t)&&(e??=Tt(a),delete e[t]);e&&(a=e)}for(let s of i){let e=St(s);if(!Nt(a,s))continue;let t=_t(a,s),r=t;for(let n=0;n<e.length-1&&r&&"object"==typeof r;n++)r=r[e[n]];if(r&&"object"==typeof r){let t=e[e.length-1];Object.prototype.hasOwnProperty.call(r,t)&&delete r[t]}a=t}return a}Math.pow(10,8);var jt=6048e5,Ct=6e4,Ot=36e5,Wt=Symbol.for("constructDateFrom");function Et(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Wt in e?e[Wt](t):e instanceof Date?new e.constructor(t):new Date(t)}function $t(e,t){return Et(t||e,e)}function Ft(e,t,r){const n=$t(e,r?.in);return isNaN(t)?Et(r?.in||e,NaN):t?(n.setDate(n.getDate()+t),n):n}var zt={};function It(){return zt}function Yt(e,t){const r=It(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=$t(e,t?.in),a=i.getDay(),s=(a<n?7:0)+a-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Ht(e,t){return Yt(e,{...t,weekStartsOn:1})}function qt(e,t){const r=$t(e,t?.in),n=r.getFullYear(),i=Et(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=Ht(i),s=Et(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=Ht(s);return r.getTime()>=a.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function Lt(e){const t=$t(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Bt(e,...t){const r=Et.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function Ut(e,t){const r=$t(e,t?.in);return r.setHours(0,0,0,0),r}function Vt(e,t){const r=+$t(e)-+$t(t);return r<0?-1:r>0?1:r}function Rt(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+$t(e)));var t}function Xt(e,t){return+$t(e)-+$t(t)}function Zt(e,t,r){const[n,i,a]=Bt(r?.in,e,e,t),s=Vt(i,a),o=Math.abs(function(e,t){const[r,n]=Bt(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(i,a));if(o<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*o);let l=Vt(i,a)===-s;(function(e,t){const r=$t(e,t?.in);return+function(e,t){const r=$t(e,t?.in);return r.setHours(23,59,59,999),r}(r,t)===+function(e,t){const r=$t(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===o&&1===Vt(n,a)&&(l=!1);const u=s*(o-+l);return 0===u?0:u}var Qt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Gt(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Jt={date:Gt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Gt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Gt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Kt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function er(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):t;n=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;n=e.values[i]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function tr(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(o,e=>e.test(s)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(o,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}function rr(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];return s=r.valueCallback?r.valueCallback(s):s,{value:s,rest:t.slice(i.length)}}}var nr={code:"en-US",formatDistance:(e,t,r)=>{let n;const i=Qt[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:Jt,formatRelative:(e,t,r,n)=>Kt[e],localize:{ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:er({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:er({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:er({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:er({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:er({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:rr({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:tr({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:tr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:tr({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:tr({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:tr({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ir(e,t){const r=$t(e,t?.in),n=+Ht(r)-+function(e,t){const r=qt(e,t),n=Et(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Ht(n)}(r);return Math.round(n/jt)+1}function ar(e,t){const r=$t(e,t?.in),n=r.getFullYear(),i=It(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=Et(t?.in||e,0);s.setFullYear(n+1,0,a),s.setHours(0,0,0,0);const o=Yt(s,t),l=Et(t?.in||e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);const u=Yt(l,t);return+r>=+o?n+1:+r>=+u?n:n-1}function sr(e,t){const r=$t(e,t?.in),n=+Yt(r,t)-+function(e,t){const r=It(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=ar(e,t),a=Et(t?.in||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),Yt(a,t)}(r,t);return Math.round(n/jt)+1}function or(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var lr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return or("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):or(r+1,2)},d:(e,t)=>or(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>or(e.getHours()%12||12,t.length),H:(e,t)=>or(e.getHours(),t.length),m:(e,t)=>or(e.getMinutes(),t.length),s:(e,t)=>or(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return or(Math.trunc(n*Math.pow(10,r-3)),t.length)}},ur={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return lr.y(e,t)},Y:function(e,t,r,n){const i=ar(e,n),a=i>0?i:1-i;return"YY"===t?or(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):or(a,t.length)},R:function(e,t){return or(qt(e),t.length)},u:function(e,t){return or(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return or(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return or(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return lr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return or(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=sr(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):or(i,t.length)},I:function(e,t,r){const n=ir(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):or(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):lr.d(e,t)},D:function(e,t,r){const n=function(e,t){const r=$t(e,t?.in);return function(e,t){const[r,n]=Bt(void 0,e,t),i=Ut(r),a=Ut(n),s=+i-Lt(i),o=+a-Lt(a);return Math.round((s-o)/864e5)}(r,function(e){const t=$t(e,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}(r))+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):or(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return or(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return or(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return or(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(i=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(i=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return lr.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):lr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):or(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):or(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):lr.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):lr.s(e,t)},S:function(e,t){return lr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return dr(n);case"XXXX":case"XX":return hr(n);default:return hr(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return dr(n);case"xxxx":case"xx":return hr(n);default:return hr(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cr(n,":");default:return"GMT"+hr(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cr(n,":");default:return"GMT"+hr(n,":")}},t:function(e,t,r){return or(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return or(+e,t.length)}};function cr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return 0===a?r+String(i):r+String(i)+t+or(a,2)}function dr(e,t){return e%60==0?(e>0?"-":"+")+or(Math.abs(e)/60,2):hr(e,t)}function hr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+or(Math.trunc(n/60),2)+t+or(n%60,2)}var fr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},pr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},mr={p:pr,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return fr(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",fr(n,t)).replace("{{time}}",pr(i,t))}},yr=/^D+$/,gr=/^Y+$/,br=["D","DD","YY","YYYY"];function wr(e){return yr.test(e)}function vr(e){return gr.test(e)}function xr(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(br.includes(e))throw new RangeError(n)}var kr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mr=/^'([^]*?)'?$/,Ar=/''/g,Pr=/[a-zA-Z]/;function Tr(e,t,r){const n=It(),i=r?.locale??n.locale??nr,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=$t(e,r?.in);if(!Rt(o))throw new RangeError("Invalid time value");let l=t.match(Sr).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,mr[t])(e,i.formatLong):e}).join("").match(kr).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:_r(e)};if(ur[t])return{isToken:!0,value:e};if(t.match(Pr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return l.map(n=>{if(!n.isToken)return n.value;const a=n.value;return(!r?.useAdditionalWeekYearTokens&&vr(a)||!r?.useAdditionalDayOfYearTokens&&wr(a))&&xr(a,t,String(e)),(0,ur[a[0]])(o,a,i.localize,u)}).join("")}function _r(e){const t=e.match(Mr);return t?t[1].replace(Ar,"'"):e}function Nr(e,t){return function(e,t,r){const n=It(),i=r?.locale??n.locale??nr,a=Vt(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const s=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:a}),[o,l]=Bt(r?.in,...a>0?[t,e]:[e,t]),u=function(e,t,r){const n=Xt(e,t)/1e3;return(i=r?.roundingMethod,e=>{const t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})(n);var i}(l,o),c=(Lt(l)-Lt(o))/1e3,d=Math.round((u-c)/60);let h;if(d<2)return r?.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,s):u<10?i.formatDistance("lessThanXSeconds",10,s):u<20?i.formatDistance("lessThanXSeconds",20,s):u<40?i.formatDistance("halfAMinute",0,s):u<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):0===d?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",d,s);if(d<45)return i.formatDistance("xMinutes",d,s);if(d<90)return i.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return i.formatDistance("aboutXHours",e,s)}if(d<2520)return i.formatDistance("xDays",1,s);if(d<43200){const e=Math.round(d/1440);return i.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/43200),i.formatDistance("aboutXMonths",h,s);if(h=Zt(l,o),h<12){const e=Math.round(d/43200);return i.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?i.formatDistance("aboutXYears",t,s):e<9?i.formatDistance("overXYears",t,s):i.formatDistance("almostXYears",t+1,s)}}(e,function(e){return Et(e,Date.now())}(e),t)}var Dr=class{subPriority=0;validate(e,t){return!0}},jr=class extends Dr{constructor(e,t,r,n,i){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=n,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}},Cr=class extends Dr{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>Et(t,e))}set(e,t){return t.timestampIsSet?e:Et(e,function(e,t){const r=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):Et(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}(e,this.context))}},Or=class{run(e,t,r,n){const i=this.parse(e,t,r,n);return i?{setter:new jr(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,r){return!0}},Wr=/^(1[0-2]|0?\d)/,Er=/^(3[0-1]|[0-2]?\d)/,$r=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Fr=/^(5[0-3]|[0-4]?\d)/,zr=/^(2[0-3]|[0-1]?\d)/,Ir=/^(2[0-4]|[0-1]?\d)/,Yr=/^(1[0-1]|0?\d)/,Hr=/^(1[0-2]|0?\d)/,qr=/^[0-5]?\d/,Lr=/^[0-5]?\d/,Br=/^\d/,Ur=/^\d{1,2}/,Vr=/^\d{1,3}/,Rr=/^\d{1,4}/,Xr=/^-?\d+/,Zr=/^-?\d/,Qr=/^-?\d{1,2}/,Gr=/^-?\d{1,3}/,Jr=/^-?\d{1,4}/,Kr=/^([+-])(\d{2})(\d{2})?|Z/,en=/^([+-])(\d{2})(\d{2})|Z/,tn=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,rn=/^([+-])(\d{2}):(\d{2})|Z/,nn=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function an(e,t){return e?{value:t(e.value),rest:e.rest}:e}function sn(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function on(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};const n="+"===r[1]?1:-1,i=r[2]?parseInt(r[2],10):0,a=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:n*(i*Ot+a*Ct+1e3*s),rest:t.slice(r[0].length)}}function ln(e){return sn(Xr,e)}function un(e,t){switch(e){case 1:return sn(Br,t);case 2:return sn(Ur,t);case 3:return sn(Vr,t);case 4:return sn(Rr,t);default:return sn(new RegExp("^\\d{1,"+e+"}"),t)}}function cn(e,t){switch(e){case 1:return sn(Zr,t);case 2:return sn(Qr,t);case 3:return sn(Gr,t);case 4:return sn(Jr,t);default:return sn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function dn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function hn(e,t){const r=t>0,n=r?t:1-t;let i;if(n<=50)i=e||100;else{const t=n+50;i=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?i:1-i}function fn(e){return e%400==0||e%4==0&&e%100!=0}var pn=[31,28,31,30,31,30,31,31,30,31,30,31],mn=[31,29,31,30,31,30,31,31,30,31,30,31];function yn(e,t,r){const n=It(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=$t(e,r?.in),s=a.getDay(),o=7-i;return Ft(a,t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7,r)}var gn={G:new class extends Or{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends Or{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return an(un(4,e),n);case"yo":return an(r.ordinalNumber(e,{unit:"year"}),n);default:return an(un(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const n=e.getFullYear();if(r.isTwoDigitYear){const t=hn(r.year,n);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Y:new class extends Or{priority=130;parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return an(un(4,e),n);case"Yo":return an(r.ordinalNumber(e,{unit:"year"}),n);default:return an(un(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,n){const i=ar(e,n);if(r.isTwoDigitYear){const t=hn(r.year,i);return e.setFullYear(t,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,n)}const a="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(a,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Yt(e,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Or{priority=130;parse(e,t){return cn("R"===t?4:t.length,e)}set(e,t,r){const n=Et(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Ht(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Or{priority=130;parse(e,t){return cn("u"===t?4:t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Or{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return un(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Or{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return un(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Or{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"M":return an(sn(Wr,e),n);case"MM":return an(un(2,e),n);case"Mo":return an(r.ordinalNumber(e,{unit:"month"}),n);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends Or{priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"L":return an(sn(Wr,e),n);case"LL":return an(un(2,e),n);case"Lo":return an(r.ordinalNumber(e,{unit:"month"}),n);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Or{priority=100;parse(e,t,r){switch(t){case"w":return sn(Fr,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return un(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,n){return Yt(function(e,t,r){const n=$t(e,r?.in),i=sr(n,r)-t;return n.setDate(n.getDate()-7*i),$t(n,r?.in)}(e,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Or{priority=100;parse(e,t,r){switch(t){case"I":return sn(Fr,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return un(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return Ht(function(e,t,r){const n=$t(e,r?.in),i=ir(n,r)-t;return n.setDate(n.getDate()-7*i),n}(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Or{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return sn(Er,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return un(t.length,e)}}validate(e,t){const r=fn(e.getFullYear()),n=e.getMonth();return r?t>=1&&t<=mn[n]:t>=1&&t<=pn[n]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Or{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return sn($r,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return un(t.length,e)}}validate(e,t){return fn(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Or{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=yn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Or{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return an(un(t.length,e),i);case"eo":return an(r.ordinalNumber(e,{unit:"day"}),i);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=yn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Or{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return an(un(t.length,e),i);case"co":return an(r.ordinalNumber(e,{unit:"day"}),i);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=yn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Or{priority=90;parse(e,t,r){const n=e=>0===e?7:e;switch(t){case"i":case"ii":return un(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return an(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiii":return an(r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiiii":return an(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);default:return an(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=function(e,t,r){const n=$t(e,r?.in),i=t-function(e,t){const r=$t(e,t?.in).getDay();return 0===r?7:r}(n,r);return Ft(n,i,r)}(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Or{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(dn(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Or{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(dn(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Or{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(dn(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends Or{priority=70;parse(e,t,r){switch(t){case"h":return sn(Hr,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return un(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const n=e.getHours()>=12;return n&&r<12?e.setHours(r+12,0,0,0):n||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Or{priority=70;parse(e,t,r){switch(t){case"H":return sn(zr,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return un(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Or{priority=70;parse(e,t,r){switch(t){case"K":return sn(Yr,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return un(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Or{priority=70;parse(e,t,r){switch(t){case"k":return sn(Ir,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return un(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const n=r<=24?r%24:r;return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Or{priority=60;parse(e,t,r){switch(t){case"m":return sn(qr,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return un(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends Or{priority=50;parse(e,t,r){switch(t){case"s":return sn(Lr,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return un(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends Or{priority=30;parse(e,t){return an(un(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends Or{priority=10;parse(e,t){switch(t){case"X":return on(Kr,e);case"XX":return on(en,e);case"XXXX":return on(tn,e);case"XXXXX":return on(nn,e);default:return on(rn,e)}}set(e,t,r){return t.timestampIsSet?e:Et(e,e.getTime()-Lt(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends Or{priority=10;parse(e,t){switch(t){case"x":return on(Kr,e);case"xx":return on(en,e);case"xxxx":return on(tn,e);case"xxxxx":return on(nn,e);default:return on(rn,e)}}set(e,t,r){return t.timestampIsSet?e:Et(e,e.getTime()-Lt(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends Or{priority=40;parse(e){return ln(e)}set(e,t,r){return[Et(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Or{priority=20;parse(e){return ln(e)}set(e,t,r){return[Et(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},bn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vn=/^'([^]*?)'?$/,xn=/''/g,kn=/\S/,Sn=/[a-zA-Z]/;function Mn(e){return e.match(vn)[1].replace(xn,"'")}function An(e,t){const r=()=>Et(t?.in,NaN),n=t?.additionalDigits??2,i=function(e){const t={},r=e.split(Pn.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Pn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Pn.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const e=Pn.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let a;if(i.date){const e=function(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?i:100*a,restDateString:e.slice((n[1]||n[2]).length)}}(i.date,n);a=function(e,t){if(null===t)/* @__PURE__ */return new Date(NaN);const r=e.match(Tn);if(!r)/* @__PURE__ */return new Date(NaN);const n=!!r[4],i=Dn(r[1]),a=Dn(r[2])-1,s=Dn(r[3]),o=Dn(r[4]),l=Dn(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,o,l)?function(e,t,r){const n=/* @__PURE__ */new Date(0);n.setUTCFullYear(e,0,4);const i=7*(t-1)+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+i),n}(t,o,l):/* @__PURE__ */new Date(NaN);{const e=/* @__PURE__ */new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Cn[t]||(On(e)?29:28))}(t,a,s)&&function(e,t){return t>=1&&t<=(On(e)?366:365)}(t,i)?(e.setUTCFullYear(t,a,Math.max(i,s)),e):/* @__PURE__ */new Date(NaN)}}(e.restDateString,e.year)}if(!a||isNaN(+a))return r();const s=+a;let o,l=0;if(i.time&&(l=function(e){const t=e.match(_n);if(!t)return NaN;const r=jn(t[1]),n=jn(t[2]),i=jn(t[3]);return function(e,t,r){return 24===e?0===t&&0===r:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,i)?r*Ot+n*Ct+1e3*i:NaN}(i.time),isNaN(l)))return r();if(!i.timezone){const e=new Date(s+l),r=$t(0,t?.in);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}return o=function(e){if("Z"===e)return 0;const t=e.match(Nn);if(!t)return 0;const r="+"===t[1]?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,i)?r*(n*Ot+i*Ct):NaN}(i.timezone),isNaN(o)?r():$t(s+l+o,t?.in)}var Pn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Tn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,_n=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Dn(e){return e?parseInt(e):1}function jn(e){return e&&parseFloat(e.replace(",","."))||0}var Cn=[31,null,31,30,31,30,31,31,30,31,30,31];function On(e){return e%400==0||e%4==0&&e%100!=0}var Wn=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?An(e):e,Math.floor((r=t,+$t(r)/1e3)).toString();var r},En=e=>!("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))&&Rt(function(e,t,r,n){const i=()=>Et(n?.in||r,NaN),a=Object.assign({},It()),s=n?.locale??a.locale??nr,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():$t(r,n?.in);const u={firstWeekContainsDate:o,weekStartsOn:l,locale:s},c=[new Cr(n?.in,r)],d=t.match(wn).map(e=>{const t=e[0];return t in mr?(0,mr[t])(e,s.formatLong):e}).join("").match(bn),h=[];for(let y of d){!n?.useAdditionalWeekYearTokens&&vr(y)&&xr(y,t,e),!n?.useAdditionalDayOfYearTokens&&wr(y)&&xr(y,t,e);const r=y[0],a=gn[r];if(a){const{incompatibleTokens:t}=a;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===r);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${y}\` at the same time`)}else if("*"===a.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);h.push({token:r,fullToken:y});const n=a.run(e,y,s.match,u);if(!n)return i();c.push(n.setter),e=n.rest}else{if(r.match(Sn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");if("''"===y?y="'":"'"===r&&(y=Mn(y)),0!==e.indexOf(y))return i();e=e.slice(y.length)}}if(e.length>0&&kn.test(e))return i();const f=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=$t(r,n?.in);if(isNaN(+p))return i();const m={};for(const y of f){if(!y.validate(p,u))return i();const e=y.set(p,m,u);Array.isArray(e)?(p=e[0],Object.assign(m,e[1])):p=e}return p}(e,"yyyy-MM-dd",/* @__PURE__ */new Date)),$n={},Fn=/* @__PURE__ */new Map,zn=a({});function In(e){return e&&(e.displayName||e.name)||"Component"}zn.displayName="ComponentContext";var Yn={};Object.freeze(Yn);var Hn=(e,t="",r=".",n=!1)=>e&&"object"==typeof e?Object.keys(e).reduce((i,a)=>{a=a.replaceAll(r,"").replaceAll(".","");let s=`${t}${t?r:""}${a}`;return"object"!=typeof e[a]||Array.isArray(e[a])&&n?[...i,s]:[...i,s,...Hn(e[a],s,r,n)]},[]):[],qn=(e,t=!0,r=!0)=>{let n="",i="abcdefghijklmnopqrstuvwxyz";t&&(i=`ABCDEFGHIJKLMNOPQRSTUVWXYZ${i}`),r&&(i=`${i}0123456789`);let a=i.length;for(let s=0;s<e;s++)n+=i.charAt(Math.floor(Math.random()*a));return n};function Ln(e,t){if(!e)return 0;let r={};try{let t=e.split(".")[1],n=typeof window<"u"?window.atob(t):Buffer.from(t,"base64").toString();r=JSON.parse(n)}catch{return 0}return t?Mt(r,"data.spaceId",0):r}function Bn(e){!e&&typeof window<"u"&&(e=window.location.search);let t={};if(!e||0===e.length)return t;let r=e.replace("?","").split("&");for(let n=0;n<r.length;n++){let e=r[n].split("="),i=decodeURIComponent(e[0]),a=decodeURIComponent(e[1]);void 0===t[i]?t[i]=decodeURIComponent(a):"string"==typeof t[i]?t[i]=[t[i],decodeURIComponent(a)]:t[i].push(decodeURIComponent(a))}return t}var Un=({url:e="",internalProps:t,autoRegister:r=!0,plitziJsxSkipHOC:n=!1,plitziJsxProps:a=Yn})=>{let{register:s}=u(zn),[o,c]=g(!1);h(()=>c(!0),[]);let d=m(()=>l(((e,t,r=!0,n=!1)=>async()=>{if(!Fn.get(e)){let t=(async e=>{try{let t=await fetch(e),r=new Blob([await t.text()],{type:"text/javascript"});return await(import(
|
|
2
|
+
/* @vite-ignore */
|
|
3
|
+
/* webpackIgnore: true */
|
|
4
|
+
URL.createObjectURL(r)))}catch(e){return}})(e).finally(()=>{Fn.delete(e)});Fn.set(e,{promise:t,timestamp:Date.now()})}let i=await(Fn.get(e)?.promise),[{default:a},{default:s},{nestedInject:o}]=await Promise.all([Promise.resolve().then(()=>Zs),import("./plitzi-sdk.js").then(e=>e.t),import("./plitzi-sdk.js").then(e=>e.n)]);if(!i)return{default:s};let{type:l,pluginSettings:u}=Mt(i,"default",{}),{version:c,initialItems:d,plugins:h}=i;if(!l)return{default:s};let f=i.default;return n||(f=a(i.default)),f.version=c,f.origin="remote",f.type=l,f.initialItems=d,f.pluginSettings=u,f.plugins=o(h,"remote"),r&&t(f),{default:f}})(e,s,r,n)),[e]);return o?/* @__PURE__ */w(i,n?{children:/* @__PURE__ */w(d,{internalProps:t,plitziJsxSkipHOC:n,...a})}:{children:/* @__PURE__ */w(d,{internalProps:t})}):null},Vn=({type:e,plugins:t})=>{let r=(e?t[e]:void 0)??((e,t)=>Object.values(e).find(e=>e.subPlugins.find(e=>e===t)))(t,e);if(!r)return;let n=Mt(r,"assets",[]).filter(e=>"script"===e.type);return{url:n.find(e=>e.isMain)?.params.src??Mt(n,"0.params.src","")}},Rn=({key:e,plitziElementLayout:t,type:r,internalProps:n,components:i,plugins:a})=>{let s={...n,plitziElementLayout:t},o=i.notFound?/* @__PURE__ */w(i.notFound,{internalProps:s},e):void 0;if(!r)return o;let l=i[r];if(l)/* @__PURE__ */return w(l,{internalProps:s,extraProps:l.extraProps},e);let u=Vn({type:r,plugins:a});return u?/* @__PURE__ */w(Un,{url:u.url,internalProps:s},e):o},Xn=e=>{let t={};for(let r of e.split(";")){let e=r.indexOf(":");if(-1===e)continue;let n=r.slice(0,e).trim(),i=r.slice(e+1).trim();if(n&&i){let e=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());t[e]=i}}return t},Zn=({id:e,children:t})=>{let[r]=g(()=>{if(typeof document>"u")return null;let t=document.querySelector(`[data-rsc-id="${e}"]`);if(!t)return null;let r={};for(let e=0;e<t.attributes.length;e++){let{name:n,value:i}=t.attributes[e];"class"!==n&&"style"!==n&&"data-rsc-id"!==n&&(r[n]=i)}let n=t.getAttribute("style");return{tag:t.tagName.toLowerCase(),className:t.className,style:n?Xn(n):void 0,attrs:r,html:t.innerHTML}});return r?s(r.tag,{"data-rsc-id":e,className:r.className||void 0,style:r.style,...r.attrs,dangerouslySetInnerHTML:{__html:r.html}}):t},Qn={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Gn={date:Gt({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:Gt({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Gt({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Jn={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Kn={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},ei={code:"es",formatDistance:(e,t,r)=>{let n;const i=Qn[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"en "+n:"hace "+n:n},formatLong:Gn,formatRelative:(e,t,r,n)=>1!==t.getHours()?Kn[e]:Jn[e],localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:er({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:er({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:er({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:er({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:er({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:rr({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:tr({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:tr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:tr({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:tr({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:tr({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:1}},ti={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ri={date:Gt({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},defaultWidth:"full"}),time:Gt({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:Gt({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ni={lastWeek:e=>{const t=e.getDay();return"'"+(0===t||6===t?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},ii={code:"pt",formatDistance:(e,t,r)=>{let n;const i=ti[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),r?.addSuffix?r.comparison&&r.comparison>0?"daqui a "+n:"há "+n:n},formatLong:ri,formatRelative:(e,t,r,n)=>{const i=ni[e];return"function"==typeof i?i(t):i},localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:er({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},defaultWidth:"wide"}),quarter:er({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:er({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:er({values:{narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:er({values:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:rr({matchPattern:/^(\d+)(º|ª)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:tr({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},defaultParseWidth:"any"}),quarter:tr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:tr({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:tr({matchPatterns:{narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},defaultParseWidth:"any"}),dayPeriod:tr({matchPatterns:{narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:4}};var ai={year:0,month:1,day:2,hour:3,minute:4,second:5},si={},oi=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(/* @__PURE__ */new Date("2014-06-25T04:00:00.123Z")),li="06/25/2014, 00:00:00"===oi||"06/25/2014 00:00:00"===oi;function ui(e,t,r,n,i,a,s){const o=/* @__PURE__ */new Date(0);return o.setUTCFullYear(e,t,r),o.setUTCHours(n,i,a,s),o}var ci=36e5,di={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function hi(e,t,r){if(!e)return 0;let n,i,a=di.timezoneZ.exec(e);if(a)return 0;if(a=di.timezoneHH.exec(e),a)return n=parseInt(a[1],10),pi(n)?-n*ci:NaN;if(a=di.timezoneHHMM.exec(e),a){n=parseInt(a[2],10);const e=parseInt(a[3],10);return pi(n,e)?(i=Math.abs(n)*ci+6e4*e,"+"===a[1]?-i:i):NaN}if(function(e){if(mi[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),mi[e]=!0,!0}catch(t){return!1}}(e)){t=new Date(t||Date.now());const n=fi(r?t:function(e){return ui(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),e);return-(r?n:function(e,t,r){let n=e.getTime()-t;const i=fi(new Date(n),r);if(t===i)return t;n-=i-t;const a=fi(new Date(n),r);return i===a?i:Math.max(i,a)}(t,n,e))}return NaN}function fi(e,t){const r=function(e,t){const r=function(e){return si[e]||(si[e]=li?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),si[e]}(t);return"formatToParts"in r?function(e,t){try{const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const t=ai[r[e].type];void 0!==t&&(n[t]=parseInt(r[e].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}(r,e):function(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}(r,e)}(e,t),n=ui(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const a=i%1e3;return i-=a>=0?a:1e3+a,n-i}function pi(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var mi={};function yi(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var gi=36e5,bi={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function wi(e,t,r){t=t||0,r=r||0;const n=/* @__PURE__ */new Date(0);n.setUTCFullYear(e,0,4);const i=7*t+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+i),n}var vi=[31,28,31,30,31,30,31,31,30,31,30,31],xi=[31,29,31,30,31,30,31,31,30,31,30,31];function ki(e){return e%400==0||e%4==0&&e%100!=0}function Si(e,t,r){if(t<0||t>11)return!1;if(null!=r){if(r<1)return!1;const n=ki(e);if(n&&r>xi[t])return!1;if(!n&&r>vi[t])return!1}return!0}function Mi(e,t){return!(e<0||e>52||null!=t&&(t<0||t>6))}function Ai(e,t,r){return!(e<0||e>=25||null!=t&&(t<0||t>=60)||null!=r&&(r<0||r>=60))}var Pi={en:nr,es:ei,pt:ii},Ti=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?An(e):e,t};function _i(e,t="dd MMMM, yyyy",r="en"){return e?Tr(Ti(e),t,{locale:Pi[r]}):""}function Ni(e,t="dd MMMM, yyyy",r="en"){return e?Tr(function(e){const t=hi("UTC",e=function(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)/* @__PURE__ */return new Date(NaN);const r=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))/* @__PURE__ */return new Date(NaN);const n=function(e){const t={};let r,n=bi.dateTimePattern.exec(e);if(n?(t.date=n[1],r=n[3]):(n=bi.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const e=bi.timeZone.exec(r);e?(t.time=r.replace(e[1],""),t.timeZone=e[1].trim()):t.time=r}return t}(e),{year:i,restDateString:a}=function(e,t){if(e){const r=bi.YYY[t],n=bi.YYYYY[t];let i=bi.YYYY.exec(e)||n.exec(e);if(i){const t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=bi.YY.exec(e)||r.exec(e),i){const t=i[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(n.date,r),s=function(e,t){if(null===t)return null;let r,n,i;if(!e||!e.length)return r=/* @__PURE__ */new Date(0),r.setUTCFullYear(t),r;let a=bi.MM.exec(e);if(a)return r=/* @__PURE__ */new Date(0),n=parseInt(a[1],10)-1,Si(t,n)?(r.setUTCFullYear(t,n),r):/* @__PURE__ */new Date(NaN);if(a=bi.DDD.exec(e),a){r=/* @__PURE__ */new Date(0);const e=parseInt(a[1],10);return function(e,t){if(t<1)return!1;const r=ki(e);return!(r&&t>366||!r&&t>365)}(t,e)?(r.setUTCFullYear(t,0,e),r):/* @__PURE__ */new Date(NaN)}if(a=bi.MMDD.exec(e),a){r=/* @__PURE__ */new Date(0),n=parseInt(a[1],10)-1;const e=parseInt(a[2],10);return Si(t,n,e)?(r.setUTCFullYear(t,n,e),r):/* @__PURE__ */new Date(NaN)}if(a=bi.Www.exec(e),a)return i=parseInt(a[1],10)-1,Mi(i)?wi(t,i):/* @__PURE__ */new Date(NaN);if(a=bi.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const e=parseInt(a[2],10)-1;return Mi(i,e)?wi(t,i,e):/* @__PURE__ */new Date(NaN)}return null}(a,i);if(null===s||isNaN(s.getTime()))/* @__PURE__ */return new Date(NaN);if(s){const e=s.getTime();let r,i=0;if(n.time&&(i=function(e){let t,r,n=bi.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Ai(t)?t%24*gi:NaN;if(n=bi.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Ai(t,r)?t%24*gi+6e4*r:NaN;if(n=bi.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const e=parseFloat(n[3].replace(",","."));return Ai(t,r,e)?t%24*gi+6e4*r+1e3*e:NaN}return null}(n.time),null===i||isNaN(i)))/* @__PURE__ */return new Date(NaN);if(n.timeZone||t.timeZone){if(r=hi(n.timeZone||t.timeZone,new Date(e+i)),isNaN(r))/* @__PURE__ */return new Date(NaN)}else r=yi(new Date(e+i)),r=yi(new Date(e+i+r));return new Date(e+i+r)}/* @__PURE__ */return new Date(NaN)}(e,void 0),!0),r=new Date(e.getTime()-t),n=/* @__PURE__ */new Date(0);return n.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),n.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),n}(Ti(e)),t,{locale:Pi[r]}):""}function Di(e,t){let r=Ti(e);return Xt(Ti(t),r)}var ji=e=>"number"==typeof e||"string"==typeof e&&!e.includes(",")&&!Number.isNaN(parseFloat(e)),Ci=e=>{if(!e||"object"!=typeof e)return;let{combinator:t,enabled:r}=e,{rules:n}=e;return Array.isArray(n)?(n=n.map(e=>{if((e=>"rules"in e)(e))return Ci(e);let{field:t,value:r,operator:n,enabled:i,isBinding:a}=e;return{field:t,value:r,operator:n,enabled:i,isBinding:a}}).filter(Boolean),{rules:n,combinator:t,enabled:r}):void 0},Oi=(e,t="json")=>Ci(e),Wi=(e,t)=>"boolean"==typeof e&&"string"==typeof t?e===(t="true"===(t=t.toLowerCase())||"1"===t):"string"==typeof e&&"boolean"==typeof t?(e="true"===(e=e.toLowerCase())||"1"===e)===t:("number"==typeof e&&(e=`${e}`),"number"==typeof t&&(t=`${t}`),e===t),Ei=(e,t)=>null!=e&&null!=t&&(En(e)&&En(t)?(e=Wn(e),t=Wn(t),parseFloat(t)>parseFloat(e)):ji(e)?(e=parseFloat(e),t=parseFloat(t),ji(t)&&t>e):t>e),$i=(e,t)=>Ei(e,t)||Wi(e,t),Fi=(e,t)=>null!=e&&null!=t&&(En(e)&&En(t)?(e=Wn(e),t=Wn(t),parseFloat(t)<parseFloat(e)):ji(e)?(e=parseFloat(e),t=parseFloat(t),ji(t)&&t<e):t<e),zi=(e,t)=>Fi(e,t)||Wi(e,t),Ii=(e,t)=>"string"==typeof e&&"string"==typeof t&&t.toLowerCase().includes(e.toLowerCase()),Yi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().startsWith(e.toLowerCase()),Hi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().endsWith(e.toLowerCase()),qi=e=>{switch(typeof e){case"boolean":case"number":case"function":return!1;case"object":case"undefined":return null==e||0===Object.keys(e).length;default:return!e}},Li=(e,t)=>("string"==typeof e&&e.includes(",")?e=e.split(",").map(e=>e.trim()):("string"==typeof e||"number"==typeof e)&&(e=[e]),!!Array.isArray(e)&&("string"==typeof t&&t.includes(",")&&(t=t.split(",").map(e=>e.trim())),Array.isArray(t)?t.some(t=>ji(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t)):ji(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t))),Bi=(e,t)=>{let r=[];return"string"==typeof e&&(r=e.split(",").map(e=>e.trim())),!(r.length<2)&&$i(r[0],t)&&zi(r[1],t)},Ui=(e,t={},r=!1,n=!1)=>{if(!e)return n;let{combinator:i,rules:a,enabled:s}=e;if(!Array.isArray(a))return n;if(!1===s)return!0;let o=a.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ui(e,t,r):((e,t)=>{let{field:r,operator:n,isBinding:i}=e,{value:a}=e,s=Mt(t,r);switch(i&&(a=Mt(t,e.value)),n){case"=":return Wi(a,s);case"!=":return!Wi(a,s);case"<":return Fi(a,s);case">":return Ei(a,s);case"<=":return zi(a,s);case">=":return $i(a,s);case"contains":return Ii(a,s);case"doesNotContain":return!Ii(a,s);case"beginsWith":return Yi(a,s);case"doesNotBeginWith":return!Yi(a,s);case"endsWith":return Hi(a,s);case"doesNotEndWith":return!Hi(a,s);case"empty":return qi(s);case"notEmpty":return!qi(s);case"in":return Li(a,s);case"notIn":return!Li(a,s);case"between":return Bi(a,s);case"notBetween":return!Bi(a,s);default:return!1}})(e,t));return r?o:"and"===i?!o.includes(!1):o.includes(!0)},Vi=(e,t={},r=!1,n=!1)=>Ui(Oi(e),t,r,n),Ri=(e,t,r,n=!1)=>{let{rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return{};let s=i.filter(e=>!1!==e.enabled).flatMap(e=>"rules"in e?Ri(e,t,r,!0):e);return n?s:s.reduce((e,n)=>{let{field:i,isBinding:a,value:s}=n;return a&&At(e,s,Mt(t,s,r)),At(e,i,Mt(t,i,r)),e},{})},Xi=(e,t={},r=void 0)=>Ri(Oi(e),t,r),Zi={action:"arrayMap",title:"Array Map",type:"utility",params:{keys:{defaultValue:'[{"from": "", "to": ""}]',type:"textarea"}},preview:{sourceParsed:""},callback:(e,t)=>{let{keys:r}=t;if(!Array.isArray(e))return e;try{"string"==typeof r&&(r=JSON.parse(r))}catch{return e}return e.map(e=>{let t={};return r.forEach(r=>{"object"==typeof r&&r.from&&r.to&&At(t,r.to,Mt(e,r.from,""))}),t})}},Qi={action:"dateConverter",title:"Date Converter",type:"utility",params:{format:{defaultValue:"dd/MM/yyyy",type:"text"},asAge:{defaultValue:!1,type:"checkbox"},isUnix:{defaultValue:!0,type:"checkbox"},isUtc:{defaultValue:!1,type:"checkbox"},locale:{defaultValue:"en",type:"select",options:[{label:"en",value:"en"},{label:"es",value:"es"},{label:"pt",value:"pt"}]}},preview:{format:"",asAge:"",isUnix:"",isUtc:"",locale:""},callback:(e,{format:t="dd/MM/yyyy",asAge:r=!1,isUnix:n=!0,isUtc:i=!1,locale:a="en"})=>{if("string"!=typeof e&&"number"!=typeof e)return e;try{let s=Ti(n?Number(e):e);return isNaN(s.getTime())?e:r?function(e,t="en",r){if(!e)return"";let n=Ti(e);return isNaN(n.getTime())?"":Nr(n,{...r,locale:Pi[t]})}(s,a,{addSuffix:!0}):i?Ni(s,t,a):_i(s,t,a)}catch{return e}}},Gi=/* @__PURE__ */new Set(["false","0",""]),Ji={action:"not",title:"Not",type:"utility",params:{},preview:{content:""},callback:e=>!(e=>"string"==typeof e?!Gi.has(e.trim().toLowerCase()):Array.isArray(e)?e.length>0:!!e)(e)},Ki={action:"styleSelector",title:"Style Selector",type:"utility",params:{originalSelector:{label:"Original Selector",description:"This will append the original selector (require append option enabled)",defaultValue:!1,disabled:({append:e})=>!e,type:"checkbox"},append:{label:"Append Selector",defaultValue:!1,type:"checkbox"},selector:{label:"Selector",defaultValue:"",type:"select",options:(e,t,r)=>{let n=r?.stylePlatform;return n?Object.keys(n).map(e=>({label:e,options:Object.values(n[e]).filter(e=>"class"===e.type).map(e=>({label:e.name,value:e.name}))})):[]}}},preview:{append:"",originalSelector:"",selector:""},callback:(e,t,r,n={})=>{let{originalSelector:i,append:a,selector:s}=t,o=[];if(a&&!i&&n.sourceTo)o.push(n.sourceTo,s);else if(i&&a){let e=Mt(r,"definition.styleSelectors.base","");e?o.push(e,s):o.push(s)}return o.length?1===o.length?o[0]:o.join(" "):""}},ea={action:"styleVariant",title:"Style Variant",type:"utility",params:{key:{label:"Selector Key",defaultValue:"",type:"select",options:(e,t)=>{let r=t?.definition?.styleSelectors;if(!t||!t.definition||!r)return[];let n=t.definition.type;return(e=>{let t=e.reduce((e,{groupLabel:t,option:r})=>(t in e||(e[t]=[]),e[t].push(r),e),{});return Object.entries(t).map(([e,t])=>({label:e,options:t}))})(Object.entries(r).flatMap(([e,t])=>(t?[n,...t.split(" ")]:[n]).map(t=>({groupLabel:e,option:{value:`${t}.${e}`,label:`${t} (${e})`}}))))}},variant:{label:"Variant",defaultValue:"",type:"select",options:(e,t,r)=>{let n=t?.definition?.styleSelectors,i=e.key||"";if(!(t&&t.definition&&n&&r?.stylePlatform&&i.includes(".")))return[];let a=t.definition.type,s=i.split(".").pop()||"",o=n[s];if(!o)return[];let l=[],u=[a,...o.split(" ").filter(Boolean)];return Object.entries(r.stylePlatform).forEach(([e,t])=>{u.forEach(r=>{let n=t[r];if(!n)return;let i=n.attributes[s];Object.keys(i.variants||{}).forEach(t=>{l.push({value:t,label:`${e}: ${t}`})})})}),l}},append:{label:"Append to Variant",description:"Merge with existing variant values instead of replacing",defaultValue:!1,type:"checkbox"}},preview:{key:"",variant:"",append:""},callback:(e,t,r,n={})=>{let{key:i,variant:a,append:s}=t;if(!i)return n.sourceTo??{};let o=i||"base",l=a||e;return"object"!=typeof l||Array.isArray(l)?At(s?{...n.sourceTo}:{},o,l):l}},ta={action:"twigTemplate",title:"Twig Template",type:"utility",params:{template:{label:"Template",defaultValue:"Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",type:"codemirror-text"}},preview:{template:""},callback:(e,t,r,n={})=>{let{template:i}=t,a=e;try{let t=ct(i,{source:e,...n});("string"==typeof t||"object"==typeof t&&t)&&(a=t)}catch{a=e}return a}},ra={twigTemplate:ta,dateConverter:Qi,staticValue:{action:"staticValue",title:"Static Value",type:"utility",params:{valueType:{label:"Value Type",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Long Text",value:"textarea"},{label:"Boolean",value:"select"}]},value:{defaultValue:"",type:({valueType:e})=>e,options:[{label:"True",value:"true"},{label:"False",value:"false"}]}},preview:{valueType:"",value:""},callback:(e,t)=>{let{valueType:r,value:n}=t;return"select"===r?"true"===n:n}},capitalize:{action:"capitalize",title:"Capitalize",type:"utility",params:{},preview:{content:""},callback:e=>"string"==typeof e?function(e){return null!=e&&"string"==typeof e&&e.trim()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}(e):e},arrayMap:Zi,stringToArray:{action:"stringToArray",title:"Text to List",type:"utility",params:{separator:{label:"Separator",defaultValue:",",type:"text"}},preview:{valueType:"",value:""},callback:(e,t)=>{let{separator:r}=t;return"string"==typeof e?e.split(r).map(e=>e.trim()):e}},not:Ji,styleSelector:Ki,styleVariant:ea},na=(Object.values(ra).map(({title:e,action:t})=>({label:e,value:t})),Symbol.for("immer-nothing")),ia=Symbol.for("immer-draftable"),aa=Symbol.for("immer-state");function sa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oa=Object,la=oa.getPrototypeOf,ua="constructor",ca="prototype",da="configurable",ha="enumerable",fa="writable",pa="value",ma=e=>!!e&&!!e[aa];function ya(e){return!!e&&(wa(e)||Aa(e)||!!e[ia]||!!e[ua]?.[ia]||Pa(e)||Ta(e))}var ga=oa[ca][ua].toString(),ba=/* @__PURE__ */new WeakMap;function wa(e){if(!e||!_a(e))return!1;const t=la(e);if(null===t||t===oa[ca])return!0;const r=oa.hasOwnProperty.call(t,ua)&&t[ua];if(r===Object)return!0;if(!Na(r))return!1;let n=ba.get(r);return void 0===n&&(n=Function.toString.call(r),ba.set(r,n)),n===ga}function va(e,t,r=!0){0===xa(e)?(r?Reflect.ownKeys(e):oa.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function xa(e){const t=e[aa];return t?t.type_:Aa(e)?1:Pa(e)?2:Ta(e)?3:0}var ka=(e,t,r=xa(e))=>2===r?e.has(t):oa[ca].hasOwnProperty.call(e,t),Sa=(e,t,r=xa(e))=>2===r?e.get(t):e[t],Ma=(e,t,r,n=xa(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},Aa=Array.isArray,Pa=e=>e instanceof Map,Ta=e=>e instanceof Set,_a=e=>"object"==typeof e,Na=e=>"function"==typeof e,Da=e=>"boolean"==typeof e,ja=e=>e.copy_||e.base_,Ca=e=>e.modified_?e.copy_:e.base_;function Oa(e,t){if(Pa(e))return new Map(e);if(Ta(e))return new Set(e);if(Aa(e))return Array[ca].slice.call(e);const r=wa(e);if(!0===t||"class_only"===t&&!r){const t=oa.getOwnPropertyDescriptors(e);delete t[aa];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],a=t[i];!1===a[fa]&&(a[fa]=!0,a[da]=!0),(a.get||a.set)&&(t[i]={[da]:!0,[fa]:!0,[ha]:a[ha],[pa]:e[i]})}return oa.create(la(e),t)}{const t=la(e);if(null!==t&&r)return{...e};const n=oa.create(t);return oa.assign(n,e)}}function Wa(e,t=!1){return $a(e)||ma(e)||!ya(e)||(xa(e)>1&&oa.defineProperties(e,{set:Ea,add:Ea,clear:Ea,delete:Ea}),oa.freeze(e),t&&va(e,(e,t)=>{Wa(t,!0)},!1)),e}var Ea={[pa]:function(){sa(2)}};function $a(e){return null===e||!_a(e)||oa.isFrozen(e)}var Fa="MapSet",za="Patches",Ia="ArrayMethods",Ya={};function Ha(e){const t=Ya[e];return t||sa(0),t}var qa,La=e=>!!Ya[e],Ba=()=>qa;function Ua(e,t){t&&(e.patchPlugin_=Ha(za),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Va(e){Ra(e),e.drafts_.forEach(Za),e.drafts_=null}function Ra(e){e===qa&&(qa=e.parent_)}var Xa=e=>qa={drafts_:[],parent_:qa,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:/* @__PURE__ */new Set,processedForPatches_:/* @__PURE__ */new Set,mapSetPlugin_:La(Fa)?Ha(Fa):void 0,arrayMethodsPlugin_:La(Ia)?Ha(Ia):void 0};function Za(e){const t=e[aa];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Qa(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(void 0!==e&&e!==r){r[aa].modified_&&(Va(t),sa(4)),ya(e)&&(e=Ga(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[aa].base_,e,t)}else e=Ga(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wa(t,r)}(t,e,!0),Va(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==na?e:void 0}function Ga(e,t){if($a(t))return t;const r=t[aa];if(!r)return ns(t,e.handledSet_,e);if(!Ka(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);rs(r,e)}return r.copy_}function Ja(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ka=(e,t)=>e.scope_===t,es=[];function ts(e,t,r,n){const i=ja(e),a=e.type_;if(void 0!==n&&Sa(i,n,a)===t)return void Ma(i,n,r,a);if(!e.draftLocations_){const t=e.draftLocations_=/* @__PURE__ */new Map;va(i,(e,r)=>{if(ma(r)){const n=t.get(r)||[];n.push(e),t.set(r,n)}})}const s=e.draftLocations_.get(t)??es;for(const o of s)Ma(i,o,r,a)}function rs(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}Ja(e)}}function ns(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ma(e)||t.has(e)||!ya(e)||$a(e)||(t.add(e),va(e,(n,i)=>{if(ma(i)){const t=i[aa];Ka(t,r)&&(Ma(e,n,Ca(t),e.type_),Ja(t))}else ya(i)&&ns(i,t,r)})),e}var is={get(e,t){if(t===aa)return e;let r=e.scope_.arrayMethodsPlugin_;const n=1===e.type_&&"string"==typeof t;if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ja(e);if(!ka(i,t,e.type_))return function(e,t,r){const n=os(t,r);return n?pa in n?n[pa]:n.get?.call(e.draft_):void 0}(e,i,t);const a=i[t];if(e.finalized_||!ya(a))return a;if(n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return a;if(a===ss(e.base_,t)||function(e,t,r){return!(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ya(r)||r[aa])&&e.baseRefs_.has(r)}(e,t,a)){us(e);const r=1===e.type_?+t:t,n=cs(e.scope_,a,e,r);return e.copy_[r]=n}return a},has:(e,t)=>t in ja(e),ownKeys:e=>Reflect.ownKeys(ja(e)),set(e,t,r){const n=os(ja(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ss(ja(e),t),i=n?.[aa];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,n)&&(void 0!==r||ka(e.base_,t,e.type_)))return!0;us(e),ls(e)}return e.copy_[t]===r&&(void 0!==r||ka(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),function(e,t,r){const{scope_:n}=e;if(ma(r)){const i=r[aa];Ka(i,n)&&i.callbacks_.push(function(){us(e),ts(e,r,Ca(i),t)})}else ya(r)&&e.callbacks_.push(function(){const i=ja(e);3===e.type_?i.has(r)&&ns(r,n.handledSet_,n):Sa(i,t,e.type_)===r&&n.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&ns(Sa(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r)),!0},deleteProperty:(e,t)=>(us(e),void 0!==ss(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),ls(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=ja(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{[fa]:!0,[da]:1!==e.type_||"length"!==t,[ha]:n[ha],[pa]:r[t]}:n},defineProperty(){sa(11)},getPrototypeOf:e=>la(e.base_),setPrototypeOf(){sa(12)}},as={};for(let Gs in is){let e=is[Gs];as[Gs]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function ss(e,t){const r=e[aa];return(r?ja(r):e)[t]}function os(e,t){if(!(t in e))return;let r=la(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=la(r)}}function ls(e){e.modified_||(e.modified_=!0,e.parent_&&ls(e.parent_))}function us(e){e.copy_||(e.assigned_=/* @__PURE__ */new Map,e.copy_=Oa(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function cs(e,t,r,n){const[i,a]=Pa(t)?Ha(Fa).proxyMap_(t,r):Ta(t)?Ha(Fa).proxySet_(t,r):function(e,t){const r=Aa(e),n={type_:r?1:0,scope_:t?t.scope_:Ba(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=is;r&&(i=[n],a=as);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,[o,n]}(t,r);return(r?.scope_??Ba()).drafts_.push(i),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&void 0!==n?function(e,t,r){e.callbacks_.push(function(n){const i=t;if(!i||!Ka(i,n))return;n.mapSetPlugin_?.fixSetContents(i);const a=Ca(i);ts(e,i.draft_??i,a,r),rs(i,n)})}(r,a,n):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function ds(e){if(!ya(e)||$a(e))return e;const t=e[aa];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Oa(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Oa(e,!0);return va(r,(e,t)=>{Ma(r,e,ds(t))},n),t&&(t.finalized_=!1),r}as.deleteProperty=function(e,t){return as.set.call(this,e,t,void 0)},as.set=function(e,t,r){return is.set.call(this,e[0],t,r,e[0])},globalThis.Iterator;var hs=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{if(Na(e)&&!Na(t)){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let n;if(Na(t)||sa(6),void 0===r||Na(r)||sa(7),ya(e)){const i=Xa(this),a=cs(0,e,void 0);let s=!0;try{n=t(a),s=!1}finally{s?Va(i):Ra(i)}return Ua(i,r),Qa(n,i)}if(!e||!_a(e)){if(n=t(e),void 0===n&&(n=e),n===na&&(n=void 0),this.autoFreeze_&&Wa(n,!0),r){const t=[],i=[];Ha(za).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}sa(1)},this.produceWithPatches=(e,t)=>{if(Na(e))return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},Da(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Da(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Da(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;ya(e)||sa(8),ma(e)&&(ma(t=e)||sa(10),e=ds(t));const r=Xa(this),n=cs(0,e,void 0);return n[aa].isManual_=!0,Ra(r),n}finishDraft(e,t){const r=e&&e[aa];r&&r.isManual_||sa(9);const{scope_:n}=r;return Ua(n,t),Qa(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=Ha(za).applyPatches_;return ma(e)?n(e,t):this.produce(e,e=>n(e,t))}},fs=hs.produce,ps=a({});ps.displayName="PlitziServiceContext";var ms=()=>{let e=u(ps);if(void 0===e)throw Error("ServiceContext value is undefined. Make sure you use the PlitziServiceProvider before using the hook.");return e},ys=e=>{let{children:t,value:r}=e;/* @__PURE__ */
|
|
5
|
+
return w(ps,{value:r,children:t})},gs=typeof window>"u",bs=()=>()=>{},ws=()=>!0,vs=()=>!1,xs=({id:e,definition:t,plitziElementLayout:n,children:i,previewMode:a,visible:s=!0})=>{let[[l,c]]=ge(["schema.flat","rsc.enabled"],{mode:"mount"}),{components:d,componentDefinitions:h}=u(zn),{contexts:{PluginsContext:f}}=ms(),{plugins:p}=u(f),{items:g}=t,v=h.current[t.type],x=t.loadStrategy??v?.definition.loadStrategy??"eager",k=n||i||g?.length,S=y(!1);s&&(S.current=!0);let M=!a||"eager"===x||s||"lazy"===x&&S.current,A=n?`${n.type}:${n.rootId}:${n.containerId}`:"",P=b(bs,ws,vs);return m(()=>{if(!k||!M)return;let t=(g??[]).filter(e=>{let t=l[e];if(!t)return!1;if(!a||!c)return!0;let r=t.definition.runtime??"shared";return!(!P&&"client"===r)}).map(e=>{let{rootId:t,type:r,runtime:i}=Mt(l,`${e}.definition`,{}),s=Mt(n,"rootId",t),o=r in d.current||!!Vn({type:r,plugins:p}),u=Rn({key:!a&&n?`${e}_${A}`:e,plitziElementLayout:n,type:r,internalProps:{id:e,rootId:s},components:d.current,plugins:p});return!c||"server"!==i||gs||!a||P&&o?u:/* @__PURE__ */w(Zn,{id:e,children:u},e)});return n?.containerId===e&&t.push(/* @__PURE__ */w(r,{children:n.bodyChildren},"#layout-body")),Array.isArray(i)?t.push(...i.filter(o)):o(i)&&t.push(/* @__PURE__ */w(r,{children:i},"#children")),g?1===t.length?t[0]:t:void 0},[k,M,g,n,i,l,a,c,P,A,d,p,e])},ks=/* @__PURE__ */new Map,Ss=(e,t,r={},n={})=>{let i,{attributes:a,definition:s}=e,{rootId:o,plitziElementLayout:l}=t;if(t.attributes&&(a={...a,...t.attributes}),Object.keys(r).length>0){let t=((e,t,r={})=>{let{attributes:n,definition:i}=t,{bindings:a}=i;return!a||"object"==typeof a&&!Object.keys(a).length?{attributes:n,style:{},definition:i}:fs({attributes:n,style:r,definition:i},t=>{Object.keys(a).forEach(r=>{a[r]&&Array.isArray(a[r])&&a[r].length&&a[r].forEach(n=>{let{source:i,transformers:a,when:s,enabled:o=!0}=n,{to:l}=n;if(!l||s&&!Vi(s,e,!1,!0)||!o)return;"style"===r&&(l=function(e){if(!e)return"";let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([0-9])([a-zA-Z])/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2").replace(/[_\s-]+/g," ").trim().split(/\s+/);return 0===t.length?"":t.map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("")}(l));let{fromValue:u,toValue:c}=((e,t,r,n,i)=>{let a="initialState"===n?`definition.${n}.${i}`:`${n}.${i}`;return{fromValue:t?Mt(e,t,Mt(r,a)):void 0,toValue:Mt(r,a,t?Mt(e,t):void 0)}})(e,i,t,r,l),d=u;a&&Array.isArray(a)&&a.length>0&&a.forEach(r=>{let{action:n,params:i,enabled:a=!0}=r;if(!a)return;let s=Mt(ra,`${n}.callback`);"function"==typeof s&&(d=s(d,i,t,{...e,sourceTo:c}))}),("boolean"==typeof d||"number"==typeof d||d)&&At(t,"initialState"===r?`definition.${r}.${l}`:`${r}.${l}`,d)})})})})(r,{...e,attributes:a},i);({attributes:a,definition:s,style:i}=t)}let{queryParams:u={},routeParams:c={},variables:d={},origin:h=""}=r,f={...d,...c,...u,navigation:{routeParams:c,queryParams:u,origin:h}};if(Object.keys(f).length>0){let e={};for(let t of Object.keys(a)){let r=a[t];e[t]="string"==typeof r&&bt(r)?ct(r,f,!0):r}a=e}return a={...a,...k(n,["visibility","styleSelectors"])},s={...s,styleSelectors:{...s.styleSelectors,...s.initialState?.styleSelectors,...n.styleSelectors??{}}},s.styleSelectors=(e=>{let t=e.initialState?.styleVariant;return Object.fromEntries(Object.entries(e.styleSelectors).map(([r,n])=>{let i="base"===r?`plitzi__${e.type}`:`plitzi__${e.type}-${r}`;if("string"!=typeof n)return[r,n];!(e=>{let t=ks.get(e);return t||(t=RegExp(`(^|\\s)${e}(?=\\s|$)`),ks.set(e,t)),t})(e.type).test(n)&&t?.[e.type]?.[r]&&(n=n?`${e.type} ${n}`:e.type);let a=n.replace(/\S+/g,n=>{let i=t?.[n]?.[r];if(!i)return n;let a=Array.isArray(i)?i:[i];return n===e.type&&"base"===r?a.map(e=>`${n}--${e}`).join(" "):n===e.type&&"base"!==r?a.map(e=>`${n}-${r}--${e}`).join(" "):`${n} ${a.map(e=>`${n}--${e}`).join(" ")}`});return a?[r,`${i} ${a}`]:[r,i]}))})(s),{...t,rootId:Mt(l,"rootId",o),attributes:{...a,...k(t,["id","rootId","attributes","definition","plitziElementLayout"])},definition:s,elementState:{...s.initialState,...n},style:i}},Ms=class extends t{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){let{children:e}=this.props,{hasError:t}=this.state;return t?/* @__PURE__ */w("div",{children:"Something broke! Please refresh and try again."}):e}},As=a({});As.displayName="EventBridgeContext";var Ps=e=>{if(void 0===e)return"undefined";if(null===e)return"null";let t=typeof e;if("function"===t)return"ƒ";if("string"===t){let t=e;return JSON.stringify(t.length>40?`${t.slice(0,40)}…`:t)}return"symbol"===t?e.toString():"number"===t||"boolean"===t||"bigint"===t?`${e}`:Array.isArray(e)?0===e.length?"[]":`[…${e.length}]`:"$$typeof"in e?"<ReactElement>":"{…}"},Ts=e=>{if("object"!=typeof e||!e)return Ps(e);if("$$typeof"in e)return"<ReactElement>";if(Array.isArray(e))return 0===e.length?"[]":`[${e.slice(0,4).map(Ps).join(", ")}${e.length>4?", …":""}]`;let t=e,r=Object.keys(t);return 0===r.length?"{}":`{ ${r.slice(0,4).map(e=>`${e}: ${Ps(t[e])}`).join(", ")}${r.length>4?", …":""} }`},_s=(e,t)=>{if(Object.is(e,t))return!0;if(null===e||null===t||"object"!=typeof e||"object"!=typeof t||Array.isArray(e)!==Array.isArray(t))return!1;let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Object.is(e[r],t[r]))},Ns=ie({enabled:!1,hydrated:!1,commits:[],tree:{}},{id:"tracing"}),Ds=((e={})=>{let{max:t=100,enabled:r}=e,n=new M,i=[],a=0,s=()=>{n.forEach(e=>e())},o=e=>{a+=1;let r={seq:a,time:typeof performance<"u"?performance.now():Date.now(),path:e.path,prevValue:e.prevValue,nextValue:e.nextValue},n=i.length>=t?i.slice(i.length-t+1):i.slice();n.push(r),i=n,s()};return{middleware:e=>{if(!A(r,e.getState()))return{onChange:o}},record:o,getEntries:()=>i,entriesSince:e=>i.filter(t=>t.seq>e),lastSeq:()=>a,subscribe:e=>n.add(e),clear:()=>{i=[],s()}}})({max:30}),js=[],Cs=/* @__PURE__ */new Map,Os=/* @__PURE__ */new Map,Ws=/* @__PURE__ */new Map,Es=/* @__PURE__ */new Map,$s=!0,Fs=0,zs=/* @__PURE__ */new Map,Is=!1,Ys=!1,Hs=0,qs=!1,Ls=!1,Bs="function"==typeof requestAnimationFrame?e=>{requestAnimationFrame(e)}:e=>{setTimeout(e,16)},Us=()=>{$s&&($s=!1,Ns.setState("tree",(()=>{let e={};for(let[t,r]of Es)e[t]={parentId:Os.get(t),baseDuration:r,elementId:Ws.get(t)??t};return e})())),Ns.setState("hydrated",Ls),Ns.setState("commits",js)},Vs=()=>{if(qs=!1,Cs.size>0){let e=[...Cs.values()].sort((e,t)=>e.timestamp-t.timestamp);Cs.clear(),(js=[...js,...e]).length>200&&(js=js.slice(js.length-200))}Ys&&Us()},Rs=()=>{let e=Ds.entriesSince(Fs);Fs=Ds.lastSeq();let t=/* @__PURE__ */new Map;for(let r of e){if(void 0===r.path)continue;let e=t.get(r.path);e?e.next=r.nextValue:t.set(r.path,{prev:r.prevValue,next:r.nextValue})}return[...t.entries()].map(([e,t])=>({path:e,preview:`${Ts(t.prev)} → ${Ts(t.next)}`}))},Xs={onRender:(e,t,r,n,i,a)=>{Is||(Is=!0,Ns.setState("enabled",!0)),Es.has(e)||($s=!0),Es.set(e,n);let s=zs.get(e);zs.delete(e);let o={id:e,elementId:Ws.get(e)??e,parentId:Os.get(e),phase:t,actualDuration:r,baseDuration:n,changedProps:s},l=Cs.get(a);l?(l.elements.push(o),l.elementCount+=1,l.duration=Math.max(l.duration,r)):(Hs+=1,Cs.set(a,{commitId:Hs,timestamp:a,duration:r,elementCount:1,elements:[o],causes:Rs()})),qs||(qs=!0,Bs(Vs))},linkParent:(e,t,r)=>{(!Os.has(e)||Os.get(e)!==t)&&($s=!0),Os.size>=2e4&&!Os.has(e)&&(Os.clear(),Ws.clear(),Es.clear(),$s=!0),Os.set(e,t),Ws.set(e,r)},recordProps:(e,t)=>{zs.set(e,t)},recordStoreChange:e=>{Ds.record(e)},setHydrated:()=>{Ls||(Ls=!0,Ys&&Ns.setState("hydrated",!0))},start:()=>{Ys=!0,Vs(),Us()},stop:()=>{Ys=!1},clear:()=>{js=[],Cs.clear(),Fs=Ds.lastSeq(),zs.clear(),Hs=0,$s=!0,Us()}},Zs=/* @__PURE__ */e({default:()=>Qs}),Qs=e=>{let t=e.displayName||e.name,r=t=>{let r=y(void 0),i=y(void 0),{id:a,rootId:s}=t.internalProps,o=u(v),l=o?.visible??!0,d=`${a}${f()}`,p=o?.traceId??d,g=m(()=>({id:a,rootId:s,visible:l,traceId:p,plitziJsxSkipHOC:!0}),[a,s,l,p]);if(t.plitziJsxSkipHOC)/* @__PURE__ */return w(v,{value:g,children:/* @__PURE__ */w(e,{...t})});let{settings:{previewMode:b,debugMode:S},root:{baseElementId:M}}=ms(),[A]=ge(`schema.flat.${a}`);if(!A)throw Error(`Element ${a} not found, Page ${M}`);let{internalProps:P,customProps:T,children:_}=(({element:e,children:t,internalProps:r,previewMode:n=!1,parentVisible:i=!0})=>{let{id:a}=r,{state:s,setElementState:o}=(({id:e,bindings:t,previewMode:r})=>{let{scopePath:n}=ye(),i=m(()=>((e,t)=>t?`runtime.elements.${e}.${t}`:`runtime.elements.${e}`)(e,n),[e,n]),[a]=ge(i),s=a??$n,o=ve(),l=m(()=>(t?.attributes&&Array.isArray(t.attributes)?t.attributes:[]).filter(e=>!1!==e.enabled).map(e=>Mt(e,"to","")),[t]),u=c(e=>!!r&&(o(i,t=>{if(!e)return{};let r="function"==typeof e?e(t??$n):e;return l.length&&(r=Dt(r,l)),r}),!0),[l,i,r,o]);return h(()=>{if(r&&n)return()=>o(i,void 0)},[r,n,i,o,e]),{state:s,setElementState:u}})({id:a,bindings:e.definition.bindings,previewMode:n}),[[l,u,d]]=ge(["navigation.routeParams","navigation.queryParams","navigation.origin"]),f=(({bindings:e,sources:t})=>{let r=m(()=>{let r=new Set(t??[]);for(let t of Object.values(e??{}))if(Array.isArray(t))for(let e of t)for(let t of xt(e))r.add(t);return r.size>0&&!r.has("variables")&&r.add("variables"),[...r]},[e,t]),n=m(()=>r.map(e=>`runtime.sources.${e}`),[r]),[i]=ge(n);return m(()=>{let e={};return r.forEach((t,r)=>{void 0!==i[r]&&(e[t]=i[r])}),e},[r,i])})({bindings:e.definition.bindings,sources:["variables"]}),p=m(()=>({...Ss(e,r,{...f,routeParams:l,queryParams:u,origin:d},s),setElementState:o}),[e,r,f,l,u,d,s,o]);return{internalProps:p,customProps:k(p,["id","rootId","plitziElementLayout","attributes","definition","style","elementState","setElementState"]),children:xs({id:a,definition:p.definition,plitziElementLayout:p.plitziElementLayout,children:t,previewMode:n,visible:i&&x(p.elementState.visibility)})}})({element:A,internalProps:t.internalProps,children:t.children,previewMode:b,parentVisible:l}),{attributes:N,definition:D,style:j,plitziElementLayout:C,elementState:O,setElementState:W}=P;((e,t={},r={},n=As,i=!1)=>{let{eventBridge:a}=u(n);h(()=>{if(i||!a||!e)return;let n=Object.entries(t);for(let[t,i]of n)"function"==typeof i&&a.on(e,t,i,r);return()=>{for(let[t,r]of n)"function"==typeof r&&a.off(e,t,r)}},[e,t,a,r,i])})("element",m(()=>({[`${a}_setState`]:W}),[a,W]));let E=l&&x(O.visibility),$=m(()=>({id:a,rootId:s,visible:E,traceId:d,attributes:N,definition:D,plitziElementLayout:C,style:j,elementState:O,setElementState:W}),[N,D,O,a,C,s,j,W,E,d]),F=m(()=>{let n={...P.attributes,...t.extraProps,...T,...k(t,["plitziJsxSkipHOC","internalProps","className","children","extraProps"])};return _&&(n={...n,children:_}),/* @__PURE__ */w(Ms,{children:/* @__PURE__ */w(e,{...n,ref:r})})},[P.attributes,t,T,_]),z=/* @__PURE__ */w(v,{value:$,children:F});if(S){Xs.linkParent(d,o?.traceId,a);let e={attributes:N,definition:D,style:j,elementState:O,plitziElementLayout:C,children:_,...T,...t.extraProps,...k(t,["plitziJsxSkipHOC","internalProps","className","children","extraProps"])};return Xs.recordProps(d,((e,t)=>{if(!e)return[];let r=[],n=/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)]);for(let i of n){let n=e[i],a=t[i];if(!Object.is(n,a)&&(r.push({key:i,prev:Ts(n),next:Ts(a),ref:_s(n,a)}),r.length>=12))break}return r})(i.current,e)),i.current=e,/* @__PURE__ */w(n,{id:d,onRender:Xs.onRender,children:z})}return z};return r.displayName=`withElement(${t})`,r};export{v as $,Pe as A,fe as B,En as C,Mt as D,At as E,ge as F,ae as G,ue as H,ke as I,V as J,ie as K,Se as L,Me as M,ve as N,bt as O,be as P,x as Q,ye as R,zn as S,Pt as T,se as U,de as V,oe as W,P as X,j as Y,A as Z,qn as _,ys as a,Hn as b,Xi as c,Di as d,_i as f,Ln as g,Un as h,As as i,xe as j,ct as k,Vi as l,Vn as m,Xs as n,ms as o,Rn as p,R as q,Ns as r,fs as s,Qs as t,ji as u,Yn as v,Dt as w,In as x,Bn as y,me as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/plitzi-sdk",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"files": [
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"@fortawesome/fontawesome-free": "^7.3.1",
|
|
34
34
|
"@plitzi/nexus": "^1.1.4",
|
|
35
35
|
"@plitzi/plitzi-ui": "^1.6.21",
|
|
36
|
-
"@plitzi/sdk-auth": "0.35.
|
|
37
|
-
"@plitzi/sdk-dev-tools": "0.35.
|
|
38
|
-
"@plitzi/sdk-elements": "0.35.
|
|
39
|
-
"@plitzi/sdk-event-bridge": "0.35.
|
|
40
|
-
"@plitzi/sdk-interactions": "0.35.
|
|
41
|
-
"@plitzi/sdk-navigation": "0.35.
|
|
42
|
-
"@plitzi/sdk-plugins": "0.35.
|
|
43
|
-
"@plitzi/sdk-schema": "0.35.
|
|
44
|
-
"@plitzi/sdk-shared": "0.35.
|
|
45
|
-
"@plitzi/sdk-style": "0.35.
|
|
46
|
-
"@plitzi/sdk-variables": "0.35.
|
|
36
|
+
"@plitzi/sdk-auth": "0.35.2",
|
|
37
|
+
"@plitzi/sdk-dev-tools": "0.35.2",
|
|
38
|
+
"@plitzi/sdk-elements": "0.35.2",
|
|
39
|
+
"@plitzi/sdk-event-bridge": "0.35.2",
|
|
40
|
+
"@plitzi/sdk-interactions": "0.35.2",
|
|
41
|
+
"@plitzi/sdk-navigation": "0.35.2",
|
|
42
|
+
"@plitzi/sdk-plugins": "0.35.2",
|
|
43
|
+
"@plitzi/sdk-schema": "0.35.2",
|
|
44
|
+
"@plitzi/sdk-shared": "0.35.2",
|
|
45
|
+
"@plitzi/sdk-style": "0.35.2",
|
|
46
|
+
"@plitzi/sdk-variables": "0.35.2",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
48
|
"graphql": "^17.0.2",
|
|
49
49
|
"immer": "^11.1.18",
|