@billgangcom/theme-lib 1.124.3 → 1.124.7
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-B_dkm02v.js → builder-BGSGUvbw.js} +15 -15
- package/dist/{builder-Dk_MBUqd.cjs → builder-BoZFTb7G.cjs} +2 -2
- package/dist/builder-components-Ce-GvvbU.cjs +5 -0
- package/dist/{builder-components-l43cXoO5.js → builder-components-uIH6kfbb.js} +3649 -3641
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +31 -31
- package/dist/{charge-BU-Az7UN.js → charge-BlJi0xCO.js} +17628 -17596
- package/dist/{charge-CcS0C6Hj.cjs → charge-w4kIp324.cjs} +69 -69
- package/dist/{checkout-ngWZwoPX.js → checkout-B32zo5ao.js} +5 -5
- package/dist/{checkout-BLgmgd9k.cjs → checkout-CtUeXuTx.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-DCYg5lir.cjs → index-B3eXZddH.cjs} +1 -1
- package/dist/{index-B9Rq5d0u.js → index-BNJDqT-0.js} +5 -5
- package/dist/{index-Bn9YCw-R.cjs → index-BRdmeZZl.cjs} +1 -1
- package/dist/{index-CPnT643z.cjs → index-BTyOlaxG.cjs} +1 -1
- package/dist/{index-gEVhujlj.js → index-BuxbXdLp.js} +5 -5
- package/dist/{index-BlWsjWZ3.js → index-CoCTJ62P.js} +10 -10
- package/dist/{index-Doa1gQPZ.js → index-DAKSB_F0.js} +2 -2
- package/dist/{index-Cg7DJNHO.cjs → index-RtcNex9r.cjs} +1 -1
- package/dist/{index-ByBe0n_t.cjs → index-SyO84kfM.cjs} +1 -1
- package/dist/{index-D82GsMsp.js → index-TvJTXZf9.js} +1 -1
- package/dist/{index-0PqQaCZ4.cjs → index-fnVhuwC_.cjs} +1 -1
- package/dist/{index-D78O6F0T.js → index-z_-C0z77.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +18 -18
- package/dist/{order-BgjNH9DK.cjs → order-Amk-Jg5s.cjs} +1 -1
- package/dist/{order-CSPUNQL8.js → order-Nvdr1Xpq.js} +9 -9
- package/dist/src/assets/storefront-icons/index.d.ts +3 -0
- package/dist/src/storefront/components/PaymentMethod/model.d.ts +2 -1
- package/dist/src/storefront/models/payment.d.ts +2 -1
- package/dist/src/ui/ChooseImage/api/index.d.ts +8 -1
- package/dist/style.css +1 -1
- package/dist/{subscription-Cv67YuMc.js → subscription-BtN0ZLhW.js} +8 -8
- package/dist/{subscription-DkAqKLzt.cjs → subscription-Dke5SI7x.cjs} +1 -1
- package/dist/{ticket-BMS8VibT.js → ticket-DR1de6DJ.js} +83 -83
- package/dist/ticket-DpkxSuxR.cjs +108 -0
- package/dist/{top-up-DzH6R08c.cjs → top-up-Cma1nW3z.cjs} +1 -1
- package/dist/{top-up-CTo-WorN.js → top-up-D2COqVbe.js} +5 -5
- package/dist/{ui-components-BHKWyvO1.js → ui-components-BQyCaYte.js} +2017 -2001
- package/dist/ui-components-CaI7HLsm.cjs +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-DTFAUmYS.js → validation-BBKKW104.js} +7 -7
- package/dist/{validation-B7tkrQWi.cjs → validation-CYN2gbtD.cjs} +1 -1
- package/package.json +1 -1
- package/dist/builder-components-CHl1cc7Z.cjs +0 -5
- package/dist/ticket-DNKLLT6h.cjs +0 -108
- package/dist/ui-components-CQk_SRR5.cjs +0 -1
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-CaI7HLsm.cjs");exports.Accordion=t.Accordion;exports.AlignText=t.AlignText;exports.BurgerMenuButton=t.BurgerMenuButton;exports.Button=t.Button;exports.ButtonSettings=t.ButtonSettings;exports.ButtonTypeSettings=t.ButtonTypeSettings;exports.ButtonsSettings=t.ButtonsSettings;exports.CategorySettings=t.CategorySettings;exports.ChargeTypes=t.ChargeTypes;exports.Checkbox=t.Checkbox;exports.CheckboxSettings=t.CheckboxSettings;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ConfirmationModal=t.ConfirmationModal;exports.EmptyCart=t.EmptyCart;exports.ErrorableBlock=t.ErrorableBlock;exports.FormSettings=t.FormSettings;exports.GroupCardModal=t.GroupCardModal;exports.HeaderButtons=t.HeaderButtons;exports.Icon=t.Icon;exports.ImagesLoader=t.ImagesLoader;exports.InputSettings=t.InputSettings;exports.InputUI=t.Input;exports.ItemsSettings=t.ItemsSettings;exports.LayoutSettings=t.LayoutSettings;exports.Link=t.Link;exports.ListingSelector=t.ListingSelector;exports.Loader=t.Loader;exports.LoaderBuilder=t.LoaderBuilder;exports.MetaInfoPost=t.MetaInfoPost;exports.Modal=t.Modal;exports.NotificationBuilder=t.NotificationBuilder;exports.PagesMobileMenu=t.PagesMobileMenu;exports.PagesMobileModal=t.PagesMobileModal;exports.PagesSettings=t.PagesSettings;exports.ProductCardButtons=t.ProductCardButtons;exports.ProductCardModal=t.ProductCardModal;exports.ProductOptions=t.ProductOptions;exports.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectSettings=t.SelectSettings;exports.SelectTypeText=t.SelectTypeText;exports.SelectUI=t.Select;exports.ShareLink=t.ShareLink;exports.ShoppingButton=t.ShoppingButton;exports.ShoppingModalCart=t.ShoppingModalCart;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.TextareaSettings;exports.TextareaUI=t.Textarea;exports.Tip=t.Tip;exports.TypesText=t.TypesText;exports.UserInfo=t.UserInfo;exports.Wrapper=t.Wrapper;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as t, J as e, a2 as o, g as n, B as i, K as r, G as g, D as S, U as d, j as l, m as c, ab as u, b as p, C as I, _ as B, E as C, F as M, a9 as T, X as h, I as m, k as x, c as L, f as y, A as P, y as b, a5 as f, Q as k, e as U, L as A, a7 as E, M as R, N as F, a1 as G, a0 as H, P as N, a6 as O, a8 as W, V as j, R as w, O as z, h as D, ac as J, S as K, aa as Q, h as V, a3 as X, Y, Z, d as _, z as $, T as q, l as v, i as aa, H as sa, $ as ta, W as ea } from "./ui-components-
|
|
1
|
+
import { a4 as t, J as e, a2 as o, g as n, B as i, K as r, G as g, D as S, U as d, j as l, m as c, ab as u, b as p, C as I, _ as B, E as C, F as M, a9 as T, X as h, I as m, k as x, c as L, f as y, A as P, y as b, a5 as f, Q as k, e as U, L as A, a7 as E, M as R, N as F, a1 as G, a0 as H, P as N, a6 as O, a8 as W, V as j, R as w, O as z, h as D, ac as J, S as K, aa as Q, h as V, a3 as X, Y, Z, d as _, z as $, T as q, l as v, i as aa, H as sa, $ as ta, W as ea } from "./ui-components-BQyCaYte.js";
|
|
2
2
|
export {
|
|
3
3
|
t as Accordion,
|
|
4
4
|
e as AlignText,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { z as I, N as x, ac as N, p as b } from "./builder-
|
|
5
|
-
import { I as y, f as k, g as L, e as E } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
3
|
+
import { _ as g } from "./charge-BlJi0xCO.js";
|
|
4
|
+
import { z as I, N as x, ac as N, p as b } from "./builder-BGSGUvbw.js";
|
|
5
|
+
import { I as y, f as k, g as L, e as E } from "./ui-components-BQyCaYte.js";
|
|
6
|
+
import "./builder-components-uIH6kfbb.js";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
import "./ticket-
|
|
8
|
+
import "./ticket-DR1de6DJ.js";
|
|
9
9
|
const V = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C = "_info_1mxa7_31", q = "_buttons_1mxa7_38", z = "_button_1mxa7_38", B = "_input_1mxa7_50", R = "_error_1mxa7_57", t = {
|
|
10
10
|
lock: V,
|
|
11
11
|
wrapper: G,
|
|
@@ -15,7 +15,7 @@ const V = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C =
|
|
|
15
15
|
button: z,
|
|
16
16
|
input: B,
|
|
17
17
|
error: R
|
|
18
|
-
},
|
|
18
|
+
}, O = () => {
|
|
19
19
|
const [f, n] = r.useState(!1), [u, h] = r.useState(!1), [c, P] = r.useState(""), { general: e, setGeneral: w } = I(), { setShopPassword: p } = x(), i = N(), m = b();
|
|
20
20
|
r.useEffect(() => {
|
|
21
21
|
if (e && (!e.info.passwordProtected || e.isPasswordValid)) {
|
|
@@ -106,5 +106,5 @@ const V = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C =
|
|
|
106
106
|
] });
|
|
107
107
|
};
|
|
108
108
|
export {
|
|
109
|
-
|
|
109
|
+
O as ValidationPage
|
|
110
110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-w4kIp324.cjs"),d=require("./builder-BoZFTb7G.cjs"),u=require("./ui-components-CaI7HLsm.cjs");require("./builder-components-Ce-GvvbU.cjs");require("react-dom");require("./ticket-DpkxSuxR.cjs");const j="_lock_1mxa7_1",b="_wrapper_1mxa7_12",I="_content_1mxa7_22",y="_info_1mxa7_31",N="_buttons_1mxa7_38",q="_button_1mxa7_38",k="_input_1mxa7_50",L="_error_1mxa7_57",s={lock:j,wrapper:b,content:I,info:y,buttons:N,button:q,input:k,error:L},V=()=>{const[f,n]=r.useState(!1),[h,w]=r.useState(!1),[c,P]=r.useState(""),{general:o,setGeneral:_}=d.useGeneralStore(),{setShopPassword:p}=d.useStorefrontStore(),i=d.useLocation(),m=d.useNavigate();r.useEffect(()=>{if(o&&(!o.info.passwordProtected||o.isPasswordValid)){const t=i.state.from==="/validation"?"/":i.state.from;m(t)}},[o]),r.useEffect(()=>{o||(async()=>{var x;n(!0);const l=localStorage.getItem("shopPassword")||"",a=await g.fetchGeneral(l);if(a.isPasswordValid){const S=((x=i.state)==null?void 0:x.from)||"/";m(S)}a.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(a),n(!1)})()},[o]);async function v(){var l;n(!0);const t=await g.fetchGeneral(c);if(!t.isPasswordValid)w(!0);else{localStorage.setItem("shopPassword",c),p(c);const a=((l=i.state)==null?void 0:l.from)||"/";m(a),t.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(t)}n(!1)}return e.jsxs("div",{className:s.wrapper,children:[!f&&e.jsxs("div",{className:s.content,children:[e.jsx("div",{className:s.lock,children:e.jsx(u.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),e.jsxs("div",{className:s.info,children:[e.jsx("h2",{id:"h2",className:s.title,children:"The store is password protected"}),e.jsx("p",{id:"p",className:s.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),e.jsxs("div",{className:s.input,children:[e.jsx(u.Input,{type:"password",onChange:t=>{w(!1),P(t)},value:c,placeholder:"Password",required:!0}),e.jsx("span",{className:s.error,children:h&&"Incorrect password"})]}),e.jsx("div",{className:s.buttons,children:e.jsx(u.Button,{type:"Primary",className:s.button,disabled:h,onClick:v,children:"Submit"})})]}),f&&e.jsx(u.Loader,{})]})};exports.ValidationPage=V;
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),f=require("react"),l=require("./builder-Dk_MBUqd.cjs"),j=require("./ui-components-CQk_SRR5.cjs"),at=require("react-dom");require("./charge-CcS0C6Hj.cjs");require("./ticket-DNKLLT6h.cjs");const Tt=({render:e,block:t})=>e(t),dn=({settings:e,pageContext:t})=>{const{footer:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{footer:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},hn=({settings:e,pageContext:t})=>{const{header:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{header:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},fn=({settings:e,pageContext:t})=>{const{announcement:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{announcement:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock(e||s,t||o)},Us=Object.freeze(Object.defineProperty({__proto__:null,RenderAnnouncement:fn,RenderBlock:Tt,RenderFooter:dn,RenderHeader:hn},Symbol.toStringTag,{value:"Module"}));function Vs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(o=>o(s))},t)}const Mt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function gn(e){return"nodeType"in e}function J(e){var t,n;return e?Xe(e)?e:gn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function pn(e){const{Document:t}=J(e);return e instanceof t}function ft(e){return Xe(e)?!1:e instanceof J(e).HTMLElement}function Qn(e){return e instanceof J(e).SVGElement}function qe(e){return e?Xe(e)?e.document:gn(e)?pn(e)?e:ft(e)||Qn(e)?e.ownerDocument:document:document:document}const be=Mt?f.useLayoutEffect:f.useEffect;function mn(e){const t=f.useRef(e);return be(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}function Ks(){const e=f.useRef(null),t=f.useCallback((s,o)=>{e.current=setInterval(s,o)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function dt(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function gt(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function At(e){const t=mn(e),n=f.useRef(null),s=f.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,s]}function Qt(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let zt={};function pt(e,t){return f.useMemo(()=>{if(t)return t;const n=zt[e]==null?0:zt[e]+1;return zt[e]=n,e+"-"+n},[e,t])}function Zn(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((r,a)=>{const c=Object.entries(a);for(const[u,h]of c){const d=r[u];d!=null&&(r[u]=d+e*h)}return r},{...t})}}const Ge=Zn(1),Nt=Zn(-1);function Gs(e){return"clientX"in e&&"clientY"in e}function vn(e){if(!e)return!1;const{KeyboardEvent:t}=J(e.target);return t&&e instanceof t}function Ys(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function Zt(e){if(Ys(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Gs(e)?{x:e.clientX,y:e.clientY}:null}const Ye=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ye.Translate.toString(e),Ye.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Bn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xs(e){return e.matches(Bn)?e:e.querySelector(Bn)}const qs={display:"none"};function Js(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:qs},n)}function Qs(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return f.createElement("div",{id:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},n)}function Zs(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const es=f.createContext(null);function eo(e){const t=f.useContext(es);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function to(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:o,event:r}=s;e.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,r)})},[e]),t]}const no={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},so={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 oo(e){let{announcements:t=so,container:n,hiddenTextDescribedById:s,screenReaderInstructions:o=no}=e;const{announce:r,announcement:a}=Zs(),c=pt("DndLiveRegion"),[u,h]=f.useState(!1);if(f.useEffect(()=>{h(!0)},[]),eo(f.useMemo(()=>({onDragStart(p){let{active:v}=p;r(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:m}=p;t.onDragMove&&r(t.onDragMove({active:v,over:m}))},onDragOver(p){let{active:v,over:m}=p;r(t.onDragOver({active:v,over:m}))},onDragEnd(p){let{active:v,over:m}=p;r(t.onDragEnd({active:v,over:m}))},onDragCancel(p){let{active:v,over:m}=p;r(t.onDragCancel({active:v,over:m}))}}),[r,t])),!u)return null;const d=f.createElement(f.Fragment,null,f.createElement(Js,{id:s,value:o.draggable}),f.createElement(Qs,{id:c,announcement:a}));return n?at.createPortal(d,n):d}var W;(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"})(W||(W={}));function It(){}function ts(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ns(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const ue=Object.freeze({x:0,y:0});function ro(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function io(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function ao(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),a=o-s,c=r-n;if(s<o&&n<r){const u=t.width*t.height,h=e.width*e.height,d=a*c,p=d/(u+h-d);return Number(p.toFixed(4))}return 0}const co=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const r of s){const{id:a}=r,c=n.get(a);if(c){const u=ao(c,t);u>0&&o.push({id:a,data:{droppableContainer:r,value:u}})}}return o.sort(ro)};function lo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ss(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function uo(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),r=1;r<s;r++)o[r-1]=arguments[r];return o.reduce((a,c)=>({...a,top:a.top+e*c.y,bottom:a.bottom+e*c.y,left:a.left+e*c.x,right:a.right+e*c.x}),{...n})}}const ho=uo(1);function fo(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 go(e,t,n){const s=fo(t);if(!s)return e;const{scaleX:o,scaleY:r,x:a,y:c}=s,u=e.left-a-(1-o)*parseFloat(n),h=e.top-c-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,p=r?e.height/r:e.height;return{width:d,height:p,top:h,right:u+d,bottom:h+p,left:u}}const po={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=po);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:d}=J(e).getComputedStyle(e);h&&(n=go(n,h,d))}const{top:s,left:o,width:r,height:a,bottom:c,right:u}=n;return{top:s,left:o,width:r,height:a,bottom:c,right:u}}function En(e){return Je(e,{ignoreTransform:!0})}function mo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function vo(e,t){return t===void 0&&(t=J(e).getComputedStyle(e)),t.position==="fixed"}function bo(e,t){t===void 0&&(t=J(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const r=t[o];return typeof r=="string"?n.test(r):!1})}function bn(e,t){const n=[];function s(o){if(t!=null&&n.length>=t||!o)return n;if(pn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ft(o)||Qn(o)||n.includes(o))return n;const r=J(e).getComputedStyle(o);return o!==e&&bo(o,r)&&n.push(o),vo(o,r)?n:s(o.parentNode)}return e?s(e):n}function os(e){const[t]=bn(e,1);return t??null}function Ht(e){return!Mt||!e?null:Xe(e)?e:gn(e)?pn(e)||e===qe(e).scrollingElement?window:ft(e)?e:null:null}function rs(e){return Xe(e)?e.scrollX:e.scrollLeft}function is(e){return Xe(e)?e.scrollY:e.scrollTop}function en(e){return{x:rs(e),y:is(e)}}var U;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(U||(U={}));function as(e){return!Mt||!e?!1:e===document.scrollingElement}function cs(e){const t={x:0,y:0},n=as(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,a=e.scrollTop>=s.y,c=e.scrollLeft>=s.x;return{isTop:o,isLeft:r,isBottom:a,isRight:c,maxScroll:s,minScroll:t}}const xo={x:.2,y:.2};function So(e,t,n,s,o){let{top:r,left:a,right:c,bottom:u}=n;s===void 0&&(s=10),o===void 0&&(o=xo);const{isTop:h,isBottom:d,isLeft:p,isRight:v}=cs(e),m={x:0,y:0},_={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!h&&r<=t.top+g.height?(m.y=U.Backward,_.y=s*Math.abs((t.top+g.height-r)/g.height)):!d&&u>=t.bottom-g.height&&(m.y=U.Forward,_.y=s*Math.abs((t.bottom-g.height-u)/g.height)),!v&&c>=t.right-g.width?(m.x=U.Forward,_.x=s*Math.abs((t.right-g.width-c)/g.width)):!p&&a<=t.left+g.width&&(m.x=U.Backward,_.x=s*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:_}}function yo(e){if(e===document.scrollingElement){const{innerWidth:r,innerHeight:a}=window;return{top:0,left:0,right:r,bottom:a,width:r,height:a}}const{top:t,left:n,right:s,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ls(e){return e.reduce((t,n)=>Ge(t,en(n)),ue)}function _o(e){return e.reduce((t,n)=>t+rs(n),0)}function Co(e){return e.reduce((t,n)=>t+is(n),0)}function wo(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:s,bottom:o,right:r}=t(e);os(e)&&(o<=0||r<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ko=[["x",["left","right"],_o],["y",["top","bottom"],Co]];class xn{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 s=bn(n),o=ls(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[r,a,c]of ko)for(const u of a)Object.defineProperty(this,u,{get:()=>{const h=c(s),d=o[r]-h;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ct{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var o;(o=this.target)==null||o.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function jo(e){const{EventTarget:t}=J(e);return e instanceof t?e:qe(e)}function Wt(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function Dn(e){e.preventDefault()}function Ao(e){e.stopPropagation()}var O;(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"})(O||(O={}));const us={start:[O.Space,O.Enter],cancel:[O.Esc],end:[O.Space,O.Enter,O.Tab]},No=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case O.Right:return{...n,x:n.x+25};case O.Left:return{...n,x:n.x-25};case O.Down:return{...n,y:n.y+25};case O.Up:return{...n,y:n.y-25}}};class ds{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 ct(qe(n)),this.windowListeners=new ct(J(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&wo(s),n(ue)}handleKeyDown(t){if(vn(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:r=us,coordinateGetter:a=No,scrollBehavior:c="smooth"}=o,{code:u}=t;if(r.end.includes(u)){this.handleEnd(t);return}if(r.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:h}=s.current,d=h?{x:h.left,y:h.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=d);const p=a(t,{active:n,context:s.current,currentCoordinates:d});if(p){const v=Nt(p,d),m={x:0,y:0},{scrollableAncestors:_}=s.current;for(const g of _){const x=t.code,{isTop:S,isRight:C,isLeft:b,isBottom:A,maxScroll:k,minScroll:w}=cs(g),y=yo(g),N={x:Math.min(x===O.Right?y.right-y.width/2:y.right,Math.max(x===O.Right?y.left:y.left+y.width/2,p.x)),y:Math.min(x===O.Down?y.bottom-y.height/2:y.bottom,Math.max(x===O.Down?y.top:y.top+y.height/2,p.y))},M=x===O.Right&&!C||x===O.Left&&!b,$=x===O.Down&&!A||x===O.Up&&!S;if(M&&N.x!==p.x){const R=g.scrollLeft+v.x,D=x===O.Right&&R<=k.x||x===O.Left&&R>=w.x;if(D&&!v.y){g.scrollTo({left:R,behavior:c});return}D?m.x=g.scrollLeft-R:m.x=x===O.Right?g.scrollLeft-k.x:g.scrollLeft-w.x,m.x&&g.scrollBy({left:-m.x,behavior:c});break}else if($&&N.y!==p.y){const R=g.scrollTop+v.y,D=x===O.Down&&R<=k.y||x===O.Up&&R>=w.y;if(D&&!v.x){g.scrollTo({top:R,behavior:c});return}D?m.y=g.scrollTop-R:m.y=x===O.Down?g.scrollTop-k.y:g.scrollTop-w.y,m.y&&g.scrollBy({top:-m.y,behavior:c});break}}this.handleMove(t,Ge(Nt(p,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(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()}}ds.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=us,onActivation:o}=t,{active:r}=n;const{code:a}=e.nativeEvent;if(s.start.includes(a)){const c=r.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Tn(e){return!!(e&&"distance"in e)}function Mn(e){return!!(e&&"delay"in e)}class Sn{constructor(t,n,s){var o;s===void 0&&(s=jo(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:r}=t,{target:a}=r;this.props=t,this.events=n,this.document=qe(a),this.documentListeners=new ct(this.document),this.listeners=new ct(s),this.windowListeners=new ct(J(a)),this.initialCoordinates=(o=Zt(r))!=null?o:ue,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:s}}}=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(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,Dn),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,Dn),this.documentListeners.add(oe.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Tn(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:s,onPending:o}=this.props;o(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(oe.Click,Ao,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:o,props:r}=this,{onMove:a,options:{activationConstraint:c}}=r;if(!o)return;const u=(n=Zt(t))!=null?n:ue,h=Nt(o,u);if(!s&&c){if(Tn(c)){if(c.tolerance!=null&&Wt(h,c.tolerance))return this.handleCancel();if(Wt(h,c.distance))return this.handleStart()}if(Mn(c)&&Wt(h,c.tolerance))return this.handleCancel();this.handlePending(c,h);return}t.cancelable&&t.preventDefault(),a(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===O.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Io={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Rt extends Sn{constructor(t){const{event:n}=t,s=qe(n.target);super(t,Io,s)}}Rt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const Bo={move:{name:"mousemove"},end:{name:"mouseup"}};var tn;(function(e){e[e.RightClick=2]="RightClick"})(tn||(tn={}));class Eo extends Sn{constructor(t){super(t,Bo,qe(t.event.target))}}Eo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===tn.RightClick?!1:(s==null||s({event:n}),!0)}}];const Ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Do extends Sn{constructor(t){super(t,Ut)}static setup(){return window.addEventListener(Ut.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ut.move.name,t)};function t(){}}}Do.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:o}=n;return o.length>1?!1:(s==null||s({event:n}),!0)}}];var lt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(lt||(lt={}));var Bt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bt||(Bt={}));function To(e){let{acceleration:t,activator:n=lt.Pointer,canScroll:s,draggingRect:o,enabled:r,interval:a=5,order:c=Bt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:d,delta:p,threshold:v}=e;const m=Ro({delta:p,disabled:!r}),[_,g]=Ks(),x=f.useRef({x:0,y:0}),S=f.useRef({x:0,y:0}),C=f.useMemo(()=>{switch(n){case lt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case lt.DraggableRect:return o}},[n,o,u]),b=f.useRef(null),A=f.useCallback(()=>{const w=b.current;if(!w)return;const y=x.current.x*S.current.x,N=x.current.y*S.current.y;w.scrollBy(y,N)},[]),k=f.useMemo(()=>c===Bt.TreeOrder?[...h].reverse():h,[c,h]);f.useEffect(()=>{if(!r||!h.length||!C){g();return}for(const w of k){if((s==null?void 0:s(w))===!1)continue;const y=h.indexOf(w),N=d[y];if(!N)continue;const{direction:M,speed:$}=So(w,N,C,t,v);for(const R of["x","y"])m[R][M[R]]||($[R]=0,M[R]=0);if($.x>0||$.y>0){g(),b.current=w,_(A,a),x.current=$,S.current=M;return}}x.current={x:0,y:0},S.current={x:0,y:0},g()},[t,A,s,g,r,a,JSON.stringify(C),JSON.stringify(m),_,h,k,d,JSON.stringify(v)])}const Mo={x:{[U.Backward]:!1,[U.Forward]:!1},y:{[U.Backward]:!1,[U.Forward]:!1}};function Ro(e){let{delta:t,disabled:n}=e;const s=Qt(t);return gt(o=>{if(n||!s||!o)return Mo;const r={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[U.Backward]:o.x[U.Backward]||r.x===-1,[U.Forward]:o.x[U.Forward]||r.x===1},y:{[U.Backward]:o.y[U.Backward]||r.y===-1,[U.Forward]:o.y[U.Forward]||r.y===1}}},[n,t,s])}function Po(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return gt(o=>{var r;return t==null?null:(r=s??o)!=null?r:null},[s,t])}function Oo(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:o}=s,r=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,s)}));return[...n,...r]},[]),[e,t])}var ht;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ht||(ht={}));var nn;(function(e){e.Optimized="optimized"})(nn||(nn={}));const Rn=new Map;function Lo(e,t){let{dragging:n,dependencies:s,config:o}=t;const[r,a]=f.useState(null),{frequency:c,measure:u,strategy:h}=o,d=f.useRef(e),p=x(),v=dt(p),m=f.useCallback(function(S){S===void 0&&(S=[]),!v.current&&a(C=>C===null?S:C.concat(S.filter(b=>!C.includes(b))))},[v]),_=f.useRef(null),g=gt(S=>{if(p&&!n)return Rn;if(!S||S===Rn||d.current!==e||r!=null){const C=new Map;for(let b of e){if(!b)continue;if(r&&r.length>0&&!r.includes(b.id)&&b.rect.current){C.set(b.id,b.rect.current);continue}const A=b.node.current,k=A?new xn(u(A),A):null;b.rect.current=k,k&&C.set(b.id,k)}return C}return S},[e,r,n,p,u]);return f.useEffect(()=>{d.current=e},[e]),f.useEffect(()=>{p||m()},[n,p]),f.useEffect(()=>{r&&r.length>0&&a(null)},[JSON.stringify(r)]),f.useEffect(()=>{p||typeof c!="number"||_.current!==null||(_.current=setTimeout(()=>{m(),_.current=null},c))},[c,p,m,...s]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:r!=null};function x(){switch(h){case ht.Always:return!1;case ht.BeforeDragging:return n;default:return!n}}}function hs(e,t){return gt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function $o(e,t){return hs(e,t)}function Fo(e){let{callback:t,disabled:n}=e;const s=mn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:r}=window;return new r(s)},[s,n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Pt(e){let{callback:t,disabled:n}=e;const s=mn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:r}=window;return new r(s)},[n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function zo(e){return new xn(Je(e),e)}function Pn(e,t,n){t===void 0&&(t=zo);const[s,o]=f.useState(null);function r(){o(u=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=u??n)!=null?h:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const a=Fo({callback(u){if(e)for(const h of u){const{type:d,target:p}=h;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){r();break}}}}),c=Pt({callback:r});return be(()=>{r(),e?(c==null||c.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),a==null||a.disconnect())},[e]),s}function Ho(e){const t=hs(e);return ss(e,t)}const On=[];function Wo(e){const t=f.useRef(e),n=gt(s=>e?s&&s!==On&&e&&t.current&&e.parentNode===t.current.parentNode?s:bn(e):On,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function Uo(e){const[t,n]=f.useState(null),s=f.useRef(e),o=f.useCallback(r=>{const a=Ht(r.target);a&&n(c=>c?(c.set(a,en(a)),new Map(c)):null)},[]);return f.useEffect(()=>{const r=s.current;if(e!==r){a(r);const c=e.map(u=>{const h=Ht(u);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,en(h)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),s.current=e}return()=>{a(e),a(r)};function a(c){c.forEach(u=>{const h=Ht(u);h==null||h.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((r,a)=>Ge(r,a),ue):ls(e):ue,[e,t])}function Ln(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==ue;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Nt(e,n.current):ue}function Vo(e){f.useEffect(()=>{if(!Mt)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Ko(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:o,handler:r}=s;return n[o]=a=>{r(a,t)},n},{}),[e,t])}function fs(e){return f.useMemo(()=>e?mo(e):null,[e])}const $n=[];function Go(e,t){t===void 0&&(t=Je);const[n]=e,s=fs(n?J(n):null),[o,r]=f.useState($n);function a(){r(()=>e.length?e.map(u=>as(u)?s:new xn(t(u),u)):$n)}const c=Pt({callback:a});return be(()=>{c==null||c.disconnect(),a(),e.forEach(u=>c==null?void 0:c.observe(u))},[e]),o}function Yo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ft(t)?t:e}function Xo(e){let{measure:t}=e;const[n,s]=f.useState(null),o=f.useCallback(h=>{for(const{target:d}of h)if(ft(d)){s(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),r=Pt({callback:o}),a=f.useCallback(h=>{const d=Yo(h);r==null||r.disconnect(),d&&(r==null||r.observe(d)),s(d?t(d):null)},[t,r]),[c,u]=At(a);return f.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const qo=[{sensor:Rt,options:{}},{sensor:ds,options:{}}],Jo={current:{}},jt={draggable:{measure:En},droppable:{measure:En,strategy:ht.WhileDragging,frequency:nn.Optimized},dragOverlay:{measure:Je}};class ut 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,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const Qo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ut,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:It},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jt,measureDroppableContainers:It,windowRect:null,measuringScheduled:!1},Zo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:It,draggableNodes:new Map,over:null,measureDroppableContainers:It},Ot=f.createContext(Zo),gs=f.createContext(Qo);function er(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ut}}}function tr(e,t){switch(t.type){case W.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case W.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 W.DragEnd:case W.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case W.RegisterDroppable:{const{element:n}=t,{id:s}=n,o=new ut(e.droppable.containers);return o.set(s,n),{...e,droppable:{...e.droppable,containers:o}}}case W.SetDroppableDisabled:{const{id:n,key:s,disabled:o}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const a=new ut(e.droppable.containers);return a.set(n,{...r,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case W.UnregisterDroppable:{const{id:n,key:s}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const r=new ut(e.droppable.containers);return r.delete(n),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function nr(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=f.useContext(Ot),r=Qt(s),a=Qt(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&r&&a!=null){if(!vn(r)||document.activeElement===r.target)return;const c=o.get(a);if(!c)return;const{activatorNode:u,node:h}=c;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const d of[u.current,h.current]){if(!d)continue;const p=Xs(d);if(p){p.focus();break}}})}},[s,t,o,a,r]),null}function sr(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,r)=>r({transform:o,...s}),n):n}function or(e){return f.useMemo(()=>({draggable:{...jt.draggable,...e==null?void 0:e.draggable},droppable:{...jt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...jt.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 rr(e){let{activeNode:t,measure:n,initialRect:s,config:o=!0}=e;const r=f.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!a&&!c||!t){r.current=!1;return}if(r.current||!s)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const d=n(h),p=ss(d,s);if(a||(p.x=0),c||(p.y=0),r.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=os(h);v&&v.scrollBy({top:p.y,left:p.x})}},[t,a,c,s,n])}const ps=f.createContext({...ue,scaleX:1,scaleY:1});var Te;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Te||(Te={}));const ms=f.memo(function(t){var n,s,o,r;let{id:a,accessibility:c,autoScroll:u=!0,children:h,sensors:d=qo,collisionDetection:p=co,measuring:v,modifiers:m,..._}=t;const g=f.useReducer(tr,void 0,er),[x,S]=g,[C,b]=to(),[A,k]=f.useState(Te.Uninitialized),w=A===Te.Initialized,{draggable:{active:y,nodes:N,translate:M},droppable:{containers:$}}=x,R=y!=null?N.get(y):null,D=f.useRef({initial:null,translated:null}),P=f.useMemo(()=>{var G;return y!=null?{id:y,data:(G=R==null?void 0:R.data)!=null?G:Jo,rect:D}:null},[y,R]),T=f.useRef(null),[z,X]=f.useState(null),[E,H]=f.useState(null),re=dt(_,Object.values(_)),we=pt("DndDescribedBy",a),Le=f.useMemo(()=>$.getEnabled(),[$]),K=or(v),{droppableRects:ie,measureDroppableContainers:de,measuringScheduled:Re}=Lo(Le,{dragging:w,dependencies:[M.x,M.y],config:K.droppable}),L=Po(N,y),$e=f.useMemo(()=>E?Zt(E):null,[E]),ke=Ws(),xe=$o(L,K.draggable.measure);rr({activeNode:y!=null?N.get(y):null,config:ke.layoutShiftCompensation,initialRect:xe,measure:K.draggable.measure});const F=Pn(L,K.draggable.measure,xe),Qe=Pn(L?L.parentElement:null),he=f.useRef({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=$.getNodeFor((n=he.current.over)==null?void 0:n.id),Se=Xo({measure:K.dragOverlay.measure}),ze=(s=Se.nodeRef.current)!=null?s:L,He=w?(o=Se.rect)!=null?o:F:null,_n=!!(Se.nodeRef.current&&Se.rect),Cn=Ho(_n?null:F),Lt=fs(ze?J(ze):null),je=Wo(w?Fe??L:null),vt=Go(je),bt=sr(m,{transform:{x:M.x-Cn.x,y:M.y-Cn.y,scaleX:1,scaleY:1},activatorEvent:E,active:P,activeNodeRect:F,containerNodeRect:Qe,draggingNodeRect:He,over:he.current.over,overlayNodeRect:Se.rect,scrollableAncestors:je,scrollableAncestorRects:vt,windowRect:Lt}),wn=$e?Ge($e,M):null,kn=Uo(je),Ps=Ln(kn),Os=Ln(kn,[F]),We=Ge(bt,Ps),Ue=He?ho(He,bt):null,Ze=P&&Ue?p({active:P,collisionRect:Ue,droppableRects:ie,droppableContainers:Le,pointerCoordinates:wn}):null,jn=io(Ze,"id"),[Ae,An]=f.useState(null),Ls=_n?bt:Ge(bt,Os),$s=lo(Ls,(r=Ae==null?void 0:Ae.rect)!=null?r:null,F),$t=f.useRef(null),Nn=f.useCallback((G,Q)=>{let{sensor:Z,options:Ne}=Q;if(T.current==null)return;const ne=N.get(T.current);if(!ne)return;const ee=G.nativeEvent,fe=new Z({active:T.current,activeNode:ne,event:ee,options:Ne,context:he,onAbort(V){if(!N.get(V))return;const{onDragAbort:ge}=re.current,ye={id:V};ge==null||ge(ye),C({type:"onDragAbort",event:ye})},onPending(V,Ie,ge,ye){if(!N.get(V))return;const{onDragPending:tt}=re.current,Be={id:V,constraint:Ie,initialCoordinates:ge,offset:ye};tt==null||tt(Be),C({type:"onDragPending",event:Be})},onStart(V){const Ie=T.current;if(Ie==null)return;const ge=N.get(Ie);if(!ge)return;const{onDragStart:ye}=re.current,et={activatorEvent:ee,active:{id:Ie,data:ge.data,rect:D}};at.unstable_batchedUpdates(()=>{ye==null||ye(et),k(Te.Initializing),S({type:W.DragStart,initialCoordinates:V,active:Ie}),C({type:"onDragStart",event:et}),X($t.current),H(ee)})},onMove(V){S({type:W.DragMove,coordinates:V})},onEnd:Ve(W.DragEnd),onCancel:Ve(W.DragCancel)});$t.current=fe;function Ve(V){return async function(){const{active:ge,collisions:ye,over:et,scrollAdjustedTranslate:tt}=he.current;let Be=null;if(ge&&tt){const{cancelDrop:nt}=re.current;Be={activatorEvent:ee,active:ge,collisions:ye,delta:tt,over:et},V===W.DragEnd&&typeof nt=="function"&&await Promise.resolve(nt(Be))&&(V=W.DragCancel)}T.current=null,at.unstable_batchedUpdates(()=>{S({type:V}),k(Te.Uninitialized),An(null),X(null),H(null),$t.current=null;const nt=V===W.DragEnd?"onDragEnd":"onDragCancel";if(Be){const Ft=re.current[nt];Ft==null||Ft(Be),C({type:nt,event:Be})}})}}},[N]),Fs=f.useCallback((G,Q)=>(Z,Ne)=>{const ne=Z.nativeEvent,ee=N.get(Ne);if(T.current!==null||!ee||ne.dndKit||ne.defaultPrevented)return;const fe={active:ee};G(Z,Q.options,fe)===!0&&(ne.dndKit={capturedBy:Q.sensor},T.current=Ne,Nn(Z,Q))},[N,Nn]),In=Oo(d,Fs);Vo(d),be(()=>{F&&A===Te.Initializing&&k(Te.Initialized)},[F,A]),f.useEffect(()=>{const{onDragMove:G}=re.current,{active:Q,activatorEvent:Z,collisions:Ne,over:ne}=he.current;if(!Q||!Z)return;const ee={active:Q,activatorEvent:Z,collisions:Ne,delta:{x:We.x,y:We.y},over:ne};at.unstable_batchedUpdates(()=>{G==null||G(ee),C({type:"onDragMove",event:ee})})},[We.x,We.y]),f.useEffect(()=>{const{active:G,activatorEvent:Q,collisions:Z,droppableContainers:Ne,scrollAdjustedTranslate:ne}=he.current;if(!G||T.current==null||!Q||!ne)return;const{onDragOver:ee}=re.current,fe=Ne.get(jn),Ve=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,V={active:G,activatorEvent:Q,collisions:Z,delta:{x:ne.x,y:ne.y},over:Ve};at.unstable_batchedUpdates(()=>{An(Ve),ee==null||ee(V),C({type:"onDragOver",event:V})})},[jn]),be(()=>{he.current={activatorEvent:E,active:P,activeNode:L,collisionRect:Ue,collisions:Ze,droppableRects:ie,draggableNodes:N,draggingNode:ze,draggingNodeRect:He,droppableContainers:$,over:Ae,scrollableAncestors:je,scrollAdjustedTranslate:We},D.current={initial:He,translated:Ue}},[P,L,Ze,Ue,N,ze,He,ie,$,Ae,je,We]),To({...ke,delta:M,draggingRect:Ue,pointerCoordinates:wn,scrollableAncestors:je,scrollableAncestorRects:vt});const zs=f.useMemo(()=>({active:P,activeNode:L,activeNodeRect:F,activatorEvent:E,collisions:Ze,containerNodeRect:Qe,dragOverlay:Se,draggableNodes:N,droppableContainers:$,droppableRects:ie,over:Ae,measureDroppableContainers:de,scrollableAncestors:je,scrollableAncestorRects:vt,measuringConfiguration:K,measuringScheduled:Re,windowRect:Lt}),[P,L,F,E,Ze,Qe,Se,N,$,ie,Ae,de,je,vt,K,Re,Lt]),Hs=f.useMemo(()=>({activatorEvent:E,activators:In,active:P,activeNodeRect:F,ariaDescribedById:{draggable:we},dispatch:S,draggableNodes:N,over:Ae,measureDroppableContainers:de}),[E,In,P,F,S,we,N,Ae,de]);return f.createElement(es.Provider,{value:b},f.createElement(Ot.Provider,{value:Hs},f.createElement(gs.Provider,{value:zs},f.createElement(ps.Provider,{value:$s},h)),f.createElement(nr,{disabled:(c==null?void 0:c.restoreFocus)===!1})),f.createElement(oo,{...c,hiddenTextDescribedById:we}));function Ws(){const G=(z==null?void 0:z.autoScrollEnabled)===!1,Q=typeof u=="object"?u.enabled===!1:u===!1,Z=w&&!G&&!Q;return typeof u=="object"?{...u,enabled:Z}:{enabled:Z}}}),ir=f.createContext(null),Fn="button",ar="Draggable";function cr(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const r=pt(ar),{activators:a,activatorEvent:c,active:u,activeNodeRect:h,ariaDescribedById:d,draggableNodes:p,over:v}=f.useContext(Ot),{role:m=Fn,roleDescription:_="draggable",tabIndex:g=0}=o??{},x=(u==null?void 0:u.id)===t,S=f.useContext(x?ps:ir),[C,b]=At(),[A,k]=At(),w=Ko(a,t),y=dt(n);be(()=>(p.set(t,{id:t,key:r,node:C,activatorNode:A,data:y}),()=>{const M=p.get(t);M&&M.key===r&&p.delete(t)}),[p,t]);const N=f.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":s,"aria-pressed":x&&m===Fn?!0:void 0,"aria-roledescription":_,"aria-describedby":d.draggable}),[s,m,g,x,_,d.draggable]);return{active:u,activatorEvent:c,activeNodeRect:h,attributes:N,isDragging:x,listeners:s?void 0:w,node:C,over:v,setNodeRef:b,setActivatorNodeRef:k,transform:S}}function lr(){return f.useContext(gs)}const ur="Droppable",dr={timeout:25};function hr(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:o}=e;const r=pt(ur),{active:a,dispatch:c,over:u,measureDroppableContainers:h}=f.useContext(Ot),d=f.useRef({disabled:n}),p=f.useRef(!1),v=f.useRef(null),m=f.useRef(null),{disabled:_,updateMeasurementsFor:g,timeout:x}={...dr,...o},S=dt(g??s),C=f.useCallback(()=>{if(!p.current){p.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{h(Array.isArray(S.current)?S.current:[S.current]),m.current=null},x)},[x]),b=Pt({callback:C,disabled:_||!a}),A=f.useCallback((N,M)=>{b&&(M&&(b.unobserve(M),p.current=!1),N&&b.observe(N))},[b]),[k,w]=At(A),y=dt(t);return f.useEffect(()=>{!b||!k.current||(b.disconnect(),p.current=!1,b.observe(k.current))},[k,b]),f.useEffect(()=>(c({type:W.RegisterDroppable,element:{id:s,key:r,disabled:n,node:k,rect:v,data:y}}),()=>c({type:W.UnregisterDroppable,key:r,id:s})),[s]),f.useEffect(()=>{n!==d.current.disabled&&(c({type:W.SetDroppableDisabled,id:s,key:r,disabled:n}),d.current.disabled=n)},[s,r,n,c]),{active:a,rect:v,isOver:(u==null?void 0:u.id)===s,node:k,over:u,setNodeRef:w}}function vs(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function fr(e,t){return e.reduce((n,s,o)=>{const r=t.get(s);return r&&(n[o]=r),n},Array(e.length))}function xt(e){return e!==null&&e>=0}function gr(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 pr(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const bs=e=>{let{rects:t,activeIndex:n,overIndex:s,index:o}=e;const r=vs(t,s,n),a=t[o],c=r[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},St={scaleX:1,scaleY:1},xs=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:o,rects:r,overIndex:a}=e;const c=(t=r[n])!=null?t:s;if(!c)return null;if(o===n){const h=r[a];return h?{x:0,y:n<a?h.top+h.height-(c.top+c.height):h.top-c.top,...St}:null}const u=mr(r,o,n);return o>n&&o<=a?{x:0,y:-c.height-u,...St}:o<n&&o>=a?{x:0,y:c.height+u,...St}:{x:0,y:0,...St}};function mr(e,t,n){const s=e[t],o=e[t-1],r=e[t+1];return s?n<t?o?s.top-(o.top+o.height):r?r.top-(s.top+s.height):0:r?r.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const Ss="Sortable",ys=f.createContext({activeIndex:-1,containerId:Ss,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bs,disabled:{draggable:!1,droppable:!1}});function _s(e){let{children:t,id:n,items:s,strategy:o=bs,disabled:r=!1}=e;const{active:a,dragOverlay:c,droppableRects:u,over:h,measureDroppableContainers:d}=lr(),p=pt(Ss,n),v=c.rect!==null,m=f.useMemo(()=>s.map(w=>typeof w=="object"&&"id"in w?w.id:w),[s]),_=a!=null,g=a?m.indexOf(a.id):-1,x=h?m.indexOf(h.id):-1,S=f.useRef(m),C=!gr(m,S.current),b=x!==-1&&g===-1||C,A=pr(r);be(()=>{C&&_&&d(m)},[C,m,_,d]),f.useEffect(()=>{S.current=m},[m]);const k=f.useMemo(()=>({activeIndex:g,containerId:p,disabled:A,disableTransforms:b,items:m,overIndex:x,useDragOverlay:v,sortedRects:fr(m,u),strategy:o}),[g,p,A.draggable,A.droppable,b,m,x,u,v,o]);return f.createElement(ys.Provider,{value:k},t)}const vr=e=>{let{id:t,items:n,activeIndex:s,overIndex:o}=e;return vs(n,s,o).indexOf(t)},br=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:o,items:r,newIndex:a,previousItems:c,previousContainerId:u,transition:h}=e;return!h||!s||c!==r&&o===a?!1:n?!0:a!==o&&t===u},xr={duration:200,easing:"ease"},Cs="transform",Sr=Ye.Transition.toString({property:Cs,duration:0,easing:"linear"}),yr={roleDescription:"sortable"};function _r(e){let{disabled:t,index:n,node:s,rect:o}=e;const[r,a]=f.useState(null),c=f.useRef(n);return be(()=>{if(!t&&n!==c.current&&s.current){const u=o.current;if(u){const h=Je(s.current,{ignoreTransform:!0}),d={x:u.left-h.left,y:u.top-h.top,scaleX:u.width/h.width,scaleY:u.height/h.height};(d.x||d.y)&&a(d)}}n!==c.current&&(c.current=n)},[t,n,s,o]),f.useEffect(()=>{r&&a(null)},[r]),r}function ws(e){let{animateLayoutChanges:t=br,attributes:n,disabled:s,data:o,getNewIndex:r=vr,id:a,strategy:c,resizeObserverConfig:u,transition:h=xr}=e;const{items:d,containerId:p,activeIndex:v,disabled:m,disableTransforms:_,sortedRects:g,overIndex:x,useDragOverlay:S,strategy:C}=f.useContext(ys),b=Cr(s,m),A=d.indexOf(a),k=f.useMemo(()=>({sortable:{containerId:p,index:A,items:d},...o}),[p,o,A,d]),w=f.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:y,node:N,isOver:M,setNodeRef:$}=hr({id:a,data:k,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...u}}),{active:R,activatorEvent:D,activeNodeRect:P,attributes:T,setNodeRef:z,listeners:X,isDragging:E,over:H,setActivatorNodeRef:re,transform:we}=cr({id:a,data:k,attributes:{...yr,...n},disabled:b.draggable}),Le=Vs($,z),K=!!R,ie=K&&!_&&xt(v)&&xt(x),de=!S&&E,Re=de&&ie?we:null,$e=ie?Re??(c??C)({rects:g,activeNodeRect:P,activeIndex:v,overIndex:x,index:A}):null,ke=xt(v)&&xt(x)?r({id:a,items:d,activeIndex:v,overIndex:x}):A,xe=R==null?void 0:R.id,F=f.useRef({activeId:xe,items:d,newIndex:ke,containerId:p}),Qe=d!==F.current.items,he=t({active:R,containerId:p,isDragging:E,isSorting:K,id:a,index:A,items:d,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:h,wasDragging:F.current.activeId!=null}),Fe=_r({disabled:!he,index:A,node:N,rect:y});return f.useEffect(()=>{K&&F.current.newIndex!==ke&&(F.current.newIndex=ke),p!==F.current.containerId&&(F.current.containerId=p),d!==F.current.items&&(F.current.items=d)},[K,ke,p,d]),f.useEffect(()=>{if(xe===F.current.activeId)return;if(xe!=null&&F.current.activeId==null){F.current.activeId=xe;return}const ze=setTimeout(()=>{F.current.activeId=xe},50);return()=>clearTimeout(ze)},[xe]),{active:R,activeIndex:v,attributes:T,data:k,rect:y,index:A,newIndex:ke,items:d,isOver:M,isSorting:K,isDragging:E,listeners:X,node:N,overIndex:x,over:H,setNodeRef:Le,setActivatorNodeRef:re,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Fe??$e,transition:Se()};function Se(){if(Fe||Qe&&F.current.newIndex===A)return Sr;if(!(de&&!vn(D)||!h)&&(K||he))return Ye.Transition.toString({...h,property:Cs})}}function Cr(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}O.Down,O.Right,O.Up,O.Left;function Ce(e){return Array.isArray?Array.isArray(e):As(e)==="[object Array]"}function wr(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function kr(e){return e==null?"":wr(e)}function ve(e){return typeof e=="string"}function ks(e){return typeof e=="number"}function jr(e){return e===!0||e===!1||Ar(e)&&As(e)=="[object Boolean]"}function js(e){return typeof e=="object"}function Ar(e){return js(e)&&e!==null}function te(e){return e!=null}function Vt(e){return!e.trim().length}function As(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Nr="Incorrect 'index' type",Ir=e=>`Invalid value for key ${e}`,Br=e=>`Pattern length exceeds max of ${e}.`,Er=e=>`Missing ${e} property in key`,Dr=e=>`Property 'weight' in key '${e}' must be a positive integer`,zn=Object.prototype.hasOwnProperty;class Tr{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(s=>{let o=Ns(s);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(s=>{s.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ns(e){let t=null,n=null,s=null,o=1,r=null;if(ve(e)||Ce(e))s=e,t=Hn(e),n=sn(e);else{if(!zn.call(e,"name"))throw new Error(Er("name"));const a=e.name;if(s=a,zn.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(Dr(a));t=Hn(a),n=sn(a),r=e.getFn}return{path:t,id:n,weight:o,src:s,getFn:r}}function Hn(e){return Ce(e)?e:e.split(".")}function sn(e){return Ce(e)?e.join("."):e}function Mr(e,t){let n=[],s=!1;const o=(r,a,c)=>{if(te(r))if(!a[c])n.push(r);else{let u=a[c];const h=r[u];if(!te(h))return;if(c===a.length-1&&(ve(h)||ks(h)||jr(h)))n.push(kr(h));else if(Ce(h)){s=!0;for(let d=0,p=h.length;d<p;d+=1)o(h[d],a,c+1)}else a.length&&o(h,a,c+1)}};return o(e,ve(t)?t.split("."):t,0),s?n:n[0]}const Rr={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Pr={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Or={location:0,threshold:.6,distance:100},Lr={useExtendedSearch:!1,getFn:Mr,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var B={...Pr,...Rr,...Or,...Lr};const $r=/[^ ]+/g;function Fr(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(o){const r=o.match($r).length;if(n.has(r))return n.get(r);const a=1/Math.pow(r,.5*e),c=parseFloat(Math.round(a*s)/s);return n.set(r,c),c},clear(){n.clear()}}}class yn{constructor({getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){this.norm=Fr(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,s)=>{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ve(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();ve(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,s=this.size();n<s;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!te(t)||Vt(t))return;let s={v:t,i:n,n:this.norm.get(t)};this.records.push(s)}_addObject(t,n){let s={i:n,$:{}};this.keys.forEach((o,r)=>{let a=o.getFn?o.getFn(t):this.getFn(t,o.path);if(te(a)){if(Ce(a)){let c=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:h,value:d}=u.pop();if(te(d))if(ve(d)&&!Vt(d)){let p={v:d,i:h,n:this.norm.get(d)};c.push(p)}else Ce(d)&&d.forEach((p,v)=>{u.push({nestedArrIndex:v,value:p})})}s.$[r]=c}else if(ve(a)&&!Vt(a)){let c={v:a,n:this.norm.get(a)};s.$[r]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function Is(e,t,{getFn:n=B.getFn,fieldNormWeight:s=B.fieldNormWeight}={}){const o=new yn({getFn:n,fieldNormWeight:s});return o.setKeys(e.map(Ns)),o.setSources(t),o.create(),o}function zr(e,{getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){const{keys:s,records:o}=e,r=new yn({getFn:t,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(o),r}function yt(e,{errors:t=0,currentLocation:n=0,expectedLocation:s=0,distance:o=B.distance,ignoreLocation:r=B.ignoreLocation}={}){const a=t/e.length;if(r)return a;const c=Math.abs(s-n);return o?a+c/o:c?1:a}function Hr(e=[],t=B.minMatchCharLength){let n=[],s=-1,o=-1,r=0;for(let a=e.length;r<a;r+=1){let c=e[r];c&&s===-1?s=r:!c&&s!==-1&&(o=r-1,o-s+1>=t&&n.push([s,o]),s=-1)}return e[r-1]&&r-s>=t&&n.push([s,r-1]),n}const Pe=32;function Wr(e,t,n,{location:s=B.location,distance:o=B.distance,threshold:r=B.threshold,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,includeMatches:u=B.includeMatches,ignoreLocation:h=B.ignoreLocation}={}){if(t.length>Pe)throw new Error(Br(Pe));const d=t.length,p=e.length,v=Math.max(0,Math.min(s,p));let m=r,_=v;const g=c>1||u,x=g?Array(p):[];let S;for(;(S=e.indexOf(t,_))>-1;){let y=yt(t,{currentLocation:S,expectedLocation:v,distance:o,ignoreLocation:h});if(m=Math.min(y,m),_=S+d,g){let N=0;for(;N<d;)x[S+N]=1,N+=1}}_=-1;let C=[],b=1,A=d+p;const k=1<<d-1;for(let y=0;y<d;y+=1){let N=0,M=A;for(;N<M;)yt(t,{errors:y,currentLocation:v+M,expectedLocation:v,distance:o,ignoreLocation:h})<=m?N=M:A=M,M=Math.floor((A-N)/2+N);A=M;let $=Math.max(1,v-M+1),R=a?p:Math.min(v+M,p)+d,D=Array(R+2);D[R+1]=(1<<y)-1;for(let T=R;T>=$;T-=1){let z=T-1,X=n[e.charAt(z)];if(g&&(x[z]=+!!X),D[T]=(D[T+1]<<1|1)&X,y&&(D[T]|=(C[T+1]|C[T])<<1|1|C[T+1]),D[T]&k&&(b=yt(t,{errors:y,currentLocation:z,expectedLocation:v,distance:o,ignoreLocation:h}),b<=m)){if(m=b,_=z,_<=v)break;$=Math.max(1,2*v-_)}}if(yt(t,{errors:y+1,currentLocation:v,expectedLocation:v,distance:o,ignoreLocation:h})>m)break;C=D}const w={isMatch:_>=0,score:Math.max(.001,b)};if(g){const y=Hr(x,c);y.length?u&&(w.indices=y):w.isMatch=!1}return w}function Ur(e){let t={};for(let n=0,s=e.length;n<s;n+=1){const o=e.charAt(n);t[o]=(t[o]||0)|1<<s-n-1}return t}const Et=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Bs{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d},t=u?t:t.toLowerCase(),t=h?Et(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(m,_)=>{this.chunks.push({pattern:m,alphabet:Ur(m),startIndex:_})},v=this.pattern.length;if(v>Pe){let m=0;const _=v%Pe,g=v-_;for(;m<g;)p(this.pattern.substr(m,Pe),m),m+=Pe;if(_){const x=v-Pe;p(this.pattern.substr(x),x)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o}=this.options;if(t=n?t:t.toLowerCase(),t=s?Et(t):t,this.pattern===t){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,t.length-1]]),g}const{location:r,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,ignoreLocation:d}=this.options;let p=[],v=0,m=!1;this.chunks.forEach(({pattern:g,alphabet:x,startIndex:S})=>{const{isMatch:C,score:b,indices:A}=Wr(t,g,x,{location:r+S,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,includeMatches:o,ignoreLocation:d});C&&(m=!0),v+=b,C&&A&&(p=[...p,...A])});let _={isMatch:m,score:m?v/this.chunks.length:1};return m&&o&&(_.indices=p),_}}class Me{constructor(t){this.pattern=t}static isMultiMatch(t){return Wn(t,this.multiRegex)}static isSingleMatch(t){return Wn(t,this.singleRegex)}search(){}}function Wn(e,t){const n=e.match(t);return n?n[1]:null}class Vr extends Me{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Kr extends Me{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Gr extends Me{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Yr extends Me{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Xr extends Me{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class qr extends Me{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Es extends Me{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){super(t),this._bitapSearch=new Bs(t,{location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Ds extends Me{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,s;const o=[],r=this.pattern.length;for(;(s=t.indexOf(this.pattern,n))>-1;)n=s+r,o.push([s,n-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const on=[Vr,Ds,Gr,Yr,qr,Xr,Kr,Es],Un=on.length,Jr=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Qr="|";function Zr(e,t={}){return e.split(Qr).map(n=>{let s=n.trim().split(Jr).filter(r=>r&&!!r.trim()),o=[];for(let r=0,a=s.length;r<a;r+=1){const c=s[r];let u=!1,h=-1;for(;!u&&++h<Un;){const d=on[h];let p=d.isMultiMatch(c);p&&(o.push(new d(p,t)),u=!0)}if(!u)for(h=-1;++h<Un;){const d=on[h];let p=d.isSingleMatch(c);if(p){o.push(new d(p,t));break}}}return o})}const ei=new Set([Es.type,Ds.type]);class ti{constructor(t,{isCaseSensitive:n=B.isCaseSensitive,ignoreDiacritics:s=B.ignoreDiacritics,includeMatches:o=B.includeMatches,minMatchCharLength:r=B.minMatchCharLength,ignoreLocation:a=B.ignoreLocation,findAllMatches:c=B.findAllMatches,location:u=B.location,threshold:h=B.threshold,distance:d=B.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o,minMatchCharLength:r,findAllMatches:c,ignoreLocation:a,location:u,threshold:h,distance:d},t=n?t:t.toLowerCase(),t=s?Et(t):t,this.pattern=t,this.query=Zr(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:o,ignoreDiacritics:r}=this.options;t=o?t:t.toLowerCase(),t=r?Et(t):t;let a=0,c=[],u=0;for(let h=0,d=n.length;h<d;h+=1){const p=n[h];c.length=0,a=0;for(let v=0,m=p.length;v<m;v+=1){const _=p[v],{isMatch:g,indices:x,score:S}=_.search(t);if(g){if(a+=1,u+=S,s){const C=_.constructor.type;ei.has(C)?c=[...c,...x]:c.push(x)}}else{u=0,a=0,c.length=0;break}}if(a){let v={isMatch:!0,score:u/a};return s&&(v.indices=c),v}}return{isMatch:!1,score:1}}}const rn=[];function ni(...e){rn.push(...e)}function an(e,t){for(let n=0,s=rn.length;n<s;n+=1){let o=rn[n];if(o.condition(e,t))return new o(e,t)}return new Bs(e,t)}const Dt={AND:"$and",OR:"$or"},cn={PATH:"$path",PATTERN:"$val"},ln=e=>!!(e[Dt.AND]||e[Dt.OR]),si=e=>!!e[cn.PATH],oi=e=>!Ce(e)&&js(e)&&!ln(e),Vn=e=>({[Dt.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ts(e,t,{auto:n=!0}={}){const s=o=>{let r=Object.keys(o);const a=si(o);if(!a&&r.length>1&&!ln(o))return s(Vn(o));if(oi(o)){const u=a?o[cn.PATH]:r[0],h=a?o[cn.PATTERN]:o[u];if(!ve(h))throw new Error(Ir(u));const d={keyId:sn(u),pattern:h};return n&&(d.searcher=an(h,t)),d}let c={children:[],operator:r[0]};return r.forEach(u=>{const h=o[u];Ce(h)&&h.forEach(d=>{c.children.push(s(d))})}),c};return ln(e)||(e=Vn(e)),s(e)}function ri(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){e.forEach(n=>{let s=1;n.matches.forEach(({key:o,norm:r,score:a})=>{const c=o?o.weight:null;s*=Math.pow(a===0&&c?Number.EPSILON:a,(c||1)*(t?1:r))}),n.score=s})}function ii(e,t){const n=e.matches;t.matches=[],te(n)&&n.forEach(s=>{if(!te(s.indices)||!s.indices.length)return;const{indices:o,value:r}=s;let a={indices:o,value:r};s.key&&(a.key=s.key.src),s.idx>-1&&(a.refIndex=s.idx),t.matches.push(a)})}function ai(e,t){t.score=e.score}function ci(e,t,{includeMatches:n=B.includeMatches,includeScore:s=B.includeScore}={}){const o=[];return n&&o.push(ii),s&&o.push(ai),e.map(r=>{const{idx:a}=r,c={item:t[a],refIndex:a};return o.length&&o.forEach(u=>{u(r,c)}),c})}class Oe{constructor(t,n={},s){this.options={...B,...n},this.options.useExtendedSearch,this._keyStore=new Tr(this.options.keys),this.setCollection(t,s)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof yn))throw new Error(Nr);this._myIndex=n||Is(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){te(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let s=0,o=this._docs.length;s<o;s+=1){const r=this._docs[s];t(r,s)&&(this.removeAt(s),s-=1,o-=1,n.push(r))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:s,includeScore:o,shouldSort:r,sortFn:a,ignoreFieldNorm:c}=this.options;let u=ve(t)?ve(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return ri(u,{ignoreFieldNorm:c}),r&&u.sort(a),ks(n)&&n>-1&&(u=u.slice(0,n)),ci(u,this._docs,{includeMatches:s,includeScore:o})}_searchStringList(t){const n=an(t,this.options),{records:s}=this._myIndex,o=[];return s.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=n.searchIn(r);u&&o.push({item:r,idx:a,matches:[{score:h,value:r,norm:c,indices:d}]})}),o}_searchLogical(t){const n=Ts(t,this.options),s=(c,u,h)=>{if(!c.children){const{keyId:p,searcher:v}=c,m=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:v});return m&&m.length?[{idx:h,item:u,matches:m}]:[]}const d=[];for(let p=0,v=c.children.length;p<v;p+=1){const m=c.children[p],_=s(m,u,h);if(_.length)d.push(..._);else if(c.operator===Dt.AND)return[]}return d},o=this._myIndex.records,r={},a=[];return o.forEach(({$:c,i:u})=>{if(te(c)){let h=s(n,c,u);h.length&&(r[u]||(r[u]={idx:u,item:c,matches:[]},a.push(r[u])),h.forEach(({matches:d})=>{r[u].matches.push(...d)}))}}),a}_searchObjectList(t){const n=an(t,this.options),{keys:s,records:o}=this._myIndex,r=[];return o.forEach(({$:a,i:c})=>{if(!te(a))return;let u=[];s.forEach((h,d)=>{u.push(...this._findMatches({key:h,value:a[d],searcher:n}))}),u.length&&r.push({idx:c,item:a,matches:u})}),r}_findMatches({key:t,value:n,searcher:s}){if(!te(n))return[];let o=[];if(Ce(n))n.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=s.searchIn(r);u&&o.push({score:h,key:t,value:r,idx:a,norm:c,indices:d})});else{const{v:r,n:a}=n,{isMatch:c,score:u,indices:h}=s.searchIn(r);c&&o.push({score:u,key:t,value:r,norm:a,indices:h})}return o}}Oe.version="7.1.0";Oe.createIndex=Is;Oe.parseIndex=zr;Oe.config=B;Oe.parseQuery=Ts;ni(ti);const li="_header_17vny_1",ui="_left_17vny_14",di="_right_17vny_15",_t={header:li,left:ui,right:di},hi="_buttons_12xlr_1",fi="_button_12xlr_1",gi="_disabled_12xlr_20",st={buttons:hi,button:fi,disabled:gi},pi=()=>{const{undo:e,redo:t,past:n,future:s}=l.useHistoryStore(),[o,r]=f.useState(!1),[a,c]=f.useState(!1),[u,h]=f.useState(!1),[d,p]=f.useState(!1),[v,m]=f.useState(null),{notifications:_,setNotifications:g}=l.useNotificationStore();return f.useEffect(()=>{r(n.length===0)},[n]),f.useEffect(()=>{c(s.length===0)},[s]),i.jsxs("div",{className:st.buttons,children:[i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:o}),onMouseEnter:()=>{const x=setTimeout(()=>{p(!0),h(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),p(!1),h(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([..._,{id:l.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),d&&i.jsx(l.Tooltip,{text:o?"Nothing to undo":"Click to undo changes"})]}),i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:a}),onMouseEnter:()=>{const x=setTimeout(()=>{h(!0),p(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),h(!1),p(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(t(),g([..._,{id:l.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),u&&i.jsx(l.Tooltip,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},mi="_devices_vftsw_1",vi="_device_vftsw_1",bi="_active_vftsw_27",un={devices:mi,device:vi,active:bi},xi=()=>i.jsx("div",{className:un.devices,children:l.devices.map(e=>i.jsx(Si,{device:e}))}),Si=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:s}=l.useDeviceStore(),[o,r]=f.useState(!1),[a,c]=f.useState(null);return i.jsxs("div",{className:l.clx(un.device,{[un.active]:n.value===t.value}),onClick:()=>s(t),onMouseEnter:()=>{const u=setTimeout(()=>{r(!0)},200);c(u)},onMouseLeave:()=>{a&&clearTimeout(a),r(!1)},children:[i.jsx(j.Icon,{name:t.icon,fill:n.value===t.value?"var(--builder-text-primary)":"var(--builder-text-secondary)",width:20,height:20}),o&&i.jsx(l.Tooltip,{text:`Switch to ${t.value} view`})]},t.value)},yi="_preview_1hcqg_2",_i="_active_1hcqg_19",Kt={preview:yi,active:_i},Ci=()=>{const{onPreview:e}=l.usePreviewStore(),[t,n]=f.useState(!1),[s,o]=f.useState(null);return i.jsxs("a",{href:"/",className:l.clx(Kt.preview,{[Kt.active]:e}),target:"_blank",onMouseEnter:()=>{const r=setTimeout(()=>{n(!0)},200);o(r)},onMouseLeave:()=>{s&&clearTimeout(s),n(!1)},children:[i.jsx(j.Icon,{name:"ArrowUpRight",width:20,height:20}),i.jsx("span",{className:Kt.text,children:"Preview"}),t&&i.jsx(l.Tooltip,{text:"Open draft theme in new tab"})]})},wi="_settings_u4cv4_1",ki={settings:wi},ji="_pages_ws1ac_1",Ai="_text_ws1ac_21",Ni="_modal_ws1ac_27",Ii="_open_ws1ac_46",Bi="_page_ws1ac_1",Ei="_hoverable_ws1ac_61",Di="_separator_ws1ac_65",Ti="_button_ws1ac_70",Mi="_items_ws1ac_85",ae={pages:ji,default:"_default_ws1ac_5",text:Ai,modal:Ni,open:Ii,page:Bi,hoverable:Ei,separator:Di,button:Ti,items:Mi},Ms=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await l.request({url:o,withToken:!0,method:"delete"})},Ri=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:s,setIsEdit:o,setEditedPage:r,deletePage:a,setIsOpenSelectModal:c}=l.usePagesStore(),{deletePage:u,setCurrentBlock:h}=l.useLayersStore(),[d,p]=f.useState(null),{setTitle:v,setDescription:m,setOnConfirm:_}=l.useConfirmationModalStore(),[g,x]=f.useState(!1),S=f.useRef(null);j.useOnClickOutside(S,()=>{g&&x(!1)}),f.useEffect(()=>{g?c(!0):setTimeout(()=>{c(!1)},300)},[g]);const C=b=>b?b.replace(/_/g," ").split(" ").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" "):"";return i.jsxs("div",{className:ae.pages,ref:S,children:[i.jsxs("div",{className:ae.default,onClick:b=>{b.stopPropagation(),x(A=>!A)},children:[i.jsx(j.Icon,{name:s&&s[e]&&s[e].icon||"File",fill:"var(--builder-text-primary)",width:20,height:20}),i.jsx("span",{className:ae.text,children:s&&s[e]&&l.defaultPagePaths.includes(s[e].path)?`${C(s[e].name)} page`:s&&s[e]&&s[e].name}),i.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:i.jsx(j.Icon,{name:"CaretDown",width:20,height:20})})]}),i.jsxs("div",{className:l.clx(ae.modal,{[ae.open]:g}),onClick:b=>b.stopPropagation(),children:[s&&i.jsx("div",{className:ae.items,children:Object.keys(s).map(b=>{const A=s[b];return i.jsxs("div",{className:l.clx(ae.page,{[ae.hoverable]:d===b}),onMouseEnter:()=>p(b),onMouseLeave:()=>p(null),onClick:()=>{p(null),o(!1),h(null),t(b),x(!1)},children:[i.jsx(j.Icon,{name:A.icon,fill:"#252525"}),i.jsx("span",{className:ae.text,children:l.defaultPagePaths.includes(A.path)?`${C(A.name)} page`:A.name}),d===b&&i.jsxs(i.Fragment,{children:[i.jsx(j.Icon,{name:"Gear",fill:"#757575",onClick:k=>{k.stopPropagation(),o(!0),r(b),n(!0)}}),!l.defaultPagePaths.includes(A.path)&&i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",onClick:k=>{k.stopPropagation(),v("Delete Page"),m(`Are you sure you want to delete ${A.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),_(()=>{k.stopPropagation(),s[e].path===A.path&&t(Object.keys(s)[0]),a(b),u(A.name),Ms(A.path)})}})]}),s[e]&&s[e].name===A.name&&i.jsx(j.Icon,{name:"Check",fill:"var(--brand-color)"})]},b)})}),i.jsx("div",{className:ae.separator}),i.jsxs(j.ButtonSettings,{className:ae.button,onClick:b=>{b.stopPropagation(),n(!0)},size:"l",children:[i.jsx(j.Icon,{name:"Plus",fill:"var(--brand-color)"}),i.jsx("span",{children:"Create New Page"})]})]})]})},Pi="_zoom_16goq_1",Kn={zoom:Pi},Oi=()=>{const{zoomLevel:e,setZoomLevel:t}=l.usePreviewStore();return i.jsxs("label",{htmlFor:"zoom",className:Kn.zoom,children:[i.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:i.jsx(j.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),i.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:n=>{const s=Number(n.target.value);t(s/100)},className:Kn.input}),i.jsx("span",{children:"%"})]})},Li=()=>i.jsxs("div",{className:ki.settings,children:[i.jsx(Ri,{}),i.jsx(Oi,{})]}),$i="_theme_8ncc1_1",Fi="_text_8ncc1_13",Gn={theme:$i,text:Fi},zi=()=>i.jsx("div",{className:Gn.theme,children:i.jsx("div",{className:Gn.text,children:"Live Theme"})}),Hi=async(e,t,n)=>{const s=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),a=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${s}/drafts/${o}/${t}`;return await l.request({url:a,withToken:!0,method:e,body:n})};function ot(e,t){var n;try{const s=[],o=(a,c)=>{const u=[],h=d=>{if(!(!d||typeof d!="object")){if(Array.isArray(d)){d.forEach(h);return}Object.entries(d).forEach(([p,v])=>{p===c&&u.push(v),v&&typeof v=="object"&&h(v)})}};return h(a),u};for(const a of t){if(!((n=a==null?void 0:a.value)!=null&&n.blockSettings))continue;const c=a.value.blockSettings,u=Object.values(c).filter(d=>d&&d.type===e).flatMap(d=>d.value);s.push(...u);const h=o(c,e);s.push(...h)}let r=s.filter(a=>a!=null).map(a=>e==="ListingIds"?(a==null?void 0:a.listingId)??a:typeof a=="object"&&a!==null&&Object.prototype.hasOwnProperty.call(a,e)?a[e]:a);if(r.length>0)if(typeof r[0]!="object")r=Array.from(new Set(r));else{const a=new Set;r=r.filter(c=>{const u=JSON.stringify(c);return a.has(u)?!1:(a.add(u),!0)})}return r}catch{return[]}}function Wi(e,t,n){return Ui(e,t)?(n.reviews||[]).length*3:0}function Ui(e,t){return t.map(s=>{if(!s.value||!s.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(s.value.blockSettings).filter(r=>r&&r.type===e).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(s=>s).length>0}function Vi(e,t){if(t){const n=Object.keys(t).find(s=>t[s].path===e);if(n)return t[n]}return null}const Ki=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=l.useThemeSettingsStore(),{settings:s}=l.useSettingsStore(),[o,r]=f.useState(null),[a,c]=f.useState(!1),{setNotifications:u,notifications:h}=l.useNotificationStore(),{header:d,footer:p,announcement:v,blocks:m}=l.useLayersStore(),{pageContext:_}=l.usePagesStore(),{pages:g}=l.usePagesStore(),x=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const C=Object.keys(m).map(k=>{const w=Vi(k,g);return m[k]&&m[k].data&&(w!=null&&w.path)?{id:w?w.id:k,name:w?w.name:k,path:w.path,layout:{...m[k]},neededProductIds:[...ot("ProductId",Object.values(m[k].data))],neededCategoryIds:[...ot("CategoryId",Object.values(m[k].data))],neededAnnouncementIds:[...ot("AnnouncementId",Object.values(m[k].data))],neededListingIds:[...ot("ListingIds",Object.values(m[k].data))],neededFaqIds:[...ot("FaqsIds",Object.values(m[k].data))],neededReviewCount:Wi("ReviewCount",Object.values(m[k].data),_),seo:{pageTitle:w&&w.seo&&w.seo.pageTitle?w.seo.pageTitle:"",pageDescription:w&&w.seo&&w.seo.pageDescription?w.seo.pageDescription:""},isPrivate:!!(w&&w.visibility==="private")}:null}).filter(k=>k),b={settings:{...s},header:d,footer:p,announcement:v},{status:A}=await Hi("post","save",{themeSettings:n,settings:b,updatedPages:C});u([...h,{id:l.v4(),message:A===200?"Settings saved":"Error",status:A===200?"success":"error"}]),e(!1)}c(!0);const S=setTimeout(()=>{c(!1)},2e3);r(S)};return i.jsx(j.ButtonSettings,{onClick:x,disabled:t,type:"Primary",children:i.jsx("span",{style:{userSelect:"none"},children:"Save"})})},Gi=()=>{const{isOpenSelectModal:e}=l.usePagesStore(),[t,n]=f.useState(!1),{showTooltip:s}=l.useTooltipStore();return i.jsxs("div",{className:_t.header,style:{zIndex:e?5e4:s?501:50},children:[i.jsxs("div",{className:_t.left,children:[i.jsx(xi,{}),i.jsx(Ci,{})]}),i.jsx("div",{className:_t.center,children:i.jsx(Li,{})}),i.jsxs("div",{className:_t.right,children:[i.jsx(zi,{}),i.jsx(pi,{}),i.jsx(Ki,{setIsLoading:n,isLoading:t}),t&&i.jsx(l.Loader,{})]})]})},Yi="_exit_ovvox_1",Xi="_text_ovvox_11",qi="_exitLink_ovvox_16",Gt={exit:Yi,text:Xi,exitLink:qi},Ji=()=>i.jsx("div",{className:Gt.exit,children:i.jsxs("a",{href:location.origin,className:Gt.exitLink,children:[i.jsx(j.Icon,{name:"SignOut",width:20,height:20}),i.jsx("span",{className:Gt.text,children:"Exit"})]})}),Qi="_navbar_1lnmu_1",Zi="_main_1lnmu_8",ea="_block_1lnmu_15",ta="_active_1lnmu_31",Ct={navbar:Qi,main:Zi,block:ea,active:ta},na=()=>{const{activeBlock:e}=l.useNavbarStore(),{setActiveBlock:t}=l.useBlocksStore(),{setCurrentBlock:n}=l.useLayersStore(),{setActiveBlock:s}=l.useThemeSettingsStore(),{setActiveBlock:o}=l.usePreviewStore(),r=l.useNavigate();function a(c){switch(t(null),n(null),s(null),o({id:null,neededScroll:!1}),c.name){case"Layers":r("/admin/builder");break;case"Add":r("/admin/builder/add");break;case"Theme":r("/admin/builder/theme");break;case"Settings":r("/admin/builder/settings");break}}return i.jsxs("div",{className:Ct.navbar,children:[i.jsx(Ji,{}),i.jsx("div",{className:Ct.main,children:l.navbarBlocks.map(c=>i.jsxs("div",{className:l.clx(Ct.block,{[Ct.active]:e.icon===c.icon}),onClick:()=>a(c),children:[i.jsx(j.Icon,{name:c.icon,fill:e.icon===c.icon?"var(--builder-text-primary)":"var(--builder-text-secondary)"}),i.jsx("span",{children:c.name})]},c.icon))})]})},sa="_preview_ltg9y_1",oa="_main_ltg9y_15",ra="_content_ltg9y_25",ia="_loading_ltg9y_34",aa="_previewLoading_ltg9y_65",rt={preview:sa,main:oa,content:ra,loading:ia,previewLoading:aa},ca="_header_17siy_2",la="_circles_17siy_16",ua="_circle_17siy_16",da="_red_17siy_32",ha="_green_17siy_36",fa="_yellow_17siy_40",ga="_input_17siy_44",pa="_main_17siy_55",ma="_text_17siy_63",va="_copy_17siy_75",pe={header:ca,circles:la,circle:ua,red:da,green:ha,yellow:fa,input:ga,main:pa,text:ma,copy:va},ba=["red","yellow","green"],xa=()=>{const{currentDevice:e}=l.useDeviceStore(),t=(o,r)=>o.length>r?o.slice(0,r)+"...":o,{notifications:n,setNotifications:s}=l.useNotificationStore();return i.jsxs("div",{className:pe.header,children:[i.jsx("div",{className:pe.circles,children:ba.map(o=>i.jsx("div",{className:l.clx(pe.circle,{[pe.red]:o==="red",[pe.yellow]:o==="yellow",[pe.green]:o==="green"})},o))}),i.jsx("div",{className:pe.input,children:i.jsxs("div",{className:pe.main,children:[i.jsx(j.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),i.jsx("span",{className:pe.text,children:e.value==="mobile"?t(window.location.origin,35):e.value==="desktop"?t(window.location.origin,200):t(window.location.origin,100)})]})}),i.jsx(j.ButtonSettings,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),s([...n,{id:l.v4(),status:"success",message:"Domain copied to clipboard"}])},className:pe.copy,children:i.jsx(j.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Sa="_content_s4v4v_1",ya="_main_s4v4v_12",_a="_block_s4v4v_16",Ca="_active_s4v4v_22",wa="_name_s4v4v_32",ka="_addSection_s4v4v_109",ja="_addSectionTop_s4v4v_117",Ee={content:Sa,main:ya,block:_a,active:Ca,name:wa,addSection:ka,addSectionTop:ja},Aa="_sidebar_p1ojw_1",Na="_content_p1ojw_14",Ia="_button_p1ojw_24",Ba="_moveButton_p1ojw_40",Ea="_deleteButton_p1ojw_49",me={sidebar:Aa,content:Na,button:Ia,moveButton:Ba,deleteButton:Ea},Da=()=>{var k;const{activeBlock:e,setActiveBlock:t}=l.usePreviewStore(),{blocks:n,removeBlock:s,moveBlock:o,duplicateBlock:r,setCurrentBlock:a}=l.useLayersStore(),{currentPage:c,pages:u}=l.usePagesStore(),{setTitle:h,setDescription:d,setOnConfirm:p}=l.useConfirmationModalStore(),{setActiveBlock:v}=l.useBlocksStore(),m=(k=u==null?void 0:u[c])==null?void 0:k.path,_=m?n[m]:null,g=(_==null?void 0:_.order)||[],x=g.indexOf(e.id),S=w=>{w.stopPropagation(),x>0&&m&&(o(m,x,x-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},C=w=>{w.stopPropagation(),x<g.length-1&&m&&(o(m,x,x+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},b=w=>{w.stopPropagation(),m&&r(m,e.id)},A=()=>{m&&(s(m,e.id),a(null),v(null),t({id:null,neededScroll:!1}))};return i.jsx("div",{className:me.sidebar,children:i.jsxs("div",{className:me.content,children:[i.jsx("button",{onClick:S,className:l.clx(me.button,me.moveButton),disabled:x===0,children:i.jsx(j.Icon,{name:"ArrowUp"})}),i.jsx("button",{onClick:C,className:l.clx(me.button,me.moveButton),disabled:x===g.length-1,children:i.jsx(j.Icon,{name:"ArrowDown"})}),i.jsx("button",{onClick:b,className:l.clx(me.button,me.moveButton),children:i.jsx(j.Icon,{name:"Copy"})}),i.jsx("button",{className:l.clx(me.button,me.deleteButton),onClick:w=>{w.stopPropagation(),h("Remove Block"),d(`Are you sure you want to delete ${(_==null?void 0:_.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),p(A)},children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},Ta=f.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:s}=l.usePreviewStore(),{blocks:o,sourceBlocks:r}=l.useBlocksStore(),{blocks:a,setCurrentBlock:c,currentBlock:u,setPositionBlock:h,announcement:d}=l.useLayersStore(),{settings:p}=l.useSettingsStore(),{currentPage:v,pages:m,pageContext:_}=l.usePagesStore(),{activeBlock:g,setActiveBlock:x}=l.useThemeSettingsStore(),{setError:S}=l.useErrorStore(),{setActiveBlock:C}=l.useBlocksStore(),b=f.useRef(n.id),A=f.useRef({});f.useEffect(()=>{if(n.id&&n.neededScroll&&A.current[n.id]){const y=A.current[n.id];if(y&&e.current){const N=y.offsetTop;e.current.scrollTo({top:N-30,behavior:"smooth"})}}},[n,e]);const k=l.useNavigate();f.useEffect(()=>{b.current=n.id},[n.id]);const w=y=>{if(!y||!y.name)return S({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});if(!o||!o[y.name])return S({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:`Block "${y.name}" does not exist in blocks.`});const N=new o[y.name];return y.value&&Object.assign(N,y.value),N.renderBlock(p,_)};return i.jsxs("div",{onClick:y=>{y.stopPropagation()},className:Ee.content,style:{width:"100%",height:"100%",zoom:`${s}`},ref:e,children:[d&&i.jsx(fn,{}),i.jsx(hn,{}),i.jsx("div",{className:Ee.main,children:m&&m[v]&&a[m[v].path]&&a[m[v].path].data&&a[m[v].path].order.map(y=>i.jsxs("div",{ref:N=>A.current[y]=N,onClick:N=>{N.stopPropagation(),C(null),g&&x(null),t({id:y,neededScroll:!0}),setTimeout(()=>{t({id:y,neededScroll:!1})},100),c(null),u?setTimeout(()=>{c(n.id)},100):c(n.id)},onMouseEnter:N=>{N.stopPropagation(),n.neededScroll||t({id:y,neededScroll:!1})},onMouseLeave:N=>{N.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:l.clx(Ee.block),children:[(n.id===y||u===y)&&i.jsx("div",{className:Ee.active}),(n.id===y||u===y)&&i.jsx("div",{className:Ee.name,children:l.getDisplayName(a[m[v].path].data[y].name,r)}),(n.id===y||u===y)&&l.getDisplayName(a[m[v].path].data[y].name,r)!=="unknown name"&&i.jsx(Da,{}),(n.id===y||u===y)&&l.getDisplayName(a[m[v].path].data[y].name,r)!=="unknown name"&&i.jsx("div",{className:Ee.addSection,children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(y,!0),c(null),t({id:null,neededScroll:!1}),C(null),k("/admin/builder/add")},children:"Add Section"})}),(n.id===y||u===y)&&l.getDisplayName(a[m[v].path].data[y].name,r)!=="unknown name"&&i.jsx("div",{className:l.clx(Ee.addSection,Ee.addSectionTop),children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(y,!1),c(null),t({id:null,neededScroll:!1}),C(null),k("/admin/builder/add")},children:"Add Section"})}),o&&i.jsx(Tt,{render:w,block:a[m[v].path].data[y]})]},y))}),i.jsx(dn,{})]})}),Ma="_results_1pahy_1",Yn={results:Ma};function Ra(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Xn(e,t){return e?Object.keys(e||{}).reduce((n,s)=>(Ra(s,t)&&n.push({name:s,displayName:l.getDisplayName(s,t)}),n),[]):[]}const Pa="_product_wgb53_1",Oa="_name_wgb53_15",Yt={product:Pa,name:Oa},La=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:s,setActiveBlock:o}=l.useBlocksStore(),{hideModal:r,hoverBlockId:a,isModalVisible:c,showPreview:u,hidePreview:h,clearHideTimeout:d,startHideTimeout:p,setHoverBlockTopPosition:v}=l.useSubmodalStore();function m(x){n(""),o(x),r("keyBlock")}function _(x,S){const C=window.innerHeight,b=400,A=10;let k=S.clientY-120;k+b>C&&(k=C-b-A),k<A&&(k=A),a||r("keyBlock"),u(x,"keyBlock"),d(),v(k)}function g(){c?p("keyBlock"):h("keyBlock"),v(null)}return i.jsxs("div",{className:Yt.product,onClick:()=>m(t),onMouseEnter:x=>_(t,x),onMouseLeave:g,children:[(()=>{const x=l.blockIcons[t];return x?i.jsx(x,{className:Yt.icon}):i.jsx(j.Icon,{name:"Cards"})})(),i.jsx("span",{className:Yt.name,children:l.getDisplayName(t,s)}),i.jsx(j.Icon,{name:"CaretRight",width:20,height:20})]},t)},Rs=()=>{const{blocks:e,sourceBlocks:t}=l.useBlocksStore(),[n,s]=f.useState(""),[o,r]=f.useState([]),a=f.useMemo(()=>Xn(e,t),[e,t]),c=f.useMemo(()=>new Oe(a,{keys:["displayName"],threshold:.4}),[a]);return f.useEffect(()=>{if(n.trim()==="")r(Xn(e,t));else{const u=c.search(n);r(u.map(h=>h.item))}},[n,c]),i.jsxs(i.Fragment,{children:[i.jsx(j.InputSettings,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:s,value:n,style:{marginBottom:10}}),i.jsx("div",{className:Yn.results,children:o.length>0?o.map(u=>i.jsx(La,{blockId:u.name,setSearchValue:s})):i.jsx("div",{className:Yn.noResults,children:"No sections found"})})]})},$a=()=>{const{onPreview:e,zoomLevel:t}=l.usePreviewStore(),{keyBlock:n,hoverBlockId:s,isModalVisible:o,hoverBlockTopPosition:r}=l.useSubmodalStore(),{settings:a}=l.useSettingsStore(),{sourceBlocks:c}=l.useBlocksStore(),{pageContext:u}=l.usePagesStore(),{showModal:h}=l.useColorPickerStore(),{currentDevice:d}=l.useDeviceStore(),{isLoadingThemeSettings:p}=l.useThemeSettingsStore(),{isLoadingLayers:v}=l.useLayersStore(),m=b=>b?!c||!c[b]?i.jsx(j.ErrorableBlock,{error:`Block "${b}" does not exist in blocks.`}):new c[b]().renderPreview(a,u):i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});function _(){if(d.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const b=d.value==="tablet"?768:425;return t>=1?`${b}px`:`${(b*t).toFixed(2)}px`}}function g(){switch(d.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:x}=l.usePagesStore(),S=f.useRef(null),C=b=>{S.current&&(S.current.scrollTop+=b.deltaY)};return i.jsxs("div",{className:rt.preview,style:{zIndex:h&&!x?5e3:500},onWheel:b=>{b.stopPropagation(),C(b)},children:[o&&i.jsx(l.AddSectionSubmodal,{children:i.jsx(Rs,{})}),i.jsxs(l.Submodal,{positionTop:r,positionLeft:!s&&n?void 0:250,children:[!p&&!v&&i.jsx(Tt,{render:m,block:n},n),(p||!n||v)&&i.jsx("div",{className:rt.previewLoading,children:i.jsx(l.Loader,{})})]}),h&&i.jsx(l.ColorPickerModal,{}),e&&i.jsxs("div",{className:rt.main,style:{width:g()},children:[i.jsx(xa,{}),i.jsx("div",{style:{borderLeft:_()==="100%"?"none":"var(--default-border)",borderRight:_()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:b=>{b.stopPropagation()},onWheel:b=>{b.stopPropagation()},children:!p&&!v?i.jsx("div",{className:rt.content,style:{width:_()},children:i.jsx(Ta,{scrollableRef:S})}):i.jsx("div",{className:rt.loading,children:i.jsx(l.Loader,{})})})]})]})},Fa="_sidebar_zs8s9_1",za="_title_zs8s9_13",qn={sidebar:Fa,title:za},Ha="_layers_1ai1e_1",Wa="_wrapper_1ai1e_10",Ua="_draggingWrapper_1ai1e_18",Va="_block_1ai1e_22",Ka="_dragging_1ai1e_18",Ga="_active_1ai1e_57",Ya="_add_1ai1e_64",Xa="_addTop_1ai1e_80",qa="_visible_1ai1e_96",Ja="_button_1ai1e_100",Qa="_nameBlock_1ai1e_159",Za="_loader_1ai1e_163",ec="_actions_1ai1e_172",tc="_deleteButton_1ai1e_180",Y={layers:Ha,wrapper:Wa,draggingWrapper:Ua,block:Va,dragging:Ka,active:Ga,add:Ya,addTop:Xa,visible:qa,button:Ja,nameBlock:Qa,loader:Za,actions:ec,deleteButton:tc},nc="_block_owmqd_1",sc="_title_owmqd_17",oc="_actions_owmqd_21",De={block:nc,title:sc,actions:oc},Jn={header:"Header",footer:"Footer",announcement:"Announcement"},Xt=({id:e})=>{const{setCurrentBlock:t}=l.useLayersStore(),{activeBlock:n}=l.usePreviewStore(),[s,o]=f.useState(!1);function r(a){t(a)}return i.jsxs("div",{className:l.clx(De.block,{[De.active]:n.id===e,[De.header]:e==="header",[De.footer]:e==="footer",[De.announcement]:e==="announcement"}),onClick:()=>r(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[(()=>{const a=l.blockIcons[Jn[e]];return a?i.jsx(a,{width:20,height:20,className:De.icon}):i.jsx(j.Icon,{name:"Cards",width:20,height:20})})(),i.jsx("span",{className:De.title,children:Jn[e]}),i.jsx("div",{className:De.actions,children:i.jsx(j.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"var(--builder-text-secondary)"})})]})},rc=({id:e,name:t,onClick:n,isDragging:s,icon:o})=>{const{activeBlock:r,setActiveBlock:a}=l.usePreviewStore(),{showPreview:c,hidePreview:u,showModal:h,hideModal:d,clearHideTimeout:p,startHideTimeout:v,hoverBlockId:m,isModalVisible:_}=l.useSubmodalStore(),{setPositionBlock:g}=l.useLayersStore(),[x,S]=f.useState(!1),[C,b]=f.useState(!1),[A,k]=f.useState(!1),[w,y]=f.useState(!1),[N,M]=f.useState(null),$=f.useRef(null),{attributes:R,listeners:D,setNodeRef:P,transform:T,transition:z}=ws({id:e}),X={transform:Ye.Transform.toString(T),transition:z},{setTitle:E,setDescription:H,setOnConfirm:re}=l.useConfirmationModalStore(),{pages:we,currentPage:Le}=l.usePagesStore(),{removeBlock:K}=l.useLayersStore(),ie=L=>{L.stopPropagation(),$.current&&clearTimeout($.current),a({id:e,neededScroll:!0}),_&&d(),c(e),p()},de=(L,$e=!0)=>{L.stopPropagation(),u(),h(e),p(),g(e,$e)},Re=L=>{L.stopPropagation(),a({id:null,neededScroll:!1}),_?v():u()};return f.useEffect(()=>{k(!1),S(!1),b(!1),y(!1)},[s]),f.useEffect(()=>{_||(b(!1),S(!1))},[_]),i.jsxs("div",{ref:P,style:X,className:l.clx(Y.wrapper,{[Y.draggingWrapper]:s&&r.id===e}),onClick:L=>{L.stopPropagation(),n(e)},onMouseEnter:ie,onMouseLeave:Re,...R,...D,children:[i.jsxs("div",{className:l.clx(Y.block,{[Y.dragging]:s&&r.id===e,[Y.active]:!s&&r.id===e}),children:[o?i.jsx(o,{width:20,height:20}):i.jsx(j.Icon,{name:"Cards",width:20,height:20}),i.jsx("span",{className:Y.nameBlock,children:t}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.addTop,{[Y.visible]:C}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L,!1),onMouseEnter:()=>{const L=setTimeout(()=>{s||y(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),y(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),w&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.add,{[Y.visible]:x}),onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L),onMouseEnter:()=>{const L=setTimeout(()=>{s||k(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),k(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),A&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})})]}),m===e&&!s&&i.jsxs("div",{className:Y.actions,children:[i.jsx(j.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),i.jsx("div",{className:Y.deleteButton,onClick:L=>{L.stopPropagation(),E("Remove Block"),H(`Are you sure you want to delete ${t||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),re(()=>{we&&K(we[Le].path,e)})},children:i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},ic=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:r}=l.useLayersStore(),{currentPage:a,pages:c}=l.usePagesStore(),{setMouseOverModal:u,setHoverBlockId:h}=l.useSubmodalStore(),{sourceBlocks:d}=l.useBlocksStore();function p(S){t(S),u(!1),h(null)}const v=ns(ts(Rt,{activationConstraint:{distance:5}})),[m,_]=f.useState(!1),g=()=>{_(!0)},x=S=>{_(!1);const{active:C,over:b}=S;if(b&&C.id!==b.id&&c&&c[a]){const A=c[a].path,k=e[A].order,w=k.indexOf(C.id),y=k.indexOf(b.id);w!==-1&&y!==-1&&s(A,w,y)}};return i.jsx("div",{className:Y.layers,children:o?i.jsx("div",{className:Y.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[r&&i.jsx(Xt,{id:"announcement"}),i.jsx(Xt,{id:"header"}),!n&&i.jsx(ms,{sensors:v,onDragEnd:x,onDragStart:g,children:c&&c[a]&&e[c[a].path]&&i.jsx(_s,{items:e[c[a].path].order,strategy:xs,children:e[c[a].path].order.map((S,C)=>i.jsx(rc,{id:S,name:l.getDisplayName(e[c[a].path].data[S].name,d),index:C,onClick:p,isDragging:m,icon:l.blockIcons[e[c[a].path].data[S].name]},S))})}),i.jsx(Xt,{id:"footer"})]})})},ac="_loader_eyvkk_1",cc={loader:ac},lc=()=>{const{isLoadingSettings:e}=l.useSettingsStore();return e?i.jsx("div",{className:cc.loader,children:i.jsx(l.Loader,{})}):i.jsx(uc,{})},uc=()=>{const{settings:e}=l.useSettingsStore(),{settings:t,setSettingsInstance:n}=l.useBlocksStore();if(!e)return null;const{setError:s}=l.useErrorStore(),o=new t(e);f.useEffect(()=>{n(o)},[e]);try{return o.renderSettings()}catch(r){throw console.error("Error rendering settings:",r),s({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},dc="_theme_8b5no_1",hc="_block_8b5no_9",fc="_name_8b5no_24",gc="_loader_8b5no_28",wt={theme:dc,block:hc,name:fc,loader:gc},pc=()=>{const e=l.useNavigate(),{isAntistock:t}=l.useGeneralStore(),{isLoadingThemeSettings:n,setActiveBlock:s}=l.useThemeSettingsStore(),o=[{icon:"PaintBrushBroad",name:"Colors"},{icon:"TextAa",name:"Fonts"}];function r(a){switch(a==null?void 0:a.name){case"Colors":e("/admin/builder/theme/colors"),s(l.themeSettingsBlocks[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(l.themeSettingsBlocks[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(l.themeSettingsBlocks[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(l.themeSettingsBlocks[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(l.themeSettingsBlocks[4]);break}}return i.jsx("div",{className:wt.theme,children:n?i.jsx("div",{className:wt.loader,children:i.jsx(l.Loader,{})}):(t?o:l.themeSettingsBlocks).map(a=>i.jsxs("div",{onClick:()=>r(a),className:l.clx(wt.block),children:[i.jsx(j.Icon,{name:a.icon}),i.jsx("span",{className:wt.name,children:a.name}),i.jsx(j.Icon,{name:"CaretRight"})]},a.icon))})},mc="_render_1k1k0_9",vc="_open_1k1k0_24",bc="_close_1k1k0_51",xc="_clicked_1k1k0_55",Sc="_loading_1k1k0_72",yc="_settings_1k1k0_76",Ke={render:mc,open:vc,close:bc,clicked:xc,loading:Sc,settings:yc},_c=({block:e})=>{const{pageContext:t}=l.usePagesStore(),{setError:n}=l.useErrorStore();try{return e.renderSettings(t)}catch(s){throw console.error("Error rendering settings:",s),n({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),s}},Cc="_wrapper_1xfvz_1",wc="_header_1xfvz_8",kc="_title_1xfvz_15",jc="_colorWrapper_1xfvz_21",Ac="_name_1xfvz_35",Nc="_color_1xfvz_21",Ic="_value_1xfvz_47",Bc="_length_1xfvz_51",se={wrapper:Cc,header:wc,title:kc,colorWrapper:jc,name:Ac,color:Nc,value:Ic,length:Bc},Ec=e=>{const{colors:t}=e,{themeSettings:n}=l.useThemeSettingsStore(),[s,o]=f.useState(!0);f.useEffect(()=>{t.length<=3&&o(!0)},[]);function r(a){const c=a.replace("--",""),[u,h]=c.split("-"),d=`${h.charAt(0).toUpperCase()+h.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[p,v]=c.split("-");return{name:d,field:p,variable:v}}return i.jsxs("div",{className:se.wrapper,children:[i.jsxs("div",{className:se.header,children:[i.jsx("div",{className:se.title,children:"Section Colors"}),!s&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!0),children:["+",t.length]})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:se.colors,children:t.map(a=>{const c=r(a),{variable:u,name:h,field:d}=c;return i.jsx(Dc,{color:n.colors[d][u],name:h})})}),t.length>3&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},Dc=e=>{const{name:t,color:n}=e,{setActiveLabel:s,setModalPosition:o,setInitialColor:r,setShowModal:a,setUpdate:c,setColor:u,setColorChange:h,colorChange:d,setIsGradientActive:p,setIsBlockSettings:v}=l.useColorPickerStore(),{updateColor:m}=l.useThemeSettingsStore(),_=(S,C)=>b=>{m(S,C,b)};f.useEffect(()=>{const S=()=>{a(!1),s(null),r(n),c(()=>{}),u(n),h(()=>{})};return document.body.addEventListener("click",S),()=>{document.body.removeEventListener("click",S)}},[]);const g=S=>{const C=t.split("/")[0],b=C.split(" ")[0].toLowerCase(),A=C.split(" ")[1].toLowerCase();S.stopPropagation(),a(!0),h(d),c(y=>_(A,b)(y)),r(n),u(n),v(!0),p(A==="surface");const{top:k,left:w}=l.getModalPosition(S,550,288,10,20,230,80);o({top:A==="surface"?k:k+125,left:w-200})};function x(S){return S.length>15?S.slice(0,15)+"...":S}return i.jsxs("div",{className:se.colorWrapper,onClick:g,children:[i.jsx("div",{className:se.color,style:{background:n}}),i.jsx("div",{className:se.name,children:t}),i.jsx("div",{className:se.value,children:x(n)})]})},Tc="_back_1rhiq_1",Mc="_title_1rhiq_9",Rc="_deleteButton_1rhiq_17",Pc="_backIcon_1rhiq_30",kt={back:Tc,title:Mc,deleteButton:Rc,backIcon:Pc},Oc=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var v,m;const{activeBlock:s}=l.useBlocksStore(),{setTitle:o,setDescription:r,setOnConfirm:a}=l.useConfirmationModalStore(),{blocks:c,currentBlock:u,removeBlock:h}=l.useLayersStore(),{currentPage:d,pages:p}=l.usePagesStore();return i.jsxs("div",{className:kt.back,children:[i.jsx("div",{className:kt.backIcon,onClick:()=>e(),children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("h3",{className:kt.title,children:s&&n(s)||p&&p[d]&&c[p[d].path]&&u&&n((v=c[p[d].path].data[u])==null?void 0:v.name)||u&&l.formatLabel(u)||"Loading"}),u&&p&&!["header","footer","announcement"].includes(u)&&c[p[d].path].data[u]&&n((m=c[p[d].path].data[u])==null?void 0:m.name)!=="unknown name"&&i.jsx("button",{onClick:_=>{var g;_.stopPropagation(),o("Remove Block"),r(`Are you sure you want to delete ${n((g=c[p[d].path].data[u])==null?void 0:g.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{t(!0),h(p[d].path,u),e(!0)})},className:kt.deleteButton,children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},Lc=()=>{const e=l.useNavigate(),[t,n]=f.useState(!1),{header:s,footer:o,announcement:r,sourceBlocks:a,activeBlock:c,setActiveBlock:u,currentInstance:h,setCurrentInstance:d}=l.useBlocksStore(),{setActiveBlock:p}=l.usePreviewStore(),{blocks:v,addBlock:m,editBlock:_,currentBlock:g,setCurrentBlock:x,header:S,footer:C,announcement:b,isLoadingLayers:A}=l.useLayersStore(),{currentPage:k,pages:w}=l.usePagesStore(),{past:y,future:N}=l.useHistoryStore();function M(D=!1){if(w&&h&&g&&!["header","footer","announcement"].includes(g)&&!D){const P={blockSettings:{}};Object.keys(h.blockSettings).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{P.blockSettings[T]=h.blockSettings[T]}),_(w[k].path,g,{name:v[w[k].path].data[g].name,value:P})}u(null),x(null),p({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),d(null)}function $(D){var X;if(!w||!k||!D)return null;if(D==="header"){const E=new s;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=S==null?void 0:S.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=S==null?void 0:S.blockColors[H]}),E}if(D==="footer"){const E=new o;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=C==null?void 0:C.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=C==null?void 0:C.blockColors[H]}),E}if(D==="announcement"){const E=new r;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=b==null?void 0:b.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=b==null?void 0:b.blockColors[H]}),E}const P=v[w[k].path];if(!P||!P.data[D])return null;const T=P.data[D];return!T||!a[T.name]?null:new a[T.name]((X=T.value)==null?void 0:X.blockSettings)}f.useEffect(()=>{if(g){const D=$(g);d(D)}else d(null)},[g,y,N,c]),f.useEffect(()=>{if(c&&w&&!g){const D={blockSettings:{},blockColors:{}},P=new a[c];d(P),Object.keys(P.blockSettings).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockSettings[z]=P.blockSettings[z]}),Object.keys(P.blockColors).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockColors[z]=P.blockColors[z]});const T=m(w[k].path,{name:c,value:D});p({id:T,neededScroll:!0}),x(T),e("/admin/builder")}},[c,y,N]);function R(D){if(!a)return"unknown name";if(!a[D])return g==="header"?S==null?void 0:S.blockSettings.displayName:g==="footer"?C==null?void 0:C.blockSettings.displayName:g==="announcement"?b==null?void 0:b.blockSettings.displayName:"unknown name";const P=new a[D];return!P.blockSettings||!P.blockSettings.displayName?"unknown name":P.blockSettings.displayName}return i.jsxs("div",{className:l.clx(Ke.render,{[Ke.open]:g,[Ke.close]:!g,[Ke.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:A?0:1},children:[i.jsx(Oc,{onClick:M,setIsClicked:n,getDisplayName:R}),i.jsxs("div",{className:Ke.settings,children:[h&&i.jsxs(i.Fragment,{children:[i.jsx(_c,{block:h}),i.jsx(Ec,{colors:h.blockColors})]}),!c&&!g&&i.jsx("div",{className:Ke.loading,children:"Loading"})]})]})},$c="_header_1u3yu_1",Fc="_title_1u3yu_9",zc="_backIcon_1u3yu_15",qt={header:$c,title:Fc,backIcon:zc},mt=({onClick:e,title:t})=>i.jsxs("div",{className:qt.header,children:[i.jsx("div",{className:qt.backIcon,onClick:e,children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("span",{className:qt.title,children:t})]}),Hc="_options_ymds7_1",Wc={options:Hc},Uc=()=>{var h,d;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:s}=l.useThemeSettingsStore();function o(p,v){n(v,p)}const r=l.useNavigate();function a(){s(null),r("/admin/builder/theme")}const c=f.useMemo(()=>t.borders,[t]),u=(e==null?void 0:e.name)==="Borders";return i.jsxs(l.AnimatedPanel,{isOpen:u,isClose:!u,children:[i.jsx(mt,{onClick:a,title:"Borders Style"}),i.jsxs("div",{className:Wc.options,children:[i.jsx(j.SelectSettings,{label:"Border Radius (px)",options:Object.keys(l.RadiusVariables),value:((h=Object.entries(l.RadiusVariables).find(([p,v])=>v===c.radius))==null?void 0:h[0])||"None",onChange:p=>o(l.RadiusVariables[p],"radius")}),i.jsx(j.SelectSettings,{label:"Border Thickness (px)",options:Object.keys(l.ThicknessVariables),value:((d=Object.entries(l.ThicknessVariables).find(([p,v])=>v===c.thickness))==null?void 0:d[0])||"None",onChange:p=>o(l.ThicknessVariables[p],"thickness")})]})]})},Vc="_options_1gneb_1",Kc="_alignments_1gneb_9",Gc="_blocks_1gneb_15",Yc="_alignment_1gneb_9",Xc="_active_1gneb_34",qc="_chargeTypes_1gneb_41",Jc="_charge_1gneb_41",Qc="_chargeActive_1gneb_69",Zc="_sliderContainer_1gneb_83",el="_shadowInputs_1gneb_91",tl="_label_1gneb_102",nl="_shadowInputsRow_1gneb_111",sl="_shadowInputsOpen_1gneb_119",q={options:Vc,alignments:Kc,blocks:Gc,alignment:Yc,active:Xc,chargeTypes:qc,charge:Jc,chargeActive:Qc,sliderContainer:Zc,shadowInputs:el,label:tl,shadowInputsRow:nl,shadowInputsOpen:sl},ol=["left","center","right"],rl=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:s}=l.useThemeSettingsStore(),{fonts:o}=l.useFontsStore(),[r,a]=f.useState("primary");function c(g,x){n(r,x,g)}const[u,h]=f.useState(!1),d=t.buttons[r],p=l.useNavigate();function v(){s(null),p("/admin/builder/theme")}const m=(e==null?void 0:e.name)==="Buttons";function _(g,x){c({...d.boxShadow,[g]:x},"boxShadow")}return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:!m,children:[i.jsx(mt,{onClick:v,title:"Buttons Style"}),i.jsx("div",{className:q.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(g=>i.jsx("div",{className:l.clx(q.charge,{[q.chargeActive]:r===g}),onClick:()=>a(g),children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),d&&i.jsxs("div",{className:q.options,children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(d.height),onChange:g=>c(Number(g),"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",value:String(d.size),onChange:g=>c(Number(g),"size"),options:l.sizeOptions}),i.jsx(j.InputSettings,{label:"Border Radius (px)",value:String(d.radius),onChange:g=>c(Number(g),"radius"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font",value:d.font,onChange:g=>c(g,"font"),options:[...o.filter(g=>g.name!==d.font).map(g=>g.name)]}),i.jsx(l.ColorPicker,{initialColor:d.color,onChange:g=>c(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.background,onChange:g=>c(g,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),i.jsxs("div",{className:q.sliderContainer,children:[i.jsx("h4",{className:q.label,children:"Shadow"}),i.jsx(j.ButtonSettings,{type:"Secondary",onClick:()=>h(!u),style:{padding:5,display:"flex"},children:i.jsx(j.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),i.jsxs("div",{className:l.clx(q.shadowInputs,{[q.shadowInputsOpen]:u}),children:[i.jsxs("div",{className:q.shadowInputsRow,children:[i.jsx(j.InputSettings,{label:"Left (px)",value:String(d.boxShadow.left),onChange:g=>_("left",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Top (px)",value:String(d.boxShadow.top),onChange:g=>_("top",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Blur (px)",value:String(d.boxShadow.blur),onChange:g=>_("blur",Number(g)),type:"number"}),i.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:i.jsx(j.InputSettings,{label:"Spread (px)",value:String(d.boxShadow.spread),onChange:g=>_("spread",Number(g)),type:"number"})})]}),i.jsx(l.ColorPicker,{initialColor:d.boxShadow.color,onChange:g=>_("color",g),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs("div",{className:q.alignments,children:[i.jsx("h4",{className:q.label,children:"Alignment Type"}),i.jsx("div",{className:q.blocks,children:ol.map(g=>i.jsx("div",{className:l.clx(q.alignment,{[q.active]:d.alignment===g}),onClick:()=>{c(g,"alignment")},children:i.jsx(j.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:d.alignment===g?"#252525":"#757575"})},g))})]}),i.jsx(j.Switch,{label:"Enable Hover",onChange:g=>c(g,"hover"),current:d.hover}),d.hover&&i.jsxs(i.Fragment,{children:[i.jsx(l.ColorPicker,{initialColor:d.colorHover,onChange:g=>c(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.backgroundHover,onChange:g=>c(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},il="_category_daart_1",al="_categoryTitle_daart_19",Jt={category:il,categoryTitle:al},cl=()=>{const{themeSettings:e,setActiveColorCategory:t}=l.useThemeSettingsStore();function n(s){t(s)}return i.jsx("div",{className:Jt.wrapper,children:Object.keys(e.colors).map(s=>s==="icon"?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Jt.category,onClick:()=>n(s),children:[i.jsxs("h2",{className:Jt.categoryTitle,children:[s==="text"?"Text & Icon":l.formatLabel(s)," Colors"]}),i.jsx(j.Icon,{name:"CaretRight",width:24,height:24})]},s))})},ll="_options_rwzk3_38",ul={options:ll},dl=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:s,updateFont:o}=l.useThemeSettingsStore(),{fonts:r}=l.useFontsStore(),[a,c]=f.useState(null);function u(){t(null)}function h(g,x){a&&n&&o("desktop",a,n,x,g)}const[d,p]=f.useState([]),v=f.useMemo(()=>n?s.fonts.desktop.heading[n]?(c("heading"),s.fonts.desktop.heading[n]):s.fonts.desktop.body[n]?(c("body"),s.fonts.desktop.body[n]):(c(null),null):null,[n,s]);f.useEffect(()=>{if(v){const g=r.find(x=>x.name===v.font);g&&(p(g.weights),g.weights.includes(v.boldWeight)||h("400","boldWeight"),g.weights.includes(v.weight)||h("400","weight"))}},[v,n]);const m=!!((e==null?void 0:e.name)==="Fonts"&&n),_=(e==null?void 0:e.name)!=="Fonts"||!n;return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:_,children:[i.jsx(mt,{onClick:u,title:"Font Style"}),n&&v&&i.jsxs("div",{className:ul.options,children:[i.jsx(j.SelectSettings,{label:"Font",value:v.font,onChange:g=>h(g,"font"),options:[...r.filter(g=>g.name!==v.font).map(g=>g.name)]}),i.jsx(j.SelectSettings,{label:"Size",value:String(v.size),onChange:g=>h(g,"size"),options:l.sizeOptions}),i.jsx(j.SelectSettings,{label:"Default Weight",value:String(v.weight),onChange:g=>h(g,"weight"),options:d}),i.jsx(j.SelectSettings,{label:"Bold Weight",value:String(v.boldWeight),onChange:g=>h(g,"boldWeight"),options:d}),i.jsx(j.SelectSettings,{label:"Case",value:String(v.case).charAt(0).toUpperCase()+String(v.case).slice(1),onChange:g=>h(g.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(g=>g.toLowerCase()!==String(v.case))})]})]})},hl="_wrapper_mkmxa_1",fl="_category_mkmxa_5",gl="_categoryTitle_mkmxa_11",pl="_font_mkmxa_17",ml="_content_mkmxa_32",vl="_icon_mkmxa_39",bl="_paragraph_mkmxa_50",_e={wrapper:hl,category:fl,categoryTitle:gl,font:pl,content:ml,icon:vl,paragraph:bl},xl={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},Sl=e=>{const{font:t,size:n,id:s,category:o}=e,{setActiveFont:r}=l.useThemeSettingsStore();return i.jsxs("div",{className:_e.font,onClick:()=>r(s),children:[i.jsx("div",{className:l.clx(_e.icon,{[_e.paragraph]:o==="paragraph"}),children:i.jsx(j.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),i.jsxs("div",{className:_e.content,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(xl[s])}),i.jsx("span",{className:_e.value,children:`${t}, ${n}px`})]})]})},yl=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=l.useThemeSettingsStore();f.useEffect(()=>(s(),()=>{s()}),[]);function s(){t(null)}if(n!=null&&n.name)return i.jsx("div",{className:_e.wrapper,children:Object.entries(e.fonts.desktop).sort(([o],[r])=>o==="heading"?-1:r==="heading"?1:0).map(([o,r])=>i.jsxs("div",{className:_e.category,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(o)}),Object.entries(r).map(([a,c])=>i.jsx(Sl,{id:a,category:o,...c},a))]},o))})},_l="_wrapper_16ym0_2",Cl="_categoryTitle_16ym0_12",wl="_title_16ym0_74",kl="_field_16ym0_82",jl="_alignments_16ym0_92",Al="_lineField_16ym0_98",Nl="_style_16ym0_106",Il="_header_16ym0_113",le={wrapper:_l,categoryTitle:Cl,title:wl,field:kl,alignments:jl,lineField:Al,style:Nl,header:Il},Bl=["left","center","right"],El=["solid","dashed"],it=e=>{const{title:t,children:n,rightAddon:s}=e;return i.jsxs("div",{className:le.field,children:[i.jsxs("div",{className:le.header,children:[i.jsx("h4",{className:le.categoryTitle,children:t}),s]}),n]})},Dl=()=>{const{themeSettings:e,updateInput:t}=l.useThemeSettingsStore(),n=f.useMemo(()=>e.inputs,[e]),s=(r,a,c)=>{t(r,a,c)},o=r=>a=>{t(r,a,"color")};return i.jsxs("div",{className:le.wrapper,children:[i.jsxs(it,{title:"General",children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(n.general.height),onChange:r=>s("general",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("general",r,"size"),value:String(n.general.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsx(it,{title:"Field Fill",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("field",r,"active"),current:n.field.active})}),children:i.jsx(l.ColorPicker,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),i.jsx(it,{title:"Placeholder",children:i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),i.jsxs(it,{title:"Border",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("border",r,"active"),current:n.border.active})}),children:[i.jsxs("div",{className:le.lineField,children:[i.jsxs("div",{className:le.style,children:[i.jsx("span",{className:le.title,children:"Style"}),i.jsx(l.Picker,{items:El,selectedItem:n.border.style,onSelect:r=>s("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),i.jsx(j.InputSettings,{label:"Radius (px)",value:String(n.border.radius),onChange:r=>s("border",r,"radius"),type:"number",min:0})]}),i.jsx(j.InputSettings,{label:"Thickness (px)",value:String(n.border.thickness),onChange:r=>s("border",r,"thickness"),type:"number",min:0}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs(it,{title:"Label",children:[i.jsx(j.InputSettings,{label:"Line Height (px)",value:String(n.label.height),onChange:r=>s("label",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("label",r,"size"),value:String(n.label.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.label.color),onChange:o("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),i.jsxs("div",{className:le.alignments,children:[i.jsx("h4",{className:le.title,children:"Alignment Type"}),i.jsx(l.Picker,{items:Bl,selectedItem:n.label.alignment,onSelect:r=>s("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},Tl="_wrapper_lyrvk_2",Ml="_color_lyrvk_24",Rl="_content_lyrvk_33",Pl="_preview_lyrvk_42",Ol="_container_lyrvk_52",Ll="_buttonWrapper_lyrvk_62",$l="_button_lyrvk_62",Fl="_buttonBorder_lyrvk_80",zl="_buttonBackground_lyrvk_83",Hl="_text_lyrvk_87",Wl="_textText_lyrvk_93",Ul="_icon_lyrvk_97",Vl="_iconIcon_lyrvk_100",Kl="_annotation_lyrvk_104",Gl="_annotationText_lyrvk_111",Yl="_label_lyrvk_116",Xl="_circle_lyrvk_127",ql="_line_lyrvk_140",Jl="_circle1_lyrvk_154",Ql="_circle2_lyrvk_159",Zl="_annotationIcon_lyrvk_164",eu="_annotationBorder_lyrvk_192",tu="_line1_lyrvk_203",nu="_line2_lyrvk_210",su="_circle3_lyrvk_227",ou="_circle4_lyrvk_232",ru="_annotationSurface_lyrvk_237",I={wrapper:Tl,color:Ml,content:Rl,preview:Pl,container:Ol,buttonWrapper:Ll,button:$l,buttonBorder:Fl,buttonBackground:zl,text:Hl,textText:Wl,icon:Ul,iconIcon:Vl,annotation:Kl,annotationText:Gl,label:Yl,circle:Xl,line:ql,circle1:Jl,circle2:Ql,annotationIcon:Zl,annotationBorder:eu,line1:tu,line2:nu,circle3:su,circle4:ou,annotationSurface:ru},iu=()=>{const{activeColorCategory:e}=l.useThemeSettingsStore();return i.jsx("div",{className:I.container,children:i.jsxs("div",{className:I.buttonWrapper,children:[i.jsxs("div",{className:l.clx(I.button,{[I.buttonBorder]:e==="border",[I.buttonBackground]:e==="surface"}),children:[i.jsx(j.Icon,{name:"Smiley",className:l.clx(I.icon,{[I.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),i.jsx("span",{className:l.clx(I.text,{[I.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationText),children:[i.jsx("div",{className:I.label,children:"Text Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationIcon),children:[i.jsx("div",{className:I.label,children:"Icon Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="border"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationBorder),children:[i.jsx("div",{className:I.label,children:"Border Color"}),i.jsx("div",{className:l.clx(I.line,I.line1)}),i.jsx("div",{className:l.clx(I.line,I.line2)}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)}),i.jsx("div",{className:l.clx(I.circle,I.circle3)}),i.jsx("div",{className:l.clx(I.circle,I.circle4)})]}),e==="surface"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationSurface),children:[i.jsx("div",{className:I.label,children:"Surface Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]})]})})},au={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},cu=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:s,updateColor:o}=l.useThemeSettingsStore();function r(){t(null)}function a(d,p,v){o(d,p,v)}const c=!!((e==null?void 0:e.name)==="Colors"&&n),u=(e==null?void 0:e.name)!=="Colors"||!n,h=n?au[n]:[];return i.jsxs(l.AnimatedPanel,{isOpen:c,isClose:u,children:[i.jsx(mt,{onClick:r,title:n==="text"?"Text & Icon Colors":`${l.formatLabel(n)} Colors`}),n&&i.jsxs("div",{className:I.wrapper,children:[i.jsx(iu,{}),h.map(d=>{const p=s.colors[n][d];return typeof p!="string"?null:i.jsx("div",{className:I.color,children:i.jsxs("div",{className:I.content,children:[i.jsx("div",{className:I.preview,style:{background:p}}),i.jsx(l.ColorPicker,{title:l.formatLabel(d),initialColor:p,onChange:v=>a(n,d,v),isGradientActive:n==="surface"})]})},d)})]})]})},lu="_loader_1p5lr_1",uu={loader:lu},du=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=l.useThemeSettingsStore();return i.jsx(i.Fragment,{children:n?i.jsx("div",{className:uu.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(yl,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(dl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cu,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&i.jsx(Dl,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&i.jsx(Uc,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&i.jsx(rl,{})]})})},hu=()=>{const{activeBlock:e,setActiveBlock:t}=l.useThemeSettingsStore(),{activeBlock:n}=l.useNavbarStore(),s=l.useNavigate();function o(){t(null),s("/admin/builder/theme")}const r=!!e,a=!e||n.name!=="Theme";return i.jsxs(l.AnimatedPanel,{isOpen:r,isClose:a,children:[i.jsx(mt,{onClick:o,title:(e==null?void 0:e.name)||""}),i.jsx(du,{})]})},fu=()=>{const{activeBlock:e}=l.useNavbarStore(),{showTooltip:t}=l.useTooltipStore();function n(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return i.jsxs("div",{className:qn.sidebar,style:{zIndex:t?50:"auto"},children:[i.jsx("h3",{className:qn.title,children:n()}),e.name==="Layers"&&i.jsx(ic,{}),e.name==="Add"&&i.jsx(Rs,{}),i.jsx(Lc,{}),i.jsx(hu,{}),e.name==="Theme"&&i.jsx(pc,{}),e.name==="Settings"&&i.jsx(lc,{})]})},gu="_wrapper_1a3e7_1",pu="_header_1a3e7_12",mu="_content_1a3e7_23",vu="_buttons_1a3e7_44",bu="_label_1a3e7_51",xu="_description_1a3e7_52",Su="_preview_1a3e7_60",yu="_block_1a3e7_66",_u="_slug_1a3e7_75",Cu="_title_1a3e7_81",wu="_closeIcon_1a3e7_87",ce={wrapper:gu,header:pu,content:mu,buttons:vu,label:bu,description:xu,preview:Su,block:yu,slug:_u,title:Cu,closeIcon:wu},ku=()=>{var $,R,D,P,T,z,X;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:s,isEdit:o,setIsEdit:r,editedPage:a,setEditedPage:c,pageContext:u}=l.usePagesStore(),{setIsOpen:h}=l.useModalStore(),{isAntistock:d}=l.useGeneralStore(),{createPage:p,updatePage:v}=l.useLayersStore(),[m,_]=f.useState(a?t&&(($=t[a])==null?void 0:$.path):""),[g,x]=f.useState(a?t&&((R=t[a])==null?void 0:R.name):""),[S,C]=f.useState(a?t&&((D=t[a])==null?void 0:D.seo)&&((T=(P=t[a])==null?void 0:P.seo)==null?void 0:T.pageDescription)||"":`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`),[b,A]=f.useState(a&&t&&(z=t[a])!=null&&z.isPrivate?"private":"public");function k(){_(""),x(""),C(""),A("public"),r(!1),c(null)}function w(){h(!1),setTimeout(()=>{k(),e(!1),h(!0)},300)}f.useEffect(()=>()=>{w()},[]);function y(E){return E[0]==="/"?E:"/"+E}function N(){n({path:y(m),name:g||m||"",icon:"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:b||"public"}),p(y(m)),w()}function M(){t&&(l.defaultPagePaths.includes(t[a].path)||Ms(t[a].path),v(t[a].path||"",m||""),s(a,{path:y(m),name:g||m,icon:t[a].icon||"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:b||"public"})),w()}return i.jsxs("div",{className:ce.wrapper,onClick:E=>E.stopPropagation(),children:[i.jsxs("div",{className:ce.header,children:[i.jsx("h2",{children:o?"Edit Page":"Create New Page"}),i.jsx("div",{className:ce.closeIcon,children:i.jsx(j.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:w})})]}),i.jsxs("div",{className:ce.content,children:[i.jsx(j.InputSettings,{label:"Page Slug",onChange:E=>_(E),value:m,placeholder:"path-to-page",disabled:!!(a&&t&&((X=t[a])!=null&&X.name)&&l.defaultPagePaths.includes(t[a].path)),required:!0,regex:"^.+$"}),i.jsx(j.InputSettings,{label:"Page Title",onChange:E=>{x(E)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),i.jsx(j.TextareaSettings,{label:"Description",onChange:E=>C(E),value:S,placeholder:`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`,maxLength:150}),i.jsxs("div",{className:ce.preview,children:[i.jsx("span",{className:ce.label,children:"Preview"}),i.jsxs("div",{className:ce.block,children:[i.jsx("span",{className:ce.slug,children:m||"yoursite.url"}),i.jsx("span",{className:ce.title,children:g||"My Blank Page"}),i.jsx("span",{className:ce.description,children:S||"It is My Description"})]})]})]}),i.jsxs("div",{className:ce.buttons,children:[i.jsx(j.ButtonSettings,{onClick:w,type:"Secondary",children:"Cancel"}),i.jsx(j.ButtonSettings,{onClick:o?M:N,disabled:m.length===0,type:"Primary",children:o?"Update":"Create"})]})]})};exports.CSS=Ye;exports.DndContext=ms;exports.Fuse=Oe;exports.Header=Gi;exports.ModifyPage=ku;exports.Navbar=na;exports.PointerSensor=Rt;exports.Preview=$a;exports.RenderAnnouncement=fn;exports.RenderBlock=Tt;exports.RenderFooter=dn;exports.RenderHeader=hn;exports.Sidebar=fu;exports.SortableContext=_s;exports.index=Us;exports.useSensor=ts;exports.useSensors=ns;exports.useSortable=ws;exports.verticalListSortingStrategy=xs;
|