cemtrik-dependencies 1.0.232 → 1.0.233
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(q,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],u):(q=typeof globalThis<"u"?globalThis:q||self,u(q["cemtrik-dependencies"]={},q.React,q.ReactDOM))})(this,function(q,u,Tt){"use strict";function $r(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const T=$r(u),Nt=(e,n=!1)=>{function t(o){if(typeof o!="object"||o===null)return o;const l=Array.isArray(o)?[]:{};for(const s in o)o.hasOwnProperty(s)&&!n&&(l[s]=t(o[s]));return l}return e.map(o=>t(o))},pn=e=>/^(?:[^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*|"[^\n"]+")@(?:[^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,63}$/i.test(e);function I(...e){return e.filter(Boolean).join(" ")}const Fr=e=>{const n=e.split(" ");let t=e.slice(0,2);return n.length>1&&(t=`${e.at(0)}${n[n.length-1].slice(0,1)}`),t};function Pr({items:e,key:n}){const t=e.reduce((r,o)=>(r[o[n]]||(r[o[n]]=[]),r[o[n]].push(o),r),{});return Object.values(t).sort((r,o)=>{const l=r[0][n],s=o[0][n];return l===""&&s!==""?1:s===""&&l!==""?-1:String(l).localeCompare(String(s))})}const Mr=e=>typeof e!="string"&&Promise.resolve(e)instanceof Promise,Ar="The user aborted a request.",Dr="signal is aborted without reason",hn=({id:e,close:n})=>{u.useEffect(()=>{const t=r=>{const o=document.getElementById(e);o&&(o.contains(r.target)||n())};return document.addEventListener("click",t,!0),()=>{document.removeEventListener("click",t,!0)}},[e,n])},Lr=()=>{const e=u.useRef({}),[n,t]=u.useState({}),[r,o]=u.useState({}),[l,s]=u.useState([]);u.useEffect(()=>{e.current={}},[]);const i=x=>f=>{f.preventDefault(),f.stopPropagation(),x(n)},a=(x,f,v)=>{const{checked:g,value:b,name:E,type:w,id:y}=x.target,k={radio:y,checkbox:g};e.current={...v,...e.current,[E]:k[w]??b},t({...e.current,[E]:k[w]??b}),f({...e.current,[E]:k[w]??b})},m=u.useCallback((x,f)=>{e.current={...e.current,[x]:f},t(v=>({...v,[x]:f}))},[]),d=u.useCallback((x,f)=>{const v=f.filter(g=>x[g]===""||x[g]===void 0);return v.forEach(g=>o(b=>({...b,[g]:"Este campo es requerido"}))),s(v),v.length>0},[]);return{handleSubmit:i,handleChange:a,setValuesDefault:m,validateFields:d,errors:l,model:n,handleError:(x,f)=>{f.forEach(v=>o(g=>({...g,[v]:x}))),s(f)},messageError:r,setModel:t}},_r=e=>{const[n,t]=u.useState(!0),[r,o]=u.useState(!1),l=u.useCallback((s,i)=>{const a=e.match(/[0-9]+/g);if(a===null)return;const[m]=a;i=Math.min(window.innerWidth,window.outerWidth);const d=s?i>=Number(m):i<=Number(m);o(d)},[e]);return u.useEffect(()=>{const s=/\(min-width:\s?[0-9]+px\)/gi.test(e),i=/\(max-width:\s?[0-9]+px\)/gi.test(e);if(!s&&!i&&t(!1),!s&&!i)return;const a=Math.min(window.innerWidth,window.outerWidth);l(s,a)},[e,l]),u.useEffect(()=>{if(!n)return;const s=Math.min(window.innerWidth,window.outerWidth);function i(){const a=/min-width/gi.test(e);l(a,s)}return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[n,e,l]),r},vn=()=>{const[e,n]=u.useState({width:0,height:0});return u.useEffect(()=>{const t=()=>{const r=Math.min(window.innerWidth,window.outerWidth),o=Math.min(window.innerHeight,window.outerHeight);n({width:r,height:o})};return requestAnimationFrame(()=>t()),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),e};function Rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ot={exports:{}},qe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xn;function zr(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){var e=u,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),v=Symbol.iterator,g="@@iterator";function b(p){if(p===null||typeof p!="object")return null;var
|
|
18
|
-
`+
|
|
19
|
-
`),ye=
|
|
17
|
+
*/var xn;function zr(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){var e=u,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),v=Symbol.iterator,g="@@iterator";function b(p){if(p===null||typeof p!="object")return null;var N=v&&p[v]||p[g];return typeof N=="function"?N:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var N=arguments.length,M=new Array(N>1?N-1:0),K=1;K<N;K++)M[K-1]=arguments[K];y("error",p,M)}}function y(p,N,M){{var K=E.ReactDebugCurrentFrame,oe=K.getStackAddendum();oe!==""&&(N+="%s",M=M.concat([oe]));var ce=M.map(function(te){return String(te)});ce.unshift("Warning: "+N),Function.prototype.apply.call(console[p],console,ce)}}var k=!1,$=!1,_=!1,W=!1,V=!1,z;z=Symbol.for("react.module.reference");function C(p){return!!(typeof p=="string"||typeof p=="function"||p===r||p===l||V||p===o||p===m||p===d||W||p===f||k||$||_||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===h||p.$$typeof===s||p.$$typeof===i||p.$$typeof===a||p.$$typeof===z||p.getModuleId!==void 0))}function P(p,N,M){var K=p.displayName;if(K)return K;var oe=N.displayName||N.name||"";return oe!==""?M+"("+oe+")":M}function D(p){return p.displayName||"Context"}function B(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 r:return"Fragment";case t:return"Portal";case l:return"Profiler";case o:return"StrictMode";case m:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case i:var N=p;return D(N)+".Consumer";case s:var M=p;return D(M._context)+".Provider";case a:return P(p,p.render,"ForwardRef");case h:var K=p.displayName||null;return K!==null?K:B(p.type)||"Memo";case x:{var oe=p,ce=oe._payload,te=oe._init;try{return B(te(ce))}catch{return null}}}return null}var U=Object.assign,S=0,R,X,j,F,H,J,ne;function ie(){}ie.__reactDisabledLog=!0;function ae(){{if(S===0){R=console.log,X=console.info,j=console.warn,F=console.error,H=console.group,J=console.groupCollapsed,ne=console.groupEnd;var p={configurable:!0,enumerable:!0,value:ie,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}S++}}function ge(){{if(S--,S===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},p,{value:R}),info:U({},p,{value:X}),warn:U({},p,{value:j}),error:U({},p,{value:F}),group:U({},p,{value:H}),groupCollapsed:U({},p,{value:J}),groupEnd:U({},p,{value:ne})})}S<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var we=E.ReactCurrentDispatcher,Y;function ue(p,N,M){{if(Y===void 0)try{throw Error()}catch(oe){var K=oe.stack.trim().match(/\n( *(at )?)/);Y=K&&K[1]||""}return`
|
|
18
|
+
`+Y+p}}var L=!1,Z;{var O=typeof WeakMap=="function"?WeakMap:Map;Z=new O}function G(p,N){if(!p||L)return"";{var M=Z.get(p);if(M!==void 0)return M}var K;L=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ce;ce=we.current,we.current=null,ae();try{if(N){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Fe){K=Fe}Reflect.construct(p,[],te)}else{try{te.call()}catch(Fe){K=Fe}p.call(te.prototype)}}else{try{throw Error()}catch(Fe){K=Fe}p()}}catch(Fe){if(Fe&&K&&typeof Fe.stack=="string"){for(var ee=Fe.stack.split(`
|
|
19
|
+
`),ye=K.stack.split(`
|
|
20
20
|
`),ve=ee.length-1,xe=ye.length-1;ve>=1&&xe>=0&&ee[ve]!==ye[xe];)xe--;for(;ve>=1&&xe>=0;ve--,xe--)if(ee[ve]!==ye[xe]){if(ve!==1||xe!==1)do if(ve--,xe--,xe<0||ee[ve]!==ye[xe]){var je=`
|
|
21
|
-
`+ee[ve].replace(" at new "," at ");return p.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",p.displayName)),typeof p=="function"&&
|
|
21
|
+
`+ee[ve].replace(" at new "," at ");return p.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",p.displayName)),typeof p=="function"&&Z.set(p,je),je}while(ve>=1&&xe>=0);break}}}finally{L=!1,we.current=ce,ge(),Error.prepareStackTrace=oe}var Ye=p?p.displayName||p.name:"",Ir=Ye?ue(Ye):"";return typeof p=="function"&&Z.set(p,Ir),Ir}function Q(p,N,M){return G(p,!1)}function Se(p){var N=p.prototype;return!!(N&&N.isReactComponent)}function ze(p,N,M){if(p==null)return"";if(typeof p=="function")return G(p,Se(p));if(typeof p=="string")return ue(p);switch(p){case m:return ue("Suspense");case d:return ue("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case a:return Q(p.render);case h:return ze(p.type,N,M);case x:{var K=p,oe=K._payload,ce=K._init;try{return ze(ce(oe),N,M)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,xr={},br=E.ReactDebugCurrentFrame;function Ct(p){if(p){var N=p._owner,M=ze(p.type,p._source,N?N.type:null);br.setExtraStackFrame(M)}else br.setExtraStackFrame(null)}function ia(p,N,M,K,oe){{var ce=Function.call.bind(We);for(var te in p)if(ce(p,te)){var ee=void 0;try{if(typeof p[te]!="function"){var ye=Error((K||"React class")+": "+M+" type `"+te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[te]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ye.name="Invariant Violation",ye}ee=p[te](N,te,K,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ve){ee=ve}ee&&!(ee instanceof Error)&&(Ct(oe),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).",K||"React class",M,te,typeof ee),Ct(null)),ee instanceof Error&&!(ee.message in xr)&&(xr[ee.message]=!0,Ct(oe),w("Failed %s type: %s",M,ee.message),Ct(null))}}}var aa=Array.isArray;function un(p){return aa(p)}function ua(p){{var N=typeof Symbol=="function"&&Symbol.toStringTag,M=N&&p[Symbol.toStringTag]||p.constructor.name||"Object";return M}}function ca(p){try{return wr(p),!1}catch{return!0}}function wr(p){return""+p}function yr(p){if(ca(p))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ua(p)),wr(p)}var ct=E.ReactCurrentOwner,da={key:!0,ref:!0,__self:!0,__source:!0},Er,Sr,cn;cn={};function fa(p){if(We.call(p,"ref")){var N=Object.getOwnPropertyDescriptor(p,"ref").get;if(N&&N.isReactWarning)return!1}return p.ref!==void 0}function ma(p){if(We.call(p,"key")){var N=Object.getOwnPropertyDescriptor(p,"key").get;if(N&&N.isReactWarning)return!1}return p.key!==void 0}function pa(p,N){if(typeof p.ref=="string"&&ct.current&&N&&ct.current.stateNode!==N){var M=B(ct.current.type);cn[M]||(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',B(ct.current.type),p.ref),cn[M]=!0)}}function ha(p,N){{var M=function(){Er||(Er=!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)",N))};M.isReactWarning=!0,Object.defineProperty(p,"key",{get:M,configurable:!0})}}function va(p,N){{var M=function(){Sr||(Sr=!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)",N))};M.isReactWarning=!0,Object.defineProperty(p,"ref",{get:M,configurable:!0})}}var ga=function(p,N,M,K,oe,ce,te){var ee={$$typeof:n,type:p,key:N,ref:M,props:te,_owner:ce};return ee._store={},Object.defineProperty(ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.defineProperty(ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(ee.props),Object.freeze(ee)),ee};function xa(p,N,M,K,oe){{var ce,te={},ee=null,ye=null;M!==void 0&&(yr(M),ee=""+M),ma(N)&&(yr(N.key),ee=""+N.key),fa(N)&&(ye=N.ref,pa(N,oe));for(ce in N)We.call(N,ce)&&!da.hasOwnProperty(ce)&&(te[ce]=N[ce]);if(p&&p.defaultProps){var ve=p.defaultProps;for(ce in ve)te[ce]===void 0&&(te[ce]=ve[ce])}if(ee||ye){var xe=typeof p=="function"?p.displayName||p.name||"Unknown":p;ee&&ha(te,xe),ye&&va(te,xe)}return ga(p,ee,ye,oe,K,ct.current,te)}}var dn=E.ReactCurrentOwner,jr=E.ReactDebugCurrentFrame;function Ve(p){if(p){var N=p._owner,M=ze(p.type,p._source,N?N.type:null);jr.setExtraStackFrame(M)}else jr.setExtraStackFrame(null)}var fn;fn=!1;function mn(p){return typeof p=="object"&&p!==null&&p.$$typeof===n}function Cr(){{if(dn.current){var p=B(dn.current.type);if(p)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+p+"`."}return""}}function ba(p){return""}var Tr={};function wa(p){{var
|
|
23
|
+
Check the render method of \``+p+"`."}return""}}function ba(p){return""}var Tr={};function wa(p){{var N=Cr();if(!N){var M=typeof p=="string"?p:p.displayName||p.name;M&&(N=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+M+">.")}return N}}function Nr(p,N){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var M=wa(N);if(Tr[M])return;Tr[M]=!0;var K="";p&&p._owner&&p._owner!==dn.current&&(K=" It was passed a child from "+B(p._owner.type)+"."),Ve(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.',M,K),Ve(null)}}function Or(p,N){{if(typeof p!="object")return;if(un(p))for(var M=0;M<p.length;M++){var K=p[M];mn(K)&&Nr(K,N)}else if(mn(p))p._store&&(p._store.validated=!0);else if(p){var oe=b(p);if(typeof oe=="function"&&oe!==p.entries)for(var ce=oe.call(p),te;!(te=ce.next()).done;)mn(te.value)&&Nr(te.value,N)}}}function ya(p){{var N=p.type;if(N==null||typeof N=="string")return;var M;if(typeof N=="function")M=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===a||N.$$typeof===h))M=N.propTypes;else return;if(M){var K=B(N);ia(M,p.props,"prop",K,p)}else if(N.PropTypes!==void 0&&!fn){fn=!0;var oe=B(N);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ea(p){{for(var N=Object.keys(p.props),M=0;M<N.length;M++){var K=N[M];if(K!=="children"&&K!=="key"){Ve(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",K),Ve(null);break}}p.ref!==null&&(Ve(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),Ve(null))}}function kr(p,N,M,K,oe,ce){{var te=C(p);if(!te){var ee="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(ee+=" 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 ye=ba();ye?ee+=ye:ee+=Cr();var ve;p===null?ve="null":un(p)?ve="array":p!==void 0&&p.$$typeof===n?(ve="<"+(B(p.type)||"Unknown")+" />",ee=" Did you accidentally export a JSX literal instead of a component?"):ve=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",ve,ee)}var xe=xa(p,N,M,oe,ce);if(xe==null)return xe;if(te){var je=N.children;if(je!==void 0)if(K)if(un(je)){for(var Ye=0;Ye<je.length;Ye++)Or(je[Ye],p);Object.freeze&&Object.freeze(je)}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 Or(je,p)}return p===r?Ea(xe):ya(xe),xe}}function Sa(p,N,M){return kr(p,N,M,!0)}function ja(p,N,M){return kr(p,N,M,!1)}var Ca=ja,Ta=Sa;Ge.Fragment=r,Ge.jsx=Ca,Ge.jsxs=Ta}()),Ge}process.env.NODE_ENV==="production"?Ot.exports=Br():Ot.exports=zr();var c=Ot.exports;function Ke(e,n,t){let r=t.initialDeps??[],o;return()=>{var l,s,i,a;let m;t.key&&((l=t.debug)!=null&&l.call(t))&&(m=Date.now());const d=e();if(!(d.length!==r.length||d.some((f,v)=>r[v]!==f)))return o;r=d;let x;if(t.key&&((s=t.debug)!=null&&s.call(t))&&(x=Date.now()),o=n(...d),t.key&&((i=t.debug)!=null&&i.call(t))){const f=Math.round((Date.now()-m)*100)/100,v=Math.round((Date.now()-x)*100)/100,g=v/16,b=(E,w)=>{for(E=String(E);E.length<w;)E=" "+E;return E};console.info(`%c⏱ ${b(v,5)} /${b(f,5)} ms`,`
|
|
26
26
|
font-size: .6rem;
|
|
27
27
|
font-weight: bold;
|
|
28
|
-
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(a=t==null?void 0:t.onChange)==null||a.call(t,o),o}}function kt(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Wr=(e,n)=>Math.abs(e-n)<1,Ur=(e,n,t)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,o),t)}},Hr=e=>e,Vr=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=n;o<=t;o++)r.push(o);return r},Yr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:i,height:a}=s;n({width:Math.round(i),height:Math.round(a)})};if(o(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(s=>{const i=s[0];if(i!=null&&i.borderBoxSize){const a=i.borderBoxSize[0];if(a){o({width:a.inlineSize,height:a.blockSize});return}}o(t.getBoundingClientRect())});return l.observe(t,{box:"border-box"}),()=>{l.unobserve(t)}},bn={passive:!0},qr=typeof window>"u"?!0:"onscrollend"in window,Gr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let o=0;const l=qr?()=>{}:Ur(r,()=>{n(o,!1)},e.options.isScrollingResetDelay),s=m=>()=>{o=t[e.options.horizontal?"scrollLeft":"scrollTop"],l(),n(o,m)},i=s(!0),a=s(!1);return a(),t.addEventListener("scroll",i,bn),t.addEventListener("scrollend",a,bn),()=>{t.removeEventListener("scroll",i),t.removeEventListener("scrollend",a)}},Kr=(e,n,t)=>{if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Zr=(e,{adjustments:n=0,behavior:t},r)=>{var o,l;const s=e+n;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:t})};class Xr{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{this._measureElement(l.target,l)})}));return{disconnect:()=>{var o;return(o=r())==null?void 0:o.disconnect()},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,o])=>{typeof o>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hr,rangeExtractor:Vr,onChange:()=>{},measureElement:Kr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,r)=>{var o,l;const{startIndex:s,endIndex:i}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(t||s!==(a==null?void 0:a.startIndex)||i!==(a==null?void 0:a.endIndex))&&((l=(o=this.options).onChange)==null||l.call(o,this,r))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.notify(!1,!1);return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o;const s=this.isScrolling;this.isScrolling=l,this.notify(s!==l,l)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const o=new Map,l=new Map;for(let s=r-1;s>=0;s--){const i=t[s];if(o.has(i.lane))continue;const a=l.get(i.lane);if(a==null||i.end>a.end?l.set(i.lane,i):i.end<a.end&&o.set(i.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((s,i)=>s.end===i.end?s.index-i.index:s.end-i.end)[0]:void 0},this.getMeasurementOptions=Ke(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,o,l,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:s}),{key:!1}),this.getMeasurements=Ke(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:s},i)=>{var a;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const m=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,m);for(let h=m;h<t;h++){let x=(a=this.measurementsCache[h])==null?void 0:a.measureElement;x||(x=O=>{const F=l(h),D=this.elementsCache.get(F);if(!O){D&&(this.observer.unobserve(D),this.elementsCache.delete(F));return}D!==O&&(D&&this.observer.unobserve(D),this.observer.observe(O),this.elementsCache.set(F,O)),O.isConnected&&this.resizeItem(h,this.options.measureElement(O,void 0,this))});const f=l(h),v=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),g=v?v.end+this.options.gap:r+o,b=i.get(f),E=typeof b=="number"?b:this.options.estimateSize(h),w=g+E,y=v?v.lane:h%this.options.lanes;d[h]={index:h,start:g,size:E,end:w,key:f,lane:y,measureElement:x}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ke(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,r,o)=>this.range=t.length>0&&r>0?Jr({measurements:t,outerSize:r,scrollOffset:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Ke(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,r,o,l)=>r===null?[]:t({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:l}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,o=t.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const o=this.indexFromElement(t),l=this.getMeasurements()[o];if(!l||!t.isConnected){this.elementsCache.forEach((i,a)=>{i===t&&(this.observer.unobserve(t),this.elementsCache.delete(a))});return}const s=this.elementsCache.get(l.key);s!==t&&(s&&this.observer.unobserve(s),this.observer.observe(t),this.elementsCache.set(l.key,t)),this.resizeItem(o,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const o=this.getMeasurements()[t];if(!o)return;const l=this.itemSizeCache.get(o.key)??o.size,s=r-l;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=Ke(()=>[this.getIndexes(),this.getMeasurements()],(t,r)=>{const o=[];for(let l=0,s=t.length;l<s;l++){const i=t[l],a=r[i];o.push(a)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return kt(r[wn(0,r.length-1,o=>kt(r[o]).start,t)])},this.getOffsetForAlignment=(t,r)=>{const o=this.getSize(),l=this.getScrollOffset();r==="auto"&&(t<=l?r="start":t>=l+o?r="end":r="start"),r==="start"?t=t:r==="end"?t=t-o:r==="center"&&(t=t-o/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-o;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getMeasurements()[t];if(!o)return;const l=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+l-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const i=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,r),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(t,{align:r="auto",behavior:o}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const l=this.getOffsetForIndex(t,r);if(!l)return;const[s,i]=l;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[m]=kt(this.getOffsetForIndex(t,i));Wr(m,this.getScrollOffset())||this.scrollToIndex(t,{align:i,behavior:o})}else this.scrollToIndex(t,{align:i,behavior:o})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((t=r[r.length-1])==null?void 0:t.end)??0:Math.max(...r.slice(-this.options.lanes).map(l=>l.end)),o-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:r,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:r},this)},this.measure=()=>{var t,r;this.itemSizeCache=new Map,(r=(t=this.options).onChange)==null||r.call(t,this,!1)},this.setOptions(n)}}const wn=(e,n,t,r)=>{for(;e<=n;){const o=(e+n)/2|0,l=t(o);if(l<r)e=o+1;else if(l>r)n=o-1;else return o}return e>0?e-1:0};function Jr({measurements:e,outerSize:n,scrollOffset:t}){const r=e.length-1,l=wn(0,r,i=>e[i].start,t);let s=l;for(;s<r&&e[s].end<t+n;)s++;return{startIndex:l,endIndex:s}}const Qr=typeof document<"u"?C.useLayoutEffect:C.useEffect;function eo(e){const n=C.useReducer(()=>({}),{})[1],t={...e,onChange:(o,l)=>{var s;l?Tt.flushSync(n):n(),(s=e.onChange)==null||s.call(e,o,l)}},[r]=C.useState(()=>new Xr(t));return r.setOptions(t),C.useEffect(()=>r._didMount(),[]),Qr(()=>r._willUpdate()),r}function to(e){return eo({observeElementRect:Yr,observeElementOffset:Gr,scrollToFn:Zr,...e})}var no=Object.defineProperty,ro=(e,n,t)=>n in e?no(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,It=(e,n,t)=>(ro(e,typeof n!="symbol"?n+"":n,t),t);let oo=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(n){this.current!==n&&(this.handoffState="pending",this.currentId=0,this.current=n)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Oe=new oo,se=(e,n)=>{Oe.isServer?u.useEffect(e,n):u.useLayoutEffect(e,n)};function Ce(e){let n=u.useRef(e);return se(()=>{n.current=e},[e]),n}function $t(e,n){let[t,r]=u.useState(e),o=Ce(e);return se(()=>r(o.current),[o,r,...n]),t}let M=function(e){let n=Ce(e);return u.useCallback((...t)=>n.current(...t),[n])};function yn(e,n,t){let[r,o]=u.useState(t),l=e!==void 0,s=u.useRef(l),i=u.useRef(!1),a=u.useRef(!1);return l&&!s.current&&!i.current?(i.current=!0,s.current=l,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!l&&s.current&&!a.current&&(a.current=!0,s.current=l,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[l?e:r,M(m=>(l||o(m),n==null?void 0:n(m)))]}function dt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(n=>setTimeout(()=>{throw n}))}function Ee(){let e=[],n={addEventListener(t,r,o,l){return t.addEventListener(r,o,l),n.add(()=>t.removeEventListener(r,o,l))},requestAnimationFrame(...t){let r=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(r))},nextFrame(...t){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(...t){let r=setTimeout(...t);return n.add(()=>clearTimeout(r))},microTask(...t){let r={current:!0};return dt(()=>{r.current&&t[0]()}),n.add(()=>{r.current=!1})},style(t,r,o){let l=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:o}),this.add(()=>{Object.assign(t.style,{[r]:l})})},group(t){let r=Ee();return t(r),this.add(()=>r.dispose())},add(t){return e.push(t),()=>{let r=e.indexOf(t);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let t of e.splice(0))t()}};return n}function ke(){let[e]=u.useState(Ee);return u.useEffect(()=>()=>e.dispose(),[e]),e}function so(){let e=typeof document>"u";return"useSyncExternalStore"in C?(n=>n.useSyncExternalStore)(C)(()=>()=>{},()=>!1,()=>!e):!1}function Ue(){let e=so(),[n,t]=C.useState(Oe.isHandoffComplete);return n&&Oe.isHandoffComplete===!1&&t(!1),C.useEffect(()=>{n!==!0&&t(!0)},[n]),C.useEffect(()=>Oe.handoff(),[]),e?!1:n}var En;let be=(En=u.useId)!=null?En:function(){let e=Ue(),[n,t]=u.useState(e?()=>Oe.nextId():null);return se(()=>{n===null&&t(Oe.nextId())},[n]),n!=null?""+n:void 0};function me(e,n,...t){if(e in n){let o=n[e];return typeof o=="function"?o(...t):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,me),r}function ft(e){return Oe.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ie=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ie||{}),Sn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Sn||{}),lo=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(lo||{});function jn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ft)).sort((n,t)=>Math.sign((n.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var Pt=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Pt||{});function Mt(e,n=0){var t;return e===((t=ft(e))==null?void 0:t.body)?!1:me(n,{0(){return e.matches(Ft)},1(){let r=e;for(;r!==null;){if(r.matches(Ft))return!0;r=r.parentElement}return!1}})}function Cn(e){let n=ft(e);Ee().nextFrame(()=>{n&&!Mt(n.activeElement,0)&&Pe(e)})}var io=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(io||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Pe(e){e==null||e.focus({preventScroll:!0})}let ao=["textarea","input"].join(",");function uo(e){var n,t;return(t=(n=e==null?void 0:e.matches)==null?void 0:n.call(e,ao))!=null?t:!1}function At(e,n=t=>t){return e.slice().sort((t,r)=>{let o=n(t),l=n(r);if(o===null||l===null)return 0;let s=o.compareDocumentPosition(l);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function co(e,n){return Ze(jn(),n,{relativeTo:e})}function Ze(e,n,{sorted:t=!0,relativeTo:r=null,skipElements:o=[]}={}){let l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?t?At(e):e:jn(e);o.length>0&&s.length>1&&(s=s.filter(f=>!o.includes(f))),r=r??l.activeElement;let i=(()=>{if(n&5)return 1;if(n&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(n&1)return 0;if(n&2)return Math.max(0,s.indexOf(r))-1;if(n&4)return Math.max(0,s.indexOf(r))+1;if(n&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),m=n&32?{preventScroll:!0}:{},d=0,h=s.length,x;do{if(d>=h||d+h<=0)return 0;let f=a+d;if(n&16)f=(f+h)%h;else{if(f<0)return 3;if(f>=h)return 1}x=s[f],x==null||x.focus(m),d+=i}while(x!==l.activeElement);return n&6&&uo(x)&&x.select(),2}function Tn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function fo(){return/Android/gi.test(window.navigator.userAgent)}function Nn(){return Tn()||fo()}function mt(e,n,t){let r=Ce(n);u.useEffect(()=>{function o(l){r.current(l)}return document.addEventListener(e,o,t),()=>document.removeEventListener(e,o,t)},[e,t])}function On(e,n,t){let r=Ce(n);u.useEffect(()=>{function o(l){r.current(l)}return window.addEventListener(e,o,t),()=>window.removeEventListener(e,o,t)},[e,t])}function Dt(e,n,t=!0){let r=u.useRef(!1);u.useEffect(()=>{requestAnimationFrame(()=>{r.current=t})},[t]);function o(s,i){if(!r.current||s.defaultPrevented)return;let a=i(s);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let m=function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of m){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(a)||s.composed&&s.composedPath().includes(h))return}return!Mt(a,Pt.Loose)&&a.tabIndex!==-1&&s.preventDefault(),n(s,a)}let l=u.useRef(null);mt("pointerdown",s=>{var i,a;r.current&&(l.current=((a=(i=s.composedPath)==null?void 0:i.call(s))==null?void 0:a[0])||s.target)},!0),mt("mousedown",s=>{var i,a;r.current&&(l.current=((a=(i=s.composedPath)==null?void 0:i.call(s))==null?void 0:a[0])||s.target)},!0),mt("click",s=>{Nn()||l.current&&(o(s,()=>l.current),l.current=null)},!0),mt("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),On("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function _e(...e){return u.useMemo(()=>ft(...e),[...e])}function kn(e){var n;if(e.type)return e.type;let t=(n=e.as)!=null?n:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function Lt(e,n){let[t,r]=u.useState(()=>kn(e));return se(()=>{r(kn(e))},[e.type,e.as]),se(()=>{t||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&r("button")},[t,n]),t}let In=Symbol();function mo(e,n=!0){return Object.assign(e,{[In]:n})}function pe(...e){let n=u.useRef(e);u.useEffect(()=>{n.current=e},[e]);let t=M(r=>{for(let o of n.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[In]))?void 0:t}function $n(e){return[e.screenX,e.screenY]}function Fn(){let e=u.useRef([-1,-1]);return{wasMoved(n){let t=$n(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=$n(n)}}}function Pn({container:e,accept:n,walk:t,enabled:r=!0}){let o=u.useRef(n),l=u.useRef(t);u.useEffect(()=>{o.current=n,l.current=t},[n,t]),se(()=>{if(!e||!r)return;let s=ft(e);if(!s)return;let i=o.current,a=l.current,m=Object.assign(h=>i(h),{acceptNode:i}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,m,!1);for(;d.nextNode();)a(d.currentNode)},[e,r,o,l])}function Xe(e,n){let t=u.useRef([]),r=M(e);u.useEffect(()=>{let o=[...t.current];for(let[l,s]of n.entries())if(t.current[l]!==s){let i=r(n,o);return t.current=n,i}},[r,...n])}function pt(...e){return Array.from(new Set(e.flatMap(n=>typeof n=="string"?n.split(" "):[]))).filter(Boolean).join(" ")}var Me=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Me||{}),Ae=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ae||{});function de({ourProps:e,theirProps:n,slot:t,defaultTag:r,features:o,visible:l=!0,name:s,mergeRefs:i}){i=i??po;let a=Mn(n,e);if(l)return ht(a,t,r,s,i);let m=o??0;if(m&2){let{static:d=!1,...h}=a;if(d)return ht(h,t,r,s,i)}if(m&1){let{unmount:d=!0,...h}=a;return me(d?0:1,{0(){return null},1(){return ht({...h,hidden:!0,style:{display:"none"}},t,r,s,i)}})}return ht(a,t,r,s,i)}function ht(e,n={},t,r,o){let{as:l=t,children:s,refName:i="ref",...a}=_t(e,["unmount","static"]),m=e.ref!==void 0?{[i]:e.ref}:{},d=typeof s=="function"?s(n):s;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(n));let h={};if(n){let x=!1,f=[];for(let[v,g]of Object.entries(n))typeof g=="boolean"&&(x=!0),g===!0&&f.push(v);x&&(h["data-headlessui-state"]=f.join(" "))}if(l===u.Fragment&&Object.keys(vt(a)).length>0){if(!u.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(g=>` - ${g}`).join(`
|
|
28
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(a=t==null?void 0:t.onChange)==null||a.call(t,o),o}}function kt(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Wr=(e,n)=>Math.abs(e-n)<1,Ur=(e,n,t)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,o),t)}},Hr=e=>e,Vr=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=n;o<=t;o++)r.push(o);return r},Yr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:i,height:a}=s;n({width:Math.round(i),height:Math.round(a)})};if(o(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(s=>{const i=s[0];if(i!=null&&i.borderBoxSize){const a=i.borderBoxSize[0];if(a){o({width:a.inlineSize,height:a.blockSize});return}}o(t.getBoundingClientRect())});return l.observe(t,{box:"border-box"}),()=>{l.unobserve(t)}},bn={passive:!0},qr=typeof window>"u"?!0:"onscrollend"in window,Gr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let o=0;const l=qr?()=>{}:Ur(r,()=>{n(o,!1)},e.options.isScrollingResetDelay),s=m=>()=>{o=t[e.options.horizontal?"scrollLeft":"scrollTop"],l(),n(o,m)},i=s(!0),a=s(!1);return a(),t.addEventListener("scroll",i,bn),t.addEventListener("scrollend",a,bn),()=>{t.removeEventListener("scroll",i),t.removeEventListener("scrollend",a)}},Kr=(e,n,t)=>{if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Zr=(e,{adjustments:n=0,behavior:t},r)=>{var o,l;const s=e+n;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:t})};class Xr{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{this._measureElement(l.target,l)})}));return{disconnect:()=>{var o;return(o=r())==null?void 0:o.disconnect()},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,o])=>{typeof o>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hr,rangeExtractor:Vr,onChange:()=>{},measureElement:Kr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,r)=>{var o,l;const{startIndex:s,endIndex:i}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(t||s!==(a==null?void 0:a.startIndex)||i!==(a==null?void 0:a.endIndex))&&((l=(o=this.options).onChange)==null||l.call(o,this,r))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.notify(!1,!1);return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o;const s=this.isScrolling;this.isScrolling=l,this.notify(s!==l,l)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const o=new Map,l=new Map;for(let s=r-1;s>=0;s--){const i=t[s];if(o.has(i.lane))continue;const a=l.get(i.lane);if(a==null||i.end>a.end?l.set(i.lane,i):i.end<a.end&&o.set(i.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((s,i)=>s.end===i.end?s.index-i.index:s.end-i.end)[0]:void 0},this.getMeasurementOptions=Ke(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,o,l,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:s}),{key:!1}),this.getMeasurements=Ke(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:s},i)=>{var a;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const m=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,m);for(let h=m;h<t;h++){let x=(a=this.measurementsCache[h])==null?void 0:a.measureElement;x||(x=k=>{const $=l(h),_=this.elementsCache.get($);if(!k){_&&(this.observer.unobserve(_),this.elementsCache.delete($));return}_!==k&&(_&&this.observer.unobserve(_),this.observer.observe(k),this.elementsCache.set($,k)),k.isConnected&&this.resizeItem(h,this.options.measureElement(k,void 0,this))});const f=l(h),v=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),g=v?v.end+this.options.gap:r+o,b=i.get(f),E=typeof b=="number"?b:this.options.estimateSize(h),w=g+E,y=v?v.lane:h%this.options.lanes;d[h]={index:h,start:g,size:E,end:w,key:f,lane:y,measureElement:x}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ke(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,r,o)=>this.range=t.length>0&&r>0?Jr({measurements:t,outerSize:r,scrollOffset:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Ke(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,r,o,l)=>r===null?[]:t({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:l}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,o=t.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const o=this.indexFromElement(t),l=this.getMeasurements()[o];if(!l||!t.isConnected){this.elementsCache.forEach((i,a)=>{i===t&&(this.observer.unobserve(t),this.elementsCache.delete(a))});return}const s=this.elementsCache.get(l.key);s!==t&&(s&&this.observer.unobserve(s),this.observer.observe(t),this.elementsCache.set(l.key,t)),this.resizeItem(o,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const o=this.getMeasurements()[t];if(!o)return;const l=this.itemSizeCache.get(o.key)??o.size,s=r-l;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=Ke(()=>[this.getIndexes(),this.getMeasurements()],(t,r)=>{const o=[];for(let l=0,s=t.length;l<s;l++){const i=t[l],a=r[i];o.push(a)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return kt(r[wn(0,r.length-1,o=>kt(r[o]).start,t)])},this.getOffsetForAlignment=(t,r)=>{const o=this.getSize(),l=this.getScrollOffset();r==="auto"&&(t<=l?r="start":t>=l+o?r="end":r="start"),r==="start"?t=t:r==="end"?t=t-o:r==="center"&&(t=t-o/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-o;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getMeasurements()[t];if(!o)return;const l=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+l-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const i=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,r),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(t,{align:r="auto",behavior:o}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const l=this.getOffsetForIndex(t,r);if(!l)return;const[s,i]=l;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[m]=kt(this.getOffsetForIndex(t,i));Wr(m,this.getScrollOffset())||this.scrollToIndex(t,{align:i,behavior:o})}else this.scrollToIndex(t,{align:i,behavior:o})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((t=r[r.length-1])==null?void 0:t.end)??0:Math.max(...r.slice(-this.options.lanes).map(l=>l.end)),o-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:r,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:r},this)},this.measure=()=>{var t,r;this.itemSizeCache=new Map,(r=(t=this.options).onChange)==null||r.call(t,this,!1)},this.setOptions(n)}}const wn=(e,n,t,r)=>{for(;e<=n;){const o=(e+n)/2|0,l=t(o);if(l<r)e=o+1;else if(l>r)n=o-1;else return o}return e>0?e-1:0};function Jr({measurements:e,outerSize:n,scrollOffset:t}){const r=e.length-1,l=wn(0,r,i=>e[i].start,t);let s=l;for(;s<r&&e[s].end<t+n;)s++;return{startIndex:l,endIndex:s}}const Qr=typeof document<"u"?T.useLayoutEffect:T.useEffect;function eo(e){const n=T.useReducer(()=>({}),{})[1],t={...e,onChange:(o,l)=>{var s;l?Tt.flushSync(n):n(),(s=e.onChange)==null||s.call(e,o,l)}},[r]=T.useState(()=>new Xr(t));return r.setOptions(t),T.useEffect(()=>r._didMount(),[]),Qr(()=>r._willUpdate()),r}function to(e){return eo({observeElementRect:Yr,observeElementOffset:Gr,scrollToFn:Zr,...e})}var no=Object.defineProperty,ro=(e,n,t)=>n in e?no(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,It=(e,n,t)=>(ro(e,typeof n!="symbol"?n+"":n,t),t);let oo=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(n){this.current!==n&&(this.handoffState="pending",this.currentId=0,this.current=n)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Oe=new oo,se=(e,n)=>{Oe.isServer?u.useEffect(e,n):u.useLayoutEffect(e,n)};function Ce(e){let n=u.useRef(e);return se(()=>{n.current=e},[e]),n}function $t(e,n){let[t,r]=u.useState(e),o=Ce(e);return se(()=>r(o.current),[o,r,...n]),t}let A=function(e){let n=Ce(e);return u.useCallback((...t)=>n.current(...t),[n])};function yn(e,n,t){let[r,o]=u.useState(t),l=e!==void 0,s=u.useRef(l),i=u.useRef(!1),a=u.useRef(!1);return l&&!s.current&&!i.current?(i.current=!0,s.current=l,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!l&&s.current&&!a.current&&(a.current=!0,s.current=l,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[l?e:r,A(m=>(l||o(m),n==null?void 0:n(m)))]}function dt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(n=>setTimeout(()=>{throw n}))}function Ee(){let e=[],n={addEventListener(t,r,o,l){return t.addEventListener(r,o,l),n.add(()=>t.removeEventListener(r,o,l))},requestAnimationFrame(...t){let r=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(r))},nextFrame(...t){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(...t){let r=setTimeout(...t);return n.add(()=>clearTimeout(r))},microTask(...t){let r={current:!0};return dt(()=>{r.current&&t[0]()}),n.add(()=>{r.current=!1})},style(t,r,o){let l=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:o}),this.add(()=>{Object.assign(t.style,{[r]:l})})},group(t){let r=Ee();return t(r),this.add(()=>r.dispose())},add(t){return e.push(t),()=>{let r=e.indexOf(t);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let t of e.splice(0))t()}};return n}function ke(){let[e]=u.useState(Ee);return u.useEffect(()=>()=>e.dispose(),[e]),e}function so(){let e=typeof document>"u";return"useSyncExternalStore"in T?(n=>n.useSyncExternalStore)(T)(()=>()=>{},()=>!1,()=>!e):!1}function Ue(){let e=so(),[n,t]=T.useState(Oe.isHandoffComplete);return n&&Oe.isHandoffComplete===!1&&t(!1),T.useEffect(()=>{n!==!0&&t(!0)},[n]),T.useEffect(()=>Oe.handoff(),[]),e?!1:n}var En;let be=(En=u.useId)!=null?En:function(){let e=Ue(),[n,t]=u.useState(e?()=>Oe.nextId():null);return se(()=>{n===null&&t(Oe.nextId())},[n]),n!=null?""+n:void 0};function me(e,n,...t){if(e in n){let o=n[e];return typeof o=="function"?o(...t):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,me),r}function ft(e){return Oe.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ie=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ie||{}),Sn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Sn||{}),lo=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(lo||{});function jn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ft)).sort((n,t)=>Math.sign((n.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var Pt=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Pt||{});function Mt(e,n=0){var t;return e===((t=ft(e))==null?void 0:t.body)?!1:me(n,{0(){return e.matches(Ft)},1(){let r=e;for(;r!==null;){if(r.matches(Ft))return!0;r=r.parentElement}return!1}})}function Cn(e){let n=ft(e);Ee().nextFrame(()=>{n&&!Mt(n.activeElement,0)&&Pe(e)})}var io=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(io||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Pe(e){e==null||e.focus({preventScroll:!0})}let ao=["textarea","input"].join(",");function uo(e){var n,t;return(t=(n=e==null?void 0:e.matches)==null?void 0:n.call(e,ao))!=null?t:!1}function At(e,n=t=>t){return e.slice().sort((t,r)=>{let o=n(t),l=n(r);if(o===null||l===null)return 0;let s=o.compareDocumentPosition(l);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function co(e,n){return Ze(jn(),n,{relativeTo:e})}function Ze(e,n,{sorted:t=!0,relativeTo:r=null,skipElements:o=[]}={}){let l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?t?At(e):e:jn(e);o.length>0&&s.length>1&&(s=s.filter(f=>!o.includes(f))),r=r??l.activeElement;let i=(()=>{if(n&5)return 1;if(n&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(n&1)return 0;if(n&2)return Math.max(0,s.indexOf(r))-1;if(n&4)return Math.max(0,s.indexOf(r))+1;if(n&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),m=n&32?{preventScroll:!0}:{},d=0,h=s.length,x;do{if(d>=h||d+h<=0)return 0;let f=a+d;if(n&16)f=(f+h)%h;else{if(f<0)return 3;if(f>=h)return 1}x=s[f],x==null||x.focus(m),d+=i}while(x!==l.activeElement);return n&6&&uo(x)&&x.select(),2}function Tn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function fo(){return/Android/gi.test(window.navigator.userAgent)}function Nn(){return Tn()||fo()}function mt(e,n,t){let r=Ce(n);u.useEffect(()=>{function o(l){r.current(l)}return document.addEventListener(e,o,t),()=>document.removeEventListener(e,o,t)},[e,t])}function On(e,n,t){let r=Ce(n);u.useEffect(()=>{function o(l){r.current(l)}return window.addEventListener(e,o,t),()=>window.removeEventListener(e,o,t)},[e,t])}function Dt(e,n,t=!0){let r=u.useRef(!1);u.useEffect(()=>{requestAnimationFrame(()=>{r.current=t})},[t]);function o(s,i){if(!r.current||s.defaultPrevented)return;let a=i(s);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let m=function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of m){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(a)||s.composed&&s.composedPath().includes(h))return}return!Mt(a,Pt.Loose)&&a.tabIndex!==-1&&s.preventDefault(),n(s,a)}let l=u.useRef(null);mt("pointerdown",s=>{var i,a;r.current&&(l.current=((a=(i=s.composedPath)==null?void 0:i.call(s))==null?void 0:a[0])||s.target)},!0),mt("mousedown",s=>{var i,a;r.current&&(l.current=((a=(i=s.composedPath)==null?void 0:i.call(s))==null?void 0:a[0])||s.target)},!0),mt("click",s=>{Nn()||l.current&&(o(s,()=>l.current),l.current=null)},!0),mt("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),On("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function _e(...e){return u.useMemo(()=>ft(...e),[...e])}function kn(e){var n;if(e.type)return e.type;let t=(n=e.as)!=null?n:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function Lt(e,n){let[t,r]=u.useState(()=>kn(e));return se(()=>{r(kn(e))},[e.type,e.as]),se(()=>{t||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&r("button")},[t,n]),t}let In=Symbol();function mo(e,n=!0){return Object.assign(e,{[In]:n})}function pe(...e){let n=u.useRef(e);u.useEffect(()=>{n.current=e},[e]);let t=A(r=>{for(let o of n.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[In]))?void 0:t}function $n(e){return[e.screenX,e.screenY]}function Fn(){let e=u.useRef([-1,-1]);return{wasMoved(n){let t=$n(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=$n(n)}}}function Pn({container:e,accept:n,walk:t,enabled:r=!0}){let o=u.useRef(n),l=u.useRef(t);u.useEffect(()=>{o.current=n,l.current=t},[n,t]),se(()=>{if(!e||!r)return;let s=ft(e);if(!s)return;let i=o.current,a=l.current,m=Object.assign(h=>i(h),{acceptNode:i}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,m,!1);for(;d.nextNode();)a(d.currentNode)},[e,r,o,l])}function Xe(e,n){let t=u.useRef([]),r=A(e);u.useEffect(()=>{let o=[...t.current];for(let[l,s]of n.entries())if(t.current[l]!==s){let i=r(n,o);return t.current=n,i}},[r,...n])}function pt(...e){return Array.from(new Set(e.flatMap(n=>typeof n=="string"?n.split(" "):[]))).filter(Boolean).join(" ")}var Me=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Me||{}),Ae=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ae||{});function de({ourProps:e,theirProps:n,slot:t,defaultTag:r,features:o,visible:l=!0,name:s,mergeRefs:i}){i=i??po;let a=Mn(n,e);if(l)return ht(a,t,r,s,i);let m=o??0;if(m&2){let{static:d=!1,...h}=a;if(d)return ht(h,t,r,s,i)}if(m&1){let{unmount:d=!0,...h}=a;return me(d?0:1,{0(){return null},1(){return ht({...h,hidden:!0,style:{display:"none"}},t,r,s,i)}})}return ht(a,t,r,s,i)}function ht(e,n={},t,r,o){let{as:l=t,children:s,refName:i="ref",...a}=_t(e,["unmount","static"]),m=e.ref!==void 0?{[i]:e.ref}:{},d=typeof s=="function"?s(n):s;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(n));let h={};if(n){let x=!1,f=[];for(let[v,g]of Object.entries(n))typeof g=="boolean"&&(x=!0),g===!0&&f.push(v);x&&(h["data-headlessui-state"]=f.join(" "))}if(l===u.Fragment&&Object.keys(vt(a)).length>0){if(!u.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(g=>` - ${g}`).join(`
|
|
29
29
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(`
|
|
30
30
|
`)].join(`
|
|
31
|
-
`));let x=d.props,f=typeof(x==null?void 0:x.className)=="function"?(...g)=>pt(x==null?void 0:x.className(...g),a.className):pt(x==null?void 0:x.className,a.className),v=f?{className:f}:{};return u.cloneElement(d,Object.assign({},Mn(d.props,vt(_t(a,["ref"]))),h,m,{ref:o(d.ref,m.ref)},v))}return u.createElement(l,Object.assign({},_t(a,["ref"]),l!==u.Fragment&&m,l!==u.Fragment&&h),d)}function po(...e){return e.every(n=>n==null)?void 0:n=>{for(let t of e)t!=null&&(typeof t=="function"?t(n):t.current=n)}}function Mn(...e){if(e.length===0)return{};if(e.length===1)return e[0];let n={},t={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(r[o])):n[o]=r[o];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(t).map(r=>[r,void 0])));for(let r in t)Object.assign(n,{[r](o,...l){let s=t[r];for(let i of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;i(o,...l)}}});return n}function fe(e){var n;return Object.assign(u.forwardRef(e),{displayName:(n=e.displayName)!=null?n:e.name})}function vt(e){let n=Object.assign({},e);for(let t in n)n[t]===void 0&&delete n[t];return n}function _t(e,n=[]){let t=Object.assign({},e);for(let r of n)r in t&&delete t[r];return t}let ho="div";var He=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(He||{});function vo(e,n){var t;let{features:r=1,...o}=e,l={ref:n,"aria-hidden":(r&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return de({ourProps:l,theirProps:o,slot:{},defaultTag:ho,name:"Hidden"})}let Je=fe(vo),Rt=u.createContext(null);Rt.displayName="OpenClosedContext";var he=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(he||{});function Qe(){return u.useContext(Rt)}function Bt({value:e,children:n}){return u.createElement(Rt.Provider,{value:e},n)}function go(e){function n(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",n))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}let Ne=[];go(()=>{function e(n){n.target instanceof HTMLElement&&n.target!==document.body&&Ne[0]!==n.target&&(Ne.unshift(n.target),Ne=Ne.filter(t=>t!=null&&t.isConnected),Ne.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function gt(e){let n=e.parentElement,t=null;for(;n&&!(n instanceof HTMLFieldSetElement);)n instanceof HTMLLegendElement&&(t=n),n=n.parentElement;let r=(n==null?void 0:n.getAttribute("disabled"))==="";return r&&xo(t)?!1:r}function xo(e){if(!e)return!1;let n=e.previousElementSibling;for(;n!==null;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}function bo(e){throw new Error("Unexpected object: "+e)}var le=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(le||{});function zt(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let l=0;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 1:{for(let l=o-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 2:{for(let l=o+1;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 3:{for(let l=t.length-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 4:{for(let l=0;l<t.length;++l)if(n.resolveId(t[l],l,t)===e.id)return l;return r}case 5:return null;default:bo(e)}}function An(e={},n=null,t=[]){for(let[r,o]of Object.entries(e))Ln(t,Dn(n,r),o);return t}function Dn(e,n){return e?e+"["+n+"]":n}function Ln(e,n,t){if(Array.isArray(t))for(let[r,o]of t.entries())Ln(e,Dn(n,r.toString()),o);else t instanceof Date?e.push([n,t.toISOString()]):typeof t=="boolean"?e.push([n,t?"1":"0"]):typeof t=="string"?e.push([n,t]):typeof t=="number"?e.push([n,`${t}`]):t==null?e.push([n,""]):An(t,n,e)}function wo(e){var n,t;let r=(n=e==null?void 0:e.form)!=null?n:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(t=r.requestSubmit)==null||t.call(r)}}var re=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(re||{}),yo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(yo||{}),Eo=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Eo||{}),So=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(So||{}),jo=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(jo||{});function Wt(e,n=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=n(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,i)=>s.dataRef.current.order-i.dataRef.current.order):At(r,s=>s.dataRef.current.domRef.current),l=t?o.indexOf(t):null;return l===-1&&(l=null),{options:o,activeOptionIndex:l}}let Co={1(e){var n;return(n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var n,t;if((n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,n){var t,r,o,l,s;if((t=e.dataRef.current)!=null&&t.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=n.focus===le.Specific?n.idx:zt(n,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var x,f;return(f=(x=e.activeOptionIndex)!=null?x:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?f:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),h=(l=n.trigger)!=null?l:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let i=Wt(e);if(i.activeOptionIndex===null){let d=i.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(i.activeOptionIndex=d)}let a=n.focus===le.Specific?n.idx:zt(n,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),m=(s=n.trigger)!=null?s:2;return e.activeOptionIndex===a&&e.activationTrigger===m?e:{...e,...i,activeOptionIndex:a,activationTrigger:m}},3:(e,n)=>{var t,r,o;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,n.payload]};let l=n.payload,s=Wt(e,a=>(a.push(l),a));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(n.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(l));let i={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(i.activeOptionIndex=0),i},4:(e,n)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(o=>o.id!==n.id)};let r=Wt(e,o=>{let l=o.findIndex(s=>s.id===n.id);return l!==-1&&o.splice(l,1),o});return{...e,...r,activationTrigger:2}},5:(e,n)=>e.labelId===n.id?e:{...e,labelId:n.id},6:(e,n)=>e.activationTrigger===n.trigger?e:{...e,activationTrigger:n.trigger},7:(e,n)=>{var t;if(((t=e.virtual)==null?void 0:t.options)===n.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=n.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:n.options})}}},Ut=u.createContext(null);Ut.displayName="ComboboxActionsContext";function et(e){let n=u.useContext(Ut);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,et),t}return n}let _n=u.createContext(null);function To(e){var n;let t=Re("VirtualProvider"),[r,o]=u.useMemo(()=>{let a=t.optionsRef.current;if(!a)return[0,0];let m=window.getComputedStyle(a);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[t.optionsRef.current]),l=to({scrollPaddingStart:r,scrollPaddingEnd:o,count:t.virtual.options.length,estimateSize(){return 40},getScrollElement(){var a;return(a=t.optionsRef.current)!=null?a:null},overscan:12}),[s,i]=u.useState(0);return se(()=>{i(a=>a+1)},[(n=t.virtual)==null?void 0:n.options]),u.createElement(_n.Provider,{value:l},u.createElement("div",{style:{position:"relative",width:"100%",height:`${l.getTotalSize()}px`},ref:a=>{if(a){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&l.scrollToIndex(t.activeOptionIndex)}}},l.getVirtualItems().map(a=>{var m;return u.createElement(u.Fragment,{key:a.key},u.cloneElement((m=e.children)==null?void 0:m.call(e,{option:t.virtual.options[a.index],open:t.comboboxState===0}),{key:`${s}-${a.key}`,"data-index":a.index,"aria-setsize":t.virtual.options.length,"aria-posinset":a.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${a.start}px)`,overflowAnchor:"none"}}))})))}let Ht=u.createContext(null);Ht.displayName="ComboboxDataContext";function Re(e){let n=u.useContext(Ht);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Re),t}return n}function No(e,n){return me(n.type,Co,e,n)}let Oo=u.Fragment;function ko(e,n){let{value:t,defaultValue:r,onChange:o,form:l,name:s,by:i=null,disabled:a=!1,__demoMode:m=!1,nullable:d=!1,multiple:h=!1,immediate:x=!1,virtual:f=null,...v}=e,g=!1,b=null,[E=h?[]:void 0,w]=yn(t,o,r),[y,O]=u.useReducer(No,{dataRef:u.createRef(),comboboxState:m?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),F=u.useRef(!1),D=u.useRef({static:!1,hold:!1}),U=u.useRef(null),V=u.useRef(null),z=u.useRef(null),_=u.useRef(null),k=M(typeof i=="string"?(A,X)=>{let N=i;return(A==null?void 0:A[N])===(X==null?void 0:X[N])}:i??((A,X)=>A===X)),L=M(A=>y.options.findIndex(X=>k(X.dataRef.current.value,A))),R=u.useCallback(A=>me(S.mode,{1:()=>E.some(X=>k(X,A)),0:()=>k(E,A)}),[E]),W=M(A=>y.activeOptionIndex===L(A)),S=u.useMemo(()=>({...y,immediate:g,optionsPropsRef:D,labelRef:U,inputRef:V,buttonRef:z,optionsRef:_,value:E,defaultValue:r,disabled:a,mode:h?1:0,virtual:y.virtual,get activeOptionIndex(){if(F.current&&y.activeOptionIndex===null&&y.options.length>0){let A=y.options.findIndex(X=>!X.dataRef.current.disabled);if(A!==-1)return A}return y.activeOptionIndex},calculateIndex:L,compare:k,isSelected:R,isActive:W,nullable:d,__demoMode:m}),[E,r,a,h,d,m,y,b]);se(()=>{},[b,void 0]),se(()=>{y.dataRef.current=S},[S]),Dt([S.buttonRef,S.inputRef,S.optionsRef],()=>ge.closeCombobox(),S.comboboxState===0);let B=u.useMemo(()=>{var A,X,N;return{open:S.comboboxState===0,disabled:a,activeIndex:S.activeOptionIndex,activeOption:S.activeOptionIndex===null?null:S.virtual?S.virtual.options[(A=S.activeOptionIndex)!=null?A:0]:(N=(X=S.options[S.activeOptionIndex])==null?void 0:X.dataRef.current.value)!=null?N:null,value:E}},[S,a,E]),Y=M(()=>{if(S.activeOptionIndex!==null){if(S.virtual)ie(S.virtual.options[S.activeOptionIndex]);else{let{dataRef:A}=S.options[S.activeOptionIndex];ie(A.current.value)}ge.goToOption(le.Specific,S.activeOptionIndex)}}),j=M(()=>{O({type:0}),F.current=!0}),I=M(()=>{O({type:1}),F.current=!1}),H=M((A,X,N)=>(F.current=!1,A===le.Specific?O({type:2,focus:le.Specific,idx:X,trigger:N}):O({type:2,focus:A,trigger:N}))),J=M((A,X)=>(O({type:3,payload:{id:A,dataRef:X}}),()=>{S.isActive(X.current.value)&&(F.current=!0),O({type:4,id:A})})),ne=M(A=>(O({type:5,id:A}),()=>O({type:5,id:null}))),ie=M(A=>me(S.mode,{0(){return w==null?void 0:w(A)},1(){let X=S.value.slice(),N=X.findIndex(K=>k(K,A));return N===-1?X.push(A):X.splice(N,1),w==null?void 0:w(X)}})),ae=M(A=>{O({type:6,trigger:A})}),ge=u.useMemo(()=>({onChange:ie,registerOption:J,registerLabel:ne,goToOption:H,closeCombobox:I,openCombobox:j,setActivationTrigger:ae,selectActiveOption:Y}),[]),we=n===null?{}:{ref:n},q=u.useRef(null),ue=ke();return u.useEffect(()=>{q.current&&r!==void 0&&ue.addEventListener(q.current,"reset",()=>{w==null||w(r)})},[q,w]),u.createElement(Ut.Provider,{value:ge},u.createElement(Ht.Provider,{value:S},u.createElement(Bt,{value:me(S.comboboxState,{0:he.Open,1:he.Closed})},s!=null&&E!=null&&An({[s]:E}).map(([A,X],N)=>u.createElement(Je,{features:He.Hidden,ref:N===0?K=>{var Q;q.current=(Q=K==null?void 0:K.closest("form"))!=null?Q:null}:void 0,...vt({key:A,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:l,disabled:a,name:A,value:X})})),de({ourProps:we,theirProps:v,slot:B,defaultTag:Oo,name:"Combobox"}))))}let Io="input";function $o(e,n){var t,r,o,l,s;let i=be(),{id:a=`headlessui-combobox-input-${i}`,onChange:m,displayValue:d,type:h="text",...x}=e,f=Re("Combobox.Input"),v=et("Combobox.Input"),g=pe(f.inputRef,n),b=_e(f.inputRef),E=u.useRef(!1),w=ke(),y=M(()=>{v.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),v.goToOption(le.Nothing)}),O=function(){var S;return typeof d=="function"&&f.value!==void 0?(S=d(f.value))!=null?S:"":typeof f.value=="string"?f.value:""}();Xe(([S,B],[Y,j])=>{if(E.current)return;let I=f.inputRef.current;I&&((j===0&&B===1||S!==Y)&&(I.value=S),requestAnimationFrame(()=>{if(E.current||!I||(b==null?void 0:b.activeElement)!==I)return;let{selectionStart:H,selectionEnd:J}=I;Math.abs((J??0)-(H??0))===0&&H===0&&I.setSelectionRange(I.value.length,I.value.length)}))},[O,f.comboboxState,b]),Xe(([S],[B])=>{if(S===0&&B===1){if(E.current)return;let Y=f.inputRef.current;if(!Y)return;let j=Y.value,{selectionStart:I,selectionEnd:H,selectionDirection:J}=Y;Y.value="",Y.value=j,J!==null?Y.setSelectionRange(I,H,J):Y.setSelectionRange(I,H)}},[f.comboboxState]);let F=u.useRef(!1),D=M(()=>{F.current=!0}),U=M(()=>{w.nextFrame(()=>{F.current=!1})}),V=M(S=>{switch(E.current=!0,S.key){case re.Enter:if(E.current=!1,f.comboboxState!==0||F.current)return;if(S.preventDefault(),S.stopPropagation(),f.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),f.mode===0&&v.closeCombobox();break;case re.ArrowDown:return E.current=!1,S.preventDefault(),S.stopPropagation(),me(f.comboboxState,{0:()=>v.goToOption(le.Next),1:()=>v.openCombobox()});case re.ArrowUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),me(f.comboboxState,{0:()=>v.goToOption(le.Previous),1:()=>{v.openCombobox(),w.nextFrame(()=>{f.value||v.goToOption(le.Last)})}});case re.Home:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.First);case re.PageUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.First);case re.End:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.Last);case re.PageDown:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.Last);case re.Escape:return E.current=!1,f.comboboxState!==0?void 0:(S.preventDefault(),f.optionsRef.current&&!f.optionsPropsRef.current.static&&S.stopPropagation(),f.nullable&&f.mode===0&&f.value===null&&y(),v.closeCombobox());case re.Tab:if(E.current=!1,f.comboboxState!==0)return;f.mode===0&&f.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),z=M(S=>{m==null||m(S),f.nullable&&f.mode===0&&S.target.value===""&&y(),v.openCombobox()}),_=M(S=>{var B,Y,j;let I=(B=S.relatedTarget)!=null?B:Ne.find(H=>H!==S.currentTarget);if(E.current=!1,!((Y=f.optionsRef.current)!=null&&Y.contains(I))&&!((j=f.buttonRef.current)!=null&&j.contains(I))&&f.comboboxState===0)return S.preventDefault(),f.mode===0&&(f.nullable&&f.value===null?y():f.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),k=M(S=>{var B,Y,j;let I=(B=S.relatedTarget)!=null?B:Ne.find(H=>H!==S.currentTarget);(Y=f.buttonRef.current)!=null&&Y.contains(I)||(j=f.optionsRef.current)!=null&&j.contains(I)||f.disabled||f.immediate&&f.comboboxState!==0&&(v.openCombobox(),w.nextFrame(()=>{v.setActivationTrigger(1)}))}),L=$t(()=>{if(f.labelId)return[f.labelId].join(" ")},[f.labelId]),R=u.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]),W={ref:g,id:a,role:"combobox",type:h,"aria-controls":(t=f.optionsRef.current)==null?void 0:t.id,"aria-expanded":f.comboboxState===0,"aria-activedescendant":f.activeOptionIndex===null?void 0:f.virtual?(r=f.options.find(S=>{var B;return!((B=f.virtual)!=null&&B.disabled(S.dataRef.current.value))&&f.compare(S.dataRef.current.value,f.virtual.options[f.activeOptionIndex])}))==null?void 0:r.id:(o=f.options[f.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":L,"aria-autocomplete":"list",defaultValue:(s=(l=e.defaultValue)!=null?l:f.defaultValue!==void 0?d==null?void 0:d(f.defaultValue):null)!=null?s:f.defaultValue,disabled:f.disabled,onCompositionStart:D,onCompositionEnd:U,onKeyDown:V,onChange:z,onFocus:k,onBlur:_};return de({ourProps:W,theirProps:x,slot:R,defaultTag:Io,name:"Combobox.Input"})}let Fo="button";function Po(e,n){var t;let r=Re("Combobox.Button"),o=et("Combobox.Button"),l=pe(r.buttonRef,n),s=be(),{id:i=`headlessui-combobox-button-${s}`,...a}=e,m=ke(),d=M(g=>{switch(g.key){case re.ArrowDown:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&o.openCombobox(),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case re.ArrowUp:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),m.nextFrame(()=>{r.value||o.goToOption(le.Last)})),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case re.Escape:return r.comboboxState!==0?void 0:(g.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&g.stopPropagation(),o.closeCombobox(),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})}));default:return}}),h=M(g=>{if(gt(g.currentTarget))return g.preventDefault();r.comboboxState===0?o.closeCombobox():(g.preventDefault(),o.openCombobox()),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})})}),x=$t(()=>{if(r.labelId)return[r.labelId,i].join(" ")},[r.labelId,i]),f=u.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:l,id:i,type:Lt(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(t=r.optionsRef.current)==null?void 0:t.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":x,disabled:r.disabled,onClick:h,onKeyDown:d};return de({ourProps:v,theirProps:a,slot:f,defaultTag:Fo,name:"Combobox.Button"})}let Mo="label";function Ao(e,n){let t=be(),{id:r=`headlessui-combobox-label-${t}`,...o}=e,l=Re("Combobox.Label"),s=et("Combobox.Label"),i=pe(l.labelRef,n);se(()=>s.registerLabel(r),[r]);let a=M(()=>{var d;return(d=l.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),m=u.useMemo(()=>({open:l.comboboxState===0,disabled:l.disabled}),[l]);return de({ourProps:{ref:i,id:r,onClick:a},theirProps:o,slot:m,defaultTag:Mo,name:"Combobox.Label"})}let Do="ul",Lo=Me.RenderStrategy|Me.Static;function _o(e,n){let t=be(),{id:r=`headlessui-combobox-options-${t}`,hold:o=!1,...l}=e,s=Re("Combobox.Options"),i=pe(s.optionsRef,n),a=Qe(),m=a!==null?(a&he.Open)===he.Open:s.comboboxState===0;se(()=>{var f;s.optionsPropsRef.current.static=(f=e.static)!=null?f:!1},[s.optionsPropsRef,e.static]),se(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Pn({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(f){return f.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let d=$t(()=>{var f,v;return(v=s.labelId)!=null?v:(f=s.buttonRef.current)==null?void 0:f.id},[s.labelId,s.buttonRef.current]),h=u.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),x={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:i};return s.virtual&&s.comboboxState===0&&Object.assign(l,{children:u.createElement(To,null,l.children)}),de({ourProps:x,theirProps:l,slot:h,defaultTag:Do,features:Lo,visible:m,name:"Combobox.Options"})}let Ro="li";function Bo(e,n){var t;let r=be(),{id:o=`headlessui-combobox-option-${r}`,disabled:l=!1,value:s,order:i=null,...a}=e,m=Re("Combobox.Option"),d=et("Combobox.Option"),h=m.virtual?m.activeOptionIndex===m.calculateIndex(s):m.activeOptionIndex===null?!1:((t=m.options[m.activeOptionIndex])==null?void 0:t.id)===o,x=m.isSelected(s),f=u.useRef(null),v=Ce({disabled:l,value:s,domRef:f,order:i}),g=u.useContext(_n),b=pe(n,f,g?g.measureElement:null),E=M(()=>d.onChange(s));se(()=>d.registerOption(o,v),[v,o]);let w=u.useRef(!(m.virtual||m.__demoMode));se(()=>{if(!m.virtual||!m.__demoMode)return;let _=Ee();return _.requestAnimationFrame(()=>{w.current=!0}),_.dispose},[m.virtual,m.__demoMode]),se(()=>{if(!w.current||m.comboboxState!==0||!h||m.activationTrigger===0)return;let _=Ee();return _.requestAnimationFrame(()=>{var k,L;(L=(k=f.current)==null?void 0:k.scrollIntoView)==null||L.call(k,{block:"nearest"})}),_.dispose},[f,h,m.comboboxState,m.activationTrigger,m.activeOptionIndex]);let y=M(_=>{var k;if(l||(k=m.virtual)!=null&&k.disabled(s))return _.preventDefault();E(),Nn()||requestAnimationFrame(()=>{var L;return(L=m.inputRef.current)==null?void 0:L.focus({preventScroll:!0})}),m.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),O=M(()=>{var _;if(l||(_=m.virtual)!=null&&_.disabled(s))return d.goToOption(le.Nothing);let k=m.calculateIndex(s);d.goToOption(le.Specific,k)}),F=Fn(),D=M(_=>F.update(_)),U=M(_=>{var k;if(!F.wasMoved(_)||l||(k=m.virtual)!=null&&k.disabled(s)||h)return;let L=m.calculateIndex(s);d.goToOption(le.Specific,L,0)}),V=M(_=>{var k;F.wasMoved(_)&&(l||(k=m.virtual)!=null&&k.disabled(s)||h&&(m.optionsPropsRef.current.hold||d.goToOption(le.Nothing)))}),z=u.useMemo(()=>({active:h,selected:x,disabled:l}),[h,x,l]);return de({ourProps:{id:o,ref:b,role:"option",tabIndex:l===!0?void 0:-1,"aria-disabled":l===!0?!0:void 0,"aria-selected":x,disabled:void 0,onClick:y,onFocus:O,onPointerEnter:D,onMouseEnter:D,onPointerMove:U,onMouseMove:U,onPointerLeave:V,onMouseLeave:V},theirProps:a,slot:z,defaultTag:Ro,name:"Combobox.Option"})}let zo=fe(ko),Wo=fe(Po),Uo=fe($o),Ho=fe(Ao),Vo=fe(_o),Yo=fe(Bo),$e=Object.assign(zo,{Input:Uo,Button:Wo,Label:Ho,Options:Vo,Option:Yo});function Rn(e,n,t,r){let o=Ce(t);u.useEffect(()=>{e=e??window;function l(s){o.current(s)}return e.addEventListener(n,l,r),()=>e.removeEventListener(n,l,r)},[e,n,r])}function tt(){let e=u.useRef(!1);return se(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Bn(e){let n=M(e),t=u.useRef(!1);u.useEffect(()=>(t.current=!1,()=>{t.current=!0,dt(()=>{t.current&&n()})}),[n])}var nt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(nt||{});function qo(){let e=u.useRef(0);return On("keydown",n=>{n.key==="Tab"&&(e.current=n.shiftKey?1:0)},!0),e}function zn(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let n=new Set;for(let t of e.current)t.current instanceof HTMLElement&&n.add(t.current);return n}let Go="div";var Wn=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Wn||{});function Ko(e,n){let t=u.useRef(null),r=pe(t,n),{initialFocus:o,containers:l,features:s=30,...i}=e;Ue()||(s=1);let a=_e(t);Jo({ownerDocument:a},!!(s&16));let m=Qo({ownerDocument:a,container:t,initialFocus:o},!!(s&2));es({ownerDocument:a,container:t,containers:l,previousActiveElement:m},!!(s&8));let d=qo(),h=M(g=>{let b=t.current;b&&(E=>E())(()=>{me(d.current,{[nt.Forwards]:()=>{Ze(b,Ie.First,{skipElements:[g.relatedTarget]})},[nt.Backwards]:()=>{Ze(b,Ie.Last,{skipElements:[g.relatedTarget]})}})})}),x=ke(),f=u.useRef(!1),v={ref:r,onKeyDown(g){g.key=="Tab"&&(f.current=!0,x.requestAnimationFrame(()=>{f.current=!1}))},onBlur(g){let b=zn(l);t.current instanceof HTMLElement&&b.add(t.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Un(b,E)||(f.current?Ze(t.current,me(d.current,{[nt.Forwards]:()=>Ie.Next,[nt.Backwards]:()=>Ie.Previous})|Ie.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Pe(g.target)))}};return u.createElement(u.Fragment,null,!!(s&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}),de({ourProps:v,theirProps:i,defaultTag:Go,name:"FocusTrap"}),!!(s&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}))}let Zo=fe(Ko),rt=Object.assign(Zo,{features:Wn});function Xo(e=!0){let n=u.useRef(Ne.slice());return Xe(([t],[r])=>{r===!0&&t===!1&&dt(()=>{n.current.splice(0)}),r===!1&&t===!0&&(n.current=Ne.slice())},[e,Ne,n]),M(()=>{var t;return(t=n.current.find(r=>r!=null&&r.isConnected))!=null?t:null})}function Jo({ownerDocument:e},n){let t=Xo(n);Xe(()=>{n||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Pe(t())},[n]),Bn(()=>{n&&Pe(t())})}function Qo({ownerDocument:e,container:n,initialFocus:t},r){let o=u.useRef(null),l=tt();return Xe(()=>{if(!r)return;let s=n.current;s&&dt(()=>{if(!l.current)return;let i=e==null?void 0:e.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===i){o.current=i;return}}else if(s.contains(i)){o.current=i;return}t!=null&&t.current?Pe(t.current):Ze(s,Ie.First)===Sn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=e==null?void 0:e.activeElement})},[r]),o}function es({ownerDocument:e,container:n,containers:t,previousActiveElement:r},o){let l=tt();Rn(e==null?void 0:e.defaultView,"focus",s=>{if(!o||!l.current)return;let i=zn(t);n.current instanceof HTMLElement&&i.add(n.current);let a=r.current;if(!a)return;let m=s.target;m&&m instanceof HTMLElement?Un(i,m)?(r.current=m,Pe(m)):(s.preventDefault(),s.stopPropagation(),Pe(a)):Pe(r.current)},!0)}function Un(e,n){for(let t of e)if(t.contains(n))return!0;return!1}let Hn=u.createContext(!1);function ts(){return u.useContext(Hn)}function Vt(e){return u.createElement(Hn.Provider,{value:e.force},e.children)}function ns(e){let n=ts(),t=u.useContext(Vn),r=_e(e),[o,l]=u.useState(()=>{if(!n&&t!==null||Oe.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return u.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),u.useEffect(()=>{n||t!==null&&l(t.current)},[t,l,n]),o}let rs=u.Fragment;function os(e,n){let t=e,r=u.useRef(null),o=pe(mo(d=>{r.current=d}),n),l=_e(r),s=ns(r),[i]=u.useState(()=>{var d;return Oe.isServer?null:(d=l==null?void 0:l.createElement("div"))!=null?d:null}),a=u.useContext(Yt),m=Ue();return se(()=>{!s||!i||s.contains(i)||(i.setAttribute("data-headlessui-portal",""),s.appendChild(i))},[s,i]),se(()=>{if(i&&a)return a.register(i)},[a,i]),Bn(()=>{var d;!s||!i||(i instanceof Node&&s.contains(i)&&s.removeChild(i),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))}),m?!s||!i?null:Tt.createPortal(de({ourProps:{ref:o},theirProps:t,defaultTag:rs,name:"Portal"}),i):null}let ss=u.Fragment,Vn=u.createContext(null);function ls(e,n){let{target:t,...r}=e,o={ref:pe(n)};return u.createElement(Vn.Provider,{value:t},de({ourProps:o,theirProps:r,defaultTag:ss,name:"Popover.Group"}))}let Yt=u.createContext(null);function is(){let e=u.useContext(Yt),n=u.useRef([]),t=M(l=>(n.current.push(l),e&&e.register(l),()=>r(l))),r=M(l=>{let s=n.current.indexOf(l);s!==-1&&n.current.splice(s,1),e&&e.unregister(l)}),o=u.useMemo(()=>({register:t,unregister:r,portals:n}),[t,r,n]);return[n,u.useMemo(()=>function({children:l}){return u.createElement(Yt.Provider,{value:o},l)},[o])]}let as=fe(os),us=fe(ls),qt=Object.assign(as,{Group:us});function cs(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}const ds=typeof Object.is=="function"?Object.is:cs,{useState:fs,useEffect:ms,useLayoutEffect:ps,useDebugValue:hs}=C;function vs(e,n,t){const r=n(),[{inst:o},l]=fs({inst:{value:r,getSnapshot:n}});return ps(()=>{o.value=r,o.getSnapshot=n,Gt(o)&&l({inst:o})},[e,r,n]),ms(()=>(Gt(o)&&l({inst:o}),e(()=>{Gt(o)&&l({inst:o})})),[e]),hs(r),r}function Gt(e){const n=e.getSnapshot,t=e.value;try{const r=n();return!ds(t,r)}catch{return!0}}function gs(e,n,t){return n()}const xs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bs=!xs,ws=bs?gs:vs,ys="useSyncExternalStore"in C?(e=>e.useSyncExternalStore)(C):ws;function Es(e){return ys(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ss(e,n){let t=e(),r=new Set;return{getSnapshot(){return t},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...l){let s=n[o].call(t,...l);s&&(t=s,r.forEach(i=>i()))}}}function js(){let e;return{before({doc:n}){var t;let r=n.documentElement;e=((t=n.defaultView)!=null?t:window).innerWidth-r.clientWidth},after({doc:n,d:t}){let r=n.documentElement,o=r.clientWidth-r.offsetWidth,l=e-o;t.style(r,"paddingRight",`${l}px`)}}}function Cs(){return Tn()?{before({doc:e,d:n,meta:t}){function r(o){return t.containers.flatMap(l=>l()).some(l=>l.contains(o))}n.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let i=Ee();i.style(e.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>i.dispose()))}let l=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;n.addEventListener(e,"click",i=>{if(i.target instanceof HTMLElement)try{let a=i.target.closest("a");if(!a)return;let{hash:m}=new URL(a.href),d=e.querySelector(m);d&&!r(d)&&(s=d)}catch{}},!0),n.addEventListener(e,"touchstart",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;n.style(a,"overscrollBehavior","contain")}else n.style(i.target,"touchAction","none")}),n.addEventListener(e,"touchmove",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&i.preventDefault()}else i.preventDefault()},{passive:!1}),n.add(()=>{var i;let a=(i=window.scrollY)!=null?i:window.pageYOffset;l!==a&&window.scrollTo(0,l),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Ts(){return{before({doc:e,d:n}){n.style(e.documentElement,"overflow","hidden")}}}function Ns(e){let n={};for(let t of e)Object.assign(n,t(n));return n}let Be=Ss(()=>new Map,{PUSH(e,n){var t;let r=(t=this.get(e))!=null?t:{doc:e,count:0,d:Ee(),meta:new Set};return r.count++,r.meta.add(n),this.set(e,r),this},POP(e,n){let t=this.get(e);return t&&(t.count--,t.meta.delete(n)),this},SCROLL_PREVENT({doc:e,d:n,meta:t}){let r={doc:e,d:n,meta:Ns(t)},o=[Cs(),js(),Ts()];o.forEach(({before:l})=>l==null?void 0:l(r)),o.forEach(({after:l})=>l==null?void 0:l(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Be.subscribe(()=>{let e=Be.getSnapshot(),n=new Map;for(let[t]of e)n.set(t,t.documentElement.style.overflow);for(let t of e.values()){let r=n.get(t.doc)==="hidden",o=t.count!==0;(o&&!r||!o&&r)&&Be.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Be.dispatch("TEARDOWN",t)}});function Os(e,n,t){let r=Es(Be),o=e?r.get(e):void 0,l=o?o.count>0:!1;return se(()=>{if(!(!e||!n))return Be.dispatch("PUSH",e,t),()=>Be.dispatch("POP",e,t)},[n,e]),l}let Kt=new Map,ot=new Map;function Yn(e,n=!0){se(()=>{var t;if(!n)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var s;if(!r)return;let i=(s=ot.get(r))!=null?s:1;if(i===1?ot.delete(r):ot.set(r,i-1),i!==1)return;let a=Kt.get(r);a&&(a["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",a["aria-hidden"]),r.inert=a.inert,Kt.delete(r))}let l=(t=ot.get(r))!=null?t:0;return ot.set(r,l+1),l!==0||(Kt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),o},[e,n])}function ks({defaultContainers:e=[],portals:n,mainTreeNodeRef:t}={}){var r;let o=u.useRef((r=t==null?void 0:t.current)!=null?r:null),l=_e(o),s=M(()=>{var i,a,m;let d=[];for(let h of e)h!==null&&(h instanceof HTMLElement?d.push(h):"current"in h&&h.current instanceof HTMLElement&&d.push(h.current));if(n!=null&&n.current)for(let h of n.current)d.push(h);for(let h of(i=l==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?i:[])h!==document.body&&h!==document.head&&h instanceof HTMLElement&&h.id!=="headlessui-portal-root"&&(h.contains(o.current)||h.contains((m=(a=o.current)==null?void 0:a.getRootNode())==null?void 0:m.host)||d.some(x=>h.contains(x))||d.push(h));return d});return{resolveContainers:s,contains:M(i=>s().some(a=>a.contains(i))),mainTreeNodeRef:o,MainTreeNode:u.useMemo(()=>function(){return t!=null?null:u.createElement(Je,{features:He.Hidden,ref:o})},[o,t])}}let Zt=u.createContext(()=>{});Zt.displayName="StackContext";var Xt=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Xt||{});function Is(){return u.useContext(Zt)}function $s({children:e,onUpdate:n,type:t,element:r,enabled:o}){let l=Is(),s=M((...i)=>{n==null||n(...i),l(...i)});return se(()=>{let i=o===void 0||o===!0;return i&&s(0,t,r),()=>{i&&s(1,t,r)}},[s,t,r,o]),u.createElement(Zt.Provider,{value:s},e)}let qn=u.createContext(null);function Gn(){let e=u.useContext(qn);if(e===null){let n=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Gn),n}return e}function Kn(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=M(l=>(n(s=>[...s,l]),()=>n(s=>{let i=s.slice(),a=i.indexOf(l);return a!==-1&&i.splice(a,1),i}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(qn.Provider,{value:o},t.children)},[n])]}let Fs="p";function Ps(e,n){let t=be(),{id:r=`headlessui-description-${t}`,...o}=e,l=Gn(),s=pe(n);se(()=>l.register(r),[r,l.register]);let i={ref:s,...l.props,id:r};return de({ourProps:i,theirProps:o,slot:l.slot||{},defaultTag:Fs,name:l.name||"Description"})}let Ms=fe(Ps),Zn=Object.assign(Ms,{});var As=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(As||{}),Ds=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ds||{});let Ls={0(e,n){return e.titleId===n.id?e:{...e,titleId:n.id}}},xt=u.createContext(null);xt.displayName="DialogContext";function st(e){let n=u.useContext(xt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,st),t}return n}function _s(e,n,t=()=>[document.body]){Os(e,n,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],t]}})}function Rs(e,n){return me(n.type,Ls,e,n)}let Bs="div",zs=Me.RenderStrategy|Me.Static;function Ws(e,n){let t=be(),{id:r=`headlessui-dialog-${t}`,open:o,onClose:l,initialFocus:s,role:i="dialog",__demoMode:a=!1,...m}=e,[d,h]=u.useState(0),x=u.useRef(!1);i=function(){return i==="dialog"||i==="alertdialog"?i:(x.current||(x.current=!0,console.warn(`Invalid role [${i}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=Qe();o===void 0&&f!==null&&(o=(f&he.Open)===he.Open);let v=u.useRef(null),g=pe(v,n),b=_e(v),E=e.hasOwnProperty("open")||f!==null,w=e.hasOwnProperty("onClose");if(!E&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!E)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let y=o?0:1,[O,F]=u.useReducer(Rs,{titleId:null,descriptionId:null,panelRef:u.createRef()}),D=M(()=>l(!1)),U=M(N=>F({type:0,id:N})),V=Ue()?a?!1:y===0:!1,z=d>1,_=u.useContext(xt)!==null,[k,L]=is(),R={get current(){var N;return(N=O.panelRef.current)!=null?N:v.current}},{resolveContainers:W,mainTreeNodeRef:S,MainTreeNode:B}=ks({portals:k,defaultContainers:[R]}),Y=z?"parent":"leaf",j=f!==null?(f&he.Closing)===he.Closing:!1,I=_||j?!1:V,H=u.useCallback(()=>{var N,K;return(K=Array.from((N=b==null?void 0:b.querySelectorAll("body > *"))!=null?N:[]).find(Q=>Q.id==="headlessui-portal-root"?!1:Q.contains(S.current)&&Q instanceof HTMLElement))!=null?K:null},[S]);Yn(H,I);let J=z?!0:V,ne=u.useCallback(()=>{var N,K;return(K=Array.from((N=b==null?void 0:b.querySelectorAll("[data-headlessui-portal]"))!=null?N:[]).find(Q=>Q.contains(S.current)&&Q instanceof HTMLElement))!=null?K:null},[S]);Yn(ne,J),Dt(W,N=>{N.preventDefault(),D()},!(!V||z));let ae=!(z||y!==0);Rn(b==null?void 0:b.defaultView,"keydown",N=>{ae&&(N.defaultPrevented||N.key===re.Escape&&(N.preventDefault(),N.stopPropagation(),D()))}),_s(b,!(j||y!==0||_),W),u.useEffect(()=>{if(y!==0||!v.current)return;let N=new ResizeObserver(K=>{for(let Q of K){let Se=Q.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&D()}});return N.observe(v.current),()=>N.disconnect()},[y,v,D]);let[we,q]=Kn(),ue=u.useMemo(()=>[{dialogState:y,close:D,setTitleId:U},O],[y,O,D,U]),A=u.useMemo(()=>({open:y===0}),[y]),X={ref:g,id:r,role:i,"aria-modal":y===0?!0:void 0,"aria-labelledby":O.titleId,"aria-describedby":we};return u.createElement($s,{type:"Dialog",enabled:y===0,element:v,onUpdate:M((N,K)=>{K==="Dialog"&&me(N,{[Xt.Add]:()=>h(Q=>Q+1),[Xt.Remove]:()=>h(Q=>Q-1)})})},u.createElement(Vt,{force:!0},u.createElement(qt,null,u.createElement(xt.Provider,{value:ue},u.createElement(qt.Group,{target:v},u.createElement(Vt,{force:!1},u.createElement(q,{slot:A,name:"Dialog.Description"},u.createElement(rt,{initialFocus:s,containers:W,features:V?me(Y,{parent:rt.features.RestoreFocus,leaf:rt.features.All&~rt.features.FocusLock}):rt.features.None},u.createElement(L,null,de({ourProps:X,theirProps:m,slot:A,defaultTag:Bs,features:zs,visible:y===0,name:"Dialog"}))))))))),u.createElement(B,null))}let Us="div";function Hs(e,n){let t=be(),{id:r=`headlessui-dialog-overlay-${t}`,...o}=e,[{dialogState:l,close:s}]=st("Dialog.Overlay"),i=pe(n),a=M(d=>{if(d.target===d.currentTarget){if(gt(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),s()}}),m=u.useMemo(()=>({open:l===0}),[l]);return de({ourProps:{ref:i,id:r,"aria-hidden":!0,onClick:a},theirProps:o,slot:m,defaultTag:Us,name:"Dialog.Overlay"})}let Vs="div";function Ys(e,n){let t=be(),{id:r=`headlessui-dialog-backdrop-${t}`,...o}=e,[{dialogState:l},s]=st("Dialog.Backdrop"),i=pe(n);u.useEffect(()=>{if(s.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let a=u.useMemo(()=>({open:l===0}),[l]);return u.createElement(Vt,{force:!0},u.createElement(qt,null,de({ourProps:{ref:i,id:r,"aria-hidden":!0},theirProps:o,slot:a,defaultTag:Vs,name:"Dialog.Backdrop"})))}let qs="div";function Gs(e,n){let t=be(),{id:r=`headlessui-dialog-panel-${t}`,...o}=e,[{dialogState:l},s]=st("Dialog.Panel"),i=pe(n,s.panelRef),a=u.useMemo(()=>({open:l===0}),[l]),m=M(d=>{d.stopPropagation()});return de({ourProps:{ref:i,id:r,onClick:m},theirProps:o,slot:a,defaultTag:qs,name:"Dialog.Panel"})}let Ks="h2";function Zs(e,n){let t=be(),{id:r=`headlessui-dialog-title-${t}`,...o}=e,[{dialogState:l,setTitleId:s}]=st("Dialog.Title"),i=pe(n);u.useEffect(()=>(s(r),()=>s(null)),[r,s]);let a=u.useMemo(()=>({open:l===0}),[l]);return de({ourProps:{ref:i,id:r},theirProps:o,slot:a,defaultTag:Ks,name:"Dialog.Title"})}let Xs=fe(Ws),Js=fe(Ys),Qs=fe(Gs),el=fe(Hs),tl=fe(Zs),Xn=Object.assign(Xs,{Backdrop:Js,Panel:Qs,Overlay:el,Title:tl,Description:Zn}),Jn=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Qn(e){var n,t;let r=(n=e.innerText)!=null?n:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let l=!1;for(let i of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))i.remove(),l=!0;let s=l?(t=o.innerText)!=null?t:"":r;return Jn.test(s)&&(s=s.replace(Jn,"")),s}function nl(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(o=>{let l=document.getElementById(o);if(l){let s=l.getAttribute("aria-label");return typeof s=="string"?s.trim():Qn(l).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Qn(e).trim()}function rl(e){let n=u.useRef(""),t=u.useRef("");return M(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(n.current===o)return t.current;let l=nl(r).trim().toLowerCase();return n.current=o,t.current=l,l})}var ol=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ol||{}),sl=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(sl||{}),ll=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(ll||{});function Jt(e,n=t=>t){let t=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=At(n(e.items.slice()),l=>l.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let il={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,n)=>{var t;let r=Jt(e),o=zt(n,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:(t=n.trigger)!=null?t:1}},3:(e,n)=>{let t=e.searchQuery!==""?0:1,r=e.searchQuery+n.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+t).concat(e.items.slice(0,e.activeItemIndex+t)):e.items).find(s=>{var i;return((i=s.dataRef.current.textValue)==null?void 0:i.startsWith(r))&&!s.dataRef.current.disabled}),l=o?e.items.indexOf(o):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:l,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,n)=>{let t=Jt(e,r=>[...r,{id:n.id,dataRef:n.dataRef}]);return{...e,...t}},6:(e,n)=>{let t=Jt(e,r=>{let o=r.findIndex(l=>l.id===n.id);return o!==-1&&r.splice(o,1),r});return{...e,...t,activationTrigger:1}}},Qt=u.createContext(null);Qt.displayName="MenuContext";function bt(e){let n=u.useContext(Qt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,bt),t}return n}function al(e,n){return me(n.type,il,e,n)}let ul=u.Fragment;function cl(e,n){let{__demoMode:t=!1,...r}=e,o=u.useReducer(al,{__demoMode:t,menuState:t?0:1,buttonRef:u.createRef(),itemsRef:u.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:l,itemsRef:s,buttonRef:i},a]=o,m=pe(n);Dt([i,s],(f,v)=>{var g;a({type:1}),Mt(v,Pt.Loose)||(f.preventDefault(),(g=i.current)==null||g.focus())},l===0);let d=M(()=>{a({type:1})}),h=u.useMemo(()=>({open:l===0,close:d}),[l,d]),x={ref:m};return u.createElement(Qt.Provider,{value:o},u.createElement(Bt,{value:me(l,{0:he.Open,1:he.Closed})},de({ourProps:x,theirProps:r,slot:h,defaultTag:ul,name:"Menu"})))}let dl="button";function fl(e,n){var t;let r=be(),{id:o=`headlessui-menu-button-${r}`,...l}=e,[s,i]=bt("Menu.Button"),a=pe(s.buttonRef,n),m=ke(),d=M(g=>{switch(g.key){case re.Space:case re.Enter:case re.ArrowDown:g.preventDefault(),g.stopPropagation(),i({type:0}),m.nextFrame(()=>i({type:2,focus:le.First}));break;case re.ArrowUp:g.preventDefault(),g.stopPropagation(),i({type:0}),m.nextFrame(()=>i({type:2,focus:le.Last}));break}}),h=M(g=>{switch(g.key){case re.Space:g.preventDefault();break}}),x=M(g=>{if(gt(g.currentTarget))return g.preventDefault();e.disabled||(s.menuState===0?(i({type:1}),m.nextFrame(()=>{var b;return(b=s.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})})):(g.preventDefault(),i({type:0})))}),f=u.useMemo(()=>({open:s.menuState===0}),[s]),v={ref:a,id:o,type:Lt(e,s.buttonRef),"aria-haspopup":"menu","aria-controls":(t=s.itemsRef.current)==null?void 0:t.id,"aria-expanded":s.menuState===0,onKeyDown:d,onKeyUp:h,onClick:x};return de({ourProps:v,theirProps:l,slot:f,defaultTag:dl,name:"Menu.Button"})}let ml="div",pl=Me.RenderStrategy|Me.Static;function hl(e,n){var t,r;let o=be(),{id:l=`headlessui-menu-items-${o}`,...s}=e,[i,a]=bt("Menu.Items"),m=pe(i.itemsRef,n),d=_e(i.itemsRef),h=ke(),x=Qe(),f=x!==null?(x&he.Open)===he.Open:i.menuState===0;u.useEffect(()=>{let w=i.itemsRef.current;w&&i.menuState===0&&w!==(d==null?void 0:d.activeElement)&&w.focus({preventScroll:!0})},[i.menuState,i.itemsRef,d]),Pn({container:i.itemsRef.current,enabled:i.menuState===0,accept(w){return w.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:w.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(w){w.setAttribute("role","none")}});let v=M(w=>{var y,O;switch(h.dispose(),w.key){case re.Space:if(i.searchQuery!=="")return w.preventDefault(),w.stopPropagation(),a({type:3,value:w.key});case re.Enter:if(w.preventDefault(),w.stopPropagation(),a({type:1}),i.activeItemIndex!==null){let{dataRef:F}=i.items[i.activeItemIndex];(O=(y=F.current)==null?void 0:y.domRef.current)==null||O.click()}Cn(i.buttonRef.current);break;case re.ArrowDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Next});case re.ArrowUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Previous});case re.Home:case re.PageUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.First});case re.End:case re.PageDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Last});case re.Escape:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{var F;return(F=i.buttonRef.current)==null?void 0:F.focus({preventScroll:!0})});break;case re.Tab:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{co(i.buttonRef.current,w.shiftKey?Ie.Previous:Ie.Next)});break;default:w.key.length===1&&(a({type:3,value:w.key}),h.setTimeout(()=>a({type:4}),350));break}}),g=M(w=>{switch(w.key){case re.Space:w.preventDefault();break}}),b=u.useMemo(()=>({open:i.menuState===0}),[i]),E={"aria-activedescendant":i.activeItemIndex===null||(t=i.items[i.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(r=i.buttonRef.current)==null?void 0:r.id,id:l,onKeyDown:v,onKeyUp:g,role:"menu",tabIndex:0,ref:m};return de({ourProps:E,theirProps:s,slot:b,defaultTag:ml,features:pl,visible:f,name:"Menu.Items"})}let vl=u.Fragment;function gl(e,n){let t=be(),{id:r=`headlessui-menu-item-${t}`,disabled:o=!1,...l}=e,[s,i]=bt("Menu.Item"),a=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===r:!1,m=u.useRef(null),d=pe(n,m);se(()=>{if(s.__demoMode||s.menuState!==0||!a||s.activationTrigger===0)return;let F=Ee();return F.requestAnimationFrame(()=>{var D,U;(U=(D=m.current)==null?void 0:D.scrollIntoView)==null||U.call(D,{block:"nearest"})}),F.dispose},[s.__demoMode,m,a,s.menuState,s.activationTrigger,s.activeItemIndex]);let h=rl(m),x=u.useRef({disabled:o,domRef:m,get textValue(){return h()}});se(()=>{x.current.disabled=o},[x,o]),se(()=>(i({type:5,id:r,dataRef:x}),()=>i({type:6,id:r})),[x,r]);let f=M(()=>{i({type:1})}),v=M(F=>{if(o)return F.preventDefault();i({type:1}),Cn(s.buttonRef.current)}),g=M(()=>{if(o)return i({type:2,focus:le.Nothing});i({type:2,focus:le.Specific,id:r})}),b=Fn(),E=M(F=>b.update(F)),w=M(F=>{b.wasMoved(F)&&(o||a||i({type:2,focus:le.Specific,id:r,trigger:0}))}),y=M(F=>{b.wasMoved(F)&&(o||a&&i({type:2,focus:le.Nothing}))}),O=u.useMemo(()=>({active:a,disabled:o,close:f}),[a,o,f]);return de({ourProps:{id:r,ref:d,role:"menuitem",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,disabled:void 0,onClick:v,onFocus:g,onPointerEnter:E,onMouseEnter:E,onPointerMove:w,onMouseMove:w,onPointerLeave:y,onMouseLeave:y},theirProps:l,slot:O,defaultTag:vl,name:"Menu.Item"})}let xl=fe(cl),bl=fe(fl),wl=fe(hl),yl=fe(gl),wt=Object.assign(xl,{Button:bl,Items:wl,Item:yl}),er=u.createContext(null);function tr(){let e=u.useContext(er);if(e===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,tr),n}return e}function El(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=M(l=>(n(s=>[...s,l]),()=>n(s=>{let i=s.slice(),a=i.indexOf(l);return a!==-1&&i.splice(a,1),i}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(er.Provider,{value:o},t.children)},[n])]}let Sl="label";function jl(e,n){let t=be(),{id:r=`headlessui-label-${t}`,passive:o=!1,...l}=e,s=tr(),i=pe(n);se(()=>s.register(r),[r,s.register]);let a={ref:i,...s.props,id:r};return o&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in l&&delete l.onClick),de({ourProps:a,theirProps:l,slot:s.slot||{},defaultTag:Sl,name:s.name||"Label"})}let Cl=fe(jl),Tl=Object.assign(Cl,{});function Nl(e=0){let[n,t]=u.useState(e),r=tt(),o=u.useCallback(a=>{r.current&&t(m=>m|a)},[n,r]),l=u.useCallback(a=>!!(n&a),[n]),s=u.useCallback(a=>{r.current&&t(m=>m&~a)},[t,r]),i=u.useCallback(a=>{r.current&&t(m=>m^a)},[t]);return{flags:n,addFlag:o,hasFlag:l,removeFlag:s,toggleFlag:i}}let en=u.createContext(null);en.displayName="GroupContext";let Ol=u.Fragment;function kl(e){var n;let[t,r]=u.useState(null),[o,l]=El(),[s,i]=Kn(),a=u.useMemo(()=>({switch:t,setSwitch:r,labelledby:o,describedby:s}),[t,r,o,s]),m={},d=e;return u.createElement(i,{name:"Switch.Description"},u.createElement(l,{name:"Switch.Label",props:{htmlFor:(n=a.switch)==null?void 0:n.id,onClick(h){t&&(h.currentTarget.tagName==="LABEL"&&h.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},u.createElement(en.Provider,{value:a},de({ourProps:m,theirProps:d,defaultTag:Ol,name:"Switch.Group"}))))}let Il="button";function $l(e,n){var t;let r=be(),{id:o=`headlessui-switch-${r}`,checked:l,defaultChecked:s=!1,onChange:i,disabled:a=!1,name:m,value:d,form:h,...x}=e,f=u.useContext(en),v=u.useRef(null),g=pe(v,n,f===null?null:f.setSwitch),[b,E]=yn(l,i,s),w=M(()=>E==null?void 0:E(!b)),y=M(z=>{if(gt(z.currentTarget))return z.preventDefault();z.preventDefault(),w()}),O=M(z=>{z.key===re.Space?(z.preventDefault(),w()):z.key===re.Enter&&wo(z.currentTarget)}),F=M(z=>z.preventDefault()),D=u.useMemo(()=>({checked:b}),[b]),U={id:o,ref:g,role:"switch",type:Lt(e,v),tabIndex:e.tabIndex===-1?0:(t=e.tabIndex)!=null?t:0,"aria-checked":b,"aria-labelledby":f==null?void 0:f.labelledby,"aria-describedby":f==null?void 0:f.describedby,disabled:a,onClick:y,onKeyUp:O,onKeyPress:F},V=ke();return u.useEffect(()=>{var z;let _=(z=v.current)==null?void 0:z.closest("form");_&&s!==void 0&&V.addEventListener(_,"reset",()=>{E(s)})},[v,E]),u.createElement(u.Fragment,null,m!=null&&b&&u.createElement(Je,{features:He.Hidden,...vt({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:a,form:h,checked:b,name:m,value:d})}),de({ourProps:U,theirProps:x,slot:D,defaultTag:Il,name:"Switch"}))}let Fl=fe($l),Pl=kl,Ml=Object.assign(Fl,{Group:Pl,Label:Tl,Description:Zn});function Al(e){let n={called:!1};return(...t)=>{if(!n.called)return n.called=!0,e(...t)}}function tn(e,...n){e&&n.length>0&&e.classList.add(...n)}function nn(e,...n){e&&n.length>0&&e.classList.remove(...n)}function Dl(e,n){let t=Ee();if(!e)return t.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[l,s]=[r,o].map(a=>{let[m=0]=a.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,h)=>h-d);return m}),i=l+s;if(i!==0){t.group(m=>{m.setTimeout(()=>{n(),m.dispose()},i),m.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&m.dispose()})});let a=t.addEventListener(e,"transitionend",m=>{m.target===m.currentTarget&&(n(),a())})}else n();return t.add(()=>n()),t.dispose}function Ll(e,n,t,r){let o=t?"enter":"leave",l=Ee(),s=r!==void 0?Al(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let i=me(o,{enter:()=>n.enter,leave:()=>n.leave}),a=me(o,{enter:()=>n.enterTo,leave:()=>n.leaveTo}),m=me(o,{enter:()=>n.enterFrom,leave:()=>n.leaveFrom});return nn(e,...n.base,...n.enter,...n.enterTo,...n.enterFrom,...n.leave,...n.leaveFrom,...n.leaveTo,...n.entered),tn(e,...n.base,...i,...m),l.nextFrame(()=>{nn(e,...n.base,...i,...m),tn(e,...n.base,...i,...a),Dl(e,()=>(nn(e,...n.base,...i),tn(e,...n.base,...n.entered),s()))}),l.dispose}function _l({immediate:e,container:n,direction:t,classes:r,onStart:o,onStop:l}){let s=tt(),i=ke(),a=Ce(t);se(()=>{e&&(a.current="enter")},[e]),se(()=>{let m=Ee();i.add(m.dispose);let d=n.current;if(d&&a.current!=="idle"&&s.current)return m.dispose(),o.current(a.current),m.add(Ll(d,r.current,a.current==="enter",()=>{m.dispose(),l.current(a.current)})),m.dispose},[t])}function De(e=""){return e.split(/\s+/).filter(n=>n.length>1)}let yt=u.createContext(null);yt.displayName="TransitionContext";var Rl=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Rl||{});function Bl(){let e=u.useContext(yt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function zl(){let e=u.useContext(Et);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Et=u.createContext(null);Et.displayName="NestingContext";function St(e){return"children"in e?St(e.children):e.current.filter(({el:n})=>n.current!==null).filter(({state:n})=>n==="visible").length>0}function nr(e,n){let t=Ce(e),r=u.useRef([]),o=tt(),l=ke(),s=M((f,v=Ae.Hidden)=>{let g=r.current.findIndex(({el:b})=>b===f);g!==-1&&(me(v,{[Ae.Unmount](){r.current.splice(g,1)},[Ae.Hidden](){r.current[g].state="hidden"}}),l.microTask(()=>{var b;!St(r)&&o.current&&((b=t.current)==null||b.call(t))}))}),i=M(f=>{let v=r.current.find(({el:g})=>g===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,Ae.Unmount)}),a=u.useRef([]),m=u.useRef(Promise.resolve()),d=u.useRef({enter:[],leave:[],idle:[]}),h=M((f,v,g)=>{a.current.splice(0),n&&(n.chains.current[v]=n.chains.current[v].filter(([b])=>b!==f)),n==null||n.chains.current[v].push([f,new Promise(b=>{a.current.push(b)})]),n==null||n.chains.current[v].push([f,new Promise(b=>{Promise.all(d.current[v].map(([E,w])=>w)).then(()=>b())})]),v==="enter"?m.current=m.current.then(()=>n==null?void 0:n.wait.current).then(()=>g(v)):g(v)}),x=M((f,v,g)=>{Promise.all(d.current[v].splice(0).map(([b,E])=>E)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>g(v))});return u.useMemo(()=>({children:r,register:i,unregister:s,onStart:h,onStop:x,wait:m,chains:d}),[i,s,r,h,x,d,m])}function Wl(){}let Ul=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function rr(e){var n;let t={};for(let r of Ul)t[r]=(n=e[r])!=null?n:Wl;return t}function Hl(e){let n=u.useRef(rr(e));return u.useEffect(()=>{n.current=rr(e)},[e]),n}let Vl="div",or=Me.RenderStrategy;function Yl(e,n){var t,r;let{beforeEnter:o,afterEnter:l,beforeLeave:s,afterLeave:i,enter:a,enterFrom:m,enterTo:d,entered:h,leave:x,leaveFrom:f,leaveTo:v,...g}=e,b=u.useRef(null),E=pe(b,n),w=(t=g.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:y,appear:O,initial:F}=Bl(),[D,U]=u.useState(y?"visible":"hidden"),V=zl(),{register:z,unregister:_}=V;u.useEffect(()=>z(b),[z,b]),u.useEffect(()=>{if(w===Ae.Hidden&&b.current){if(y&&D!=="visible"){U("visible");return}return me(D,{hidden:()=>_(b),visible:()=>z(b)})}},[D,b,z,_,y,w]);let k=Ce({base:De(g.className),enter:De(a),enterFrom:De(m),enterTo:De(d),entered:De(h),leave:De(x),leaveFrom:De(f),leaveTo:De(v)}),L=Hl({beforeEnter:o,afterEnter:l,beforeLeave:s,afterLeave:i}),R=Ue();u.useEffect(()=>{if(R&&D==="visible"&&b.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[b,D,R]);let W=F&&!O,S=O&&y&&F,B=!R||W?"idle":y?"enter":"leave",Y=Nl(0),j=M(ae=>me(ae,{enter:()=>{Y.addFlag(he.Opening),L.current.beforeEnter()},leave:()=>{Y.addFlag(he.Closing),L.current.beforeLeave()},idle:()=>{}})),I=M(ae=>me(ae,{enter:()=>{Y.removeFlag(he.Opening),L.current.afterEnter()},leave:()=>{Y.removeFlag(he.Closing),L.current.afterLeave()},idle:()=>{}})),H=nr(()=>{U("hidden"),_(b)},V),J=u.useRef(!1);_l({immediate:S,container:b,classes:k,direction:B,onStart:Ce(ae=>{J.current=!0,H.onStart(b,ae,j)}),onStop:Ce(ae=>{J.current=!1,H.onStop(b,ae,I),ae==="leave"&&!St(H)&&(U("hidden"),_(b))})});let ne=g,ie={ref:E};return S?ne={...ne,className:pt(g.className,...k.current.enter,...k.current.enterFrom)}:J.current&&(ne.className=pt(g.className,(r=b.current)==null?void 0:r.className),ne.className===""&&delete ne.className),u.createElement(Et.Provider,{value:H},u.createElement(Bt,{value:me(D,{visible:he.Open,hidden:he.Closed})|Y.flags},de({ourProps:ie,theirProps:ne,defaultTag:Vl,features:or,visible:D==="visible",name:"Transition.Child"})))}function ql(e,n){let{show:t,appear:r=!1,unmount:o=!0,...l}=e,s=u.useRef(null),i=pe(s,n);Ue();let a=Qe();if(t===void 0&&a!==null&&(t=(a&he.Open)===he.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[m,d]=u.useState(t?"visible":"hidden"),h=nr(()=>{d("hidden")}),[x,f]=u.useState(!0),v=u.useRef([t]);se(()=>{x!==!1&&v.current[v.current.length-1]!==t&&(v.current.push(t),f(!1))},[v,t]);let g=u.useMemo(()=>({show:t,appear:r,initial:x}),[t,r,x]);u.useEffect(()=>{if(t)d("visible");else if(!St(h))d("hidden");else{let y=s.current;if(!y)return;let O=y.getBoundingClientRect();O.x===0&&O.y===0&&O.width===0&&O.height===0&&d("hidden")}},[t,h]);let b={unmount:o},E=M(()=>{var y;x&&f(!1),(y=e.beforeEnter)==null||y.call(e)}),w=M(()=>{var y;x&&f(!1),(y=e.beforeLeave)==null||y.call(e)});return u.createElement(Et.Provider,{value:h},u.createElement(yt.Provider,{value:g},de({ourProps:{...b,as:u.Fragment,children:u.createElement(sr,{ref:i,...b,...l,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:u.Fragment,features:or,visible:m==="visible",name:"Transition"})))}function Gl(e,n){let t=u.useContext(yt)!==null,r=Qe()!==null;return u.createElement(u.Fragment,null,!t&&r?u.createElement(rn,{ref:n,...e}):u.createElement(sr,{ref:n,...e}))}let rn=fe(ql),sr=fe(Yl),Kl=fe(Gl),Le=Object.assign(rn,{Child:Kl,Root:rn});function Zl({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z",clipRule:"evenodd"}))}const Xl=C.forwardRef(Zl);function Jl({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z",clipRule:"evenodd"}))}const Ql=C.forwardRef(Jl);function ei({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const ti=C.forwardRef(ei);function ni({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const ri=C.forwardRef(ni);function oi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const on=C.forwardRef(oi);function si({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const lr=C.forwardRef(si);function li({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const ii=C.forwardRef(li);function ai({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const ui=C.forwardRef(ai);function ci({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",clipRule:"evenodd"}))}const di=C.forwardRef(ci),fi={warning:{color:"bg-yellow-50",icon:c.jsx(ii,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"}),colorTitle:"text-yellow-800",colorText:"text-yellow-700"},error:{color:"bg-red-50",icon:c.jsx(di,{className:"h-5 w-5 text-red-400","aria-hidden":"true"}),colorTitle:"text-red-800",colorText:"text-red-700"},success:{color:"bg-green-50",icon:c.jsx(ti,{className:"h-5 w-5 text-green-400","aria-hidden":"true"}),colorTitle:"text-green-800",colorText:"text-green-700"},info:{color:"bg-blue-50",icon:c.jsx(ui,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},mi=({type:e="info",title:n,message:t,active:r=!1,time:o=1e3,onClose:l})=>{const[s,i]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(r&&(i(!0),a.current=setTimeout(()=>{i(!1),l&&l()},o)),()=>clearTimeout(a.current)),[r,o,l]);const m=fi[e];return s?c.jsx("div",{className:"fixed top-2.5 left-1/2 transform -translate-x-1/2 w-80 3xs:w-96 z-50",children:c.jsx(Le,{as:u.Fragment,show:s,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:c.jsxs("div",{className:$("rounded-md p-4 text-center",m.color),children:[c.jsxs("div",{className:"flex justify-center flex-shrink-0",children:[m.icon,c.jsx("h3",{className:$("text-sm font-medium ml-3",m.colorTitle),children:n})]}),c.jsx("div",{className:$("mt-2 text-sm",m.colorText),children:c.jsx("p",{children:t})})]})})}):null};function pi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M11.47 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06l-3.22-3.22V16.5a.75.75 0 0 1-1.5 0V4.81L8.03 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5ZM3 15.75a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const ir=C.forwardRef(pi);function hi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))}const vi=C.forwardRef(hi);function gi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const xi=C.forwardRef(gi);function bi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),C.createElement("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"}))}const wi=C.forwardRef(bi);function yi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z",clipRule:"evenodd"}))}const Ei=C.forwardRef(yi);function Si({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const ar=C.forwardRef(Si),ji=({src:e,alt:n,width:t,height:r,className:o="",classNameIcon:l="",isIcon:s=!0,acronym:i=""})=>{function a(){if(typeof i!="string")return i;const m=i.toLowerCase(),d=m.split(" "),h=d[d.length-1];return m.charAt(0)+h.charAt(0)}return c.jsx(c.Fragment,{children:e?c.jsx("img",{src:e,alt:n,width:t,height:r,className:$(o!==""&&o),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s"},onLoad:m=>m.currentTarget.style.filter="none","data-testid":"img"}):s?c.jsx(Ei,{className:$("bg-white text-default-4",l!==""?l:"w-7 h-7")}):c.jsx("div",{className:$("bg-gray-200 text-default-4 rounded-full font-bold uppercase flex justify-center items-center",l!==""?l:"w-7 h-7"),children:a()})})},Ci=({steps:e,onClick:n})=>{const[t,r]=u.useState(0),o=l=>{r(l),n(l)};return c.jsx("nav",{className:"flex items-center justify-center w-full","aria-label":"Progress","data-testid":"bullets",children:c.jsx("ol",{role:"list",className:"flex items-center space-x-5",children:new Array(e).fill(1).map((l,s)=>c.jsx("li",{children:t!==s?c.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>o(s),"data-testid":`step-${s}`,children:c.jsx("span",{className:"sr-only",children:"step"})}):c.jsxs("div",{className:"relative flex items-center justify-center cursor-pointer","aria-current":"step",children:[c.jsx("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true",children:c.jsx("span",{className:"h-full w-full rounded-full bg-gray-300"})}),c.jsx("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-gray-500","aria-hidden":"true"}),c.jsx("span",{className:"sr-only",children:"step"})]})},s))})})};var ur={exports:{}};/*!
|
|
31
|
+
`));let x=d.props,f=typeof(x==null?void 0:x.className)=="function"?(...g)=>pt(x==null?void 0:x.className(...g),a.className):pt(x==null?void 0:x.className,a.className),v=f?{className:f}:{};return u.cloneElement(d,Object.assign({},Mn(d.props,vt(_t(a,["ref"]))),h,m,{ref:o(d.ref,m.ref)},v))}return u.createElement(l,Object.assign({},_t(a,["ref"]),l!==u.Fragment&&m,l!==u.Fragment&&h),d)}function po(...e){return e.every(n=>n==null)?void 0:n=>{for(let t of e)t!=null&&(typeof t=="function"?t(n):t.current=n)}}function Mn(...e){if(e.length===0)return{};if(e.length===1)return e[0];let n={},t={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(r[o])):n[o]=r[o];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(t).map(r=>[r,void 0])));for(let r in t)Object.assign(n,{[r](o,...l){let s=t[r];for(let i of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;i(o,...l)}}});return n}function fe(e){var n;return Object.assign(u.forwardRef(e),{displayName:(n=e.displayName)!=null?n:e.name})}function vt(e){let n=Object.assign({},e);for(let t in n)n[t]===void 0&&delete n[t];return n}function _t(e,n=[]){let t=Object.assign({},e);for(let r of n)r in t&&delete t[r];return t}let ho="div";var He=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(He||{});function vo(e,n){var t;let{features:r=1,...o}=e,l={ref:n,"aria-hidden":(r&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return de({ourProps:l,theirProps:o,slot:{},defaultTag:ho,name:"Hidden"})}let Je=fe(vo),Rt=u.createContext(null);Rt.displayName="OpenClosedContext";var he=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(he||{});function Qe(){return u.useContext(Rt)}function Bt({value:e,children:n}){return u.createElement(Rt.Provider,{value:e},n)}function go(e){function n(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",n))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}let Ne=[];go(()=>{function e(n){n.target instanceof HTMLElement&&n.target!==document.body&&Ne[0]!==n.target&&(Ne.unshift(n.target),Ne=Ne.filter(t=>t!=null&&t.isConnected),Ne.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function gt(e){let n=e.parentElement,t=null;for(;n&&!(n instanceof HTMLFieldSetElement);)n instanceof HTMLLegendElement&&(t=n),n=n.parentElement;let r=(n==null?void 0:n.getAttribute("disabled"))==="";return r&&xo(t)?!1:r}function xo(e){if(!e)return!1;let n=e.previousElementSibling;for(;n!==null;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}function bo(e){throw new Error("Unexpected object: "+e)}var le=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(le||{});function zt(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let l=0;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 1:{for(let l=o-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 2:{for(let l=o+1;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 3:{for(let l=t.length-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 4:{for(let l=0;l<t.length;++l)if(n.resolveId(t[l],l,t)===e.id)return l;return r}case 5:return null;default:bo(e)}}function An(e={},n=null,t=[]){for(let[r,o]of Object.entries(e))Ln(t,Dn(n,r),o);return t}function Dn(e,n){return e?e+"["+n+"]":n}function Ln(e,n,t){if(Array.isArray(t))for(let[r,o]of t.entries())Ln(e,Dn(n,r.toString()),o);else t instanceof Date?e.push([n,t.toISOString()]):typeof t=="boolean"?e.push([n,t?"1":"0"]):typeof t=="string"?e.push([n,t]):typeof t=="number"?e.push([n,`${t}`]):t==null?e.push([n,""]):An(t,n,e)}function wo(e){var n,t;let r=(n=e==null?void 0:e.form)!=null?n:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(t=r.requestSubmit)==null||t.call(r)}}var re=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(re||{}),yo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(yo||{}),Eo=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Eo||{}),So=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(So||{}),jo=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(jo||{});function Wt(e,n=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=n(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,i)=>s.dataRef.current.order-i.dataRef.current.order):At(r,s=>s.dataRef.current.domRef.current),l=t?o.indexOf(t):null;return l===-1&&(l=null),{options:o,activeOptionIndex:l}}let Co={1(e){var n;return(n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var n,t;if((n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,n){var t,r,o,l,s;if((t=e.dataRef.current)!=null&&t.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=n.focus===le.Specific?n.idx:zt(n,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var x,f;return(f=(x=e.activeOptionIndex)!=null?x:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?f:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),h=(l=n.trigger)!=null?l:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let i=Wt(e);if(i.activeOptionIndex===null){let d=i.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(i.activeOptionIndex=d)}let a=n.focus===le.Specific?n.idx:zt(n,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),m=(s=n.trigger)!=null?s:2;return e.activeOptionIndex===a&&e.activationTrigger===m?e:{...e,...i,activeOptionIndex:a,activationTrigger:m}},3:(e,n)=>{var t,r,o;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,n.payload]};let l=n.payload,s=Wt(e,a=>(a.push(l),a));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(n.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(l));let i={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(i.activeOptionIndex=0),i},4:(e,n)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(o=>o.id!==n.id)};let r=Wt(e,o=>{let l=o.findIndex(s=>s.id===n.id);return l!==-1&&o.splice(l,1),o});return{...e,...r,activationTrigger:2}},5:(e,n)=>e.labelId===n.id?e:{...e,labelId:n.id},6:(e,n)=>e.activationTrigger===n.trigger?e:{...e,activationTrigger:n.trigger},7:(e,n)=>{var t;if(((t=e.virtual)==null?void 0:t.options)===n.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=n.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:n.options})}}},Ut=u.createContext(null);Ut.displayName="ComboboxActionsContext";function et(e){let n=u.useContext(Ut);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,et),t}return n}let _n=u.createContext(null);function To(e){var n;let t=Re("VirtualProvider"),[r,o]=u.useMemo(()=>{let a=t.optionsRef.current;if(!a)return[0,0];let m=window.getComputedStyle(a);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[t.optionsRef.current]),l=to({scrollPaddingStart:r,scrollPaddingEnd:o,count:t.virtual.options.length,estimateSize(){return 40},getScrollElement(){var a;return(a=t.optionsRef.current)!=null?a:null},overscan:12}),[s,i]=u.useState(0);return se(()=>{i(a=>a+1)},[(n=t.virtual)==null?void 0:n.options]),u.createElement(_n.Provider,{value:l},u.createElement("div",{style:{position:"relative",width:"100%",height:`${l.getTotalSize()}px`},ref:a=>{if(a){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&l.scrollToIndex(t.activeOptionIndex)}}},l.getVirtualItems().map(a=>{var m;return u.createElement(u.Fragment,{key:a.key},u.cloneElement((m=e.children)==null?void 0:m.call(e,{option:t.virtual.options[a.index],open:t.comboboxState===0}),{key:`${s}-${a.key}`,"data-index":a.index,"aria-setsize":t.virtual.options.length,"aria-posinset":a.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${a.start}px)`,overflowAnchor:"none"}}))})))}let Ht=u.createContext(null);Ht.displayName="ComboboxDataContext";function Re(e){let n=u.useContext(Ht);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Re),t}return n}function No(e,n){return me(n.type,Co,e,n)}let Oo=u.Fragment;function ko(e,n){let{value:t,defaultValue:r,onChange:o,form:l,name:s,by:i=null,disabled:a=!1,__demoMode:m=!1,nullable:d=!1,multiple:h=!1,immediate:x=!1,virtual:f=null,...v}=e,g=!1,b=null,[E=h?[]:void 0,w]=yn(t,o,r),[y,k]=u.useReducer(No,{dataRef:u.createRef(),comboboxState:m?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),$=u.useRef(!1),_=u.useRef({static:!1,hold:!1}),W=u.useRef(null),V=u.useRef(null),z=u.useRef(null),C=u.useRef(null),P=A(typeof i=="string"?(L,Z)=>{let O=i;return(L==null?void 0:L[O])===(Z==null?void 0:Z[O])}:i??((L,Z)=>L===Z)),D=A(L=>y.options.findIndex(Z=>P(Z.dataRef.current.value,L))),B=u.useCallback(L=>me(S.mode,{1:()=>E.some(Z=>P(Z,L)),0:()=>P(E,L)}),[E]),U=A(L=>y.activeOptionIndex===D(L)),S=u.useMemo(()=>({...y,immediate:g,optionsPropsRef:_,labelRef:W,inputRef:V,buttonRef:z,optionsRef:C,value:E,defaultValue:r,disabled:a,mode:h?1:0,virtual:y.virtual,get activeOptionIndex(){if($.current&&y.activeOptionIndex===null&&y.options.length>0){let L=y.options.findIndex(Z=>!Z.dataRef.current.disabled);if(L!==-1)return L}return y.activeOptionIndex},calculateIndex:D,compare:P,isSelected:B,isActive:U,nullable:d,__demoMode:m}),[E,r,a,h,d,m,y,b]);se(()=>{},[b,void 0]),se(()=>{y.dataRef.current=S},[S]),Dt([S.buttonRef,S.inputRef,S.optionsRef],()=>ge.closeCombobox(),S.comboboxState===0);let R=u.useMemo(()=>{var L,Z,O;return{open:S.comboboxState===0,disabled:a,activeIndex:S.activeOptionIndex,activeOption:S.activeOptionIndex===null?null:S.virtual?S.virtual.options[(L=S.activeOptionIndex)!=null?L:0]:(O=(Z=S.options[S.activeOptionIndex])==null?void 0:Z.dataRef.current.value)!=null?O:null,value:E}},[S,a,E]),X=A(()=>{if(S.activeOptionIndex!==null){if(S.virtual)ie(S.virtual.options[S.activeOptionIndex]);else{let{dataRef:L}=S.options[S.activeOptionIndex];ie(L.current.value)}ge.goToOption(le.Specific,S.activeOptionIndex)}}),j=A(()=>{k({type:0}),$.current=!0}),F=A(()=>{k({type:1}),$.current=!1}),H=A((L,Z,O)=>($.current=!1,L===le.Specific?k({type:2,focus:le.Specific,idx:Z,trigger:O}):k({type:2,focus:L,trigger:O}))),J=A((L,Z)=>(k({type:3,payload:{id:L,dataRef:Z}}),()=>{S.isActive(Z.current.value)&&($.current=!0),k({type:4,id:L})})),ne=A(L=>(k({type:5,id:L}),()=>k({type:5,id:null}))),ie=A(L=>me(S.mode,{0(){return w==null?void 0:w(L)},1(){let Z=S.value.slice(),O=Z.findIndex(G=>P(G,L));return O===-1?Z.push(L):Z.splice(O,1),w==null?void 0:w(Z)}})),ae=A(L=>{k({type:6,trigger:L})}),ge=u.useMemo(()=>({onChange:ie,registerOption:J,registerLabel:ne,goToOption:H,closeCombobox:F,openCombobox:j,setActivationTrigger:ae,selectActiveOption:X}),[]),we=n===null?{}:{ref:n},Y=u.useRef(null),ue=ke();return u.useEffect(()=>{Y.current&&r!==void 0&&ue.addEventListener(Y.current,"reset",()=>{w==null||w(r)})},[Y,w]),u.createElement(Ut.Provider,{value:ge},u.createElement(Ht.Provider,{value:S},u.createElement(Bt,{value:me(S.comboboxState,{0:he.Open,1:he.Closed})},s!=null&&E!=null&&An({[s]:E}).map(([L,Z],O)=>u.createElement(Je,{features:He.Hidden,ref:O===0?G=>{var Q;Y.current=(Q=G==null?void 0:G.closest("form"))!=null?Q:null}:void 0,...vt({key:L,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:l,disabled:a,name:L,value:Z})})),de({ourProps:we,theirProps:v,slot:R,defaultTag:Oo,name:"Combobox"}))))}let Io="input";function $o(e,n){var t,r,o,l,s;let i=be(),{id:a=`headlessui-combobox-input-${i}`,onChange:m,displayValue:d,type:h="text",...x}=e,f=Re("Combobox.Input"),v=et("Combobox.Input"),g=pe(f.inputRef,n),b=_e(f.inputRef),E=u.useRef(!1),w=ke(),y=A(()=>{v.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),v.goToOption(le.Nothing)}),k=function(){var S;return typeof d=="function"&&f.value!==void 0?(S=d(f.value))!=null?S:"":typeof f.value=="string"?f.value:""}();Xe(([S,R],[X,j])=>{if(E.current)return;let F=f.inputRef.current;F&&((j===0&&R===1||S!==X)&&(F.value=S),requestAnimationFrame(()=>{if(E.current||!F||(b==null?void 0:b.activeElement)!==F)return;let{selectionStart:H,selectionEnd:J}=F;Math.abs((J??0)-(H??0))===0&&H===0&&F.setSelectionRange(F.value.length,F.value.length)}))},[k,f.comboboxState,b]),Xe(([S],[R])=>{if(S===0&&R===1){if(E.current)return;let X=f.inputRef.current;if(!X)return;let j=X.value,{selectionStart:F,selectionEnd:H,selectionDirection:J}=X;X.value="",X.value=j,J!==null?X.setSelectionRange(F,H,J):X.setSelectionRange(F,H)}},[f.comboboxState]);let $=u.useRef(!1),_=A(()=>{$.current=!0}),W=A(()=>{w.nextFrame(()=>{$.current=!1})}),V=A(S=>{switch(E.current=!0,S.key){case re.Enter:if(E.current=!1,f.comboboxState!==0||$.current)return;if(S.preventDefault(),S.stopPropagation(),f.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),f.mode===0&&v.closeCombobox();break;case re.ArrowDown:return E.current=!1,S.preventDefault(),S.stopPropagation(),me(f.comboboxState,{0:()=>v.goToOption(le.Next),1:()=>v.openCombobox()});case re.ArrowUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),me(f.comboboxState,{0:()=>v.goToOption(le.Previous),1:()=>{v.openCombobox(),w.nextFrame(()=>{f.value||v.goToOption(le.Last)})}});case re.Home:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.First);case re.PageUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.First);case re.End:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.Last);case re.PageDown:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(le.Last);case re.Escape:return E.current=!1,f.comboboxState!==0?void 0:(S.preventDefault(),f.optionsRef.current&&!f.optionsPropsRef.current.static&&S.stopPropagation(),f.nullable&&f.mode===0&&f.value===null&&y(),v.closeCombobox());case re.Tab:if(E.current=!1,f.comboboxState!==0)return;f.mode===0&&f.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),z=A(S=>{m==null||m(S),f.nullable&&f.mode===0&&S.target.value===""&&y(),v.openCombobox()}),C=A(S=>{var R,X,j;let F=(R=S.relatedTarget)!=null?R:Ne.find(H=>H!==S.currentTarget);if(E.current=!1,!((X=f.optionsRef.current)!=null&&X.contains(F))&&!((j=f.buttonRef.current)!=null&&j.contains(F))&&f.comboboxState===0)return S.preventDefault(),f.mode===0&&(f.nullable&&f.value===null?y():f.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),P=A(S=>{var R,X,j;let F=(R=S.relatedTarget)!=null?R:Ne.find(H=>H!==S.currentTarget);(X=f.buttonRef.current)!=null&&X.contains(F)||(j=f.optionsRef.current)!=null&&j.contains(F)||f.disabled||f.immediate&&f.comboboxState!==0&&(v.openCombobox(),w.nextFrame(()=>{v.setActivationTrigger(1)}))}),D=$t(()=>{if(f.labelId)return[f.labelId].join(" ")},[f.labelId]),B=u.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]),U={ref:g,id:a,role:"combobox",type:h,"aria-controls":(t=f.optionsRef.current)==null?void 0:t.id,"aria-expanded":f.comboboxState===0,"aria-activedescendant":f.activeOptionIndex===null?void 0:f.virtual?(r=f.options.find(S=>{var R;return!((R=f.virtual)!=null&&R.disabled(S.dataRef.current.value))&&f.compare(S.dataRef.current.value,f.virtual.options[f.activeOptionIndex])}))==null?void 0:r.id:(o=f.options[f.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":D,"aria-autocomplete":"list",defaultValue:(s=(l=e.defaultValue)!=null?l:f.defaultValue!==void 0?d==null?void 0:d(f.defaultValue):null)!=null?s:f.defaultValue,disabled:f.disabled,onCompositionStart:_,onCompositionEnd:W,onKeyDown:V,onChange:z,onFocus:P,onBlur:C};return de({ourProps:U,theirProps:x,slot:B,defaultTag:Io,name:"Combobox.Input"})}let Fo="button";function Po(e,n){var t;let r=Re("Combobox.Button"),o=et("Combobox.Button"),l=pe(r.buttonRef,n),s=be(),{id:i=`headlessui-combobox-button-${s}`,...a}=e,m=ke(),d=A(g=>{switch(g.key){case re.ArrowDown:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&o.openCombobox(),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case re.ArrowUp:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),m.nextFrame(()=>{r.value||o.goToOption(le.Last)})),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case re.Escape:return r.comboboxState!==0?void 0:(g.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&g.stopPropagation(),o.closeCombobox(),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})}));default:return}}),h=A(g=>{if(gt(g.currentTarget))return g.preventDefault();r.comboboxState===0?o.closeCombobox():(g.preventDefault(),o.openCombobox()),m.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})})}),x=$t(()=>{if(r.labelId)return[r.labelId,i].join(" ")},[r.labelId,i]),f=u.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:l,id:i,type:Lt(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(t=r.optionsRef.current)==null?void 0:t.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":x,disabled:r.disabled,onClick:h,onKeyDown:d};return de({ourProps:v,theirProps:a,slot:f,defaultTag:Fo,name:"Combobox.Button"})}let Mo="label";function Ao(e,n){let t=be(),{id:r=`headlessui-combobox-label-${t}`,...o}=e,l=Re("Combobox.Label"),s=et("Combobox.Label"),i=pe(l.labelRef,n);se(()=>s.registerLabel(r),[r]);let a=A(()=>{var d;return(d=l.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),m=u.useMemo(()=>({open:l.comboboxState===0,disabled:l.disabled}),[l]);return de({ourProps:{ref:i,id:r,onClick:a},theirProps:o,slot:m,defaultTag:Mo,name:"Combobox.Label"})}let Do="ul",Lo=Me.RenderStrategy|Me.Static;function _o(e,n){let t=be(),{id:r=`headlessui-combobox-options-${t}`,hold:o=!1,...l}=e,s=Re("Combobox.Options"),i=pe(s.optionsRef,n),a=Qe(),m=a!==null?(a&he.Open)===he.Open:s.comboboxState===0;se(()=>{var f;s.optionsPropsRef.current.static=(f=e.static)!=null?f:!1},[s.optionsPropsRef,e.static]),se(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Pn({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(f){return f.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:f.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(f){f.setAttribute("role","none")}});let d=$t(()=>{var f,v;return(v=s.labelId)!=null?v:(f=s.buttonRef.current)==null?void 0:f.id},[s.labelId,s.buttonRef.current]),h=u.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),x={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:i};return s.virtual&&s.comboboxState===0&&Object.assign(l,{children:u.createElement(To,null,l.children)}),de({ourProps:x,theirProps:l,slot:h,defaultTag:Do,features:Lo,visible:m,name:"Combobox.Options"})}let Ro="li";function Bo(e,n){var t;let r=be(),{id:o=`headlessui-combobox-option-${r}`,disabled:l=!1,value:s,order:i=null,...a}=e,m=Re("Combobox.Option"),d=et("Combobox.Option"),h=m.virtual?m.activeOptionIndex===m.calculateIndex(s):m.activeOptionIndex===null?!1:((t=m.options[m.activeOptionIndex])==null?void 0:t.id)===o,x=m.isSelected(s),f=u.useRef(null),v=Ce({disabled:l,value:s,domRef:f,order:i}),g=u.useContext(_n),b=pe(n,f,g?g.measureElement:null),E=A(()=>d.onChange(s));se(()=>d.registerOption(o,v),[v,o]);let w=u.useRef(!(m.virtual||m.__demoMode));se(()=>{if(!m.virtual||!m.__demoMode)return;let C=Ee();return C.requestAnimationFrame(()=>{w.current=!0}),C.dispose},[m.virtual,m.__demoMode]),se(()=>{if(!w.current||m.comboboxState!==0||!h||m.activationTrigger===0)return;let C=Ee();return C.requestAnimationFrame(()=>{var P,D;(D=(P=f.current)==null?void 0:P.scrollIntoView)==null||D.call(P,{block:"nearest"})}),C.dispose},[f,h,m.comboboxState,m.activationTrigger,m.activeOptionIndex]);let y=A(C=>{var P;if(l||(P=m.virtual)!=null&&P.disabled(s))return C.preventDefault();E(),Nn()||requestAnimationFrame(()=>{var D;return(D=m.inputRef.current)==null?void 0:D.focus({preventScroll:!0})}),m.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),k=A(()=>{var C;if(l||(C=m.virtual)!=null&&C.disabled(s))return d.goToOption(le.Nothing);let P=m.calculateIndex(s);d.goToOption(le.Specific,P)}),$=Fn(),_=A(C=>$.update(C)),W=A(C=>{var P;if(!$.wasMoved(C)||l||(P=m.virtual)!=null&&P.disabled(s)||h)return;let D=m.calculateIndex(s);d.goToOption(le.Specific,D,0)}),V=A(C=>{var P;$.wasMoved(C)&&(l||(P=m.virtual)!=null&&P.disabled(s)||h&&(m.optionsPropsRef.current.hold||d.goToOption(le.Nothing)))}),z=u.useMemo(()=>({active:h,selected:x,disabled:l}),[h,x,l]);return de({ourProps:{id:o,ref:b,role:"option",tabIndex:l===!0?void 0:-1,"aria-disabled":l===!0?!0:void 0,"aria-selected":x,disabled:void 0,onClick:y,onFocus:k,onPointerEnter:_,onMouseEnter:_,onPointerMove:W,onMouseMove:W,onPointerLeave:V,onMouseLeave:V},theirProps:a,slot:z,defaultTag:Ro,name:"Combobox.Option"})}let zo=fe(ko),Wo=fe(Po),Uo=fe($o),Ho=fe(Ao),Vo=fe(_o),Yo=fe(Bo),$e=Object.assign(zo,{Input:Uo,Button:Wo,Label:Ho,Options:Vo,Option:Yo});function Rn(e,n,t,r){let o=Ce(t);u.useEffect(()=>{e=e??window;function l(s){o.current(s)}return e.addEventListener(n,l,r),()=>e.removeEventListener(n,l,r)},[e,n,r])}function tt(){let e=u.useRef(!1);return se(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Bn(e){let n=A(e),t=u.useRef(!1);u.useEffect(()=>(t.current=!1,()=>{t.current=!0,dt(()=>{t.current&&n()})}),[n])}var nt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(nt||{});function qo(){let e=u.useRef(0);return On("keydown",n=>{n.key==="Tab"&&(e.current=n.shiftKey?1:0)},!0),e}function zn(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let n=new Set;for(let t of e.current)t.current instanceof HTMLElement&&n.add(t.current);return n}let Go="div";var Wn=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Wn||{});function Ko(e,n){let t=u.useRef(null),r=pe(t,n),{initialFocus:o,containers:l,features:s=30,...i}=e;Ue()||(s=1);let a=_e(t);Jo({ownerDocument:a},!!(s&16));let m=Qo({ownerDocument:a,container:t,initialFocus:o},!!(s&2));es({ownerDocument:a,container:t,containers:l,previousActiveElement:m},!!(s&8));let d=qo(),h=A(g=>{let b=t.current;b&&(E=>E())(()=>{me(d.current,{[nt.Forwards]:()=>{Ze(b,Ie.First,{skipElements:[g.relatedTarget]})},[nt.Backwards]:()=>{Ze(b,Ie.Last,{skipElements:[g.relatedTarget]})}})})}),x=ke(),f=u.useRef(!1),v={ref:r,onKeyDown(g){g.key=="Tab"&&(f.current=!0,x.requestAnimationFrame(()=>{f.current=!1}))},onBlur(g){let b=zn(l);t.current instanceof HTMLElement&&b.add(t.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Un(b,E)||(f.current?Ze(t.current,me(d.current,{[nt.Forwards]:()=>Ie.Next,[nt.Backwards]:()=>Ie.Previous})|Ie.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Pe(g.target)))}};return u.createElement(u.Fragment,null,!!(s&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}),de({ourProps:v,theirProps:i,defaultTag:Go,name:"FocusTrap"}),!!(s&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}))}let Zo=fe(Ko),rt=Object.assign(Zo,{features:Wn});function Xo(e=!0){let n=u.useRef(Ne.slice());return Xe(([t],[r])=>{r===!0&&t===!1&&dt(()=>{n.current.splice(0)}),r===!1&&t===!0&&(n.current=Ne.slice())},[e,Ne,n]),A(()=>{var t;return(t=n.current.find(r=>r!=null&&r.isConnected))!=null?t:null})}function Jo({ownerDocument:e},n){let t=Xo(n);Xe(()=>{n||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Pe(t())},[n]),Bn(()=>{n&&Pe(t())})}function Qo({ownerDocument:e,container:n,initialFocus:t},r){let o=u.useRef(null),l=tt();return Xe(()=>{if(!r)return;let s=n.current;s&&dt(()=>{if(!l.current)return;let i=e==null?void 0:e.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===i){o.current=i;return}}else if(s.contains(i)){o.current=i;return}t!=null&&t.current?Pe(t.current):Ze(s,Ie.First)===Sn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=e==null?void 0:e.activeElement})},[r]),o}function es({ownerDocument:e,container:n,containers:t,previousActiveElement:r},o){let l=tt();Rn(e==null?void 0:e.defaultView,"focus",s=>{if(!o||!l.current)return;let i=zn(t);n.current instanceof HTMLElement&&i.add(n.current);let a=r.current;if(!a)return;let m=s.target;m&&m instanceof HTMLElement?Un(i,m)?(r.current=m,Pe(m)):(s.preventDefault(),s.stopPropagation(),Pe(a)):Pe(r.current)},!0)}function Un(e,n){for(let t of e)if(t.contains(n))return!0;return!1}let Hn=u.createContext(!1);function ts(){return u.useContext(Hn)}function Vt(e){return u.createElement(Hn.Provider,{value:e.force},e.children)}function ns(e){let n=ts(),t=u.useContext(Vn),r=_e(e),[o,l]=u.useState(()=>{if(!n&&t!==null||Oe.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)});return u.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),u.useEffect(()=>{n||t!==null&&l(t.current)},[t,l,n]),o}let rs=u.Fragment;function os(e,n){let t=e,r=u.useRef(null),o=pe(mo(d=>{r.current=d}),n),l=_e(r),s=ns(r),[i]=u.useState(()=>{var d;return Oe.isServer?null:(d=l==null?void 0:l.createElement("div"))!=null?d:null}),a=u.useContext(Yt),m=Ue();return se(()=>{!s||!i||s.contains(i)||(i.setAttribute("data-headlessui-portal",""),s.appendChild(i))},[s,i]),se(()=>{if(i&&a)return a.register(i)},[a,i]),Bn(()=>{var d;!s||!i||(i instanceof Node&&s.contains(i)&&s.removeChild(i),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))}),m?!s||!i?null:Tt.createPortal(de({ourProps:{ref:o},theirProps:t,defaultTag:rs,name:"Portal"}),i):null}let ss=u.Fragment,Vn=u.createContext(null);function ls(e,n){let{target:t,...r}=e,o={ref:pe(n)};return u.createElement(Vn.Provider,{value:t},de({ourProps:o,theirProps:r,defaultTag:ss,name:"Popover.Group"}))}let Yt=u.createContext(null);function is(){let e=u.useContext(Yt),n=u.useRef([]),t=A(l=>(n.current.push(l),e&&e.register(l),()=>r(l))),r=A(l=>{let s=n.current.indexOf(l);s!==-1&&n.current.splice(s,1),e&&e.unregister(l)}),o=u.useMemo(()=>({register:t,unregister:r,portals:n}),[t,r,n]);return[n,u.useMemo(()=>function({children:l}){return u.createElement(Yt.Provider,{value:o},l)},[o])]}let as=fe(os),us=fe(ls),qt=Object.assign(as,{Group:us});function cs(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}const ds=typeof Object.is=="function"?Object.is:cs,{useState:fs,useEffect:ms,useLayoutEffect:ps,useDebugValue:hs}=T;function vs(e,n,t){const r=n(),[{inst:o},l]=fs({inst:{value:r,getSnapshot:n}});return ps(()=>{o.value=r,o.getSnapshot=n,Gt(o)&&l({inst:o})},[e,r,n]),ms(()=>(Gt(o)&&l({inst:o}),e(()=>{Gt(o)&&l({inst:o})})),[e]),hs(r),r}function Gt(e){const n=e.getSnapshot,t=e.value;try{const r=n();return!ds(t,r)}catch{return!0}}function gs(e,n,t){return n()}const xs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bs=!xs,ws=bs?gs:vs,ys="useSyncExternalStore"in T?(e=>e.useSyncExternalStore)(T):ws;function Es(e){return ys(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ss(e,n){let t=e(),r=new Set;return{getSnapshot(){return t},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...l){let s=n[o].call(t,...l);s&&(t=s,r.forEach(i=>i()))}}}function js(){let e;return{before({doc:n}){var t;let r=n.documentElement;e=((t=n.defaultView)!=null?t:window).innerWidth-r.clientWidth},after({doc:n,d:t}){let r=n.documentElement,o=r.clientWidth-r.offsetWidth,l=e-o;t.style(r,"paddingRight",`${l}px`)}}}function Cs(){return Tn()?{before({doc:e,d:n,meta:t}){function r(o){return t.containers.flatMap(l=>l()).some(l=>l.contains(o))}n.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let i=Ee();i.style(e.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>i.dispose()))}let l=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;n.addEventListener(e,"click",i=>{if(i.target instanceof HTMLElement)try{let a=i.target.closest("a");if(!a)return;let{hash:m}=new URL(a.href),d=e.querySelector(m);d&&!r(d)&&(s=d)}catch{}},!0),n.addEventListener(e,"touchstart",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;n.style(a,"overscrollBehavior","contain")}else n.style(i.target,"touchAction","none")}),n.addEventListener(e,"touchmove",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&i.preventDefault()}else i.preventDefault()},{passive:!1}),n.add(()=>{var i;let a=(i=window.scrollY)!=null?i:window.pageYOffset;l!==a&&window.scrollTo(0,l),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Ts(){return{before({doc:e,d:n}){n.style(e.documentElement,"overflow","hidden")}}}function Ns(e){let n={};for(let t of e)Object.assign(n,t(n));return n}let Be=Ss(()=>new Map,{PUSH(e,n){var t;let r=(t=this.get(e))!=null?t:{doc:e,count:0,d:Ee(),meta:new Set};return r.count++,r.meta.add(n),this.set(e,r),this},POP(e,n){let t=this.get(e);return t&&(t.count--,t.meta.delete(n)),this},SCROLL_PREVENT({doc:e,d:n,meta:t}){let r={doc:e,d:n,meta:Ns(t)},o=[Cs(),js(),Ts()];o.forEach(({before:l})=>l==null?void 0:l(r)),o.forEach(({after:l})=>l==null?void 0:l(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Be.subscribe(()=>{let e=Be.getSnapshot(),n=new Map;for(let[t]of e)n.set(t,t.documentElement.style.overflow);for(let t of e.values()){let r=n.get(t.doc)==="hidden",o=t.count!==0;(o&&!r||!o&&r)&&Be.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Be.dispatch("TEARDOWN",t)}});function Os(e,n,t){let r=Es(Be),o=e?r.get(e):void 0,l=o?o.count>0:!1;return se(()=>{if(!(!e||!n))return Be.dispatch("PUSH",e,t),()=>Be.dispatch("POP",e,t)},[n,e]),l}let Kt=new Map,ot=new Map;function Yn(e,n=!0){se(()=>{var t;if(!n)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var s;if(!r)return;let i=(s=ot.get(r))!=null?s:1;if(i===1?ot.delete(r):ot.set(r,i-1),i!==1)return;let a=Kt.get(r);a&&(a["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",a["aria-hidden"]),r.inert=a.inert,Kt.delete(r))}let l=(t=ot.get(r))!=null?t:0;return ot.set(r,l+1),l!==0||(Kt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),o},[e,n])}function ks({defaultContainers:e=[],portals:n,mainTreeNodeRef:t}={}){var r;let o=u.useRef((r=t==null?void 0:t.current)!=null?r:null),l=_e(o),s=A(()=>{var i,a,m;let d=[];for(let h of e)h!==null&&(h instanceof HTMLElement?d.push(h):"current"in h&&h.current instanceof HTMLElement&&d.push(h.current));if(n!=null&&n.current)for(let h of n.current)d.push(h);for(let h of(i=l==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?i:[])h!==document.body&&h!==document.head&&h instanceof HTMLElement&&h.id!=="headlessui-portal-root"&&(h.contains(o.current)||h.contains((m=(a=o.current)==null?void 0:a.getRootNode())==null?void 0:m.host)||d.some(x=>h.contains(x))||d.push(h));return d});return{resolveContainers:s,contains:A(i=>s().some(a=>a.contains(i))),mainTreeNodeRef:o,MainTreeNode:u.useMemo(()=>function(){return t!=null?null:u.createElement(Je,{features:He.Hidden,ref:o})},[o,t])}}let Zt=u.createContext(()=>{});Zt.displayName="StackContext";var Xt=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Xt||{});function Is(){return u.useContext(Zt)}function $s({children:e,onUpdate:n,type:t,element:r,enabled:o}){let l=Is(),s=A((...i)=>{n==null||n(...i),l(...i)});return se(()=>{let i=o===void 0||o===!0;return i&&s(0,t,r),()=>{i&&s(1,t,r)}},[s,t,r,o]),u.createElement(Zt.Provider,{value:s},e)}let qn=u.createContext(null);function Gn(){let e=u.useContext(qn);if(e===null){let n=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Gn),n}return e}function Kn(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=A(l=>(n(s=>[...s,l]),()=>n(s=>{let i=s.slice(),a=i.indexOf(l);return a!==-1&&i.splice(a,1),i}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(qn.Provider,{value:o},t.children)},[n])]}let Fs="p";function Ps(e,n){let t=be(),{id:r=`headlessui-description-${t}`,...o}=e,l=Gn(),s=pe(n);se(()=>l.register(r),[r,l.register]);let i={ref:s,...l.props,id:r};return de({ourProps:i,theirProps:o,slot:l.slot||{},defaultTag:Fs,name:l.name||"Description"})}let Ms=fe(Ps),Zn=Object.assign(Ms,{});var As=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(As||{}),Ds=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ds||{});let Ls={0(e,n){return e.titleId===n.id?e:{...e,titleId:n.id}}},xt=u.createContext(null);xt.displayName="DialogContext";function st(e){let n=u.useContext(xt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,st),t}return n}function _s(e,n,t=()=>[document.body]){Os(e,n,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],t]}})}function Rs(e,n){return me(n.type,Ls,e,n)}let Bs="div",zs=Me.RenderStrategy|Me.Static;function Ws(e,n){let t=be(),{id:r=`headlessui-dialog-${t}`,open:o,onClose:l,initialFocus:s,role:i="dialog",__demoMode:a=!1,...m}=e,[d,h]=u.useState(0),x=u.useRef(!1);i=function(){return i==="dialog"||i==="alertdialog"?i:(x.current||(x.current=!0,console.warn(`Invalid role [${i}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let f=Qe();o===void 0&&f!==null&&(o=(f&he.Open)===he.Open);let v=u.useRef(null),g=pe(v,n),b=_e(v),E=e.hasOwnProperty("open")||f!==null,w=e.hasOwnProperty("onClose");if(!E&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!E)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let y=o?0:1,[k,$]=u.useReducer(Rs,{titleId:null,descriptionId:null,panelRef:u.createRef()}),_=A(()=>l(!1)),W=A(O=>$({type:0,id:O})),V=Ue()?a?!1:y===0:!1,z=d>1,C=u.useContext(xt)!==null,[P,D]=is(),B={get current(){var O;return(O=k.panelRef.current)!=null?O:v.current}},{resolveContainers:U,mainTreeNodeRef:S,MainTreeNode:R}=ks({portals:P,defaultContainers:[B]}),X=z?"parent":"leaf",j=f!==null?(f&he.Closing)===he.Closing:!1,F=C||j?!1:V,H=u.useCallback(()=>{var O,G;return(G=Array.from((O=b==null?void 0:b.querySelectorAll("body > *"))!=null?O:[]).find(Q=>Q.id==="headlessui-portal-root"?!1:Q.contains(S.current)&&Q instanceof HTMLElement))!=null?G:null},[S]);Yn(H,F);let J=z?!0:V,ne=u.useCallback(()=>{var O,G;return(G=Array.from((O=b==null?void 0:b.querySelectorAll("[data-headlessui-portal]"))!=null?O:[]).find(Q=>Q.contains(S.current)&&Q instanceof HTMLElement))!=null?G:null},[S]);Yn(ne,J),Dt(U,O=>{O.preventDefault(),_()},!(!V||z));let ae=!(z||y!==0);Rn(b==null?void 0:b.defaultView,"keydown",O=>{ae&&(O.defaultPrevented||O.key===re.Escape&&(O.preventDefault(),O.stopPropagation(),_()))}),_s(b,!(j||y!==0||C),U),u.useEffect(()=>{if(y!==0||!v.current)return;let O=new ResizeObserver(G=>{for(let Q of G){let Se=Q.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&_()}});return O.observe(v.current),()=>O.disconnect()},[y,v,_]);let[we,Y]=Kn(),ue=u.useMemo(()=>[{dialogState:y,close:_,setTitleId:W},k],[y,k,_,W]),L=u.useMemo(()=>({open:y===0}),[y]),Z={ref:g,id:r,role:i,"aria-modal":y===0?!0:void 0,"aria-labelledby":k.titleId,"aria-describedby":we};return u.createElement($s,{type:"Dialog",enabled:y===0,element:v,onUpdate:A((O,G)=>{G==="Dialog"&&me(O,{[Xt.Add]:()=>h(Q=>Q+1),[Xt.Remove]:()=>h(Q=>Q-1)})})},u.createElement(Vt,{force:!0},u.createElement(qt,null,u.createElement(xt.Provider,{value:ue},u.createElement(qt.Group,{target:v},u.createElement(Vt,{force:!1},u.createElement(Y,{slot:L,name:"Dialog.Description"},u.createElement(rt,{initialFocus:s,containers:U,features:V?me(X,{parent:rt.features.RestoreFocus,leaf:rt.features.All&~rt.features.FocusLock}):rt.features.None},u.createElement(D,null,de({ourProps:Z,theirProps:m,slot:L,defaultTag:Bs,features:zs,visible:y===0,name:"Dialog"}))))))))),u.createElement(R,null))}let Us="div";function Hs(e,n){let t=be(),{id:r=`headlessui-dialog-overlay-${t}`,...o}=e,[{dialogState:l,close:s}]=st("Dialog.Overlay"),i=pe(n),a=A(d=>{if(d.target===d.currentTarget){if(gt(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),s()}}),m=u.useMemo(()=>({open:l===0}),[l]);return de({ourProps:{ref:i,id:r,"aria-hidden":!0,onClick:a},theirProps:o,slot:m,defaultTag:Us,name:"Dialog.Overlay"})}let Vs="div";function Ys(e,n){let t=be(),{id:r=`headlessui-dialog-backdrop-${t}`,...o}=e,[{dialogState:l},s]=st("Dialog.Backdrop"),i=pe(n);u.useEffect(()=>{if(s.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let a=u.useMemo(()=>({open:l===0}),[l]);return u.createElement(Vt,{force:!0},u.createElement(qt,null,de({ourProps:{ref:i,id:r,"aria-hidden":!0},theirProps:o,slot:a,defaultTag:Vs,name:"Dialog.Backdrop"})))}let qs="div";function Gs(e,n){let t=be(),{id:r=`headlessui-dialog-panel-${t}`,...o}=e,[{dialogState:l},s]=st("Dialog.Panel"),i=pe(n,s.panelRef),a=u.useMemo(()=>({open:l===0}),[l]),m=A(d=>{d.stopPropagation()});return de({ourProps:{ref:i,id:r,onClick:m},theirProps:o,slot:a,defaultTag:qs,name:"Dialog.Panel"})}let Ks="h2";function Zs(e,n){let t=be(),{id:r=`headlessui-dialog-title-${t}`,...o}=e,[{dialogState:l,setTitleId:s}]=st("Dialog.Title"),i=pe(n);u.useEffect(()=>(s(r),()=>s(null)),[r,s]);let a=u.useMemo(()=>({open:l===0}),[l]);return de({ourProps:{ref:i,id:r},theirProps:o,slot:a,defaultTag:Ks,name:"Dialog.Title"})}let Xs=fe(Ws),Js=fe(Ys),Qs=fe(Gs),el=fe(Hs),tl=fe(Zs),Xn=Object.assign(Xs,{Backdrop:Js,Panel:Qs,Overlay:el,Title:tl,Description:Zn}),Jn=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Qn(e){var n,t;let r=(n=e.innerText)!=null?n:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let l=!1;for(let i of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))i.remove(),l=!0;let s=l?(t=o.innerText)!=null?t:"":r;return Jn.test(s)&&(s=s.replace(Jn,"")),s}function nl(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(o=>{let l=document.getElementById(o);if(l){let s=l.getAttribute("aria-label");return typeof s=="string"?s.trim():Qn(l).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Qn(e).trim()}function rl(e){let n=u.useRef(""),t=u.useRef("");return A(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(n.current===o)return t.current;let l=nl(r).trim().toLowerCase();return n.current=o,t.current=l,l})}var ol=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ol||{}),sl=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(sl||{}),ll=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(ll||{});function Jt(e,n=t=>t){let t=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=At(n(e.items.slice()),l=>l.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let il={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,n)=>{var t;let r=Jt(e),o=zt(n,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:(t=n.trigger)!=null?t:1}},3:(e,n)=>{let t=e.searchQuery!==""?0:1,r=e.searchQuery+n.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+t).concat(e.items.slice(0,e.activeItemIndex+t)):e.items).find(s=>{var i;return((i=s.dataRef.current.textValue)==null?void 0:i.startsWith(r))&&!s.dataRef.current.disabled}),l=o?e.items.indexOf(o):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:l,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,n)=>{let t=Jt(e,r=>[...r,{id:n.id,dataRef:n.dataRef}]);return{...e,...t}},6:(e,n)=>{let t=Jt(e,r=>{let o=r.findIndex(l=>l.id===n.id);return o!==-1&&r.splice(o,1),r});return{...e,...t,activationTrigger:1}}},Qt=u.createContext(null);Qt.displayName="MenuContext";function bt(e){let n=u.useContext(Qt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,bt),t}return n}function al(e,n){return me(n.type,il,e,n)}let ul=u.Fragment;function cl(e,n){let{__demoMode:t=!1,...r}=e,o=u.useReducer(al,{__demoMode:t,menuState:t?0:1,buttonRef:u.createRef(),itemsRef:u.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:l,itemsRef:s,buttonRef:i},a]=o,m=pe(n);Dt([i,s],(f,v)=>{var g;a({type:1}),Mt(v,Pt.Loose)||(f.preventDefault(),(g=i.current)==null||g.focus())},l===0);let d=A(()=>{a({type:1})}),h=u.useMemo(()=>({open:l===0,close:d}),[l,d]),x={ref:m};return u.createElement(Qt.Provider,{value:o},u.createElement(Bt,{value:me(l,{0:he.Open,1:he.Closed})},de({ourProps:x,theirProps:r,slot:h,defaultTag:ul,name:"Menu"})))}let dl="button";function fl(e,n){var t;let r=be(),{id:o=`headlessui-menu-button-${r}`,...l}=e,[s,i]=bt("Menu.Button"),a=pe(s.buttonRef,n),m=ke(),d=A(g=>{switch(g.key){case re.Space:case re.Enter:case re.ArrowDown:g.preventDefault(),g.stopPropagation(),i({type:0}),m.nextFrame(()=>i({type:2,focus:le.First}));break;case re.ArrowUp:g.preventDefault(),g.stopPropagation(),i({type:0}),m.nextFrame(()=>i({type:2,focus:le.Last}));break}}),h=A(g=>{switch(g.key){case re.Space:g.preventDefault();break}}),x=A(g=>{if(gt(g.currentTarget))return g.preventDefault();e.disabled||(s.menuState===0?(i({type:1}),m.nextFrame(()=>{var b;return(b=s.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})})):(g.preventDefault(),i({type:0})))}),f=u.useMemo(()=>({open:s.menuState===0}),[s]),v={ref:a,id:o,type:Lt(e,s.buttonRef),"aria-haspopup":"menu","aria-controls":(t=s.itemsRef.current)==null?void 0:t.id,"aria-expanded":s.menuState===0,onKeyDown:d,onKeyUp:h,onClick:x};return de({ourProps:v,theirProps:l,slot:f,defaultTag:dl,name:"Menu.Button"})}let ml="div",pl=Me.RenderStrategy|Me.Static;function hl(e,n){var t,r;let o=be(),{id:l=`headlessui-menu-items-${o}`,...s}=e,[i,a]=bt("Menu.Items"),m=pe(i.itemsRef,n),d=_e(i.itemsRef),h=ke(),x=Qe(),f=x!==null?(x&he.Open)===he.Open:i.menuState===0;u.useEffect(()=>{let w=i.itemsRef.current;w&&i.menuState===0&&w!==(d==null?void 0:d.activeElement)&&w.focus({preventScroll:!0})},[i.menuState,i.itemsRef,d]),Pn({container:i.itemsRef.current,enabled:i.menuState===0,accept(w){return w.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:w.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(w){w.setAttribute("role","none")}});let v=A(w=>{var y,k;switch(h.dispose(),w.key){case re.Space:if(i.searchQuery!=="")return w.preventDefault(),w.stopPropagation(),a({type:3,value:w.key});case re.Enter:if(w.preventDefault(),w.stopPropagation(),a({type:1}),i.activeItemIndex!==null){let{dataRef:$}=i.items[i.activeItemIndex];(k=(y=$.current)==null?void 0:y.domRef.current)==null||k.click()}Cn(i.buttonRef.current);break;case re.ArrowDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Next});case re.ArrowUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Previous});case re.Home:case re.PageUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.First});case re.End:case re.PageDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:le.Last});case re.Escape:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{var $;return($=i.buttonRef.current)==null?void 0:$.focus({preventScroll:!0})});break;case re.Tab:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{co(i.buttonRef.current,w.shiftKey?Ie.Previous:Ie.Next)});break;default:w.key.length===1&&(a({type:3,value:w.key}),h.setTimeout(()=>a({type:4}),350));break}}),g=A(w=>{switch(w.key){case re.Space:w.preventDefault();break}}),b=u.useMemo(()=>({open:i.menuState===0}),[i]),E={"aria-activedescendant":i.activeItemIndex===null||(t=i.items[i.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(r=i.buttonRef.current)==null?void 0:r.id,id:l,onKeyDown:v,onKeyUp:g,role:"menu",tabIndex:0,ref:m};return de({ourProps:E,theirProps:s,slot:b,defaultTag:ml,features:pl,visible:f,name:"Menu.Items"})}let vl=u.Fragment;function gl(e,n){let t=be(),{id:r=`headlessui-menu-item-${t}`,disabled:o=!1,...l}=e,[s,i]=bt("Menu.Item"),a=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===r:!1,m=u.useRef(null),d=pe(n,m);se(()=>{if(s.__demoMode||s.menuState!==0||!a||s.activationTrigger===0)return;let $=Ee();return $.requestAnimationFrame(()=>{var _,W;(W=(_=m.current)==null?void 0:_.scrollIntoView)==null||W.call(_,{block:"nearest"})}),$.dispose},[s.__demoMode,m,a,s.menuState,s.activationTrigger,s.activeItemIndex]);let h=rl(m),x=u.useRef({disabled:o,domRef:m,get textValue(){return h()}});se(()=>{x.current.disabled=o},[x,o]),se(()=>(i({type:5,id:r,dataRef:x}),()=>i({type:6,id:r})),[x,r]);let f=A(()=>{i({type:1})}),v=A($=>{if(o)return $.preventDefault();i({type:1}),Cn(s.buttonRef.current)}),g=A(()=>{if(o)return i({type:2,focus:le.Nothing});i({type:2,focus:le.Specific,id:r})}),b=Fn(),E=A($=>b.update($)),w=A($=>{b.wasMoved($)&&(o||a||i({type:2,focus:le.Specific,id:r,trigger:0}))}),y=A($=>{b.wasMoved($)&&(o||a&&i({type:2,focus:le.Nothing}))}),k=u.useMemo(()=>({active:a,disabled:o,close:f}),[a,o,f]);return de({ourProps:{id:r,ref:d,role:"menuitem",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,disabled:void 0,onClick:v,onFocus:g,onPointerEnter:E,onMouseEnter:E,onPointerMove:w,onMouseMove:w,onPointerLeave:y,onMouseLeave:y},theirProps:l,slot:k,defaultTag:vl,name:"Menu.Item"})}let xl=fe(cl),bl=fe(fl),wl=fe(hl),yl=fe(gl),wt=Object.assign(xl,{Button:bl,Items:wl,Item:yl}),er=u.createContext(null);function tr(){let e=u.useContext(er);if(e===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,tr),n}return e}function El(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=A(l=>(n(s=>[...s,l]),()=>n(s=>{let i=s.slice(),a=i.indexOf(l);return a!==-1&&i.splice(a,1),i}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(er.Provider,{value:o},t.children)},[n])]}let Sl="label";function jl(e,n){let t=be(),{id:r=`headlessui-label-${t}`,passive:o=!1,...l}=e,s=tr(),i=pe(n);se(()=>s.register(r),[r,s.register]);let a={ref:i,...s.props,id:r};return o&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in l&&delete l.onClick),de({ourProps:a,theirProps:l,slot:s.slot||{},defaultTag:Sl,name:s.name||"Label"})}let Cl=fe(jl),Tl=Object.assign(Cl,{});function Nl(e=0){let[n,t]=u.useState(e),r=tt(),o=u.useCallback(a=>{r.current&&t(m=>m|a)},[n,r]),l=u.useCallback(a=>!!(n&a),[n]),s=u.useCallback(a=>{r.current&&t(m=>m&~a)},[t,r]),i=u.useCallback(a=>{r.current&&t(m=>m^a)},[t]);return{flags:n,addFlag:o,hasFlag:l,removeFlag:s,toggleFlag:i}}let en=u.createContext(null);en.displayName="GroupContext";let Ol=u.Fragment;function kl(e){var n;let[t,r]=u.useState(null),[o,l]=El(),[s,i]=Kn(),a=u.useMemo(()=>({switch:t,setSwitch:r,labelledby:o,describedby:s}),[t,r,o,s]),m={},d=e;return u.createElement(i,{name:"Switch.Description"},u.createElement(l,{name:"Switch.Label",props:{htmlFor:(n=a.switch)==null?void 0:n.id,onClick(h){t&&(h.currentTarget.tagName==="LABEL"&&h.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},u.createElement(en.Provider,{value:a},de({ourProps:m,theirProps:d,defaultTag:Ol,name:"Switch.Group"}))))}let Il="button";function $l(e,n){var t;let r=be(),{id:o=`headlessui-switch-${r}`,checked:l,defaultChecked:s=!1,onChange:i,disabled:a=!1,name:m,value:d,form:h,...x}=e,f=u.useContext(en),v=u.useRef(null),g=pe(v,n,f===null?null:f.setSwitch),[b,E]=yn(l,i,s),w=A(()=>E==null?void 0:E(!b)),y=A(z=>{if(gt(z.currentTarget))return z.preventDefault();z.preventDefault(),w()}),k=A(z=>{z.key===re.Space?(z.preventDefault(),w()):z.key===re.Enter&&wo(z.currentTarget)}),$=A(z=>z.preventDefault()),_=u.useMemo(()=>({checked:b}),[b]),W={id:o,ref:g,role:"switch",type:Lt(e,v),tabIndex:e.tabIndex===-1?0:(t=e.tabIndex)!=null?t:0,"aria-checked":b,"aria-labelledby":f==null?void 0:f.labelledby,"aria-describedby":f==null?void 0:f.describedby,disabled:a,onClick:y,onKeyUp:k,onKeyPress:$},V=ke();return u.useEffect(()=>{var z;let C=(z=v.current)==null?void 0:z.closest("form");C&&s!==void 0&&V.addEventListener(C,"reset",()=>{E(s)})},[v,E]),u.createElement(u.Fragment,null,m!=null&&b&&u.createElement(Je,{features:He.Hidden,...vt({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:a,form:h,checked:b,name:m,value:d})}),de({ourProps:W,theirProps:x,slot:_,defaultTag:Il,name:"Switch"}))}let Fl=fe($l),Pl=kl,Ml=Object.assign(Fl,{Group:Pl,Label:Tl,Description:Zn});function Al(e){let n={called:!1};return(...t)=>{if(!n.called)return n.called=!0,e(...t)}}function tn(e,...n){e&&n.length>0&&e.classList.add(...n)}function nn(e,...n){e&&n.length>0&&e.classList.remove(...n)}function Dl(e,n){let t=Ee();if(!e)return t.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[l,s]=[r,o].map(a=>{let[m=0]=a.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,h)=>h-d);return m}),i=l+s;if(i!==0){t.group(m=>{m.setTimeout(()=>{n(),m.dispose()},i),m.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&m.dispose()})});let a=t.addEventListener(e,"transitionend",m=>{m.target===m.currentTarget&&(n(),a())})}else n();return t.add(()=>n()),t.dispose}function Ll(e,n,t,r){let o=t?"enter":"leave",l=Ee(),s=r!==void 0?Al(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let i=me(o,{enter:()=>n.enter,leave:()=>n.leave}),a=me(o,{enter:()=>n.enterTo,leave:()=>n.leaveTo}),m=me(o,{enter:()=>n.enterFrom,leave:()=>n.leaveFrom});return nn(e,...n.base,...n.enter,...n.enterTo,...n.enterFrom,...n.leave,...n.leaveFrom,...n.leaveTo,...n.entered),tn(e,...n.base,...i,...m),l.nextFrame(()=>{nn(e,...n.base,...i,...m),tn(e,...n.base,...i,...a),Dl(e,()=>(nn(e,...n.base,...i),tn(e,...n.base,...n.entered),s()))}),l.dispose}function _l({immediate:e,container:n,direction:t,classes:r,onStart:o,onStop:l}){let s=tt(),i=ke(),a=Ce(t);se(()=>{e&&(a.current="enter")},[e]),se(()=>{let m=Ee();i.add(m.dispose);let d=n.current;if(d&&a.current!=="idle"&&s.current)return m.dispose(),o.current(a.current),m.add(Ll(d,r.current,a.current==="enter",()=>{m.dispose(),l.current(a.current)})),m.dispose},[t])}function De(e=""){return e.split(/\s+/).filter(n=>n.length>1)}let yt=u.createContext(null);yt.displayName="TransitionContext";var Rl=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Rl||{});function Bl(){let e=u.useContext(yt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function zl(){let e=u.useContext(Et);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Et=u.createContext(null);Et.displayName="NestingContext";function St(e){return"children"in e?St(e.children):e.current.filter(({el:n})=>n.current!==null).filter(({state:n})=>n==="visible").length>0}function nr(e,n){let t=Ce(e),r=u.useRef([]),o=tt(),l=ke(),s=A((f,v=Ae.Hidden)=>{let g=r.current.findIndex(({el:b})=>b===f);g!==-1&&(me(v,{[Ae.Unmount](){r.current.splice(g,1)},[Ae.Hidden](){r.current[g].state="hidden"}}),l.microTask(()=>{var b;!St(r)&&o.current&&((b=t.current)==null||b.call(t))}))}),i=A(f=>{let v=r.current.find(({el:g})=>g===f);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:f,state:"visible"}),()=>s(f,Ae.Unmount)}),a=u.useRef([]),m=u.useRef(Promise.resolve()),d=u.useRef({enter:[],leave:[],idle:[]}),h=A((f,v,g)=>{a.current.splice(0),n&&(n.chains.current[v]=n.chains.current[v].filter(([b])=>b!==f)),n==null||n.chains.current[v].push([f,new Promise(b=>{a.current.push(b)})]),n==null||n.chains.current[v].push([f,new Promise(b=>{Promise.all(d.current[v].map(([E,w])=>w)).then(()=>b())})]),v==="enter"?m.current=m.current.then(()=>n==null?void 0:n.wait.current).then(()=>g(v)):g(v)}),x=A((f,v,g)=>{Promise.all(d.current[v].splice(0).map(([b,E])=>E)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>g(v))});return u.useMemo(()=>({children:r,register:i,unregister:s,onStart:h,onStop:x,wait:m,chains:d}),[i,s,r,h,x,d,m])}function Wl(){}let Ul=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function rr(e){var n;let t={};for(let r of Ul)t[r]=(n=e[r])!=null?n:Wl;return t}function Hl(e){let n=u.useRef(rr(e));return u.useEffect(()=>{n.current=rr(e)},[e]),n}let Vl="div",or=Me.RenderStrategy;function Yl(e,n){var t,r;let{beforeEnter:o,afterEnter:l,beforeLeave:s,afterLeave:i,enter:a,enterFrom:m,enterTo:d,entered:h,leave:x,leaveFrom:f,leaveTo:v,...g}=e,b=u.useRef(null),E=pe(b,n),w=(t=g.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:y,appear:k,initial:$}=Bl(),[_,W]=u.useState(y?"visible":"hidden"),V=zl(),{register:z,unregister:C}=V;u.useEffect(()=>z(b),[z,b]),u.useEffect(()=>{if(w===Ae.Hidden&&b.current){if(y&&_!=="visible"){W("visible");return}return me(_,{hidden:()=>C(b),visible:()=>z(b)})}},[_,b,z,C,y,w]);let P=Ce({base:De(g.className),enter:De(a),enterFrom:De(m),enterTo:De(d),entered:De(h),leave:De(x),leaveFrom:De(f),leaveTo:De(v)}),D=Hl({beforeEnter:o,afterEnter:l,beforeLeave:s,afterLeave:i}),B=Ue();u.useEffect(()=>{if(B&&_==="visible"&&b.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[b,_,B]);let U=$&&!k,S=k&&y&&$,R=!B||U?"idle":y?"enter":"leave",X=Nl(0),j=A(ae=>me(ae,{enter:()=>{X.addFlag(he.Opening),D.current.beforeEnter()},leave:()=>{X.addFlag(he.Closing),D.current.beforeLeave()},idle:()=>{}})),F=A(ae=>me(ae,{enter:()=>{X.removeFlag(he.Opening),D.current.afterEnter()},leave:()=>{X.removeFlag(he.Closing),D.current.afterLeave()},idle:()=>{}})),H=nr(()=>{W("hidden"),C(b)},V),J=u.useRef(!1);_l({immediate:S,container:b,classes:P,direction:R,onStart:Ce(ae=>{J.current=!0,H.onStart(b,ae,j)}),onStop:Ce(ae=>{J.current=!1,H.onStop(b,ae,F),ae==="leave"&&!St(H)&&(W("hidden"),C(b))})});let ne=g,ie={ref:E};return S?ne={...ne,className:pt(g.className,...P.current.enter,...P.current.enterFrom)}:J.current&&(ne.className=pt(g.className,(r=b.current)==null?void 0:r.className),ne.className===""&&delete ne.className),u.createElement(Et.Provider,{value:H},u.createElement(Bt,{value:me(_,{visible:he.Open,hidden:he.Closed})|X.flags},de({ourProps:ie,theirProps:ne,defaultTag:Vl,features:or,visible:_==="visible",name:"Transition.Child"})))}function ql(e,n){let{show:t,appear:r=!1,unmount:o=!0,...l}=e,s=u.useRef(null),i=pe(s,n);Ue();let a=Qe();if(t===void 0&&a!==null&&(t=(a&he.Open)===he.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[m,d]=u.useState(t?"visible":"hidden"),h=nr(()=>{d("hidden")}),[x,f]=u.useState(!0),v=u.useRef([t]);se(()=>{x!==!1&&v.current[v.current.length-1]!==t&&(v.current.push(t),f(!1))},[v,t]);let g=u.useMemo(()=>({show:t,appear:r,initial:x}),[t,r,x]);u.useEffect(()=>{if(t)d("visible");else if(!St(h))d("hidden");else{let y=s.current;if(!y)return;let k=y.getBoundingClientRect();k.x===0&&k.y===0&&k.width===0&&k.height===0&&d("hidden")}},[t,h]);let b={unmount:o},E=A(()=>{var y;x&&f(!1),(y=e.beforeEnter)==null||y.call(e)}),w=A(()=>{var y;x&&f(!1),(y=e.beforeLeave)==null||y.call(e)});return u.createElement(Et.Provider,{value:h},u.createElement(yt.Provider,{value:g},de({ourProps:{...b,as:u.Fragment,children:u.createElement(sr,{ref:i,...b,...l,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:u.Fragment,features:or,visible:m==="visible",name:"Transition"})))}function Gl(e,n){let t=u.useContext(yt)!==null,r=Qe()!==null;return u.createElement(u.Fragment,null,!t&&r?u.createElement(rn,{ref:n,...e}):u.createElement(sr,{ref:n,...e}))}let rn=fe(ql),sr=fe(Yl),Kl=fe(Gl),Le=Object.assign(rn,{Child:Kl,Root:rn});function Zl({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z",clipRule:"evenodd"}))}const Xl=T.forwardRef(Zl);function Jl({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z",clipRule:"evenodd"}))}const Ql=T.forwardRef(Jl);function ei({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const ti=T.forwardRef(ei);function ni({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const ri=T.forwardRef(ni);function oi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const on=T.forwardRef(oi);function si({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const lr=T.forwardRef(si);function li({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const ii=T.forwardRef(li);function ai({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const ui=T.forwardRef(ai);function ci({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",clipRule:"evenodd"}))}const di=T.forwardRef(ci),fi={warning:{color:"bg-yellow-50",icon:c.jsx(ii,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"}),colorTitle:"text-yellow-800",colorText:"text-yellow-700"},error:{color:"bg-red-50",icon:c.jsx(di,{className:"h-5 w-5 text-red-400","aria-hidden":"true"}),colorTitle:"text-red-800",colorText:"text-red-700"},success:{color:"bg-green-50",icon:c.jsx(ti,{className:"h-5 w-5 text-green-400","aria-hidden":"true"}),colorTitle:"text-green-800",colorText:"text-green-700"},info:{color:"bg-blue-50",icon:c.jsx(ui,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},mi=({type:e="info",title:n,message:t,active:r=!1,time:o=1e3,onClose:l})=>{const[s,i]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(r&&(i(!0),a.current=setTimeout(()=>{i(!1),l&&l()},o)),()=>clearTimeout(a.current)),[r,o,l]);const m=fi[e];return s?c.jsx("div",{className:"fixed top-2.5 left-1/2 transform -translate-x-1/2 w-80 3xs:w-96 z-50",children:c.jsx(Le,{as:u.Fragment,show:s,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:c.jsxs("div",{className:I("rounded-md p-4 text-center",m.color),children:[c.jsxs("div",{className:"flex justify-center flex-shrink-0",children:[m.icon,c.jsx("h3",{className:I("text-sm font-medium ml-3",m.colorTitle),children:n})]}),c.jsx("div",{className:I("mt-2 text-sm",m.colorText),children:c.jsx("p",{children:t})})]})})}):null};function pi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M11.47 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06l-3.22-3.22V16.5a.75.75 0 0 1-1.5 0V4.81L8.03 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5ZM3 15.75a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const ir=T.forwardRef(pi);function hi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))}const vi=T.forwardRef(hi);function gi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const xi=T.forwardRef(gi);function bi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),T.createElement("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"}))}const wi=T.forwardRef(bi);function yi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z",clipRule:"evenodd"}))}const Ei=T.forwardRef(yi);function Si({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const ar=T.forwardRef(Si),ji=({src:e,alt:n,width:t,height:r,className:o="",classNameIcon:l="",isIcon:s=!0,acronym:i=""})=>{function a(){if(typeof i!="string")return i;const m=i.toLowerCase(),d=m.split(" "),h=d[d.length-1];return m.charAt(0)+h.charAt(0)}return c.jsx(c.Fragment,{children:e?c.jsx("img",{src:e,alt:n,width:t,height:r,className:I(o!==""&&o),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s"},onLoad:m=>m.currentTarget.style.filter="none","data-testid":"img"}):s?c.jsx(Ei,{className:I("bg-white text-default-4",l!==""?l:"w-7 h-7")}):c.jsx("div",{className:I("bg-gray-200 text-default-4 rounded-full font-bold uppercase flex justify-center items-center",l!==""?l:"w-7 h-7"),children:a()})})},Ci=({steps:e,onClick:n})=>{const[t,r]=u.useState(0),o=l=>{r(l),n(l)};return c.jsx("nav",{className:"flex items-center justify-center w-full","aria-label":"Progress","data-testid":"bullets",children:c.jsx("ol",{role:"list",className:"flex items-center space-x-5",children:new Array(e).fill(1).map((l,s)=>c.jsx("li",{children:t!==s?c.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>o(s),"data-testid":`step-${s}`,children:c.jsx("span",{className:"sr-only",children:"step"})}):c.jsxs("div",{className:"relative flex items-center justify-center cursor-pointer","aria-current":"step",children:[c.jsx("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true",children:c.jsx("span",{className:"h-full w-full rounded-full bg-gray-300"})}),c.jsx("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-gray-500","aria-hidden":"true"}),c.jsx("span",{className:"sr-only",children:"step"})]})},s))})})};var ur={exports:{}};/*!
|
|
32
32
|
Copyright (c) 2018 Jed Watson.
|
|
33
33
|
Licensed under the MIT License (MIT), see
|
|
34
34
|
http://jedwatson.github.io/classnames
|
|
35
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var l="",s=0;s<arguments.length;s++){var i=arguments[s];i&&(l=o(l,r(i)))}return l}function r(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return t.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var s="";for(var i in l)n.call(l,i)&&l[i]&&(s=o(s,i));return s}function o(l,s){return s?l?l+" "+s:l+s:l}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ur);var Ti=ur.exports;const Te=Rr(Ti),cr=({className:e="text-sm w-full rounded-md",children:n,icon:t=null,edge:r=null,disabled:o=!1,type:l="button",onClick:s,id:i})=>{const a=Te({"ml-2":r==="start"&&t!==null,"mr-2":r==="end"&&t!==null});return c.jsxs("button",{className
|
|
35
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var l="",s=0;s<arguments.length;s++){var i=arguments[s];i&&(l=o(l,r(i)))}return l}function r(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return t.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var s="";for(var i in l)n.call(l,i)&&l[i]&&(s=o(s,i));return s}function o(l,s){return s?l?l+" "+s:l+s:l}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ur);var Ti=ur.exports;const Te=Rr(Ti),cr=({className:e="text-sm w-full rounded-md",children:n,icon:t=null,edge:r=null,disabled:o=!1,type:l="button",onClick:s,id:i})=>{const a=Te({"ml-2":r==="start"&&t!==null,"mr-2":r==="end"&&t!==null});return c.jsxs("button",{className:I("flex justify-center items-center bg-white px-3 py-7px font-medium leading-6 shadow-sm ring-1 ring-inset ring-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-7 bg-gray-50",e),type:l,onClick:s,disabled:o,"data-testid":`button-outline-${i}`,id:`button-outline-${i}`,children:[r==="start"&&t!==null&&c.jsx("span",{children:t}),c.jsx("span",{className:I("flex",a),id:i,children:n}),r==="end"&&t!==null&&c.jsx("span",{children:t})]})},dr=({children:e,className:n="",icon:t=null,edge:r=null,disabled:o=!1,type:l="button",onClick:s,id:i})=>{const a=Te({"ml-2":r==="start"&&t!==null,"mr-2":r==="end"&&t!==null});return c.jsxs("button",{className:`${n} flex justify-center items-center`,edge:r,type:l,onClick:s,disabled:o,"data-testid":`button-${i}`,children:[r==="start"&&t!==null&&c.jsx("span",{children:t}),c.jsx("span",{className:a,children:e}),r==="end"&&t!==null&&c.jsx("span",{children:t})]})},fr={py:/^py-\d+(\.\d+)?$/,px:/^px-\d+(\.\d+)?$/,w:/^w-.+$/,rounded:/^rounded.*$/,text:/^(text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)|text-\d+)$/,font:/^(font-thin|font-extralight|font-light|font-normal|font-medium|font-semibold|font-bold|font-extrabold|font-black)$/},mr=(e="",n="")=>{const t=e.split(/\s+/),r=n.split(/\s+/),o=Object.entries(fr).filter(([s,i])=>r.some(a=>i.test(a))).map(([s])=>s);return[...t.filter(s=>!o.some(i=>fr[i].test(s))),...r].join(" ")},lt=({children:e,classNameButton:n="bg-primary-7 hover:bg-primary-8 focus:outline-none focus:ring-2 focus:ring-primary-9 focus:ring-offset-2 focus:ring-offset-white shadow-primary-6 rounded font-semibold py-1.5 px-3 text-white w-full",classNameDisabled:t="",classNameText:r="",icon:o=null,edge:l=null,disabled:s=!1,type:i="button",onClick:a,id:m,classNameContainer:d=""})=>{const h="flex items-center justify-center leading-6 transition text-sm px-3 py-1.5 rounded w-full",x=`
|
|
36
36
|
bg-gray-300
|
|
37
37
|
text-white
|
|
38
38
|
cursor-not-allowed
|
|
39
39
|
shadow-none
|
|
40
40
|
focus:outline-none
|
|
41
41
|
focus:ring-0
|
|
42
|
-
`,f=Te({"ml-2":l==="start"&&o!==null,"mr-2":l==="end"&&o!==null}),v=()=>{a&&a()},g=s?$(mr(h,t),x):$(mr(h,n));return c.jsx("div",{className:$("rounded-md p-0.5",d!==""&&d),"data-testid":"container-button",children:c.jsxs("button",{className:g,type:i,onClick:v,disabled:s,"data-testid":`button-solid-${m}`,children:[l==="start"&&o!==null&&c.jsx("span",{className:"flex",children:o}),c.jsx("span",{className:$(r.length===0&&f,r.length!==0&&r),children:e}),l==="end"&&o!==null&&c.jsx("span",{children:o})]})})},Ni=({label:e=null,checked:n=!1,onChange:t,id:r,className:o="",classNameCheckbox:l="h-4 w-4",style:s={},disabled:i=!1})=>{const[a,m]=u.useState(!1);return u.useEffect(()=>{m(n)},[n]),c.jsxs("div",{className:"flex items-center",style:s,"data-testid":`container-check-${r}`,children:[c.jsx("input",{checked:a,id:`${e}-${r}`,value:r,"aria-describedby":"comments-description",type:"checkbox",onChange:t,className:$("cursor-pointer rounded border-gray-300 text-primary-7 focus:ring-primary-7",l!==""&&l),"data-testid":`checkbox-${r}`,disabled:i}),e!==null?c.jsx("label",{htmlFor:`${e}-${r}`,className:`ml-2.5 font-normal cursor-pointer ${o}`,id:`label-${r}`,"data-testid":"label",children:e}):null]})};function Oi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const ki=C.forwardRef(Oi);function Ii({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const pr=C.forwardRef(Ii);function $i({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Fi=C.forwardRef($i);function Pi({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Mi=C.forwardRef(Pi);function Ai({title:e,titleId:n,...t},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?C.createElement("title",{id:n},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const Di=C.forwardRef(Ai);function hr({children:e,className:n="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:t="",isOpen:r=!1,setIsOpen:o,showIconSuccess:l=!0,showButton:s=!0,style:i={}}){return c.jsx(Le,{show:r,as:u.Fragment,children:c.jsxs(Xn,{as:"div",className:"z-50 relative",onClose:o,"data-testid":"modal",children:[c.jsx(Le.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-5",leave:"ease-in duration-200",leaveFrom:"opacity-5",leaveTo:"opacity-0",children:c.jsx("div",{className:"fixed inset-0 bg-opacity-40 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>o(!1)})}),c.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:c.jsx("div",{className:"flex min-h-full items-center justify-center xs:p-2 p-4 text-center sm:items-center sm:p-0",children:c.jsx(Le.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:c.jsxs(Xn.Panel,{className:$("relative transform rounded-lg bg-white px-4 pb-3 pt-5 text-left transition-all sm:w-full sm:pt-3 sm:px-3",n!==""&&n),style:i,children:[l&&c.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:c.jsx(ki,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),c.jsx("div",{className:$(t!==""&&t),"data-testid":"content",children:e}),s&&c.jsx("div",{className:"mt-5 sm:mt-6",children:c.jsx(lt,{id:"close-modal",onClick:()=>o(!1),children:"Cerrar"})}),c.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const Li=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:n,close:t,title:r="¿Estás seguro de abandonar la creación de la acción?",description:o="La información se perderá si no creas la acción",classNameTitle:l="",classNameDescription:s=""})=>{const i=()=>{n(!1),t()};return c.jsxs(hr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[c.jsx("p",{className:$("text-center text-sm",l!==""&&l),children:r}),c.jsx("p",{className:$("text-center text-sm",s!==""&&s),children:o}),c.jsxs("div",{className:"flex w-full justify-center mt-5",children:[c.jsx(cr,{className:"rounded-md bg-white text-gray-500 text-sm shadow-sm ring-1 ring-inset ring-gray-300 bg-gray-50 w-24 h-9 mr-6",onClick:()=>n(),id:"cancel",children:"Cancelar"}),c.jsx(lt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 focus-visible:outline-secondary-2 shadow-secondary-2 rounded py-1.5 text-white w-full px-5",outline:"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",onClick:i,id:"confirmation",children:"Aceptar"})]})]})},_i=({className:e="",style:n={}})=>c.jsx("div",{className:$("w-px",e!==""&&e),style:n}),Ri=({onClick:e,id:n="",className:t=""})=>c.jsxs("div",{className:$("flex items-center text-default-4",t!==""&&t),"data-testid":n,children:[c.jsx(vi,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),c.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]}),sn=({children:e,childRef:n,message:t="",className:r="",classNameContainer:o="",style:l={}})=>{const[s,i]=u.useState(!1),[a,m]=u.useState({top:0,left:0}),d=u.useRef(null),h=()=>{if(!t)return;const g=d.current.getBoundingClientRect();m({top:g.bottom+window.scrollY,left:g.left+window.scrollX}),i(!0)},x=()=>i(!1),f=c.jsx(Le,{as:u.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",show:s,children:c.jsx("div",{className:$("absolute z-40 px-4 mt-0 sm:px-0",r),style:{top:a.top,left:a.left,position:"absolute"},children:c.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:h,onMouseLeave:x,children:typeof t=="object"?"":t})})}),v=n?u.cloneElement(e,{ref:n}):e;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:d,className:$("inline-block",o),onMouseEnter:h,onMouseLeave:x,style:l,children:v}),typeof window<"u"&&Tt.createPortal(f,document.body)]})},it=u.forwardRef((e,n)=>{const{placeholder:t="",label:r="",htmlFor:o,type:l="text",name:s,handleChange:i,onClick:a=()=>{},value:m,isReadOnly:d=!1,isError:h=!1,helperText:x="",autocomplete:f="off",id:v,classNameLabel:g="",classNameContainerInput:b="",classNameContainer:E="",className:w="",icon:y=null,onKeyDown:O,onFocus:F,min:D,maxWidth:U=5e3,onPaste:V}=e,[z,_]=u.useState(!1),k=Te({"ring-red-300 focus:ring-red-300 text-red-900":h||z,"focus:ring-primary-7 text-gray-500":!h&&!z}),L=R=>{if(i&&i(R),l!=="email")return;const{value:W}=R.target,S=pn(W);_(!S)};return c.jsxs("div",{"data-testid":`container-input-${v}`,className:E,children:[r!==""&&c.jsx("label",{htmlFor:o,className:$("block text-sm font-medium leading-6",!g.includes("mb-")&&"mb-0.5",g!==""?g:"text-gray-700"),"data-testid":`label-${v}`,children:r}),c.jsxs("div",{className:$("relative rounded-md",b!==""&&b),children:[c.jsx(sn,{message:l==="password"?"":m,childRef:n,className:"text-sm",classNameContainer:"w-full",children:c.jsx("input",{id:v,name:s,type:l,autoComplete:f,placeholder:t,onChange:L,onClick:a,onKeyDown:O,onFocus:F,onPaste:V,value:m,readOnly:d,"data-testid":`input-${v}`,min:D,className:$("block w-full rounded-md border-0 py-1.5 shadow-sm placeholder-gray-300 ring-1 ring-gray-300 ring-inset focus:ring-1 focus:ring-inset text-sm sm:leading-6 truncate focus:outline-none",k,w!==""&&w),style:{maxWidth:`${U}px`},ref:n})}),y!==null&&c.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:y}),h&&y===null&&c.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:c.jsx(lr,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),x.length===0||!h?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${v}`,children:x})]})});it.displayName="Input";function at({className:e="w-6 h-6",colorSpinner:n="text-primary-9"}){return c.jsxs("svg",{className:$("fill-current animate-spin",e,n),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("circle",{className:$("opacity-25 stroke-current",n),cx:"12",cy:"12",r:"10",strokeWidth:"4",fill:"none"}),c.jsx("path",{d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function Bi(){return c.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-full h-screen overflow-hidden bg-stone-600 opacity-75 flex flex-col items-center justify-center","data-testid":"spinner",style:{zIndex:60},children:[c.jsx("div",{className:"inline-block h-12 w-12 animate-[spinner-grow_0.75s_linear_infinite] rounded-full bg-current align-[-0.125em] opacity-0 motion-reduce:animate-[spinner-grow_1.5s_linear_infinite]",role:"status"}),c.jsx(at,{className:"w-8 h-8 animate-spin text-primary-9"})]})}const vr=({height:e="36px",style:n={},styleMenu:t={},label:r="",onChange:o,isReadOnly:l=!1,isError:s=!1,helperText:i="",name:a,id:m,className:d="",classNameLabel:h="",classNameInput:x="",options:f,value:v=-1,defaultValue:g={value:-1,label:"",iconStart:null,iconEnd:null,selectedLabel:""},defaultLabel:b="label",defaultId:E="value",bgOptionSelect:w="bg-primary-7",isSearch:y=!1,loading:O=!1,isSingleOptionAndFirstLoad:F=!0,isTest:D=!1})=>{const U=u.useRef(!0),[V,z]=u.useState(""),[_,k]=u.useState(g),[L,R]=u.useState(!1);u.useEffect(()=>{if((f==null?void 0:f.length)!==1||!U.current)return;U.current=!1;const[j]=f,I=j[E],H=j[b];k({value:I,label:H}),F&&o({target:{value:j,checked:!1,name:a,type:void 0,id:j[E]}})},[f,E,b,o,a,F]),u.useEffect(()=>{if(v===-1||(f==null?void 0:f.length)===0)return;const j=f==null?void 0:f.find(H=>H[E]===v),I=j&&j.selectedLabel?{...j,label:j.selectedLabel}:j;I&&k(I)},[v,f,E]),u.useEffect(()=>{v==="clear"&&(_[E]!==g[E]||_[b]!==g[b]||D)&&k(g)},[g,D,_,v,E,b]);const W=V===""?f:f.filter(j=>j[b].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(V.toLowerCase())),S=Te({"ring-red-300 focus:ring-red-300 text-red-900":s&&!l,"text-gray-500":!s,"focus:ring-primary-7":!s&&!l}),B=Te({"text-red-400":s&&!l,"text-gray-400":!s}),Y=j=>{const I=j.selectedLabel?{...j,label:j.selectedLabel}:j;k(I),o({target:{value:I,checked:!1,name:a,type:void 0,id:j[E]}})};return c.jsxs($e,{as:"div",value:_,children:[c.jsx($e.Label,{className:$("block text-sm font-medium leading-6 text-gray-500 mb-0.5",h!==""&&h),children:r}),c.jsxs("div",{className:$("relative",d!==""&&d),children:[c.jsx(sn,{className:"text-sm",classNameContainer:"w-full",message:_[b],children:c.jsxs($e.Button,{className:"w-full","data-testid":`listbox-button-${m}`,children:[_.iconStart&&c.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:_.iconStart}),c.jsx($e.Input,{className:$("w-full rounded-md border-0 bg-white py-1.5 pr-10 text-gray-900 shadow-sm ring-1 ring-gray-300 sm:text-sm sm:leading-6 truncate block focus:outline-none",!s&&!l&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-primary-7",l&&"focus:ring-gray-300",S,x!==""&&x),onChange:j=>z(j.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:j=>{var I;return(I=j[b])==null?void 0:I.trim()},autoComplete:"off",readOnly:!y||l,style:{height:e,...n},"data-testid":"input-search",onClick:()=>R(l?!1:!L),onBlur:()=>R(!1)})]})}),_.iconEnd&&c.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:_.iconEnd}),!l&&c.jsx($e.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>R(l?!1:!L),"data-testid":"arrow-button",children:c.jsx(on,{className:$("h-5 w-5 ml-auto transition-transform","transform",L&&"rotate-180",B)})}),!l&&c.jsx(c.Fragment,{children:O?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none flex justify-center items-center py-2",children:c.jsx(at,{})}):(W??[]).length>0?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden",style:t,children:W.map((j,I)=>c.jsx($e.Option,{value:j,className:$(j[E]===_[E]?`${w} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${w}`),"data-testid":`select-${m}-${j[E]}`,onClick:()=>Y(j),children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center",children:[j.iconStart&&c.jsx("span",{className:"mr-2","aria-hidden":"true",children:j.iconStart}),c.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:j[b]})]}),j.iconEnd&&c.jsx("span",{className:"ml-2","aria-hidden":"true",children:j.iconEnd})]})},I))}):c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden flex justify-center items-center py-2",children:c.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),i.length>0&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${m}`,children:i})]})},zi=({isOpenMenu:e=null,placeholder:n="",label:t="",htmlFor:r,name:o,handleChange:l,onClick:s=()=>{},value:i,valueSelect:a,isReadOnly:m=!1,isError:d=!1,helperText:h="",autocomplete:x="on",id:f,classNameLabel:v="",classNameContainer:g="",className:b="",onKeyDown:E,options:w,idSelect:y,isMarginLeft:O=!0,classNameSelect:F="w-20",type:D="text"})=>{const U=u.useRef(null),V=u.useRef(null),{width:z}=vn(),[_,k]=u.useState(0);u.useEffect(()=>{if(!(!U.current||e===null))return V.current=window.setTimeout(()=>{const{offsetWidth:R}=U.current;k(R)},0),()=>window.clearTimeout(V.current)},[e]);const L=Te({"ring-red-300 focus:ring-red-300 text-red-900":d,"focus:ring-primary-7 text-gray-500":!d});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
42
|
+
`,f=Te({"ml-2":l==="start"&&o!==null,"mr-2":l==="end"&&o!==null}),v=()=>{a&&a()},g=s?I(mr(h,t),x):I(mr(h,n));return c.jsx("div",{className:I("rounded-md p-0.5",d!==""&&d),"data-testid":"container-button",children:c.jsxs("button",{className:g,type:i,onClick:v,disabled:s,"data-testid":`button-solid-${m}`,children:[l==="start"&&o!==null&&c.jsx("span",{className:"flex",children:o}),c.jsx("span",{className:I(r.length===0&&f,r.length!==0&&r),children:e}),l==="end"&&o!==null&&c.jsx("span",{children:o})]})})},Ni=({label:e=null,checked:n=!1,onChange:t,id:r,className:o="",classNameCheckbox:l="h-4 w-4",style:s={},disabled:i=!1})=>{const[a,m]=u.useState(!1);return u.useEffect(()=>{m(n)},[n]),c.jsxs("div",{className:"flex items-center",style:s,"data-testid":`container-check-${r}`,children:[c.jsx("input",{checked:a,id:`${e}-${r}`,value:r,"aria-describedby":"comments-description",type:"checkbox",onChange:t,className:I("cursor-pointer rounded border-gray-300 text-primary-7 focus:ring-primary-7",l!==""&&l),"data-testid":`checkbox-${r}`,disabled:i}),e!==null?c.jsx("label",{htmlFor:`${e}-${r}`,className:`ml-2.5 font-normal cursor-pointer ${o}`,id:`label-${r}`,"data-testid":"label",children:e}):null]})};function Oi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const ki=T.forwardRef(Oi);function Ii({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const pr=T.forwardRef(Ii);function $i({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Fi=T.forwardRef($i);function Pi({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Mi=T.forwardRef(Pi);function Ai({title:e,titleId:n,...t},r){return T.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?T.createElement("title",{id:n},e):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const Di=T.forwardRef(Ai);function hr({children:e,className:n="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:t="",isOpen:r=!1,setIsOpen:o,showIconSuccess:l=!0,showButton:s=!0,style:i={}}){return c.jsx(Le,{show:r,as:u.Fragment,children:c.jsxs(Xn,{as:"div",className:"z-50 relative",onClose:o,"data-testid":"modal",children:[c.jsx(Le.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-5",leave:"ease-in duration-200",leaveFrom:"opacity-5",leaveTo:"opacity-0",children:c.jsx("div",{className:"fixed inset-0 bg-opacity-40 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>o(!1)})}),c.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:c.jsx("div",{className:"flex min-h-full items-center justify-center xs:p-2 p-4 text-center sm:items-center sm:p-0",children:c.jsx(Le.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:c.jsxs(Xn.Panel,{className:I("relative transform rounded-lg bg-white px-4 pb-3 pt-5 text-left transition-all sm:w-full sm:pt-3 sm:px-3",n!==""&&n),style:i,children:[l&&c.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:c.jsx(ki,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),c.jsx("div",{className:I(t!==""&&t),"data-testid":"content",children:e}),s&&c.jsx("div",{className:"mt-5 sm:mt-6",children:c.jsx(lt,{id:"close-modal",onClick:()=>o(!1),children:"Cerrar"})}),c.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const Li=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:n,close:t,title:r="¿Estás seguro de abandonar la creación de la acción?",description:o="La información se perderá si no creas la acción",classNameTitle:l="",classNameDescription:s=""})=>{const i=()=>{n(!1),t()};return c.jsxs(hr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[c.jsx("p",{className:I("text-center text-sm",l!==""&&l),children:r}),c.jsx("p",{className:I("text-center text-sm",s!==""&&s),children:o}),c.jsxs("div",{className:"flex w-full justify-center mt-5",children:[c.jsx(cr,{className:"rounded-md bg-white text-gray-500 text-sm shadow-sm ring-1 ring-inset ring-gray-300 bg-gray-50 w-24 h-9 mr-6",onClick:()=>n(),id:"cancel",children:"Cancelar"}),c.jsx(lt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 focus-visible:outline-secondary-2 shadow-secondary-2 rounded py-1.5 text-white w-full px-5",outline:"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",onClick:i,id:"confirmation",children:"Aceptar"})]})]})},_i=({className:e="",style:n={}})=>c.jsx("div",{className:I("w-px",e!==""&&e),style:n}),Ri=({onClick:e,id:n="",className:t=""})=>c.jsxs("div",{className:I("flex items-center text-default-4",t!==""&&t),"data-testid":n,children:[c.jsx(vi,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),c.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]}),sn=({children:e,childRef:n,message:t="",className:r="",classNameContainer:o="",style:l={}})=>{const[s,i]=u.useState(!1),[a,m]=u.useState({top:0,left:0}),d=u.useRef(null),h=()=>{if(!t)return;const g=d.current.getBoundingClientRect();m({top:g.bottom+window.scrollY,left:g.left+window.scrollX}),i(!0)},x=()=>i(!1),f=c.jsx(Le,{as:u.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",show:s,children:c.jsx("div",{className:I("absolute z-40 px-4 mt-0 sm:px-0",r),style:{top:a.top,left:a.left,position:"absolute"},children:c.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:h,onMouseLeave:x,children:typeof t=="object"?"":t})})}),v=n?u.cloneElement(e,{ref:n}):e;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:d,className:I("inline-block",o),onMouseEnter:h,onMouseLeave:x,style:l,children:v}),typeof window<"u"&&Tt.createPortal(f,document.body)]})},it=u.forwardRef((e,n)=>{const{placeholder:t="",label:r="",htmlFor:o,type:l="text",name:s,handleChange:i,onClick:a=()=>{},value:m,isReadOnly:d=!1,isError:h=!1,helperText:x="",autocomplete:f="off",id:v,classNameLabel:g="",classNameContainerInput:b="",classNameContainer:E="",className:w="",icon:y=null,onKeyDown:k,onFocus:$,min:_,maxWidth:W=5e3,onPaste:V}=e,[z,C]=u.useState(!1),P=Te({"ring-red-300 focus:ring-red-300 text-red-900":h||z,"focus:ring-primary-7 text-gray-500":!h&&!z}),D=B=>{if(i&&i(B),l!=="email")return;const{value:U}=B.target,S=pn(U);C(!S)};return c.jsxs("div",{"data-testid":`container-input-${v}`,className:E,children:[r!==""&&c.jsx("label",{htmlFor:o,className:I("block text-sm font-medium leading-6",!g.includes("mb-")&&"mb-0.5",g!==""?g:"text-gray-700"),"data-testid":`label-${v}`,children:r}),c.jsxs("div",{className:I("relative rounded-md",b!==""&&b),children:[c.jsx(sn,{message:l==="password"?"":m,childRef:n,className:"text-sm",classNameContainer:"w-full",children:c.jsx("input",{id:v,name:s,type:l,autoComplete:f,placeholder:t,onChange:D,onClick:a,onKeyDown:k,onFocus:$,onPaste:V,value:m,readOnly:d,"data-testid":`input-${v}`,min:_,className:I("block w-full rounded-md border-0 py-1.5 shadow-sm placeholder-gray-300 ring-1 ring-gray-300 ring-inset focus:ring-1 focus:ring-inset text-sm sm:leading-6 truncate focus:outline-none",P,w!==""&&w),style:{maxWidth:`${W}px`},ref:n})}),y!==null&&c.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:y}),h&&y===null&&c.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:c.jsx(lr,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),x.length===0||!h?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${v}`,children:x})]})});it.displayName="Input";function at({className:e="w-6 h-6",colorSpinner:n="text-primary-9"}){return c.jsxs("svg",{className:I("fill-current animate-spin",e,n),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("circle",{className:I("opacity-25 stroke-current",n),cx:"12",cy:"12",r:"10",strokeWidth:"4",fill:"none"}),c.jsx("path",{d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function Bi(){return c.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-full h-screen overflow-hidden bg-stone-600 opacity-75 flex flex-col items-center justify-center","data-testid":"spinner",style:{zIndex:60},children:[c.jsx("div",{className:"inline-block h-12 w-12 animate-[spinner-grow_0.75s_linear_infinite] rounded-full bg-current align-[-0.125em] opacity-0 motion-reduce:animate-[spinner-grow_1.5s_linear_infinite]",role:"status"}),c.jsx(at,{className:"w-8 h-8 animate-spin text-primary-9"})]})}const vr=({height:e="36px",style:n={},styleMenu:t={},label:r="",onChange:o,isReadOnly:l=!1,isError:s=!1,helperText:i="",name:a,id:m,className:d="",classNameLabel:h="",classNameInput:x="",options:f,value:v=-1,defaultValue:g={value:-1,label:"",iconStart:null,iconEnd:null,selectedLabel:""},defaultLabel:b="label",defaultId:E="value",bgOptionSelect:w="bg-primary-7",isSearch:y=!1,loading:k=!1,isSingleOptionAndFirstLoad:$=!0,isTest:_=!1})=>{const W=u.useRef(!0),[V,z]=u.useState(""),[C,P]=u.useState(g),[D,B]=u.useState(!1);u.useEffect(()=>{if((f==null?void 0:f.length)!==1||!W.current)return;W.current=!1;const[j]=f,F=j[E],H=j[b];P({value:F,label:H}),$&&o({target:{value:j,checked:!1,name:a,type:void 0,id:j[E]}})},[f,E,b,o,a,$]),u.useEffect(()=>{if(v===-1||(f==null?void 0:f.length)===0)return;const j=f==null?void 0:f.find(H=>H[E]===v),F=j&&j.selectedLabel?{...j,label:j.selectedLabel}:j;F&&P(F)},[v,f,E]),u.useEffect(()=>{v==="clear"&&(C[E]!==g[E]||C[b]!==g[b]||_)&&P(g)},[g,_,C,v,E,b]);const U=V===""?f:f.filter(j=>j[b].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(V.toLowerCase())),S=Te({"ring-red-300 focus:ring-red-300 text-red-900":s&&!l,"text-gray-500":!s,"focus:ring-primary-7":!s&&!l}),R=Te({"text-red-400":s&&!l,"text-gray-400":!s}),X=j=>{const F=j.selectedLabel?{...j,label:j.selectedLabel}:j;P(F),o({target:{value:F,checked:!1,name:a,type:void 0,id:j[E]}})};return c.jsxs($e,{as:"div",value:C,children:[c.jsx($e.Label,{className:I("block text-sm font-medium leading-6 text-gray-500 mb-0.5",h!==""&&h),children:r}),c.jsxs("div",{className:I("relative",d!==""&&d),children:[c.jsx(sn,{className:"text-sm",classNameContainer:"w-full",message:C[b],children:c.jsxs($e.Button,{className:"w-full","data-testid":`listbox-button-${m}`,children:[C.iconStart&&c.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:C.iconStart}),c.jsx($e.Input,{className:I("w-full rounded-md border-0 bg-white py-1.5 pr-10 text-gray-900 shadow-sm ring-1 ring-gray-300 sm:text-sm sm:leading-6 truncate block focus:outline-none",!s&&!l&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-primary-7",l&&"focus:ring-gray-300",S,x!==""&&x),onChange:j=>z(j.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:j=>{var F;return(F=j[b])==null?void 0:F.trim()},autoComplete:"off",readOnly:!y||l,style:{height:e,...n},"data-testid":"input-search",onClick:()=>B(l?!1:!D),onBlur:()=>B(!1)})]})}),C.iconEnd&&c.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:C.iconEnd}),!l&&c.jsx($e.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>B(l?!1:!D),"data-testid":"arrow-button",children:c.jsx(on,{className:I("h-5 w-5 ml-auto transition-transform","transform",D&&"rotate-180",R)})}),!l&&c.jsx(c.Fragment,{children:k?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none flex justify-center items-center py-2",children:c.jsx(at,{})}):(U??[]).length>0?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden",style:t,children:U.map((j,F)=>c.jsx($e.Option,{value:j,className:I(j[E]===C[E]?`${w} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${w}`),"data-testid":`select-${m}-${j[E]}`,onClick:()=>X(j),children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center",children:[j.iconStart&&c.jsx("span",{className:"mr-2","aria-hidden":"true",children:j.iconStart}),c.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:j[b]})]}),j.iconEnd&&c.jsx("span",{className:"ml-2","aria-hidden":"true",children:j.iconEnd})]})},F))}):c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden flex justify-center items-center py-2",children:c.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),i.length>0&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${m}`,children:i})]})},zi=({isOpenMenu:e=null,placeholder:n="",label:t="",htmlFor:r,name:o,handleChange:l,onClick:s=()=>{},value:i,valueSelect:a,isReadOnly:m=!1,isError:d=!1,helperText:h="",autocomplete:x="on",id:f,classNameLabel:v="",classNameContainer:g="",className:b="",onKeyDown:E,options:w,idSelect:y,isMarginLeft:k=!0,classNameSelect:$="w-20",type:_="text"})=>{const W=u.useRef(null),V=u.useRef(null),{width:z}=vn(),[C,P]=u.useState(0);u.useEffect(()=>{if(!(!W.current||e===null))return V.current=window.setTimeout(()=>{const{offsetWidth:B}=W.current;P(B)},0),()=>window.clearTimeout(V.current)},[e]);const D=Te({"ring-red-300 focus:ring-red-300 text-red-900":d,"focus:ring-primary-7 text-gray-500":!d});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
43
43
|
input[type="number"]::-webkit-inner-spin-button,
|
|
44
44
|
input[type="number"]::-webkit-outer-spin-button {
|
|
45
45
|
-webkit-appearance: none;
|
|
@@ -48,7 +48,7 @@ Check the top-level render call using <`+P+">.")}return T}}function Nr(p,T){{if(
|
|
|
48
48
|
input[type="number"] {
|
|
49
49
|
-moz-appearance: textfield;
|
|
50
50
|
}
|
|
51
|
-
`}),c.jsxs("div",{"data-testid":`container-input-${f}`,className:g,children:[t!==""&&c.jsx("label",{htmlFor:r,className
|
|
51
|
+
`}),c.jsxs("div",{"data-testid":`container-input-${f}`,className:g,children:[t!==""&&c.jsx("label",{htmlFor:r,className:I("block text-sm font-medium leading-6",v!==""?v:"text-gray-700"),"data-testid":`label-${f}`,children:t}),c.jsxs("div",{className:"relative mt-0.5 rounded-md shadow-sm",children:[c.jsx("div",{className:"absolute flex items-center",style:{left:"2px",top:"1px"},children:c.jsx(vr,{name:y,onChange:B=>l(B),id:y,options:w,value:a,isReadOnly:m,className:$,height:z<=640?"28px":"32px",classNameInput:I(k&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},styleMenu:{width:e===null?"fit-content":`${C}px`},isDisabledFocus:!0})}),c.jsx("input",{ref:W,id:f,name:o,type:_,autoComplete:x,placeholder:n,readOnly:m,"data-testid":`input-${f}`,onClick:s,onKeyDown:E,onChange:B=>l(B),value:i,className:I("block w-full rounded-md border-0 py-1.5 pl-24 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6 focus:outline-none",D,b!==""&&b)}),d&&c.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:c.jsx(lr,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),h.length===0||!d?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${f}`,children:h})]})]})},Wi=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1,handleClick:r,text:o="",updateStatus:l=!1,id:s="status",isHiddenText:i=!1,setForm:a,handleChange:m,textActive:d="Activo",textInactive:h="Inactivo"})=>{const[x,f]=u.useState(!1);u.useEffect(()=>{f(n),e(s,n),a(g=>({...g,[s]:n}))},[n,e,l,a,s]);const v=()=>{f(!x),e(s,!x),a(g=>({...g,[s]:!x})),m({target:{checked:!x,value:!x,name:s,type:"",id:""}}),r&&r()};return c.jsxs("div",{className:"flex",children:[c.jsxs(Ml,{checked:x,onChange:v,className:I("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-5 focus:ring-offset-2 mt-1",x?"bg-success-5":"bg-gray-200"),"data-testid":`switch-${s}`,disabled:t,children:[c.jsx("span",{className:"sr-only",children:"Use setting"}),c.jsx("span",{"aria-hidden":"true",className:I("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",x?"translate-x-full":"translate-x-0")})]}),o!==""?c.jsx("p",{className:I("text-sm font-medium text-gray-500 ml-2 self-end",i&&"hidden"),children:o}):c.jsx("p",{className:I("text-sm font-medium text-gray-500 ml-2 self-end",i&&"hidden"),"data-testid":"text-switch",children:x?d:h})]})};function Ui({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:o="",rows:l=4,name:s,placeholder:i="",helperText:a="",isReadOnly:m=!1,isError:d=!1,onChange:h,value:x,idInput:f,nameInput:v,placeholderInput:g="",isReadOnlyInput:b=!1,valueInput:E,infoTop:w=null,infoBottom:y=null,classNameInfoTop:k="h-4",classNameInfoBottom:$="h-2",isInputTitle:_=!1,hiddenBorder:W=!1}){const V=Te({"ring-red-300 focus:ring-red-300 text-red-900":d,"focus:ring-primary-7 text-gray-700":!d});return c.jsxs(c.Fragment,{children:[e!==""&&c.jsx("label",{htmlFor:t,className:I("leading-6 block text-sm",r!==""&&r),children:e}),c.jsxs("div",{className:"relative overflow-x-hidden",children:[w!==null&&c.jsx("div",{className:"absolute top-2 left-3 w-full",children:w}),c.jsxs("div",{className:I("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-7 placeholder:text-gray-400 bg-white",V),children:[w!==null&&c.jsx("div",{className:"py-2","aria-hidden":"true",children:c.jsx("div",{className:"py-px",children:c.jsx("div",{className:k})})}),_&&c.jsx("textarea",{name:v,id:f,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:g,value:E,onChange:h,rows:2,readOnly:b}),c.jsx("textarea",{placeholder:i,rows:l,name:s,id:n,className:I(_||W?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",V,o!==""&&o),readOnly:m,onChange:h,value:x,"data-testid":`textarea-${n}`}),y!==null&&c.jsx("div",{className:"py-2","aria-hidden":"true",children:c.jsx("div",{className:"py-px",children:c.jsx("div",{className:$})})})]}),y!==null&&c.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:y})]}),a.length>0&&d&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Hi=({children:e,data:n,className:t="",classNameTooltip:r="w-full",classNameMenu:o="",classNameMenuItems:l="",classNameContainerSearch:s="px-5",isSelectMultiple:i=!1,optionsSelect:a,propObject:m="name",propId:d="id",textNewItem:h="",defaultId:x=null,loading:f=!1,search:v=null,searchPlaceHolder:g="Buscar...",valueSearch:b=void 0,idsOptionSelect:E=null,isComponent:w,isSticky:y=!1,hiddenMenu:k=!1,id:$,onClick:_=()=>{},isRelative:W=!0,isMaxWidth:V=!1,isTag:z=!1,isClear:C=!1,clear:P=null,applyButton:D=null,applyButtonText:B="Aplicar",tagsParent:U=[],isClearTagsParent:S=!1,isReadOnly:R,isDisabledApplyButton:X=!0,isOpenMenu:j=void 0,onScroll:F=null})=>{const H=u.useRef(null),J=u.useRef(null),[ne,ie]=u.useState(new Set),[ae,ge]=u.useState(new Map);u.useEffect(()=>{E!==null&&ie(new Set(new Set(E)))},[E]),u.useEffect(()=>{S&&ge(new Map)},[S]),u.useEffect(()=>{if(U.length===0)return;const O=new Map;U.forEach(G=>O.set(G.id,G)),ge(O)},[U]),u.useEffect(()=>{C&&(ie(new Set),ge(new Map),P&&P())},[P,C]);const we=O=>{let G=new Map(ae),Q=new Set(ne),Se=null;if(x!==null&&(O[d]===x&&(Se=crypto.randomUUID()),Se!==null&&(O[d]=Se),Se!==null&&(O[m]=O[m].replace(h,"").trim())),Q.has(O[d])?Q.delete(O[d]):Q.add(O[d]),G.has(O[d])?G.delete(O[d]):G.set(O[d],O),!i){const ze=Array.from(Q),We=Array.from(G);ze.shift(),We.shift(),Q=Q.size===2?new Set(ze):Q,G=G.size===2?new Map(We):G}a(O,Array.from(Q),Se!==null),ie(Q),ge(G)},Y=O=>{_(O===!0?-1:$)},ue=O=>{const G=new Set(ne),Q=new Map(ae);G.delete(O[d]),Q.delete(O[d]),a(O,Array.from(G)),ie(G),ge(Q)},L=()=>{if(ne.size===0)return;const O=new Set(ne),G=new Map(ae);O.clear(),G.clear(),a(null,Array.from(O)),ie(O),ge(G)};function Z(O){if(typeof O!="string")return O;const G=O.toLowerCase();return G.charAt(0).toUpperCase()+G.slice(1)}return c.jsxs(wt,{as:"div",className:I("inline-block text-left",W&&"relative",o!==""&&o),onClick:()=>Y(!0),"data-testid":`menu-${$}`,id:$,ref:H,children:[c.jsx("style",{children:`
|
|
52
52
|
.w-custom {
|
|
53
53
|
width: 320px;
|
|
54
54
|
}
|
|
@@ -62,8 +62,8 @@ Check the top-level render call using <`+P+">.")}return T}}function Nr(p,T){{if(
|
|
|
62
62
|
width: 414px;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`}),c.jsx(wt.Button,{as:"div",onClick:()=>q(O),"data-testid":`menu-button-${F}`,ref:J,children:e}),!B&&c.jsx("div",{className:$("absolute right-0 z-20",r,O&&"hidden",f&&"w-full"),children:c.jsx(Le,{as:u.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",show:j,children:c.jsx(wt.Items,{className:$("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",f?"w-full":l===""&&"w-max",l!==""&&l),children:f?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(at,{})}):c.jsxs("div",{className:$(!w&&"pb-1",t!==""&&t,V&&"w-custom"),"data-testid":"dropdown-menu",onScroll:I,children:[c.jsxs("div",{className:"sticky top-0 bg-white w-full z-20",children:[v!==null&&c.jsx("div",{className:$("py-2 w-full",s),children:c.jsx(it,{htmlFor:"search",id:`dropdown-search-${F}`,name:"search",type:"text",placeholder:g,handleChange:N=>v(N,F),icon:g!==""&&c.jsx(xi,{className:"w-4 h-4 text-primary-4"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:b,onKeyDown:N=>N.key===" "&&N.stopPropagation(),autocomplete:"off"})}),L!==null&&c.jsxs("div",{className:$("pt-1.5 justify-end flex items-center",s),children:[c.jsx(lt,{classNameButton:$("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",ne.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:A,children:"Descartar"}),c.jsx(lt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",classNameText:"text-xs text-white text-center",id:"apply",disabled:ne.size===0&&Y,onClick:()=>L({id:F,items:Array.from(ae.values())}),children:R})]})]}),z&&c.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(ae).map((N,K)=>c.jsx("div",{className:"mr-1",children:c.jsxs("span",{className:"inline-flex items-center gap-x-0.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600 mb-1",children:[N[1][m],c.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>ue(N[1]),"data-testid":`tag-${N[0]}`,children:c.jsx(ar,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},N))}),c.jsx("div",{className:"divide-y divide-gray-100",children:n.map((N,K)=>c.jsx("div",{className:$(!w&&"py-1",y&&K===0&&"sticky top-0"),children:w?c.jsx("div",{onClick:Q=>{Q.preventDefault(),a()},"data-testid":`item-component-${K}`,children:N}):c.jsx(wt.Item,{children:c.jsx("span",{className:$(ne.has(N[d])&&"bg-secondary-2 text-white",!ne.has(N[d])&&"text-gray-700 hover:bg-gray-100 hover:text-gray-900","block px-4 py-2 text-13 lg:text-sm cursor-pointer font-normal"),"data-testid":`item-${K}`,onClick:Q=>{Q.preventDefault(),we(N)},children:X(N[m])})})},K))})]})})})})]})},ln=50,Vi=({total:e,handleNext:n,handlePrev:t,handleSelectPage:r,page:o=null,pageSize:l=ln})=>{const[s,i]=u.useState(1),[a,m]=u.useState([]),[d,h]=u.useState([]),[x,f]=u.useState(""),v=Math.ceil(e/l);u.useEffect(()=>{const y=[];for(let O=1;O<=v;O++)y.push(O);h(y)},[v]),u.useEffect(()=>{let y=[];const O="...",F="... ",D=" ...";if(d.length<6)y=d;else if(s>=1&&s<=3)y=[1,2,3,4,O,d.length];else if(s===4)y=[...d.slice(0,5),O,d.length];else if(s>4&&s<d.length-2){const U=d.slice(s-2,s),V=d.slice(s,s+1);y=[1,F,...U,...V,D,d.length]}else if(s>d.length-3){const U=d.slice(d.length-4);y=[1,F,...U]}m(y)},[s,d]),u.useEffect(()=>{o!==null&&o!==s&&i(o)},[o,s]);const g=y=>{f(""),i(y),r(y)},b=()=>{f(""),s>1&&i(s-1),s>1&&t(s-1)},E=()=>{f(""),s<d.length&&i(s+1),s<d.length&&n(s+1)},w=y=>{const{value:O}=y.target;if(!/^\d*$/.test(O))return;const F=Math.ceil(e/ln);O>F||f(O)};return u.useEffect(()=>{const y=setTimeout(()=>{const O=Number(x);!isNaN(O)&&O>=1&&O<=v&&(r(O),i(O))},500);return()=>clearTimeout(y)},[x,v,r]),c.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[c.jsx("div",{className:"-mt-px flex w-0 flex-1",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pr-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:b,"data-testid":"prev",children:[c.jsx(Xl,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),c.jsxs("div",{className:"hidden md:-mt-px md:flex",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-sm text-gray-500 font-medium mr-1",children:"Ir a"}),c.jsx("div",{className:"inline-flex items-center border-t-2 pr-2 pt-1 text-sm font-medium border-transparent text-gray-500",style:{width:"45px"},children:c.jsx(it,{htmlFor:"",id:"pager",name:"pager",handleChange:w,value:x,className:"pl-1.5 pr-1 h-7"})})]}),a.map((y,O)=>c.jsx(dr,{className:$("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",s===y?"border-primary-6 text-primary-7":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>y!=="..."&&y!==" ..."&&y!=="... "&&g(y),id:`page-${O+1}`,children:y},O))]}),c.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pl-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:E,"data-testid":"next",children:["Siguiente",c.jsx(Ql,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},Yi=({setForm:e,setValuesDefault:n,className:t="",classNameContainer:r="",classNameContainerImg:o="",src:l=null,alt:s=null,width:i,height:a,title:m="Logo (Opcional)",fileFormatsDescription:d="PNG, JPG, GIF up to 10MB",acceptTypes:h,maxFileSize:x,onError:f,helperText:v="",isError:g=!1,multiple:b=!1,failAllOnError:E=!0,maxNumberOfFiles:w=null})=>{const y=Array.isArray(l)?l[0]:l,O=l===null?"":y.split("."),F=D=>{const{files:U}=D.target;if(!U||U.length===0)return;if(w&&U.length>w){f==null||f(`Solo se permite un máximo de ${w} archivo${w>1?"s":""}`);return}const V=Array.from(U).slice(0,w??U.length),z=V.map(_=>new Promise((k,L)=>{if(h&&!h.includes(_.type)){const W=V.length>1?"Alguno de los archivos no es de un tipo permitido":"Tipo de archivo no permitido";L(new Error(W));return}if(x&&_.size>x){L(new Error(`${V.length===1?"El archivo":"Cada archivo"} no puede superar ${x/(1024*1024)} MB`));return}const R=new FileReader;R.onload=()=>k({base64:R.result,type:_.type}),R.onerror=()=>L(new Error("Error al leer el archivo")),R.readAsDataURL(_)}));Promise.allSettled(z).then(_=>{const k=_.filter(B=>B.status==="rejected"),L=_.filter(B=>B.status==="fulfilled").map(B=>B.value);if(E&&k.length>0){const B=k[k.length-1].reason.message;f==null||f(B);return}if(!E&&k.length>0){const B=k[k.length-1].reason.message;f==null||f(B)}if(L.length===0)return;const R=L.length===1?L[0].base64:L.map(B=>B.base64),W=L[0],S=W.type.startsWith("image/")?W.base64:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png";e(B=>({...B,photo:S})),n("photo",R)})};return c.jsxs("div",{className:$("col-span-full",r!==""&&r),children:[c.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:m}),c.jsxs("div",{className:$("mt-2 flex justify-center rounded-lg border-2 border-dotted cursor-pointer relative",g?"border-red-300":"border-gray-300",o!==""&&o),children:[l?c.jsx("div",{className:"flex",children:Array.isArray(l)?l.map((D,U)=>c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(D.split(".")[D.split(".").length-1])||D.startsWith("data:image/")?D:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:s,width:i,height:a,className:$(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:V=>V.currentTarget.style.filter="none","data-testid":"img"},U)):c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(O[O.length-1])||y.startsWith("data:image/")?y:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:s,width:i,height:a,className:$(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:D=>D.currentTarget.style.filter="none","data-testid":"img"})}):c.jsxs("div",{className:"text-center",children:[c.jsx(ir,{"aria-hidden":"true",className:$("mt-3 mx-auto h-9 w-9",g?"text-red-900":"text-gray-300")}),c.jsxs("div",{className:$("mt-4 flex text-sm leading-6",g?"text-red-900":"text-gray-600"),children:[c.jsx("label",{htmlFor:"file-upload",className:$("relative cursor-pointer rounded-md bg-white font-semibold focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-7 focus-within:ring-offset-2 hover:text-primary-6",g?"text-red-900":"text-primary-7"),children:c.jsx("span",{children:"Subir un archivo"})}),c.jsx("p",{className:"pl-1",children:"o arrástralo y suéltalo aquí"})]}),c.jsx("p",{className:$("text-xs leading-5",g?"text-red-900":"text-gray-600"),children:d})]}),c.jsx("input",{id:"file-upload",name:"file-upload",type:"file",multiple:b,className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:F})]}),v.length===0||!g?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":"helperText-upload",children:v})]})},qi=({children:e,openDefault:n=!1,setForm:t,setValuesDefault:r,title:o,type:l,data:s,setData:i,id:a,defaultData:m,showAlert:d,isAdd:h=!0,search:x=null,isPadding:f=!0,isReadOnly:v=!1,isEdit:g=!1,deleteItem:b=null,validateAdd:E=null,loading:w=!1,internalEdit:y=!0,isDataEmpty:O=!0,typeProp:F="value",setAdd:D=null,hasNoRecords:U=!0,tabs:V=null,selectTab:z=null,className:_="mt-7"})=>{const[L,R]=u.useState(!1),[W,S]=u.useState(!1),[,B]=u.useState(!1),[Y,j]=u.useState(""),[I,H]=u.useState(1);u.useEffect(()=>{R(n),B(v)},[n,v]);const J=({e:q,index:ue})=>{const A=Nt(s),{name:X,value:N}=q.target;!(E===null?!1:E({value:N,copyData:A,index:ue}))&&(A[ue][X]=N),i(A),r(a,A),t(Q=>({...Q,[a]:A}))},ne=()=>{if(s.some(ue=>Object.values(ue).some(N=>N[F]===-1))||s.length===0)return d({title:"",message:"Todos los campos son requeridos",type:"warning"});t(ue=>({...ue,data:s})),r(a,s),i([...s,m]),D&&D([...s,m])},ie=({index:q,item:ue})=>{if(s.length===1&&!g)return;let A=Nt(s);A.length===1&&(A=[m]),A.length>1&&A.splice(q,1),t(X=>({...X,data:A})),r(a,A),i(A),b&&b({index:q,item:ue,data:A}),q===s.length-1&&g&&A.length===0&&(t(X=>({...X,data:A})),r(a,A),i([...A,m]))},ae=()=>{S(!W),B(!1)},ge=()=>{if(s.length>1)return;if(s.length===0)return!0;const[q]=s;return!q||typeof q!="object"?!0:Object.keys(q).filter(X=>{const N=q[X];return N&&typeof N=="object"&&"value"in N}).every(X=>q[X].value===-1)},we=({tab:q})=>{H(q.id),z&&z({tab:q})};return c.jsxs("div",{className:$("divide-y divide-gray-200 rounded-lg bg-white shadow",_),children:[c.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>R(!L),"data-testid":`open-accordion-${a}`,children:[typeof o=="string"?c.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:o}):o,c.jsxs("div",{className:"flex items-center",children:[x&&c.jsx(it,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:q=>{x(q),j(q.target.value)},icon:c.jsx(Mi,{className:"w-6 h-6 text-primary-4"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:Y,onClick:q=>q.stopPropagation(),onFocus:()=>R(!0)}),L?c.jsx(Fi,{className:"w-5 h-5 text-default-4"}):c.jsx(pr,{className:"w-5 h-5 text-default-4"})]})]}),c.jsx(Le,{as:u.Fragment,show:L,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:c.jsxs("div",{children:[V&&c.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:V.map(q=>c.jsx("span",{className:$(I===q.id?"border-primary-6 text-gray-900":"border-gray-300 text-gray-500 hover:border-primary-6","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":I===q.id?"page":void 0,onClick:()=>we({tab:q}),"data-testid":`tab-${q.id}`,children:q.name},q.name))}),c.jsxs("div",{className:$("sm:mt-2.5 py-3.5 relative",f&&V===null&&"px-4 sm:p-6",f&&V!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[y&&!W&&c.jsx(wi,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:ae,"data-testid":`edit-role-${a}`}),w&&c.jsx("div",{className:"flex justify-center mt-5",children:c.jsx(at,{})}),O&&ge()&&U&&!w&&(y?!W:!g)&&c.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!w&&s.map((q,ue)=>c.jsxs("div",{className:$("flex flex-col 3xs:flex-row mb-4",f&&"ml-0 3xs:ml-3"),children:[typeof e=="function"?e({item:q,index:ue,handleChange:J,isEdit:y?W:g}):e,h&&(y?W:g)&&c.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:$("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",s.length===1&&!g&&"opacity-0"),children:c.jsx(Di,{className:$("w-6 h-4",(s.length>1||g)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>ie({index:ue,item:q}),"data-testid":`delete-item-${ue}-${a}`})})]},ue)),h&&(y?W:g)&&!w&&c.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:ne,"data-testid":`add-item-${a}`,style:{width:"fit-content"},children:`+ Añadir ${l}`})]})]})})]})},Gi=({src:e,alt:n,width:t,height:r,className:o="",priority:l=!1,style:s={},id:i="",onClick:a=null,objectFit:m="cover"})=>{const[d,h]=u.useState(!1),x={filter:d?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:m,...t?{width:t}:{},...r?{height:r}:{},...s};return c.jsx("img",{src:e,alt:n,...t?{width:t}:{},...r?{height:r}:{},className:$(o!==""&&o),loading:l?"eager":"lazy",decoding:"async",style:x,onLoad:()=>h(!0),"data-testid":`image-${i}`,onClick:a})},Ki=["icon-analytics-alt-1","icon-bell-remove","icon-calculator-alt","icon-cart-full","icon-cloud-sun","icon-coding","icon-cottage-alt","icon-flag-alt","icon-gallery","icon-grow","icon-head-idea","icon-idea-share","icon-highlight-alt","icon-invention","icon-Jurisdiction","icon-layout-2","icon-lock","icon-map-alt","icon-megaphone","icon-personal-data","icon-personal-file","icon-phone-ring","icon-pie-chart-dollar","icon-pointer-right","icon-portfolio","icon-presentation-chart-line","icon-pyramid","icon-puzzle","icon-revenue","icon-rocket-growth-2","icon-ruler-pencil","icon-save","icon-search-home","icon-shoe-print","icon-strategy","icon-target","icon-time-settings","icon-vector-1","icon-user-alt-3","icon-world-2","icon-write","icon-website-money","icon-website","icon-alarm-clock","icon-arc","icon-bot","icon-control-panel","icon-corner","icon-dashboard","icon-full-battery","icon-help","icon-networking-startup","icon-share-alt","icon-thumbnail","icon-ux","icon-travel","icon-music","icon-heart","icon-book-mark","icon-map-pin","icon-star","icon-microphone","icon-clipboard-document","icon-arrow-down-tray","icon-reports"];function Zi({value:e,onChange:n,disabled:t,id:r,label:o="",classNameLabel:l="",helperText:s="",isError:i=!1,isReadOnly:a=!1,name:m}){const[d,h]=u.useState(!1),x=u.useRef(null);u.useEffect(()=>{function v(g){d&&x.current&&!x.current.contains(g.target)&&h(!1)}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const f=Te({"border-red-300 focus:border-red-300 text-red-900":i&&!a,"text-gray-500":!i,"focus:border-primary-7":!i&&!a});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
65
|
+
`}),c.jsx(wt.Button,{as:"div",onClick:()=>Y(k),"data-testid":`menu-button-${$}`,ref:J,children:e}),!R&&c.jsx("div",{className:I("absolute right-0 z-20",r,k&&"hidden",f&&"w-full"),children:c.jsx(Le,{as:u.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",show:j,children:c.jsx(wt.Items,{className:I("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",f?"w-full":l===""&&"w-max",l!==""&&l),children:f?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(at,{})}):c.jsxs("div",{className:I(!w&&"pb-1",t!==""&&t,V&&"w-custom"),"data-testid":"dropdown-menu",onScroll:F,children:[c.jsxs("div",{className:"sticky top-0 bg-white w-full z-20",children:[v!==null&&c.jsx("div",{className:I("py-2 w-full",s),children:c.jsx(it,{htmlFor:"search",id:`dropdown-search-${$}`,name:"search",type:"text",placeholder:g,handleChange:O=>v(O,$),icon:g!==""&&c.jsx(xi,{className:"w-4 h-4 text-primary-4"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:b,onKeyDown:O=>O.key===" "&&O.stopPropagation(),autocomplete:"off"})}),D!==null&&c.jsxs("div",{className:I("pt-1.5 justify-end flex items-center",s),children:[c.jsx(lt,{classNameButton:I("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",ne.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:L,children:"Descartar"}),c.jsx(lt,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",classNameText:"text-xs text-white text-center",id:"apply",disabled:ne.size===0&&X,onClick:()=>D({id:$,items:Array.from(ae.values())}),children:B})]})]}),z&&c.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(ae).map((O,G)=>c.jsx("div",{className:"mr-1",children:c.jsxs("span",{className:"inline-flex items-center gap-x-0.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600 mb-1",children:[O[1][m],c.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>ue(O[1]),"data-testid":`tag-${O[0]}`,children:c.jsx(ar,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},O))}),c.jsx("div",{className:"divide-y divide-gray-100",children:n.map((O,G)=>c.jsx("div",{className:I(!w&&"py-1",y&&G===0&&"sticky top-0"),children:w?c.jsx("div",{onClick:Q=>{Q.preventDefault(),a()},"data-testid":`item-component-${G}`,children:O}):c.jsx(wt.Item,{children:c.jsx("span",{className:I(ne.has(O[d])&&"bg-secondary-2 text-white",!ne.has(O[d])&&"text-gray-700 hover:bg-gray-100 hover:text-gray-900","block px-4 py-2 text-13 lg:text-sm cursor-pointer font-normal"),"data-testid":`item-${G}`,onClick:Q=>{Q.preventDefault(),we(O)},children:Z(O[m])})})},G))})]})})})})]})},ln=50,Vi=({total:e,handleNext:n,handlePrev:t,handleSelectPage:r,page:o=null,pageSize:l=ln})=>{const[s,i]=u.useState(1),[a,m]=u.useState([]),[d,h]=u.useState([]),[x,f]=u.useState(""),v=Math.ceil(e/l);u.useEffect(()=>{const y=[];for(let k=1;k<=v;k++)y.push(k);h(y)},[v]),u.useEffect(()=>{let y=[];const k="...",$="... ",_=" ...";if(d.length<6)y=d;else if(s>=1&&s<=3)y=[1,2,3,4,k,d.length];else if(s===4)y=[...d.slice(0,5),k,d.length];else if(s>4&&s<d.length-2){const W=d.slice(s-2,s),V=d.slice(s,s+1);y=[1,$,...W,...V,_,d.length]}else if(s>d.length-3){const W=d.slice(d.length-4);y=[1,$,...W]}m(y)},[s,d]),u.useEffect(()=>{o!==null&&o!==s&&i(o)},[o,s]);const g=y=>{f(""),i(y),r(y)},b=()=>{f(""),s>1&&i(s-1),s>1&&t(s-1)},E=()=>{f(""),s<d.length&&i(s+1),s<d.length&&n(s+1)},w=y=>{const{value:k}=y.target;if(!/^\d*$/.test(k))return;const $=Math.ceil(e/ln);k>$||f(k)};return u.useEffect(()=>{const y=setTimeout(()=>{const k=Number(x);!isNaN(k)&&k>=1&&k<=v&&(r(k),i(k))},500);return()=>clearTimeout(y)},[x,v,r]),c.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[c.jsx("div",{className:"-mt-px flex w-0 flex-1",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pr-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:b,"data-testid":"prev",children:[c.jsx(Xl,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),c.jsxs("div",{className:"hidden md:-mt-px md:flex",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-sm text-gray-500 font-medium mr-1",children:"Ir a"}),c.jsx("div",{className:"inline-flex items-center border-t-2 pr-2 pt-1 text-sm font-medium border-transparent text-gray-500",style:{width:"45px"},children:c.jsx(it,{htmlFor:"",id:"pager",name:"pager",handleChange:w,value:x,className:"pl-1.5 pr-1 h-7"})})]}),a.map((y,k)=>c.jsx(dr,{className:I("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",s===y?"border-primary-6 text-primary-7":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>y!=="..."&&y!==" ..."&&y!=="... "&&g(y),id:`page-${k+1}`,children:y},k))]}),c.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pl-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:E,"data-testid":"next",children:["Siguiente",c.jsx(Ql,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},Yi=({setForm:e,setValuesDefault:n,className:t="",classNameContainer:r="",classNameContainerImg:o="",src:l=null,alt:s=null,width:i,height:a,title:m="Logo (Opcional)",fileFormatsDescription:d="PNG, JPG, GIF up to 10MB",acceptTypes:h,maxFileSize:x,onError:f,helperText:v="",isError:g=!1,multiple:b=!1,failAllOnError:E=!0,maxNumberOfFiles:w=null})=>{const y=Array.isArray(l)?l[0]:l,k=l===null?"":y.split("."),$=_=>{const{files:W}=_.target;if(!W||W.length===0)return;if(w&&W.length>w){f==null||f(`Solo se permite un máximo de ${w} archivo${w>1?"s":""}`);return}const V=Array.from(W).slice(0,w??W.length),z=V.map(C=>new Promise((P,D)=>{if(h&&!h.includes(C.type)){const U=V.length>1?"Alguno de los archivos no es de un tipo permitido":"Tipo de archivo no permitido";D(new Error(U));return}if(x&&C.size>x){D(new Error(`${V.length===1?"El archivo":"Cada archivo"} no puede superar ${x/(1024*1024)} MB`));return}const B=new FileReader;B.onload=()=>P({base64:B.result,type:C.type}),B.onerror=()=>D(new Error("Error al leer el archivo")),B.readAsDataURL(C)}));Promise.allSettled(z).then(C=>{const P=C.filter(R=>R.status==="rejected"),D=C.filter(R=>R.status==="fulfilled").map(R=>R.value);if(E&&P.length>0){const R=P[P.length-1].reason.message;f==null||f(R);return}if(!E&&P.length>0){const R=P[P.length-1].reason.message;f==null||f(R)}if(D.length===0)return;const B=D.length===1?D[0].base64:D.map(R=>R.base64),U=D[0],S=U.type.startsWith("image/")?U.base64:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png";e(R=>({...R,photo:S})),n("photo",B)})};return c.jsxs("div",{className:I("col-span-full",r!==""&&r),children:[c.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:m}),c.jsxs("div",{className:I("mt-2 flex justify-center rounded-lg border-2 border-dotted cursor-pointer relative",g?"border-red-300":"border-gray-300",o!==""&&o),children:[l?c.jsx("div",{className:"flex",children:Array.isArray(l)?l.map((_,W)=>c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(_.split(".")[_.split(".").length-1])||_.startsWith("data:image/")?_:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:s,width:i,height:a,className:I(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:V=>V.currentTarget.style.filter="none","data-testid":"img"},W)):c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(k[k.length-1])||y.startsWith("data:image/")?y:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:s,width:i,height:a,className:I(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:_=>_.currentTarget.style.filter="none","data-testid":"img"})}):c.jsxs("div",{className:"text-center",children:[c.jsx(ir,{"aria-hidden":"true",className:I("mt-3 mx-auto h-9 w-9",g?"text-red-900":"text-gray-300")}),c.jsxs("div",{className:I("mt-4 flex text-sm leading-6",g?"text-red-900":"text-gray-600"),children:[c.jsx("label",{htmlFor:"file-upload",className:I("relative cursor-pointer rounded-md bg-white font-semibold focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-7 focus-within:ring-offset-2 hover:text-primary-6",g?"text-red-900":"text-primary-7"),children:c.jsx("span",{children:"Subir un archivo"})}),c.jsx("p",{className:"pl-1",children:"o arrástralo y suéltalo aquí"})]}),c.jsx("p",{className:I("text-xs leading-5",g?"text-red-900":"text-gray-600"),children:d})]}),c.jsx("input",{id:"file-upload",name:"file-upload",type:"file",multiple:b,className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:$})]}),v.length===0||!g?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":"helperText-upload",children:v})]})},qi=({children:e,openDefault:n=!1,setForm:t,setValuesDefault:r,title:o,type:l,data:s,setData:i,id:a,defaultData:m,showAlert:d,isAdd:h=!0,search:x=null,isPadding:f=!0,isReadOnly:v=!1,isEdit:g=!1,deleteItem:b=null,validateAdd:E=null,loading:w=!1,internalEdit:y=!0,isDataEmpty:k=!0,typeProp:$="value",setAdd:_=null,hasNoRecords:W=!0,tabs:V=null,selectTab:z=null,className:C="mt-7"})=>{const[D,B]=u.useState(!1),[U,S]=u.useState(!1),[,R]=u.useState(!1),[X,j]=u.useState(""),[F,H]=u.useState(1);u.useEffect(()=>{B(n),R(v)},[n,v]);const J=({e:Y,index:ue})=>{const L=Nt(s),{name:Z,value:O}=Y.target;!(E===null?!1:E({value:O,copyData:L,index:ue}))&&(L[ue][Z]=O),i(L),r(a,L),t(Q=>({...Q,[a]:L}))},ne=()=>{if(s.some(ue=>Object.values(ue).some(O=>O[$]===-1))||s.length===0)return d({title:"",message:"Todos los campos son requeridos",type:"warning"});t(ue=>({...ue,data:s})),r(a,s),i([...s,m]),_&&_([...s,m])},ie=({index:Y,item:ue})=>{if(s.length===1&&!g)return;let L=Nt(s);L.length===1&&(L=[m]),L.length>1&&L.splice(Y,1),t(Z=>({...Z,data:L})),r(a,L),i(L),b&&b({index:Y,item:ue,data:L}),Y===s.length-1&&g&&L.length===0&&(t(Z=>({...Z,data:L})),r(a,L),i([...L,m]))},ae=()=>{S(!U),R(!1)},ge=()=>{if(s.length>1)return;if(s.length===0)return!0;const[Y]=s;return!Y||typeof Y!="object"?!0:Object.keys(Y).filter(Z=>{const O=Y[Z];return O&&typeof O=="object"&&"value"in O}).every(Z=>Y[Z].value===-1)},we=({tab:Y})=>{H(Y.id),z&&z({tab:Y})};return c.jsxs("div",{className:I("divide-y divide-gray-200 rounded-lg bg-white shadow",C),children:[c.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>B(!D),"data-testid":`open-accordion-${a}`,children:[typeof o=="string"?c.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:o}):o,c.jsxs("div",{className:"flex items-center",children:[x&&c.jsx(it,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:Y=>{x(Y),j(Y.target.value)},icon:c.jsx(Mi,{className:"w-6 h-6 text-primary-4"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:X,onClick:Y=>Y.stopPropagation(),onFocus:()=>B(!0)}),D?c.jsx(Fi,{className:"w-5 h-5 text-default-4"}):c.jsx(pr,{className:"w-5 h-5 text-default-4"})]})]}),c.jsx(Le,{as:u.Fragment,show:D,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:c.jsxs("div",{children:[V&&c.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:V.map(Y=>c.jsx("span",{className:I(F===Y.id?"border-primary-6 text-gray-900":"border-gray-300 text-gray-500 hover:border-primary-6","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":F===Y.id?"page":void 0,onClick:()=>we({tab:Y}),"data-testid":`tab-${Y.id}`,children:Y.name},Y.name))}),c.jsxs("div",{className:I("sm:mt-2.5 py-3.5 relative",f&&V===null&&"px-4 sm:p-6",f&&V!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[y&&!U&&c.jsx(wi,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:ae,"data-testid":`edit-role-${a}`}),w&&c.jsx("div",{className:"flex justify-center mt-5",children:c.jsx(at,{})}),k&&ge()&&W&&!w&&(y?!U:!g)&&c.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!w&&s.map((Y,ue)=>c.jsxs("div",{className:I("flex flex-col 3xs:flex-row mb-4",f&&"ml-0 3xs:ml-3"),children:[typeof e=="function"?e({item:Y,index:ue,handleChange:J,isEdit:y?U:g}):e,h&&(y?U:g)&&c.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:I("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",s.length===1&&!g&&"opacity-0"),children:c.jsx(Di,{className:I("w-6 h-4",(s.length>1||g)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>ie({index:ue,item:Y}),"data-testid":`delete-item-${ue}-${a}`})})]},ue)),h&&(y?U:g)&&!w&&c.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:ne,"data-testid":`add-item-${a}`,style:{width:"fit-content"},children:`+ Añadir ${l}`})]})]})})]})},Gi=({src:e,alt:n,width:t,height:r,className:o="",priority:l=!1,style:s={},id:i="",onClick:a=null,objectFit:m="cover"})=>{const[d,h]=u.useState(!1),x={filter:d?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:m,...t?{width:t}:{},...r?{height:r}:{},...s};return c.jsx("img",{src:e,alt:n,...t?{width:t}:{},...r?{height:r}:{},className:I(o!==""&&o),loading:l?"eager":"lazy",decoding:"async",style:x,onLoad:()=>h(!0),"data-testid":`image-${i}`,onClick:a})},Ki=["icon-analytics-alt-1","icon-bell-remove","icon-calculator-alt","icon-cart-full","icon-cloud-sun","icon-coding","icon-cottage-alt","icon-flag-alt","icon-gallery","icon-grow","icon-head-idea","icon-idea-share","icon-highlight-alt","icon-invention","icon-Jurisdiction","icon-layout-2","icon-lock","icon-map-alt","icon-megaphone","icon-personal-data","icon-personal-file","icon-phone-ring","icon-pie-chart-dollar","icon-pointer-right","icon-portfolio","icon-presentation-chart-line","icon-pyramid","icon-puzzle","icon-revenue","icon-rocket-growth-2","icon-ruler-pencil","icon-save","icon-search-home","icon-shoe-print","icon-strategy","icon-target","icon-time-settings","icon-vector-1","icon-user-alt-3","icon-world-2","icon-write","icon-website-money","icon-website","icon-alarm-clock","icon-arc","icon-bot","icon-control-panel","icon-corner","icon-dashboard","icon-full-battery","icon-help","icon-networking-startup","icon-share-alt","icon-thumbnail","icon-ux","icon-travel","icon-music","icon-heart","icon-book-mark","icon-map-pin","icon-star","icon-microphone","icon-clipboard-document","icon-arrow-down-tray","icon-reports"];function Zi({value:e,onChange:n,disabled:t,id:r,label:o="",classNameLabel:l="",helperText:s="",isError:i=!1,isReadOnly:a=!1,name:m}){const[d,h]=u.useState(!1),x=u.useRef(null);u.useEffect(()=>{function v(g){d&&x.current&&!x.current.contains(g.target)&&h(!1)}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const f=Te({"border-red-300 focus:border-red-300 text-red-900":i&&!a,"text-gray-500":!i,"focus:border-primary-7":!i&&!a});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
66
66
|
.black-icon::before {
|
|
67
67
|
color: rgb(51, 51, 51);
|
|
68
68
|
}
|
|
69
|
-
`}),o!==""&&c.jsx("p",{className:$("block text-sm font-medium leading-6",l!==""?l:"text-gray-700"),"data-testid":`label-${r}`,children:o}),c.jsxs("div",{style:{position:"relative",width:"100%"},className:$("border rounded-md",f),ref:x,children:[c.jsxs("div",{className:"flex items-center gap-2 dropdown-trigger border border-default-2 rounded-md p-1.5",onClick:()=>!t&&h(!d),style:{cursor:t?"not-allowed":"pointer"},title:e||"Selecciona un icono","data-testid":"open",children:[c.jsx("div",{className:"rounded border border-default-2 p-1 h-6 w-6 bg-default-2 flex items-center justify-center",children:e&&c.jsx("i",{className:$(e,"text-normal block")})}),c.jsx("div",{className:"truncate",style:{flexGrow:1,minWidth:0,overflow:"hidden"},children:e}),c.jsx(pr,{className:$("h-5 w-5 ml-auto transition-transform flex-shrink-0",{"transform rotate-180":d})})]}),d&&c.jsx("div",{className:"openIconSelect absolute z-10 bg-white p-3 rounded-lg",style:{top:48,left:"0",width:"100%",maxWidth:500,border:"1px solid #ccc",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",maxHeight:300,overflowY:"auto"},children:c.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:"repeat(auto-fill, minmax(30px, 1fr))",gap:12},children:Ki.map(v=>c.jsx("button",{type:"button",className:"icon-picker-btn",style:{width:"100%",aspectRatio:"1",borderRadius:4,border:e===v?"2px solid #007bff":"1px solid #eee",background:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,color:e===v?"#007bff":"#333",outline:"none",cursor:"pointer"},onClick:()=>{n({target:{value:v,checked:!1,name:m,id:r}}),h(!1)},title:v,children:c.jsx("i",{className:$(v,"black-icon")})},v))})})]}),s.length>0&&i&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${r}`,children:s})]})}const jt=(e,n,t)=>{const r=t*n,o=r*(1-Math.abs(e/60%2-1)),l=t-r;let s,i,a;return e<60?[s,i,a]=[r,o,0]:e<120?[s,i,a]=[o,r,0]:e<180?[s,i,a]=[0,r,o]:e<240?[s,i,a]=[0,o,r]:e<300?[s,i,a]=[o,0,r]:[s,i,a]=[r,0,o],[Math.round((s+l)*255),Math.round((i+l)*255),Math.round((a+l)*255)]},an=(e,n,t)=>{e/=255,n/=255,t/=255;const r=Math.max(e,n,t),o=Math.min(e,n,t),l=r-o;let s;const i=r,a=r===0?0:l/r;if(r===o)s=0;else{switch(r){case e:s=(n-t)/l+(n<t?6:0);break;case n:s=(t-e)/l+2;break;case t:s=(e-n)/l+4;break}s*=60}return[s,a,i]},ut=(e,n,t)=>"#"+[e,n,t].map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase(),gr=e=>/^#[0-9A-Fa-f]{6}$/.test(e)?[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]:[255,0,0];function Xi({value:e,onChange:n,disabled:t,label:r="",classNameLabel:o="",helperText:l="",isError:s=!1,isReadOnly:i=!1,name:a}){const m=u.useRef(!0),d=u.useRef(null),h=u.useRef(null),[x,f]=u.useState(!1),[v,g]=u.useState([182.2,.849,.494]),[b,E]=u.useState(e),w=u.useCallback(j=>{n({target:{value:j,name:a}})},[a,n]);u.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const j=gr(e);g(an(...j)),E(e.toUpperCase())}},[e]);const[y,O,F]=v,[D,U,V]=jt(y,O,F),z=ut(D,U,V);u.useEffect(()=>{E(z)},[z]),u.useEffect(()=>{!m.current||i||(m.current=!1,w(z))},[z,w,i]),u.useEffect(()=>{function j(H){if(!d.current||!d.current._dragging)return;const J=d.current.getBoundingClientRect();let ne=(H.touches?H.touches[0].clientX:H.clientX)-J.left,ie=(H.touches?H.touches[0].clientY:H.clientY)-J.top;ne=Math.max(0,Math.min(J.width,ne)),ie=Math.max(0,Math.min(J.height,ie));const ae=ne/J.width,ge=1-ie/J.height;g([y,ae,ge]);const[we,q,ue]=jt(y,ae,ge),A=ut(we,q,ue);E(A),w(A)}function I(){d.current&&(d.current._dragging=!1),window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",I),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",I)}return d.current&&d.current._dragging&&(window.addEventListener("mousemove",j),window.addEventListener("mouseup",I),window.addEventListener("touchmove",j),window.addEventListener("touchend",I)),()=>{window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",I),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",I)}},[w,y]),u.useEffect(()=>{function j(I){x&&h.current&&!h.current.contains(I.target)&&f(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[x]);const _=j=>{if(!d.current)return;const I=d.current.getBoundingClientRect();let H=(j.touches?j.touches[0].clientX:j.clientX)-I.left,J=(j.touches?j.touches[0].clientY:j.clientY)-I.top;H=Math.max(0,Math.min(I.width,H)),J=Math.max(0,Math.min(I.height,J));const ne=H/I.width,ie=1-J/I.height;g([y,ne,ie]);const[ae,ge,we]=jt(y,ne,ie),q=ut(ae,ge,we);E(q),w(q)},k=j=>{t||(d.current&&(d.current._dragging=!0),_(j))},L=()=>{d.current&&(d.current._dragging=!1)},R=j=>{const I=Number(j.target.value);g([I,O,F]);const[H,J,ne]=jt(I,O,F),ie=ut(H,J,ne);E(ie),w(ie)},W=j=>{const I=j.target.value;if(E(I),/^#[0-9A-Fa-f]{6}$/.test(I)){const H=gr(I);g(an(...H)),w(I.toUpperCase())}},S=(j,I)=>{const H=[D,U,V];H[j]=Math.max(0,Math.min(255,Number(I)||0)),g(an(...H));const J=ut(...H);E(J),w(J)},B=O*180,Y=(1-F)*180;return c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:Te("block text-sm font-medium leading-6",o||"text-gray-700"),children:r}),c.jsxs("div",{style:{position:"relative",display:"inline-block"},ref:h,className:"w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 dropdown-trigger rounded-md border p-2 border-default-2 w-full",onClick:()=>!t&&f(!x),children:[c.jsx("div",{className:"rounded border border-default-2 flex-shrink-0 w-6 h-6",style:{backgroundColor:i?"":z}}),c.jsx("input",{type:"text",className:"px-2 py-1 border-b border-t-0 border-l-0 border-r-0 border-default-7 text-xs focus:border-default-5 focus:ring-0 w-full",value:i?"":b,disabled:t,onChange:W,readOnly:i}),c.jsx(on,{className:Te("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":x&&!i})})]}),x&&!i&&c.jsxs("div",{className:"openSketch absolute z-20 top-14 left-0 bg-white border border-default-5 rounded-md p-4 shadow-md w-full",children:[c.jsxs("div",{className:"relative rounded mb-2 cursor-crosshair",ref:d,style:{backgroundColor:`hsl(${y}, 100%, 50%)`,height:"200px"},onMouseDown:k,onMouseMove:j=>d.current&&d.current._dragging&&_(j),onMouseUp:L,onMouseLeave:L,onTouchStart:k,onTouchMove:j=>d.current&&d.current._dragging&&_(j),onTouchEnd:L,children:[c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, #000, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow",style:{left:`calc(${B}px - 8px)`,top:`calc(${Y}px - 8px)`,background:z,pointerEvents:"none"}})]}),c.jsx("input",{type:"range",min:0,max:359,value:y,onChange:R,className:"w-full mb-2",style:{background:"linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"},disabled:t}),c.jsx("div",{className:"flex gap-2 mb-2",children:["R","G","B"].map((j,I)=>c.jsxs("div",{children:[c.jsx("label",{className:"text-center block",children:j}),c.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[D,U,V][I],onChange:H=>S(I,H.target.value),disabled:t,placeholder:j})]},I))})]})]}),l&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:l})]})}const Ji=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Qi=({className:e="",label:n="",onChange:t,name:r,id:o,value:l="#FFCEC7"})=>{const[s,i]=u.useState(!1),[a,m]=u.useState("#FFCEC7");hn({id:"menu-colors",close:()=>i(!1)}),u.useEffect(()=>{m(l)},[l]);const d=h=>{m(h),i(!1),t({target:{value:h,checked:!1,name:r,type:void 0,id:o}})};return c.jsxs("div",{className:$("relative",e!==""&&e),children:[n&&c.jsx("p",{className:"text-sm font-medium leading-6 text-gray-500 mb-0.5",children:n}),c.jsxs("div",{className:"flex justify-center items-center bg-gray-100 px-3 rounded-md h-10 w-20 gap-4 cursor-pointer",onClick:()=>i(!s),id:"menu-colors","data-testid":"menu-colors",children:[c.jsx("div",{style:{width:"18px",height:"18px",backgroundColor:a},className:"rounded-full"}),c.jsx(on,{className:$("h-5 w-5 transition-transform",s&&"transform rotate-180")})]}),c.jsx(Le,{show:s,enter:"transition-opacity duration-75",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",id:"menu-colors",className:"absolute top-full",children:c.jsx("div",{id:"menu-colors",className:"bg-gray-100 shadow grid gap-2 p-2 mt-2 rounded",style:{gridTemplateColumns:"repeat(auto-fill, minmax(17px, 1fr))",maxWidth:"180px"},children:Ji.map((h,x)=>c.jsx("div",{style:{width:"17px",height:"17px",backgroundColor:h},className:"rounded-full cursor-pointer flex justify-center items-center",onClick:()=>d(h),"data-testid":`color-${x}`,children:a===h&&c.jsx(ri,{className:"w-3 h-3 text-white",stroke:"2"})},x))})})]})},ea=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-red-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"PDF"})]}),ta=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-blue-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"DOC"})]}),na=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-green-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"XLS"})]}),ra=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16",style:{color:"#059669"},children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"CSV"})]}),oa=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-gray-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"TXT"})]}),sa=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-gray-400",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"8",fill:"currentColor",children:"?"})]}),la=({onChangeValue:e,className:n="",classNameContainerImg:t="",title:r="Logo (Opcional)",fileFormatsDescription:o="PNG, JPG, GIF, PDF up to 10MB",acceptTypes:l,maxFileSize:s=10,onError:i,helperText:a="",isError:m=!1,multiple:d=!1,maxNumberOfFiles:h=null,failAllOnError:x=!0,id:f,initialValue:v=[],isClearFiles:g=!1})=>{const[b,E]=u.useState([]),[w,y]=u.useState(!1),O=u.useRef(null);u.useEffect(()=>{g&&E([])},[g]),u.useEffect(()=>{if(!v||v.length===0)return;(async()=>{const L=await Promise.all(v.map(async R=>{var W,S;if(R instanceof File){const B=await new Promise((Y,j)=>{const I=new FileReader;I.onload=()=>Y(I.result),I.onerror=j,I.readAsDataURL(R)});return{file:R,preview:B,type:R.type}}if(typeof R=="string"){const B=((W=R.split("/").pop())==null?void 0:W.split("?")[0])||"Archivo",Y=(S=B.split(".").pop())==null?void 0:S.toLowerCase();return{file:{name:B,size:0},preview:R,type:["jpg","jpeg","png","gif","webp","svg"].includes(Y)?`image/${Y==="jpg"?"jpeg":Y}`:""}}return null}));E(L.filter(Boolean))})()},[]);const F=k=>k.size/1048576<=s,D=k=>{const L=Array.from(k);if(h&&L.length+b.length>h){i==null||i(`Puedes subir hasta ${h} archivo${h>1?"s":""}.`);return}const R=L.map(W=>new Promise((S,B)=>{if(l&&!l.includes(W.type)){B(new Error("Tipo de archivo no permitido"));return}if(!F(W)){B(new Error(`El archivo no puede superar ${s}MB`));return}const Y=new FileReader;Y.onload=()=>S({file:W,preview:Y.result,type:W.type}),Y.onerror=()=>B(new Error("Error al leer el archivo")),Y.readAsDataURL(W)}));Promise.allSettled(R).then(W=>{const S=W.filter(j=>j.status==="rejected"),B=W.filter(j=>j.status==="fulfilled").map(j=>j.value);if(x&&S.length>0){i==null||i(S[S.length-1].reason.message);return}else S.length>0&&(i==null||i(S[S.length-1].reason.message));if(B.length===0)return;E(j=>[...j,...B]);const Y=B.length===1?B[0].preview:B.map(j=>j.preview);e(f,Y)})},U=k=>{const L=[...b];URL.revokeObjectURL(L[k].preview),L.splice(k,1);const R=L.map(W=>W.preview);E(L),e(f,R)},V=k=>{k.preventDefault(),y(!1),k.dataTransfer.files.length>0&&D(k.dataTransfer.files)},z=k=>{const L=k.file.name.split(".").pop().toLowerCase();return{pdf:"pdf",doc:"word",docx:"word",xls:"excel",xlsx:"excel",csv:"csv",txt:"text"}[L]||"unknown"},_=k=>{if(!k)return"0 Bytes";const L=["Bytes","KB","MB","GB","TB"],R=Math.floor(Math.log(k)/Math.log(1024));return`${(k/Math.pow(1024,R)).toFixed(R===0?0:2)} ${L[R]}`};return c.jsxs("div",{className:$("col-span-full",n),children:[c.jsx("label",{className:"block text-sm font-medium leading-6 text-gray-500",children:r}),c.jsx("div",{className:$("mt-2 flex justify-center rounded-lg border-2 border-dotted relative cursor-pointer transition",m?"border-red-300":"border-gray-300",w?"border-indigo-500 bg-indigo-50":"",t),onClick:()=>{var k;return(k=O.current)==null?void 0:k.click()},onDragEnter:()=>y(!0),onDragLeave:()=>y(!1),onDragOver:k=>{k.preventDefault(),k.dataTransfer.dropEffect="copy"},onDrop:V,children:c.jsxs("div",{className:"text-center py-6",children:[c.jsx(ir,{className:$("mx-auto h-9 w-9",m?"text-red-900":"text-gray-300")}),c.jsxs("div",{className:$("mt-4 flex text-sm justify-center",m?"text-red-900":"text-gray-600"),children:[c.jsxs("label",{className:"cursor-pointer font-semibold text-primary-7 hover:text-primary-6",children:["Subir un archivo",c.jsx("input",{ref:O,type:"file",multiple:d,className:"hidden",onChange:k=>D(k.target.files),accept:l!==void 0?l.join(","):void 0})]}),c.jsx("p",{className:"pl-2",children:"o arrástralo y suéltalo aquí"})]}),c.jsx("p",{className:$("text-xs mt-2",m?"text-red-900":"text-gray-600"),children:o})]})}),b.length>0&&c.jsx("div",{className:"mt-4 grid grid-cols-2 md:grid-cols-3 gap-4",children:b.map((k,L)=>{var R;return c.jsxs("div",{className:"group relative bg-white border border-gray-200 rounded-xl p-4 shadow-sm hover:shadow-md hover:-translate-y-1 transition-all cursor-pointer",children:[c.jsx("button",{type:"button",onClick:()=>U(L),className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition bg-white rounded-full p-1 shadow hover:bg-red-50",children:c.jsx(ar,{className:"h-4 w-4 text-red-500"})}),c.jsxs("div",{className:"flex flex-col items-center text-center",children:[(R=k.type)!=null&&R.startsWith("image/")?c.jsx("img",{src:k.preview,alt:"Preview",className:"w-16 h-16 object-contain rounded-lg mb-3"}):c.jsx("div",{className:"w-16 h-16 flex items-center justify-center rounded-xl mb-3 bg-gray-100 p-1",children:{pdf:c.jsx(ea,{}),word:c.jsx(ta,{}),excel:c.jsx(na,{}),csv:c.jsx(ra,{}),text:c.jsx(oa,{}),unknown:c.jsx(sa,{})}[z(k)]}),c.jsx("p",{className:"text-sm font-semibold truncate w-full text-default-5",children:k.file.name}),c.jsx("p",{className:"text-xs text-gray-500",children:k.file.size?_(k.file.size):""})]})]},L)})}),a&&m&&c.jsx("p",{className:"text-red-600 text-sm mt-1",children:a})]})};G.Accordion=qi,G.Alert=mi,G.Avatar=ji,G.Bullets=Ci,G.ButtonOutline=cr,G.ButtonPagination=dr,G.ButtonSolid=lt,G.Checkbox=Ni,G.ConfirmationAbandoningCreation=Li,G.CoverPhoto=Yi,G.Divider=_i,G.Dropdown=Hi,G.FileUploadPreview=la,G.GoBack=Ri,G.IconSelectPicker=Zi,G.Image=Gi,G.Input=it,G.InputDropdown=zi,G.MESSAGE_ABORT_CONTROLLER=Ar,G.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=Dr,G.Modal=hr,G.Pagination=Vi,G.Select=vr,G.SelectColor=Qi,G.SketchColorPicker=Xi,G.Spinner=Bi,G.SpinnerIcon=at,G.Switch=Wi,G.Textarea=Ui,G.Tooltip=sn,G.classNames=$,G.copyOptions=Nt,G.generateAvatarInitials=Fr,G.groupBy=Pr,G.isPromise=Mr,G.rowsPerPage=ln,G.useCloseModal=hn,G.useForm=Lr,G.useMediaQuery=_r,G.useWindowDimensions=vn,G.validateEmail=pn,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
69
|
+
`}),o!==""&&c.jsx("p",{className:I("block text-sm font-medium leading-6",l!==""?l:"text-gray-700"),"data-testid":`label-${r}`,children:o}),c.jsxs("div",{style:{position:"relative",width:"100%"},className:I("border rounded-md",f),ref:x,children:[c.jsxs("div",{className:"flex items-center gap-2 dropdown-trigger border border-default-2 rounded-md p-1.5",onClick:()=>!t&&h(!d),style:{cursor:t?"not-allowed":"pointer"},title:e||"Selecciona un icono","data-testid":"open",children:[c.jsx("div",{className:"rounded border border-default-2 p-1 h-6 w-6 bg-default-2 flex items-center justify-center",children:e&&c.jsx("i",{className:I(e,"text-normal block")})}),c.jsx("div",{className:"truncate",style:{flexGrow:1,minWidth:0,overflow:"hidden"},children:e}),c.jsx(pr,{className:I("h-5 w-5 ml-auto transition-transform flex-shrink-0",{"transform rotate-180":d})})]}),d&&c.jsx("div",{className:"openIconSelect absolute z-10 bg-white p-3 rounded-lg",style:{top:48,left:"0",width:"100%",maxWidth:500,border:"1px solid #ccc",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",maxHeight:300,overflowY:"auto"},children:c.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:"repeat(auto-fill, minmax(30px, 1fr))",gap:12},children:Ki.map(v=>c.jsx("button",{type:"button",className:"icon-picker-btn",style:{width:"100%",aspectRatio:"1",borderRadius:4,border:e===v?"2px solid #007bff":"1px solid #eee",background:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,color:e===v?"#007bff":"#333",outline:"none",cursor:"pointer"},onClick:()=>{n({target:{value:v,checked:!1,name:m,id:r}}),h(!1)},title:v,children:c.jsx("i",{className:I(v,"black-icon")})},v))})})]}),s.length>0&&i&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${r}`,children:s})]})}const jt=(e,n,t)=>{const r=t*n,o=r*(1-Math.abs(e/60%2-1)),l=t-r;let s,i,a;return e<60?[s,i,a]=[r,o,0]:e<120?[s,i,a]=[o,r,0]:e<180?[s,i,a]=[0,r,o]:e<240?[s,i,a]=[0,o,r]:e<300?[s,i,a]=[o,0,r]:[s,i,a]=[r,0,o],[Math.round((s+l)*255),Math.round((i+l)*255),Math.round((a+l)*255)]},an=(e,n,t)=>{e/=255,n/=255,t/=255;const r=Math.max(e,n,t),o=Math.min(e,n,t),l=r-o;let s;const i=r,a=r===0?0:l/r;if(r===o)s=0;else{switch(r){case e:s=(n-t)/l+(n<t?6:0);break;case n:s=(t-e)/l+2;break;case t:s=(e-n)/l+4;break}s*=60}return[s,a,i]},ut=(e,n,t)=>"#"+[e,n,t].map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase(),gr=e=>/^#[0-9A-Fa-f]{6}$/.test(e)?[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]:[255,0,0];function Xi({value:e,onChange:n,disabled:t,label:r="",classNameLabel:o="",helperText:l="",isError:s=!1,isReadOnly:i=!1,name:a}){const m=u.useRef(!0),d=u.useRef(null),h=u.useRef(null),[x,f]=u.useState(!1),[v,g]=u.useState([182.2,.849,.494]),[b,E]=u.useState(e),w=u.useCallback(j=>{n({target:{value:j,name:a}})},[a,n]);u.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const j=gr(e);g(an(...j)),E(e.toUpperCase())}},[e]);const[y,k,$]=v,[_,W,V]=jt(y,k,$),z=ut(_,W,V);u.useEffect(()=>{E(z)},[z]),u.useEffect(()=>{!m.current||i||(m.current=!1,w(z))},[z,w,i]),u.useEffect(()=>{function j(H){if(!d.current||!d.current._dragging)return;const J=d.current.getBoundingClientRect();let ne=(H.touches?H.touches[0].clientX:H.clientX)-J.left,ie=(H.touches?H.touches[0].clientY:H.clientY)-J.top;ne=Math.max(0,Math.min(J.width,ne)),ie=Math.max(0,Math.min(J.height,ie));const ae=ne/J.width,ge=1-ie/J.height;g([y,ae,ge]);const[we,Y,ue]=jt(y,ae,ge),L=ut(we,Y,ue);E(L),w(L)}function F(){d.current&&(d.current._dragging=!1),window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",F),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",F)}return d.current&&d.current._dragging&&(window.addEventListener("mousemove",j),window.addEventListener("mouseup",F),window.addEventListener("touchmove",j),window.addEventListener("touchend",F)),()=>{window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",F),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",F)}},[w,y]),u.useEffect(()=>{function j(F){x&&h.current&&!h.current.contains(F.target)&&f(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[x]);const C=j=>{if(!d.current)return;const F=d.current.getBoundingClientRect();let H=(j.touches?j.touches[0].clientX:j.clientX)-F.left,J=(j.touches?j.touches[0].clientY:j.clientY)-F.top;H=Math.max(0,Math.min(F.width,H)),J=Math.max(0,Math.min(F.height,J));const ne=H/F.width,ie=1-J/F.height;g([y,ne,ie]);const[ae,ge,we]=jt(y,ne,ie),Y=ut(ae,ge,we);E(Y),w(Y)},P=j=>{t||(d.current&&(d.current._dragging=!0),C(j))},D=()=>{d.current&&(d.current._dragging=!1)},B=j=>{const F=Number(j.target.value);g([F,k,$]);const[H,J,ne]=jt(F,k,$),ie=ut(H,J,ne);E(ie),w(ie)},U=j=>{const F=j.target.value;if(E(F),/^#[0-9A-Fa-f]{6}$/.test(F)){const H=gr(F);g(an(...H)),w(F.toUpperCase())}},S=(j,F)=>{const H=[_,W,V];H[j]=Math.max(0,Math.min(255,Number(F)||0)),g(an(...H));const J=ut(...H);E(J),w(J)},R=k*180,X=(1-$)*180;return c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:Te("block text-sm font-medium leading-6",o||"text-gray-700"),children:r}),c.jsxs("div",{style:{position:"relative",display:"inline-block"},ref:h,className:"w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 dropdown-trigger rounded-md border p-2 border-default-2 w-full",onClick:()=>!t&&f(!x),children:[c.jsx("div",{className:"rounded border border-default-2 flex-shrink-0 w-6 h-6",style:{backgroundColor:i?"":z}}),c.jsx("input",{type:"text",className:"px-2 py-1 border-b border-t-0 border-l-0 border-r-0 border-default-7 text-xs focus:border-default-5 focus:ring-0 w-full",value:i?"":b,disabled:t,onChange:U,readOnly:i}),c.jsx(on,{className:Te("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":x&&!i})})]}),x&&!i&&c.jsxs("div",{className:"openSketch absolute z-20 top-14 left-0 bg-white border border-default-5 rounded-md p-4 shadow-md w-full",children:[c.jsxs("div",{className:"relative rounded mb-2 cursor-crosshair",ref:d,style:{backgroundColor:`hsl(${y}, 100%, 50%)`,height:"200px"},onMouseDown:P,onMouseMove:j=>d.current&&d.current._dragging&&C(j),onMouseUp:D,onMouseLeave:D,onTouchStart:P,onTouchMove:j=>d.current&&d.current._dragging&&C(j),onTouchEnd:D,children:[c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, #000, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow",style:{left:`calc(${R}px - 8px)`,top:`calc(${X}px - 8px)`,background:z,pointerEvents:"none"}})]}),c.jsx("input",{type:"range",min:0,max:359,value:y,onChange:B,className:"w-full mb-2",style:{background:"linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"},disabled:t}),c.jsx("div",{className:"flex gap-2 mb-2",children:["R","G","B"].map((j,F)=>c.jsxs("div",{children:[c.jsx("label",{className:"text-center block",children:j}),c.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[_,W,V][F],onChange:H=>S(F,H.target.value),disabled:t,placeholder:j})]},F))})]})]}),l&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:l})]})}const Ji=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Qi=({className:e="",label:n="",onChange:t,name:r,id:o,value:l="#FFCEC7"})=>{const[s,i]=u.useState(!1),[a,m]=u.useState("#FFCEC7");hn({id:"menu-colors",close:()=>i(!1)}),u.useEffect(()=>{m(l)},[l]);const d=h=>{m(h),i(!1),t({target:{value:h,checked:!1,name:r,type:void 0,id:o}})};return c.jsxs("div",{className:I("relative",e!==""&&e),children:[n&&c.jsx("p",{className:"text-sm font-medium leading-6 text-gray-500 mb-0.5",children:n}),c.jsxs("div",{className:"flex justify-center items-center bg-gray-100 px-3 rounded-md h-10 w-20 gap-4 cursor-pointer",onClick:()=>i(!s),id:"menu-colors","data-testid":"menu-colors",children:[c.jsx("div",{style:{width:"18px",height:"18px",backgroundColor:a},className:"rounded-full"}),c.jsx(on,{className:I("h-5 w-5 transition-transform",s&&"transform rotate-180")})]}),c.jsx(Le,{show:s,enter:"transition-opacity duration-75",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",id:"menu-colors",className:"absolute top-full",children:c.jsx("div",{id:"menu-colors",className:"bg-gray-100 shadow grid gap-2 p-2 mt-2 rounded",style:{gridTemplateColumns:"repeat(auto-fill, minmax(17px, 1fr))",maxWidth:"180px"},children:Ji.map((h,x)=>c.jsx("div",{style:{width:"17px",height:"17px",backgroundColor:h},className:"rounded-full cursor-pointer flex justify-center items-center",onClick:()=>d(h),"data-testid":`color-${x}`,children:a===h&&c.jsx(ri,{className:"w-3 h-3 text-white",stroke:"2"})},x))})})]})},ea=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-red-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"PDF"})]}),ta=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-blue-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"DOC"})]}),na=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-green-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"XLS"})]}),ra=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16",style:{color:"#059669"},children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"CSV"})]}),oa=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-gray-600",children:[c.jsx("rect",{x:"4",y:"2",width:"16",height:"20",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fill:"currentColor",children:"TXT"})]}),sa=()=>c.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",className:"w-16 h-16 text-gray-400",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),c.jsx("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"8",fill:"currentColor",children:"?"})]}),la=({onChangeValue:e,className:n="",classNameContainerImg:t="",title:r="Logo (Opcional)",fileFormatsDescription:o="PNG, JPG, GIF, PDF up to 10MB",acceptTypes:l,maxFileSize:s=10,onError:i,helperText:a="",isError:m=!1,multiple:d=!1,maxNumberOfFiles:h=null,failAllOnError:x=!0,id:f,initialValue:v=[],isClearFiles:g=!1})=>{const[b,E]=u.useState([]),[w,y]=u.useState(!1);u.useEffect(()=>{g&&E([])},[g]),u.useEffect(()=>{if(!v||v.length===0)return;(async()=>{const P=await Promise.all(v.map(async D=>{var B,U;if(D instanceof File){const S=await new Promise((R,X)=>{const j=new FileReader;j.onload=()=>R(j.result),j.onerror=X,j.readAsDataURL(D)});return{file:D,preview:S,type:D.type}}if(typeof D=="string"){const S=((B=D.split("/").pop())==null?void 0:B.split("?")[0])||"Archivo",R=(U=S.split(".").pop())==null?void 0:U.toLowerCase();return{file:{name:S,size:0},preview:D,type:["jpg","jpeg","png","gif","webp","svg"].includes(R)?`image/${R==="jpg"?"jpeg":R}`:""}}return null}));E(P.filter(Boolean))})()},[]);const k=C=>C.size/1048576<=s,$=C=>{const P=Array.from(C);if(h&&P.length+b.length>h){i==null||i(`Puedes subir hasta ${h} archivo${h>1?"s":""}.`);return}const D=P.map(B=>new Promise((U,S)=>{if(l&&!l.includes(B.type)){S(new Error("Tipo de archivo no permitido"));return}if(!k(B)){S(new Error(`El archivo no puede superar ${s}MB`));return}const R=new FileReader;R.onload=()=>U({file:B,preview:R.result,type:B.type}),R.onerror=()=>S(new Error("Error al leer el archivo")),R.readAsDataURL(B)}));Promise.allSettled(D).then(B=>{const U=B.filter(R=>R.status==="rejected"),S=B.filter(R=>R.status==="fulfilled").map(R=>R.value);if(x&&U.length>0){i==null||i(U[U.length-1].reason.message);return}else U.length>0&&(i==null||i(U[U.length-1].reason.message));S.length!==0&&(E(R=>[...R,...S]),e(f,[...b,...S]))})},_=C=>{const P=[...b];URL.revokeObjectURL(P[C].preview),P.splice(C,1),E(P),e(f,P)},W=C=>{C.preventDefault(),y(!1),C.dataTransfer.files.length>0&&$(C.dataTransfer.files)},V=C=>{const P=C.file.name.split(".").pop().toLowerCase();return{pdf:"pdf",doc:"word",docx:"word",xls:"excel",xlsx:"excel",csv:"csv",txt:"text"}[P]||"unknown"},z=C=>{if(!C)return"0 Bytes";const P=["Bytes","KB","MB","GB","TB"],D=Math.floor(Math.log(C)/Math.log(1024));return`${(C/Math.pow(1024,D)).toFixed(D===0?0:2)} ${P[D]}`};return c.jsxs("div",{className:I("col-span-full",n),children:[c.jsx("label",{className:"block text-sm font-medium leading-6 text-gray-500",children:r}),c.jsxs("label",{className:I("mt-2 flex justify-center rounded-lg border-2 border-dotted relative cursor-pointer transition",m?"border-red-300":"border-gray-300",w?"border-indigo-500 bg-indigo-50":"",t),onDragEnter:()=>y(!0),onDragLeave:()=>y(!1),onDragOver:C=>{C.preventDefault(),C.dataTransfer.dropEffect="copy"},onDrop:W,children:[c.jsx("input",{type:"file",multiple:d,className:"hidden",onChange:C=>$(C.target.files),accept:l!==void 0?l.join(","):void 0}),c.jsxs("div",{className:"text-center py-6 pointer-events-none",children:[c.jsx(ir,{className:I("mx-auto h-9 w-9",m?"text-red-900":"text-gray-300")}),c.jsxs("div",{className:I("mt-4 flex text-sm justify-center",m?"text-red-900":"text-gray-600"),children:[c.jsx("span",{className:"font-semibold text-primary-7 hover:text-primary-6",children:"Subir un archivo"}),c.jsx("p",{className:"pl-2",children:"o arrástralo y suéltalo aquí"})]}),c.jsx("p",{className:I("text-xs mt-2",m?"text-red-900":"text-gray-600"),children:o})]})]}),b.length>0&&c.jsx("div",{className:"mt-4 grid grid-cols-2 md:grid-cols-3 gap-4",children:b.map((C,P)=>{var D;return c.jsxs("div",{className:"group relative bg-white border border-gray-200 rounded-xl p-4 shadow-sm hover:shadow-md hover:-translate-y-1 transition-all cursor-pointer",children:[c.jsx("button",{type:"button",onClick:()=>_(P),className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition bg-white rounded-full p-1 shadow hover:bg-red-50",children:c.jsx(ar,{className:"h-4 w-4 text-red-500"})}),c.jsxs("div",{className:"flex flex-col items-center text-center",children:[(D=C.type)!=null&&D.startsWith("image/")?c.jsx("img",{src:C.preview,alt:"Preview",className:"w-16 h-16 object-contain rounded-lg mb-3"}):c.jsx("div",{className:"w-16 h-16 flex items-center justify-center rounded-xl mb-3 bg-gray-100 p-1",children:{pdf:c.jsx(ea,{}),word:c.jsx(ta,{}),excel:c.jsx(na,{}),csv:c.jsx(ra,{}),text:c.jsx(oa,{}),unknown:c.jsx(sa,{})}[V(C)]}),c.jsx("p",{className:"text-sm font-semibold truncate w-full text-default-5",children:C.file.name}),c.jsx("p",{className:"text-xs text-gray-500",children:C.file.size?z(C.file.size):""})]})]},P)})}),a&&m&&c.jsx("p",{className:"text-red-600 text-sm mt-1",children:a})]})};q.Accordion=qi,q.Alert=mi,q.Avatar=ji,q.Bullets=Ci,q.ButtonOutline=cr,q.ButtonPagination=dr,q.ButtonSolid=lt,q.Checkbox=Ni,q.ConfirmationAbandoningCreation=Li,q.CoverPhoto=Yi,q.Divider=_i,q.Dropdown=Hi,q.FileUploadPreview=la,q.GoBack=Ri,q.IconSelectPicker=Zi,q.Image=Gi,q.Input=it,q.InputDropdown=zi,q.MESSAGE_ABORT_CONTROLLER=Ar,q.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=Dr,q.Modal=hr,q.Pagination=Vi,q.Select=vr,q.SelectColor=Qi,q.SketchColorPicker=Xi,q.Spinner=Bi,q.SpinnerIcon=at,q.Switch=Wi,q.Textarea=Ui,q.Tooltip=sn,q.classNames=I,q.copyOptions=Nt,q.generateAvatarInitials=Fr,q.groupBy=Pr,q.isPromise=Mr,q.rowsPerPage=ln,q.useCloseModal=hn,q.useForm=Lr,q.useMediaQuery=_r,q.useWindowDimensions=vn,q.validateEmail=pn,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|