@yext/visual-editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/README.md +23 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/style.css +1 -0
- package/dist/visual-editor.cjs +131 -0
- package/dist/visual-editor.js +7470 -0
- package/package.json +108 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),or=require("@measured/puck"),Hr=require("react-dom");function Zn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const f=Zn(E),Ur=Zn(Hr);var kr={exports:{}},Dt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var yn;function ms(){if(yn)return Dt;yn=1;var e=E,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,l,u){var d,g={},c=null,h=null;u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),l.ref!==void 0&&(h=l.ref);for(d in l)n.call(l,d)&&!a.hasOwnProperty(d)&&(g[d]=l[d]);if(i&&i.defaultProps)for(d in l=i.defaultProps,l)g[d]===void 0&&(g[d]=l[d]);return{$$typeof:t,type:i,key:c,ref:h,props:g,_owner:o.current}}return Dt.Fragment=r,Dt.jsx=s,Dt.jsxs=s,Dt}var Nt={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var bn;function hs(){return bn||(bn=1,process.env.NODE_ENV!=="production"&&function(){var e=E,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),x=Symbol.iterator,m="@@iterator";function v(p){if(p===null||typeof p!="object")return null;var C=x&&p[x]||p[m];return typeof C=="function"?C:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var C=arguments.length,T=new Array(C>1?C-1:0),M=1;M<C;M++)T[M-1]=arguments[M];R("error",p,T)}}function R(p,C,T){{var M=b.ReactDebugCurrentFrame,q=M.getStackAddendum();q!==""&&(C+="%s",T=T.concat([q]));var Q=T.map(function(Y){return String(Y)});Q.unshift("Warning: "+C),Function.prototype.apply.call(console[p],console,Q)}}var S=!1,P=!1,N=!1,D=!1,B=!1,U;U=Symbol.for("react.module.reference");function G(p){return!!(typeof p=="string"||typeof p=="function"||p===n||p===a||B||p===o||p===u||p===d||D||p===h||S||P||N||typeof p=="object"&&p!==null&&(p.$$typeof===c||p.$$typeof===g||p.$$typeof===s||p.$$typeof===i||p.$$typeof===l||p.$$typeof===U||p.getModuleId!==void 0))}function X(p,C,T){var M=p.displayName;if(M)return M;var q=C.displayName||C.name||"";return q!==""?T+"("+q+")":T}function k(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case i:var C=p;return k(C)+".Consumer";case s:var T=p;return k(T._context)+".Provider";case l:return X(p,p.render,"ForwardRef");case g:var M=p.displayName||null;return M!==null?M:W(p.type)||"Memo";case c:{var q=p,Q=q._payload,Y=q._init;try{return W(Y(Q))}catch{return null}}}return null}var $=Object.assign,V=0,_,O,A,j,oe,F,H;function Z(){}Z.__reactDisabledLog=!0;function ue(){{if(V===0){_=console.log,O=console.info,A=console.warn,j=console.error,oe=console.group,F=console.groupCollapsed,H=console.groupEnd;var p={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}V++}}function Se(){{if(V--,V===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},p,{value:_}),info:$({},p,{value:O}),warn:$({},p,{value:A}),error:$({},p,{value:j}),group:$({},p,{value:oe}),groupCollapsed:$({},p,{value:F}),groupEnd:$({},p,{value:H})})}V<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=b.ReactCurrentDispatcher,Te;function ge(p,C,T){{if(Te===void 0)try{throw Error()}catch(q){var M=q.stack.trim().match(/\n( *(at )?)/);Te=M&&M[1]||""}return`
|
|
18
|
+
`+Te+p}}var xe=!1,ve;{var st=typeof WeakMap=="function"?WeakMap:Map;ve=new st}function Me(p,C){if(!p||xe)return"";{var T=ve.get(p);if(T!==void 0)return T}var M;xe=!0;var q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=ee.current,ee.current=null,ue();try{if(C){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(pe){M=pe}Reflect.construct(p,[],Y)}else{try{Y.call()}catch(pe){M=pe}p.call(Y.prototype)}}else{try{throw Error()}catch(pe){M=pe}p()}}catch(pe){if(pe&&M&&typeof pe.stack=="string"){for(var z=pe.stack.split(`
|
|
19
|
+
`),le=M.stack.split(`
|
|
20
|
+
`),ne=z.length-1,ae=le.length-1;ne>=1&&ae>=0&&z[ne]!==le[ae];)ae--;for(;ne>=1&&ae>=0;ne--,ae--)if(z[ne]!==le[ae]){if(ne!==1||ae!==1)do if(ne--,ae--,ae<0||z[ne]!==le[ae]){var Ee=`
|
|
21
|
+
`+z[ne].replace(" at new "," at ");return p.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",p.displayName)),typeof p=="function"&&ve.set(p,Ee),Ee}while(ne>=1&&ae>=0);break}}}finally{xe=!1,ee.current=Q,Se(),Error.prepareStackTrace=q}var dt=p?p.displayName||p.name:"",et=dt?ge(dt):"";return typeof p=="function"&&ve.set(p,et),et}function Ie(p,C,T){return Me(p,!1)}function Qe(p){var C=p.prototype;return!!(C&&C.isReactComponent)}function Le(p,C,T){if(p==null)return"";if(typeof p=="function")return Me(p,Qe(p));if(typeof p=="string")return ge(p);switch(p){case u:return ge("Suspense");case d:return ge("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case l:return Ie(p.render);case g:return Le(p.type,C,T);case c:{var M=p,q=M._payload,Q=M._init;try{return Le(Q(q),C,T)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,it={},lt=b.ReactDebugCurrentFrame;function re(p){if(p){var C=p._owner,T=Le(p.type,p._source,C?C.type:null);lt.setExtraStackFrame(T)}else lt.setExtraStackFrame(null)}function He(p,C,T,M,q){{var Q=Function.call.bind(de);for(var Y in p)if(Q(p,Y)){var z=void 0;try{if(typeof p[Y]!="function"){var le=Error((M||"React class")+": "+T+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw le.name="Invariant Violation",le}z=p[Y](C,Y,M,T,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){z=ne}z&&!(z instanceof Error)&&(re(q),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",T,Y,typeof z),re(null)),z instanceof Error&&!(z.message in it)&&(it[z.message]=!0,re(q),w("Failed %s type: %s",T,z.message),re(null))}}}var yr=Array.isArray;function Rt(p){return yr(p)}function ct(p){{var C=typeof Symbol=="function"&&Symbol.toStringTag,T=C&&p[Symbol.toStringTag]||p.constructor.name||"Object";return T}}function br(p){try{return Pt(p),!1}catch{return!0}}function Pt(p){return""+p}function ut(p){if(br(p))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ct(p)),Pt(p)}var we=b.ReactCurrentOwner,Wt={key:!0,ref:!0,__self:!0,__source:!0},$e,At,Tt;Tt={};function zt(p){if(de.call(p,"ref")){var C=Object.getOwnPropertyDescriptor(p,"ref").get;if(C&&C.isReactWarning)return!1}return p.ref!==void 0}function Vt(p){if(de.call(p,"key")){var C=Object.getOwnPropertyDescriptor(p,"key").get;if(C&&C.isReactWarning)return!1}return p.key!==void 0}function xr(p,C){if(typeof p.ref=="string"&&we.current&&C&&we.current.stateNode!==C){var T=W(we.current.type);Tt[T]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(we.current.type),p.ref),Tt[T]=!0)}}function Ot(p,C){{var T=function(){$e||($e=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",C))};T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})}}function Oe(p,C){{var T=function(){At||(At=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",C))};T.isReactWarning=!0,Object.defineProperty(p,"ref",{get:T,configurable:!0})}}var wr=function(p,C,T,M,q,Q,Y){var z={$$typeof:t,type:p,key:C,ref:T,props:Y,_owner:Q};return z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:q}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z};function I(p,C,T,M,q){{var Q,Y={},z=null,le=null;T!==void 0&&(ut(T),z=""+T),Vt(C)&&(ut(C.key),z=""+C.key),zt(C)&&(le=C.ref,xr(C,q));for(Q in C)de.call(C,Q)&&!Wt.hasOwnProperty(Q)&&(Y[Q]=C[Q]);if(p&&p.defaultProps){var ne=p.defaultProps;for(Q in ne)Y[Q]===void 0&&(Y[Q]=ne[Q])}if(z||le){var ae=typeof p=="function"?p.displayName||p.name||"Unknown":p;z&&Ot(Y,ae),le&&Oe(Y,ae)}return wr(p,z,le,q,M,we.current,Y)}}var K=b.ReactCurrentOwner,J=b.ReactDebugCurrentFrame;function se(p){if(p){var C=p._owner,T=Le(p.type,p._source,C?C.type:null);J.setExtraStackFrame(T)}else J.setExtraStackFrame(null)}var fe;fe=!1;function Ue(p){return typeof p=="object"&&p!==null&&p.$$typeof===t}function Ht(){{if(K.current){var p=W(K.current.type);if(p)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+p+"`."}return""}}function ss(p){return""}var pn={};function is(p){{var C=Ht();if(!C){var T=typeof p=="string"?p:p.displayName||p.name;T&&(C=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+T+">.")}return C}}function gn(p,C){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var T=is(C);if(pn[T])return;pn[T]=!0;var M="";p&&p._owner&&p._owner!==K.current&&(M=" It was passed a child from "+W(p._owner.type)+"."),se(p),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',T,M),se(null)}}function vn(p,C){{if(typeof p!="object")return;if(Rt(p))for(var T=0;T<p.length;T++){var M=p[T];Ue(M)&&gn(M,C)}else if(Ue(p))p._store&&(p._store.validated=!0);else if(p){var q=v(p);if(typeof q=="function"&&q!==p.entries)for(var Q=q.call(p),Y;!(Y=Q.next()).done;)Ue(Y.value)&&gn(Y.value,C)}}}function ls(p){{var C=p.type;if(C==null||typeof C=="string")return;var T;if(typeof C=="function")T=C.propTypes;else if(typeof C=="object"&&(C.$$typeof===l||C.$$typeof===g))T=C.propTypes;else return;if(T){var M=W(C);He(T,p.props,"prop",M,p)}else if(C.PropTypes!==void 0&&!fe){fe=!0;var q=W(C);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",q||"Unknown")}typeof C.getDefaultProps=="function"&&!C.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cs(p){{for(var C=Object.keys(p.props),T=0;T<C.length;T++){var M=C[T];if(M!=="children"&&M!=="key"){se(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),se(null);break}}p.ref!==null&&(se(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),se(null))}}var mn={};function hn(p,C,T,M,q,Q){{var Y=G(p);if(!Y){var z="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(z+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var le=ss();le?z+=le:z+=Ht();var ne;p===null?ne="null":Rt(p)?ne="array":p!==void 0&&p.$$typeof===t?(ne="<"+(W(p.type)||"Unknown")+" />",z=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof p,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,z)}var ae=I(p,C,T,q,Q);if(ae==null)return ae;if(Y){var Ee=C.children;if(Ee!==void 0)if(M)if(Rt(Ee)){for(var dt=0;dt<Ee.length;dt++)vn(Ee[dt],p);Object.freeze&&Object.freeze(Ee)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else vn(Ee,p)}if(de.call(C,"key")){var et=W(p),pe=Object.keys(C).filter(function(vs){return vs!=="key"}),Er=pe.length>0?"{key: someKey, "+pe.join(": ..., ")+": ...}":"{key: someKey}";if(!mn[et+Er]){var gs=pe.length>0?"{"+pe.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,Er,et,gs,et),mn[et+Er]=!0}}return p===n?cs(ae):ls(ae),ae}}function us(p,C,T){return hn(p,C,T,!0)}function ds(p,C,T){return hn(p,C,T,!1)}var fs=ds,ps=us;Nt.Fragment=n,Nt.jsx=fs,Nt.jsxs=ps}()),Nt}process.env.NODE_ENV==="production"?kr.exports=ms():kr.exports=hs();var y=kr.exports;/**
|
|
31
|
+
* @license lucide-react v0.414.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/const ys=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qn=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
|
|
36
|
+
* @license lucide-react v0.414.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/var bs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
41
|
+
* @license lucide-react v0.414.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const xs=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:s,...i},l)=>E.createElement("svg",{ref:l,...bs,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Qn("lucide",o),...i},[...s.map(([u,d])=>E.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
|
46
|
+
* @license lucide-react v0.414.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const It=(e,t)=>{const r=E.forwardRef(({className:n,...o},a)=>E.createElement(xs,{ref:a,iconNode:t,className:Qn(`lucide-${ys(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
|
|
51
|
+
* @license lucide-react v0.414.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const ws=It("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
|
|
56
|
+
* @license lucide-react v0.414.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const Es=It("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
61
|
+
* @license lucide-react v0.414.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const Cs=It("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
66
|
+
* @license lucide-react v0.414.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Ss=It("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
71
|
+
* @license lucide-react v0.414.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const Rs=It("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);function Ps(e,t){const r=f.createContext(t);function n(a){const{children:s,...i}=a,l=f.useMemo(()=>i,Object.values(i));return y.jsx(r.Provider,{value:l,children:s})}function o(a){const s=f.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,o]}function Lt(e,t=[]){let r=[];function n(a,s){const i=f.createContext(s),l=r.length;r=[...r,s];function u(g){const{scope:c,children:h,...x}=g,m=(c==null?void 0:c[e][l])||i,v=f.useMemo(()=>x,Object.values(x));return y.jsx(m.Provider,{value:v,children:h})}function d(g,c){const h=(c==null?void 0:c[e][l])||i,x=f.useContext(h);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${g}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const o=()=>{const a=r.map(s=>f.createContext(s));return function(i){const l=(i==null?void 0:i[e])||a;return f.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[n,As(o,...t)]}function As(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=n.reduce((i,{useScope:l,scopeName:u})=>{const g=l(a)[`__scope${u}`];return{...i,...g}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Ts(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function eo(...e){return t=>e.forEach(r=>Ts(r,t))}function be(...e){return f.useCallback(eo(...e),e)}function ce(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var nt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Os=f.useId||(()=>{}),Ds=0;function Qt(e){const[t,r]=f.useState(Os());return nt(()=>{r(n=>n??String(Ds++))},[e]),t?`radix-${t}`:""}function qe(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function to({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=Ns({defaultProp:t,onChange:r}),a=e!==void 0,s=a?e:n,i=qe(r),l=f.useCallback(u=>{if(a){const g=typeof u=="function"?u(e):u;g!==e&&i(g)}else o(u)},[a,e,o,i]);return[s,l]}function Ns({defaultProp:e,onChange:t}){const r=f.useState(e),[n]=r,o=f.useRef(n),a=qe(t);return f.useEffect(()=>{o.current!==n&&(a(n),o.current=n)},[n,o,a]),r}var $t=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),a=o.find(ks);if(a){const s=a.props.children,i=o.map(l=>l===a?f.Children.count(s)>1?f.Children.only(null):f.isValidElement(s)?s.props.children:null:l);return y.jsx(_r,{...n,ref:t,children:f.isValidElement(s)?f.cloneElement(s,void 0,i):null})}return y.jsx(_r,{...n,ref:t,children:r})});$t.displayName="Slot";var _r=f.forwardRef((e,t)=>{const{children:r,...n}=e;if(f.isValidElement(r)){const o=js(r);return f.cloneElement(r,{..._s(n,r.props),ref:t?eo(t,o):o})}return f.Children.count(r)>1?f.Children.only(null):null});_r.displayName="SlotClone";var Yr=({children:e})=>y.jsx(y.Fragment,{children:e});function ks(e){return f.isValidElement(e)&&e.type===Yr}function _s(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{a(...i),o(...i)}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function js(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ms=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ie=Ms.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:a,...s}=n,i=a?$t:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(i,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Is(e,t){e&&Ur.flushSync(()=>e.dispatchEvent(t))}function Ls(e,t=globalThis==null?void 0:globalThis.document){const r=qe(e);f.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var $s="DismissableLayer",jr="dismissableLayer.update",Fs="dismissableLayer.pointerDownOutside",Bs="dismissableLayer.focusOutside",xn,ro=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:i,...l}=e,u=f.useContext(ro),[d,g]=f.useState(null),c=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=f.useState({}),x=be(t,D=>g(D)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),w=d?m.indexOf(d):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,P=Vs(D=>{const B=D.target,U=[...u.branches].some(G=>G.contains(B));!S||U||(o==null||o(D),s==null||s(D),D.defaultPrevented||i==null||i())},c),N=Hs(D=>{const B=D.target;[...u.branches].some(G=>G.contains(B))||(a==null||a(D),s==null||s(D),D.defaultPrevented||i==null||i())},c);return Ls(D=>{w===u.layers.size-1&&(n==null||n(D),!D.defaultPrevented&&i&&(D.preventDefault(),i()))},c),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xn=c.body.style.pointerEvents,c.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),wn(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(c.body.style.pointerEvents=xn)}},[d,c,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),wn())},[d,u]),f.useEffect(()=>{const D=()=>h({});return document.addEventListener(jr,D),()=>document.removeEventListener(jr,D)},[]),y.jsx(ie.div,{...l,ref:x,style:{pointerEvents:R?S?"auto":"none":void 0,...e.style},onFocusCapture:ce(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ce(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ce(e.onPointerDownCapture,P.onPointerDownCapture)})});Gr.displayName=$s;var Ws="DismissableLayerBranch",zs=f.forwardRef((e,t)=>{const r=f.useContext(ro),n=f.useRef(null),o=be(t,n);return f.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),y.jsx(ie.div,{...e,ref:o})});zs.displayName=Ws;function Vs(e,t=globalThis==null?void 0:globalThis.document){const r=qe(e),n=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const a=i=>{if(i.target&&!n.current){let l=function(){no(Fs,r,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Hs(e,t=globalThis==null?void 0:globalThis.document){const r=qe(e),n=f.useRef(!1);return f.useEffect(()=>{const o=a=>{a.target&&!n.current&&no(Bs,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function wn(){const e=new CustomEvent(jr);document.dispatchEvent(e)}function no(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Is(o,a):o.dispatchEvent(a)}var Cr="focusScope.autoFocusOnMount",Sr="focusScope.autoFocusOnUnmount",En={bubbles:!1,cancelable:!0},Us="FocusScope",oo=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,l]=f.useState(null),u=qe(o),d=qe(a),g=f.useRef(null),c=be(t,m=>l(m)),h=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let m=function(R){if(h.paused||!i)return;const S=R.target;i.contains(S)?g.current=S:Xe(g.current,{select:!0})},v=function(R){if(h.paused||!i)return;const S=R.relatedTarget;S!==null&&(i.contains(S)||Xe(g.current,{select:!0}))},b=function(R){if(document.activeElement===document.body)for(const P of R)P.removedNodes.length>0&&Xe(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(b);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[n,i,h.paused]),f.useEffect(()=>{if(i){Sn.add(h);const m=document.activeElement;if(!i.contains(m)){const b=new CustomEvent(Cr,En);i.addEventListener(Cr,u),i.dispatchEvent(b),b.defaultPrevented||(Ys(Js(ao(i)),{select:!0}),document.activeElement===m&&Xe(i))}return()=>{i.removeEventListener(Cr,u),setTimeout(()=>{const b=new CustomEvent(Sr,En);i.addEventListener(Sr,d),i.dispatchEvent(b),b.defaultPrevented||Xe(m??document.body,{select:!0}),i.removeEventListener(Sr,d),Sn.remove(h)},0)}}},[i,u,d,h]);const x=f.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const w=m.currentTarget,[R,S]=Gs(w);R&&S?!m.shiftKey&&b===S?(m.preventDefault(),r&&Xe(R,{select:!0})):m.shiftKey&&b===R&&(m.preventDefault(),r&&Xe(S,{select:!0})):b===w&&m.preventDefault()}},[r,n,h.paused]);return y.jsx(ie.div,{tabIndex:-1,...s,ref:c,onKeyDown:x})});oo.displayName=Us;function Ys(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Xe(n,{select:t}),document.activeElement!==r)return}function Gs(e){const t=ao(e),r=Cn(t,e),n=Cn(t.reverse(),e);return[r,n]}function ao(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Cn(e,t){for(const r of e)if(!Xs(r,{upTo:t}))return r}function Xs(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qs(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&qs(e)&&t&&e.select()}}var Sn=Ks();function Ks(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Rn(e,t),e.unshift(t)},remove(t){var r;e=Rn(e,t),(r=e[0])==null||r.resume()}}}function Rn(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Js(e){return e.filter(t=>t.tagName!=="A")}var Zs="Portal",so=f.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[o,a]=f.useState(!1);nt(()=>a(!0),[]);const s=r||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?Hr.createPortal(y.jsx(ie.div,{...n,ref:t}),s):null});so.displayName=Zs;function Qs(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var Ft=e=>{const{present:t,children:r}=e,n=ei(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),a=be(n.ref,ti(o));return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:a}):null};Ft.displayName="Presence";function ei(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),a=f.useRef("none"),s=e?"mounted":"unmounted",[i,l]=Qs(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ut(n.current);a.current=i==="mounted"?u:"none"},[i]),nt(()=>{const u=n.current,d=o.current;if(d!==e){const c=a.current,h=Ut(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&c!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),nt(()=>{if(t){const u=g=>{const h=Ut(n.current).includes(g.animationName);g.target===t&&h&&Ur.flushSync(()=>l("ANIMATION_END"))},d=g=>{g.target===t&&(a.current=Ut(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:f.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function Ut(e){return(e==null?void 0:e.animationName)||"none"}function ti(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Rr=0;function ri(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pn()),document.body.insertAdjacentElement("beforeend",e[1]??Pn()),Rr++,()=>{Rr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rr--}},[])}function Pn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Ne=function(){return Ne=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ne.apply(this,arguments)};function io(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ni(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var er="right-scroll-bar-position",tr="width-before-scroll-bar",oi="with-scroll-bars-hidden",ai="--removed-body-scroll-bar-size";function Pr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function si(e,t){var r=E.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ii=typeof window<"u"?f.useLayoutEffect:f.useEffect,An=new WeakMap;function li(e,t){var r=si(null,function(n){return e.forEach(function(o){return Pr(o,n)})});return ii(function(){var n=An.get(r);if(n){var o=new Set(n),a=new Set(e),s=r.current;o.forEach(function(i){a.has(i)||Pr(i,null)}),a.forEach(function(i){o.has(i)||Pr(i,s)})}An.set(r,e)},[e]),r}function ci(e){return e}function ui(e,t){t===void 0&&(t=ci);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var s=t(a,n);return r.push(s),function(){r=r.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(n=!0;r.length;){var s=r;r=[],s.forEach(a)}r={push:function(i){return a(i)},filter:function(){return r}}},assignMedium:function(a){n=!0;var s=[];if(r.length){var i=r;r=[],i.forEach(a),s=r}var l=function(){var d=s;s=[],d.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),r}}}};return o}function di(e){e===void 0&&(e={});var t=ui(null);return t.options=Ne({async:!0,ssr:!1},e),t}var lo=function(e){var t=e.sideCar,r=io(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,Ne({},r))};lo.isSideCarExport=!0;function fi(e,t){return e.useMedium(t),lo}var co=di(),Ar=function(){},dr=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Ar,onWheelCapture:Ar,onTouchMoveCapture:Ar}),o=n[0],a=n[1],s=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,g=e.shards,c=e.sideCar,h=e.noIsolation,x=e.inert,m=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,w=e.gapMode,R=io(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=c,P=li([r,t]),N=Ne(Ne({},R),o);return f.createElement(f.Fragment,null,d&&f.createElement(S,{sideCar:co,removeScrollBar:u,shards:g,noIsolation:h,inert:x,setCallbacks:a,allowPinchZoom:!!m,lockRef:r,gapMode:w}),s?f.cloneElement(f.Children.only(i),Ne(Ne({},N),{ref:P})):f.createElement(b,Ne({},N,{className:l,ref:P}),i))});dr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dr.classNames={fullWidth:tr,zeroRight:er};var pi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pi();return t&&e.setAttribute("nonce",t),e}function vi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hi=function(){var e=0,t=null;return{add:function(r){e==0&&(t=gi())&&(vi(t,r),mi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yi=function(){var e=hi();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},uo=function(){var e=yi(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},bi={left:0,top:0,right:0,gap:0},Tr=function(e){return parseInt(e||"",10)||0},xi=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Tr(r),Tr(n),Tr(o)]},wi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bi;var t=xi(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Ei=uo(),mt="data-scroll-locked",Ci=function(e,t,r,n){var o=e.left,a=e.top,s=e.right,i=e.gap;return r===void 0&&(r="margin"),`
|
|
76
|
+
.`.concat(oi,` {
|
|
77
|
+
overflow: hidden `).concat(n,`;
|
|
78
|
+
padding-right: `).concat(i,"px ").concat(n,`;
|
|
79
|
+
}
|
|
80
|
+
body[`).concat(mt,`] {
|
|
81
|
+
overflow: hidden `).concat(n,`;
|
|
82
|
+
overscroll-behavior: contain;
|
|
83
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
84
|
+
padding-left: `.concat(o,`px;
|
|
85
|
+
padding-top: `).concat(a,`px;
|
|
86
|
+
padding-right: `).concat(s,`px;
|
|
87
|
+
margin-left:0;
|
|
88
|
+
margin-top:0;
|
|
89
|
+
margin-right: `).concat(i,"px ").concat(n,`;
|
|
90
|
+
`),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.`).concat(er,` {
|
|
94
|
+
right: `).concat(i,"px ").concat(n,`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.`).concat(tr,` {
|
|
98
|
+
margin-right: `).concat(i,"px ").concat(n,`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.`).concat(er," .").concat(er,` {
|
|
102
|
+
right: 0 `).concat(n,`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.`).concat(tr," .").concat(tr,` {
|
|
106
|
+
margin-right: 0 `).concat(n,`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
body[`).concat(mt,`] {
|
|
110
|
+
`).concat(ai,": ").concat(i,`px;
|
|
111
|
+
}
|
|
112
|
+
`)},Tn=function(){var e=parseInt(document.body.getAttribute(mt)||"0",10);return isFinite(e)?e:0},Si=function(){f.useEffect(function(){return document.body.setAttribute(mt,(Tn()+1).toString()),function(){var e=Tn()-1;e<=0?document.body.removeAttribute(mt):document.body.setAttribute(mt,e.toString())}},[])},Ri=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Si();var a=f.useMemo(function(){return wi(o)},[o]);return f.createElement(Ei,{styles:Ci(a,!t,o,r?"":"!important")})},Mr=!1;if(typeof window<"u")try{var Yt=Object.defineProperty({},"passive",{get:function(){return Mr=!0,!0}});window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{Mr=!1}var ft=Mr?{passive:!1}:!1,Pi=function(e){return e.tagName==="TEXTAREA"},fo=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Pi(e)&&r[t]==="visible")},Ai=function(e){return fo(e,"overflowY")},Ti=function(e){return fo(e,"overflowX")},On=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=po(e,n);if(o){var a=go(e,n),s=a[1],i=a[2];if(s>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Oi=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Di=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},po=function(e,t){return e==="v"?Ai(t):Ti(t)},go=function(e,t){return e==="v"?Oi(t):Di(t)},Ni=function(e,t){return e==="h"&&t==="rtl"?-1:1},ki=function(e,t,r,n,o){var a=Ni(e,window.getComputedStyle(t).direction),s=a*n,i=r.target,l=t.contains(i),u=!1,d=s>0,g=0,c=0;do{var h=go(e,i),x=h[0],m=h[1],v=h[2],b=m-v-a*x;(x||b)&&po(e,i)&&(g+=b,c+=x),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&(Math.abs(g)<1||!o)||!d&&(Math.abs(c)<1||!o))&&(u=!0),u},Gt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dn=function(e){return[e.deltaX,e.deltaY]},Nn=function(e){return e&&"current"in e?e.current:e},_i=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ji=function(e){return`
|
|
113
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
114
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
115
|
+
`)},Mi=0,pt=[];function Ii(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(Mi++)[0],a=f.useState(uo)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=ni([e.lockRef.current],(e.shards||[]).map(Nn),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var b=Gt(m),w=r.current,R="deltaX"in m?m.deltaX:w[0]-b[0],S="deltaY"in m?m.deltaY:w[1]-b[1],P,N=m.target,D=Math.abs(R)>Math.abs(S)?"h":"v";if("touches"in m&&D==="h"&&N.type==="range")return!1;var B=On(D,N);if(!B)return!0;if(B?P=D:(P=D==="v"?"h":"v",B=On(D,N)),!B)return!1;if(!n.current&&"changedTouches"in m&&(R||S)&&(n.current=P),!P)return!0;var U=n.current||P;return ki(U,v,m,U==="h"?R:S,!0)},[]),l=f.useCallback(function(m){var v=m;if(!(!pt.length||pt[pt.length-1]!==a)){var b="deltaY"in v?Dn(v):Gt(v),w=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&_i(P.delta,b)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var R=(s.current.shards||[]).map(Nn).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=R.length>0?i(v,R[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=f.useCallback(function(m,v,b,w){var R={name:m,delta:v,target:b,should:w,shadowParent:Li(b)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(S){return S!==R})},1)},[]),d=f.useCallback(function(m){r.current=Gt(m),n.current=void 0},[]),g=f.useCallback(function(m){u(m.type,Dn(m),m.target,i(m,e.lockRef.current))},[]),c=f.useCallback(function(m){u(m.type,Gt(m),m.target,i(m,e.lockRef.current))},[]);f.useEffect(function(){return pt.push(a),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:c}),document.addEventListener("wheel",l,ft),document.addEventListener("touchmove",l,ft),document.addEventListener("touchstart",d,ft),function(){pt=pt.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,ft),document.removeEventListener("touchmove",l,ft),document.removeEventListener("touchstart",d,ft)}},[]);var h=e.removeScrollBar,x=e.inert;return f.createElement(f.Fragment,null,x?f.createElement(a,{styles:ji(o)}):null,h?f.createElement(Ri,{gapMode:e.gapMode}):null)}function Li(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $i=fi(co,Ii);var vo=f.forwardRef(function(e,t){return f.createElement(dr,Ne({},e,{ref:t,sideCar:$i}))});vo.classNames=dr.classNames;var Fi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gt=new WeakMap,Xt=new WeakMap,qt={},Or=0,mo=function(e){return e&&(e.host||mo(e.parentNode))},Bi=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=mo(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Wi=function(e,t,r,n){var o=Bi(t,Array.isArray(e)?e:[e]);qt[r]||(qt[r]=new WeakMap);var a=qt[r],s=[],i=new Set,l=new Set(o),u=function(g){!g||i.has(g)||(i.add(g),u(g.parentNode))};o.forEach(u);var d=function(g){!g||l.has(g)||Array.prototype.forEach.call(g.children,function(c){if(i.has(c))d(c);else try{var h=c.getAttribute(n),x=h!==null&&h!=="false",m=(gt.get(c)||0)+1,v=(a.get(c)||0)+1;gt.set(c,m),a.set(c,v),s.push(c),m===1&&x&&Xt.set(c,!0),v===1&&c.setAttribute(r,"true"),x||c.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",c,b)}})};return d(t),i.clear(),Or++,function(){s.forEach(function(g){var c=gt.get(g)-1,h=a.get(g)-1;gt.set(g,c),a.set(g,h),c||(Xt.has(g)||g.removeAttribute(n),Xt.delete(g)),h||g.removeAttribute(r)}),Or--,Or||(gt=new WeakMap,gt=new WeakMap,Xt=new WeakMap,qt={})}},zi=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Fi(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),Wi(n,o,r,"aria-hidden")):function(){return null}},Xr="Dialog",[ho,yo]=Lt(Xr),[Vi,Ae]=ho(Xr),bo=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,i=f.useRef(null),l=f.useRef(null),[u=!1,d]=to({prop:n,defaultProp:o,onChange:a});return y.jsx(Vi,{scope:t,triggerRef:i,contentRef:l,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(g=>!g),[d]),modal:s,children:r})};bo.displayName=Xr;var xo="DialogTrigger",wo=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ae(xo,r),a=be(t,o.triggerRef);return y.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Jr(o.open),...n,ref:a,onClick:ce(e.onClick,o.onOpenToggle)})});wo.displayName=xo;var qr="DialogPortal",[Hi,Eo]=ho(qr,{forceMount:void 0}),Co=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,a=Ae(qr,t);return y.jsx(Hi,{scope:t,forceMount:r,children:f.Children.map(n,s=>y.jsx(Ft,{present:r||a.open,children:y.jsx(so,{asChild:!0,container:o,children:s})}))})};Co.displayName=qr;var ar="DialogOverlay",So=f.forwardRef((e,t)=>{const r=Eo(ar,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=Ae(ar,e.__scopeDialog);return a.modal?y.jsx(Ft,{present:n||a.open,children:y.jsx(Ui,{...o,ref:t})}):null});So.displayName=ar;var Ui=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ae(ar,r);return y.jsx(vo,{as:$t,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(ie.div,{"data-state":Jr(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ot="DialogContent",Ro=f.forwardRef((e,t)=>{const r=Eo(ot,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=Ae(ot,e.__scopeDialog);return y.jsx(Ft,{present:n||a.open,children:a.modal?y.jsx(Yi,{...o,ref:t}):y.jsx(Gi,{...o,ref:t})})});Ro.displayName=ot;var Yi=f.forwardRef((e,t)=>{const r=Ae(ot,e.__scopeDialog),n=f.useRef(null),o=be(t,r.contentRef,n);return f.useEffect(()=>{const a=n.current;if(a)return zi(a)},[]),y.jsx(Po,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ce(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ce(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&a.preventDefault()}),onFocusOutside:ce(e.onFocusOutside,a=>a.preventDefault())})}),Gi=f.forwardRef((e,t)=>{const r=Ae(ot,e.__scopeDialog),n=f.useRef(!1),o=f.useRef(!1);return y.jsx(Po,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Po=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,i=Ae(ot,r),l=f.useRef(null),u=be(t,l);return ri(),y.jsxs(y.Fragment,{children:[y.jsx(oo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:y.jsx(Gr,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Jr(i.open),...s,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(qi,{titleId:i.titleId}),y.jsx(Ji,{contentRef:l,descriptionId:i.descriptionId})]})]})}),Kr="DialogTitle",Ao=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ae(Kr,r);return y.jsx(ie.h2,{id:o.titleId,...n,ref:t})});Ao.displayName=Kr;var To="DialogDescription",Oo=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ae(To,r);return y.jsx(ie.p,{id:o.descriptionId,...n,ref:t})});Oo.displayName=To;var Do="DialogClose",No=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=Ae(Do,r);return y.jsx(ie.button,{type:"button",...n,ref:t,onClick:ce(e.onClick,()=>o.onOpenChange(!1))})});No.displayName=Do;function Jr(e){return e?"open":"closed"}var ko="DialogTitleWarning",[Xi,_o]=Ps(ko,{contentName:ot,titleName:Kr,docsSlug:"dialog"}),qi=({titleId:e})=>{const t=_o(ko),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
116
|
+
|
|
117
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
118
|
+
|
|
119
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Ki="DialogDescriptionWarning",Ji=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_o(Ki).contentName}}.`;return f.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Zi=bo,Qi=wo,el=Co,tl=So,rl=Ro,nl=Ao,ol=Oo,jo=No,Mo="AlertDialog",[al,$d]=Lt(Mo,[yo]),ze=yo(),Io=e=>{const{__scopeAlertDialog:t,...r}=e,n=ze(t);return y.jsx(Zi,{...n,...r,modal:!0})};Io.displayName=Mo;var sl="AlertDialogTrigger",Lo=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,o=ze(r);return y.jsx(Qi,{...o,...n,ref:t})});Lo.displayName=sl;var il="AlertDialogPortal",$o=e=>{const{__scopeAlertDialog:t,...r}=e,n=ze(t);return y.jsx(el,{...n,...r})};$o.displayName=il;var ll="AlertDialogOverlay",Fo=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,o=ze(r);return y.jsx(tl,{...o,...n,ref:t})});Fo.displayName=ll;var ht="AlertDialogContent",[cl,ul]=al(ht),Bo=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...o}=e,a=ze(r),s=f.useRef(null),i=be(t,s),l=f.useRef(null);return y.jsx(Xi,{contentName:ht,titleName:Wo,docsSlug:"alert-dialog",children:y.jsx(cl,{scope:r,cancelRef:l,children:y.jsxs(rl,{role:"alertdialog",...a,...o,ref:i,onOpenAutoFocus:ce(o.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[y.jsx(Yr,{children:n}),y.jsx(fl,{contentRef:s})]})})})});Bo.displayName=ht;var Wo="AlertDialogTitle",zo=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,o=ze(r);return y.jsx(nl,{...o,...n,ref:t})});zo.displayName=Wo;var Vo="AlertDialogDescription",Ho=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,o=ze(r);return y.jsx(ol,{...o,...n,ref:t})});Ho.displayName=Vo;var dl="AlertDialogAction",Uo=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,o=ze(r);return y.jsx(jo,{...o,...n,ref:t})});Uo.displayName=dl;var Yo="AlertDialogCancel",Go=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:o}=ul(Yo,r),a=ze(r),s=be(t,o);return y.jsx(jo,{...a,...n,ref:s})});Go.displayName=Yo;var fl=({contentRef:e})=>{const t=`\`${ht}\` requires a description for the component to be accessible for screen reader users.
|
|
120
|
+
|
|
121
|
+
You can add a description to the \`${ht}\` by passing a \`${Vo}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
122
|
+
|
|
123
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ht}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
124
|
+
|
|
125
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},pl=Io,gl=Lo,vl=$o,Xo=Fo,qo=Bo,Ko=Uo,Jo=Go,Zo=zo,Qo=Ho;function ea(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ea(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ml(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ea(e))&&(n&&(n+=" "),n+=t);return n}const Zr="-";function hl(e){const t=bl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;function o(s){const i=s.split(Zr);return i[0]===""&&i.length!==1&&i.shift(),ta(i,t)||yl(s)}function a(s,i){const l=r[s]||[];return i&&n[s]?[...l,...n[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:a}}function ta(e,t){var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ta(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(Zr);return(s=t.validators.find(({validator:i})=>i(a)))==null?void 0:s.classGroupId}const kn=/^\[(.+)\]$/;function yl(e){if(kn.test(e)){const t=kn.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function bl(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return wl(Object.entries(e.classGroups),r).forEach(([a,s])=>{Ir(s,n,a,t)}),n}function Ir(e,t,r,n){e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:_n(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(xl(o)){Ir(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,s])=>{Ir(s,_n(t,a),r,n)})})}function _n(e,t){let r=e;return t.split(Zr).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function xl(e){return e.isThemeGetter}function wl(e,t){return t?e.map(([r,n])=>{const o=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,i])=>[t+s,i])):a);return[r,o]}):e}function El(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function o(a,s){r.set(a,s),t++,t>e&&(t=0,n=r,r=new Map)}return{get(a){let s=r.get(a);if(s!==void 0)return s;if((s=n.get(a))!==void 0)return o(a,s),s},set(a,s){r.has(a)?r.set(a,s):o(a,s)}}}const ra="!";function Cl(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],a=t.length;function s(i){const l=[];let u=0,d=0,g;for(let v=0;v<i.length;v++){let b=i[v];if(u===0){if(b===o&&(n||i.slice(v,v+a)===t)){l.push(i.slice(d,v)),d=v+a;continue}if(b==="/"){g=v;continue}}b==="["?u++:b==="]"&&u--}const c=l.length===0?i:i.substring(d),h=c.startsWith(ra),x=h?c.substring(1):c,m=g&&g>d?g-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:m}}return r?function(l){return r({className:l,parseClassName:s})}:s}function Sl(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function Rl(e){return{cache:El(e.cacheSize),parseClassName:Cl(e),...hl(e)}}const Pl=/\s+/;function Al(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=new Set;return e.trim().split(Pl).map(s=>{const{modifiers:i,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=r(s);let g=!!d,c=n(g?u.substring(0,d):u);if(!c){if(!g)return{isTailwindClass:!1,originalClassName:s};if(c=n(u),!c)return{isTailwindClass:!1,originalClassName:s};g=!1}const h=Sl(i).join(":");return{isTailwindClass:!0,modifierId:l?h+ra:h,classGroupId:c,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:i,classGroupId:l,hasPostfixModifier:u}=s,d=i+l;return a.has(d)?!1:(a.add(d),o(l,u).forEach(g=>a.add(i+g)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function Tl(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=na(t))&&(n&&(n+=" "),n+=r);return n}function na(e){if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=na(e[n]))&&(r&&(r+=" "),r+=t);return r}function Ol(e,...t){let r,n,o,a=s;function s(l){const u=t.reduce((d,g)=>g(d),e());return r=Rl(u),n=r.cache.get,o=r.cache.set,a=i,i(l)}function i(l){const u=n(l);if(u)return u;const d=Al(l,r);return o(l,d),d}return function(){return a(Tl.apply(null,arguments))}}function te(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const oa=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dl=/^\d+\/\d+$/,Nl=new Set(["px","full","screen"]),kl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_l=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ml=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Il=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Fe(e){return rt(e)||Nl.has(e)||Dl.test(e)}function Ye(e){return wt(e,"length",Hl)}function rt(e){return!!e&&!Number.isNaN(Number(e))}function Kt(e){return wt(e,"number",rt)}function kt(e){return!!e&&Number.isInteger(Number(e))}function Ll(e){return e.endsWith("%")&&rt(e.slice(0,-1))}function L(e){return oa.test(e)}function Ge(e){return kl.test(e)}const $l=new Set(["length","size","percentage"]);function Fl(e){return wt(e,$l,aa)}function Bl(e){return wt(e,"position",aa)}const Wl=new Set(["image","url"]);function zl(e){return wt(e,Wl,Yl)}function Vl(e){return wt(e,"",Ul)}function _t(){return!0}function wt(e,t,r){const n=oa.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function Hl(e){return _l.test(e)&&!jl.test(e)}function aa(){return!1}function Ul(e){return Ml.test(e)}function Yl(e){return Il.test(e)}function Gl(){const e=te("colors"),t=te("spacing"),r=te("blur"),n=te("brightness"),o=te("borderColor"),a=te("borderRadius"),s=te("borderSpacing"),i=te("borderWidth"),l=te("contrast"),u=te("grayscale"),d=te("hueRotate"),g=te("invert"),c=te("gap"),h=te("gradientColorStops"),x=te("gradientColorStopPositions"),m=te("inset"),v=te("margin"),b=te("opacity"),w=te("padding"),R=te("saturate"),S=te("scale"),P=te("sepia"),N=te("skew"),D=te("space"),B=te("translate"),U=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",L,t],k=()=>[L,t],W=()=>["",Fe,Ye],$=()=>["auto",rt,L],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",L],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[rt,Kt],H=()=>[rt,L];return{cacheSize:500,separator:":",theme:{colors:[_t],spacing:[Fe,Ye],blur:["none","",Ge,L],brightness:F(),borderColor:[e],borderRadius:["none","","full",Ge,L],borderSpacing:k(),borderWidth:W(),contrast:F(),grayscale:j(),hueRotate:H(),invert:j(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[Ll,Ye],inset:X(),margin:X(),opacity:F(),padding:k(),saturate:F(),scale:F(),sepia:j(),skew:H(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[Ge]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),L]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kt,L]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",kt,L]}],"grid-cols":[{"grid-cols":[_t]}],"col-start-end":[{col:["auto",{span:["full",kt,L]},L]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[_t]}],"row-start-end":[{row:["auto",{span:[kt,L]},L]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[c]}],"gap-x":[{"gap-x":[c]}],"gap-y":[{"gap-y":[c]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[Ge]},Ge]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ge,Ye]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kt]}],"font-family":[{font:[_t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",rt,Kt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fe,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fe,Ye]}],"underline-offset":[{"underline-offset":["auto",Fe,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Bl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zl]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:_()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[Fe,L]}],"outline-w":[{outline:[Fe,Ye]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Fe,Ye]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ge,Vl]}],"shadow-color":[{shadow:[_t]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ge,L]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[R]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[kt,L]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fe,Ye,Kt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Xl=Ol(Gl);function Ce(...e){return Xl(ml(e))}function sa(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=sa(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ql(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=sa(e))&&(n&&(n+=" "),n+=t);return n}const jn=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Mn=ql,ia=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Mn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(u=>{const d=r==null?void 0:r[u],g=a==null?void 0:a[u];if(d===null)return null;const c=jn(d)||jn(g);return o[u][c]}),i=r&&Object.entries(r).reduce((u,d)=>{let[g,c]=d;return c===void 0||(u[g]=c),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:g,className:c,...h}=d;return Object.entries(h).every(x=>{let[m,v]=x;return Array.isArray(v)?v.includes({...a,...i}[m]):{...a,...i}[m]===v})?[...u,g,c]:u},[]);return Mn(e,s,l,r==null?void 0:r.class,r==null?void 0:r.className)},Qr=ia("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-secondary active:bg-primary-foreground active:text-primary active:border-primary focus:border-2",secondary:"bg-primary-foreground text-primary border-2 border-primary hover:bg-primary hover:text-primary-foreground active:bg-secondary active:text-secondary-foreground focus:border-2",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border-primary border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 rounded-md px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Kl=f.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},a)=>{const s=n?$t:"button";return y.jsx(s,{className:Ce(Qr({variant:t,size:r,className:e})),ref:a,...o})});Kl.displayName="Button";const Jl=pl,Zl=gl,Ql=vl,la=f.forwardRef(({className:e,...t},r)=>y.jsx(Xo,{className:Ce("ve-fixed ve-inset-0 ve-z-50 ve-bg-black/80 data-[state=open]:ve-animate-in data-[state=closed]:ve-animate-out data-[state=closed]:ve-fade-out-0 data-[state=open]:ve-fade-in-0",e),...t,ref:r}));la.displayName=Xo.displayName;const ca=f.forwardRef(({className:e,...t},r)=>y.jsxs(Ql,{children:[y.jsx(la,{}),y.jsx(qo,{ref:r,className:Ce("ve-fixed ve-left-[50%] ve-top-[50%] ve-z-50 ve-grid ve-w-full ve-max-w-lg ve-translate-x-[-50%] ve-translate-y-[-50%] ve-gap-4 ve-border ve-bg-background ve-p-6 ve-shadow-lg ve-duration-200 data-[state=open]:ve-animate-in data-[state=closed]:ve-animate-out data-[state=closed]:ve-fade-out-0 data-[state=open]:ve-fade-in-0 data-[state=closed]:ve-zoom-out-95 data-[state=open]:ve-zoom-in-95 data-[state=closed]:ve-slide-out-to-left-1/2 data-[state=closed]:ve-slide-out-to-top-[48%] data-[state=open]:ve-slide-in-from-left-1/2 data-[state=open]:ve-slide-in-from-top-[48%] sm:ve-rounded-lg",e),...t})]}));ca.displayName=qo.displayName;const ua=({className:e,...t})=>y.jsx("div",{className:Ce("ve-flex ve-flex-col ve-space-y-2 ve-text-center sm:ve-text-left",e),...t});ua.displayName="AlertDialogHeader";const da=({className:e,...t})=>y.jsx("div",{className:Ce("ve-flex ve-flex-col-reverse sm:ve-flex-row sm:ve-justify-end sm:ve-space-x-2",e),...t});da.displayName="AlertDialogFooter";const fa=f.forwardRef(({className:e,...t},r)=>y.jsx(Zo,{ref:r,className:Ce("ve-text-lg ve-font-semibold",e),...t}));fa.displayName=Zo.displayName;const pa=f.forwardRef(({className:e,...t},r)=>y.jsx(Qo,{ref:r,className:Ce("ve-text-sm ve-text-muted-foreground",e),...t}));pa.displayName=Qo.displayName;const ec=f.forwardRef(({className:e,...t},r)=>y.jsx(Ko,{ref:r,className:Ce(Qr(),e),...t}));ec.displayName=Ko.displayName;const ga=f.forwardRef(({className:e,...t},r)=>y.jsx(Jo,{ref:r,className:Ce(Qr({variant:"outline"}),"ve-mt-2 sm:ve-mt-0",e),...t}));ga.displayName=Jo.displayName;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});var tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rc=typeof window<"u"&&typeof window.document<"u",nc=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,oc=(typeof self>"u"?"undefined":tc(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",ac=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),sc=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";Et.isBrowser=rc;Et.isWebWorker=oc;Et.isNode=nc;Et.isJsDom=ac;Et.isDeno=sc;const va=f.createContext(void 0),ic=({value:e,children:t})=>f.createElement(va.Provider,{value:e},t),lc=()=>{const e=f.useContext(va);if(!e)throw new Error("useDocument must be used within a DocumentProvider");return e},cc=ia("ve-inline-flex ve-items-center ve-justify-center ve-whitespace-nowrap ve-rounded-md ve-text-sm ve-font-medium ve-ring-offset-background ve-transition-colors focus-visible:ve-outline-none focus-visible:ve-ring-2 focus-visible:ve-ring-ring focus-visible:ve-ring-offset-2 disabled:ve-pointer-events-none disabled:ve-opacity-50",{variants:{variant:{default:"ve-bg-primary ve-text-primary-foreground hover:ve-bg-primary/90",destructive:"ve-bg-destructive ve-text-destructive-foreground hover:ve-bg-destructive/90",outline:"ve-border ve-border-input ve-bg-background hover:ve-bg-accent hover:ve-text-accent-foreground",secondary:"ve-bg-secondary ve-text-secondary-foreground hover:ve-bg-secondary/80",ghost:"hover:ve-bg-accent hover:ve-text-accent-foreground",link:"ve-text-primary ve-underline-offset-4 hover:ve-underline"},size:{default:"ve-h-10 ve-rounded-md ve-px-4 ve-py-2",sm:"ve-h-9 ve-rounded-md ve-px-3",lg:"ve-h-11 ve-rounded-md ve-px-8",icon:"ve-h-10 ve-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ke=f.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},a)=>{const s=n?$t:"button";return y.jsx(s,{className:Ce(cc({variant:t,size:r,className:e})),ref:a,...o})});ke.displayName="Button";const uc=["top","right","bottom","left"],_e=Math.min,he=Math.max,sr=Math.round,Jt=Math.floor,Ke=e=>({x:e,y:e}),dc={left:"right",right:"left",bottom:"top",top:"bottom"},fc={start:"end",end:"start"};function Lr(e,t,r){return he(e,_e(t,r))}function Be(e,t){return typeof e=="function"?e(t):e}function We(e){return e.split("-")[0]}function Ct(e){return e.split("-")[1]}function en(e){return e==="x"?"y":"x"}function tn(e){return e==="y"?"height":"width"}function Je(e){return["top","bottom"].includes(We(e))?"y":"x"}function rn(e){return en(Je(e))}function pc(e,t,r){r===void 0&&(r=!1);const n=Ct(e),o=rn(e),a=tn(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=ir(s)),[s,ir(s)]}function gc(e){const t=ir(e);return[$r(e),t,$r(t)]}function $r(e){return e.replace(/start|end/g,t=>fc[t])}function vc(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:s;default:return[]}}function mc(e,t,r,n){const o=Ct(e);let a=vc(We(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map($r)))),a}function ir(e){return e.replace(/left|right|bottom|top/g,t=>dc[t])}function hc(e){return{top:0,right:0,bottom:0,left:0,...e}}function ma(e){return typeof e!="number"?hc(e):{top:e,right:e,bottom:e,left:e}}function lr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function In(e,t,r){let{reference:n,floating:o}=e;const a=Je(t),s=rn(t),i=tn(s),l=We(t),u=a==="y",d=n.x+n.width/2-o.width/2,g=n.y+n.height/2-o.height/2,c=n[i]/2-o[i]/2;let h;switch(l){case"top":h={x:d,y:n.y-o.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:g};break;case"left":h={x:n.x-o.width,y:g};break;default:h={x:n.x,y:n.y}}switch(Ct(t)){case"start":h[s]-=c*(r&&u?-1:1);break;case"end":h[s]+=c*(r&&u?-1:1);break}return h}const yc=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:g}=In(u,n,l),c=n,h={},x=0;for(let m=0;m<i.length;m++){const{name:v,fn:b}=i[m],{x:w,y:R,data:S,reset:P}=await b({x:d,y:g,initialPlacement:n,placement:c,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});d=w??d,g=R??g,h={...h,[v]:{...h[v],...S}},P&&x<=50&&(x++,typeof P=="object"&&(P.placement&&(c=P.placement),P.rects&&(u=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:g}=In(u,c,l)),m=-1)}return{x:d,y:g,placement:c,strategy:o,middlewareData:h}};async function jt(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:c=!1,padding:h=0}=Be(t,e),x=ma(h),v=i[c?g==="floating"?"reference":"floating":g],b=lr(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:u,rootBoundary:d,strategy:l})),w=g==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),S=await(a.isElement==null?void 0:a.isElement(R))?await(a.getScale==null?void 0:a.getScale(R))||{x:1,y:1}:{x:1,y:1},P=lr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:R,strategy:l}):w);return{top:(b.top-P.top+x.top)/S.y,bottom:(P.bottom-b.bottom+x.bottom)/S.y,left:(b.left-P.left+x.left)/S.x,right:(P.right-b.right+x.right)/S.x}}const bc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:i,middlewareData:l}=t,{element:u,padding:d=0}=Be(e,t)||{};if(u==null)return{};const g=ma(d),c={x:r,y:n},h=rn(o),x=tn(h),m=await s.getDimensions(u),v=h==="y",b=v?"top":"left",w=v?"bottom":"right",R=v?"clientHeight":"clientWidth",S=a.reference[x]+a.reference[h]-c[h]-a.floating[x],P=c[h]-a.reference[h],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let D=N?N[R]:0;(!D||!await(s.isElement==null?void 0:s.isElement(N)))&&(D=i.floating[R]||a.floating[x]);const B=S/2-P/2,U=D/2-m[x]/2-1,G=_e(g[b],U),X=_e(g[w],U),k=G,W=D-m[x]-X,$=D/2-m[x]/2+B,V=Lr(k,$,W),_=!l.arrow&&Ct(o)!=null&&$!==V&&a.reference[x]/2-($<k?G:X)-m[x]/2<0,O=_?$<k?$-k:$-W:0;return{[h]:c[h]+O,data:{[h]:V,centerOffset:$-V-O,..._&&{alignmentOffset:O}},reset:_}}}),xc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:c,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...v}=Be(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=We(o),w=Je(i),R=We(i)===i,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=c||(R||!m?[ir(i)]:gc(i)),N=x!=="none";!c&&N&&P.push(...mc(i,m,x,S));const D=[i,...P],B=await jt(t,v),U=[];let G=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&U.push(B[b]),g){const $=pc(o,s,S);U.push(B[$[0]],B[$[1]])}if(G=[...G,{placement:o,overflows:U}],!U.every($=>$<=0)){var X,k;const $=(((X=a.flip)==null?void 0:X.index)||0)+1,V=D[$];if(V)return{data:{index:$,overflows:G},reset:{placement:V}};let _=(k=G.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:k.placement;if(!_)switch(h){case"bestFit":{var W;const O=(W=G.filter(A=>{if(N){const j=Je(A.placement);return j===w||j==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(j=>j>0).reduce((j,oe)=>j+oe,0)]).sort((A,j)=>A[1]-j[1])[0])==null?void 0:W[0];O&&(_=O);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $n(e){return uc.some(t=>e[t]>=0)}const wc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Be(e,t);switch(n){case"referenceHidden":{const a=await jt(t,{...o,elementContext:"reference"}),s=Ln(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:$n(s)}}}case"escaped":{const a=await jt(t,{...o,altBoundary:!0}),s=Ln(a,r.floating);return{data:{escapedOffsets:s,escaped:$n(s)}}}default:return{}}}}};async function Ec(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=We(r),i=Ct(r),l=Je(r)==="y",u=["left","top"].includes(s)?-1:1,d=a&&l?-1:1,g=Be(t,e);let{mainAxis:c,crossAxis:h,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return i&&typeof x=="number"&&(h=i==="end"?x*-1:x),l?{x:h*d,y:c*u}:{x:c*u,y:h*d}}const Cc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:i}=t,l=await Ec(t,e);return s===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:s}}}}},Sc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:v=>{let{x:b,y:w}=v;return{x:b,y:w}}},...l}=Be(e,t),u={x:r,y:n},d=await jt(t,l),g=Je(We(o)),c=en(g);let h=u[c],x=u[g];if(a){const v=c==="y"?"top":"left",b=c==="y"?"bottom":"right",w=h+d[v],R=h-d[b];h=Lr(w,h,R)}if(s){const v=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=x+d[v],R=x-d[b];x=Lr(w,x,R)}const m=i.fn({...t,[c]:h,[g]:x});return{...m,data:{x:m.x-r,y:m.y-n}}}}},Rc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=Be(e,t),d={x:r,y:n},g=Je(o),c=en(g);let h=d[c],x=d[g];const m=Be(i,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const R=c==="y"?"height":"width",S=a.reference[c]-a.floating[R]+v.mainAxis,P=a.reference[c]+a.reference[R]-v.mainAxis;h<S?h=S:h>P&&(h=P)}if(u){var b,w;const R=c==="y"?"width":"height",S=["top","left"].includes(We(o)),P=a.reference[g]-a.floating[R]+(S&&((b=s.offset)==null?void 0:b[g])||0)+(S?0:v.crossAxis),N=a.reference[g]+a.reference[R]+(S?0:((w=s.offset)==null?void 0:w[g])||0)-(S?v.crossAxis:0);x<P?x=P:x>N&&(x=N)}return{[c]:h,[g]:x}}}},Pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:a}=t,{apply:s=()=>{},...i}=Be(e,t),l=await jt(t,i),u=We(r),d=Ct(r),g=Je(r)==="y",{width:c,height:h}=n.floating;let x,m;u==="top"||u==="bottom"?(x=u,m=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=u,x=d==="end"?"top":"bottom");const v=h-l.top-l.bottom,b=c-l.left-l.right,w=_e(h-l[x],v),R=_e(c-l[m],b),S=!t.middlewareData.shift;let P=w,N=R;if(g?N=d||S?_e(R,b):b:P=d||S?_e(w,v):v,S&&!d){const B=he(l.left,0),U=he(l.right,0),G=he(l.top,0),X=he(l.bottom,0);g?N=c-2*(B!==0||U!==0?B+U:he(l.left,l.right)):P=h-2*(G!==0||X!==0?G+X:he(l.top,l.bottom))}await s({...t,availableWidth:N,availableHeight:P});const D=await o.getDimensions(a.floating);return c!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function St(e){return ha(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ve(e){var t;return(t=(ha(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ha(e){return e instanceof Node||e instanceof ye(e).Node}function Re(e){return e instanceof Element||e instanceof ye(e).Element}function je(e){return e instanceof HTMLElement||e instanceof ye(e).HTMLElement}function Fn(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function Bt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Ac(e){return["table","td","th"].includes(St(e))}function fr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function nn(e){const t=on(),r=Re(e)?Pe(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Tc(e){let t=Ze(e);for(;je(t)&&!bt(t);){if(nn(t))return t;if(fr(t))return null;t=Ze(t)}return null}function on(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bt(e){return["html","body","#document"].includes(St(e))}function Pe(e){return ye(e).getComputedStyle(e)}function pr(e){return Re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(St(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fn(e)&&e.host||Ve(e);return Fn(t)?t.host:t}function ya(e){const t=Ze(e);return bt(t)?e.ownerDocument?e.ownerDocument.body:e.body:je(t)&&Bt(t)?t:ya(t)}function Mt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ya(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=ye(o);if(a){const i=Fr(s);return t.concat(s,s.visualViewport||[],Bt(o)?o:[],i&&r?Mt(i):[])}return t.concat(o,Mt(o,[],r))}function Fr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ba(e){const t=Pe(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=je(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,i=sr(r)!==a||sr(n)!==s;return i&&(r=a,n=s),{width:r,height:n,$:i}}function an(e){return Re(e)?e:e.contextElement}function yt(e){const t=an(e);if(!je(t))return Ke(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=ba(t);let s=(a?sr(r.width):r.width)/n,i=(a?sr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const Oc=Ke(0);function xa(e){const t=ye(e);return!on()||!t.visualViewport?Oc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dc(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ye(e)?!1:t}function at(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=an(e);let s=Ke(1);t&&(n?Re(n)&&(s=yt(n)):s=yt(e));const i=Dc(a,r,n)?xa(a):Ke(0);let l=(o.left+i.x)/s.x,u=(o.top+i.y)/s.y,d=o.width/s.x,g=o.height/s.y;if(a){const c=ye(a),h=n&&Re(n)?ye(n):n;let x=c,m=Fr(x);for(;m&&n&&h!==x;){const v=yt(m),b=m.getBoundingClientRect(),w=Pe(m),R=b.left+(m.clientLeft+parseFloat(w.paddingLeft))*v.x,S=b.top+(m.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,g*=v.y,l+=R,u+=S,x=ye(m),m=Fr(x)}}return lr({width:d,height:g,x:l,y:u})}function Nc(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=Ve(n),i=t?fr(t.floating):!1;if(n===s||i&&a)return r;let l={scrollLeft:0,scrollTop:0},u=Ke(1);const d=Ke(0),g=je(n);if((g||!g&&!a)&&((St(n)!=="body"||Bt(s))&&(l=pr(n)),je(n))){const c=at(n);u=yt(n),d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x,y:r.y*u.y-l.scrollTop*u.y+d.y}}function kc(e){return Array.from(e.getClientRects())}function wa(e){return at(Ve(e)).left+pr(e).scrollLeft}function _c(e){const t=Ve(e),r=pr(e),n=e.ownerDocument.body,o=he(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=he(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+wa(e);const i=-r.scrollTop;return Pe(n).direction==="rtl"&&(s+=he(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:i}}function jc(e,t){const r=ye(e),n=Ve(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,i=0,l=0;if(o){a=o.width,s=o.height;const u=on();(!u||u&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}return{width:a,height:s,x:i,y:l}}function Mc(e,t){const r=at(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=je(e)?yt(e):Ke(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=o*a.x,u=n*a.y;return{width:s,height:i,x:l,y:u}}function Bn(e,t,r){let n;if(t==="viewport")n=jc(e,r);else if(t==="document")n=_c(Ve(e));else if(Re(t))n=Mc(t,r);else{const o=xa(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return lr(n)}function Ea(e,t){const r=Ze(e);return r===t||!Re(r)||bt(r)?!1:Pe(r).position==="fixed"||Ea(r,t)}function Ic(e,t){const r=t.get(e);if(r)return r;let n=Mt(e,[],!1).filter(i=>Re(i)&&St(i)!=="body"),o=null;const a=Pe(e).position==="fixed";let s=a?Ze(e):e;for(;Re(s)&&!bt(s);){const i=Pe(s),l=nn(s);!l&&i.position==="fixed"&&(o=null),(a?!l&&!o:!l&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Bt(s)&&!l&&Ea(e,s))?n=n.filter(d=>d!==s):o=i,s=Ze(s)}return t.set(e,n),n}function Lc(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?fr(t)?[]:Ic(t,this._c):[].concat(r),n],i=s[0],l=s.reduce((u,d)=>{const g=Bn(t,d,o);return u.top=he(g.top,u.top),u.right=_e(g.right,u.right),u.bottom=_e(g.bottom,u.bottom),u.left=he(g.left,u.left),u},Bn(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $c(e){const{width:t,height:r}=ba(e);return{width:t,height:r}}function Fc(e,t,r){const n=je(t),o=Ve(t),a=r==="fixed",s=at(e,!0,a,t);let i={scrollLeft:0,scrollTop:0};const l=Ke(0);if(n||!n&&!a)if((St(t)!=="body"||Bt(o))&&(i=pr(t)),n){const g=at(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&(l.x=wa(o));const u=s.left+i.scrollLeft-l.x,d=s.top+i.scrollTop-l.y;return{x:u,y:d,width:s.width,height:s.height}}function Dr(e){return Pe(e).position==="static"}function Wn(e,t){return!je(e)||Pe(e).position==="fixed"?null:t?t(e):e.offsetParent}function Ca(e,t){const r=ye(e);if(fr(e))return r;if(!je(e)){let o=Ze(e);for(;o&&!bt(o);){if(Re(o)&&!Dr(o))return o;o=Ze(o)}return r}let n=Wn(e,t);for(;n&&Ac(n)&&Dr(n);)n=Wn(n,t);return n&&bt(n)&&Dr(n)&&!nn(n)?r:n||Tc(e)||r}const Bc=async function(e){const t=this.getOffsetParent||Ca,r=this.getDimensions,n=await r(e.floating);return{reference:Fc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Wc(e){return Pe(e).direction==="rtl"}const zc={convertOffsetParentRelativeRectToViewportRelativeRect:Nc,getDocumentElement:Ve,getClippingRect:Lc,getOffsetParent:Ca,getElementRects:Bc,getClientRects:kc,getDimensions:$c,getScale:yt,isElement:Re,isRTL:Wc};function Vc(e,t){let r=null,n;const o=Ve(e);function a(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();const{left:u,top:d,width:g,height:c}=e.getBoundingClientRect();if(i||t(),!g||!c)return;const h=Jt(d),x=Jt(o.clientWidth-(u+g)),m=Jt(o.clientHeight-(d+c)),v=Jt(u),w={rootMargin:-h+"px "+-x+"px "+-m+"px "+-v+"px",threshold:he(0,_e(1,l))||1};let R=!0;function S(P){const N=P[0].intersectionRatio;if(N!==l){if(!R)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(S,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,w)}r.observe(e)}return s(!0),a}function Hc(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=an(e),d=o||a?[...u?Mt(u):[],...Mt(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const g=u&&i?Vc(u,r):null;let c=-1,h=null;s&&(h=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(c),c=requestAnimationFrame(()=>{var R;(R=h)==null||R.observe(t)})),r()}),u&&!l&&h.observe(u),h.observe(t));let x,m=l?at(e):null;l&&v();function v(){const b=at(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&r(),m=b,x=requestAnimationFrame(v)}return r(),()=>{var b;d.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),g==null||g(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const Uc=Cc,Yc=Sc,Gc=xc,Xc=Pc,qc=wc,zn=bc,Kc=Rc,Jc=(e,t,r)=>{const n=new Map,o={platform:zc,...r},a={...o.platform,_c:n};return yc(e,t,{...o,platform:a})};var rr=typeof document<"u"?E.useLayoutEffect:E.useEffect;function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!cr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!cr(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Sa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vn(e,t){const r=Sa(e);return Math.round(t*r)/r}function Hn(e){const t=f.useRef(e);return rr(()=>{t.current=e}),t}function Zc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[d,g]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[c,h]=f.useState(n);cr(c,n)||h(n);const[x,m]=f.useState(null),[v,b]=f.useState(null),w=f.useCallback(O=>{O!==N.current&&(N.current=O,m(O))},[]),R=f.useCallback(O=>{O!==D.current&&(D.current=O,b(O))},[]),S=a||x,P=s||v,N=f.useRef(null),D=f.useRef(null),B=f.useRef(d),U=l!=null,G=Hn(l),X=Hn(o),k=f.useCallback(()=>{if(!N.current||!D.current)return;const O={placement:t,strategy:r,middleware:c};X.current&&(O.platform=X.current),Jc(N.current,D.current,O).then(A=>{const j={...A,isPositioned:!0};W.current&&!cr(B.current,j)&&(B.current=j,Ur.flushSync(()=>{g(j)}))})},[c,t,r,X]);rr(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[u]);const W=f.useRef(!1);rr(()=>(W.current=!0,()=>{W.current=!1}),[]),rr(()=>{if(S&&(N.current=S),P&&(D.current=P),S&&P){if(G.current)return G.current(S,P,k);k()}},[S,P,k,G,U]);const $=f.useMemo(()=>({reference:N,floating:D,setReference:w,setFloating:R}),[w,R]),V=f.useMemo(()=>({reference:S,floating:P}),[S,P]),_=f.useMemo(()=>{const O={position:r,left:0,top:0};if(!V.floating)return O;const A=Vn(V.floating,d.x),j=Vn(V.floating,d.y);return i?{...O,transform:"translate("+A+"px, "+j+"px)",...Sa(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:j}},[r,i,V.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:k,refs:$,elements:V,floatingStyles:_}),[d,k,$,V,_])}const Qc=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?zn({element:n.current,padding:o}).fn(r):{}:n?zn({element:n,padding:o}).fn(r):{}}}},eu=(e,t)=>({...Uc(e),options:[e,t]}),tu=(e,t)=>({...Yc(e),options:[e,t]}),ru=(e,t)=>({...Kc(e),options:[e,t]}),nu=(e,t)=>({...Gc(e),options:[e,t]}),ou=(e,t)=>({...Xc(e),options:[e,t]}),au=(e,t)=>({...qc(e),options:[e,t]}),su=(e,t)=>({...Qc(e),options:[e,t]});var iu="Arrow",Ra=f.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return y.jsx(ie.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ra.displayName=iu;var lu=Ra;function cu(e){const[t,r]=f.useState(void 0);return nt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,i;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var sn="Popper",[Pa,Aa]=Lt(sn),[uu,Ta]=Pa(sn),Oa=e=>{const{__scopePopper:t,children:r}=e,[n,o]=f.useState(null);return y.jsx(uu,{scope:t,anchor:n,onAnchorChange:o,children:r})};Oa.displayName=sn;var Da="PopperAnchor",Na=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Ta(Da,r),s=f.useRef(null),i=be(t,s);return f.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:y.jsx(ie.div,{...o,ref:i})});Na.displayName=Da;var ln="PopperContent",[du,fu]=Pa(ln),ka=f.forwardRef((e,t)=>{var Te,ge,xe,ve,st,Me;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:g="partial",hideWhenDetached:c=!1,updatePositionStrategy:h="optimized",onPlaced:x,...m}=e,v=Ta(ln,r),[b,w]=f.useState(null),R=be(t,Ie=>w(Ie)),[S,P]=f.useState(null),N=cu(S),D=(N==null?void 0:N.width)??0,B=(N==null?void 0:N.height)??0,U=n+(a!=="center"?"-"+a:""),G=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},X=Array.isArray(u)?u:[u],k=X.length>0,W={padding:G,boundary:X.filter(gu),altBoundary:k},{refs:$,floatingStyles:V,placement:_,isPositioned:O,middlewareData:A}=Zc({strategy:"fixed",placement:U,whileElementsMounted:(...Ie)=>Hc(...Ie,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[eu({mainAxis:o+B,alignmentAxis:s}),l&&tu({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?ru():void 0,...W}),l&&nu({...W}),ou({...W,apply:({elements:Ie,rects:Qe,availableWidth:Le,availableHeight:de})=>{const{width:it,height:lt}=Qe.reference,re=Ie.floating.style;re.setProperty("--radix-popper-available-width",`${Le}px`),re.setProperty("--radix-popper-available-height",`${de}px`),re.setProperty("--radix-popper-anchor-width",`${it}px`),re.setProperty("--radix-popper-anchor-height",`${lt}px`)}}),S&&su({element:S,padding:i}),vu({arrowWidth:D,arrowHeight:B}),c&&au({strategy:"referenceHidden",...W})]}),[j,oe]=Ma(_),F=qe(x);nt(()=>{O&&(F==null||F())},[O,F]);const H=(Te=A.arrow)==null?void 0:Te.x,Z=(ge=A.arrow)==null?void 0:ge.y,ue=((xe=A.arrow)==null?void 0:xe.centerOffset)!==0,[Se,ee]=f.useState();return nt(()=>{b&&ee(window.getComputedStyle(b).zIndex)},[b]),y.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:O?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(ve=A.transformOrigin)==null?void 0:ve.x,(st=A.transformOrigin)==null?void 0:st.y].join(" "),...((Me=A.hide)==null?void 0:Me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(du,{scope:r,placedSide:j,onArrowChange:P,arrowX:H,arrowY:Z,shouldHideArrow:ue,children:y.jsx(ie.div,{"data-side":j,"data-align":oe,...m,ref:R,style:{...m.style,animation:O?void 0:"none"}})})})});ka.displayName=ln;var _a="PopperArrow",pu={top:"bottom",right:"left",bottom:"top",left:"right"},ja=f.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=fu(_a,n),s=pu[a.placedSide];return y.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:y.jsx(lu,{...o,ref:r,style:{...o.style,display:"block"}})})});ja.displayName=_a;function gu(e){return e!==null}var vu=e=>({name:"transformOrigin",options:e,fn(t){var v,b,w;const{placement:r,rects:n,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=Ma(r),g={start:"0%",center:"50%",end:"100%"}[d],c=(((b=o.arrow)==null?void 0:b.x)??0)+i/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",m="";return u==="bottom"?(x=s?g:`${c}px`,m=`${-l}px`):u==="top"?(x=s?g:`${c}px`,m=`${n.floating.height+l}px`):u==="right"?(x=`${-l}px`,m=s?g:`${h}px`):u==="left"&&(x=`${n.floating.width+l}px`,m=s?g:`${h}px`),{data:{x,y:m}}}});function Ma(e){const[t,r="center"]=e.split("-");return[t,r]}var mu=Oa,hu=Na,yu=ka,bu=ja,xu="VisuallyHidden",Ia=f.forwardRef((e,t)=>y.jsx(ie.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ia.displayName=xu;var wu=Ia,[gr,Fd]=Lt("Tooltip",[Aa]),vr=Aa(),La="TooltipProvider",Eu=700,Br="tooltip.open",[Cu,cn]=gr(La),$a=e=>{const{__scopeTooltip:t,delayDuration:r=Eu,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,[s,i]=f.useState(!0),l=f.useRef(!1),u=f.useRef(0);return f.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),y.jsx(Cu,{scope:t,isOpenDelayed:s,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(u.current),i(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:a})};$a.displayName=La;var mr="Tooltip",[Su,hr]=gr(mr),Fa=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:i}=e,l=cn(mr,e.__scopeTooltip),u=vr(t),[d,g]=f.useState(null),c=Qt(),h=f.useRef(0),x=s??l.disableHoverableContent,m=i??l.delayDuration,v=f.useRef(!1),[b=!1,w]=to({prop:n,defaultProp:o,onChange:D=>{D?(l.onOpen(),document.dispatchEvent(new CustomEvent(Br))):l.onClose(),a==null||a(D)}}),R=f.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),S=f.useCallback(()=>{window.clearTimeout(h.current),v.current=!1,w(!0)},[w]),P=f.useCallback(()=>{window.clearTimeout(h.current),w(!1)},[w]),N=f.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0)},m)},[m,w]);return f.useEffect(()=>()=>window.clearTimeout(h.current),[]),y.jsx(mu,{...u,children:y.jsx(Su,{scope:t,contentId:c,open:b,stateAttribute:R,trigger:d,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayed?N():S()},[l.isOpenDelayed,N,S]),onTriggerLeave:f.useCallback(()=>{x?P():window.clearTimeout(h.current)},[P,x]),onOpen:S,onClose:P,disableHoverableContent:x,children:r})})};Fa.displayName=mr;var Wr="TooltipTrigger",Ba=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=hr(Wr,r),a=cn(Wr,r),s=vr(r),i=f.useRef(null),l=be(t,i,o.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),g=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),y.jsx(hu,{asChild:!0,...s,children:y.jsx(ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:ce(e.onPointerMove,c=>{c.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ce(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ce(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ce(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ce(e.onBlur,o.onClose),onClick:ce(e.onClick,o.onClose)})})});Ba.displayName=Wr;var Ru="TooltipPortal",[Bd,Pu]=gr(Ru,{forceMount:void 0}),xt="TooltipContent",Wa=f.forwardRef((e,t)=>{const r=Pu(xt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,s=hr(xt,e.__scopeTooltip);return y.jsx(Ft,{present:n||s.open,children:s.disableHoverableContent?y.jsx(za,{side:o,...a,ref:t}):y.jsx(Au,{side:o,...a,ref:t})})}),Au=f.forwardRef((e,t)=>{const r=hr(xt,e.__scopeTooltip),n=cn(xt,e.__scopeTooltip),o=f.useRef(null),a=be(t,o),[s,i]=f.useState(null),{trigger:l,onClose:u}=r,d=o.current,{onPointerInTransitChange:g}=n,c=f.useCallback(()=>{i(null),g(!1)},[g]),h=f.useCallback((x,m)=>{const v=x.currentTarget,b={x:x.clientX,y:x.clientY},w=Du(b,v.getBoundingClientRect()),R=Nu(b,w),S=ku(m.getBoundingClientRect()),P=ju([...R,...S]);i(P),g(!0)},[g]);return f.useEffect(()=>()=>c(),[c]),f.useEffect(()=>{if(l&&d){const x=v=>h(v,d),m=v=>h(v,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",m)}}},[l,d,h,c]),f.useEffect(()=>{if(s){const x=m=>{const v=m.target,b={x:m.clientX,y:m.clientY},w=(l==null?void 0:l.contains(v))||(d==null?void 0:d.contains(v)),R=!_u(b,s);w?c():R&&(c(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,s,u,c]),y.jsx(za,{...e,ref:a})}),[Tu,Ou]=gr(mr,{isInside:!1}),za=f.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...i}=e,l=hr(xt,r),u=vr(r),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(Br,d),()=>document.removeEventListener(Br,d)),[d]),f.useEffect(()=>{if(l.trigger){const g=c=>{const h=c.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[l.trigger,d]),y.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:d,children:y.jsxs(yu,{"data-state":l.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(Yr,{children:n}),y.jsx(Tu,{scope:r,isInside:!0,children:y.jsx(wu,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Wa.displayName=xt;var Va="TooltipArrow",Ha=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=vr(r);return Ou(Va,r).isInside?null:y.jsx(bu,{...o,...n,ref:t})});Ha.displayName=Va;function Du(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Nu(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function ku(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function _u(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const i=t[a].x,l=t[a].y,u=t[s].x,d=t[s].y;l>n!=d>n&&r<(u-i)*(n-l)/(d-l)+i&&(o=!o)}return o}function ju(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Mu(t)}function Mu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Iu=$a,Lu=Fa,$u=Ba,Ua=Wa,Fu=Ha;const Ya=Iu,Ga=Lu,Xa=$u,qa=Fu,un=f.forwardRef(({className:e,sideOffset:t=4,...r},n)=>y.jsx(Ua,{ref:n,sideOffset:t,className:Ce("ve-z-50 ve-overflow-hidden ve-rounded-[6px] ve-bg-popover ve-px-3 ve-py-1.5 ve-text-sm ve-text-popover-foreground",e),...r}));un.displayName=Ua.displayName;const Bu=({displayName:e,fieldId:t,children:r})=>{const{tooltipsVisible:n}=Ja();let o="";return e&&t?o=`${e} (${t})`:t?o=`(${t})`:e&&(o=`${e}`),y.jsx(Ya,{children:y.jsxs(Ga,{open:n&&!!o,children:[y.jsx(Xa,{asChild:!0,children:y.jsx("div",{className:n?"ve-outline-2 ve-outline-dotted ve-outline-[#5A58F2]":"",children:r})}),y.jsxs(un,{children:[y.jsx("p",{children:o}),y.jsx(qa,{fill:"bg-popover"})]})]})})},Ka=E.createContext(void 0),Wu=({children:e})=>{const[t,r]=E.useState(!1),n=()=>{r(o=>!o)};return y.jsx(Ka.Provider,{value:{tooltipsVisible:t,toggleTooltips:n},children:e})},Ja=()=>{const e=E.useContext(Ka);return e||{tooltipsVisible:!1,toggleTooltips:()=>{}}},zu=e=>{window.open(`/${e}`,"_blank")},Vu=(e,t,r,n,o)=>{const a=lc(),{history:{back:s,forward:i,histories:l,index:u,hasFuture:d,hasPast:g,setHistories:c,setHistoryIndex:h}}=or.usePuck();return E.useEffect(()=>{t(l,u)},[u,l,t]),y.jsxs("header",{className:"puck-header puck-css",children:[y.jsxs("div",{className:"header-left",children:[y.jsx(Uu,{}),y.jsx(Yu,{})]}),y.jsx("div",{className:"header-center"}),y.jsxs("div",{className:"actions",children:[y.jsx(ke,{variant:"ghost",size:"icon",disabled:!g,onClick:s,children:y.jsx(Ss,{className:"sm-icon"})}),y.jsx(ke,{variant:"ghost",size:"icon",disabled:!d,onClick:i,children:y.jsx(Rs,{className:"sm-icon"})}),y.jsx(Hu,{disabled:l.length===0,onClearLocalChanges:()=>{e(),c([]),h(-1)}}),y.jsx(ke,{variant:"outline",onClick:()=>zu(a.slug),children:"View Page"}),!o&&y.jsx(ke,{variant:"secondary",disabled:l.length===0,onClick:async()=>{await n(r),e()},children:"Publish"})]})]})},Hu=({disabled:e,onClearLocalChanges:t})=>y.jsxs(Jl,{children:[y.jsx(Zl,{disabled:e,asChild:!0,children:y.jsx(ke,{variant:"outline",children:"Clear Local Changes"})}),y.jsxs(ca,{className:"puck-css",children:[y.jsxs(ua,{children:[y.jsx(fa,{children:"Clear Local Changes"}),y.jsx(pa,{children:"This action will remove your local changes. It cannot be undone."})]}),y.jsxs(da,{children:[y.jsx(ga,{children:"Cancel"}),y.jsx(ke,{onClick:t,children:"Confirm"})]})]})]}),Uu=()=>{const{dispatch:e,appState:{ui:{leftSideBarVisible:t,rightSideBarVisible:r}}}=or.usePuck(),n=E.useCallback(o=>{const a=window.matchMedia("(min-width: 638px)").matches,s=o==="left"?t:r,i=o==="left"?"rightSideBarVisible":"leftSideBarVisible";e({type:"setUi",ui:{[`${o}SideBarVisible`]:!s,...a?{}:{[i]:!1}}})},[e,t,r]);return y.jsxs(y.Fragment,{children:[y.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>{n("left")},children:y.jsx(Es,{className:"sm-icon"})}),y.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>{n("right")},children:y.jsx(Cs,{className:"sm-icon"})})]})},Yu=()=>{const{toggleTooltips:e,tooltipsVisible:t}=Ja();return y.jsx(Ya,{children:y.jsxs(Ga,{children:[y.jsx(Xa,{asChild:!0,children:y.jsx(ke,{variant:"ghost",size:"icon",onClick:e,className:t?"ve-border-2 ve-border-[#5A58F2] ve-rounded-full":"",children:y.jsx(ws,{className:"sm-icon"})})}),y.jsxs(un,{children:[t?"Hide Entity Fields":"Show Entity Fields",y.jsx(qa,{fill:"bg-popover"})]})]})})},Un="ROLE_",Yn="TEMPLATE_",Gu="LAYOUT_",Xu="ENTITY_";function tt(e,t,r,n,o){const a=e?"dev":"";if(!t||!r||!o&&!n)throw new Error("Unable to generate local storage key, missing query parameters");if(t===jd.INDIVIDUAL){if(!o)throw new Error(`EntityId required for role ${t}`);return a+Un+t+Yn+r+Xu+o}if(!n)throw new Error(`LayoutId required for role ${t}`);return a+Un+t+Yn+r+Gu+n}const qu=({puckConfig:e,puckData:t,puckInitialHistory:r,isLoading:n,clearHistory:o,templateMetadata:a,saveState:s,saveSaveState:i,saveVisualConfigData:l,sendDevSaveStateData:u})=>{const[d,g]=E.useState(!1),c=E.useRef(-1),h=E.useCallback((b,w)=>{var R;w!==-1&&c.current!==w&&b.length>0&&(c.current=w,window.localStorage.setItem(tt(a.isDevMode,a.role,a.templateId,a.layoutId,a.entityId),JSON.stringify(b)),(s==null?void 0:s.hash)!==b[w].id&&(a.isDevMode?u({payload:{devSaveStateData:JSON.stringify((R=b[w].data)==null?void 0:R.data)}}):i({payload:{hash:b[w].id,history:JSON.stringify(b[w].data)}})))},[a,tt]),x=()=>{o(a.isDevMode,a.role,a.templateId,a.layoutId,a.entityId)},m=async b=>{l({payload:{visualConfigurationData:JSON.stringify(b)}})},v=async()=>{if(!n&&!d){g(!0);return}};return y.jsx(Wu,{children:y.jsx(or.Puck,{config:e,data:t??{root:{},content:[],zones:{}},initialHistory:r,onChange:v,overrides:{header:()=>{const{appState:b}=or.usePuck();return Vu(x,h,b.data,m,a.isDevMode)}}})})};var dn="Progress",fn=100,[Ku,Wd]=Lt(dn),[Ju,Zu]=Ku(dn),Za=f.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:o,getValueLabel:a=Qu,...s}=e;(o||o===0)&&!Gn(o)&&console.error(ed(`${o}`,"Progress"));const i=Gn(o)?o:fn;n!==null&&!Xn(n,i)&&console.error(td(`${n}`,"Progress"));const l=Xn(n,i)?n:null,u=ur(l)?a(l,i):void 0;return y.jsx(Ju,{scope:r,value:l,max:i,children:y.jsx(ie.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":ur(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":ts(l,i),"data-value":l??void 0,"data-max":i,...s,ref:t})})});Za.displayName=dn;var Qa="ProgressIndicator",es=f.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,o=Zu(Qa,r);return y.jsx(ie.div,{"data-state":ts(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});es.displayName=Qa;function Qu(e,t){return`${Math.round(e/t*100)}%`}function ts(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ur(e){return typeof e=="number"}function Gn(e){return ur(e)&&!isNaN(e)&&e>0}function Xn(e,t){return ur(e)&&!isNaN(e)&&e<=t&&e>=0}function ed(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${fn}\`.`}function td(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
126
|
+
- a positive number
|
|
127
|
+
- less than the value passed to \`max\` (or ${fn} if no \`max\` prop is set)
|
|
128
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
129
|
+
|
|
130
|
+
Defaulting to \`null\`.`}var rs=Za,rd=es;const ns=f.forwardRef(({className:e,value:t,...r},n)=>y.jsx(rs,{ref:n,className:Ce("ve-relative ve-h-4 ve-w-full ve-overflow-hidden ve-rounded-full ve-bg-secondary",e),...r,children:y.jsx(rd,{className:"ve-h-full ve-w-full ve-flex-1 ve-bg-primary ve-transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ns.displayName=rs.displayName;function nd({progress:e}){return y.jsxs("div",{className:"ve-flex ve-h-screen ve-loading-wrapper ve-w-screen ve-flex-col ve-items-center ve-justify-center puck-css",children:[y.jsx(ns,{className:"ve-w-1/3 ve-loading-progress",value:e}),y.jsx("div",{children:"Loading Visual Editor..."})]})}var qn=["light","dark"],od="(prefers-color-scheme: dark)",ad=f.createContext(void 0),sd={setTheme:e=>{},themes:[]},id=()=>{var e;return(e=f.useContext(ad))!=null?e:sd};f.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:o,defaultTheme:a,value:s,attrs:i,nonce:l})=>{let u=a==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,g=o?qn.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",c=(x,m=!1,v=!0)=>{let b=s?s[x]:x,w=m?x+"|| ''":`'${b}'`,R="";return o&&v&&!m&&qn.includes(x)&&(R+=`d.style.colorScheme = '${x}';`),r==="class"?m||b?R+=`c.add(${w})`:R+="null":b&&(R+=`d[s](n,${w})`),R},h=e?`!function(){${d}${c(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${od}',m=window.matchMedia(t);if(m.media!==t||m.matches){${c("dark")}}else{${c("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${c(s?"x[e]":"e",!0)}}${u?"":"else{"+c(a,!1,!1)+"}"}${g}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${c(s?"x[e]":"e",!0)}}else{${c(a,!1,!1)};}${g}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var ld=e=>{switch(e){case"success":return dd;case"info":return pd;case"warning":return fd;case"error":return gd;default:return null}},cd=Array(12).fill(0),ud=({visible:e})=>E.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},E.createElement("div",{className:"sonner-spinner"},cd.map((t,r)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),dd=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),fd=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),pd=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),gd=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),vd=()=>{let[e,t]=E.useState(document.hidden);return E.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},zr=1,md=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:zr++,a=this.toasts.find(i=>i.id===o),s=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(i=>i.id===o?(this.publish({...i,...e,id:o,title:r}),{...i,...e,id:o,dismissible:s,title:r}):i):this.addToast({title:r,...n,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),o=r!==void 0;return n.then(async a=>{if(yd(a)&&!a.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${a.status}`):t.error,i=typeof t.description=="function"?await t.description(`HTTP error! status: ${a.status}`):t.description;this.create({id:r,type:"error",message:s,description:i})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(a):t.success,i=typeof t.description=="function"?await t.description(a):t.description;this.create({id:r,type:"success",message:s,description:i})}}).catch(async a=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(a):t.error,i=typeof t.description=="function"?await t.description(a):t.description;this.create({id:r,type:"error",message:s,description:i})}}).finally(()=>{var a;o&&(this.dismiss(r),r=void 0),(a=t.finally)==null||a.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||zr++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},me=new md,hd=(e,t)=>{let r=(t==null?void 0:t.id)||zr++;return me.addToast({title:e,...t,id:r}),r},yd=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",bd=hd,xd=()=>me.toasts;Object.assign(bd,{success:me.success,info:me.info,warning:me.warning,error:me.error,custom:me.custom,message:me.message,promise:me.promise,dismiss:me.dismiss,loading:me.loading},{getHistory:xd});function wd(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}wd(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
131
|
+
`);function Zt(e){return e.label!==void 0}var Ed=3,Cd="32px",Sd=4e3,Rd=356,Pd=14,Ad=20,Td=200;function Od(...e){return e.filter(Boolean).join(" ")}var Dd=e=>{var t,r,n,o,a,s,i,l,u,d;let{invert:g,toast:c,unstyled:h,interacting:x,setHeights:m,visibleToasts:v,heights:b,index:w,toasts:R,expanded:S,removeToast:P,defaultRichColors:N,closeButton:D,style:B,cancelButtonStyle:U,actionButtonStyle:G,className:X="",descriptionClassName:k="",duration:W,position:$,gap:V,loadingIcon:_,expandByDefault:O,classNames:A,icons:j,closeButtonAriaLabel:oe="Close toast",pauseWhenPageIsHidden:F,cn:H}=e,[Z,ue]=E.useState(!1),[Se,ee]=E.useState(!1),[Te,ge]=E.useState(!1),[xe,ve]=E.useState(!1),[st,Me]=E.useState(0),[Ie,Qe]=E.useState(0),Le=E.useRef(null),de=E.useRef(null),it=w===0,lt=w+1<=v,re=c.type,He=c.dismissible!==!1,yr=c.className||"",Rt=c.descriptionClassName||"",ct=E.useMemo(()=>b.findIndex(I=>I.toastId===c.id)||0,[b,c.id]),br=E.useMemo(()=>{var I;return(I=c.closeButton)!=null?I:D},[c.closeButton,D]),Pt=E.useMemo(()=>c.duration||W||Sd,[c.duration,W]),ut=E.useRef(0),we=E.useRef(0),Wt=E.useRef(0),$e=E.useRef(null),[At,Tt]=$.split("-"),zt=E.useMemo(()=>b.reduce((I,K,J)=>J>=ct?I:I+K.height,0),[b,ct]),Vt=vd(),xr=c.invert||g,Ot=re==="loading";we.current=E.useMemo(()=>ct*V+zt,[ct,zt]),E.useEffect(()=>{ue(!0)},[]),E.useLayoutEffect(()=>{if(!Z)return;let I=de.current,K=I.style.height;I.style.height="auto";let J=I.getBoundingClientRect().height;I.style.height=K,Qe(J),m(se=>se.find(fe=>fe.toastId===c.id)?se.map(fe=>fe.toastId===c.id?{...fe,height:J}:fe):[{toastId:c.id,height:J,position:c.position},...se])},[Z,c.title,c.description,m,c.id]);let Oe=E.useCallback(()=>{ee(!0),Me(we.current),m(I=>I.filter(K=>K.toastId!==c.id)),setTimeout(()=>{P(c)},Td)},[c,P,m,we]);E.useEffect(()=>{if(c.promise&&re==="loading"||c.duration===1/0||c.type==="loading")return;let I,K=Pt;return S||x||F&&Vt?(()=>{if(Wt.current<ut.current){let J=new Date().getTime()-ut.current;K=K-J}Wt.current=new Date().getTime()})():K!==1/0&&(ut.current=new Date().getTime(),I=setTimeout(()=>{var J;(J=c.onAutoClose)==null||J.call(c,c),Oe()},K)),()=>clearTimeout(I)},[S,x,O,c,Pt,Oe,c.promise,re,F,Vt]),E.useEffect(()=>{let I=de.current;if(I){let K=I.getBoundingClientRect().height;return Qe(K),m(J=>[{toastId:c.id,height:K,position:c.position},...J]),()=>m(J=>J.filter(se=>se.toastId!==c.id))}},[m,c.id]),E.useEffect(()=>{c.delete&&Oe()},[Oe,c.delete]);function wr(){return j!=null&&j.loading?E.createElement("div",{className:"sonner-loader","data-visible":re==="loading"},j.loading):_?E.createElement("div",{className:"sonner-loader","data-visible":re==="loading"},_):E.createElement(ud,{visible:re==="loading"})}return E.createElement("li",{"aria-live":c.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:de,className:H(X,yr,A==null?void 0:A.toast,(t=c==null?void 0:c.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[re],(r=c==null?void 0:c.classNames)==null?void 0:r[re]),"data-sonner-toast":"","data-rich-colors":(n=c.richColors)!=null?n:N,"data-styled":!(c.jsx||c.unstyled||h),"data-mounted":Z,"data-promise":!!c.promise,"data-removed":Se,"data-visible":lt,"data-y-position":At,"data-x-position":Tt,"data-index":w,"data-front":it,"data-swiping":Te,"data-dismissible":He,"data-type":re,"data-invert":xr,"data-swipe-out":xe,"data-expanded":!!(S||O&&Z),style:{"--index":w,"--toasts-before":w,"--z-index":R.length-w,"--offset":`${Se?st:we.current}px`,"--initial-height":O?"auto":`${Ie}px`,...B,...c.style},onPointerDown:I=>{Ot||!He||(Le.current=new Date,Me(we.current),I.target.setPointerCapture(I.pointerId),I.target.tagName!=="BUTTON"&&(ge(!0),$e.current={x:I.clientX,y:I.clientY}))},onPointerUp:()=>{var I,K,J,se;if(xe||!He)return;$e.current=null;let fe=Number(((I=de.current)==null?void 0:I.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Ue=new Date().getTime()-((K=Le.current)==null?void 0:K.getTime()),Ht=Math.abs(fe)/Ue;if(Math.abs(fe)>=Ad||Ht>.11){Me(we.current),(J=c.onDismiss)==null||J.call(c,c),Oe(),ve(!0);return}(se=de.current)==null||se.style.setProperty("--swipe-amount","0px"),ge(!1)},onPointerMove:I=>{var K;if(!$e.current||!He)return;let J=I.clientY-$e.current.y,se=I.clientX-$e.current.x,fe=(At==="top"?Math.min:Math.max)(0,J),Ue=I.pointerType==="touch"?10:2;Math.abs(fe)>Ue?(K=de.current)==null||K.style.setProperty("--swipe-amount",`${J}px`):Math.abs(se)>Ue&&($e.current=null)}},br&&!c.jsx?E.createElement("button",{"aria-label":oe,"data-disabled":Ot,"data-close-button":!0,onClick:Ot||!He?()=>{}:()=>{var I;Oe(),(I=c.onDismiss)==null||I.call(c,c)},className:H(A==null?void 0:A.closeButton,(o=c==null?void 0:c.classNames)==null?void 0:o.closeButton)},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,c.jsx||E.isValidElement(c.title)?c.jsx||c.title:E.createElement(E.Fragment,null,re||c.icon||c.promise?E.createElement("div",{"data-icon":"",className:H(A==null?void 0:A.icon,(a=c==null?void 0:c.classNames)==null?void 0:a.icon)},c.promise||c.type==="loading"&&!c.icon?c.icon||wr():null,c.type!=="loading"?c.icon||(j==null?void 0:j[re])||ld(re):null):null,E.createElement("div",{"data-content":"",className:H(A==null?void 0:A.content,(s=c==null?void 0:c.classNames)==null?void 0:s.content)},E.createElement("div",{"data-title":"",className:H(A==null?void 0:A.title,(i=c==null?void 0:c.classNames)==null?void 0:i.title)},c.title),c.description?E.createElement("div",{"data-description":"",className:H(k,Rt,A==null?void 0:A.description,(l=c==null?void 0:c.classNames)==null?void 0:l.description)},c.description):null),E.isValidElement(c.cancel)?c.cancel:c.cancel&&Zt(c.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||U,onClick:I=>{var K,J;Zt(c.cancel)&&He&&((J=(K=c.cancel).onClick)==null||J.call(K,I),Oe())},className:H(A==null?void 0:A.cancelButton,(u=c==null?void 0:c.classNames)==null?void 0:u.cancelButton)},c.cancel.label):null,E.isValidElement(c.action)?c.action:c.action&&Zt(c.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:c.actionButtonStyle||G,onClick:I=>{var K,J;Zt(c.action)&&(I.defaultPrevented||((J=(K=c.action).onClick)==null||J.call(K,I),Oe()))},className:H(A==null?void 0:A.actionButton,(d=c==null?void 0:c.classNames)==null?void 0:d.actionButton)},c.action.label):null))};function Kn(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Nd=e=>{let{invert:t,position:r="bottom-right",hotkey:n=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:i,theme:l="light",richColors:u,duration:d,style:g,visibleToasts:c=Ed,toastOptions:h,dir:x=Kn(),gap:m=Pd,loadingIcon:v,icons:b,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:R,cn:S=Od}=e,[P,N]=E.useState([]),D=E.useMemo(()=>Array.from(new Set([r].concat(P.filter(F=>F.position).map(F=>F.position)))),[P,r]),[B,U]=E.useState([]),[G,X]=E.useState(!1),[k,W]=E.useState(!1),[$,V]=E.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=E.useRef(null),O=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=E.useRef(null),j=E.useRef(!1),oe=E.useCallback(F=>{var H;(H=P.find(Z=>Z.id===F.id))!=null&&H.delete||me.dismiss(F.id),N(Z=>Z.filter(({id:ue})=>ue!==F.id))},[P]);return E.useEffect(()=>me.subscribe(F=>{if(F.dismiss){N(H=>H.map(Z=>Z.id===F.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Hr.flushSync(()=>{N(H=>{let Z=H.findIndex(ue=>ue.id===F.id);return Z!==-1?[...H.slice(0,Z),{...H[Z],...F},...H.slice(Z+1)]:[F,...H]})})})}),[]),E.useEffect(()=>{if(l!=="system"){V(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:F})=>{V(F?"dark":"light")})},[l]),E.useEffect(()=>{P.length<=1&&X(!1)},[P]),E.useEffect(()=>{let F=H=>{var Z,ue;n.every(Se=>H[Se]||H.code===Se)&&(X(!0),(Z=_.current)==null||Z.focus()),H.code==="Escape"&&(document.activeElement===_.current||(ue=_.current)!=null&&ue.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[n]),E.useEffect(()=>{if(_.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,j.current=!1)}},[_.current]),P.length?E.createElement("section",{"aria-label":`${w} ${O}`,tabIndex:-1},D.map((F,H)=>{var Z;let[ue,Se]=F.split("-");return E.createElement("ol",{key:F,dir:x==="auto"?Kn():x,tabIndex:-1,ref:_,className:s,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":ue,"data-x-position":Se,style:{"--front-toast-height":`${((Z=B[0])==null?void 0:Z.height)||0}px`,"--offset":typeof i=="number"?`${i}px`:i||Cd,"--width":`${Rd}px`,"--gap":`${m}px`,...g},onBlur:ee=>{j.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(j.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||j.current||(j.current=!0,A.current=ee.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{k||X(!1)},onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},P.filter(ee=>!ee.position&&H===0||ee.position===F).map((ee,Te)=>{var ge,xe;return E.createElement(Dd,{key:ee.id,icons:b,index:Te,toast:ee,defaultRichColors:u,duration:(ge=h==null?void 0:h.duration)!=null?ge:d,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:t,visibleToasts:c,closeButton:(xe=h==null?void 0:h.closeButton)!=null?xe:a,interacting:k,position:F,style:h==null?void 0:h.style,unstyled:h==null?void 0:h.unstyled,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,removeToast:oe,toasts:P.filter(ve=>ve.position==ee.position),heights:B.filter(ve=>ve.position==ee.position),setHeights:U,expandByDefault:o,gap:m,loadingIcon:v,expanded:G,pauseWhenPageIsHidden:R,cn:S})}))})):null};const kd=({...e})=>{const{theme:t="system"}=id();return y.jsx(Nd,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:ve-bg-background group-[.toaster]:ve-text-foreground group-[.toaster]:ve-border-border group-[.toaster]:ve-shadow-lg",description:"group-[.toast]:ve-text-muted-foreground",actionButton:"group-[.toast]:ve-bg-primary group-[.toast]:ve-text-primary-foreground",cancelButton:"group-[.toast]:ve-bg-muted group-[.toast]:ve-text-muted-foreground"}},...e})},os=(e,t,r="*")=>t==null?void 0:t.postMessage(e,{targetOrigin:r}),vt=(e,t)=>{const[r,n]=E.useState("pending");return as(e,t,_d(n)),{sendToParent:a=>{if(!window.parent)throw new Error("Parent window has closed");n("pending");for(const s of t)os({...a,type:e},window.parent,s)},status:r}},nr=(e,t,r)=>{as(e,t,(o,a,s)=>{const{type:i,payload:l}=o;i===e&&typeof r=="function"&&r(u=>os({...u,type:e},s,a),l)})},as=(e,t,r)=>{const[n,o]=E.useState(),[a,s]=E.useState(),i=E.useRef(),l=E.useRef();i.current=n,l.current=a;const u=E.useCallback(({origin:d,source:g,data:c})=>{var x;if((x=c.source)!=null&&x.startsWith("react-devtools"))return;if(!t.includes(d))throw new Error("Unrecognized origin");const{type:h}=c;h===e&&(s(g),o(d),r(c,d,g))},[e,t,s,o,r]);E.useEffect(()=>(window.addEventListener("message",u),()=>window.removeEventListener("message",u)),[e,a,n,u])},_d=e=>(t,r,n)=>{const{status:o}=t;o==="success"?e("success"):o==="error"&&e("error")},jd={GLOBAL:"global",INDIVIDUAL:"individual"},De=["http://localhost","https://dev.yext.com","https://qa.yext.com","https://sandbox.yext.com","https://www.yext.com","https://app-qa.eu.yext.com","https://app.eu.yext.com"],Md=({document:e,puckConfigs:t})=>{const[r,n]=E.useState(),[o,a]=E.useState({histories:[],index:-1}),[s,i]=E.useState(),[l,u]=E.useState(!1),[d,g]=E.useState(),[c,h]=E.useState(!1),[x,m]=E.useState(void 0),[v,b]=E.useState(),[w,R]=E.useState();nr("getTemplateMetadata",De,(_,O)=>{const A=t.get(O.templateId);R(A),b(O),_({status:"success",payload:{message:"payload received"}})}),E.useEffect(()=>{if(v!=null&&v.isDevMode)try{m(pageSets)}catch{console.warn("pageSets are not defined")}},[v==null?void 0:v.isDevMode]);const S=(_,O,A,j,oe)=>{window.localStorage.removeItem(tt(_,O,A,j,oe))},P=(_,O,A,j,oe)=>{S(_,O,A,j,oe),k()},N=E.useRef(!0);E.useEffect(()=>{if(N.current){N.current=!1;return}D()},[v,d,s]);const D=E.useCallback(()=>{if(!l||!c||!v)return;if(v.isDevMode){const A=window.localStorage.getItem(tt(v.isDevMode,v.role,v.templateId,v.layoutId,v.entityId));if(A){const j=JSON.parse(A),oe=j.length-1;a({histories:j,index:oe}),n(j[oe].data.data);return}n(s);return}if(!d){S(v.isDevMode,v.role,v.templateId,v.layoutId,v.entityId),n(s);return}n(Jn(d.history).data);const _=window.localStorage.getItem(tt(v.isDevMode,v.role,v.templateId,v.layoutId,v.entityId));if(!_)return;const O=JSON.parse(_).findIndex(A=>A.id===(d==null?void 0:d.hash));if(O!==-1){a({histories:JSON.parse(_),index:O});return}S(v.isDevMode,v.role,v.templateId,v.layoutId,v.entityId)},[a,n,S,tt]),{sendToParent:B}=vt("iFrameLoaded",De),{sendToParent:U}=vt("sendDevSaveStateData",De);E.useEffect(()=>{B({payload:{message:"iFrame is loaded"}})},[]),E.useEffect(()=>{var _;if(v!=null&&v.isDevMode){const O=window.localStorage.getItem(tt(v.isDevMode,v.role,v.templateId,v.layoutId,v.entityId)),A=O?JSON.parse(O):[],j=JSON.stringify(A.length>0?(_=A[A.length-1].data)==null?void 0:_.data:{});U({payload:{devSaveStateData:j}})}},[v]),nr("getSaveState",De,(_,O)=>{g(O),h(!0),_({status:"success",payload:{message:"saveState received"}})}),nr("getVisualConfigurationData",De,(_,O)=>{i(Jn(O.visualConfigurationData)),u(!0),_({status:"success",payload:{message:"getVisualConfigurationData received"}})});const{sendToParent:G}=vt("pushPageSets",De);E.useEffect(()=>{typeof window<"u"&&(v!=null&&v.isDevMode)&&x&&G({payload:x})},[v==null?void 0:v.isDevMode,x]);const{sendToParent:X}=vt("saveSaveState",De),{sendToParent:k}=vt("deleteSaveState",De),{sendToParent:W}=vt("saveVisualConfigData",De),$=!r||!w||!v||!e||!c||!l,V=100*(!!w+!!r+!!v+!!e+c+l)/6;return y.jsxs(y.Fragment,{children:[$?y.jsx(nd,{progress:V}):y.jsx(ic,{value:e,children:y.jsx(qu,{puckConfig:w,puckData:r,isLoading:$,puckInitialHistory:o,clearHistory:v!=null&&v.isDevMode?S:P,templateMetadata:v,saveState:d,saveSaveState:X,saveVisualConfigData:W,sendDevSaveStateData:U})}),y.jsx(kd,{closeButton:!0,richColors:!0})]})},Jn=e=>JSON.parse(e.replace(/\\"/g,'"')),Id=()=>{const[e,t]=E.useState();return nr("getEntityDocument",De,(r,n)=>{t(n),r({status:"success",payload:{message:"getEntityDocument received"}})}),e},Vr=JSON.stringify({root:{},content:[],zones:{}});function Ld(e,t){var i,l,u;if(!t)throw new Error("Unable to parse puck data, template name must be defined in config.");const{document:r}=e,n=r.c_visualConfigurations??[],o=r.c_pages_layouts??[],a=(i=r._site)==null?void 0:i.c_visualLayouts;for(const d of n)if(d.template===t){const g=JSON.parse(Nr(d.data,t));return{...e,document:{...r,visualTemplate:g}}}for(const d of o)if(((l=d.c_visualConfiguration)==null?void 0:l.template)===t){const g=JSON.parse(Nr(d.c_visualConfiguration.data,t));return{...e,document:{...r,visualTemplate:g}}}for(const d of a)if(((u=d.c_visualConfiguration)==null?void 0:u.template)===t){const g=JSON.parse(Nr(d.c_visualConfiguration.data,t));return{...e,document:{...r,visualTemplate:g}}}console.warn(`Unable to find puck data for template: ${t}`);const s=JSON.parse(Vr);return{...e,document:{...r,visualTemplate:s}}}function Nr(e,t){if(!e||e.length<1)return console.warn(`Missing visual editor data for template: ${t}`),Vr;try{JSON.parse(e)}catch{return console.warn(`Invalid visual editor data for template: ${t}`),Vr}return e}exports.Editor=Md;exports.EntityField=Bu;exports.resolveVisualEditorData=Ld;exports.useDocumentProvider=Id;
|