@billgangcom/theme-lib 1.65.0 → 1.65.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/dist/builder/store/useFontsStore.d.ts +6 -2
- package/dist/builder.cjs.js +5 -4
- package/dist/builder.es.js +1333 -1318
- package/dist/{index-BPn2qi_o.js → index-CMw6nNKj.js} +14 -9
- package/dist/{index-Dc4CgFbD.cjs → index-_Cl8H5kf.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +167 -167
- package/package.json +1 -1
|
@@ -14090,7 +14090,7 @@ const vG = (e) => {
|
|
|
14090
14090
|
openInNewTab: y
|
|
14091
14091
|
}
|
|
14092
14092
|
});
|
|
14093
|
-
}, [s, c, h, m, d, y]), /* @__PURE__ */ E.jsxs(
|
|
14093
|
+
}, [s, c, h, m, d, y]), console.log("ActivePage", d), /* @__PURE__ */ E.jsxs(
|
|
14094
14094
|
"div",
|
|
14095
14095
|
{
|
|
14096
14096
|
className: ai.modal,
|
|
@@ -14131,17 +14131,22 @@ const vG = (e) => {
|
|
|
14131
14131
|
{
|
|
14132
14132
|
label: "Go to",
|
|
14133
14133
|
onChange: (C) => {
|
|
14134
|
-
if (
|
|
14134
|
+
if (C === "Sign In")
|
|
14135
|
+
f("/customer-dash");
|
|
14136
|
+
else if (b) {
|
|
14135
14137
|
for (const S in b)
|
|
14136
14138
|
if (b[S].name === C) {
|
|
14137
|
-
f(b[S].path);
|
|
14139
|
+
console.log("pages[key]", b[S]), f(b[S].path);
|
|
14138
14140
|
break;
|
|
14139
14141
|
}
|
|
14140
14142
|
} else
|
|
14141
14143
|
f(MH[0]);
|
|
14142
14144
|
},
|
|
14143
|
-
options: b ?
|
|
14144
|
-
|
|
14145
|
+
options: b ? [
|
|
14146
|
+
...Object.values(b).filter((C) => C.path !== d).map((C) => C.name),
|
|
14147
|
+
"Sign In"
|
|
14148
|
+
] : ["Sign In"],
|
|
14149
|
+
value: b ? d === "/customer-dash" ? "Sign In" : ((x = Object.values(b).find((C) => C.path === d)) == null ? void 0 : x.name) || "Home" : "Home"
|
|
14145
14150
|
}
|
|
14146
14151
|
) : /* @__PURE__ */ E.jsx(
|
|
14147
14152
|
aa,
|
|
@@ -33384,11 +33389,11 @@ export {
|
|
|
33384
33389
|
zz as d,
|
|
33385
33390
|
iG as e,
|
|
33386
33391
|
Cs as f,
|
|
33387
|
-
|
|
33388
|
-
|
|
33389
|
-
|
|
33392
|
+
Ti as g,
|
|
33393
|
+
pG as h,
|
|
33394
|
+
ns as i,
|
|
33390
33395
|
E as j,
|
|
33391
|
-
|
|
33396
|
+
m4e as k,
|
|
33392
33397
|
uu as l,
|
|
33393
33398
|
_2 as m,
|
|
33394
33399
|
g4e as n,
|
|
@@ -71,7 +71,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
71
71
|
To pick up a draggable item, press the space bar.
|
|
72
72
|
While dragging, use the arrow keys to move the item.
|
|
73
73
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
74
|
-
`},Hy={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $y(e){let{announcements:t=Hy,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=Fy}=e;const{announce:o,announcement:i}=Iy(),c=cl("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),My(C.useMemo(()=>({onDragStart(p){let{active:f}=p;o(t.onDragStart({active:f}))},onDragMove(p){let{active:f,over:y}=p;t.onDragMove&&o(t.onDragMove({active:f,over:y}))},onDragOver(p){let{active:f,over:y}=p;o(t.onDragOver({active:f,over:y}))},onDragEnd(p){let{active:f,over:y}=p;o(t.onDragEnd({active:f,over:y}))},onDragCancel(p){let{active:f,over:y}=p;o(t.onDragCancel({active:f,over:y}))}}),[o,t])),!u)return null;const h=C.createElement(C.Fragment,null,C.createElement(Dy,{id:r,value:a.draggable}),C.createElement(Oy,{id:c,announcement:i}));return n?kr.createPortal(h,n):h}var Qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Qt||(Qt={}));function jc(){}function am(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function om(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ar=Object.freeze({x:0,y:0});function Vy(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Uy(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wy(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=a-r,c=o-n;if(r<a&&n<o){const u=t.width*t.height,d=e.width*e.height,h=i*c,p=h/(u+d-h);return Number(p.toFixed(4))}return 0}const qy=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:i}=o,c=n.get(i);if(c){const u=Wy(c,t);u>0&&a.push({id:i,data:{droppableContainer:o,value:u}})}}return a.sort(Vy)};function zy(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function im(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ar}function Zy(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((i,c)=>({...i,top:i.top+e*c.y,bottom:i.bottom+e*c.y,left:i.left+e*c.x,right:i.right+e*c.x}),{...n})}}const Gy=Zy(1);function Yy(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ky(e,t,n){const r=Yy(t);if(!r)return e;const{scaleX:a,scaleY:o,x:i,y:c}=r,u=e.left-i-(1-a)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),h=a?e.width/a:e.width,p=o?e.height/o:e.height;return{width:h,height:p,top:d,right:u+h,bottom:d+p,left:u}}const Xy={ignoreTransform:!1};function Oi(e,t){t===void 0&&(t=Xy);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=Jn(e).getComputedStyle(e);d&&(n=Ky(n,d,h))}const{top:r,left:a,width:o,height:i,bottom:c,right:u}=n;return{top:r,left:a,width:o,height:i,bottom:c,right:u}}function up(e){return Oi(e,{ignoreTransform:!0})}function Jy(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Qy(e,t){return t===void 0&&(t=Jn(e).getComputedStyle(e)),t.position==="fixed"}function eC(e,t){t===void 0&&(t=Jn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const o=t[a];return typeof o=="string"?n.test(o):!1})}function eh(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(Xd(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!sl(a)||tm(a)||n.includes(a))return n;const o=Jn(e).getComputedStyle(a);return a!==e&&eC(a,o)&&n.push(a),Qy(a,o)?n:r(a.parentNode)}return e?r(e):n}function sm(e){const[t]=eh(e,1);return t??null}function Gu(e){return!lu||!e?null:Ri(e)?e:Kd(e)?Xd(e)||e===Di(e).scrollingElement?window:sl(e)?e:null:null}function lm(e){return Ri(e)?e.scrollX:e.scrollLeft}function cm(e){return Ri(e)?e.scrollY:e.scrollTop}function z1(e){return{x:lm(e),y:cm(e)}}var on;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(on||(on={}));function um(e){return!lu||!e?!1:e===document.scrollingElement}function dm(e){const t={x:0,y:0},n=um(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:a,isLeft:o,isBottom:i,isRight:c,maxScroll:r,minScroll:t}}const tC={x:.2,y:.2};function nC(e,t,n,r,a){let{top:o,left:i,right:c,bottom:u}=n;r===void 0&&(r=10),a===void 0&&(a=tC);const{isTop:d,isBottom:h,isLeft:p,isRight:f}=dm(e),y={x:0,y:0},g={x:0,y:0},m={height:t.height*a.y,width:t.width*a.x};return!d&&o<=t.top+m.height?(y.y=on.Backward,g.y=r*Math.abs((t.top+m.height-o)/m.height)):!h&&u>=t.bottom-m.height&&(y.y=on.Forward,g.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!f&&c>=t.right-m.width?(y.x=on.Forward,g.x=r*Math.abs((t.right-m.width-c)/m.width)):!p&&i<=t.left+m.width&&(y.x=on.Backward,g.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:y,speed:g}}function rC(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function hm(e){return e.reduce((t,n)=>gi(t,z1(n)),Ar)}function aC(e){return e.reduce((t,n)=>t+lm(n),0)}function oC(e){return e.reduce((t,n)=>t+cm(n),0)}function iC(e,t){if(t===void 0&&(t=Oi),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);sm(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sC=[["x",["left","right"],aC],["y",["top","bottom"],oC]];class th{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=eh(n),a=hm(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,i,c]of sC)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=c(r),h=a[o]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cs{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lC(e){const{EventTarget:t}=Jn(e);return e instanceof t?e:Di(e)}function Yu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var mr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(mr||(mr={}));function dp(e){e.preventDefault()}function cC(e){e.stopPropagation()}var it;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(it||(it={}));const fm={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},uC=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case it.Right:return{...n,x:n.x+25};case it.Left:return{...n,x:n.x-25};case it.Down:return{...n,y:n.y+25};case it.Up:return{...n,y:n.y-25}}};class pm{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Cs(Di(n)),this.windowListeners=new Cs(Jn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&iC(r),n(Ar)}handleKeyDown(t){if(Qd(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=fm,coordinateGetter:i=uC,scrollBehavior:c="smooth"}=a,{code:u}=t;if(o.end.includes(u)){this.handleEnd(t);return}if(o.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Ar;this.referenceCoordinates||(this.referenceCoordinates=h);const p=i(t,{active:n,context:r.current,currentCoordinates:h});if(p){const f=Sc(p,h),y={x:0,y:0},{scrollableAncestors:g}=r.current;for(const m of g){const b=t.code,{isTop:x,isRight:_,isLeft:S,isBottom:w,maxScroll:k,minScroll:L}=dm(m),D=rC(m),j={x:Math.min(b===it.Right?D.right-D.width/2:D.right,Math.max(b===it.Right?D.left:D.left+D.width/2,p.x)),y:Math.min(b===it.Down?D.bottom-D.height/2:D.bottom,Math.max(b===it.Down?D.top:D.top+D.height/2,p.y))},T=b===it.Right&&!_||b===it.Left&&!S,I=b===it.Down&&!w||b===it.Up&&!x;if(T&&j.x!==p.x){const A=m.scrollLeft+f.x,U=b===it.Right&&A<=k.x||b===it.Left&&A>=L.x;if(U&&!f.y){m.scrollTo({left:A,behavior:c});return}U?y.x=m.scrollLeft-A:y.x=b===it.Right?m.scrollLeft-k.x:m.scrollLeft-L.x,y.x&&m.scrollBy({left:-y.x,behavior:c});break}else if(I&&j.y!==p.y){const A=m.scrollTop+f.y,U=b===it.Down&&A<=k.y||b===it.Up&&A>=L.y;if(U&&!f.x){m.scrollTo({top:A,behavior:c});return}U?y.y=m.scrollTop-A:y.y=b===it.Down?m.scrollTop-k.y:m.scrollTop-L.y,y.y&&m.scrollBy({top:-y.y,behavior:c});break}}this.handleMove(t,gi(Sc(p,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}pm.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=fm,onActivation:a}=t,{active:o}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function hp(e){return!!(e&&"distance"in e)}function fp(e){return!!(e&&"delay"in e)}class nh{constructor(t,n,r){var a;r===void 0&&(r=lC(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:i}=o;this.props=t,this.events=n,this.document=Di(i),this.documentListeners=new Cs(this.document),this.listeners=new Cs(r),this.windowListeners=new Cs(Jn(i)),this.initialCoordinates=(a=q1(o))!=null?a:Ar,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.DragStart,dp),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),this.windowListeners.add(mr.ContextMenu,dp),this.documentListeners.add(mr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fp(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hp(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(mr.Click,cC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:o}=this,{onMove:i,options:{activationConstraint:c}}=o;if(!a)return;const u=(n=q1(t))!=null?n:Ar,d=Sc(a,u);if(!r&&c){if(hp(c)){if(c.tolerance!=null&&Yu(d,c.tolerance))return this.handleCancel();if(Yu(d,c.distance))return this.handleStart()}if(fp(c)&&Yu(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),i(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===it.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cu extends nh{constructor(t){const{event:n}=t,r=Di(n.target);super(t,dC,r)}}cu.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const hC={move:{name:"mousemove"},end:{name:"mouseup"}};var Z1;(function(e){e[e.RightClick=2]="RightClick"})(Z1||(Z1={}));class fC extends nh{constructor(t){super(t,hC,Di(t.event.target))}}fC.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Z1.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ku={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pC extends nh{constructor(t){super(t,Ku)}static setup(){return window.addEventListener(Ku.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ku.move.name,t)};function t(){}}}pC.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var bs;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(bs||(bs={}));var kc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(kc||(kc={}));function mC(e){let{acceleration:t,activator:n=bs.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:i=5,order:c=kc.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:p,threshold:f}=e;const y=vC({delta:p,disabled:!o}),[g,m]=Ty(),b=C.useRef({x:0,y:0}),x=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case bs.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case bs.DraggableRect:return a}},[n,a,u]),S=C.useRef(null),w=C.useCallback(()=>{const L=S.current;if(!L)return;const D=b.current.x*x.current.x,j=b.current.y*x.current.y;L.scrollBy(D,j)},[]),k=C.useMemo(()=>c===kc.TreeOrder?[...d].reverse():d,[c,d]);C.useEffect(()=>{if(!o||!d.length||!_){m();return}for(const L of k){if((r==null?void 0:r(L))===!1)continue;const D=d.indexOf(L),j=h[D];if(!j)continue;const{direction:T,speed:I}=nC(L,j,_,t,f);for(const A of["x","y"])y[A][T[A]]||(I[A]=0,T[A]=0);if(I.x>0||I.y>0){m(),S.current=L,g(w,i),b.current=I,x.current=T;return}}b.current={x:0,y:0},x.current={x:0,y:0},m()},[t,w,r,m,o,i,JSON.stringify(_),JSON.stringify(y),g,d,k,h,JSON.stringify(f)])}const gC={x:{[on.Backward]:!1,[on.Forward]:!1},y:{[on.Backward]:!1,[on.Forward]:!1}};function vC(e){let{delta:t,disabled:n}=e;const r=W1(t);return ll(a=>{if(n||!r||!a)return gC;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[on.Backward]:a.x[on.Backward]||o.x===-1,[on.Forward]:a.x[on.Forward]||o.x===1},y:{[on.Backward]:a.y[on.Backward]||o.y===-1,[on.Forward]:a.y[on.Forward]||o.y===1}}},[n,t,r])}function yC(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ll(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function CC(e,t){return C.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,o=a.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...o]},[]),[e,t])}var Ls;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ls||(Ls={}));var G1;(function(e){e.Optimized="optimized"})(G1||(G1={}));const pp=new Map;function bC(e,t){let{dragging:n,dependencies:r,config:a}=t;const[o,i]=C.useState(null),{frequency:c,measure:u,strategy:d}=a,h=C.useRef(e),p=b(),f=Ps(p),y=C.useCallback(function(x){x===void 0&&(x=[]),!f.current&&i(_=>_===null?x:_.concat(x.filter(S=>!_.includes(S))))},[f]),g=C.useRef(null),m=ll(x=>{if(p&&!n)return pp;if(!x||x===pp||h.current!==e||o!=null){const _=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){_.set(S.id,S.rect.current);continue}const w=S.node.current,k=w?new th(u(w),w):null;S.rect.current=k,k&&_.set(S.id,k)}return _}return x},[e,o,n,p,u]);return C.useEffect(()=>{h.current=e},[e]),C.useEffect(()=>{p||y()},[n,p]),C.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),C.useEffect(()=>{p||typeof c!="number"||g.current!==null||(g.current=setTimeout(()=>{y(),g.current=null},c))},[c,p,y,...r]),{droppableRects:m,measureDroppableContainers:y,measuringScheduled:o!=null};function b(){switch(d){case Ls.Always:return!1;case Ls.BeforeDragging:return n;default:return!n}}}function mm(e,t){return ll(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function _C(e,t){return mm(e,t)}function xC(e){let{callback:t,disabled:n}=e;const r=Jd(t),a=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return C.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function uu(e){let{callback:t,disabled:n}=e;const r=Jd(t),a=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return C.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function wC(e){return new th(Oi(e),e)}function mp(e,t,n){t===void 0&&(t=wC);const[r,a]=C.useState(null);function o(){a(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const h=t(e);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const i=xC({callback(u){if(e)for(const d of u){const{type:h,target:p}=d;if(h==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),c=uu({callback:o});return na(()=>{o(),e?(c==null||c.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),i==null||i.disconnect())},[e]),r}function SC(e){const t=mm(e);return im(e,t)}const gp=[];function jC(e){const t=C.useRef(e),n=ll(r=>e?r&&r!==gp&&e&&t.current&&e.parentNode===t.current.parentNode?r:eh(e):gp,[e]);return C.useEffect(()=>{t.current=e},[e]),n}function kC(e){const[t,n]=C.useState(null),r=C.useRef(e),a=C.useCallback(o=>{const i=Gu(o.target);i&&n(c=>c?(c.set(i,z1(i)),new Map(c)):null)},[]);return C.useEffect(()=>{const o=r.current;if(e!==o){i(o);const c=e.map(u=>{const d=Gu(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,z1(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{i(e),i(o)};function i(c){c.forEach(u=>{const d=Gu(u);d==null||d.removeEventListener("scroll",a)})}},[a,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>gi(o,i),Ar):hm(e):Ar,[e,t])}function vp(e,t){t===void 0&&(t=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},t),C.useEffect(()=>{const r=e!==Ar;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Sc(e,n.current):Ar}function NC(e){C.useEffect(()=>{if(!lu)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function EC(e,t){return C.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:o}=r;return n[a]=i=>{o(i,t)},n},{}),[e,t])}function gm(e){return C.useMemo(()=>e?Jy(e):null,[e])}const yp=[];function TC(e,t){t===void 0&&(t=Oi);const[n]=e,r=gm(n?Jn(n):null),[a,o]=C.useState(yp);function i(){o(()=>e.length?e.map(u=>um(u)?r:new th(t(u),u)):yp)}const c=uu({callback:i});return na(()=>{c==null||c.disconnect(),i(),e.forEach(u=>c==null?void 0:c.observe(u))},[e]),a}function PC(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return sl(t)?t:e}function LC(e){let{measure:t}=e;const[n,r]=C.useState(null),a=C.useCallback(d=>{for(const{target:h}of d)if(sl(h)){r(p=>{const f=t(h);return p?{...p,width:f.width,height:f.height}:f});break}},[t]),o=uu({callback:a}),i=C.useCallback(d=>{const h=PC(d);o==null||o.disconnect(),h&&(o==null||o.observe(h)),r(h?t(h):null)},[t,o]),[c,u]=wc(i);return C.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const AC=[{sensor:cu,options:{}},{sensor:pm,options:{}}],RC={current:{}},lc={draggable:{measure:up},droppable:{measure:up,strategy:Ls.WhileDragging,frequency:G1.Optimized},dragOverlay:{measure:Oi}};class _s extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const DC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _s,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lc,measureDroppableContainers:jc,windowRect:null,measuringScheduled:!1},OC={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jc,draggableNodes:new Map,over:null,measureDroppableContainers:jc},du=C.createContext(OC),vm=C.createContext(DC);function IC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _s}}}function MC(e,t){switch(t.type){case Qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Qt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Qt.DragEnd:case Qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new _s(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case Qt.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new _s(e.droppable.containers);return i.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:i}}}case Qt.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new _s(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function BC(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=C.useContext(du),o=W1(r),i=W1(n==null?void 0:n.id);return C.useEffect(()=>{if(!t&&!r&&o&&i!=null){if(!Qd(o)||document.activeElement===o.target)return;const c=a.get(i);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const p=Ay(h);if(p){p.focus();break}}})}},[r,t,a,i,o]),null}function FC(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function HC(e){return C.useMemo(()=>({draggable:{...lc.draggable,...e==null?void 0:e.draggable},droppable:{...lc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...lc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $C(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const o=C.useRef(!1),{x:i,y:c}=typeof a=="boolean"?{x:a,y:a}:a;na(()=>{if(!i&&!c||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),p=im(h,r);if(i||(p.x=0),c||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const f=sm(d);f&&f.scrollBy({top:p.y,left:p.x})}},[t,i,c,r,n])}const ym=C.createContext({...Ar,scaleX:1,scaleY:1});var Ba;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ba||(Ba={}));const Cm=C.memo(function(t){var n,r,a,o;let{id:i,accessibility:c,autoScroll:u=!0,children:d,sensors:h=AC,collisionDetection:p=qy,measuring:f,modifiers:y,...g}=t;const m=C.useReducer(MC,void 0,IC),[b,x]=m,[_,S]=By(),[w,k]=C.useState(Ba.Uninitialized),L=w===Ba.Initialized,{draggable:{active:D,nodes:j,translate:T},droppable:{containers:I}}=b,A=D!=null?j.get(D):null,U=C.useRef({initial:null,translated:null}),K=C.useMemo(()=>{var We;return D!=null?{id:D,data:(We=A==null?void 0:A.data)!=null?We:RC,rect:U}:null},[D,A]),X=C.useRef(null),[G,Q]=C.useState(null),[oe,le]=C.useState(null),de=Ps(g,Object.values(g)),B=cl("DndDescribedBy",i),V=C.useMemo(()=>I.getEnabled(),[I]),F=HC(f),{droppableRects:W,measureDroppableContainers:J,measuringScheduled:fe}=bC(V,{dragging:L,dependencies:[T.x,T.y],config:F.droppable}),ee=yC(j,D),re=C.useMemo(()=>oe?q1(oe):null,[oe]),se=at(),ge=_C(ee,F.draggable.measure);$C({activeNode:D!=null?j.get(D):null,config:se.layoutShiftCompensation,initialRect:ge,measure:F.draggable.measure});const ae=mp(ee,F.draggable.measure,ge),Oe=mp(ee?ee.parentElement:null),q=C.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=I.getNodeFor((n=q.current.over)==null?void 0:n.id),xe=LC({measure:F.dragOverlay.measure}),Ae=(r=xe.nodeRef.current)!=null?r:ee,Be=L?(a=xe.rect)!=null?a:ae:null,ue=!!(xe.nodeRef.current&&xe.rect),Pe=SC(ue?null:ae),Le=gm(Ae?Jn(Ae):null),Ee=jC(L?Ce??ee:null),dt=TC(Ee),st=FC(y,{transform:{x:T.x-Pe.x,y:T.y-Pe.y,scaleX:1,scaleY:1},activatorEvent:oe,active:K,activeNodeRect:ae,containerNodeRect:Oe,draggingNodeRect:Be,over:q.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Ee,scrollableAncestorRects:dt,windowRect:Le}),_t=re?gi(re,T):null,Et=kC(Ee),Mt=vp(Et),Wt=vp(Et,[ae]),tt=gi(st,Mt),nn=Be?Gy(Be,st):null,Tt=K&&nn?p({active:K,collisionRect:nn,droppableRects:W,droppableContainers:V,pointerCoordinates:_t}):null,Bt=Uy(Tt,"id"),[Ke,_n]=C.useState(null),An=ue?st:gi(st,Wt),la=zy(An,(o=Ke==null?void 0:Ke.rect)!=null?o:null,ae),qt=C.useRef(null),rn=C.useCallback((We,lt)=>{let{sensor:xt,options:xn}=lt;if(X.current==null)return;const zt=j.get(X.current);if(!zt)return;const Zt=We.nativeEvent,an=new xt({active:X.current,activeNode:zt,event:Zt,options:xn,context:q,onAbort(wt){if(!j.get(wt))return;const{onDragAbort:Jt}=de.current,cn={id:wt};Jt==null||Jt(cn),_({type:"onDragAbort",event:cn})},onPending(wt,ln,Jt,cn){if(!j.get(wt))return;const{onDragPending:R}=de.current,M={id:wt,constraint:ln,initialCoordinates:Jt,offset:cn};R==null||R(M),_({type:"onDragPending",event:M})},onStart(wt){const ln=X.current;if(ln==null)return;const Jt=j.get(ln);if(!Jt)return;const{onDragStart:cn}=de.current,Cr={activatorEvent:Zt,active:{id:ln,data:Jt.data,rect:U}};kr.unstable_batchedUpdates(()=>{cn==null||cn(Cr),k(Ba.Initializing),x({type:Qt.DragStart,initialCoordinates:wt,active:ln}),_({type:"onDragStart",event:Cr}),Q(qt.current),le(Zt)})},onMove(wt){x({type:Qt.DragMove,coordinates:wt})},onEnd:Rn(Qt.DragEnd),onCancel:Rn(Qt.DragCancel)});qt.current=an;function Rn(wt){return async function(){const{active:Jt,collisions:cn,over:Cr,scrollAdjustedTranslate:R}=q.current;let M=null;if(Jt&&R){const{cancelDrop:$}=de.current;M={activatorEvent:Zt,active:Jt,collisions:cn,delta:R,over:Cr},wt===Qt.DragEnd&&typeof $=="function"&&await Promise.resolve($(M))&&(wt=Qt.DragCancel)}X.current=null,kr.unstable_batchedUpdates(()=>{x({type:wt}),k(Ba.Uninitialized),_n(null),Q(null),le(null),qt.current=null;const $=wt===Qt.DragEnd?"onDragEnd":"onDragCancel";if(M){const v=de.current[$];v==null||v(M),_({type:$,event:M})}})}}},[j]),$r=C.useCallback((We,lt)=>(xt,xn)=>{const zt=xt.nativeEvent,Zt=j.get(xn);if(X.current!==null||!Zt||zt.dndKit||zt.defaultPrevented)return;const an={active:Zt};We(xt,lt.options,an)===!0&&(zt.dndKit={capturedBy:lt.sensor},X.current=xn,rn(xt,lt))},[j,rn]),Re=CC(h,$r);NC(h),na(()=>{ae&&w===Ba.Initializing&&k(Ba.Initialized)},[ae,w]),C.useEffect(()=>{const{onDragMove:We}=de.current,{active:lt,activatorEvent:xt,collisions:xn,over:zt}=q.current;if(!lt||!xt)return;const Zt={active:lt,activatorEvent:xt,collisions:xn,delta:{x:tt.x,y:tt.y},over:zt};kr.unstable_batchedUpdates(()=>{We==null||We(Zt),_({type:"onDragMove",event:Zt})})},[tt.x,tt.y]),C.useEffect(()=>{const{active:We,activatorEvent:lt,collisions:xt,droppableContainers:xn,scrollAdjustedTranslate:zt}=q.current;if(!We||X.current==null||!lt||!zt)return;const{onDragOver:Zt}=de.current,an=xn.get(Bt),Rn=an&&an.rect.current?{id:an.id,rect:an.rect.current,data:an.data,disabled:an.disabled}:null,wt={active:We,activatorEvent:lt,collisions:xt,delta:{x:zt.x,y:zt.y},over:Rn};kr.unstable_batchedUpdates(()=>{_n(Rn),Zt==null||Zt(wt),_({type:"onDragOver",event:wt})})},[Bt]),na(()=>{q.current={activatorEvent:oe,active:K,activeNode:ee,collisionRect:nn,collisions:Tt,droppableRects:W,draggableNodes:j,draggingNode:Ae,draggingNodeRect:Be,droppableContainers:I,over:Ke,scrollableAncestors:Ee,scrollAdjustedTranslate:tt},U.current={initial:Be,translated:nn}},[K,ee,Tt,nn,j,Ae,Be,W,I,Ke,Ee,tt]),mC({...se,delta:T,draggingRect:nn,pointerCoordinates:_t,scrollableAncestors:Ee,scrollableAncestorRects:dt});const Ze=C.useMemo(()=>({active:K,activeNode:ee,activeNodeRect:ae,activatorEvent:oe,collisions:Tt,containerNodeRect:Oe,dragOverlay:xe,draggableNodes:j,droppableContainers:I,droppableRects:W,over:Ke,measureDroppableContainers:J,scrollableAncestors:Ee,scrollableAncestorRects:dt,measuringConfiguration:F,measuringScheduled:fe,windowRect:Le}),[K,ee,ae,oe,Tt,Oe,xe,j,I,W,Ke,J,Ee,dt,F,fe,Le]),Ge=C.useMemo(()=>({activatorEvent:oe,activators:Re,active:K,activeNodeRect:ae,ariaDescribedById:{draggable:B},dispatch:x,draggableNodes:j,over:Ke,measureDroppableContainers:J}),[oe,Re,K,ae,x,B,j,Ke,J]);return C.createElement(rm.Provider,{value:S},C.createElement(du.Provider,{value:Ge},C.createElement(vm.Provider,{value:Ze},C.createElement(ym.Provider,{value:la},d)),C.createElement(BC,{disabled:(c==null?void 0:c.restoreFocus)===!1})),C.createElement($y,{...c,hiddenTextDescribedById:B}));function at(){const We=(G==null?void 0:G.autoScrollEnabled)===!1,lt=typeof u=="object"?u.enabled===!1:u===!1,xt=L&&!We&&!lt;return typeof u=="object"?{...u,enabled:xt}:{enabled:xt}}}),VC=C.createContext(null),Cp="button",UC="Draggable";function WC(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=cl(UC),{activators:i,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:p,over:f}=C.useContext(du),{role:y=Cp,roleDescription:g="draggable",tabIndex:m=0}=a??{},b=(u==null?void 0:u.id)===t,x=C.useContext(b?ym:VC),[_,S]=wc(),[w,k]=wc(),L=EC(i,t),D=Ps(n);na(()=>(p.set(t,{id:t,key:o,node:_,activatorNode:w,data:D}),()=>{const T=p.get(t);T&&T.key===o&&p.delete(t)}),[p,t]);const j=C.useMemo(()=>({role:y,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&y===Cp?!0:void 0,"aria-roledescription":g,"aria-describedby":h.draggable}),[r,y,m,b,g,h.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:j,isDragging:b,listeners:r?void 0:L,node:_,over:f,setNodeRef:S,setActivatorNodeRef:k,transform:x}}function qC(){return C.useContext(vm)}const zC="Droppable",ZC={timeout:25};function GC(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=cl(zC),{active:i,dispatch:c,over:u,measureDroppableContainers:d}=C.useContext(du),h=C.useRef({disabled:n}),p=C.useRef(!1),f=C.useRef(null),y=C.useRef(null),{disabled:g,updateMeasurementsFor:m,timeout:b}={...ZC,...a},x=Ps(m??r),_=C.useCallback(()=>{if(!p.current){p.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(x.current)?x.current:[x.current]),y.current=null},b)},[b]),S=uu({callback:_,disabled:g||!i}),w=C.useCallback((j,T)=>{S&&(T&&(S.unobserve(T),p.current=!1),j&&S.observe(j))},[S]),[k,L]=wc(w),D=Ps(t);return C.useEffect(()=>{!S||!k.current||(S.disconnect(),p.current=!1,S.observe(k.current))},[k,S]),C.useEffect(()=>(c({type:Qt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:k,rect:f,data:D}}),()=>c({type:Qt.UnregisterDroppable,key:o,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(c({type:Qt.SetDroppableDisabled,id:r,key:o,disabled:n}),h.current.disabled=n)},[r,o,n,c]),{active:i,rect:f,isOver:(u==null?void 0:u.id)===r,node:k,over:u,setNodeRef:L}}function bm(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function YC(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Dl(e){return e!==null&&e>=0}function KC(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function XC(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const _m=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=bm(t,r,n),i=t[a],c=o[a];return!c||!i?null:{x:c.left-i.left,y:c.top-i.top,scaleX:c.width/i.width,scaleY:c.height/i.height}},Ol={scaleX:1,scaleY:1},xm=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:a,rects:o,overIndex:i}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(a===n){const d=o[i];return d?{x:0,y:n<i?d.top+d.height-(c.top+c.height):d.top-c.top,...Ol}:null}const u=JC(o,a,n);return a>n&&a<=i?{x:0,y:-c.height-u,...Ol}:a<n&&a>=i?{x:0,y:c.height+u,...Ol}:{x:0,y:0,...Ol}};function JC(e,t,n){const r=e[t],a=e[t-1],o=e[t+1];return r?n<t?a?r.top-(a.top+a.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const wm="Sortable",Sm=C.createContext({activeIndex:-1,containerId:wm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_m,disabled:{draggable:!1,droppable:!1}});function jm(e){let{children:t,id:n,items:r,strategy:a=_m,disabled:o=!1}=e;const{active:i,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:h}=qC(),p=cl(wm,n),f=c.rect!==null,y=C.useMemo(()=>r.map(L=>typeof L=="object"&&"id"in L?L.id:L),[r]),g=i!=null,m=i?y.indexOf(i.id):-1,b=d?y.indexOf(d.id):-1,x=C.useRef(y),_=!KC(y,x.current),S=b!==-1&&m===-1||_,w=XC(o);na(()=>{_&&g&&h(y)},[_,y,g,h]),C.useEffect(()=>{x.current=y},[y]);const k=C.useMemo(()=>({activeIndex:m,containerId:p,disabled:w,disableTransforms:S,items:y,overIndex:b,useDragOverlay:f,sortedRects:YC(y,u),strategy:a}),[m,p,w.draggable,w.droppable,S,y,b,u,f,a]);return C.createElement(Sm.Provider,{value:k},t)}const QC=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return bm(n,r,a).indexOf(t)},eb=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:i,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==o&&a===i?!1:n?!0:i!==a&&t===u},tb={duration:200,easing:"ease"},km="transform",nb=bi.Transition.toString({property:km,duration:0,easing:"linear"}),rb={roleDescription:"sortable"};function ab(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,i]=C.useState(null),c=C.useRef(n);return na(()=>{if(!t&&n!==c.current&&r.current){const u=a.current;if(u){const d=Oi(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&i(h)}}n!==c.current&&(c.current=n)},[t,n,r,a]),C.useEffect(()=>{o&&i(null)},[o]),o}function Nm(e){let{animateLayoutChanges:t=eb,attributes:n,disabled:r,data:a,getNewIndex:o=QC,id:i,strategy:c,resizeObserverConfig:u,transition:d=tb}=e;const{items:h,containerId:p,activeIndex:f,disabled:y,disableTransforms:g,sortedRects:m,overIndex:b,useDragOverlay:x,strategy:_}=C.useContext(Sm),S=ob(r,y),w=h.indexOf(i),k=C.useMemo(()=>({sortable:{containerId:p,index:w,items:h},...a}),[p,a,w,h]),L=C.useMemo(()=>h.slice(h.indexOf(i)),[h,i]),{rect:D,node:j,isOver:T,setNodeRef:I}=GC({id:i,data:k,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...u}}),{active:A,activatorEvent:U,activeNodeRect:K,attributes:X,setNodeRef:G,listeners:Q,isDragging:oe,over:le,setActivatorNodeRef:de,transform:B}=WC({id:i,data:k,attributes:{...rb,...n},disabled:S.draggable}),V=Ey(I,G),F=!!A,W=F&&!g&&Dl(f)&&Dl(b),J=!x&&oe,fe=J&&W?B:null,re=W?fe??(c??_)({rects:m,activeNodeRect:K,activeIndex:f,overIndex:b,index:w}):null,se=Dl(f)&&Dl(b)?o({id:i,items:h,activeIndex:f,overIndex:b}):w,ge=A==null?void 0:A.id,ae=C.useRef({activeId:ge,items:h,newIndex:se,containerId:p}),Oe=h!==ae.current.items,q=t({active:A,containerId:p,isDragging:oe,isSorting:F,id:i,index:w,items:h,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:d,wasDragging:ae.current.activeId!=null}),Ce=ab({disabled:!q,index:w,node:j,rect:D});return C.useEffect(()=>{F&&ae.current.newIndex!==se&&(ae.current.newIndex=se),p!==ae.current.containerId&&(ae.current.containerId=p),h!==ae.current.items&&(ae.current.items=h)},[F,se,p,h]),C.useEffect(()=>{if(ge===ae.current.activeId)return;if(ge!=null&&ae.current.activeId==null){ae.current.activeId=ge;return}const Ae=setTimeout(()=>{ae.current.activeId=ge},50);return()=>clearTimeout(Ae)},[ge]),{active:A,activeIndex:f,attributes:X,data:k,rect:D,index:w,newIndex:se,items:h,isOver:T,isSorting:F,isDragging:oe,listeners:Q,node:j,overIndex:b,over:le,setNodeRef:V,setActivatorNodeRef:de,setDroppableNodeRef:I,setDraggableNodeRef:G,transform:Ce??re,transition:xe()};function xe(){if(Ce||Oe&&ae.current.newIndex===w)return nb;if(!(J&&!Qd(U)||!d)&&(F||q))return bi.Transition.toString({...d,property:km})}}function ob(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}it.Down,it.Right,it.Up,it.Left;function ib({product:e,children:t}){const{attributes:n,listeners:r,setNodeRef:a,transform:o,transition:i,isDragging:c}=Nm({id:e.id}),u={transform:bi.Transform.toString(o),transition:i};return P.jsx("div",{ref:a,style:u,className:`${$t.product} ${c?$t.dragging:""}`,...n,...r,children:t})}const Em=e=>{const{isActiveItems:t,setIsActiveItems:n,items:r,setItems:a,other:o,title:i,subtitle:c,editable:u=!0,draggable:d=!1,withImage:h=!1,deletable:p=!0,addable:f=!0,itemsType:y,itemsPlaceholder:g="",itemsOptions:m,hasRangeSelector:b=!1,rangeSelectorOptions:x,modalOptions:_,addableOptions:S={},limit:w,autoInterval:k,tip:L}=e,[D,j]=C.useState(null),[T,I]=C.useState({top:0,left:0}),[A,U]=C.useState(null),K=C.useRef(null),[X,G]=C.useState(!1),Q=om(am(cu,{activationConstraint:{distance:5}}));C.useEffect(()=>{if(D){const F=[...r].map(W=>W.id===D.id?D:W);a(F)}},[D]),C.useEffect(()=>{if(K.current&&A){const F=K.current.getBoundingClientRect().height,W=window.innerHeight;let J=A.top;J+F>W+window.scrollY-200&&(J=W+window.scrollY-F-200),J<0&&(J=10),I({top:J-30,left:A.left})}},[K.current,A]);const oe=(F,W)=>{F.stopPropagation();const J=F.target.getBoundingClientRect();U({top:J.top+window.scrollY-70,left:J.left-(f?30:65)}),j(W),G(!0)},le=(F,W)=>{const J=[...r],fe={...F,id:Math.random().toString(36).substr(2,9)};J.splice(W+1,0,fe),a(J)};function de(F){if(h)return F?P.jsx("img",{src:`https://imagedelivery.net/${F[0]}/w=1000`,alt:"image",width:16,height:16}):P.jsx(pt,{name:"Image",width:16,height:16,fill:"#757575"})}const B=F=>{const{active:W,over:J}=F;if(J&&W.id!==J.id){const fe=r.findIndex(re=>re.id===W.id),ee=r.findIndex(re=>re.id===J.id);if(fe!==-1&&ee!==-1){const re=[...r],[se]=re.splice(fe,1);re.splice(ee,0,se),a(re)}}},V=(F,W)=>{var fe,ee;const J=P.jsxs(P.Fragment,{children:[d&&P.jsx("div",{children:P.jsx(pt,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&m&&P.jsx(Lo,{onChange:re=>{const se=[...r],ge=m.find(Oe=>Oe.name["en-US"]===re);if(!ge)return;const ae=se.map(Oe=>Oe.id===F.id?{...ge,name:{"en-US":re}}:Oe);j({...F,name:{"en-US":re}}),a([...ae])},value:F.name["en-US"],options:m.filter(re=>!r.find(se=>se.name["en-US"]===re.name["en-US"])).map(re=>re.name["en-US"]),leftAddon:de(F.images)}),y==="input"&&P.jsx(Er,{onChange:re=>{const ge=[...r].map(ae=>ae.id===F.id?{...F,name:{"en-US":re}}:ae);a([...ge])},value:F.name["en-US"],placeholder:g}),y==="image"&&P.jsx(il,{onChange:re=>{const ge=[...r].map(ae=>ae.id===F.id?{...F,images:re}:ae);a([...ge])},activeImage:(fe=r.find(re=>re.id===F.id))!=null&&fe.images?(ee=r.find(re=>re.id===F.id))==null?void 0:ee.images[0]:void 0,tip:L}),P.jsxs("div",{className:$t.buttons,children:[w&&w>r.length&&f&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{le(F,W)}})}),u&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:re=>{oe(re,F)}})}),p&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(re=>re.id!==F.id))})})]})]});return d?P.jsx(ib,{product:F,index:W,children:J},F.id):P.jsx("div",{className:$t.product,children:J},F.id)};return P.jsxs("div",{className:$t.productsBlock,children:[(i||t!==void 0)&&P.jsxs("div",{className:$t.top,children:[i&&P.jsx("h3",{className:$t.title,children:i}),t!==void 0&&P.jsx(ao,{current:t,onChange:F=>n==null?void 0:n(F)})]}),D&&u&&_&&X&&P.jsx(Sy,{ref:K,activeItem:D,setActiveItem:j,popupPosition:T,modalOptions:_,setIsOpenModal:G}),(t===void 0||t)&&b&&x&&P.jsx(Tm,{...x}),(t===void 0||t)&&P.jsxs("div",{className:$t.products,children:[c&&P.jsx("h5",{className:$t.subtitle,children:c}),d?P.jsx(Cm,{sensors:Q,onDragEnd:B,children:P.jsx(jm,{items:r.map(F=>F.id),strategy:xm,children:r.map((F,W)=>V(F,W))})}):r.map((F,W)=>V(F,W)),f&&P.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:P.jsx(xc,{withoutHover:!0,className:Ot($t.button,{[$t.disabled]:!!(w&&w<=r.length||r.length===(m==null?void 0:m.length))}),size:"s",disabled:!!(w&&w<=r.length||r.length===(m==null?void 0:m.length)),onClick:()=>{const F=[...r];let W=null;if(m){for(let J=0;J<m.length;J++)if(!r.find(fe=>fe.id===m[J].id)){W=m[J];break}}y==="select"&&m?F.push({name:W?W.name:m[0].name,id:(W==null?void 0:W.id)||m[0].id,...S}):y==="input"?F.push({name:{"en-US":""},id:Ci(),...S}):F.push({name:{"en-US":`Image ${r.length+1}`},id:Ci(),...S}),a(F)},style:{width:"fit-content"},children:P.jsxs("div",{className:$t.addButton,children:[P.jsx("span",{children:"Add Option"}),P.jsx(pt,{name:"Plus",width:16,height:16})]})})})]}),(t===void 0||t)&&o!==void 0&&P.jsx(em,{items:o}),(t===void 0||t)&&k!==void 0&&P.jsx(Er,{label:k.title||"Auto scroll interval",type:"number",value:String(k.autoInterval),onChange:F=>k.setAutoInterval(Number(F)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},sb="_title_cx65i_1",lb="_subtitle_cx65i_5",cb="_header_cx65i_12",ub="_text_cx65i_13",db="_productsBlock_cx65i_14",hb="_top_cx65i_26",fb="_itemsBlock_cx65i_35",pb="_typeTexts_cx65i_41",mb="_block_cx65i_48",gb="_active_cx65i_61",vb="_products_cx65i_14",yb="_product_cx65i_14",Cb="_button_cx65i_80",bb="_disabled_cx65i_91",_b="_image_cx65i_95",xb="_info_cx65i_102",wb="_name_cx65i_114",Sb="_buttons_cx65i_118",jb="_modal_cx65i_125",kb="_link_cx65i_146",Nb="_modalOptions_cx65i_152",Eb="_addButton_cx65i_165",Tb="_deleteButton_cx65i_180",Pb="_closeIcon_cx65i_192",mo={title:sb,subtitle:lb,header:cb,text:ub,productsBlock:db,top:hb,itemsBlock:fb,typeTexts:pb,block:mb,active:gb,products:vb,product:yb,button:Cb,disabled:bb,image:_b,info:xb,name:wb,buttons:Sb,modal:jb,link:kb,modalOptions:Nb,addButton:Eb,deleteButton:Tb,closeIcon:Pb},Lb=C.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:r,popupPosition:a,modalOptions:o,setIsOpenModal:i}=e;return Pi(t,()=>{r(null),i(!1)}),P.jsxs("div",{ref:t,className:mo.modal,onClick:c=>{c.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[P.jsxs("div",{className:mo.top,children:[P.jsx("h3",{className:mo.title,children:n.name["en-US"]}),P.jsx("div",{className:mo.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),i(!1)}})})]}),P.jsx("div",{className:mo.modalOptions,children:o.map(c=>{if(c.type==="image")return P.jsx(il,{label:"Put up an attractive image",activeImage:n[c.field],onChange:u=>{const d={...n,[c.field]:u};r(d)}},String(c.field));if(c.type==="text")return P.jsx(Yd,{isActiveText:!0,typesText:n[c.field.type],setTypesText:u=>{const d={...n,[c.field.type]:u};r(d)},text:n[c.field.text]["en-US"]||"",setText:u=>{const d={...n,[c.field.text]:{"en-US":u}};r(d)},typeFont:n[c.field.type],setTypeFont:u=>{const d={...n,[c.field.type]:u};r(d)},subtitle:c.label});if(c.type==="input")return P.jsx(Er,{onChange:u=>{const d={...n,[c.field]:{"en-US":u}};r(d)},value:n[c.field]["en-US"]||"",label:c.label,placeholder:c.placeholder});if(c.type==="inputNumber")return P.jsx(Er,{onChange:u=>{const d={...n,[c.field]:u};r(d)},value:n[c.field]||"",label:c.label,placeholder:c.placeholder,type:"number"});if(c.type==="inputSwitch")return P.jsxs("div",{className:mo.link,children:[P.jsx(Er,{onChange:u=>{const d={...n,[c.field.text]:{"en-US":u}};r(d)},value:n[c.field.text]["en-US"]||"",label:c.inputLabel,placeholder:c.placeholder}),P.jsx(ao,{current:!!n[c.field.switch]||!1,label:c.switchLabel,onChange:u=>{const d={...n,[c.field.switch]:u};r(d)}})]});if(c.type==="select")return P.jsx(Lo,{options:c.itemsOptions,onChange:u=>{const d={...n,[c.field]:u};r(d)},label:c.label,value:n[c.field]||"String",leftAddon:c.leftAddon&&c.leftAddon==="icon"&&P.jsx(pt,{name:n[c.field]})})})})]})}),Ab="_title_hvj8m_1",Rb="_subtitle_hvj8m_5",Db="_header_hvj8m_12",Ob="_text_hvj8m_13",Ib="_productsBlock_hvj8m_14",Mb="_buttonsBlock_hvj8m_15",Bb="_top_hvj8m_26",Fb="_itemsBlock_hvj8m_35",Hb="_typeTexts_hvj8m_41",$b="_block_hvj8m_48",Vb="_active_hvj8m_60",Ub="_products_hvj8m_14",Wb="_product_hvj8m_14",qb="_button_hvj8m_15",zb="_image_hvj8m_90",Zb="_info_hvj8m_97",Gb="_name_hvj8m_109",Yb="_buttons_hvj8m_15",Kb="_modal_hvj8m_120",Xb="_other_hvj8m_140",Jb="_options_hvj8m_146",Qb="_closeIcon_hvj8m_154",ci={title:Ab,subtitle:Rb,header:Db,text:Ob,productsBlock:Ib,buttonsBlock:Mb,top:Bb,itemsBlock:Fb,typeTexts:Hb,block:$b,active:Vb,products:Ub,product:Wb,button:qb,image:zb,info:Zb,name:Gb,buttons:Yb,modal:Kb,other:Xb,options:Jb,closeIcon:Qb},e_=C.forwardRef((e,t)=>{var S;const{activeButton:n,setActiveButton:r,popupPosition:a,editableLink:o=!0}=e,[i,c]=C.useState(n.typesText),[u,d]=C.useState(n.destination),[h,p]=C.useState(n.page),[f,y]=C.useState(n.link||""),[g,m]=C.useState(n.text||{"en-US":""}),[b,x]=C.useState(n.openInNewTab),{pages:_}=Md();return Pi(t,()=>{r(null)}),C.useEffect(()=>{r({...n,...{text:g,link:f,destination:u,typesText:i,page:h,openInNewTab:b}})},[i,u,f,g,h,b]),P.jsxs("div",{className:ci.modal,onClick:w=>{w.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:t,children:[P.jsxs("div",{className:ci.top,children:[P.jsx("h3",{className:ci.title,children:n.type}),P.jsx("div",{className:ci.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),P.jsxs("div",{className:ci.options,children:[o&&P.jsx(Lo,{label:"Destination",onChange:w=>d(w),options:["Go to Page","Open Link"].filter(w=>w!==u),value:u}),o&&(u==="Go to Page"?P.jsx(Lo,{label:"Go to",onChange:w=>{if(_){for(const k in _)if(_[k].name===w){p(_[k].path);break}}else p(v2[0])},options:_?Object.values(_).filter(w=>w.path!==h).map(w=>w.name):[],value:_&&((S=Object.values(_).find(w=>w.path===h))==null?void 0:S.name)||"Home"}):P.jsx(Er,{onChange:w=>y(w),value:f,placeholder:"https://",label:"Link"})),o&&P.jsx(ao,{current:n.openInNewTab,label:"Open in new tab",onChange:w=>x(w)}),P.jsx(Gd,{onChange:w=>m({"en-US":w}),value:g["en-US"],label:"Text",maxLength:150}),P.jsx(Zd,{typesText:i,setTypesText:c})]})]})}),t_="_wrapper_m18qi_1",n_="_subtitle_m18qi_7",r_="_content_m18qi_14",a_="_range_m18qi_22",o_="_track_m18qi_27",i_="_progress_m18qi_36",s_="_dots_m18qi_46",l_="_dot_m18qi_46",c_="_active_m18qi_65",u_="_input_m18qi_77",d_="_countBlock_m18qi_91",h_="_count_m18qi_91",f_="_controls_m18qi_107",p_="_button_m18qi_113",Sn={wrapper:t_,subtitle:n_,content:r_,range:a_,track:o_,progress:i_,dots:s_,dot:l_,active:c_,input:u_,countBlock:d_,count:h_,controls:f_,button:p_},Tm=e=>{const{label:t,min:n=1,max:r=4,step:a=1,count:o,setCount:i}=e,[c,u]=C.useState(!1),d=Array.from({length:(r-n)/a+1}),h=(o-n)/(r-n)*100,p=()=>{o<r&&i(o+a)},f=()=>{o>n&&i(o-a)},y=g=>{const m=n+g*a;i(m)};return P.jsxs("div",{className:Sn.wrapper,children:[t&&P.jsx("h5",{className:Sn.subtitle,children:t}),P.jsxs("div",{className:Sn.content,children:[P.jsxs("div",{className:Sn.range,children:[P.jsx("div",{className:Sn.track}),P.jsx("div",{className:Sn.progress,style:{width:`${h}%`}}),P.jsx("div",{className:Sn.dots,children:d.map((g,m)=>{const b=m<=(o-n)/a;return P.jsx("button",{onClick:()=>y(m),className:Ot(Sn.dot,{[Sn.active]:b,[Sn.inactive]:!b,[Sn.dragging]:c}),"aria-label":`Set value to ${n+m*a}`},m)})}),P.jsx("input",{type:"range",min:n,max:r,step:a,value:o,onChange:g=>i(Number(g.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Sn.input})]}),P.jsxs("div",{className:Sn.countBlock,children:[P.jsx(Er,{type:"number",min:n,max:r,paddingless:!0,onChange:g=>{const m=Number(g);m>r?i(r):m<n?i(n):i(m)},value:String(o)}),P.jsxs("div",{className:Sn.controls,children:[P.jsx("button",{onClick:p,disabled:o>=r,className:Sn.button,"aria-label":"Increment count",children:P.jsx(pt,{name:"CaretUp",width:15,height:15})}),P.jsx("button",{onClick:f,disabled:o<=n,className:Sn.button,"aria-label":"Decrement count",children:P.jsx(pt,{name:"CaretDown",width:15,height:15})})]})]})]})]})},m_="_title_11jyy_1",g_="_subtitle_11jyy_5",v_="_header_11jyy_12",y_="_text_11jyy_13",C_="_productsBlock_11jyy_14",b_="_top_11jyy_26",__="_itemsBlock_11jyy_35",x_="_typeTexts_11jyy_41",w_="_block_11jyy_48",S_="_active_11jyy_61",j_="_products_11jyy_14",k_="_product_11jyy_14",N_="_button_11jyy_80",E_="_image_11jyy_91",T_="_info_11jyy_98",P_="_name_11jyy_110",L_="_buttons_11jyy_114",A_="_modal_11jyy_121",R_="_link_11jyy_142",D_="_modalOptions_11jyy_148",O_="_addButton_11jyy_161",I_="_deleteButton_11jyy_176",M_="_closeIcon_11jyy_188",ps={title:m_,subtitle:g_,header:v_,text:y_,productsBlock:C_,top:b_,itemsBlock:__,typeTexts:x_,block:w_,active:S_,products:j_,product:k_,button:N_,image:E_,info:T_,name:P_,buttons:L_,modal:A_,link:R_,modalOptions:D_,addButton:O_,deleteButton:I_,closeIcon:M_},bp=Symbol(),Xu=function(e){try{return e(...[].slice.call(arguments,1))}catch(t){return setTimeout(()=>{throw t}),t instanceof Error?t:t=new Error(t)}};function $a(e,t){if(e)throw new Error(`Reatom error: ${t}`)}const cc=e=>(e==null?void 0:e.__reatom)!==void 0,_p=e=>{var t;return((t=e==null?void 0:e.__reatom)==null?void 0:t.isAction)===!0},uo=e=>e.subs.size+e.listeners.size>0;function Y1(e){$a(typeof e!="function",`invalid "${typeof e}", function expected`)}const Pm=e=>e.cause===null?e:Pm(e.cause);let rs;const B_=({callLateEffect:e=Xu,callNearEffect:t=Xu}={})=>{let n=new WeakMap,r=D=>n.get(D),a=new Set,o=[],i=[],c=!1,u=null,d=[],h=[],p=[],f=0,y=0,g=!1,m=()=>{for(let D of o)t(D,L);o=[]},b=()=>{if(!g){g=!0,m();for(let D of i)e(D,L),o.length>0&&m();i=[],g=!1}},x=({state:D,proto:j,pubs:T,subs:I,listeners:A},U)=>(j.actual=!1,p.push(j.patch={state:D,proto:j,cause:U,pubs:T,subs:I,listeners:A}),j.patch),_=D=>{for(let j of D.subs){let T=j.patch??r(j);j.patch&&!j.actual||x(T,D).listeners.size===0&&_(T)}},S=(D,j)=>{if(j.subs.delete(D)&&(h.push(()=>j.subs.add(D)),!uo(j))){j.proto.disconnectHooks!==null&&o.push(...j.proto.disconnectHooks);for(let T of j.pubs)S(j.proto,T)}},w=(D,j)=>{if(!j.subs.has(D)){let T=uo(j);if(j.subs.add(D),h.push(()=>j.subs.delete(D)),!T){j.proto.connectHooks!==null&&o.push(...j.proto.connectHooks);for(let I of j.pubs)w(j.proto,I)}}},k=(D,j,T)=>{let{patch:I,actual:A}=j,U=T!==void 0;if(!U&&A&&(I.pubs.length===0||uo(I)))return I;let K=I??r(j),X=!K,G=U?D.cause:r(uc);if(X)K={state:j.initState(D),proto:j,cause:G,pubs:[],subs:new Set,listeners:new Set};else if(j.computer===null&&!U)return K;I&&!A||(I=x(K,G));let{state:Q}=I,oe={get:D.get,spy:void 0,schedule:D.schedule,subscribe:D.subscribe,cause:I};try{j.computer&&((le,de)=>{let{proto:B,pubs:V}=de,F=!1;if(V.length===0||V.some(({proto:W,state:J})=>!Object.is(J,(de.cause=k(le,W)).state))){let W=[];if(le.spy=({__reatom:J},fe)=>{if(de.pubs===V){let ee=k(le,J),re=W.push(ee)<=V.length?V[W.length-1]:void 0,se=(re==null?void 0:re.proto)!==ee.proto;F||(F=se);let ge=J.isAction&&!se?ee.state.slice(re.state.length):ee.state;if(!fe||!se&&Object.is(ge,re.state))return ge;if(J.isAction)for(const ae of ge)fe(ae);else fe(ge,se||re==null?void 0:re.state)}else $a(!0,"async spy")},de.state=de.proto.computer(le,de.state),de.pubs=W,(F||V.length>W.length)&&uo(de)){for(let{proto:J}of V)W.every(fe=>fe.proto!==J)&&S(B,J.patch??r(J));for(let{proto:J}of W)V.every(fe=>fe.proto!==J)&&w(B,J.patch??r(J))}}})(oe,I),U&&(I.cause=D.cause,T(oe,I)),j.actual=!0}catch(le){throw I.error=le}if(!Object.is(Q,I.state)&&(I.subs.size>0&&(U||I.listeners.size>0)&&_(I),j.updateHooks)){let le={get:oe.get,spy:void 0,schedule:oe.schedule,subscribe:oe.subscribe,cause:oe.cause};j.updateHooks.forEach(de=>d.push(()=>de(le,I)))}return I},L={get(D){if($a(rs&&Pm(rs.cause)!==r(uc),"cause collision"),cc(D)){let I=D.__reatom;if(c)return k(this,I).state;let A=r(I);return A===void 0||I.computer!==null&&!uo(A)?this.get(()=>k(this,I).state):A.state}if($a(u!==null,"tr failed"),c)return D(r,k);c=!0,f=o.length,y=i.length;let j=rs===void 0;j&&(rs=this);try{var T=D(r,k);for(let I=0;I<p.length;I++){let{listeners:A,proto:U}=p[I];if(A.size>0&&k(this,U),d.length>0)for(let K of d.splice(0))K(this)}if(p.length)for(let I of a)I(p);for(let I of p){let{proto:A,state:U}=I;if(A.isAction&&(I.state=[]),I===A.patch)if(A.patch=null,A.actual=!1,n.set(A,I),A.isAction){if(U.length===0)continue;for(let K of I.listeners)o.push(()=>K(U))}else for(let K of I.listeners)i.push(()=>K(r(A).state))}}catch(I){u=I=I instanceof Error?I:new Error(String(I));for(let A of a)A(p,I);for(let A of h)Xu(A,I);for(let{proto:A}of p)A.patch=null,A.actual=!1;throw o.length=f,i.length=y,I}finally{c=!1,u=null,d=[],h=[],p=[],f=0,y=0,j&&(rs=void 0)}return b(),T},spy:void 0,schedule(D,j=1){return Y1(D),$a(!this,"missed context"),new Promise((T,I)=>{j===-1?c&&h.push(D):j===0?c&&d.push(()=>D(this)):((j===1?o:i).push(()=>{try{let A=D(this);return A instanceof Promise?A.then(T,I):T(A),A}catch(A){throw I(A),A}}),c||b())})},subscribe(D,j=D){if(Y1(j),D===j)return a.add(j),()=>a.delete(j);let{__reatom:T}=D,I=bp,A=K=>Object.is(I,K)||j(I=K),U=r(T);return U!==void 0&&uo(U)?U.listeners.add(A):this.get(()=>{U=k(this,T,(K,X)=>{}),U.listeners.add(A),h.push(()=>T.patch.listeners.delete(A)),T.connectHooks!==null&&o.push(...T.connectHooks);for(let K of U.pubs)w(T,K)}),I===bp&&A((T.patch??r(T)).state),()=>{if(U.listeners.delete(A)&&!uo(U)){T.disconnectHooks&&o.push(...T.disconnectHooks);for(let K of U.pubs)S(T,K);c||(h.length=0,b())}}},cause:void 0};return(L.cause=L.get(()=>k(L,uc))).cause=null,L};let F_=0,hu=e=>`${e}#${++F_}`;function H_(){return[].slice.call(arguments).reduce((e,t)=>t(e),this)}function $_(e){var t;const n=(r,a)=>e(r,a.state);return((t=this.__reatom).updateHooks??(t.updateHooks=new Set)).add(n),()=>this.__reatom.updateHooks.delete(n)}function V_(e){return this.onChange((t,n)=>{const{params:r,payload:a}=n[n.length-1];e(t,a,r)})}function ze(e,t=hu("_atom")){let n=(a,o)=>a.get((i,c)=>c(a,n.__reatom,(u,d)=>{d.state=typeof o=="function"?o(d.state,u):o}).state),r=null;return typeof e=="function"&&(n={},r=e,e=void 0),n.__reatom={name:t,isAction:!1,patch:null,initState:()=>e,computer:r,connectHooks:null,disconnectHooks:null,updateHooks:null,actual:!1},n.pipe=H_,n.onChange=$_,xp.length===0?n:n.pipe(...xp)}const jo=(e,t)=>{e!==void 0&&typeof e!="string"||(t=e,e=(r,a)=>a),Y1(e);let n=ze([],t??hu("_action"));return n.__reatom.isAction=!0,n.__reatom.unstable_fn=e,Object.assign(function(){var r=[].slice.call(arguments);let a=n(r[0],(o,i)=>(r[0]=i,[...o,{params:r.slice(1),payload:i.cause.proto.unstable_fn(...r)}]));return a[a.length-1].payload},n,{onCall:V_})},xp=[],uc=ze(void 0,"root").__reatom,Eo=()=>{},U_=e=>typeof e=="object"&&e!==null,rh=Object.assign,K1=function(){return Object.assign({},...[].slice.call(arguments))},W_=(e=0,t=Number.MAX_SAFE_INTEGER-1)=>Math.floor(Math.random()*(t-e+1))+e,{toString:q_}=Object.prototype,fu=e=>{if(e instanceof Error==0||e.name!=="AbortError"){if(e instanceof Error){var t={cause:e};e=e.message}else e=U_(e)?q_.call(e):String(e);typeof DOMException>"u"?(e=new Error(e,t)).name="AbortError":e=rh(new DOMException(e,"AbortError"),t)}return e},X1=e=>{if(e!=null&&e.signal.aborted)throw fu(e.signal.reason)},Lm=e=>e instanceof Error&&e.name==="AbortError",Am=2**31-1;function z_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}let Z_=class extends WeakMap{has(e){return super.has(e)||e.cause!==null&&this.has(e.cause)}get(e){for(;!super.has(e)&&e.cause;)e=e.cause;return super.get(e)}};const ah=new Z_,Rm=e=>ah.get(e)??null,Dm=(e,t)=>{const n=Rm(e.cause);if(n){const r=()=>t(fu(n.signal.reason)),a=()=>n.signal.removeEventListener("abort",r);if(!n.signal.aborted)return n.signal.addEventListener("abort",r),e.schedule(()=>n.signal.removeEventListener("abort",r),-1),a;r()}},Ju=new WeakMap,Om=(e,t,n,r)=>{let a=Ju.get(t);if(!a){const o=t.then(i=>(e.get((c,u)=>a.then.forEach(d=>d(i,c,u))),i),i=>{throw e.get((c,u)=>a.catch.forEach(d=>d(i,c,u))),Lm(i)&&o.catch(Eo),i});Ju.set(t,a={promise:o,then:[],catch:[]}),Ju.set(o,a)}return n&&a.then.push(n),r&&a.catch.push(r),a.promise},G_=e=>{const{schedule:t}=e;return K1(e,{schedule(n,r=1){const a=this;if(r<1)return t.call(this,n,r);let o,i;const c=new Promise((d,h)=>{o=d,i=h}),u=Dm(this,d=>{c.catch(Eo),i(d)});return t.call(this,function(d){try{let h=function(){u==null||u()};const p=z_(function(){const f=Rm(a.cause);return X1(f),Promise.resolve(n(d)).then(function(y){X1(f),o(y)})},function(f){i(f)});return Promise.resolve(p&&p.then?p.then(h):h())}catch(h){return Promise.reject(h)}},r).catch(d=>{i(d),u==null||u()}),c}})},Nc=e=>e.cause===null?e:Nc(e.cause),Y_=(e,t)=>Nc(e.cause)===Nc(t.cause),K_=(e,t)=>{var n;return((n=e.__reatom).connectHooks??(n.connectHooks=new Set)).add(t)},X_=(e,t)=>{var n;return((n=e.__reatom).disconnectHooks??(n.disconnectHooks=new Set)).add(t)},fr=(e,t)=>{const n=a=>{const o=K1(a.get(h=>h(e.__reatom)),{cause:Nc(a.cause)}),i=new AbortController;ah.set(o,i);const c=t(K1(a,{cause:o,controller:i,isConnected:()=>J_(a,e)}));c instanceof Promise&&c.catch(Eo);const u=h=>{Y_(a,h)&&d.delete(u)&&r.has(n)&&(i.abort(fu(`${e.__reatom.name} disconnect`)),typeof c=="function"&&c())},d=X_(e,u)},r=K_(e,n);return()=>r.delete(n)},J_=(e,{__reatom:t})=>e.get(n=>{const r=t.patch??n(t);return!!r&&r.subs.size+r.listeners.size>0}),Q_=ze(null,"initializations");Q_.__reatom.initState=()=>new WeakMap;const ex=(e,t,{shouldPending:n=!0,shouldFulfill:r=!0,shouldReject:a=!0,effect:o=e.__reatom.unstable_fn}={})=>{const i=e.pendingAtom,[c]=t;n&&i(c,d=>++d);const u=c.schedule(()=>new Promise((d,h)=>{X1(c.controller),o(...t).then(d,h),c.controller.signal.addEventListener("abort",()=>h(fu(c.controller.signal.reason)))}));return rh(Om(c,u,d=>{r&&e.onFulfill(c,d),n&&i(c,h=>--h)},d=>{a&&!Lm(d)&&e.onReject(c,d),n&&i(c,h=>--h)}),{controller:c.controller})},tn=(e,t={})=>{const{name:n=hu("async"),onEffect:r,onFulfill:a,onReject:o,onSettle:i}=typeof t=="string"?{name:t}:t,c=ze(0,`${n}.pendingAtom`),u=Object.assign(function(){var f=[].slice.call(arguments);return f[0].get((y,g)=>{const{state:m}=g(f[0],u.__reatom,(b,x)=>{ah.set(b.cause,b.controller=new AbortController);const _=Dm(f[0],w=>{S==null||S.catch(Eo),b.controller.abort(w)});_&&b.controller.signal.addEventListener("abort",_),f[0]=G_(b);var S=u._handleCache?u._handleCache(...f):ex(u,f);Om(b,S,void 0,()=>{h.__reatom.updateHooks.size>1&&S.catch(Eo)}),x.state=[...x.state,{params:f.slice(1),payload:S}]});return m[m.length-1].payload})},jo(e,n)),d=jo(`${n}.onFulfill`),h=jo(`${n}.onReject`),p=jo(`${n}._onSettle`);return d.onCall(f=>p(f)),h.onCall(f=>p(f)),r&&u.onCall((f,y,g)=>r(f,g,y)),a&&d.onCall(a),o&&h.onCall(o),i&&p.onCall(i),fr(c,f=>f.subscribe(u,Eo)),rh(u,{onFulfill:d,onReject:h,onSettle:p,pendingAtom:c})};tn.from=(e,t={})=>(e.name.length>2&&(typeof t=="object"?t.name??(t.name=e.name):t??(t=e.name)),tn(function(n){return e(...[].slice.call(arguments,1))},t));const $n=(e,t)=>n=>{if(!n.dataAtom){const r=n.dataAtom=Object.assign(ze(e,`${n.__reatom.name}.dataAtom`),{reset:jo(a=>{r(a,e)},`${n.__reatom.name}.dataAtom.reset`),mapFulfill:t});r.__reatom.computer=(a,o)=>(a.spy(n.onFulfill,({payload:i})=>{o=i}),o),n.onFulfill.onCall(a=>{a.get(r)}),fr(r,a=>a.subscribe(n,Eo))}return n},wp=new WeakMap,Im=(e,t)=>{let n=wp.get(e);n||wp.set(e,n=new WeakMap);let r=n.get(t);return r||n.set(t,r=t.bind(null,e)),r},tx=ze(null);tx.__reatom.initState=()=>new WeakMap;const nx=()=>{},rx=Object.assign,{toString:ax}=Object.prototype,oh=e=>{if(e instanceof Error==0||e.name!=="AbortError"){if(e instanceof Error){var t={cause:e};e=e.message}else e=typeof(n=e)=="object"&&n!==null?ax.call(e):String(e);typeof DOMException>"u"?(e=new Error(e,t)).name="AbortError":e=rx(new DOMException(e,"AbortError"),t)}var n;return e},Sp=e=>{if(e!=null&&e.signal.aborted)throw oh(e.signal.reason)};class ox extends WeakMap{has(t){return super.has(t)||t.cause!==null&&this.has(t.cause)}get(t){for(;!super.has(t)&&t.cause;)t=t.cause;return super.get(t)}}const J1=new ox,jp=e=>J1.get(e)??null,ix=e=>{const{schedule:t}=e;return function(){return Object.assign({},...[].slice.call(arguments))}(e,{schedule(n,r=1){const a=this;if(r<1)return t.call(this,n,r);let o,i;const c=new Promise((d,h)=>{o=d,i=h}),u=((d,h)=>{const p=jp(d.cause);if(p){const f=()=>{return g=oh(p.signal.reason),c.catch(nx),void i(g);var g},y=()=>p.signal.removeEventListener("abort",f);if(!p.signal.aborted)return p.signal.addEventListener("abort",f),d.schedule(()=>p.signal.removeEventListener("abort",f),-1),y;f()}})(this);return t.call(this,function(d){try{let h=function(){u==null||u()};const p=function(f,y){try{var g=function(){const m=jp(a.cause);return Sp(m),Promise.resolve(n(d)).then(function(b){Sp(m),o(b)})}()}catch(m){return y(m)}return g&&g.then?g.then(void 0,y):g}(0,function(f){i(f)});return Promise.resolve(p&&p.then?p.then(h):h())}catch(h){return Promise.reject(h)}},r).catch(d=>{i(d),u==null||u()}),c}})},sx=typeof document<"u"?C.useLayoutEffect:C.useEffect;let Mm=e=>{var t,n,r;let a=(r=(n=(t=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:t.ReactCurrentOwner)==null?void 0:n.current)==null?void 0:r.type,o=(a==null?void 0:a.displayName)??(a==null?void 0:a.name);return o&&o.concat(".",e)||`_${e}`},Bm=e=>e();const Fm=C.createContext(null),ih=()=>{let e=C.useContext(Fm);return $a(!e,"ctx is not set, you probably forgot to specify the ctx provider"),e};let lx=(e,t)=>Im(e,t);const me=(e,t=[],n={})=>{let{name:r,subscribe:a=!0}=typeof n=="boolean"?{subscribe:n}:n,o=ih(),i=[o];cc(e)&&i.push(e);let c=C.useMemo(()=>{let y=Mm(r??"useAtom#"+typeof e),g=ze([],`${y}._depsAtom`),m=e;return cc(m)||(m=ze(typeof e=="function"?(b,x)=>(b.spy(g),c.anAtom(b,x)):e,y)),{theAtom:m,depsAtom:g,update:typeof m=="function"?function(){return Bm(()=>m(o,...[].slice.call(arguments)))}:void 0,sub:b=>o.subscribe(m,b),get:()=>o.get(m),subscribe:a,anAtom:e}},i);c.anAtom=e;let{theAtom:u,depsAtom:d,update:h,sub:p,get:f}=c;return o.get(()=>{if(!cc(e)){const y=o.get(d);(t.length!==y.length||t.some((g,m)=>!Object.is(g,y[m])))&&(typeof e=="function"?d(o,t):h(o,e))}return[a?C.useSyncExternalStore(p,f,f):f(),h,u,o]})},Fr=(e,t=[],n)=>{$a(typeof e!="function",'invalid "fn"'),t??(t=[]);let r=ih();t.push(r),_p(e)&&t.push(e);let a=C.useMemo(()=>{let o=_p(e)?e:jo(function(){return a.fn(...[].slice.call(arguments))},Mm("useAction"));return{fn:e,cb:function(){return Bm(()=>o(r,...[].slice.call(arguments)))}}},t);return sx(()=>{a.fn=e}),a.cb},cx=(e,t=hu("Component"))=>{let n=!1;return Object.defineProperty(r=>{const{controller:a,propsAtom:o,renderAtom:i}=C.useMemo(()=>{const d=new AbortController,h=ze({},`${t}._propsAtom`),p=ze((f,y)=>{const{pubs:g}=f.cause,m=f.spy(h);if(n){const b=C.useRef();if(!b.current){const S=b.current=ix(f);J1.set(S.cause,d)}const x=b.current;m.ctx={get:f.get,spy:f.spy,schedule:f.schedule,subscribe:f.subscribe,cause:x.cause,bind:Im(x,lx)};const _=e(m);return typeof _!="object"||_===null||Symbol.iterator in _?C.createElement(C.Fragment,null,_):_}for(let b=1;b<g.length;b++)f.spy({__reatom:g[b].proto});return{...y,REATOM_DEPS_CHANGE:!0}},`${t}._renderAtom`);return{controller:d,propsAtom:h,renderAtom:p}},[]),c=ih(),[,u]=C.useState({});return C.useEffect(()=>{let d=a;if(d.signal.aborted){const p=c.get(o).ctx.cause;J1.set(p,d=new AbortController)}const h=c.subscribe(i,p=>{p.REATOM_DEPS_CHANGE&&u(p)});return()=>{h(),d.abort(oh(`${t} unmount`))}},[c,i]),c.get(()=>{o(c,{...r});try{return n=!0,c.get(i)}finally{n=!1}})},"name",{value:t})},Hm=e=>{const t=ze(e,`storageAtom#${e.name}`);return Object.assign(n=>r=>{const{key:a,fromSnapshot:o=(b,x)=>x,migration:i,subscribe:c=!!e.subscribe,time:u=Am,toSnapshot:d=(b,x)=>x,version:h=0}=typeof n=="string"?{key:n}:n,p=r.__reatom,{initState:f}=p,y=function(b,x){x===void 0&&(x=null);const _=b.get(t).get(b,a);return(_==null?void 0:_.id)===(x==null?void 0:x.id)?x:_??x},g=function(b,x,_){return x===void 0&&(x=y(b)),x===null||x.version!==h&&i===void 0?f(b):o(b,x.version!==h?i(b,x):x.data,_)};$a(!a,"missed key");const m=ze(null,`${r.__reatom.name}._${e.name}Atom`);if(m.__reatom.computer=y,c){const{computer:b}=r.__reatom;r.__reatom.computer=(x,_)=>(x.spy(m,S=>{_=g(x,S,_)}),b?b(x,_):_),fr(r,x=>{var _,S;return(S=(_=x.get(t)).subscribe)==null?void 0:S.call(_,x,a,()=>{m(x,w=>w)})})}else r.__reatom.initState=g;return r.onChange((b,x)=>{const{cause:_}=b,S=b.get(k=>k(uc));b.get(m);let w=b.get((k,L)=>L(b,m.__reatom));if(_.cause===w&&w.cause===_&&(w.cause=S),r.__reatom.patch===_&&_.cause!==w){const{subs:k}=w;w.subs=new Set;const L=m(b,((j,T)=>({data:d(j,T),fromState:!0,id:W_(),timestamp:Date.now(),to:Date.now()+u,version:h}))(b,x));(w=w.proto.patch).subs=w.subs=k,w.cause=S;const D=_.pubs.findIndex(j=>{let{proto:T}=j;return T===w.proto});_.pubs[D]=w,b.get(t).set(b,a,L)}}),r},{storageAtom:t})},sh=e=>{let{name:t,mutable:n=!0,snapshot:r={},subscribe:a=!0}=e;const o=Date.now(),i=o+Am,c=ze(Object.entries(r).reduce((d,h)=>{let[p,f]=h;return d[p]={data:f,fromState:!1,id:0,timestamp:o,to:i,version:0},d},{}),`${t}._snapshotAtom`),u=ze(function(d,h){return h===void 0&&(h=new Map),h},`${t}._listenersAtom`);return{name:t,get:(d,h)=>d.get(c)[h]??null,set:(d,h,p)=>{if(n){const f=d.get(c),y=f[h];f[h]=p,d.schedule(()=>f[h]=y,-1)}else c(d,f=>({...f,[h]:p}));d.schedule(()=>{var f;return(f=d.get(u).get(h))==null?void 0:f.forEach(y=>y(p))})},subscribe:a?(d,h,p)=>{const f=d.get(u);f.set(h,(f.get(h)??new Set).add(p));const y=()=>{const g=f.get(h);g&&(g.delete(p),g.size===0&&f.delete(h))};return d.schedule(y,-1),y}:void 0,snapshotAtom:c}};try{var $m=!!globalThis.BroadcastChannel}catch{$m=!1}$m?new BroadcastChannel("reatom_withBroadcastChannel_default"):sh({name:"withBroadcastChannel"});new BroadcastChannel("reatom_withIndexedDb_default");const ux=(e,t)=>{const n=ze((r,a=new Map)=>a,`${e}._memCacheAtom`);return Hm({name:e,get(r,a){try{const o=r.get(n),i=t.getItem(a);if(i){const c=JSON.parse(i);if(c.to<Date.now())return this.clear(r,a),null;const u=o.get(a);return(u==null?void 0:u.id)===c.id||(u==null?void 0:u.timestamp)>=c.timestamp?u:(o.set(a,c),c)}}catch{return null}return null},set(r,a,o){r.get(n).set(a,o),r.schedule(()=>t.setItem(a,JSON.stringify(o)))},clear(r,a){r.get(n).delete(a),r.schedule(()=>t.removeItem(a))},subscribe(r,a,o){var i;const c=r.get(n),u=d=>{var h;if(d.storageArea===t&&d.key===a)if(d.newValue===null)c.delete(a);else{const p=JSON.parse(d.newValue);p.id!==((h=c.get(a))==null?void 0:h.id)&&(c.set(a,p),o())}};return(i=globalThis.addEventListener)==null||i.call(globalThis,"storage",u,!1),()=>{var d;return(d=globalThis.removeEventListener)==null?void 0:d.call(globalThis,"storage",u,!1)}}})};try{var lh=!!globalThis.localStorage}catch{lh=!1}const ch=lh?ux("withLocalStorage",globalThis.localStorage):Hm(sh({name:"withLocalStorage"}));lh?globalThis.sessionStorage:sh({name:"withSessionStorage"});try{var dx="cookie"in globalThis.document}catch{dx=!1}const io=ze("").pipe(ch("token")),_i=ze({requested:!1,email:""}),Vm=tn(async(e,{email:t,recaptcha:n})=>{await bt("auth/otp/request",{body:{email:t,recaptcha:n},apiUrl:fh(),method:"POST",useToken:!1})&&_i(e,{requested:!0,email:t})}),Um=tn(async(e,{otp:t,recaptcha:n})=>{const r="auth/otp/login",a=e.get(_i).email,o=await bt(r,{method:"POST",body:{email:a,otp:t,recaptcha:n},apiUrl:fh(),useToken:!1});o.data&&(io(e,o.data),_i(e,{requested:!1}))}),Q1=jo(e=>{io(e,"")});var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ed={exports:{}},as={};/**
|
|
74
|
+
`},Hy={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $y(e){let{announcements:t=Hy,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=Fy}=e;const{announce:o,announcement:i}=Iy(),c=cl("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),My(C.useMemo(()=>({onDragStart(p){let{active:f}=p;o(t.onDragStart({active:f}))},onDragMove(p){let{active:f,over:y}=p;t.onDragMove&&o(t.onDragMove({active:f,over:y}))},onDragOver(p){let{active:f,over:y}=p;o(t.onDragOver({active:f,over:y}))},onDragEnd(p){let{active:f,over:y}=p;o(t.onDragEnd({active:f,over:y}))},onDragCancel(p){let{active:f,over:y}=p;o(t.onDragCancel({active:f,over:y}))}}),[o,t])),!u)return null;const h=C.createElement(C.Fragment,null,C.createElement(Dy,{id:r,value:a.draggable}),C.createElement(Oy,{id:c,announcement:i}));return n?kr.createPortal(h,n):h}var Qt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Qt||(Qt={}));function jc(){}function am(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function om(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ar=Object.freeze({x:0,y:0});function Vy(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Uy(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wy(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=a-r,c=o-n;if(r<a&&n<o){const u=t.width*t.height,d=e.width*e.height,h=i*c,p=h/(u+d-h);return Number(p.toFixed(4))}return 0}const qy=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:i}=o,c=n.get(i);if(c){const u=Wy(c,t);u>0&&a.push({id:i,data:{droppableContainer:o,value:u}})}}return a.sort(Vy)};function zy(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function im(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ar}function Zy(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((i,c)=>({...i,top:i.top+e*c.y,bottom:i.bottom+e*c.y,left:i.left+e*c.x,right:i.right+e*c.x}),{...n})}}const Gy=Zy(1);function Yy(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ky(e,t,n){const r=Yy(t);if(!r)return e;const{scaleX:a,scaleY:o,x:i,y:c}=r,u=e.left-i-(1-a)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),h=a?e.width/a:e.width,p=o?e.height/o:e.height;return{width:h,height:p,top:d,right:u+h,bottom:d+p,left:u}}const Xy={ignoreTransform:!1};function Oi(e,t){t===void 0&&(t=Xy);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=Jn(e).getComputedStyle(e);d&&(n=Ky(n,d,h))}const{top:r,left:a,width:o,height:i,bottom:c,right:u}=n;return{top:r,left:a,width:o,height:i,bottom:c,right:u}}function up(e){return Oi(e,{ignoreTransform:!0})}function Jy(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Qy(e,t){return t===void 0&&(t=Jn(e).getComputedStyle(e)),t.position==="fixed"}function eC(e,t){t===void 0&&(t=Jn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const o=t[a];return typeof o=="string"?n.test(o):!1})}function eh(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(Xd(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!sl(a)||tm(a)||n.includes(a))return n;const o=Jn(e).getComputedStyle(a);return a!==e&&eC(a,o)&&n.push(a),Qy(a,o)?n:r(a.parentNode)}return e?r(e):n}function sm(e){const[t]=eh(e,1);return t??null}function Gu(e){return!lu||!e?null:Ri(e)?e:Kd(e)?Xd(e)||e===Di(e).scrollingElement?window:sl(e)?e:null:null}function lm(e){return Ri(e)?e.scrollX:e.scrollLeft}function cm(e){return Ri(e)?e.scrollY:e.scrollTop}function z1(e){return{x:lm(e),y:cm(e)}}var on;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(on||(on={}));function um(e){return!lu||!e?!1:e===document.scrollingElement}function dm(e){const t={x:0,y:0},n=um(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:a,isLeft:o,isBottom:i,isRight:c,maxScroll:r,minScroll:t}}const tC={x:.2,y:.2};function nC(e,t,n,r,a){let{top:o,left:i,right:c,bottom:u}=n;r===void 0&&(r=10),a===void 0&&(a=tC);const{isTop:d,isBottom:h,isLeft:p,isRight:f}=dm(e),y={x:0,y:0},g={x:0,y:0},m={height:t.height*a.y,width:t.width*a.x};return!d&&o<=t.top+m.height?(y.y=on.Backward,g.y=r*Math.abs((t.top+m.height-o)/m.height)):!h&&u>=t.bottom-m.height&&(y.y=on.Forward,g.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!f&&c>=t.right-m.width?(y.x=on.Forward,g.x=r*Math.abs((t.right-m.width-c)/m.width)):!p&&i<=t.left+m.width&&(y.x=on.Backward,g.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:y,speed:g}}function rC(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function hm(e){return e.reduce((t,n)=>gi(t,z1(n)),Ar)}function aC(e){return e.reduce((t,n)=>t+lm(n),0)}function oC(e){return e.reduce((t,n)=>t+cm(n),0)}function iC(e,t){if(t===void 0&&(t=Oi),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);sm(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sC=[["x",["left","right"],aC],["y",["top","bottom"],oC]];class th{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=eh(n),a=hm(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,i,c]of sC)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=c(r),h=a[o]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cs{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lC(e){const{EventTarget:t}=Jn(e);return e instanceof t?e:Di(e)}function Yu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var mr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(mr||(mr={}));function dp(e){e.preventDefault()}function cC(e){e.stopPropagation()}var it;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(it||(it={}));const fm={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},uC=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case it.Right:return{...n,x:n.x+25};case it.Left:return{...n,x:n.x-25};case it.Down:return{...n,y:n.y+25};case it.Up:return{...n,y:n.y-25}}};class pm{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Cs(Di(n)),this.windowListeners=new Cs(Jn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&iC(r),n(Ar)}handleKeyDown(t){if(Qd(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=fm,coordinateGetter:i=uC,scrollBehavior:c="smooth"}=a,{code:u}=t;if(o.end.includes(u)){this.handleEnd(t);return}if(o.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Ar;this.referenceCoordinates||(this.referenceCoordinates=h);const p=i(t,{active:n,context:r.current,currentCoordinates:h});if(p){const f=Sc(p,h),y={x:0,y:0},{scrollableAncestors:g}=r.current;for(const m of g){const b=t.code,{isTop:x,isRight:_,isLeft:S,isBottom:w,maxScroll:k,minScroll:L}=dm(m),D=rC(m),j={x:Math.min(b===it.Right?D.right-D.width/2:D.right,Math.max(b===it.Right?D.left:D.left+D.width/2,p.x)),y:Math.min(b===it.Down?D.bottom-D.height/2:D.bottom,Math.max(b===it.Down?D.top:D.top+D.height/2,p.y))},T=b===it.Right&&!_||b===it.Left&&!S,I=b===it.Down&&!w||b===it.Up&&!x;if(T&&j.x!==p.x){const A=m.scrollLeft+f.x,U=b===it.Right&&A<=k.x||b===it.Left&&A>=L.x;if(U&&!f.y){m.scrollTo({left:A,behavior:c});return}U?y.x=m.scrollLeft-A:y.x=b===it.Right?m.scrollLeft-k.x:m.scrollLeft-L.x,y.x&&m.scrollBy({left:-y.x,behavior:c});break}else if(I&&j.y!==p.y){const A=m.scrollTop+f.y,U=b===it.Down&&A<=k.y||b===it.Up&&A>=L.y;if(U&&!f.x){m.scrollTo({top:A,behavior:c});return}U?y.y=m.scrollTop-A:y.y=b===it.Down?m.scrollTop-k.y:m.scrollTop-L.y,y.y&&m.scrollBy({top:-y.y,behavior:c});break}}this.handleMove(t,gi(Sc(p,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}pm.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=fm,onActivation:a}=t,{active:o}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function hp(e){return!!(e&&"distance"in e)}function fp(e){return!!(e&&"delay"in e)}class nh{constructor(t,n,r){var a;r===void 0&&(r=lC(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:i}=o;this.props=t,this.events=n,this.document=Di(i),this.documentListeners=new Cs(this.document),this.listeners=new Cs(r),this.windowListeners=new Cs(Jn(i)),this.initialCoordinates=(a=q1(o))!=null?a:Ar,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.DragStart,dp),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),this.windowListeners.add(mr.ContextMenu,dp),this.documentListeners.add(mr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fp(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(hp(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(mr.Click,cC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:o}=this,{onMove:i,options:{activationConstraint:c}}=o;if(!a)return;const u=(n=q1(t))!=null?n:Ar,d=Sc(a,u);if(!r&&c){if(hp(c)){if(c.tolerance!=null&&Yu(d,c.tolerance))return this.handleCancel();if(Yu(d,c.distance))return this.handleStart()}if(fp(c)&&Yu(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),i(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===it.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cu extends nh{constructor(t){const{event:n}=t,r=Di(n.target);super(t,dC,r)}}cu.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const hC={move:{name:"mousemove"},end:{name:"mouseup"}};var Z1;(function(e){e[e.RightClick=2]="RightClick"})(Z1||(Z1={}));class fC extends nh{constructor(t){super(t,hC,Di(t.event.target))}}fC.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Z1.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ku={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pC extends nh{constructor(t){super(t,Ku)}static setup(){return window.addEventListener(Ku.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ku.move.name,t)};function t(){}}}pC.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var bs;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(bs||(bs={}));var kc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(kc||(kc={}));function mC(e){let{acceleration:t,activator:n=bs.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:i=5,order:c=kc.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:p,threshold:f}=e;const y=vC({delta:p,disabled:!o}),[g,m]=Ty(),b=C.useRef({x:0,y:0}),x=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case bs.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case bs.DraggableRect:return a}},[n,a,u]),S=C.useRef(null),w=C.useCallback(()=>{const L=S.current;if(!L)return;const D=b.current.x*x.current.x,j=b.current.y*x.current.y;L.scrollBy(D,j)},[]),k=C.useMemo(()=>c===kc.TreeOrder?[...d].reverse():d,[c,d]);C.useEffect(()=>{if(!o||!d.length||!_){m();return}for(const L of k){if((r==null?void 0:r(L))===!1)continue;const D=d.indexOf(L),j=h[D];if(!j)continue;const{direction:T,speed:I}=nC(L,j,_,t,f);for(const A of["x","y"])y[A][T[A]]||(I[A]=0,T[A]=0);if(I.x>0||I.y>0){m(),S.current=L,g(w,i),b.current=I,x.current=T;return}}b.current={x:0,y:0},x.current={x:0,y:0},m()},[t,w,r,m,o,i,JSON.stringify(_),JSON.stringify(y),g,d,k,h,JSON.stringify(f)])}const gC={x:{[on.Backward]:!1,[on.Forward]:!1},y:{[on.Backward]:!1,[on.Forward]:!1}};function vC(e){let{delta:t,disabled:n}=e;const r=W1(t);return ll(a=>{if(n||!r||!a)return gC;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[on.Backward]:a.x[on.Backward]||o.x===-1,[on.Forward]:a.x[on.Forward]||o.x===1},y:{[on.Backward]:a.y[on.Backward]||o.y===-1,[on.Forward]:a.y[on.Forward]||o.y===1}}},[n,t,r])}function yC(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ll(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function CC(e,t){return C.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,o=a.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...o]},[]),[e,t])}var Ls;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ls||(Ls={}));var G1;(function(e){e.Optimized="optimized"})(G1||(G1={}));const pp=new Map;function bC(e,t){let{dragging:n,dependencies:r,config:a}=t;const[o,i]=C.useState(null),{frequency:c,measure:u,strategy:d}=a,h=C.useRef(e),p=b(),f=Ps(p),y=C.useCallback(function(x){x===void 0&&(x=[]),!f.current&&i(_=>_===null?x:_.concat(x.filter(S=>!_.includes(S))))},[f]),g=C.useRef(null),m=ll(x=>{if(p&&!n)return pp;if(!x||x===pp||h.current!==e||o!=null){const _=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){_.set(S.id,S.rect.current);continue}const w=S.node.current,k=w?new th(u(w),w):null;S.rect.current=k,k&&_.set(S.id,k)}return _}return x},[e,o,n,p,u]);return C.useEffect(()=>{h.current=e},[e]),C.useEffect(()=>{p||y()},[n,p]),C.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),C.useEffect(()=>{p||typeof c!="number"||g.current!==null||(g.current=setTimeout(()=>{y(),g.current=null},c))},[c,p,y,...r]),{droppableRects:m,measureDroppableContainers:y,measuringScheduled:o!=null};function b(){switch(d){case Ls.Always:return!1;case Ls.BeforeDragging:return n;default:return!n}}}function mm(e,t){return ll(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function _C(e,t){return mm(e,t)}function xC(e){let{callback:t,disabled:n}=e;const r=Jd(t),a=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return C.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function uu(e){let{callback:t,disabled:n}=e;const r=Jd(t),a=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return C.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function wC(e){return new th(Oi(e),e)}function mp(e,t,n){t===void 0&&(t=wC);const[r,a]=C.useState(null);function o(){a(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const h=t(e);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const i=xC({callback(u){if(e)for(const d of u){const{type:h,target:p}=d;if(h==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),c=uu({callback:o});return na(()=>{o(),e?(c==null||c.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),i==null||i.disconnect())},[e]),r}function SC(e){const t=mm(e);return im(e,t)}const gp=[];function jC(e){const t=C.useRef(e),n=ll(r=>e?r&&r!==gp&&e&&t.current&&e.parentNode===t.current.parentNode?r:eh(e):gp,[e]);return C.useEffect(()=>{t.current=e},[e]),n}function kC(e){const[t,n]=C.useState(null),r=C.useRef(e),a=C.useCallback(o=>{const i=Gu(o.target);i&&n(c=>c?(c.set(i,z1(i)),new Map(c)):null)},[]);return C.useEffect(()=>{const o=r.current;if(e!==o){i(o);const c=e.map(u=>{const d=Gu(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,z1(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{i(e),i(o)};function i(c){c.forEach(u=>{const d=Gu(u);d==null||d.removeEventListener("scroll",a)})}},[a,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>gi(o,i),Ar):hm(e):Ar,[e,t])}function vp(e,t){t===void 0&&(t=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},t),C.useEffect(()=>{const r=e!==Ar;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Sc(e,n.current):Ar}function NC(e){C.useEffect(()=>{if(!lu)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function EC(e,t){return C.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:o}=r;return n[a]=i=>{o(i,t)},n},{}),[e,t])}function gm(e){return C.useMemo(()=>e?Jy(e):null,[e])}const yp=[];function TC(e,t){t===void 0&&(t=Oi);const[n]=e,r=gm(n?Jn(n):null),[a,o]=C.useState(yp);function i(){o(()=>e.length?e.map(u=>um(u)?r:new th(t(u),u)):yp)}const c=uu({callback:i});return na(()=>{c==null||c.disconnect(),i(),e.forEach(u=>c==null?void 0:c.observe(u))},[e]),a}function PC(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return sl(t)?t:e}function LC(e){let{measure:t}=e;const[n,r]=C.useState(null),a=C.useCallback(d=>{for(const{target:h}of d)if(sl(h)){r(p=>{const f=t(h);return p?{...p,width:f.width,height:f.height}:f});break}},[t]),o=uu({callback:a}),i=C.useCallback(d=>{const h=PC(d);o==null||o.disconnect(),h&&(o==null||o.observe(h)),r(h?t(h):null)},[t,o]),[c,u]=wc(i);return C.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const AC=[{sensor:cu,options:{}},{sensor:pm,options:{}}],RC={current:{}},lc={draggable:{measure:up},droppable:{measure:up,strategy:Ls.WhileDragging,frequency:G1.Optimized},dragOverlay:{measure:Oi}};class _s extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const DC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _s,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lc,measureDroppableContainers:jc,windowRect:null,measuringScheduled:!1},OC={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jc,draggableNodes:new Map,over:null,measureDroppableContainers:jc},du=C.createContext(OC),vm=C.createContext(DC);function IC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _s}}}function MC(e,t){switch(t.type){case Qt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Qt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Qt.DragEnd:case Qt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new _s(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case Qt.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new _s(e.droppable.containers);return i.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:i}}}case Qt.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new _s(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function BC(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=C.useContext(du),o=W1(r),i=W1(n==null?void 0:n.id);return C.useEffect(()=>{if(!t&&!r&&o&&i!=null){if(!Qd(o)||document.activeElement===o.target)return;const c=a.get(i);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const p=Ay(h);if(p){p.focus();break}}})}},[r,t,a,i,o]),null}function FC(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function HC(e){return C.useMemo(()=>({draggable:{...lc.draggable,...e==null?void 0:e.draggable},droppable:{...lc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...lc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $C(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const o=C.useRef(!1),{x:i,y:c}=typeof a=="boolean"?{x:a,y:a}:a;na(()=>{if(!i&&!c||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),p=im(h,r);if(i||(p.x=0),c||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const f=sm(d);f&&f.scrollBy({top:p.y,left:p.x})}},[t,i,c,r,n])}const ym=C.createContext({...Ar,scaleX:1,scaleY:1});var Ba;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ba||(Ba={}));const Cm=C.memo(function(t){var n,r,a,o;let{id:i,accessibility:c,autoScroll:u=!0,children:d,sensors:h=AC,collisionDetection:p=qy,measuring:f,modifiers:y,...g}=t;const m=C.useReducer(MC,void 0,IC),[b,x]=m,[_,S]=By(),[w,k]=C.useState(Ba.Uninitialized),L=w===Ba.Initialized,{draggable:{active:D,nodes:j,translate:T},droppable:{containers:I}}=b,A=D!=null?j.get(D):null,U=C.useRef({initial:null,translated:null}),K=C.useMemo(()=>{var We;return D!=null?{id:D,data:(We=A==null?void 0:A.data)!=null?We:RC,rect:U}:null},[D,A]),X=C.useRef(null),[G,Q]=C.useState(null),[oe,le]=C.useState(null),de=Ps(g,Object.values(g)),B=cl("DndDescribedBy",i),V=C.useMemo(()=>I.getEnabled(),[I]),F=HC(f),{droppableRects:W,measureDroppableContainers:J,measuringScheduled:fe}=bC(V,{dragging:L,dependencies:[T.x,T.y],config:F.droppable}),ee=yC(j,D),re=C.useMemo(()=>oe?q1(oe):null,[oe]),se=at(),ge=_C(ee,F.draggable.measure);$C({activeNode:D!=null?j.get(D):null,config:se.layoutShiftCompensation,initialRect:ge,measure:F.draggable.measure});const ae=mp(ee,F.draggable.measure,ge),Oe=mp(ee?ee.parentElement:null),q=C.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=I.getNodeFor((n=q.current.over)==null?void 0:n.id),xe=LC({measure:F.dragOverlay.measure}),Ae=(r=xe.nodeRef.current)!=null?r:ee,Be=L?(a=xe.rect)!=null?a:ae:null,ue=!!(xe.nodeRef.current&&xe.rect),Pe=SC(ue?null:ae),Le=gm(Ae?Jn(Ae):null),Ee=jC(L?Ce??ee:null),dt=TC(Ee),st=FC(y,{transform:{x:T.x-Pe.x,y:T.y-Pe.y,scaleX:1,scaleY:1},activatorEvent:oe,active:K,activeNodeRect:ae,containerNodeRect:Oe,draggingNodeRect:Be,over:q.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Ee,scrollableAncestorRects:dt,windowRect:Le}),_t=re?gi(re,T):null,Et=kC(Ee),Mt=vp(Et),Wt=vp(Et,[ae]),tt=gi(st,Mt),nn=Be?Gy(Be,st):null,Tt=K&&nn?p({active:K,collisionRect:nn,droppableRects:W,droppableContainers:V,pointerCoordinates:_t}):null,Bt=Uy(Tt,"id"),[Ke,_n]=C.useState(null),An=ue?st:gi(st,Wt),la=zy(An,(o=Ke==null?void 0:Ke.rect)!=null?o:null,ae),qt=C.useRef(null),rn=C.useCallback((We,lt)=>{let{sensor:xt,options:xn}=lt;if(X.current==null)return;const zt=j.get(X.current);if(!zt)return;const Zt=We.nativeEvent,an=new xt({active:X.current,activeNode:zt,event:Zt,options:xn,context:q,onAbort(wt){if(!j.get(wt))return;const{onDragAbort:Jt}=de.current,cn={id:wt};Jt==null||Jt(cn),_({type:"onDragAbort",event:cn})},onPending(wt,ln,Jt,cn){if(!j.get(wt))return;const{onDragPending:R}=de.current,M={id:wt,constraint:ln,initialCoordinates:Jt,offset:cn};R==null||R(M),_({type:"onDragPending",event:M})},onStart(wt){const ln=X.current;if(ln==null)return;const Jt=j.get(ln);if(!Jt)return;const{onDragStart:cn}=de.current,Cr={activatorEvent:Zt,active:{id:ln,data:Jt.data,rect:U}};kr.unstable_batchedUpdates(()=>{cn==null||cn(Cr),k(Ba.Initializing),x({type:Qt.DragStart,initialCoordinates:wt,active:ln}),_({type:"onDragStart",event:Cr}),Q(qt.current),le(Zt)})},onMove(wt){x({type:Qt.DragMove,coordinates:wt})},onEnd:Rn(Qt.DragEnd),onCancel:Rn(Qt.DragCancel)});qt.current=an;function Rn(wt){return async function(){const{active:Jt,collisions:cn,over:Cr,scrollAdjustedTranslate:R}=q.current;let M=null;if(Jt&&R){const{cancelDrop:$}=de.current;M={activatorEvent:Zt,active:Jt,collisions:cn,delta:R,over:Cr},wt===Qt.DragEnd&&typeof $=="function"&&await Promise.resolve($(M))&&(wt=Qt.DragCancel)}X.current=null,kr.unstable_batchedUpdates(()=>{x({type:wt}),k(Ba.Uninitialized),_n(null),Q(null),le(null),qt.current=null;const $=wt===Qt.DragEnd?"onDragEnd":"onDragCancel";if(M){const v=de.current[$];v==null||v(M),_({type:$,event:M})}})}}},[j]),$r=C.useCallback((We,lt)=>(xt,xn)=>{const zt=xt.nativeEvent,Zt=j.get(xn);if(X.current!==null||!Zt||zt.dndKit||zt.defaultPrevented)return;const an={active:Zt};We(xt,lt.options,an)===!0&&(zt.dndKit={capturedBy:lt.sensor},X.current=xn,rn(xt,lt))},[j,rn]),Re=CC(h,$r);NC(h),na(()=>{ae&&w===Ba.Initializing&&k(Ba.Initialized)},[ae,w]),C.useEffect(()=>{const{onDragMove:We}=de.current,{active:lt,activatorEvent:xt,collisions:xn,over:zt}=q.current;if(!lt||!xt)return;const Zt={active:lt,activatorEvent:xt,collisions:xn,delta:{x:tt.x,y:tt.y},over:zt};kr.unstable_batchedUpdates(()=>{We==null||We(Zt),_({type:"onDragMove",event:Zt})})},[tt.x,tt.y]),C.useEffect(()=>{const{active:We,activatorEvent:lt,collisions:xt,droppableContainers:xn,scrollAdjustedTranslate:zt}=q.current;if(!We||X.current==null||!lt||!zt)return;const{onDragOver:Zt}=de.current,an=xn.get(Bt),Rn=an&&an.rect.current?{id:an.id,rect:an.rect.current,data:an.data,disabled:an.disabled}:null,wt={active:We,activatorEvent:lt,collisions:xt,delta:{x:zt.x,y:zt.y},over:Rn};kr.unstable_batchedUpdates(()=>{_n(Rn),Zt==null||Zt(wt),_({type:"onDragOver",event:wt})})},[Bt]),na(()=>{q.current={activatorEvent:oe,active:K,activeNode:ee,collisionRect:nn,collisions:Tt,droppableRects:W,draggableNodes:j,draggingNode:Ae,draggingNodeRect:Be,droppableContainers:I,over:Ke,scrollableAncestors:Ee,scrollAdjustedTranslate:tt},U.current={initial:Be,translated:nn}},[K,ee,Tt,nn,j,Ae,Be,W,I,Ke,Ee,tt]),mC({...se,delta:T,draggingRect:nn,pointerCoordinates:_t,scrollableAncestors:Ee,scrollableAncestorRects:dt});const Ze=C.useMemo(()=>({active:K,activeNode:ee,activeNodeRect:ae,activatorEvent:oe,collisions:Tt,containerNodeRect:Oe,dragOverlay:xe,draggableNodes:j,droppableContainers:I,droppableRects:W,over:Ke,measureDroppableContainers:J,scrollableAncestors:Ee,scrollableAncestorRects:dt,measuringConfiguration:F,measuringScheduled:fe,windowRect:Le}),[K,ee,ae,oe,Tt,Oe,xe,j,I,W,Ke,J,Ee,dt,F,fe,Le]),Ge=C.useMemo(()=>({activatorEvent:oe,activators:Re,active:K,activeNodeRect:ae,ariaDescribedById:{draggable:B},dispatch:x,draggableNodes:j,over:Ke,measureDroppableContainers:J}),[oe,Re,K,ae,x,B,j,Ke,J]);return C.createElement(rm.Provider,{value:S},C.createElement(du.Provider,{value:Ge},C.createElement(vm.Provider,{value:Ze},C.createElement(ym.Provider,{value:la},d)),C.createElement(BC,{disabled:(c==null?void 0:c.restoreFocus)===!1})),C.createElement($y,{...c,hiddenTextDescribedById:B}));function at(){const We=(G==null?void 0:G.autoScrollEnabled)===!1,lt=typeof u=="object"?u.enabled===!1:u===!1,xt=L&&!We&&!lt;return typeof u=="object"?{...u,enabled:xt}:{enabled:xt}}}),VC=C.createContext(null),Cp="button",UC="Draggable";function WC(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=cl(UC),{activators:i,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:p,over:f}=C.useContext(du),{role:y=Cp,roleDescription:g="draggable",tabIndex:m=0}=a??{},b=(u==null?void 0:u.id)===t,x=C.useContext(b?ym:VC),[_,S]=wc(),[w,k]=wc(),L=EC(i,t),D=Ps(n);na(()=>(p.set(t,{id:t,key:o,node:_,activatorNode:w,data:D}),()=>{const T=p.get(t);T&&T.key===o&&p.delete(t)}),[p,t]);const j=C.useMemo(()=>({role:y,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&y===Cp?!0:void 0,"aria-roledescription":g,"aria-describedby":h.draggable}),[r,y,m,b,g,h.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:j,isDragging:b,listeners:r?void 0:L,node:_,over:f,setNodeRef:S,setActivatorNodeRef:k,transform:x}}function qC(){return C.useContext(vm)}const zC="Droppable",ZC={timeout:25};function GC(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=cl(zC),{active:i,dispatch:c,over:u,measureDroppableContainers:d}=C.useContext(du),h=C.useRef({disabled:n}),p=C.useRef(!1),f=C.useRef(null),y=C.useRef(null),{disabled:g,updateMeasurementsFor:m,timeout:b}={...ZC,...a},x=Ps(m??r),_=C.useCallback(()=>{if(!p.current){p.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(x.current)?x.current:[x.current]),y.current=null},b)},[b]),S=uu({callback:_,disabled:g||!i}),w=C.useCallback((j,T)=>{S&&(T&&(S.unobserve(T),p.current=!1),j&&S.observe(j))},[S]),[k,L]=wc(w),D=Ps(t);return C.useEffect(()=>{!S||!k.current||(S.disconnect(),p.current=!1,S.observe(k.current))},[k,S]),C.useEffect(()=>(c({type:Qt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:k,rect:f,data:D}}),()=>c({type:Qt.UnregisterDroppable,key:o,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(c({type:Qt.SetDroppableDisabled,id:r,key:o,disabled:n}),h.current.disabled=n)},[r,o,n,c]),{active:i,rect:f,isOver:(u==null?void 0:u.id)===r,node:k,over:u,setNodeRef:L}}function bm(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function YC(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Dl(e){return e!==null&&e>=0}function KC(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function XC(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const _m=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=bm(t,r,n),i=t[a],c=o[a];return!c||!i?null:{x:c.left-i.left,y:c.top-i.top,scaleX:c.width/i.width,scaleY:c.height/i.height}},Ol={scaleX:1,scaleY:1},xm=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:a,rects:o,overIndex:i}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(a===n){const d=o[i];return d?{x:0,y:n<i?d.top+d.height-(c.top+c.height):d.top-c.top,...Ol}:null}const u=JC(o,a,n);return a>n&&a<=i?{x:0,y:-c.height-u,...Ol}:a<n&&a>=i?{x:0,y:c.height+u,...Ol}:{x:0,y:0,...Ol}};function JC(e,t,n){const r=e[t],a=e[t-1],o=e[t+1];return r?n<t?a?r.top-(a.top+a.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const wm="Sortable",Sm=C.createContext({activeIndex:-1,containerId:wm,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_m,disabled:{draggable:!1,droppable:!1}});function jm(e){let{children:t,id:n,items:r,strategy:a=_m,disabled:o=!1}=e;const{active:i,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:h}=qC(),p=cl(wm,n),f=c.rect!==null,y=C.useMemo(()=>r.map(L=>typeof L=="object"&&"id"in L?L.id:L),[r]),g=i!=null,m=i?y.indexOf(i.id):-1,b=d?y.indexOf(d.id):-1,x=C.useRef(y),_=!KC(y,x.current),S=b!==-1&&m===-1||_,w=XC(o);na(()=>{_&&g&&h(y)},[_,y,g,h]),C.useEffect(()=>{x.current=y},[y]);const k=C.useMemo(()=>({activeIndex:m,containerId:p,disabled:w,disableTransforms:S,items:y,overIndex:b,useDragOverlay:f,sortedRects:YC(y,u),strategy:a}),[m,p,w.draggable,w.droppable,S,y,b,u,f,a]);return C.createElement(Sm.Provider,{value:k},t)}const QC=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return bm(n,r,a).indexOf(t)},eb=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:i,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==o&&a===i?!1:n?!0:i!==a&&t===u},tb={duration:200,easing:"ease"},km="transform",nb=bi.Transition.toString({property:km,duration:0,easing:"linear"}),rb={roleDescription:"sortable"};function ab(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,i]=C.useState(null),c=C.useRef(n);return na(()=>{if(!t&&n!==c.current&&r.current){const u=a.current;if(u){const d=Oi(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&i(h)}}n!==c.current&&(c.current=n)},[t,n,r,a]),C.useEffect(()=>{o&&i(null)},[o]),o}function Nm(e){let{animateLayoutChanges:t=eb,attributes:n,disabled:r,data:a,getNewIndex:o=QC,id:i,strategy:c,resizeObserverConfig:u,transition:d=tb}=e;const{items:h,containerId:p,activeIndex:f,disabled:y,disableTransforms:g,sortedRects:m,overIndex:b,useDragOverlay:x,strategy:_}=C.useContext(Sm),S=ob(r,y),w=h.indexOf(i),k=C.useMemo(()=>({sortable:{containerId:p,index:w,items:h},...a}),[p,a,w,h]),L=C.useMemo(()=>h.slice(h.indexOf(i)),[h,i]),{rect:D,node:j,isOver:T,setNodeRef:I}=GC({id:i,data:k,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...u}}),{active:A,activatorEvent:U,activeNodeRect:K,attributes:X,setNodeRef:G,listeners:Q,isDragging:oe,over:le,setActivatorNodeRef:de,transform:B}=WC({id:i,data:k,attributes:{...rb,...n},disabled:S.draggable}),V=Ey(I,G),F=!!A,W=F&&!g&&Dl(f)&&Dl(b),J=!x&&oe,fe=J&&W?B:null,re=W?fe??(c??_)({rects:m,activeNodeRect:K,activeIndex:f,overIndex:b,index:w}):null,se=Dl(f)&&Dl(b)?o({id:i,items:h,activeIndex:f,overIndex:b}):w,ge=A==null?void 0:A.id,ae=C.useRef({activeId:ge,items:h,newIndex:se,containerId:p}),Oe=h!==ae.current.items,q=t({active:A,containerId:p,isDragging:oe,isSorting:F,id:i,index:w,items:h,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:d,wasDragging:ae.current.activeId!=null}),Ce=ab({disabled:!q,index:w,node:j,rect:D});return C.useEffect(()=>{F&&ae.current.newIndex!==se&&(ae.current.newIndex=se),p!==ae.current.containerId&&(ae.current.containerId=p),h!==ae.current.items&&(ae.current.items=h)},[F,se,p,h]),C.useEffect(()=>{if(ge===ae.current.activeId)return;if(ge!=null&&ae.current.activeId==null){ae.current.activeId=ge;return}const Ae=setTimeout(()=>{ae.current.activeId=ge},50);return()=>clearTimeout(Ae)},[ge]),{active:A,activeIndex:f,attributes:X,data:k,rect:D,index:w,newIndex:se,items:h,isOver:T,isSorting:F,isDragging:oe,listeners:Q,node:j,overIndex:b,over:le,setNodeRef:V,setActivatorNodeRef:de,setDroppableNodeRef:I,setDraggableNodeRef:G,transform:Ce??re,transition:xe()};function xe(){if(Ce||Oe&&ae.current.newIndex===w)return nb;if(!(J&&!Qd(U)||!d)&&(F||q))return bi.Transition.toString({...d,property:km})}}function ob(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}it.Down,it.Right,it.Up,it.Left;function ib({product:e,children:t}){const{attributes:n,listeners:r,setNodeRef:a,transform:o,transition:i,isDragging:c}=Nm({id:e.id}),u={transform:bi.Transform.toString(o),transition:i};return P.jsx("div",{ref:a,style:u,className:`${$t.product} ${c?$t.dragging:""}`,...n,...r,children:t})}const Em=e=>{const{isActiveItems:t,setIsActiveItems:n,items:r,setItems:a,other:o,title:i,subtitle:c,editable:u=!0,draggable:d=!1,withImage:h=!1,deletable:p=!0,addable:f=!0,itemsType:y,itemsPlaceholder:g="",itemsOptions:m,hasRangeSelector:b=!1,rangeSelectorOptions:x,modalOptions:_,addableOptions:S={},limit:w,autoInterval:k,tip:L}=e,[D,j]=C.useState(null),[T,I]=C.useState({top:0,left:0}),[A,U]=C.useState(null),K=C.useRef(null),[X,G]=C.useState(!1),Q=om(am(cu,{activationConstraint:{distance:5}}));C.useEffect(()=>{if(D){const F=[...r].map(W=>W.id===D.id?D:W);a(F)}},[D]),C.useEffect(()=>{if(K.current&&A){const F=K.current.getBoundingClientRect().height,W=window.innerHeight;let J=A.top;J+F>W+window.scrollY-200&&(J=W+window.scrollY-F-200),J<0&&(J=10),I({top:J-30,left:A.left})}},[K.current,A]);const oe=(F,W)=>{F.stopPropagation();const J=F.target.getBoundingClientRect();U({top:J.top+window.scrollY-70,left:J.left-(f?30:65)}),j(W),G(!0)},le=(F,W)=>{const J=[...r],fe={...F,id:Math.random().toString(36).substr(2,9)};J.splice(W+1,0,fe),a(J)};function de(F){if(h)return F?P.jsx("img",{src:`https://imagedelivery.net/${F[0]}/w=1000`,alt:"image",width:16,height:16}):P.jsx(pt,{name:"Image",width:16,height:16,fill:"#757575"})}const B=F=>{const{active:W,over:J}=F;if(J&&W.id!==J.id){const fe=r.findIndex(re=>re.id===W.id),ee=r.findIndex(re=>re.id===J.id);if(fe!==-1&&ee!==-1){const re=[...r],[se]=re.splice(fe,1);re.splice(ee,0,se),a(re)}}},V=(F,W)=>{var fe,ee;const J=P.jsxs(P.Fragment,{children:[d&&P.jsx("div",{children:P.jsx(pt,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&m&&P.jsx(Lo,{onChange:re=>{const se=[...r],ge=m.find(Oe=>Oe.name["en-US"]===re);if(!ge)return;const ae=se.map(Oe=>Oe.id===F.id?{...ge,name:{"en-US":re}}:Oe);j({...F,name:{"en-US":re}}),a([...ae])},value:F.name["en-US"],options:m.filter(re=>!r.find(se=>se.name["en-US"]===re.name["en-US"])).map(re=>re.name["en-US"]),leftAddon:de(F.images)}),y==="input"&&P.jsx(Er,{onChange:re=>{const ge=[...r].map(ae=>ae.id===F.id?{...F,name:{"en-US":re}}:ae);a([...ge])},value:F.name["en-US"],placeholder:g}),y==="image"&&P.jsx(il,{onChange:re=>{const ge=[...r].map(ae=>ae.id===F.id?{...F,images:re}:ae);a([...ge])},activeImage:(fe=r.find(re=>re.id===F.id))!=null&&fe.images?(ee=r.find(re=>re.id===F.id))==null?void 0:ee.images[0]:void 0,tip:L}),P.jsxs("div",{className:$t.buttons,children:[w&&w>r.length&&f&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{le(F,W)}})}),u&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:re=>{oe(re,F)}})}),p&&P.jsx("div",{className:$t.deleteButton,children:P.jsx(pt,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(re=>re.id!==F.id))})})]})]});return d?P.jsx(ib,{product:F,index:W,children:J},F.id):P.jsx("div",{className:$t.product,children:J},F.id)};return P.jsxs("div",{className:$t.productsBlock,children:[(i||t!==void 0)&&P.jsxs("div",{className:$t.top,children:[i&&P.jsx("h3",{className:$t.title,children:i}),t!==void 0&&P.jsx(ao,{current:t,onChange:F=>n==null?void 0:n(F)})]}),D&&u&&_&&X&&P.jsx(Sy,{ref:K,activeItem:D,setActiveItem:j,popupPosition:T,modalOptions:_,setIsOpenModal:G}),(t===void 0||t)&&b&&x&&P.jsx(Tm,{...x}),(t===void 0||t)&&P.jsxs("div",{className:$t.products,children:[c&&P.jsx("h5",{className:$t.subtitle,children:c}),d?P.jsx(Cm,{sensors:Q,onDragEnd:B,children:P.jsx(jm,{items:r.map(F=>F.id),strategy:xm,children:r.map((F,W)=>V(F,W))})}):r.map((F,W)=>V(F,W)),f&&P.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:P.jsx(xc,{withoutHover:!0,className:Ot($t.button,{[$t.disabled]:!!(w&&w<=r.length||r.length===(m==null?void 0:m.length))}),size:"s",disabled:!!(w&&w<=r.length||r.length===(m==null?void 0:m.length)),onClick:()=>{const F=[...r];let W=null;if(m){for(let J=0;J<m.length;J++)if(!r.find(fe=>fe.id===m[J].id)){W=m[J];break}}y==="select"&&m?F.push({name:W?W.name:m[0].name,id:(W==null?void 0:W.id)||m[0].id,...S}):y==="input"?F.push({name:{"en-US":""},id:Ci(),...S}):F.push({name:{"en-US":`Image ${r.length+1}`},id:Ci(),...S}),a(F)},style:{width:"fit-content"},children:P.jsxs("div",{className:$t.addButton,children:[P.jsx("span",{children:"Add Option"}),P.jsx(pt,{name:"Plus",width:16,height:16})]})})})]}),(t===void 0||t)&&o!==void 0&&P.jsx(em,{items:o}),(t===void 0||t)&&k!==void 0&&P.jsx(Er,{label:k.title||"Auto scroll interval",type:"number",value:String(k.autoInterval),onChange:F=>k.setAutoInterval(Number(F)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},sb="_title_cx65i_1",lb="_subtitle_cx65i_5",cb="_header_cx65i_12",ub="_text_cx65i_13",db="_productsBlock_cx65i_14",hb="_top_cx65i_26",fb="_itemsBlock_cx65i_35",pb="_typeTexts_cx65i_41",mb="_block_cx65i_48",gb="_active_cx65i_61",vb="_products_cx65i_14",yb="_product_cx65i_14",Cb="_button_cx65i_80",bb="_disabled_cx65i_91",_b="_image_cx65i_95",xb="_info_cx65i_102",wb="_name_cx65i_114",Sb="_buttons_cx65i_118",jb="_modal_cx65i_125",kb="_link_cx65i_146",Nb="_modalOptions_cx65i_152",Eb="_addButton_cx65i_165",Tb="_deleteButton_cx65i_180",Pb="_closeIcon_cx65i_192",mo={title:sb,subtitle:lb,header:cb,text:ub,productsBlock:db,top:hb,itemsBlock:fb,typeTexts:pb,block:mb,active:gb,products:vb,product:yb,button:Cb,disabled:bb,image:_b,info:xb,name:wb,buttons:Sb,modal:jb,link:kb,modalOptions:Nb,addButton:Eb,deleteButton:Tb,closeIcon:Pb},Lb=C.forwardRef((e,t)=>{const{activeItem:n,setActiveItem:r,popupPosition:a,modalOptions:o,setIsOpenModal:i}=e;return Pi(t,()=>{r(null),i(!1)}),P.jsxs("div",{ref:t,className:mo.modal,onClick:c=>{c.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[P.jsxs("div",{className:mo.top,children:[P.jsx("h3",{className:mo.title,children:n.name["en-US"]}),P.jsx("div",{className:mo.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),i(!1)}})})]}),P.jsx("div",{className:mo.modalOptions,children:o.map(c=>{if(c.type==="image")return P.jsx(il,{label:"Put up an attractive image",activeImage:n[c.field],onChange:u=>{const d={...n,[c.field]:u};r(d)}},String(c.field));if(c.type==="text")return P.jsx(Yd,{isActiveText:!0,typesText:n[c.field.type],setTypesText:u=>{const d={...n,[c.field.type]:u};r(d)},text:n[c.field.text]["en-US"]||"",setText:u=>{const d={...n,[c.field.text]:{"en-US":u}};r(d)},typeFont:n[c.field.type],setTypeFont:u=>{const d={...n,[c.field.type]:u};r(d)},subtitle:c.label});if(c.type==="input")return P.jsx(Er,{onChange:u=>{const d={...n,[c.field]:{"en-US":u}};r(d)},value:n[c.field]["en-US"]||"",label:c.label,placeholder:c.placeholder});if(c.type==="inputNumber")return P.jsx(Er,{onChange:u=>{const d={...n,[c.field]:u};r(d)},value:n[c.field]||"",label:c.label,placeholder:c.placeholder,type:"number"});if(c.type==="inputSwitch")return P.jsxs("div",{className:mo.link,children:[P.jsx(Er,{onChange:u=>{const d={...n,[c.field.text]:{"en-US":u}};r(d)},value:n[c.field.text]["en-US"]||"",label:c.inputLabel,placeholder:c.placeholder}),P.jsx(ao,{current:!!n[c.field.switch]||!1,label:c.switchLabel,onChange:u=>{const d={...n,[c.field.switch]:u};r(d)}})]});if(c.type==="select")return P.jsx(Lo,{options:c.itemsOptions,onChange:u=>{const d={...n,[c.field]:u};r(d)},label:c.label,value:n[c.field]||"String",leftAddon:c.leftAddon&&c.leftAddon==="icon"&&P.jsx(pt,{name:n[c.field]})})})})]})}),Ab="_title_hvj8m_1",Rb="_subtitle_hvj8m_5",Db="_header_hvj8m_12",Ob="_text_hvj8m_13",Ib="_productsBlock_hvj8m_14",Mb="_buttonsBlock_hvj8m_15",Bb="_top_hvj8m_26",Fb="_itemsBlock_hvj8m_35",Hb="_typeTexts_hvj8m_41",$b="_block_hvj8m_48",Vb="_active_hvj8m_60",Ub="_products_hvj8m_14",Wb="_product_hvj8m_14",qb="_button_hvj8m_15",zb="_image_hvj8m_90",Zb="_info_hvj8m_97",Gb="_name_hvj8m_109",Yb="_buttons_hvj8m_15",Kb="_modal_hvj8m_120",Xb="_other_hvj8m_140",Jb="_options_hvj8m_146",Qb="_closeIcon_hvj8m_154",ci={title:Ab,subtitle:Rb,header:Db,text:Ob,productsBlock:Ib,buttonsBlock:Mb,top:Bb,itemsBlock:Fb,typeTexts:Hb,block:$b,active:Vb,products:Ub,product:Wb,button:qb,image:zb,info:Zb,name:Gb,buttons:Yb,modal:Kb,other:Xb,options:Jb,closeIcon:Qb},e_=C.forwardRef((e,t)=>{var S;const{activeButton:n,setActiveButton:r,popupPosition:a,editableLink:o=!0}=e,[i,c]=C.useState(n.typesText),[u,d]=C.useState(n.destination),[h,p]=C.useState(n.page),[f,y]=C.useState(n.link||""),[g,m]=C.useState(n.text||{"en-US":""}),[b,x]=C.useState(n.openInNewTab),{pages:_}=Md();return Pi(t,()=>{r(null)}),C.useEffect(()=>{r({...n,...{text:g,link:f,destination:u,typesText:i,page:h,openInNewTab:b}})},[i,u,f,g,h,b]),console.log("ActivePage",h),P.jsxs("div",{className:ci.modal,onClick:w=>{w.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:t,children:[P.jsxs("div",{className:ci.top,children:[P.jsx("h3",{className:ci.title,children:n.type}),P.jsx("div",{className:ci.closeIcon,children:P.jsx(pt,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),P.jsxs("div",{className:ci.options,children:[o&&P.jsx(Lo,{label:"Destination",onChange:w=>d(w),options:["Go to Page","Open Link"].filter(w=>w!==u),value:u}),o&&(u==="Go to Page"?P.jsx(Lo,{label:"Go to",onChange:w=>{if(w==="Sign In")p("/customer-dash");else if(_){for(const k in _)if(_[k].name===w){console.log("pages[key]",_[k]),p(_[k].path);break}}else p(v2[0])},options:_?[...Object.values(_).filter(w=>w.path!==h).map(w=>w.name),"Sign In"]:["Sign In"],value:_?h==="/customer-dash"?"Sign In":((S=Object.values(_).find(w=>w.path===h))==null?void 0:S.name)||"Home":"Home"}):P.jsx(Er,{onChange:w=>y(w),value:f,placeholder:"https://",label:"Link"})),o&&P.jsx(ao,{current:n.openInNewTab,label:"Open in new tab",onChange:w=>x(w)}),P.jsx(Gd,{onChange:w=>m({"en-US":w}),value:g["en-US"],label:"Text",maxLength:150}),P.jsx(Zd,{typesText:i,setTypesText:c})]})]})}),t_="_wrapper_m18qi_1",n_="_subtitle_m18qi_7",r_="_content_m18qi_14",a_="_range_m18qi_22",o_="_track_m18qi_27",i_="_progress_m18qi_36",s_="_dots_m18qi_46",l_="_dot_m18qi_46",c_="_active_m18qi_65",u_="_input_m18qi_77",d_="_countBlock_m18qi_91",h_="_count_m18qi_91",f_="_controls_m18qi_107",p_="_button_m18qi_113",Sn={wrapper:t_,subtitle:n_,content:r_,range:a_,track:o_,progress:i_,dots:s_,dot:l_,active:c_,input:u_,countBlock:d_,count:h_,controls:f_,button:p_},Tm=e=>{const{label:t,min:n=1,max:r=4,step:a=1,count:o,setCount:i}=e,[c,u]=C.useState(!1),d=Array.from({length:(r-n)/a+1}),h=(o-n)/(r-n)*100,p=()=>{o<r&&i(o+a)},f=()=>{o>n&&i(o-a)},y=g=>{const m=n+g*a;i(m)};return P.jsxs("div",{className:Sn.wrapper,children:[t&&P.jsx("h5",{className:Sn.subtitle,children:t}),P.jsxs("div",{className:Sn.content,children:[P.jsxs("div",{className:Sn.range,children:[P.jsx("div",{className:Sn.track}),P.jsx("div",{className:Sn.progress,style:{width:`${h}%`}}),P.jsx("div",{className:Sn.dots,children:d.map((g,m)=>{const b=m<=(o-n)/a;return P.jsx("button",{onClick:()=>y(m),className:Ot(Sn.dot,{[Sn.active]:b,[Sn.inactive]:!b,[Sn.dragging]:c}),"aria-label":`Set value to ${n+m*a}`},m)})}),P.jsx("input",{type:"range",min:n,max:r,step:a,value:o,onChange:g=>i(Number(g.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Sn.input})]}),P.jsxs("div",{className:Sn.countBlock,children:[P.jsx(Er,{type:"number",min:n,max:r,paddingless:!0,onChange:g=>{const m=Number(g);m>r?i(r):m<n?i(n):i(m)},value:String(o)}),P.jsxs("div",{className:Sn.controls,children:[P.jsx("button",{onClick:p,disabled:o>=r,className:Sn.button,"aria-label":"Increment count",children:P.jsx(pt,{name:"CaretUp",width:15,height:15})}),P.jsx("button",{onClick:f,disabled:o<=n,className:Sn.button,"aria-label":"Decrement count",children:P.jsx(pt,{name:"CaretDown",width:15,height:15})})]})]})]})]})},m_="_title_11jyy_1",g_="_subtitle_11jyy_5",v_="_header_11jyy_12",y_="_text_11jyy_13",C_="_productsBlock_11jyy_14",b_="_top_11jyy_26",__="_itemsBlock_11jyy_35",x_="_typeTexts_11jyy_41",w_="_block_11jyy_48",S_="_active_11jyy_61",j_="_products_11jyy_14",k_="_product_11jyy_14",N_="_button_11jyy_80",E_="_image_11jyy_91",T_="_info_11jyy_98",P_="_name_11jyy_110",L_="_buttons_11jyy_114",A_="_modal_11jyy_121",R_="_link_11jyy_142",D_="_modalOptions_11jyy_148",O_="_addButton_11jyy_161",I_="_deleteButton_11jyy_176",M_="_closeIcon_11jyy_188",ps={title:m_,subtitle:g_,header:v_,text:y_,productsBlock:C_,top:b_,itemsBlock:__,typeTexts:x_,block:w_,active:S_,products:j_,product:k_,button:N_,image:E_,info:T_,name:P_,buttons:L_,modal:A_,link:R_,modalOptions:D_,addButton:O_,deleteButton:I_,closeIcon:M_},bp=Symbol(),Xu=function(e){try{return e(...[].slice.call(arguments,1))}catch(t){return setTimeout(()=>{throw t}),t instanceof Error?t:t=new Error(t)}};function $a(e,t){if(e)throw new Error(`Reatom error: ${t}`)}const cc=e=>(e==null?void 0:e.__reatom)!==void 0,_p=e=>{var t;return((t=e==null?void 0:e.__reatom)==null?void 0:t.isAction)===!0},uo=e=>e.subs.size+e.listeners.size>0;function Y1(e){$a(typeof e!="function",`invalid "${typeof e}", function expected`)}const Pm=e=>e.cause===null?e:Pm(e.cause);let rs;const B_=({callLateEffect:e=Xu,callNearEffect:t=Xu}={})=>{let n=new WeakMap,r=D=>n.get(D),a=new Set,o=[],i=[],c=!1,u=null,d=[],h=[],p=[],f=0,y=0,g=!1,m=()=>{for(let D of o)t(D,L);o=[]},b=()=>{if(!g){g=!0,m();for(let D of i)e(D,L),o.length>0&&m();i=[],g=!1}},x=({state:D,proto:j,pubs:T,subs:I,listeners:A},U)=>(j.actual=!1,p.push(j.patch={state:D,proto:j,cause:U,pubs:T,subs:I,listeners:A}),j.patch),_=D=>{for(let j of D.subs){let T=j.patch??r(j);j.patch&&!j.actual||x(T,D).listeners.size===0&&_(T)}},S=(D,j)=>{if(j.subs.delete(D)&&(h.push(()=>j.subs.add(D)),!uo(j))){j.proto.disconnectHooks!==null&&o.push(...j.proto.disconnectHooks);for(let T of j.pubs)S(j.proto,T)}},w=(D,j)=>{if(!j.subs.has(D)){let T=uo(j);if(j.subs.add(D),h.push(()=>j.subs.delete(D)),!T){j.proto.connectHooks!==null&&o.push(...j.proto.connectHooks);for(let I of j.pubs)w(j.proto,I)}}},k=(D,j,T)=>{let{patch:I,actual:A}=j,U=T!==void 0;if(!U&&A&&(I.pubs.length===0||uo(I)))return I;let K=I??r(j),X=!K,G=U?D.cause:r(uc);if(X)K={state:j.initState(D),proto:j,cause:G,pubs:[],subs:new Set,listeners:new Set};else if(j.computer===null&&!U)return K;I&&!A||(I=x(K,G));let{state:Q}=I,oe={get:D.get,spy:void 0,schedule:D.schedule,subscribe:D.subscribe,cause:I};try{j.computer&&((le,de)=>{let{proto:B,pubs:V}=de,F=!1;if(V.length===0||V.some(({proto:W,state:J})=>!Object.is(J,(de.cause=k(le,W)).state))){let W=[];if(le.spy=({__reatom:J},fe)=>{if(de.pubs===V){let ee=k(le,J),re=W.push(ee)<=V.length?V[W.length-1]:void 0,se=(re==null?void 0:re.proto)!==ee.proto;F||(F=se);let ge=J.isAction&&!se?ee.state.slice(re.state.length):ee.state;if(!fe||!se&&Object.is(ge,re.state))return ge;if(J.isAction)for(const ae of ge)fe(ae);else fe(ge,se||re==null?void 0:re.state)}else $a(!0,"async spy")},de.state=de.proto.computer(le,de.state),de.pubs=W,(F||V.length>W.length)&&uo(de)){for(let{proto:J}of V)W.every(fe=>fe.proto!==J)&&S(B,J.patch??r(J));for(let{proto:J}of W)V.every(fe=>fe.proto!==J)&&w(B,J.patch??r(J))}}})(oe,I),U&&(I.cause=D.cause,T(oe,I)),j.actual=!0}catch(le){throw I.error=le}if(!Object.is(Q,I.state)&&(I.subs.size>0&&(U||I.listeners.size>0)&&_(I),j.updateHooks)){let le={get:oe.get,spy:void 0,schedule:oe.schedule,subscribe:oe.subscribe,cause:oe.cause};j.updateHooks.forEach(de=>d.push(()=>de(le,I)))}return I},L={get(D){if($a(rs&&Pm(rs.cause)!==r(uc),"cause collision"),cc(D)){let I=D.__reatom;if(c)return k(this,I).state;let A=r(I);return A===void 0||I.computer!==null&&!uo(A)?this.get(()=>k(this,I).state):A.state}if($a(u!==null,"tr failed"),c)return D(r,k);c=!0,f=o.length,y=i.length;let j=rs===void 0;j&&(rs=this);try{var T=D(r,k);for(let I=0;I<p.length;I++){let{listeners:A,proto:U}=p[I];if(A.size>0&&k(this,U),d.length>0)for(let K of d.splice(0))K(this)}if(p.length)for(let I of a)I(p);for(let I of p){let{proto:A,state:U}=I;if(A.isAction&&(I.state=[]),I===A.patch)if(A.patch=null,A.actual=!1,n.set(A,I),A.isAction){if(U.length===0)continue;for(let K of I.listeners)o.push(()=>K(U))}else for(let K of I.listeners)i.push(()=>K(r(A).state))}}catch(I){u=I=I instanceof Error?I:new Error(String(I));for(let A of a)A(p,I);for(let A of h)Xu(A,I);for(let{proto:A}of p)A.patch=null,A.actual=!1;throw o.length=f,i.length=y,I}finally{c=!1,u=null,d=[],h=[],p=[],f=0,y=0,j&&(rs=void 0)}return b(),T},spy:void 0,schedule(D,j=1){return Y1(D),$a(!this,"missed context"),new Promise((T,I)=>{j===-1?c&&h.push(D):j===0?c&&d.push(()=>D(this)):((j===1?o:i).push(()=>{try{let A=D(this);return A instanceof Promise?A.then(T,I):T(A),A}catch(A){throw I(A),A}}),c||b())})},subscribe(D,j=D){if(Y1(j),D===j)return a.add(j),()=>a.delete(j);let{__reatom:T}=D,I=bp,A=K=>Object.is(I,K)||j(I=K),U=r(T);return U!==void 0&&uo(U)?U.listeners.add(A):this.get(()=>{U=k(this,T,(K,X)=>{}),U.listeners.add(A),h.push(()=>T.patch.listeners.delete(A)),T.connectHooks!==null&&o.push(...T.connectHooks);for(let K of U.pubs)w(T,K)}),I===bp&&A((T.patch??r(T)).state),()=>{if(U.listeners.delete(A)&&!uo(U)){T.disconnectHooks&&o.push(...T.disconnectHooks);for(let K of U.pubs)S(T,K);c||(h.length=0,b())}}},cause:void 0};return(L.cause=L.get(()=>k(L,uc))).cause=null,L};let F_=0,hu=e=>`${e}#${++F_}`;function H_(){return[].slice.call(arguments).reduce((e,t)=>t(e),this)}function $_(e){var t;const n=(r,a)=>e(r,a.state);return((t=this.__reatom).updateHooks??(t.updateHooks=new Set)).add(n),()=>this.__reatom.updateHooks.delete(n)}function V_(e){return this.onChange((t,n)=>{const{params:r,payload:a}=n[n.length-1];e(t,a,r)})}function ze(e,t=hu("_atom")){let n=(a,o)=>a.get((i,c)=>c(a,n.__reatom,(u,d)=>{d.state=typeof o=="function"?o(d.state,u):o}).state),r=null;return typeof e=="function"&&(n={},r=e,e=void 0),n.__reatom={name:t,isAction:!1,patch:null,initState:()=>e,computer:r,connectHooks:null,disconnectHooks:null,updateHooks:null,actual:!1},n.pipe=H_,n.onChange=$_,xp.length===0?n:n.pipe(...xp)}const jo=(e,t)=>{e!==void 0&&typeof e!="string"||(t=e,e=(r,a)=>a),Y1(e);let n=ze([],t??hu("_action"));return n.__reatom.isAction=!0,n.__reatom.unstable_fn=e,Object.assign(function(){var r=[].slice.call(arguments);let a=n(r[0],(o,i)=>(r[0]=i,[...o,{params:r.slice(1),payload:i.cause.proto.unstable_fn(...r)}]));return a[a.length-1].payload},n,{onCall:V_})},xp=[],uc=ze(void 0,"root").__reatom,Eo=()=>{},U_=e=>typeof e=="object"&&e!==null,rh=Object.assign,K1=function(){return Object.assign({},...[].slice.call(arguments))},W_=(e=0,t=Number.MAX_SAFE_INTEGER-1)=>Math.floor(Math.random()*(t-e+1))+e,{toString:q_}=Object.prototype,fu=e=>{if(e instanceof Error==0||e.name!=="AbortError"){if(e instanceof Error){var t={cause:e};e=e.message}else e=U_(e)?q_.call(e):String(e);typeof DOMException>"u"?(e=new Error(e,t)).name="AbortError":e=rh(new DOMException(e,"AbortError"),t)}return e},X1=e=>{if(e!=null&&e.signal.aborted)throw fu(e.signal.reason)},Lm=e=>e instanceof Error&&e.name==="AbortError",Am=2**31-1;function z_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}let Z_=class extends WeakMap{has(e){return super.has(e)||e.cause!==null&&this.has(e.cause)}get(e){for(;!super.has(e)&&e.cause;)e=e.cause;return super.get(e)}};const ah=new Z_,Rm=e=>ah.get(e)??null,Dm=(e,t)=>{const n=Rm(e.cause);if(n){const r=()=>t(fu(n.signal.reason)),a=()=>n.signal.removeEventListener("abort",r);if(!n.signal.aborted)return n.signal.addEventListener("abort",r),e.schedule(()=>n.signal.removeEventListener("abort",r),-1),a;r()}},Ju=new WeakMap,Om=(e,t,n,r)=>{let a=Ju.get(t);if(!a){const o=t.then(i=>(e.get((c,u)=>a.then.forEach(d=>d(i,c,u))),i),i=>{throw e.get((c,u)=>a.catch.forEach(d=>d(i,c,u))),Lm(i)&&o.catch(Eo),i});Ju.set(t,a={promise:o,then:[],catch:[]}),Ju.set(o,a)}return n&&a.then.push(n),r&&a.catch.push(r),a.promise},G_=e=>{const{schedule:t}=e;return K1(e,{schedule(n,r=1){const a=this;if(r<1)return t.call(this,n,r);let o,i;const c=new Promise((d,h)=>{o=d,i=h}),u=Dm(this,d=>{c.catch(Eo),i(d)});return t.call(this,function(d){try{let h=function(){u==null||u()};const p=z_(function(){const f=Rm(a.cause);return X1(f),Promise.resolve(n(d)).then(function(y){X1(f),o(y)})},function(f){i(f)});return Promise.resolve(p&&p.then?p.then(h):h())}catch(h){return Promise.reject(h)}},r).catch(d=>{i(d),u==null||u()}),c}})},Nc=e=>e.cause===null?e:Nc(e.cause),Y_=(e,t)=>Nc(e.cause)===Nc(t.cause),K_=(e,t)=>{var n;return((n=e.__reatom).connectHooks??(n.connectHooks=new Set)).add(t)},X_=(e,t)=>{var n;return((n=e.__reatom).disconnectHooks??(n.disconnectHooks=new Set)).add(t)},fr=(e,t)=>{const n=a=>{const o=K1(a.get(h=>h(e.__reatom)),{cause:Nc(a.cause)}),i=new AbortController;ah.set(o,i);const c=t(K1(a,{cause:o,controller:i,isConnected:()=>J_(a,e)}));c instanceof Promise&&c.catch(Eo);const u=h=>{Y_(a,h)&&d.delete(u)&&r.has(n)&&(i.abort(fu(`${e.__reatom.name} disconnect`)),typeof c=="function"&&c())},d=X_(e,u)},r=K_(e,n);return()=>r.delete(n)},J_=(e,{__reatom:t})=>e.get(n=>{const r=t.patch??n(t);return!!r&&r.subs.size+r.listeners.size>0}),Q_=ze(null,"initializations");Q_.__reatom.initState=()=>new WeakMap;const ex=(e,t,{shouldPending:n=!0,shouldFulfill:r=!0,shouldReject:a=!0,effect:o=e.__reatom.unstable_fn}={})=>{const i=e.pendingAtom,[c]=t;n&&i(c,d=>++d);const u=c.schedule(()=>new Promise((d,h)=>{X1(c.controller),o(...t).then(d,h),c.controller.signal.addEventListener("abort",()=>h(fu(c.controller.signal.reason)))}));return rh(Om(c,u,d=>{r&&e.onFulfill(c,d),n&&i(c,h=>--h)},d=>{a&&!Lm(d)&&e.onReject(c,d),n&&i(c,h=>--h)}),{controller:c.controller})},tn=(e,t={})=>{const{name:n=hu("async"),onEffect:r,onFulfill:a,onReject:o,onSettle:i}=typeof t=="string"?{name:t}:t,c=ze(0,`${n}.pendingAtom`),u=Object.assign(function(){var f=[].slice.call(arguments);return f[0].get((y,g)=>{const{state:m}=g(f[0],u.__reatom,(b,x)=>{ah.set(b.cause,b.controller=new AbortController);const _=Dm(f[0],w=>{S==null||S.catch(Eo),b.controller.abort(w)});_&&b.controller.signal.addEventListener("abort",_),f[0]=G_(b);var S=u._handleCache?u._handleCache(...f):ex(u,f);Om(b,S,void 0,()=>{h.__reatom.updateHooks.size>1&&S.catch(Eo)}),x.state=[...x.state,{params:f.slice(1),payload:S}]});return m[m.length-1].payload})},jo(e,n)),d=jo(`${n}.onFulfill`),h=jo(`${n}.onReject`),p=jo(`${n}._onSettle`);return d.onCall(f=>p(f)),h.onCall(f=>p(f)),r&&u.onCall((f,y,g)=>r(f,g,y)),a&&d.onCall(a),o&&h.onCall(o),i&&p.onCall(i),fr(c,f=>f.subscribe(u,Eo)),rh(u,{onFulfill:d,onReject:h,onSettle:p,pendingAtom:c})};tn.from=(e,t={})=>(e.name.length>2&&(typeof t=="object"?t.name??(t.name=e.name):t??(t=e.name)),tn(function(n){return e(...[].slice.call(arguments,1))},t));const $n=(e,t)=>n=>{if(!n.dataAtom){const r=n.dataAtom=Object.assign(ze(e,`${n.__reatom.name}.dataAtom`),{reset:jo(a=>{r(a,e)},`${n.__reatom.name}.dataAtom.reset`),mapFulfill:t});r.__reatom.computer=(a,o)=>(a.spy(n.onFulfill,({payload:i})=>{o=i}),o),n.onFulfill.onCall(a=>{a.get(r)}),fr(r,a=>a.subscribe(n,Eo))}return n},wp=new WeakMap,Im=(e,t)=>{let n=wp.get(e);n||wp.set(e,n=new WeakMap);let r=n.get(t);return r||n.set(t,r=t.bind(null,e)),r},tx=ze(null);tx.__reatom.initState=()=>new WeakMap;const nx=()=>{},rx=Object.assign,{toString:ax}=Object.prototype,oh=e=>{if(e instanceof Error==0||e.name!=="AbortError"){if(e instanceof Error){var t={cause:e};e=e.message}else e=typeof(n=e)=="object"&&n!==null?ax.call(e):String(e);typeof DOMException>"u"?(e=new Error(e,t)).name="AbortError":e=rx(new DOMException(e,"AbortError"),t)}var n;return e},Sp=e=>{if(e!=null&&e.signal.aborted)throw oh(e.signal.reason)};class ox extends WeakMap{has(t){return super.has(t)||t.cause!==null&&this.has(t.cause)}get(t){for(;!super.has(t)&&t.cause;)t=t.cause;return super.get(t)}}const J1=new ox,jp=e=>J1.get(e)??null,ix=e=>{const{schedule:t}=e;return function(){return Object.assign({},...[].slice.call(arguments))}(e,{schedule(n,r=1){const a=this;if(r<1)return t.call(this,n,r);let o,i;const c=new Promise((d,h)=>{o=d,i=h}),u=((d,h)=>{const p=jp(d.cause);if(p){const f=()=>{return g=oh(p.signal.reason),c.catch(nx),void i(g);var g},y=()=>p.signal.removeEventListener("abort",f);if(!p.signal.aborted)return p.signal.addEventListener("abort",f),d.schedule(()=>p.signal.removeEventListener("abort",f),-1),y;f()}})(this);return t.call(this,function(d){try{let h=function(){u==null||u()};const p=function(f,y){try{var g=function(){const m=jp(a.cause);return Sp(m),Promise.resolve(n(d)).then(function(b){Sp(m),o(b)})}()}catch(m){return y(m)}return g&&g.then?g.then(void 0,y):g}(0,function(f){i(f)});return Promise.resolve(p&&p.then?p.then(h):h())}catch(h){return Promise.reject(h)}},r).catch(d=>{i(d),u==null||u()}),c}})},sx=typeof document<"u"?C.useLayoutEffect:C.useEffect;let Mm=e=>{var t,n,r;let a=(r=(n=(t=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:t.ReactCurrentOwner)==null?void 0:n.current)==null?void 0:r.type,o=(a==null?void 0:a.displayName)??(a==null?void 0:a.name);return o&&o.concat(".",e)||`_${e}`},Bm=e=>e();const Fm=C.createContext(null),ih=()=>{let e=C.useContext(Fm);return $a(!e,"ctx is not set, you probably forgot to specify the ctx provider"),e};let lx=(e,t)=>Im(e,t);const me=(e,t=[],n={})=>{let{name:r,subscribe:a=!0}=typeof n=="boolean"?{subscribe:n}:n,o=ih(),i=[o];cc(e)&&i.push(e);let c=C.useMemo(()=>{let y=Mm(r??"useAtom#"+typeof e),g=ze([],`${y}._depsAtom`),m=e;return cc(m)||(m=ze(typeof e=="function"?(b,x)=>(b.spy(g),c.anAtom(b,x)):e,y)),{theAtom:m,depsAtom:g,update:typeof m=="function"?function(){return Bm(()=>m(o,...[].slice.call(arguments)))}:void 0,sub:b=>o.subscribe(m,b),get:()=>o.get(m),subscribe:a,anAtom:e}},i);c.anAtom=e;let{theAtom:u,depsAtom:d,update:h,sub:p,get:f}=c;return o.get(()=>{if(!cc(e)){const y=o.get(d);(t.length!==y.length||t.some((g,m)=>!Object.is(g,y[m])))&&(typeof e=="function"?d(o,t):h(o,e))}return[a?C.useSyncExternalStore(p,f,f):f(),h,u,o]})},Fr=(e,t=[],n)=>{$a(typeof e!="function",'invalid "fn"'),t??(t=[]);let r=ih();t.push(r),_p(e)&&t.push(e);let a=C.useMemo(()=>{let o=_p(e)?e:jo(function(){return a.fn(...[].slice.call(arguments))},Mm("useAction"));return{fn:e,cb:function(){return Bm(()=>o(r,...[].slice.call(arguments)))}}},t);return sx(()=>{a.fn=e}),a.cb},cx=(e,t=hu("Component"))=>{let n=!1;return Object.defineProperty(r=>{const{controller:a,propsAtom:o,renderAtom:i}=C.useMemo(()=>{const d=new AbortController,h=ze({},`${t}._propsAtom`),p=ze((f,y)=>{const{pubs:g}=f.cause,m=f.spy(h);if(n){const b=C.useRef();if(!b.current){const S=b.current=ix(f);J1.set(S.cause,d)}const x=b.current;m.ctx={get:f.get,spy:f.spy,schedule:f.schedule,subscribe:f.subscribe,cause:x.cause,bind:Im(x,lx)};const _=e(m);return typeof _!="object"||_===null||Symbol.iterator in _?C.createElement(C.Fragment,null,_):_}for(let b=1;b<g.length;b++)f.spy({__reatom:g[b].proto});return{...y,REATOM_DEPS_CHANGE:!0}},`${t}._renderAtom`);return{controller:d,propsAtom:h,renderAtom:p}},[]),c=ih(),[,u]=C.useState({});return C.useEffect(()=>{let d=a;if(d.signal.aborted){const p=c.get(o).ctx.cause;J1.set(p,d=new AbortController)}const h=c.subscribe(i,p=>{p.REATOM_DEPS_CHANGE&&u(p)});return()=>{h(),d.abort(oh(`${t} unmount`))}},[c,i]),c.get(()=>{o(c,{...r});try{return n=!0,c.get(i)}finally{n=!1}})},"name",{value:t})},Hm=e=>{const t=ze(e,`storageAtom#${e.name}`);return Object.assign(n=>r=>{const{key:a,fromSnapshot:o=(b,x)=>x,migration:i,subscribe:c=!!e.subscribe,time:u=Am,toSnapshot:d=(b,x)=>x,version:h=0}=typeof n=="string"?{key:n}:n,p=r.__reatom,{initState:f}=p,y=function(b,x){x===void 0&&(x=null);const _=b.get(t).get(b,a);return(_==null?void 0:_.id)===(x==null?void 0:x.id)?x:_??x},g=function(b,x,_){return x===void 0&&(x=y(b)),x===null||x.version!==h&&i===void 0?f(b):o(b,x.version!==h?i(b,x):x.data,_)};$a(!a,"missed key");const m=ze(null,`${r.__reatom.name}._${e.name}Atom`);if(m.__reatom.computer=y,c){const{computer:b}=r.__reatom;r.__reatom.computer=(x,_)=>(x.spy(m,S=>{_=g(x,S,_)}),b?b(x,_):_),fr(r,x=>{var _,S;return(S=(_=x.get(t)).subscribe)==null?void 0:S.call(_,x,a,()=>{m(x,w=>w)})})}else r.__reatom.initState=g;return r.onChange((b,x)=>{const{cause:_}=b,S=b.get(k=>k(uc));b.get(m);let w=b.get((k,L)=>L(b,m.__reatom));if(_.cause===w&&w.cause===_&&(w.cause=S),r.__reatom.patch===_&&_.cause!==w){const{subs:k}=w;w.subs=new Set;const L=m(b,((j,T)=>({data:d(j,T),fromState:!0,id:W_(),timestamp:Date.now(),to:Date.now()+u,version:h}))(b,x));(w=w.proto.patch).subs=w.subs=k,w.cause=S;const D=_.pubs.findIndex(j=>{let{proto:T}=j;return T===w.proto});_.pubs[D]=w,b.get(t).set(b,a,L)}}),r},{storageAtom:t})},sh=e=>{let{name:t,mutable:n=!0,snapshot:r={},subscribe:a=!0}=e;const o=Date.now(),i=o+Am,c=ze(Object.entries(r).reduce((d,h)=>{let[p,f]=h;return d[p]={data:f,fromState:!1,id:0,timestamp:o,to:i,version:0},d},{}),`${t}._snapshotAtom`),u=ze(function(d,h){return h===void 0&&(h=new Map),h},`${t}._listenersAtom`);return{name:t,get:(d,h)=>d.get(c)[h]??null,set:(d,h,p)=>{if(n){const f=d.get(c),y=f[h];f[h]=p,d.schedule(()=>f[h]=y,-1)}else c(d,f=>({...f,[h]:p}));d.schedule(()=>{var f;return(f=d.get(u).get(h))==null?void 0:f.forEach(y=>y(p))})},subscribe:a?(d,h,p)=>{const f=d.get(u);f.set(h,(f.get(h)??new Set).add(p));const y=()=>{const g=f.get(h);g&&(g.delete(p),g.size===0&&f.delete(h))};return d.schedule(y,-1),y}:void 0,snapshotAtom:c}};try{var $m=!!globalThis.BroadcastChannel}catch{$m=!1}$m?new BroadcastChannel("reatom_withBroadcastChannel_default"):sh({name:"withBroadcastChannel"});new BroadcastChannel("reatom_withIndexedDb_default");const ux=(e,t)=>{const n=ze((r,a=new Map)=>a,`${e}._memCacheAtom`);return Hm({name:e,get(r,a){try{const o=r.get(n),i=t.getItem(a);if(i){const c=JSON.parse(i);if(c.to<Date.now())return this.clear(r,a),null;const u=o.get(a);return(u==null?void 0:u.id)===c.id||(u==null?void 0:u.timestamp)>=c.timestamp?u:(o.set(a,c),c)}}catch{return null}return null},set(r,a,o){r.get(n).set(a,o),r.schedule(()=>t.setItem(a,JSON.stringify(o)))},clear(r,a){r.get(n).delete(a),r.schedule(()=>t.removeItem(a))},subscribe(r,a,o){var i;const c=r.get(n),u=d=>{var h;if(d.storageArea===t&&d.key===a)if(d.newValue===null)c.delete(a);else{const p=JSON.parse(d.newValue);p.id!==((h=c.get(a))==null?void 0:h.id)&&(c.set(a,p),o())}};return(i=globalThis.addEventListener)==null||i.call(globalThis,"storage",u,!1),()=>{var d;return(d=globalThis.removeEventListener)==null?void 0:d.call(globalThis,"storage",u,!1)}}})};try{var lh=!!globalThis.localStorage}catch{lh=!1}const ch=lh?ux("withLocalStorage",globalThis.localStorage):Hm(sh({name:"withLocalStorage"}));lh?globalThis.sessionStorage:sh({name:"withSessionStorage"});try{var dx="cookie"in globalThis.document}catch{dx=!1}const io=ze("").pipe(ch("token")),_i=ze({requested:!1,email:""}),Vm=tn(async(e,{email:t,recaptcha:n})=>{await bt("auth/otp/request",{body:{email:t,recaptcha:n},apiUrl:fh(),method:"POST",useToken:!1})&&_i(e,{requested:!0,email:t})}),Um=tn(async(e,{otp:t,recaptcha:n})=>{const r="auth/otp/login",a=e.get(_i).email,o=await bt(r,{method:"POST",body:{email:a,otp:t,recaptcha:n},apiUrl:fh(),useToken:!1});o.data&&(io(e,o.data),_i(e,{requested:!1}))}),Q1=jo(e=>{io(e,"")});var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ed={exports:{}},as={};/**
|
|
75
75
|
* @license React
|
|
76
76
|
* react-jsx-runtime.production.min.js
|
|
77
77
|
*
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-_Cl8H5kf.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.ReCaptchaProvider=t.q2;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.bi;
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { App as o, ColorVariables as t, createTicket as r, hotReload as s, iconNames as p } from "./builder.es.js";
|
|
2
|
-
import { q as i, s as l, b as h } from "./index-
|
|
2
|
+
import { q as i, s as l, b as h } from "./index-CMw6nNKj.js";
|
|
3
3
|
export {
|
|
4
4
|
o as App,
|
|
5
5
|
t as ColorVariables,
|