@billgangcom/theme-lib 1.122.0 → 1.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{builder-DOCPzptl.cjs → builder-BNQD7fm1.cjs} +13 -13
  2. package/dist/{builder-BDWYOk4o.js → builder-Cbzb-Pzj.js} +805 -805
  3. package/dist/{builder-components-CvexDBBH.js → builder-components-B6Ct-1cI.js} +699 -699
  4. package/dist/builder-components-B8gWw88v.cjs +5 -0
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +23 -23
  7. package/dist/{charge-C15xUj35.js → charge-Bv8wu-fV.js} +7 -7
  8. package/dist/{charge-CJQibcfu.cjs → charge-DcKd_es2.cjs} +2 -2
  9. package/dist/{checkout-CpzLu5oq.cjs → checkout-BQwNBpVW.cjs} +1 -1
  10. package/dist/{checkout-BrL3RJUF.js → checkout-DkIvY2zs.js} +5 -5
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-BWWTIm1T.js → index-BHLQHIsH.js} +2 -2
  14. package/dist/{index-DOXo55nb.js → index-BIfw5wrd.js} +5 -5
  15. package/dist/{index-BHCz9QsY.cjs → index-BYdRgPyI.cjs} +1 -1
  16. package/dist/{index-LHU1sHHV.js → index-Bk-mY9E3.js} +5 -5
  17. package/dist/{index-DYH2kLjz.cjs → index-BnMpELp_.cjs} +1 -1
  18. package/dist/{index-Duey4obm.cjs → index-BtqOzf1F.cjs} +1 -1
  19. package/dist/{index-CaE8IYfM.js → index-C-OH-0Jj.js} +1 -1
  20. package/dist/{index-DNSijKmM.js → index-CtZBWOyf.js} +5 -5
  21. package/dist/{index-foFJrz8D.js → index-D1W9Fza6.js} +5 -5
  22. package/dist/{index-C0e_BhGQ.cjs → index-DoklSmf4.cjs} +1 -1
  23. package/dist/{index-Dcnqy8X3.cjs → index-DozNvPOR.cjs} +1 -1
  24. package/dist/{index-Bxaj05Fb.cjs → index-Dyg2ZZW6.cjs} +1 -1
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.es.js +6 -6
  27. package/dist/{order-DNKJ-JsD.cjs → order-B0gf5VEi.cjs} +1 -1
  28. package/dist/{order-C-Ur9Jbh.js → order-S6e2WcCX.js} +5 -5
  29. package/dist/src/builder/components/ExitButton/index.d.ts +1 -4
  30. package/dist/style.css +1 -1
  31. package/dist/{subscription-B6uyLDB4.cjs → subscription-5ytxlwXp.cjs} +1 -1
  32. package/dist/{subscription-BySRgrl2.js → subscription-HEpvSKgZ.js} +5 -5
  33. package/dist/{ticket-DWQeThhP.cjs → ticket-C5g3kw8c.cjs} +1 -1
  34. package/dist/{ticket-FYGZ32D-.js → ticket-CbQabuyp.js} +5 -5
  35. package/dist/{top-up-BO5_olGw.cjs → top-up-CrbYB293.cjs} +1 -1
  36. package/dist/{top-up-IV8ZjQ3f.js → top-up-lubckd9w.js} +5 -5
  37. package/dist/{ui-components-CiVZSTvC.js → ui-components-BhVIVLV-.js} +2214 -2210
  38. package/dist/ui-components-jkqz3-Kc.cjs +1 -0
  39. package/dist/ui.cjs.js +1 -1
  40. package/dist/ui.es.js +1 -1
  41. package/dist/{validation-2cuCf_Ob.cjs → validation-Be-6h5-8.cjs} +1 -1
  42. package/dist/{validation-D7cnZ3qf.js → validation-lwFWEACU.js} +5 -5
  43. package/package.json +1 -1
  44. package/dist/builder-components-Bb96v4TW.cjs +0 -5
  45. package/dist/ui-components-CencTE96.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-CencTE96.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-jkqz3-Kc.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-CiVZSTvC.js";
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-BhVIVLV-.js";
2
2
  export {
3
3
  t as Accordion,
4
4
  e as AlignText,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-CJQibcfu.cjs"),d=require("./builder-DOCPzptl.cjs"),u=require("./ui-components-CencTE96.cjs");require("./builder-components-Bb96v4TW.cjs");require("react-dom");require("./ticket-DWQeThhP.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-DcKd_es2.cjs"),d=require("./builder-BNQD7fm1.cjs"),u=require("./ui-components-jkqz3-Kc.cjs");require("./builder-components-B8gWw88v.cjs");require("react-dom");require("./ticket-C5g3kw8c.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;
@@ -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 { Z as g } from "./charge-C15xUj35.js";
4
- import { K as I, N as x, ac as N, p as b } from "./builder-BDWYOk4o.js";
5
- import { I as y, f as k, g as L, e as E } from "./ui-components-CiVZSTvC.js";
6
- import "./builder-components-CvexDBBH.js";
3
+ import { Z as g } from "./charge-Bv8wu-fV.js";
4
+ import { K as I, N as x, ac as N, p as b } from "./builder-Cbzb-Pzj.js";
5
+ import { I as y, f as k, g as L, e as E } from "./ui-components-BhVIVLV-.js";
6
+ import "./builder-components-B6Ct-1cI.js";
7
7
  import "react-dom";
8
- import "./ticket-FYGZ32D-.js";
8
+ import "./ticket-CbQabuyp.js";
9
9
  const V = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C = "_info_1mxa7_31", q = "_buttons_1mxa7_38", B = "_button_1mxa7_38", K = "_input_1mxa7_50", R = "_error_1mxa7_57", t = {
10
10
  lock: V,
11
11
  wrapper: G,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.122.0",
3
+ "version": "1.123.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,5 +0,0 @@
1
- "use strict";const r=require("react/jsx-runtime"),f=require("react"),l=require("./builder-DOCPzptl.cjs"),k=require("./ui-components-CencTE96.cjs"),ct=require("react-dom");require("./charge-CJQibcfu.cjs");require("./ticket-DWQeThhP.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:i}=l.useBlocksStore();if(!i||!n)return null;const c=new i;return Object.keys(n).map(a=>{c[a]=n[a]}),c.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:i}=l.useBlocksStore();if(!i||!n)return null;const c=new i;return Object.keys(n).map(a=>{c[a]=n[a]}),c.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:i}=l.useBlocksStore();if(!i||!n)return null;const c=new i;return Object.keys(n).map(a=>{c[a]=n[a]}),c.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 qe(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?qe(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 qe(e)?!1:e instanceof J(e).HTMLElement}function Qn(e){return e instanceof J(e).SVGElement}function Xe(e){return e?qe(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((i,c)=>{const a=Object.entries(c);for(const[u,h]of a){const d=i[u];d!=null&&(i[u]=d+e*h)}return i},{...t})}}const Ye=Zn(1),Nt=Zn(-1);function Ys(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 Gs(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function Zt(e){if(Gs(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 Ys(e)?{x:e.clientX,y:e.clientY}:null}const Ge=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[Ge.Translate.toString(e),Ge.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),En="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qs(e){return e.matches(En)?e:e.querySelector(En)}const Xs={display:"none"};function Js(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:Xs},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:i}=s;e.forEach(c=>{var a;return(a=c[o])==null?void 0:a.call(c,i)})},[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:i,announcement:c}=Zs(),a=pt("DndLiveRegion"),[u,h]=f.useState(!1);if(f.useEffect(()=>{h(!0)},[]),eo(f.useMemo(()=>({onDragStart(p){let{active:v}=p;i(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:m}=p;t.onDragMove&&i(t.onDragMove({active:v,over:m}))},onDragOver(p){let{active:v,over:m}=p;i(t.onDragOver({active:v,over:m}))},onDragEnd(p){let{active:v,over:m}=p;i(t.onDragEnd({active:v,over:m}))},onDragCancel(p){let{active:v,over:m}=p;i(t.onDragCancel({active:v,over:m}))}}),[i,t])),!u)return null;const d=f.createElement(f.Fragment,null,f.createElement(Js,{id:s,value:o.draggable}),f.createElement(Qs,{id:a,announcement:c}));return n?ct.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 co(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),i=Math.min(t.top+t.height,e.top+e.height),c=o-s,a=i-n;if(s<o&&n<i){const u=t.width*t.height,h=e.width*e.height,d=c*a,p=d/(u+h-d);return Number(p.toFixed(4))}return 0}const ao=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const i of s){const{id:c}=i,a=n.get(c);if(a){const u=co(a,t);u>0&&o.push({id:c,data:{droppableContainer:i,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),i=1;i<s;i++)o[i-1]=arguments[i];return o.reduce((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.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:i,x:c,y:a}=s,u=e.left-c-(1-o)*parseFloat(n),h=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,p=i?e.height/i: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:i,height:c,bottom:a,right:u}=n;return{top:s,left:o,width:i,height:c,bottom:a,right:u}}function Bn(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 i=t[o];return typeof i=="string"?n.test(i):!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 i=J(e).getComputedStyle(o);return o!==e&&bo(o,i)&&n.push(o),vo(o,i)?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:qe(e)?e:gn(e)?pn(e)||e===Xe(e).scrollingElement?window:ft(e)?e:null:null}function rs(e){return qe(e)?e.scrollX:e.scrollLeft}function is(e){return qe(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 cs(e){return!Mt||!e?!1:e===document.scrollingElement}function as(e){const t={x:0,y:0},n=cs(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,i=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,a=e.scrollLeft>=s.x;return{isTop:o,isLeft:i,isBottom:c,isRight:a,maxScroll:s,minScroll:t}}const xo={x:.2,y:.2};function So(e,t,n,s,o){let{top:i,left:c,right:a,bottom:u}=n;s===void 0&&(s=10),o===void 0&&(o=xo);const{isTop:h,isBottom:d,isLeft:p,isRight:v}=as(e),m={x:0,y:0},_={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!h&&i<=t.top+g.height?(m.y=U.Backward,_.y=s*Math.abs((t.top+g.height-i)/g.height)):!d&&u>=t.bottom-g.height&&(m.y=U.Forward,_.y=s*Math.abs((t.bottom-g.height-u)/g.height)),!v&&a>=t.right-g.width?(m.x=U.Forward,_.x=s*Math.abs((t.right-g.width-a)/g.width)):!p&&c<=t.left+g.width&&(m.x=U.Backward,_.x=s*Math.abs((t.left+g.width-c)/g.width)),{direction:m,speed:_}}function wo(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}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)=>Ye(t,en(n)),ue)}function _o(e){return e.reduce((t,n)=>t+rs(n),0)}function yo(e){return e.reduce((t,n)=>t+is(n),0)}function Co(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:s,bottom:o,right:i}=t(e);os(e)&&(o<=0||i<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const jo=[["x",["left","right"],_o],["y",["top","bottom"],yo]];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[i,c,a]of jo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const h=a(s),d=o[i]-h;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class at{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 ko(e){const{EventTarget:t}=J(e);return e instanceof t?e:Xe(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 L;(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"})(L||(L={}));const us={start:[L.Space,L.Enter],cancel:[L.Esc],end:[L.Space,L.Enter,L.Tab]},No=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case L.Right:return{...n,x:n.x+25};case L.Left:return{...n,x:n.x-25};case L.Down:return{...n,y:n.y+25};case L.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 at(Xe(n)),this.windowListeners=new at(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&&Co(s),n(ue)}handleKeyDown(t){if(vn(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:i=us,coordinateGetter:c=No,scrollBehavior:a="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.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=c(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:y,isLeft:b,isBottom:A,maxScroll:j,minScroll:C}=as(g),w=wo(g),N={x:Math.min(x===L.Right?w.right-w.width/2:w.right,Math.max(x===L.Right?w.left:w.left+w.width/2,p.x)),y:Math.min(x===L.Down?w.bottom-w.height/2:w.bottom,Math.max(x===L.Down?w.top:w.top+w.height/2,p.y))},M=x===L.Right&&!y||x===L.Left&&!b,$=x===L.Down&&!A||x===L.Up&&!S;if(M&&N.x!==p.x){const R=g.scrollLeft+v.x,D=x===L.Right&&R<=j.x||x===L.Left&&R>=C.x;if(D&&!v.y){g.scrollTo({left:R,behavior:a});return}D?m.x=g.scrollLeft-R:m.x=x===L.Right?g.scrollLeft-j.x:g.scrollLeft-C.x,m.x&&g.scrollBy({left:-m.x,behavior:a});break}else if($&&N.y!==p.y){const R=g.scrollTop+v.y,D=x===L.Down&&R<=j.y||x===L.Up&&R>=C.y;if(D&&!v.x){g.scrollTo({top:R,behavior:a});return}D?m.y=g.scrollTop-R:m.y=x===L.Down?g.scrollTop-j.y:g.scrollTop-C.y,m.y&&g.scrollBy({top:-m.y,behavior:a});break}}this.handleMove(t,Ye(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:i}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const a=i.activatorNode.current;return a&&e.target!==a?!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=ko(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=Xe(c),this.documentListeners=new at(this.document),this.listeners=new at(s),this.windowListeners=new at(J(c)),this.initialCoordinates=(o=Zt(i))!=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:i}=this,{onMove:c,options:{activationConstraint:a}}=i;if(!o)return;const u=(n=Zt(t))!=null?n:ue,h=Nt(o,u);if(!s&&a){if(Tn(a)){if(a.tolerance!=null&&Wt(h,a.tolerance))return this.handleCancel();if(Wt(h,a.distance))return this.handleStart()}if(Mn(a)&&Wt(h,a.tolerance))return this.handleCancel();this.handlePending(a,h);return}t.cancelable&&t.preventDefault(),c(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===L.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=Xe(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 Eo={move:{name:"mousemove"},end:{name:"mouseup"}};var tn;(function(e){e[e.RightClick=2]="RightClick"})(tn||(tn={}));class Bo extends Sn{constructor(t){super(t,Eo,Xe(t.event.target))}}Bo.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 Et;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Et||(Et={}));function To(e){let{acceleration:t,activator:n=lt.Pointer,canScroll:s,draggingRect:o,enabled:i,interval:c=5,order:a=Et.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:d,delta:p,threshold:v}=e;const m=Ro({delta:p,disabled:!i}),[_,g]=Ks(),x=f.useRef({x:0,y:0}),S=f.useRef({x:0,y:0}),y=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 C=b.current;if(!C)return;const w=x.current.x*S.current.x,N=x.current.y*S.current.y;C.scrollBy(w,N)},[]),j=f.useMemo(()=>a===Et.TreeOrder?[...h].reverse():h,[a,h]);f.useEffect(()=>{if(!i||!h.length||!y){g();return}for(const C of j){if((s==null?void 0:s(C))===!1)continue;const w=h.indexOf(C),N=d[w];if(!N)continue;const{direction:M,speed:$}=So(C,N,y,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=C,_(A,c),x.current=$,S.current=M;return}}x.current={x:0,y:0},S.current={x:0,y:0},g()},[t,A,s,g,i,c,JSON.stringify(y),JSON.stringify(m),_,h,j,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 i={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[U.Backward]:o.x[U.Backward]||i.x===-1,[U.Forward]:o.x[U.Forward]||i.x===1},y:{[U.Backward]:o.y[U.Backward]||i.y===-1,[U.Forward]:o.y[U.Forward]||i.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 i;return t==null?null:(i=s??o)!=null?i:null},[s,t])}function Lo(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:o}=s,i=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...i]},[]),[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 Oo(e,t){let{dragging:n,dependencies:s,config:o}=t;const[i,c]=f.useState(null),{frequency:a,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&&c(y=>y===null?S:y.concat(S.filter(b=>!y.includes(b))))},[v]),_=f.useRef(null),g=gt(S=>{if(p&&!n)return Rn;if(!S||S===Rn||d.current!==e||i!=null){const y=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){y.set(b.id,b.rect.current);continue}const A=b.node.current,j=A?new xn(u(A),A):null;b.rect.current=j,j&&y.set(b.id,j)}return y}return S},[e,i,n,p,u]);return f.useEffect(()=>{d.current=e},[e]),f.useEffect(()=>{p||m()},[n,p]),f.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),f.useEffect(()=>{p||typeof a!="number"||_.current!==null||(_.current=setTimeout(()=>{m(),_.current=null},a))},[a,p,m,...s]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:i!=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:i}=window;return new i(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:i}=window;return new i(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 i(){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 c=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)){i();break}}}}),a=Pt({callback:i});return be(()=>{i(),e?(a==null||a.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),c==null||c.disconnect())},[e]),s}function Ho(e){const t=hs(e);return ss(e,t)}const Ln=[];function Wo(e){const t=f.useRef(e),n=gt(s=>e?s&&s!==Ln&&e&&t.current&&e.parentNode===t.current.parentNode?s:bn(e):Ln,[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(i=>{const c=Ht(i.target);c&&n(a=>a?(a.set(c,en(c)),new Map(a)):null)},[]);return f.useEffect(()=>{const i=s.current;if(e!==i){c(i);const a=e.map(u=>{const h=Ht(u);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,en(h)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),s.current=e}return()=>{c(e),c(i)};function c(a){a.forEach(u=>{const h=Ht(u);h==null||h.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Ye(i,c),ue):ls(e):ue,[e,t])}function On(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:i}=s;return n[o]=c=>{i(c,t)},n},{}),[e,t])}function fs(e){return f.useMemo(()=>e?mo(e):null,[e])}const $n=[];function Yo(e,t){t===void 0&&(t=Je);const[n]=e,s=fs(n?J(n):null),[o,i]=f.useState($n);function c(){i(()=>e.length?e.map(u=>cs(u)?s:new xn(t(u),u)):$n)}const a=Pt({callback:c});return be(()=>{a==null||a.disconnect(),c(),e.forEach(u=>a==null?void 0:a.observe(u))},[e]),o}function Go(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ft(t)?t:e}function qo(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]),i=Pt({callback:o}),c=f.useCallback(h=>{const d=Go(h);i==null||i.disconnect(),d&&(i==null||i.observe(d)),s(d?t(d):null)},[t,i]),[a,u]=At(c);return f.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const Xo=[{sensor:Rt,options:{}},{sensor:ds,options:{}}],Jo={current:{}},kt={draggable:{measure:Bn},droppable:{measure:Bn,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:kt,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},Lt=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,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const c=new ut(e.droppable.containers);return c.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case W.UnregisterDroppable:{const{id:n,key:s}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const i=new ut(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function nr(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=f.useContext(Lt),i=Qt(s),c=Qt(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&i&&c!=null){if(!vn(i)||document.activeElement===i.target)return;const a=o.get(c);if(!a)return;const{activatorNode:u,node:h}=a;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const d of[u.current,h.current]){if(!d)continue;const p=qs(d);if(p){p.focus();break}}})}},[s,t,o,c,i]),null}function sr(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...s}),n):n}function or(e){return f.useMemo(()=>({draggable:{...kt.draggable,...e==null?void 0:e.draggable},droppable:{...kt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...kt.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 i=f.useRef(!1),{x:c,y:a}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!c&&!a||!t){i.current=!1;return}if(i.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(c||(p.x=0),a||(p.y=0),i.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,c,a,s,n])}const ps=f.createContext({...ue,scaleX:1,scaleY:1});var De;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(De||(De={}));const ms=f.memo(function(t){var n,s,o,i;let{id:c,accessibility:a,autoScroll:u=!0,children:h,sensors:d=Xo,collisionDetection:p=ao,measuring:v,modifiers:m,..._}=t;const g=f.useReducer(tr,void 0,er),[x,S]=g,[y,b]=to(),[A,j]=f.useState(De.Uninitialized),C=A===De.Initialized,{draggable:{active:w,nodes:N,translate:M},droppable:{containers:$}}=x,R=w!=null?N.get(w):null,D=f.useRef({initial:null,translated:null}),P=f.useMemo(()=>{var Y;return w!=null?{id:w,data:(Y=R==null?void 0:R.data)!=null?Y:Jo,rect:D}:null},[w,R]),T=f.useRef(null),[z,q]=f.useState(null),[B,H]=f.useState(null),re=dt(_,Object.values(_)),Ce=pt("DndDescribedBy",c),Oe=f.useMemo(()=>$.getEnabled(),[$]),K=or(v),{droppableRects:ie,measureDroppableContainers:de,measuringScheduled:Me}=Oo(Oe,{dragging:C,dependencies:[M.x,M.y],config:K.droppable}),O=Po(N,w),$e=f.useMemo(()=>B?Zt(B):null,[B]),je=Ws(),xe=$o(O,K.draggable.measure);rr({activeNode:w!=null?N.get(w):null,config:je.layoutShiftCompensation,initialRect:xe,measure:K.draggable.measure});const F=Pn(O,K.draggable.measure,xe),Qe=Pn(O?O.parentElement:null),he=f.useRef({activatorEvent:null,active:null,activeNode:O,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=qo({measure:K.dragOverlay.measure}),ze=(s=Se.nodeRef.current)!=null?s:O,He=C?(o=Se.rect)!=null?o:F:null,_n=!!(Se.nodeRef.current&&Se.rect),yn=Ho(_n?null:F),Ot=fs(ze?J(ze):null),ke=Wo(C?Fe??O:null),vt=Yo(ke),bt=sr(m,{transform:{x:M.x-yn.x,y:M.y-yn.y,scaleX:1,scaleY:1},activatorEvent:B,active:P,activeNodeRect:F,containerNodeRect:Qe,draggingNodeRect:He,over:he.current.over,overlayNodeRect:Se.rect,scrollableAncestors:ke,scrollableAncestorRects:vt,windowRect:Ot}),Cn=$e?Ye($e,M):null,jn=Uo(ke),Ps=On(jn),Ls=On(jn,[F]),We=Ye(bt,Ps),Ue=He?ho(He,bt):null,Ze=P&&Ue?p({active:P,collisionRect:Ue,droppableRects:ie,droppableContainers:Oe,pointerCoordinates:Cn}):null,kn=io(Ze,"id"),[Ae,An]=f.useState(null),Os=_n?bt:Ye(bt,Ls),$s=lo(Os,(i=Ae==null?void 0:Ae.rect)!=null?i:null,F),$t=f.useRef(null),Nn=f.useCallback((Y,Q)=>{let{sensor:Z,options:Ne}=Q;if(T.current==null)return;const ne=N.get(T.current);if(!ne)return;const ee=Y.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,we={id:V};ge==null||ge(we),y({type:"onDragAbort",event:we})},onPending(V,Ie,ge,we){if(!N.get(V))return;const{onDragPending:tt}=re.current,Ee={id:V,constraint:Ie,initialCoordinates:ge,offset:we};tt==null||tt(Ee),y({type:"onDragPending",event:Ee})},onStart(V){const Ie=T.current;if(Ie==null)return;const ge=N.get(Ie);if(!ge)return;const{onDragStart:we}=re.current,et={activatorEvent:ee,active:{id:Ie,data:ge.data,rect:D}};ct.unstable_batchedUpdates(()=>{we==null||we(et),j(De.Initializing),S({type:W.DragStart,initialCoordinates:V,active:Ie}),y({type:"onDragStart",event:et}),q($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:we,over:et,scrollAdjustedTranslate:tt}=he.current;let Ee=null;if(ge&&tt){const{cancelDrop:nt}=re.current;Ee={activatorEvent:ee,active:ge,collisions:we,delta:tt,over:et},V===W.DragEnd&&typeof nt=="function"&&await Promise.resolve(nt(Ee))&&(V=W.DragCancel)}T.current=null,ct.unstable_batchedUpdates(()=>{S({type:V}),j(De.Uninitialized),An(null),q(null),H(null),$t.current=null;const nt=V===W.DragEnd?"onDragEnd":"onDragCancel";if(Ee){const Ft=re.current[nt];Ft==null||Ft(Ee),y({type:nt,event:Ee})}})}}},[N]),Fs=f.useCallback((Y,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};Y(Z,Q.options,fe)===!0&&(ne.dndKit={capturedBy:Q.sensor},T.current=Ne,Nn(Z,Q))},[N,Nn]),In=Lo(d,Fs);Vo(d),be(()=>{F&&A===De.Initializing&&j(De.Initialized)},[F,A]),f.useEffect(()=>{const{onDragMove:Y}=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};ct.unstable_batchedUpdates(()=>{Y==null||Y(ee),y({type:"onDragMove",event:ee})})},[We.x,We.y]),f.useEffect(()=>{const{active:Y,activatorEvent:Q,collisions:Z,droppableContainers:Ne,scrollAdjustedTranslate:ne}=he.current;if(!Y||T.current==null||!Q||!ne)return;const{onDragOver:ee}=re.current,fe=Ne.get(kn),Ve=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,V={active:Y,activatorEvent:Q,collisions:Z,delta:{x:ne.x,y:ne.y},over:Ve};ct.unstable_batchedUpdates(()=>{An(Ve),ee==null||ee(V),y({type:"onDragOver",event:V})})},[kn]),be(()=>{he.current={activatorEvent:B,active:P,activeNode:O,collisionRect:Ue,collisions:Ze,droppableRects:ie,draggableNodes:N,draggingNode:ze,draggingNodeRect:He,droppableContainers:$,over:Ae,scrollableAncestors:ke,scrollAdjustedTranslate:We},D.current={initial:He,translated:Ue}},[P,O,Ze,Ue,N,ze,He,ie,$,Ae,ke,We]),To({...je,delta:M,draggingRect:Ue,pointerCoordinates:Cn,scrollableAncestors:ke,scrollableAncestorRects:vt});const zs=f.useMemo(()=>({active:P,activeNode:O,activeNodeRect:F,activatorEvent:B,collisions:Ze,containerNodeRect:Qe,dragOverlay:Se,draggableNodes:N,droppableContainers:$,droppableRects:ie,over:Ae,measureDroppableContainers:de,scrollableAncestors:ke,scrollableAncestorRects:vt,measuringConfiguration:K,measuringScheduled:Me,windowRect:Ot}),[P,O,F,B,Ze,Qe,Se,N,$,ie,Ae,de,ke,vt,K,Me,Ot]),Hs=f.useMemo(()=>({activatorEvent:B,activators:In,active:P,activeNodeRect:F,ariaDescribedById:{draggable:Ce},dispatch:S,draggableNodes:N,over:Ae,measureDroppableContainers:de}),[B,In,P,F,S,Ce,N,Ae,de]);return f.createElement(es.Provider,{value:b},f.createElement(Lt.Provider,{value:Hs},f.createElement(gs.Provider,{value:zs},f.createElement(ps.Provider,{value:$s},h)),f.createElement(nr,{disabled:(a==null?void 0:a.restoreFocus)===!1})),f.createElement(oo,{...a,hiddenTextDescribedById:Ce}));function Ws(){const Y=(z==null?void 0:z.autoScrollEnabled)===!1,Q=typeof u=="object"?u.enabled===!1:u===!1,Z=C&&!Y&&!Q;return typeof u=="object"?{...u,enabled:Z}:{enabled:Z}}}),ir=f.createContext(null),Fn="button",cr="Draggable";function ar(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const i=pt(cr),{activators:c,activatorEvent:a,active:u,activeNodeRect:h,ariaDescribedById:d,draggableNodes:p,over:v}=f.useContext(Lt),{role:m=Fn,roleDescription:_="draggable",tabIndex:g=0}=o??{},x=(u==null?void 0:u.id)===t,S=f.useContext(x?ps:ir),[y,b]=At(),[A,j]=At(),C=Ko(c,t),w=dt(n);be(()=>(p.set(t,{id:t,key:i,node:y,activatorNode:A,data:w}),()=>{const M=p.get(t);M&&M.key===i&&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:a,activeNodeRect:h,attributes:N,isDragging:x,listeners:s?void 0:C,node:y,over:v,setNodeRef:b,setActivatorNodeRef:j,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 i=pt(ur),{active:c,dispatch:a,over:u,measureDroppableContainers:h}=f.useContext(Lt),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),y=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:y,disabled:_||!c}),A=f.useCallback((N,M)=>{b&&(M&&(b.unobserve(M),p.current=!1),N&&b.observe(N))},[b]),[j,C]=At(A),w=dt(t);return f.useEffect(()=>{!b||!j.current||(b.disconnect(),p.current=!1,b.observe(j.current))},[j,b]),f.useEffect(()=>(a({type:W.RegisterDroppable,element:{id:s,key:i,disabled:n,node:j,rect:v,data:w}}),()=>a({type:W.UnregisterDroppable,key:i,id:s})),[s]),f.useEffect(()=>{n!==d.current.disabled&&(a({type:W.SetDroppableDisabled,id:s,key:i,disabled:n}),d.current.disabled=n)},[s,i,n,a]),{active:c,rect:v,isOver:(u==null?void 0:u.id)===s,node:j,over:u,setNodeRef:C}}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 i=t.get(s);return i&&(n[o]=i),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 i=vs(t,s,n),c=t[o],a=i[o];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},St={scaleX:1,scaleY:1},xs=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:o,rects:i,overIndex:c}=e;const a=(t=i[n])!=null?t:s;if(!a)return null;if(o===n){const h=i[c];return h?{x:0,y:n<c?h.top+h.height-(a.top+a.height):h.top-a.top,...St}:null}const u=mr(i,o,n);return o>n&&o<=c?{x:0,y:-a.height-u,...St}:o<n&&o>=c?{x:0,y:a.height+u,...St}:{x:0,y:0,...St}};function mr(e,t,n){const s=e[t],o=e[t-1],i=e[t+1];return s?n<t?o?s.top-(o.top+o.height):i?i.top-(s.top+s.height):0:i?i.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const Ss="Sortable",ws=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:i=!1}=e;const{active:c,dragOverlay:a,droppableRects:u,over:h,measureDroppableContainers:d}=lr(),p=pt(Ss,n),v=a.rect!==null,m=f.useMemo(()=>s.map(C=>typeof C=="object"&&"id"in C?C.id:C),[s]),_=c!=null,g=c?m.indexOf(c.id):-1,x=h?m.indexOf(h.id):-1,S=f.useRef(m),y=!gr(m,S.current),b=x!==-1&&g===-1||y,A=pr(i);be(()=>{y&&_&&d(m)},[y,m,_,d]),f.useEffect(()=>{S.current=m},[m]);const j=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(ws.Provider,{value:j},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:i,newIndex:c,previousItems:a,previousContainerId:u,transition:h}=e;return!h||!s||a!==i&&o===c?!1:n?!0:c!==o&&t===u},xr={duration:200,easing:"ease"},ys="transform",Sr=Ge.Transition.toString({property:ys,duration:0,easing:"linear"}),wr={roleDescription:"sortable"};function _r(e){let{disabled:t,index:n,node:s,rect:o}=e;const[i,c]=f.useState(null),a=f.useRef(n);return be(()=>{if(!t&&n!==a.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)&&c(d)}}n!==a.current&&(a.current=n)},[t,n,s,o]),f.useEffect(()=>{i&&c(null)},[i]),i}function Cs(e){let{animateLayoutChanges:t=br,attributes:n,disabled:s,data:o,getNewIndex:i=vr,id:c,strategy:a,resizeObserverConfig:u,transition:h=xr}=e;const{items:d,containerId:p,activeIndex:v,disabled:m,disableTransforms:_,sortedRects:g,overIndex:x,useDragOverlay:S,strategy:y}=f.useContext(ws),b=yr(s,m),A=d.indexOf(c),j=f.useMemo(()=>({sortable:{containerId:p,index:A,items:d},...o}),[p,o,A,d]),C=f.useMemo(()=>d.slice(d.indexOf(c)),[d,c]),{rect:w,node:N,isOver:M,setNodeRef:$}=hr({id:c,data:j,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...u}}),{active:R,activatorEvent:D,activeNodeRect:P,attributes:T,setNodeRef:z,listeners:q,isDragging:B,over:H,setActivatorNodeRef:re,transform:Ce}=ar({id:c,data:j,attributes:{...wr,...n},disabled:b.draggable}),Oe=Vs($,z),K=!!R,ie=K&&!_&&xt(v)&&xt(x),de=!S&&B,Me=de&&ie?Ce:null,$e=ie?Me??(a??y)({rects:g,activeNodeRect:P,activeIndex:v,overIndex:x,index:A}):null,je=xt(v)&&xt(x)?i({id:c,items:d,activeIndex:v,overIndex:x}):A,xe=R==null?void 0:R.id,F=f.useRef({activeId:xe,items:d,newIndex:je,containerId:p}),Qe=d!==F.current.items,he=t({active:R,containerId:p,isDragging:B,isSorting:K,id:c,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:w});return f.useEffect(()=>{K&&F.current.newIndex!==je&&(F.current.newIndex=je),p!==F.current.containerId&&(F.current.containerId=p),d!==F.current.items&&(F.current.items=d)},[K,je,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:j,rect:w,index:A,newIndex:je,items:d,isOver:M,isSorting:K,isDragging:B,listeners:q,node:N,overIndex:x,over:H,setNodeRef:Oe,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 Ge.Transition.toString({...h,property:ys})}}function yr(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}}L.Down,L.Right,L.Up,L.Left;function ye(e){return Array.isArray?Array.isArray(e):As(e)==="[object Array]"}function Cr(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function jr(e){return e==null?"":Cr(e)}function ve(e){return typeof e=="string"}function js(e){return typeof e=="number"}function kr(e){return e===!0||e===!1||Ar(e)&&As(e)=="[object Boolean]"}function ks(e){return typeof e=="object"}function Ar(e){return ks(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}`,Er=e=>`Pattern length exceeds max of ${e}.`,Br=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,i=null;if(ve(e)||ye(e))s=e,t=Hn(e),n=sn(e);else{if(!zn.call(e,"name"))throw new Error(Br("name"));const c=e.name;if(s=c,zn.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(Dr(c));t=Hn(c),n=sn(c),i=e.getFn}return{path:t,id:n,weight:o,src:s,getFn:i}}function Hn(e){return ye(e)?e:e.split(".")}function sn(e){return ye(e)?e.join("."):e}function Mr(e,t){let n=[],s=!1;const o=(i,c,a)=>{if(te(i))if(!c[a])n.push(i);else{let u=c[a];const h=i[u];if(!te(h))return;if(a===c.length-1&&(ve(h)||js(h)||kr(h)))n.push(jr(h));else if(ye(h)){s=!0;for(let d=0,p=h.length;d<p;d+=1)o(h[d],c,a+1)}else c.length&&o(h,c,a+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},Lr={location:0,threshold:.6,distance:100},Or={useExtendedSearch:!1,getFn:Mr,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var E={...Pr,...Rr,...Lr,...Or};const $r=/[^ ]+/g;function Fr(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(o){const i=o.match($r).length;if(n.has(i))return n.get(i);const c=1/Math.pow(i,.5*e),a=parseFloat(Math.round(c*s)/s);return n.set(i,a),a},clear(){n.clear()}}}class wn{constructor({getFn:t=E.getFn,fieldNormWeight:n=E.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,i)=>{let c=o.getFn?o.getFn(t):this.getFn(t,o.path);if(te(c)){if(ye(c)){let a=[];const u=[{nestedArrIndex:-1,value:c}];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)};a.push(p)}else ye(d)&&d.forEach((p,v)=>{u.push({nestedArrIndex:v,value:p})})}s.$[i]=a}else if(ve(c)&&!Vt(c)){let a={v:c,n:this.norm.get(c)};s.$[i]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function Is(e,t,{getFn:n=E.getFn,fieldNormWeight:s=E.fieldNormWeight}={}){const o=new wn({getFn:n,fieldNormWeight:s});return o.setKeys(e.map(Ns)),o.setSources(t),o.create(),o}function zr(e,{getFn:t=E.getFn,fieldNormWeight:n=E.fieldNormWeight}={}){const{keys:s,records:o}=e,i=new wn({getFn:t,fieldNormWeight:n});return i.setKeys(s),i.setIndexRecords(o),i}function wt(e,{errors:t=0,currentLocation:n=0,expectedLocation:s=0,distance:o=E.distance,ignoreLocation:i=E.ignoreLocation}={}){const c=t/e.length;if(i)return c;const a=Math.abs(s-n);return o?c+a/o:a?1:c}function Hr(e=[],t=E.minMatchCharLength){let n=[],s=-1,o=-1,i=0;for(let c=e.length;i<c;i+=1){let a=e[i];a&&s===-1?s=i:!a&&s!==-1&&(o=i-1,o-s+1>=t&&n.push([s,o]),s=-1)}return e[i-1]&&i-s>=t&&n.push([s,i-1]),n}const Pe=32;function Wr(e,t,n,{location:s=E.location,distance:o=E.distance,threshold:i=E.threshold,findAllMatches:c=E.findAllMatches,minMatchCharLength:a=E.minMatchCharLength,includeMatches:u=E.includeMatches,ignoreLocation:h=E.ignoreLocation}={}){if(t.length>Pe)throw new Error(Er(Pe));const d=t.length,p=e.length,v=Math.max(0,Math.min(s,p));let m=i,_=v;const g=a>1||u,x=g?Array(p):[];let S;for(;(S=e.indexOf(t,_))>-1;){let w=wt(t,{currentLocation:S,expectedLocation:v,distance:o,ignoreLocation:h});if(m=Math.min(w,m),_=S+d,g){let N=0;for(;N<d;)x[S+N]=1,N+=1}}_=-1;let y=[],b=1,A=d+p;const j=1<<d-1;for(let w=0;w<d;w+=1){let N=0,M=A;for(;N<M;)wt(t,{errors:w,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=c?p:Math.min(v+M,p)+d,D=Array(R+2);D[R+1]=(1<<w)-1;for(let T=R;T>=$;T-=1){let z=T-1,q=n[e.charAt(z)];if(g&&(x[z]=+!!q),D[T]=(D[T+1]<<1|1)&q,w&&(D[T]|=(y[T+1]|y[T])<<1|1|y[T+1]),D[T]&j&&(b=wt(t,{errors:w,currentLocation:z,expectedLocation:v,distance:o,ignoreLocation:h}),b<=m)){if(m=b,_=z,_<=v)break;$=Math.max(1,2*v-_)}}if(wt(t,{errors:w+1,currentLocation:v,expectedLocation:v,distance:o,ignoreLocation:h})>m)break;y=D}const C={isMatch:_>=0,score:Math.max(.001,b)};if(g){const w=Hr(x,a);w.length?u&&(C.indices=w):C.isMatch=!1}return C}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 Bt=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 Es{constructor(t,{location:n=E.location,threshold:s=E.threshold,distance:o=E.distance,includeMatches:i=E.includeMatches,findAllMatches:c=E.findAllMatches,minMatchCharLength:a=E.minMatchCharLength,isCaseSensitive:u=E.isCaseSensitive,ignoreDiacritics:h=E.ignoreDiacritics,ignoreLocation:d=E.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:o,includeMatches:i,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d},t=u?t:t.toLowerCase(),t=h?Bt(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?Bt(t):t,this.pattern===t){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,t.length-1]]),g}const{location:i,distance:c,threshold:a,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:y,score:b,indices:A}=Wr(t,g,x,{location:i+S,distance:c,threshold:a,findAllMatches:u,minMatchCharLength:h,includeMatches:o,ignoreLocation:d});y&&(m=!0),v+=b,y&&A&&(p=[...p,...A])});let _={isMatch:m,score:m?v/this.chunks.length:1};return m&&o&&(_.indices=p),_}}class Te{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 Te{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 Te{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 Yr extends Te{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 Gr extends Te{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 qr extends Te{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 Xr extends Te{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 Bs extends Te{constructor(t,{location:n=E.location,threshold:s=E.threshold,distance:o=E.distance,includeMatches:i=E.includeMatches,findAllMatches:c=E.findAllMatches,minMatchCharLength:a=E.minMatchCharLength,isCaseSensitive:u=E.isCaseSensitive,ignoreDiacritics:h=E.ignoreDiacritics,ignoreLocation:d=E.ignoreLocation}={}){super(t),this._bitapSearch=new Es(t,{location:n,threshold:s,distance:o,includeMatches:i,findAllMatches:c,minMatchCharLength:a,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 Te{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=[],i=this.pattern.length;for(;(s=t.indexOf(this.pattern,n))>-1;)n=s+i,o.push([s,n-1]);const c=!!o.length;return{isMatch:c,score:c?0:1,indices:o}}}const on=[Vr,Ds,Yr,Gr,Xr,qr,Kr,Bs],Un=on.length,Jr=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Qr="|";function Zr(e,t={}){return e.split(Qr).map(n=>{let s=n.trim().split(Jr).filter(i=>i&&!!i.trim()),o=[];for(let i=0,c=s.length;i<c;i+=1){const a=s[i];let u=!1,h=-1;for(;!u&&++h<Un;){const d=on[h];let p=d.isMultiMatch(a);p&&(o.push(new d(p,t)),u=!0)}if(!u)for(h=-1;++h<Un;){const d=on[h];let p=d.isSingleMatch(a);if(p){o.push(new d(p,t));break}}}return o})}const ei=new Set([Bs.type,Ds.type]);class ti{constructor(t,{isCaseSensitive:n=E.isCaseSensitive,ignoreDiacritics:s=E.ignoreDiacritics,includeMatches:o=E.includeMatches,minMatchCharLength:i=E.minMatchCharLength,ignoreLocation:c=E.ignoreLocation,findAllMatches:a=E.findAllMatches,location:u=E.location,threshold:h=E.threshold,distance:d=E.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o,minMatchCharLength:i,findAllMatches:a,ignoreLocation:c,location:u,threshold:h,distance:d},t=n?t:t.toLowerCase(),t=s?Bt(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:i}=this.options;t=o?t:t.toLowerCase(),t=i?Bt(t):t;let c=0,a=[],u=0;for(let h=0,d=n.length;h<d;h+=1){const p=n[h];a.length=0,c=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(c+=1,u+=S,s){const y=_.constructor.type;ei.has(y)?a=[...a,...x]:a.push(x)}}else{u=0,c=0,a.length=0;break}}if(c){let v={isMatch:!0,score:u/c};return s&&(v.indices=a),v}}return{isMatch:!1,score:1}}}const rn=[];function ni(...e){rn.push(...e)}function cn(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 Es(e,t)}const Dt={AND:"$and",OR:"$or"},an={PATH:"$path",PATTERN:"$val"},ln=e=>!!(e[Dt.AND]||e[Dt.OR]),si=e=>!!e[an.PATH],oi=e=>!ye(e)&&ks(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 i=Object.keys(o);const c=si(o);if(!c&&i.length>1&&!ln(o))return s(Vn(o));if(oi(o)){const u=c?o[an.PATH]:i[0],h=c?o[an.PATTERN]:o[u];if(!ve(h))throw new Error(Ir(u));const d={keyId:sn(u),pattern:h};return n&&(d.searcher=cn(h,t)),d}let a={children:[],operator:i[0]};return i.forEach(u=>{const h=o[u];ye(h)&&h.forEach(d=>{a.children.push(s(d))})}),a};return ln(e)||(e=Vn(e)),s(e)}function ri(e,{ignoreFieldNorm:t=E.ignoreFieldNorm}){e.forEach(n=>{let s=1;n.matches.forEach(({key:o,norm:i,score:c})=>{const a=o?o.weight:null;s*=Math.pow(c===0&&a?Number.EPSILON:c,(a||1)*(t?1:i))}),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:i}=s;let c={indices:o,value:i};s.key&&(c.key=s.key.src),s.idx>-1&&(c.refIndex=s.idx),t.matches.push(c)})}function ci(e,t){t.score=e.score}function ai(e,t,{includeMatches:n=E.includeMatches,includeScore:s=E.includeScore}={}){const o=[];return n&&o.push(ii),s&&o.push(ci),e.map(i=>{const{idx:c}=i,a={item:t[c],refIndex:c};return o.length&&o.forEach(u=>{u(i,a)}),a})}class Le{constructor(t,n={},s){this.options={...E,...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 wn))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 i=this._docs[s];t(i,s)&&(this.removeAt(s),s-=1,o-=1,n.push(i))}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:i,sortFn:c,ignoreFieldNorm:a}=this.options;let u=ve(t)?ve(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return ri(u,{ignoreFieldNorm:a}),i&&u.sort(c),js(n)&&n>-1&&(u=u.slice(0,n)),ai(u,this._docs,{includeMatches:s,includeScore:o})}_searchStringList(t){const n=cn(t,this.options),{records:s}=this._myIndex,o=[];return s.forEach(({v:i,i:c,n:a})=>{if(!te(i))return;const{isMatch:u,score:h,indices:d}=n.searchIn(i);u&&o.push({item:i,idx:c,matches:[{score:h,value:i,norm:a,indices:d}]})}),o}_searchLogical(t){const n=Ts(t,this.options),s=(a,u,h)=>{if(!a.children){const{keyId:p,searcher:v}=a,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=a.children.length;p<v;p+=1){const m=a.children[p],_=s(m,u,h);if(_.length)d.push(..._);else if(a.operator===Dt.AND)return[]}return d},o=this._myIndex.records,i={},c=[];return o.forEach(({$:a,i:u})=>{if(te(a)){let h=s(n,a,u);h.length&&(i[u]||(i[u]={idx:u,item:a,matches:[]},c.push(i[u])),h.forEach(({matches:d})=>{i[u].matches.push(...d)}))}}),c}_searchObjectList(t){const n=cn(t,this.options),{keys:s,records:o}=this._myIndex,i=[];return o.forEach(({$:c,i:a})=>{if(!te(c))return;let u=[];s.forEach((h,d)=>{u.push(...this._findMatches({key:h,value:c[d],searcher:n}))}),u.length&&i.push({idx:a,item:c,matches:u})}),i}_findMatches({key:t,value:n,searcher:s}){if(!te(n))return[];let o=[];if(ye(n))n.forEach(({v:i,i:c,n:a})=>{if(!te(i))return;const{isMatch:u,score:h,indices:d}=s.searchIn(i);u&&o.push({score:h,key:t,value:i,idx:c,norm:a,indices:d})});else{const{v:i,n:c}=n,{isMatch:a,score:u,indices:h}=s.searchIn(i);a&&o.push({score:u,key:t,value:i,norm:c,indices:h})}return o}}Le.version="7.1.0";Le.createIndex=Is;Le.parseIndex=zr;Le.config=E;Le.parseQuery=Ts;ni(ti);const li="_header_2d8xd_1",ui="_left_2d8xd_13",di="_right_2d8xd_14",_t={header:li,left:ui,right:di},hi="_buttons_12rs0_1",fi="_button_12rs0_1",gi="_disabled_12rs0_20",st={buttons:hi,button:fi,disabled:gi},pi=()=>{const{undo:e,redo:t,past:n,future:s}=l.useHistoryStore(),[o,i]=f.useState(!1),[c,a]=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(()=>{i(n.length===0)},[n]),f.useEffect(()=>{a(s.length===0)},[s]),r.jsxs("div",{className:st.buttons,children:[r.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:[r.jsx(k.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([..._,{id:l.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),d&&r.jsx(l.Tooltip,{text:o?"Nothing to undo":"Click to undo changes"})]}),r.jsxs("div",{className:l.clx(st.button,{[st.disabled]:c}),onMouseEnter:()=>{const x=setTimeout(()=>{h(!0),p(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),h(!1),p(!1)},children:[r.jsx(k.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{c||(t(),g([..._,{id:l.v4(),message:"Changes redone",status:"success"}]))},fill:c?"#757575":"#252525"}),u&&r.jsx(l.Tooltip,{text:c?"Nothing to redo":"Click to redo changes"})]})]})},mi="_devices_ls6k9_1",vi="_device_ls6k9_1",bi="_active_ls6k9_27",un={devices:mi,device:vi,active:bi},xi=()=>r.jsx("div",{className:un.devices,children:l.devices.map(e=>r.jsx(Si,{device:e}))}),Si=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:s}=l.useDeviceStore(),[o,i]=f.useState(!1),[c,a]=f.useState(null);return r.jsxs("div",{className:l.clx(un.device,{[un.active]:n.value===t.value}),onClick:()=>s(t),onMouseEnter:()=>{const u=setTimeout(()=>{i(!0)},200);a(u)},onMouseLeave:()=>{c&&clearTimeout(c),i(!1)},children:[r.jsx(k.Icon,{name:t.icon,fill:n.value===t.value?"#252525":"#757575",width:20,height:20}),o&&r.jsx(l.Tooltip,{text:`Switch to ${t.value} view`})]},t.value)},wi="_preview_1x3m8_2",_i="_active_1x3m8_19",Kt={preview:wi,active:_i},yi=()=>{const{onPreview:e}=l.usePreviewStore(),[t,n]=f.useState(!1),[s,o]=f.useState(null);return r.jsxs("a",{href:"/",className:l.clx(Kt.preview,{[Kt.active]:e}),target:"_blank",onMouseEnter:()=>{const i=setTimeout(()=>{n(!0)},200);o(i)},onMouseLeave:()=>{s&&clearTimeout(s),n(!1)},children:[r.jsx(k.Icon,{name:"ArrowUpRight",width:20,height:20}),r.jsx("span",{className:Kt.text,children:"Preview"}),t&&r.jsx(l.Tooltip,{text:"Open draft theme in new tab"})]})},Ci="_settings_u4cv4_1",ji={settings:Ci},ki="_pages_167qp_1",Ai="_text_167qp_21",Ni="_modal_167qp_27",Ii="_open_167qp_46",Ei="_page_167qp_1",Bi="_hoverable_167qp_61",Di="_separator_167qp_65",Ti="_button_167qp_70",Mi="_items_167qp_85",ce={pages:ki,default:"_default_167qp_5",text:Ai,modal:Ni,open:Ii,page:Ei,hoverable:Bi,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:i,deletePage:c,setIsOpenSelectModal:a}=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);k.useOnClickOutside(S,()=>{g&&x(!1)}),f.useEffect(()=>{g?a(!0):setTimeout(()=>{a(!1)},300)},[g]);const y=b=>b?b.replace(/_/g," ").split(" ").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" "):"";return r.jsxs("div",{className:ce.pages,ref:S,children:[r.jsxs("div",{className:ce.default,onClick:b=>{b.stopPropagation(),x(A=>!A)},children:[r.jsx(k.Icon,{name:s&&s[e]&&s[e].icon||"File",fill:"#252525",width:20,height:20}),r.jsx("span",{className:ce.text,children:s&&s[e]&&l.defaultPagePaths.includes(s[e].path)?`${y(s[e].name)} page`:s&&s[e]&&s[e].name}),r.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:r.jsx(k.Icon,{name:"CaretDown",width:20,height:20})})]}),r.jsxs("div",{className:l.clx(ce.modal,{[ce.open]:g}),onClick:b=>b.stopPropagation(),children:[s&&r.jsx("div",{className:ce.items,children:Object.keys(s).map(b=>{const A=s[b];return r.jsxs("div",{className:l.clx(ce.page,{[ce.hoverable]:d===b}),onMouseEnter:()=>p(b),onMouseLeave:()=>p(null),onClick:()=>{p(null),o(!1),h(null),t(b),x(!1)},children:[r.jsx(k.Icon,{name:A.icon,fill:"#252525"}),r.jsx("span",{className:ce.text,children:l.defaultPagePaths.includes(A.path)?`${y(A.name)} page`:A.name}),d===b&&r.jsxs(r.Fragment,{children:[r.jsx(k.Icon,{name:"Gear",fill:"#757575",onClick:j=>{j.stopPropagation(),o(!0),i(b),n(!0)}}),!l.defaultPagePaths.includes(A.path)&&r.jsx(k.Icon,{name:"Trash",fill:"#C12A2A",onClick:j=>{j.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.`),_(()=>{j.stopPropagation(),s[e].path===A.path&&t(Object.keys(s)[0]),c(b),u(A.name),Ms(A.path)})}})]}),s[e]&&s[e].name===A.name&&r.jsx(k.Icon,{name:"Check",fill:"#FF3F19"})]},b)})}),r.jsx("div",{className:ce.separator}),r.jsxs(k.ButtonSettings,{className:ce.button,onClick:b=>{b.stopPropagation(),n(!0)},size:"l",children:[r.jsx(k.Icon,{name:"Plus",fill:"#ff3f19"}),r.jsx("span",{children:"Create New Page"})]})]})]})},Pi="_zoom_fu0hj_1",Kn={zoom:Pi},Li=()=>{const{zoomLevel:e,setZoomLevel:t}=l.usePreviewStore();return r.jsxs("label",{htmlFor:"zoom",className:Kn.zoom,children:[r.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:r.jsx(k.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),r.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}),r.jsx("span",{children:"%"})]})},Oi=()=>r.jsxs("div",{className:ji.settings,children:[r.jsx(Ri,{}),r.jsx(Li,{})]}),$i="_theme_1e5wq_1",Fi="_text_1e5wq_13",Yn={theme:$i,text:Fi},zi=()=>r.jsx("div",{className:Yn.theme,children:r.jsx("div",{className:Yn.text,children:"Live Theme"})}),Hi=async(e,t,n)=>{const s=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),c=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${s}/drafts/${o}/${t}`;return await l.request({url:c,withToken:!0,method:e,body:n})};function ot(e,t){try{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(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.value}).flat()}).flat().filter(s=>s).map(s=>e==="ListingIds"?s.listingId:s)}catch(n){return console.error("Error in getValues function:",n),[]}}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(i=>i&&i.type===e).map(i=>{if(i.value===void 0)throw new Error("item.value is undefined.");return i.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,i]=f.useState(null),[c,a]=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(c)o&&clearTimeout(o);else{e(!0);const y=Object.keys(m).map(j=>{const C=Vi(j,g);return m[j]&&m[j].data&&(C!=null&&C.path)?{id:C?C.id:j,name:C?C.name:j,path:C.path,layout:{...m[j]},neededProductIds:[...ot("ProductId",Object.values(m[j].data))],neededCategoryIds:[...ot("CategoryId",Object.values(m[j].data))],neededAnnouncementIds:[...ot("AnnouncementId",Object.values(m[j].data))],neededListingIds:[...ot("ListingIds",Object.values(m[j].data))],neededFaqIds:[...ot("FaqsIds",Object.values(m[j].data))],neededReviewCount:Wi("ReviewCount",Object.values(m[j].data),_),seo:{pageTitle:C&&C.seo&&C.seo.pageTitle?C.seo.pageTitle:"",pageDescription:C&&C.seo&&C.seo.pageDescription?C.seo.pageDescription:""},isPrivate:!!(C&&C.visibility==="private")}:null}).filter(j=>j),b={settings:{...s},header:d,footer:p,announcement:v},{status:A}=await Hi("post","save",{themeSettings:n,settings:b,updatedPages:y});u([...h,{id:l.v4(),message:A===200?"Settings saved":"Error",status:A===200?"success":"error"}]),e(!1)}a(!0);const S=setTimeout(()=>{a(!1)},2e3);i(S)};return r.jsx(k.ButtonSettings,{onClick:x,disabled:t,type:"Primary",children:r.jsx("span",{style:{userSelect:"none"},children:"Save"})})},Yi=()=>{const{isOpenSelectModal:e}=l.usePagesStore(),[t,n]=f.useState(!1),{showTooltip:s}=l.useTooltipStore();return r.jsxs("div",{className:_t.header,style:{zIndex:e?5e4:s?501:50},children:[r.jsxs("div",{className:_t.left,children:[r.jsx(xi,{}),r.jsx(yi,{})]}),r.jsx("div",{className:_t.center,children:r.jsx(Oi,{})}),r.jsxs("div",{className:_t.right,children:[r.jsx(zi,{}),r.jsx(pi,{}),r.jsx(Ki,{setIsLoading:n,isLoading:t}),t&&r.jsx(l.Loader,{})]})]})},Gi="_exit_ovvox_1",qi="_text_ovvox_11",Xi="_exitLink_ovvox_16",Yt={exit:Gi,text:qi,exitLink:Xi},Ji=()=>r.jsx("div",{className:Yt.exit,children:r.jsxs("a",{href:"https://dash.billgang.com/",className:Yt.exitLink,children:[r.jsx(k.Icon,{name:"SignOut",width:20,height:20}),r.jsx("span",{className:Yt.text,children:"Exit"})]})}),Qi="_navbar_1podc_1",Zi="_main_1podc_6",ec="_block_1podc_13",tc="_active_1podc_29",yt={navbar:Qi,main:Zi,block:ec,active:tc},nc=()=>{const{activeBlock:e}=l.useNavbarStore(),{setActiveBlock:t}=l.useBlocksStore(),{setCurrentBlock:n}=l.useLayersStore(),{setActiveBlock:s}=l.useThemeSettingsStore(),{setActiveBlock:o}=l.usePreviewStore(),i=l.useNavigate();function c(a){switch(t(null),n(null),s(null),o({id:null,neededScroll:!1}),a.name){case"Layers":i("/admin/builder");break;case"Add":i("/admin/builder/add");break;case"Theme":i("/admin/builder/theme");break;case"Settings":i("/admin/builder/settings");break}}return r.jsxs("div",{className:yt.navbar,children:[r.jsx(Ji,{}),r.jsx("div",{className:yt.main,children:l.navbarBlocks.map(a=>r.jsxs("div",{className:l.clx(yt.block,{[yt.active]:e.icon===a.icon}),onClick:()=>c(a),children:[r.jsx(k.Icon,{name:a.icon,fill:e.icon===a.icon?"#252525":"#757575"}),r.jsx("span",{children:a.name})]},a.icon))})]})},sc="_preview_gb2ye_1",oc="_main_gb2ye_15",rc="_content_gb2ye_25",ic="_loading_gb2ye_34",cc="_previewLoading_gb2ye_65",rt={preview:sc,main:oc,content:rc,loading:ic,previewLoading:cc},ac="_header_11zku_2",lc="_circles_11zku_16",uc="_circle_11zku_16",dc="_red_11zku_32",hc="_green_11zku_36",fc="_yellow_11zku_40",gc="_input_11zku_44",pc="_main_11zku_55",mc="_text_11zku_63",vc="_copy_11zku_75",pe={header:ac,circles:lc,circle:uc,red:dc,green:hc,yellow:fc,input:gc,main:pc,text:mc,copy:vc},bc=["red","yellow","green"],xc=()=>{const{currentDevice:e}=l.useDeviceStore(),t=(o,i)=>o.length>i?o.slice(0,i)+"...":o,{notifications:n,setNotifications:s}=l.useNotificationStore();return r.jsxs("div",{className:pe.header,children:[r.jsx("div",{className:pe.circles,children:bc.map(o=>r.jsx("div",{className:l.clx(pe.circle,{[pe.red]:o==="red",[pe.yellow]:o==="yellow",[pe.green]:o==="green"})},o))}),r.jsx("div",{className:pe.input,children:r.jsxs("div",{className:pe.main,children:[r.jsx(k.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),r.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)})]})}),r.jsx(k.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:r.jsx(k.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Sc="_content_eonwv_1",wc="_main_eonwv_12",_c="_block_eonwv_16",yc="_active_eonwv_22",Cc="_name_eonwv_32",jc="_addSection_eonwv_109",kc="_addSectionTop_eonwv_117",Be={content:Sc,main:wc,block:_c,active:yc,name:Cc,addSection:jc,addSectionTop:kc},Ac="_sidebar_xhqpt_1",Nc="_content_xhqpt_14",Ic="_button_xhqpt_24",Ec="_moveButton_xhqpt_40",Bc="_deleteButton_xhqpt_49",me={sidebar:Ac,content:Nc,button:Ic,moveButton:Ec,deleteButton:Bc},Dc=()=>{var j;const{activeBlock:e,setActiveBlock:t}=l.usePreviewStore(),{blocks:n,removeBlock:s,moveBlock:o,duplicateBlock:i,setCurrentBlock:c}=l.useLayersStore(),{currentPage:a,pages:u}=l.usePagesStore(),{setTitle:h,setDescription:d,setOnConfirm:p}=l.useConfirmationModalStore(),{setActiveBlock:v}=l.useBlocksStore(),m=(j=u==null?void 0:u[a])==null?void 0:j.path,_=m?n[m]:null,g=(_==null?void 0:_.order)||[],x=g.indexOf(e.id),S=C=>{C.stopPropagation(),x>0&&m&&(o(m,x,x-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},y=C=>{C.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=C=>{C.stopPropagation(),m&&i(m,e.id)},A=()=>{m&&(s(m,e.id),c(null),v(null),t({id:null,neededScroll:!1}))};return r.jsx("div",{className:me.sidebar,children:r.jsxs("div",{className:me.content,children:[r.jsx("button",{onClick:S,className:l.clx(me.button,me.moveButton),disabled:x===0,children:r.jsx(k.Icon,{name:"ArrowUp"})}),r.jsx("button",{onClick:y,className:l.clx(me.button,me.moveButton),disabled:x===g.length-1,children:r.jsx(k.Icon,{name:"ArrowDown"})}),r.jsx("button",{onClick:b,className:l.clx(me.button,me.moveButton),children:r.jsx(k.Icon,{name:"Copy"})}),r.jsx("button",{className:l.clx(me.button,me.deleteButton),onClick:C=>{C.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:r.jsx(k.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},Tc=f.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:s}=l.usePreviewStore(),{blocks:o,sourceBlocks:i}=l.useBlocksStore(),{blocks:c,setCurrentBlock:a,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:y}=l.useBlocksStore(),b=f.useRef(n.id),A=f.useRef({});f.useEffect(()=>{if(n.id&&n.neededScroll&&A.current[n.id]){const w=A.current[n.id];if(w&&e.current){const N=w.offsetTop;e.current.scrollTo({top:N-30,behavior:"smooth"})}}},[n,e]);const j=l.useNavigate();f.useEffect(()=>{b.current=n.id},[n.id]);const C=w=>{if(!w||!w.name)return S({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),r.jsx(k.ErrorableBlock,{error:"Block or block.name is undefined."});if(!o||!o[w.name])return S({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),r.jsx(k.ErrorableBlock,{error:`Block "${w.name}" does not exist in blocks.`});const N=new o[w.name];return w.value&&Object.assign(N,w.value),N.renderBlock(p,_)};return r.jsxs("div",{onClick:w=>{w.stopPropagation()},className:Be.content,style:{width:"100%",height:"100%",zoom:`${s}`},ref:e,children:[d&&r.jsx(fn,{}),r.jsx(hn,{}),r.jsx("div",{className:Be.main,children:m&&m[v]&&c[m[v].path]&&c[m[v].path].data&&c[m[v].path].order.map(w=>r.jsxs("div",{ref:N=>A.current[w]=N,onClick:N=>{N.stopPropagation(),y(null),g&&x(null),t({id:w,neededScroll:!0}),setTimeout(()=>{t({id:w,neededScroll:!1})},100),a(null),u?setTimeout(()=>{a(n.id)},100):a(n.id)},onMouseEnter:N=>{N.stopPropagation(),n.neededScroll||t({id:w,neededScroll:!1})},onMouseLeave:N=>{N.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:l.clx(Be.block),children:[(n.id===w||u===w)&&r.jsx("div",{className:Be.active}),(n.id===w||u===w)&&r.jsx("div",{className:Be.name,children:l.getDisplayName(c[m[v].path].data[w].name,i)}),(n.id===w||u===w)&&l.getDisplayName(c[m[v].path].data[w].name,i)!=="unknown name"&&r.jsx(Dc,{}),(n.id===w||u===w)&&l.getDisplayName(c[m[v].path].data[w].name,i)!=="unknown name"&&r.jsx("div",{className:Be.addSection,children:r.jsx(k.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(w,!0),a(null),t({id:null,neededScroll:!1}),y(null),j("/admin/builder/add")},children:"Add Section"})}),(n.id===w||u===w)&&l.getDisplayName(c[m[v].path].data[w].name,i)!=="unknown name"&&r.jsx("div",{className:l.clx(Be.addSection,Be.addSectionTop),children:r.jsx(k.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(w,!1),a(null),t({id:null,neededScroll:!1}),y(null),j("/admin/builder/add")},children:"Add Section"})}),o&&r.jsx(Tt,{render:C,block:c[m[v].path].data[w]})]},w))}),r.jsx(dn,{})]})}),Mc="_results_1pahy_1",Gn={results:Mc};function Rc(e,t){return t?new t[e]().blockSettings.isAddable:!1}function qn(e,t){return e?Object.keys(e||{}).reduce((n,s)=>(Rc(s,t)&&n.push({name:s,displayName:l.getDisplayName(s,t)}),n),[]):[]}const Pc="_product_yggw5_1",Lc="_name_yggw5_15",Xn={product:Pc,name:Lc},Oc=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:s,setActiveBlock:o}=l.useBlocksStore(),{hideModal:i,hoverBlockId:c,isModalVisible:a,showPreview:u,hidePreview:h,clearHideTimeout:d,startHideTimeout:p,setHoverBlockTopPosition:v}=l.useSubmodalStore();function m(x){n(""),o(x),i("keyBlock")}function _(x,S){const y=window.innerHeight,b=400,A=10;let j=S.clientY-120;j+b>y&&(j=y-b-A),j<A&&(j=A),c||i("keyBlock"),u(x,"keyBlock"),d(),v(j)}function g(){a?p("keyBlock"):h("keyBlock"),v(null)}return r.jsxs("div",{className:Xn.product,onClick:()=>m(t),onMouseEnter:x=>_(t,x),onMouseLeave:g,children:[l.blockIcons[t]?r.jsx("img",{src:l.blockIcons[t]}):r.jsx(k.Icon,{name:"Cards"}),r.jsx("span",{className:Xn.name,children:l.getDisplayName(t,s)}),r.jsx(k.Icon,{name:"CaretRight",width:20,height:20})]},t)},Rs=()=>{const{blocks:e,sourceBlocks:t}=l.useBlocksStore(),[n,s]=f.useState(""),[o,i]=f.useState([]),c=f.useMemo(()=>qn(e,t),[e,t]),a=f.useMemo(()=>new Le(c,{keys:["displayName"],threshold:.4}),[c]);return f.useEffect(()=>{if(n.trim()==="")i(qn(e,t));else{const u=a.search(n);i(u.map(h=>h.item))}},[n,a]),r.jsxs(r.Fragment,{children:[r.jsx(k.InputSettings,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:s,value:n,style:{marginBottom:10}}),r.jsx("div",{className:Gn.results,children:o.length>0?o.map(u=>r.jsx(Oc,{blockId:u.name,setSearchValue:s})):r.jsx("div",{className:Gn.noResults,children:"No sections found"})})]})},$c=()=>{const{onPreview:e,zoomLevel:t}=l.usePreviewStore(),{keyBlock:n,hoverBlockId:s,isModalVisible:o,hoverBlockTopPosition:i}=l.useSubmodalStore(),{settings:c}=l.useSettingsStore(),{sourceBlocks:a}=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?!a||!a[b]?r.jsx(k.ErrorableBlock,{error:`Block "${b}" does not exist in blocks.`}):new a[b]().renderPreview(c,u):r.jsx(k.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),y=b=>{S.current&&(S.current.scrollTop+=b.deltaY)};return r.jsxs("div",{className:rt.preview,style:{zIndex:h&&!x?5e3:500},onWheel:b=>{b.stopPropagation(),y(b)},children:[o&&r.jsx(l.AddSectionSubmodal,{children:r.jsx(Rs,{})}),r.jsxs(l.Submodal,{positionTop:i,positionLeft:!s&&n?void 0:250,children:[!p&&!v&&r.jsx(Tt,{render:m,block:n},n),(p||!n||v)&&r.jsx("div",{className:rt.previewLoading,children:r.jsx(l.Loader,{})})]}),h&&r.jsx(l.ColorPickerModal,{}),e&&r.jsxs("div",{className:rt.main,style:{width:g()},children:[r.jsx(xc,{}),r.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?r.jsx("div",{className:rt.content,style:{width:_()},children:r.jsx(Tc,{scrollableRef:S})}):r.jsx("div",{className:rt.loading,children:r.jsx(l.Loader,{})})})]})]})},Fc="_sidebar_1xtkj_1",zc="_title_1xtkj_11",Jn={sidebar:Fc,title:zc},Hc="_layers_1jhzw_1",Wc="_wrapper_1jhzw_9",Uc="_draggingWrapper_1jhzw_17",Vc="_block_1jhzw_21",Kc="_dragging_1jhzw_17",Yc="_active_1jhzw_56",Gc="_add_1jhzw_63",qc="_addTop_1jhzw_79",Xc="_visible_1jhzw_95",Jc="_button_1jhzw_99",Qc="_nameBlock_1jhzw_158",Zc="_loader_1jhzw_162",ea="_actions_1jhzw_171",ta="_deleteButton_1jhzw_179",G={layers:Hc,wrapper:Wc,draggingWrapper:Uc,block:Vc,dragging:Kc,active:Yc,add:Gc,addTop:qc,visible:Xc,button:Jc,nameBlock:Qc,loader:Zc,actions:ea,deleteButton:ta},na="_block_sj4cc_1",sa="_title_sj4cc_17",oa="_actions_sj4cc_21",Re={block:na,title:sa,actions:oa},Gt={header:"Header",footer:"Footer",announcement:"Announcement"},qt=({id:e})=>{const{setCurrentBlock:t}=l.useLayersStore(),{activeBlock:n}=l.usePreviewStore(),[s,o]=f.useState(!1);function i(c){t(c)}return r.jsxs("div",{className:l.clx(Re.block,{[Re.active]:n.id===e,[Re.header]:e==="header",[Re.footer]:e==="footer",[Re.announcement]:e==="announcement"}),onClick:()=>i(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[l.blockIcons[Gt[e]]?r.jsx("img",{src:l.blockIcons[Gt[e]],width:20,height:20}):r.jsx(k.Icon,{name:"Cards",width:20,height:20}),r.jsx("span",{className:Re.title,children:Gt[e]}),r.jsx("div",{className:Re.actions,children:r.jsx(k.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},ra=({id:e,name:t,onClick:n,isDragging:s,icon:o})=>{const{activeBlock:i,setActiveBlock:c}=l.usePreviewStore(),{showPreview:a,hidePreview:u,showModal:h,hideModal:d,clearHideTimeout:p,startHideTimeout:v,hoverBlockId:m,isModalVisible:_}=l.useSubmodalStore(),{setPositionBlock:g}=l.useLayersStore(),[x,S]=f.useState(!1),[y,b]=f.useState(!1),[A,j]=f.useState(!1),[C,w]=f.useState(!1),[N,M]=f.useState(null),$=f.useRef(null),{attributes:R,listeners:D,setNodeRef:P,transform:T,transition:z}=Cs({id:e}),q={transform:Ge.Transform.toString(T),transition:z},{setTitle:B,setDescription:H,setOnConfirm:re}=l.useConfirmationModalStore(),{pages:Ce,currentPage:Oe}=l.usePagesStore(),{removeBlock:K}=l.useLayersStore(),ie=O=>{O.stopPropagation(),$.current&&clearTimeout($.current),c({id:e,neededScroll:!0}),_&&d(),a(e),p()},de=(O,$e=!0)=>{O.stopPropagation(),u(),h(e),p(),g(e,$e)},Me=O=>{O.stopPropagation(),c({id:null,neededScroll:!1}),_?v():u()};return f.useEffect(()=>{j(!1),S(!1),b(!1),w(!1)},[s]),f.useEffect(()=>{_||(b(!1),S(!1))},[_]),r.jsxs("div",{ref:P,style:q,className:l.clx(G.wrapper,{[G.draggingWrapper]:s&&i.id===e}),onClick:O=>{O.stopPropagation(),n(e)},onMouseEnter:ie,onMouseLeave:Me,...R,...D,children:[r.jsxs("div",{className:l.clx(G.block,{[G.dragging]:s&&i.id===e,[G.active]:!s&&i.id===e}),children:[o?r.jsx("img",{src:o,width:20,height:20}):r.jsx(k.Icon,{name:"Cards",width:20,height:20}),r.jsx("span",{className:G.nameBlock,children:t}),m===e&&!s&&r.jsx("div",{className:l.clx(G.addTop,{[G.visible]:y}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:r.jsxs("button",{className:G.button,onClick:O=>de(O,!1),onMouseEnter:()=>{const O=setTimeout(()=>{s||w(!0)},200);M(O)},onMouseLeave:()=>{N&&clearTimeout(N),w(!1)},children:[r.jsx(k.Icon,{name:"Plus",fill:"#fff"}),C&&r.jsx(l.Tooltip,{text:"Click to add a section"})]})}),m===e&&!s&&r.jsx("div",{className:l.clx(G.add,{[G.visible]:x}),onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},children:r.jsxs("button",{className:G.button,onClick:O=>de(O),onMouseEnter:()=>{const O=setTimeout(()=>{s||j(!0)},200);M(O)},onMouseLeave:()=>{N&&clearTimeout(N),j(!1)},children:[r.jsx(k.Icon,{name:"Plus",fill:"#fff"}),A&&r.jsx(l.Tooltip,{text:"Click to add a section"})]})})]}),m===e&&!s&&r.jsxs("div",{className:G.actions,children:[r.jsx(k.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),r.jsx("div",{className:G.deleteButton,onClick:O=>{O.stopPropagation(),B("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(()=>{Ce&&K(Ce[Oe].path,e)})},children:r.jsx(k.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},ia=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:i}=l.useLayersStore(),{currentPage:c,pages:a}=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:y,over:b}=S;if(b&&y.id!==b.id&&a&&a[c]){const A=a[c].path,j=e[A].order,C=j.indexOf(y.id),w=j.indexOf(b.id);C!==-1&&w!==-1&&s(A,C,w)}};return r.jsx("div",{className:G.layers,children:o?r.jsx("div",{className:G.loader,children:r.jsx(l.Loader,{})}):r.jsxs(r.Fragment,{children:[i&&r.jsx(qt,{id:"announcement"}),r.jsx(qt,{id:"header"}),!n&&r.jsx(ms,{sensors:v,onDragEnd:x,onDragStart:g,children:a&&a[c]&&e[a[c].path]&&r.jsx(_s,{items:e[a[c].path].order,strategy:xs,children:e[a[c].path].order.map((S,y)=>r.jsx(ra,{id:S,name:l.getDisplayName(e[a[c].path].data[S].name,d),index:y,onClick:p,isDragging:m,icon:l.blockIcons[e[a[c].path].data[S].name]},S))})}),r.jsx(qt,{id:"footer"})]})})},ca="_loader_eyvkk_1",aa={loader:ca},la=()=>{const{isLoadingSettings:e}=l.useSettingsStore();return e?r.jsx("div",{className:aa.loader,children:r.jsx(l.Loader,{})}):r.jsx(ua,{})},ua=()=>{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(i){throw console.error("Error rendering settings:",i),s({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),i}},da="_theme_a1one_1",ha="_block_a1one_8",fa="_name_a1one_23",ga="_loader_a1one_27",Ct={theme:da,block:ha,name:fa,loader:ga},pa=()=>{const e=l.useNavigate(),{isLoadingThemeSettings:t,setActiveBlock:n}=l.useThemeSettingsStore();function s(o){switch(o==null?void 0:o.name){case"Colors":e("/admin/builder/theme/colors"),n(l.themeSettingsBlocks[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),n(l.themeSettingsBlocks[1]);break;case"Borders":e("/admin/builder/theme/borders"),n(l.themeSettingsBlocks[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),n(l.themeSettingsBlocks[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),n(l.themeSettingsBlocks[4]);break}}return r.jsx("div",{className:Ct.theme,children:t?r.jsx("div",{className:Ct.loader,children:r.jsx(l.Loader,{})}):l.themeSettingsBlocks.map(o=>r.jsxs("div",{onClick:()=>s(o),className:l.clx(Ct.block),children:[r.jsx(k.Icon,{name:o.icon}),r.jsx("span",{className:Ct.name,children:o.name}),r.jsx(k.Icon,{name:"CaretRight"})]},o.icon))})},ma="_render_7e826_9",va="_open_7e826_24",ba="_close_7e826_51",xa="_clicked_7e826_55",Sa="_loading_7e826_72",wa="_settings_7e826_76",Ke={render:ma,open:va,close:ba,clicked:xa,loading:Sa,settings:wa},_a=({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}},ya="_wrapper_15ju8_1",Ca="_header_15ju8_8",ja="_title_15ju8_15",ka="_colorWrapper_15ju8_21",Aa="_name_15ju8_35",Na="_color_15ju8_21",Ia="_value_15ju8_47",Ea="_length_15ju8_51",se={wrapper:ya,header:Ca,title:ja,colorWrapper:ka,name:Aa,color:Na,value:Ia,length:Ea},Ba=e=>{const{colors:t}=e,{themeSettings:n}=l.useThemeSettingsStore(),[s,o]=f.useState(!0);f.useEffect(()=>{t.length<=3&&o(!0)},[]);function i(c){const a=c.replace("--",""),[u,h]=a.split("-"),d=`${h.charAt(0).toUpperCase()+h.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[p,v]=a.split("-");return{name:d,field:p,variable:v}}return r.jsxs("div",{className:se.wrapper,children:[r.jsxs("div",{className:se.header,children:[r.jsx("div",{className:se.title,children:"Section Colors"}),!s&&r.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!0),children:["+",t.length]})]}),s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:se.colors,children:t.map(c=>{const a=i(c),{variable:u,name:h,field:d}=a;return r.jsx(Da,{color:n.colors[d][u],name:h})})}),t.length>3&&r.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},Da=e=>{const{name:t,color:n}=e,{setActiveLabel:s,setModalPosition:o,setInitialColor:i,setShowModal:c,setUpdate:a,setColor:u,setColorChange:h,colorChange:d,setIsGradientActive:p,setIsBlockSettings:v}=l.useColorPickerStore(),{updateColor:m}=l.useThemeSettingsStore(),_=(S,y)=>b=>{m(S,y,b)};f.useEffect(()=>{const S=()=>{c(!1),s(null),i(n),a(()=>{}),u(n),h(()=>{})};return document.body.addEventListener("click",S),()=>{document.body.removeEventListener("click",S)}},[]);const g=S=>{const y=t.split("/")[0],b=y.split(" ")[0].toLowerCase(),A=y.split(" ")[1].toLowerCase();S.stopPropagation(),c(!0),h(d),a(w=>_(A,b)(w)),i(n),u(n),v(!0),p(A==="surface");const{top:j,left:C}=l.getModalPosition(S,550,288,10,20,230,80);o({top:A==="surface"?j:j+125,left:C-200})};function x(S){return S.length>15?S.slice(0,15)+"...":S}return r.jsxs("div",{className:se.colorWrapper,onClick:g,children:[r.jsx("div",{className:se.color,style:{background:n}}),r.jsx("div",{className:se.name,children:t}),r.jsx("div",{className:se.value,children:x(n)})]})},Ta="_back_1sznl_1",Ma="_title_1sznl_9",Ra="_deleteButton_1sznl_17",Pa="_backIcon_1sznl_30",jt={back:Ta,title:Ma,deleteButton:Ra,backIcon:Pa},La=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var v,m;const{activeBlock:s}=l.useBlocksStore(),{setTitle:o,setDescription:i,setOnConfirm:c}=l.useConfirmationModalStore(),{blocks:a,currentBlock:u,removeBlock:h}=l.useLayersStore(),{currentPage:d,pages:p}=l.usePagesStore();return r.jsxs("div",{className:jt.back,children:[r.jsx("div",{className:jt.backIcon,onClick:()=>e(),children:r.jsx(k.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),r.jsx("h3",{className:jt.title,children:s&&n(s)||p&&p[d]&&a[p[d].path]&&u&&n((v=a[p[d].path].data[u])==null?void 0:v.name)||u&&l.formatLabel(u)||"Loading"}),u&&p&&!["header","footer","announcement"].includes(u)&&a[p[d].path].data[u]&&n((m=a[p[d].path].data[u])==null?void 0:m.name)!=="unknown name"&&r.jsx("button",{onClick:_=>{var g;_.stopPropagation(),o("Remove Block"),i(`Are you sure you want to delete ${n((g=a[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.`),c(()=>{t(!0),h(p[d].path,u),e(!0)})},className:jt.deleteButton,children:r.jsx(k.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},Oa=()=>{const e=l.useNavigate(),[t,n]=f.useState(!1),{header:s,footer:o,announcement:i,sourceBlocks:c,activeBlock:a,setActiveBlock:u,currentInstance:h,setCurrentInstance:d}=l.useBlocksStore(),{setActiveBlock:p}=l.usePreviewStore(),{blocks:v,addBlock:m,editBlock:_,currentBlock:g,setCurrentBlock:x,header:S,footer:y,announcement:b,isLoadingLayers:A}=l.useLayersStore(),{currentPage:j,pages:C}=l.usePagesStore(),{past:w,future:N}=l.useHistoryStore();function M(D=!1){if(C&&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]}),_(C[j].path,g,{name:v[C[j].path].data[g].name,value:P})}u(null),x(null),p({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),d(null)}function $(D){var q;if(!C||!j||!D)return null;if(D==="header"){const B=new s;return Object.keys(B.blockSettings).forEach(H=>{B.blockSettings[H]=S==null?void 0:S.blockSettings[H]}),Object.keys(B.blockColors).forEach(H=>{B.blockColors[H]=S==null?void 0:S.blockColors[H]}),B}if(D==="footer"){const B=new o;return Object.keys(B.blockSettings).forEach(H=>{B.blockSettings[H]=y==null?void 0:y.blockSettings[H]}),Object.keys(B.blockColors).forEach(H=>{B.blockColors[H]=y==null?void 0:y.blockColors[H]}),B}if(D==="announcement"){const B=new i;return Object.keys(B.blockSettings).forEach(H=>{B.blockSettings[H]=b==null?void 0:b.blockSettings[H]}),Object.keys(B.blockColors).forEach(H=>{B.blockColors[H]=b==null?void 0:b.blockColors[H]}),B}const P=v[C[j].path];if(!P||!P.data[D])return null;const T=P.data[D];return!T||!c[T.name]?null:new c[T.name]((q=T.value)==null?void 0:q.blockSettings)}f.useEffect(()=>{if(g){const D=$(g);d(D)}else d(null)},[g,w,N,a]),f.useEffect(()=>{if(a&&C&&!g){const D={blockSettings:{},blockColors:{}},P=new c[a];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(C[j].path,{name:a,value:D});p({id:T,neededScroll:!0}),x(T),e("/admin/builder")}},[a,w,N]);function R(D){if(!c)return"unknown name";if(!c[D])return g==="header"?S==null?void 0:S.blockSettings.displayName:g==="footer"?y==null?void 0:y.blockSettings.displayName:g==="announcement"?b==null?void 0:b.blockSettings.displayName:"unknown name";const P=new c[D];return!P.blockSettings||!P.blockSettings.displayName?"unknown name":P.blockSettings.displayName}return r.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:[r.jsx(La,{onClick:M,setIsClicked:n,getDisplayName:R}),r.jsxs("div",{className:Ke.settings,children:[h&&r.jsxs(r.Fragment,{children:[r.jsx(_a,{block:h}),r.jsx(Ba,{colors:h.blockColors})]}),!a&&!g&&r.jsx("div",{className:Ke.loading,children:"Loading"})]})]})},$a="_header_9rrfr_1",Fa="_title_9rrfr_9",za="_backIcon_9rrfr_15",Xt={header:$a,title:Fa,backIcon:za},mt=({onClick:e,title:t})=>r.jsxs("div",{className:Xt.header,children:[r.jsx("div",{className:Xt.backIcon,onClick:e,children:r.jsx(k.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),r.jsx("span",{className:Xt.title,children:t})]}),Ha="_options_ymds7_1",Wa={options:Ha},Ua=()=>{var h,d;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:s}=l.useThemeSettingsStore();function o(p,v){n(v,p)}const i=l.useNavigate();function c(){s(null),i("/admin/builder/theme")}const a=f.useMemo(()=>t.borders,[t]),u=(e==null?void 0:e.name)==="Borders";return r.jsxs(l.AnimatedPanel,{isOpen:u,isClose:!u,children:[r.jsx(mt,{onClick:c,title:"Borders Style"}),r.jsxs("div",{className:Wa.options,children:[r.jsx(k.SelectSettings,{label:"Border Radius (px)",options:Object.keys(l.RadiusVariables),value:((h=Object.entries(l.RadiusVariables).find(([p,v])=>v===a.radius))==null?void 0:h[0])||"None",onChange:p=>o(l.RadiusVariables[p],"radius")}),r.jsx(k.SelectSettings,{label:"Border Thickness (px)",options:Object.keys(l.ThicknessVariables),value:((d=Object.entries(l.ThicknessVariables).find(([p,v])=>v===a.thickness))==null?void 0:d[0])||"None",onChange:p=>o(l.ThicknessVariables[p],"thickness")})]})]})},Va="_options_jo38w_1",Ka="_alignments_jo38w_9",Ya="_blocks_jo38w_15",Ga="_alignment_jo38w_9",qa="_active_jo38w_34",Xa="_chargeTypes_jo38w_41",Ja="_charge_jo38w_41",Qa="_chargeActive_jo38w_69",Za="_sliderContainer_jo38w_83",el="_shadowInputs_jo38w_91",tl="_label_jo38w_102",nl="_shadowInputsRow_jo38w_111",sl="_shadowInputsOpen_jo38w_119",X={options:Va,alignments:Ka,blocks:Ya,alignment:Ga,active:qa,chargeTypes:Xa,charge:Ja,chargeActive:Qa,sliderContainer:Za,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(),[i,c]=f.useState("primary");function a(g,x){n(i,x,g)}const[u,h]=f.useState(!1),d=t.buttons[i],p=l.useNavigate();function v(){s(null),p("/admin/builder/theme")}const m=(e==null?void 0:e.name)==="Buttons";function _(g,x){a({...d.boxShadow,[g]:x},"boxShadow")}return r.jsxs(l.AnimatedPanel,{isOpen:m,isClose:!m,children:[r.jsx(mt,{onClick:v,title:"Buttons Style"}),r.jsx("div",{className:X.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(g=>r.jsx("div",{className:l.clx(X.charge,{[X.chargeActive]:i===g}),onClick:()=>c(g),children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),d&&r.jsxs("div",{className:X.options,children:[r.jsx(k.InputSettings,{label:"Height (px)",value:String(d.height),onChange:g=>a(Number(g),"height"),type:"number",min:0}),r.jsx(k.SelectSettings,{label:"Font Size (px)",value:String(d.size),onChange:g=>a(Number(g),"size"),options:l.sizeOptions}),r.jsx(k.InputSettings,{label:"Border Radius (px)",value:String(d.radius),onChange:g=>a(Number(g),"radius"),type:"number",min:0}),r.jsx(k.SelectSettings,{label:"Font",value:d.font,onChange:g=>a(g,"font"),options:[...o.filter(g=>g.name!==d.font).map(g=>g.name)]}),r.jsx(l.ColorPicker,{initialColor:d.color,onChange:g=>a(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),r.jsx(l.ColorPicker,{initialColor:d.background,onChange:g=>a(g,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),r.jsxs("div",{className:X.sliderContainer,children:[r.jsx("h4",{className:X.label,children:"Shadow"}),r.jsx(k.ButtonSettings,{type:"Secondary",onClick:()=>h(!u),style:{padding:5,display:"flex"},children:r.jsx(k.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),r.jsxs("div",{className:l.clx(X.shadowInputs,{[X.shadowInputsOpen]:u}),children:[r.jsxs("div",{className:X.shadowInputsRow,children:[r.jsx(k.InputSettings,{label:"Left (px)",value:String(d.boxShadow.left),onChange:g=>_("left",Number(g)),type:"number"}),r.jsx(k.InputSettings,{label:"Top (px)",value:String(d.boxShadow.top),onChange:g=>_("top",Number(g)),type:"number"}),r.jsx(k.InputSettings,{label:"Blur (px)",value:String(d.boxShadow.blur),onChange:g=>_("blur",Number(g)),type:"number"}),r.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:r.jsx(k.InputSettings,{label:"Spread (px)",value:String(d.boxShadow.spread),onChange:g=>_("spread",Number(g)),type:"number"})})]}),r.jsx(l.ColorPicker,{initialColor:d.boxShadow.color,onChange:g=>_("color",g),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),r.jsxs("div",{className:X.alignments,children:[r.jsx("h4",{className:X.label,children:"Alignment Type"}),r.jsx("div",{className:X.blocks,children:ol.map(g=>r.jsx("div",{className:l.clx(X.alignment,{[X.active]:d.alignment===g}),onClick:()=>{a(g,"alignment")},children:r.jsx(k.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:d.alignment===g?"#252525":"#757575"})},g))})]}),r.jsx(k.Switch,{label:"Enable Hover",onChange:g=>a(g,"hover"),current:d.hover}),d.hover&&r.jsxs(r.Fragment,{children:[r.jsx(l.ColorPicker,{initialColor:d.colorHover,onChange:g=>a(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),r.jsx(l.ColorPicker,{initialColor:d.backgroundHover,onChange:g=>a(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},il="_category_hxy9u_1",cl="_categoryTitle_hxy9u_19",Jt={category:il,categoryTitle:cl},al=()=>{const{themeSettings:e,setActiveColorCategory:t}=l.useThemeSettingsStore();function n(s){t(s)}return r.jsx("div",{className:Jt.wrapper,children:Object.keys(e.colors).map(s=>s==="icon"?r.jsx(r.Fragment,{}):r.jsxs("div",{className:Jt.category,onClick:()=>n(s),children:[r.jsxs("h2",{className:Jt.categoryTitle,children:[s==="text"?"Text & Icon":l.formatLabel(s)," Colors"]}),r.jsx(k.Icon,{name:"CaretRight",width:24,height:24})]},s))})},ll="_options_ikvjo_38",ul={options:ll},dl=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:s,updateFont:o}=l.useThemeSettingsStore(),{fonts:i}=l.useFontsStore(),[c,a]=f.useState(null);function u(){t(null)}function h(g,x){c&&n&&o("desktop",c,n,x,g)}const[d,p]=f.useState([]),v=f.useMemo(()=>n?s.fonts.desktop.heading[n]?(a("heading"),s.fonts.desktop.heading[n]):s.fonts.desktop.body[n]?(a("body"),s.fonts.desktop.body[n]):(a(null),null):null,[n,s]);f.useEffect(()=>{if(v){const g=i.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 r.jsxs(l.AnimatedPanel,{isOpen:m,isClose:_,children:[r.jsx(mt,{onClick:u,title:"Font Style"}),n&&v&&r.jsxs("div",{className:ul.options,children:[r.jsx(k.SelectSettings,{label:"Font",value:v.font,onChange:g=>h(g,"font"),options:[...i.filter(g=>g.name!==v.font).map(g=>g.name)]}),r.jsx(k.SelectSettings,{label:"Size",value:String(v.size),onChange:g=>h(g,"size"),options:l.sizeOptions}),r.jsx(k.SelectSettings,{label:"Default Weight",value:String(v.weight),onChange:g=>h(g,"weight"),options:d}),r.jsx(k.SelectSettings,{label:"Bold Weight",value:String(v.boldWeight),onChange:g=>h(g,"boldWeight"),options:d}),r.jsx(k.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:i}=l.useThemeSettingsStore();return r.jsxs("div",{className:_e.font,onClick:()=>i(s),children:[r.jsx("div",{className:l.clx(_e.icon,{[_e.paragraph]:o==="paragraph"}),children:r.jsx(k.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),r.jsxs("div",{className:_e.content,children:[r.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(xl[s])}),r.jsx("span",{className:_e.value,children:`${t}, ${n}px`})]})]})},wl=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=l.useThemeSettingsStore();f.useEffect(()=>(s(),()=>{s()}),[]);function s(){t(null)}if(n!=null&&n.name)return r.jsx("div",{className:_e.wrapper,children:Object.entries(e.fonts.desktop).sort(([o],[i])=>o==="heading"?-1:i==="heading"?1:0).map(([o,i])=>r.jsxs("div",{className:_e.category,children:[r.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(o)}),Object.entries(i).map(([c,a])=>r.jsx(Sl,{id:c,category:o,...a},c))]},o))})},_l="_wrapper_16ym0_2",yl="_categoryTitle_16ym0_12",Cl="_title_16ym0_74",jl="_field_16ym0_82",kl="_alignments_16ym0_92",Al="_lineField_16ym0_98",Nl="_style_16ym0_106",Il="_header_16ym0_113",le={wrapper:_l,categoryTitle:yl,title:Cl,field:jl,alignments:kl,lineField:Al,style:Nl,header:Il},El=["left","center","right"],Bl=["solid","dashed"],it=e=>{const{title:t,children:n,rightAddon:s}=e;return r.jsxs("div",{className:le.field,children:[r.jsxs("div",{className:le.header,children:[r.jsx("h4",{className:le.categoryTitle,children:t}),s]}),n]})},Dl=()=>{const{themeSettings:e,updateInput:t}=l.useThemeSettingsStore(),n=f.useMemo(()=>e.inputs,[e]),s=(i,c,a)=>{t(i,c,a)},o=i=>c=>{t(i,c,"color")};return r.jsxs("div",{className:le.wrapper,children:[r.jsxs(it,{title:"General",children:[r.jsx(k.InputSettings,{label:"Height (px)",value:String(n.general.height),onChange:i=>s("general",i,"height"),type:"number",min:0}),r.jsx(k.SelectSettings,{label:"Font Size (px)",onChange:i=>s("general",i,"size"),value:String(n.general.size),options:l.sizeOptions}),r.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),r.jsx(it,{title:"Field Fill",rightAddon:r.jsx("div",{className:le.switch,children:r.jsx(k.Switch,{onChange:i=>s("field",i,"active"),current:n.field.active})}),children:r.jsx(l.ColorPicker,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),r.jsx(it,{title:"Placeholder",children:r.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),r.jsxs(it,{title:"Border",rightAddon:r.jsx("div",{className:le.switch,children:r.jsx(k.Switch,{onChange:i=>s("border",i,"active"),current:n.border.active})}),children:[r.jsxs("div",{className:le.lineField,children:[r.jsxs("div",{className:le.style,children:[r.jsx("span",{className:le.title,children:"Style"}),r.jsx(l.Picker,{items:Bl,selectedItem:n.border.style,onSelect:i=>s("border",i,"style"),getIconName:i=>i==="solid"?"Minus":"Selection"})]}),r.jsx(k.InputSettings,{label:"Radius (px)",value:String(n.border.radius),onChange:i=>s("border",i,"radius"),type:"number",min:0})]}),r.jsx(k.InputSettings,{label:"Thickness (px)",value:String(n.border.thickness),onChange:i=>s("border",i,"thickness"),type:"number",min:0}),r.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),r.jsxs(it,{title:"Label",children:[r.jsx(k.InputSettings,{label:"Line Height (px)",value:String(n.label.height),onChange:i=>s("label",i,"height"),type:"number",min:0}),r.jsx(k.SelectSettings,{label:"Font Size (px)",onChange:i=>s("label",i,"size"),value:String(n.label.size),options:l.sizeOptions}),r.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.label.color),onChange:o("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),r.jsxs("div",{className:le.alignments,children:[r.jsx("h4",{className:le.title,children:"Alignment Type"}),r.jsx(l.Picker,{items:El,selectedItem:n.label.alignment,onSelect:i=>s("label",i,"alignment"),getIconName:i=>i==="center"?"AlignCenterHorizontal":i==="left"?"AlignLeft":"AlignRight"})]})]})]})},Tl="_wrapper_1yw63_2",Ml="_color_1yw63_24",Rl="_content_1yw63_33",Pl="_preview_1yw63_42",Ll="_container_1yw63_52",Ol="_buttonWrapper_1yw63_62",$l="_button_1yw63_62",Fl="_buttonBorder_1yw63_80",zl="_buttonBackground_1yw63_83",Hl="_text_1yw63_87",Wl="_textText_1yw63_93",Ul="_icon_1yw63_97",Vl="_iconIcon_1yw63_100",Kl="_annotation_1yw63_104",Yl="_annotationText_1yw63_111",Gl="_label_1yw63_116",ql="_circle_1yw63_127",Xl="_line_1yw63_140",Jl="_circle1_1yw63_154",Ql="_circle2_1yw63_159",Zl="_annotationIcon_1yw63_164",eu="_annotationBorder_1yw63_192",tu="_line1_1yw63_203",nu="_line2_1yw63_210",su="_circle3_1yw63_227",ou="_circle4_1yw63_232",ru="_annotationSurface_1yw63_237",I={wrapper:Tl,color:Ml,content:Rl,preview:Pl,container:Ll,buttonWrapper:Ol,button:$l,buttonBorder:Fl,buttonBackground:zl,text:Hl,textText:Wl,icon:Ul,iconIcon:Vl,annotation:Kl,annotationText:Yl,label:Gl,circle:ql,line:Xl,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 r.jsx("div",{className:I.container,children:r.jsxs("div",{className:I.buttonWrapper,children:[r.jsxs("div",{className:l.clx(I.button,{[I.buttonBorder]:e==="border",[I.buttonBackground]:e==="surface"}),children:[r.jsx(k.Icon,{name:"Smiley",className:l.clx(I.icon,{[I.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),r.jsx("span",{className:l.clx(I.text,{[I.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&r.jsxs("div",{className:l.clx(I.annotation,I.annotationText),children:[r.jsx("div",{className:I.label,children:"Text Color"}),r.jsx("div",{className:I.line}),r.jsx("div",{className:l.clx(I.circle,I.circle1)}),r.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="text"&&r.jsxs("div",{className:l.clx(I.annotation,I.annotationIcon),children:[r.jsx("div",{className:I.label,children:"Icon Color"}),r.jsx("div",{className:I.line}),r.jsx("div",{className:l.clx(I.circle,I.circle1)}),r.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="border"&&r.jsxs("div",{className:l.clx(I.annotation,I.annotationBorder),children:[r.jsx("div",{className:I.label,children:"Border Color"}),r.jsx("div",{className:l.clx(I.line,I.line1)}),r.jsx("div",{className:l.clx(I.line,I.line2)}),r.jsx("div",{className:l.clx(I.circle,I.circle1)}),r.jsx("div",{className:l.clx(I.circle,I.circle2)}),r.jsx("div",{className:l.clx(I.circle,I.circle3)}),r.jsx("div",{className:l.clx(I.circle,I.circle4)})]}),e==="surface"&&r.jsxs("div",{className:l.clx(I.annotation,I.annotationSurface),children:[r.jsx("div",{className:I.label,children:"Surface Color"}),r.jsx("div",{className:I.line}),r.jsx("div",{className:l.clx(I.circle,I.circle1)}),r.jsx("div",{className:l.clx(I.circle,I.circle2)})]})]})})},cu={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"]},au=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:s,updateColor:o}=l.useThemeSettingsStore();function i(){t(null)}function c(d,p,v){o(d,p,v)}const a=!!((e==null?void 0:e.name)==="Colors"&&n),u=(e==null?void 0:e.name)!=="Colors"||!n,h=n?cu[n]:[];return r.jsxs(l.AnimatedPanel,{isOpen:a,isClose:u,children:[r.jsx(mt,{onClick:i,title:n==="text"?"Text & Icon Colors":`${l.formatLabel(n)} Colors`}),n&&r.jsxs("div",{className:I.wrapper,children:[r.jsx(iu,{}),h.map(d=>{const p=s.colors[n][d];return typeof p!="string"?null:r.jsx("div",{className:I.color,children:r.jsxs("div",{className:I.content,children:[r.jsx("div",{className:I.preview,style:{background:p}}),r.jsx(l.ColorPicker,{title:l.formatLabel(d),initialColor:p,onChange:v=>c(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 r.jsx(r.Fragment,{children:n?r.jsx("div",{className:uu.loader,children:r.jsx(l.Loader,{})}):r.jsxs(r.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&r.jsx(wl,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&r.jsx(dl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&r.jsx(al,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&r.jsx(au,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&r.jsx(Dl,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&r.jsx(Ua,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&r.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 i=!!e,c=!e||n.name!=="Theme";return r.jsxs(l.AnimatedPanel,{isOpen:i,isClose:c,children:[r.jsx(mt,{onClick:o,title:(e==null?void 0:e.name)||""}),r.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 r.jsxs("div",{className:Jn.sidebar,style:{zIndex:t?50:"auto"},children:[r.jsx("h3",{className:Jn.title,children:n()}),e.name==="Layers"&&r.jsx(ia,{}),e.name==="Add"&&r.jsx(Rs,{}),r.jsx(Oa,{}),r.jsx(hu,{}),e.name==="Theme"&&r.jsx(pa,{}),e.name==="Settings"&&r.jsx(la,{})]})},gu="_wrapper_no6if_1",pu="_header_no6if_12",mu="_content_no6if_23",vu="_buttons_no6if_44",bu="_label_no6if_51",xu="_description_no6if_52",Su="_preview_no6if_60",wu="_block_no6if_66",_u="_slug_no6if_75",yu="_title_no6if_81",Cu="_closeIcon_no6if_87",ae={wrapper:gu,header:pu,content:mu,buttons:vu,label:bu,description:xu,preview:Su,block:wu,slug:_u,title:yu,closeIcon:Cu},ju=()=>{var $,R,D,P,T,z,q;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:s,isEdit:o,setIsEdit:i,editedPage:c,setEditedPage:a,pageContext:u}=l.usePagesStore(),{setIsOpen:h}=l.useModalStore(),{isAntistock:d}=l.useGeneralStore(),{createPage:p,updatePage:v}=l.useLayersStore(),[m,_]=f.useState(c?t&&(($=t[c])==null?void 0:$.path):""),[g,x]=f.useState(c?t&&((R=t[c])==null?void 0:R.name):""),[S,y]=f.useState(c?t&&((D=t[c])==null?void 0:D.seo)&&((T=(P=t[c])==null?void 0:P.seo)==null?void 0:T.pageDescription)||"":`${u.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[b,A]=f.useState(c&&t&&(z=t[c])!=null&&z.isPrivate?"private":"public");function j(){_(""),x(""),y(""),A("public"),i(!1),a(null)}function C(){h(!1),setTimeout(()=>{j(),e(!1),h(!0)},300)}f.useEffect(()=>()=>{C()},[]);function w(B){return B[0]==="/"?B:"/"+B}function N(){n({path:w(m),name:g||m||"",icon:"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:b||"public"}),p(w(m)),C()}function M(){t&&(l.defaultPagePaths.includes(t[c].path)||Ms(t[c].path),v(t[c].path||"",m||""),s(c,{path:w(m),name:g||m,icon:t[c].icon||"File",seo:{pageTitle:g||"",pageDescription:S||""},visibility:b||"public"})),C()}return r.jsxs("div",{className:ae.wrapper,onClick:B=>B.stopPropagation(),children:[r.jsxs("div",{className:ae.header,children:[r.jsx("h2",{children:o?"Edit Page":"Create New Page"}),r.jsx("div",{className:ae.closeIcon,children:r.jsx(k.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:C})})]}),r.jsxs("div",{className:ae.content,children:[r.jsx(k.InputSettings,{label:"Page Slug",onChange:B=>_(B),value:m,placeholder:"path-to-page",disabled:!!(c&&t&&((q=t[c])!=null&&q.name)&&l.defaultPagePaths.includes(t[c].path)),required:!0,regex:"^.+$"}),r.jsx(k.InputSettings,{label:"Page Title",onChange:B=>{x(B)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),r.jsx(k.TextareaSettings,{label:"Description",onChange:B=>y(B),value:S,placeholder:`${u.general.info.name} is powered by the ${d?"Antistock":"Billgang.com"} platform which allows them to sell their digital products online for free.`,maxLength:150}),r.jsxs("div",{className:ae.preview,children:[r.jsx("span",{className:ae.label,children:"Preview"}),r.jsxs("div",{className:ae.block,children:[r.jsx("span",{className:ae.slug,children:m||"yoursite.url"}),r.jsx("span",{className:ae.title,children:g||"My Blank Page"}),r.jsx("span",{className:ae.description,children:S||"It is My Description"})]})]})]}),r.jsxs("div",{className:ae.buttons,children:[r.jsx(k.ButtonSettings,{onClick:C,type:"Secondary",children:"Cancel"}),r.jsx(k.ButtonSettings,{onClick:o?M:N,disabled:m.length===0,type:"Primary",children:o?"Update":"Create"})]})]})};exports.CSS=Ge;exports.DndContext=ms;exports.Fuse=Le;exports.Header=Yi;exports.ModifyPage=ju;exports.Navbar=nc;exports.PointerSensor=Rt;exports.Preview=$c;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=Cs;exports.verticalListSortingStrategy=xs;