cemtrik-dependencies 1.0.230 → 1.0.232
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 +16 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(G,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):(G=typeof globalThis<"u"?globalThis:G||self,u(G["cemtrik-dependencies"]={},G.React,G.ReactDOM))})(this,function(G,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 C=$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 $(...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,O={radio:y,checkbox:g};e.current={...v,...e.current,[E]:O[w]??b},t({...e.current,[E]:O[w]??b}),f({...e.current,[E]:O[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
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var gn;function
|
|
9
|
+
*/var gn;function Br(){if(gn)return qe;gn=1;var e=u,n=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(i,a,m){var d,h={},x=null,f=null;m!==void 0&&(x=""+m),a.key!==void 0&&(x=""+a.key),a.ref!==void 0&&(f=a.ref);for(d in a)r.call(a,d)&&!l.hasOwnProperty(d)&&(h[d]=a[d]);if(i&&i.defaultProps)for(d in a=i.defaultProps,a)h[d]===void 0&&(h[d]=a[d]);return{$$typeof:n,type:i,key:x,ref:f,props:h,_owner:o.current}}return qe.Fragment=t,qe.jsx=s,qe.jsxs=s,qe}var Ge={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -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
|
|
18
|
-
`+
|
|
19
|
-
`),ye=
|
|
20
|
-
`),ve=ee.length-1,
|
|
21
|
-
`+ee[ve].replace(" at new "," at ");return p.displayName&&
|
|
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 T=v&&p[v]||p[g];return typeof T=="function"?T:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var T=arguments.length,P=new Array(T>1?T-1:0),Z=1;Z<T;Z++)P[Z-1]=arguments[Z];y("error",p,P)}}function y(p,T,P){{var Z=E.ReactDebugCurrentFrame,oe=Z.getStackAddendum();oe!==""&&(T+="%s",P=P.concat([oe]));var ce=P.map(function(te){return String(te)});ce.unshift("Warning: "+T),Function.prototype.apply.call(console[p],console,ce)}}var O=!1,F=!1,D=!1,U=!1,V=!1,z;z=Symbol.for("react.module.reference");function _(p){return!!(typeof p=="string"||typeof p=="function"||p===r||p===l||V||p===o||p===m||p===d||U||p===f||O||F||D||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 k(p,T,P){var Z=p.displayName;if(Z)return Z;var oe=T.displayName||T.name||"";return oe!==""?P+"("+oe+")":P}function L(p){return p.displayName||"Context"}function R(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 T=p;return L(T)+".Consumer";case s:var P=p;return L(P._context)+".Provider";case a:return k(p,p.render,"ForwardRef");case h:var Z=p.displayName||null;return Z!==null?Z:R(p.type)||"Memo";case x:{var oe=p,ce=oe._payload,te=oe._init;try{return R(te(ce))}catch{return null}}}return null}var W=Object.assign,S=0,B,Y,j,I,H,J,ne;function ie(){}ie.__reactDisabledLog=!0;function ae(){{if(S===0){B=console.log,Y=console.info,j=console.warn,I=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:W({},p,{value:B}),info:W({},p,{value:Y}),warn:W({},p,{value:j}),error:W({},p,{value:I}),group:W({},p,{value:H}),groupCollapsed:W({},p,{value:J}),groupEnd:W({},p,{value:ne})})}S<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var we=E.ReactCurrentDispatcher,q;function ue(p,T,P){{if(q===void 0)try{throw Error()}catch(oe){var Z=oe.stack.trim().match(/\n( *(at )?)/);q=Z&&Z[1]||""}return`
|
|
18
|
+
`+q+p}}var A=!1,X;{var N=typeof WeakMap=="function"?WeakMap:Map;X=new N}function K(p,T){if(!p||A)return"";{var P=X.get(p);if(P!==void 0)return P}var Z;A=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ce;ce=we.current,we.current=null,ae();try{if(T){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){Z=Fe}Reflect.construct(p,[],te)}else{try{te.call()}catch(Fe){Z=Fe}p.call(te.prototype)}}else{try{throw Error()}catch(Fe){Z=Fe}p()}}catch(Fe){if(Fe&&Z&&typeof Fe.stack=="string"){for(var ee=Fe.stack.split(`
|
|
19
|
+
`),ye=Z.stack.split(`
|
|
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"&&X.set(p,je),je}while(ve>=1&&xe>=0);break}}}finally{A=!1,we.current=ce,ge(),Error.prepareStackTrace=oe}var Ye=p?p.displayName||p.name:"",Ir=Ye?ue(Ye):"";return typeof p=="function"&&X.set(p,Ir),Ir}function Q(p,T,P){return K(p,!1)}function Se(p){var T=p.prototype;return!!(T&&T.isReactComponent)}function ze(p,T,P){if(p==null)return"";if(typeof p=="function")return K(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,T,P);case x:{var Z=p,oe=Z._payload,ce=Z._init;try{return ze(ce(oe),T,P)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,xr={},br=E.ReactDebugCurrentFrame;function Ct(p){if(p){var T=p._owner,P=ze(p.type,p._source,T?T.type:null);br.setExtraStackFrame(P)}else br.setExtraStackFrame(null)}function ia(p,T,P,Z,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((Z||"React class")+": "+P+" 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](T,te,Z,P,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).",Z||"React class",P,te,typeof ee),Ct(null)),ee instanceof Error&&!(ee.message in xr)&&(xr[ee.message]=!0,Ct(oe),w("Failed %s type: %s",P,ee.message),Ct(null))}}}var aa=Array.isArray;function un(p){return aa(p)}function ua(p){{var T=typeof Symbol=="function"&&Symbol.toStringTag,P=T&&p[Symbol.toStringTag]||p.constructor.name||"Object";return P}}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 T=Object.getOwnPropertyDescriptor(p,"ref").get;if(T&&T.isReactWarning)return!1}return p.ref!==void 0}function ma(p){if(We.call(p,"key")){var T=Object.getOwnPropertyDescriptor(p,"key").get;if(T&&T.isReactWarning)return!1}return p.key!==void 0}function pa(p,T){if(typeof p.ref=="string"&&ct.current&&T&&ct.current.stateNode!==T){var P=R(ct.current.type);cn[P]||(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',R(ct.current.type),p.ref),cn[P]=!0)}}function ha(p,T){{var P=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)",T))};P.isReactWarning=!0,Object.defineProperty(p,"key",{get:P,configurable:!0})}}function va(p,T){{var P=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)",T))};P.isReactWarning=!0,Object.defineProperty(p,"ref",{get:P,configurable:!0})}}var ga=function(p,T,P,Z,oe,ce,te){var ee={$$typeof:n,type:p,key:T,ref:P,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:Z}),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,T,P,Z,oe){{var ce,te={},ee=null,ye=null;P!==void 0&&(yr(P),ee=""+P),ma(T)&&(yr(T.key),ee=""+T.key),fa(T)&&(ye=T.ref,pa(T,oe));for(ce in T)We.call(T,ce)&&!da.hasOwnProperty(ce)&&(te[ce]=T[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,Z,ct.current,te)}}var dn=E.ReactCurrentOwner,jr=E.ReactDebugCurrentFrame;function Ve(p){if(p){var T=p._owner,P=ze(p.type,p._source,T?T.type:null);jr.setExtraStackFrame(P)}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=R(dn.current.type);if(p)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+p+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+p+"`."}return""}}function ba(p){return""}var Tr={};function wa(p){{var T=Cr();if(!T){var P=typeof p=="string"?p:p.displayName||p.name;P&&(T=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+P+">.")}return T}}function Nr(p,T){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var P=wa(T);if(Tr[P])return;Tr[P]=!0;var Z="";p&&p._owner&&p._owner!==dn.current&&(Z=" It was passed a child from "+R(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.',P,Z),Ve(null)}}function Or(p,T){{if(typeof p!="object")return;if(un(p))for(var P=0;P<p.length;P++){var Z=p[P];mn(Z)&&Nr(Z,T)}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,T)}}}function ya(p){{var T=p.type;if(T==null||typeof T=="string")return;var P;if(typeof T=="function")P=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===a||T.$$typeof===h))P=T.propTypes;else return;if(P){var Z=R(T);ia(P,p.props,"prop",Z,p)}else if(T.PropTypes!==void 0&&!fn){fn=!0;var oe=R(T);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ea(p){{for(var T=Object.keys(p.props),P=0;P<T.length;P++){var Z=T[P];if(Z!=="children"&&Z!=="key"){Ve(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Z),Ve(null);break}}p.ref!==null&&(Ve(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),Ve(null))}}function kr(p,T,P,Z,oe,ce){{var te=_(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="<"+(R(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,T,P,oe,ce);if(xe==null)return xe;if(te){var je=T.children;if(je!==void 0)if(Z)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,T,P){return kr(p,T,P,!0)}function ja(p,T,P){return kr(p,T,P,!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 Br=(e,n)=>Math.abs(e-n)<1,zr=(e,n,t)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,o),t)}},Wr=e=>e,Ur=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},Hr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const o=l=>{const{width:s,height:a}=l;n({width:Math.round(s),height:Math.round(a)})};if(o(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(l=>{const s=l[0];if(s!=null&&s.borderBoxSize){const a=s.borderBoxSize[0];if(a){o({width:a.inlineSize,height:a.blockSize});return}}o(t.getBoundingClientRect())});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},xn={passive:!0},Vr=typeof window>"u"?!0:"onscrollend"in window,Yr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let o=0;const i=Vr?()=>{}:zr(r,()=>{n(o,!1)},e.options.isScrollingResetDelay),l=m=>()=>{o=t[e.options.horizontal?"scrollLeft":"scrollTop"],i(),n(o,m)},s=l(!0),a=l(!1);return a(),t.addEventListener("scroll",s,xn),t.addEventListener("scrollend",a,xn),()=>{t.removeEventListener("scroll",s),t.removeEventListener("scrollend",a)}},qr=(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"])},Gr=(e,{adjustments:n=0,behavior:t},r)=>{var o,i;const l=e+n;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:l,behavior:t})};class Kr{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(i=>{this._measureElement(i.target,i)})}));return{disconnect:()=>{var o;return(o=r())==null?void 0:o.disconnect()},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.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:Wr,rangeExtractor:Ur,onChange:()=>{},measureElement:qr,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,i;const{startIndex:l,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(t||l!==(a==null?void 0:a.startIndex)||s!==(a==null?void 0:a.endIndex))&&((i=(o=this.options).onChange)==null||i.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,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o;const l=this.isScrolling;this.isScrolling=i,this.notify(l!==i,i)}))}},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,i=new Map;for(let l=r-1;l>=0;l--){const s=t[l];if(o.has(s.lane))continue;const a=i.get(s.lane);if(a==null||s.end>a.end?i.set(s.lane,s):s.end<a.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,s)=>l.end===s.end?l.index-s.index:l.end-s.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,i,l)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l}),{key:!1}),this.getMeasurements=Ke(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l},s)=>{var a;if(!l)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 b=(a=this.measurementsCache[h])==null?void 0:a.measureElement;b||(b=N=>{const $=i(h),A=this.elementsCache.get($);if(!N){A&&(this.observer.unobserve(A),this.elementsCache.delete($));return}A!==N&&(A&&this.observer.unobserve(A),this.observer.observe(N),this.elementsCache.set($,N)),N.isConnected&&this.resizeItem(h,this.options.measureElement(N,void 0,this))});const f=i(h),v=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),g=v?v.end+this.options.gap:r+o,x=s.get(f),E=typeof x=="number"?x: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:b}}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?Zr({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,i)=>r===null?[]:t({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:i}),{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),i=this.getMeasurements()[o];if(!i||!t.isConnected){this.elementsCache.forEach((s,a)=>{s===t&&(this.observer.unobserve(t),this.elementsCache.delete(a))});return}const l=this.elementsCache.get(i.key);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(i.key,t)),this.resizeItem(o,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const o=this.getMeasurements()[t];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,l=r-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,l,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",l),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,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 i=0,l=t.length;i<l;i++){const s=t[i],a=r[s];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(),i=this.getScrollOffset();r==="auto"&&(t<=i?r="start":t>=i+o?r="end":r="start"),r==="start"?t=t:r==="end"?t=t-o:r==="center"&&(t=t-o/2);const l=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[l]:this.scrollElement[l]: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 i=this.getSize(),l=this.getScrollOffset();if(r==="auto")if(o.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,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 i=this.getOffsetForIndex(t,r);if(!i)return;const[l,s]=i;this._scrollToOffset(l,{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,s));Br(m,this.getScrollOffset())||this.scrollToIndex(t,{align:s,behavior:o})}else this.scrollToIndex(t,{align:s,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(i=>i.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,i=t(o);if(i<r)e=o+1;else if(i>r)n=o-1;else return o}return e>0?e-1:0};function Zr({measurements:e,outerSize:n,scrollOffset:t}){const r=e.length-1,i=wn(0,r,s=>e[s].start,t);let l=i;for(;l<r&&e[l].end<t+n;)l++;return{startIndex:i,endIndex:l}}const Xr=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Jr(e){const n=C.useReducer(()=>({}),{})[1],t={...e,onChange:(o,i)=>{var l;i?Tt.flushSync(n):n(),(l=e.onChange)==null||l.call(e,o,i)}},[r]=C.useState(()=>new Kr(t));return r.setOptions(t),C.useEffect(()=>r._didMount(),[]),Xr(()=>r._willUpdate()),r}function Qr(e){return Jr({observeElementRect:Hr,observeElementOffset:Yr,scrollToFn:Gr,...e})}var eo=Object.defineProperty,to=(e,n,t)=>n in e?eo(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,It=(e,n,t)=>(to(e,typeof n!="symbol"?n+"":n,t),t);let no=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"}},Ne=new no,le=(e,n)=>{Ne.isServer?u.useEffect(e,n):u.useLayoutEffect(e,n)};function je(e){let n=u.useRef(e);return le(()=>{n.current=e},[e]),n}function $t(e,n){let[t,r]=u.useState(e),o=je(e);return le(()=>r(o.current),[o,r,...n]),t}let M=function(e){let n=je(e);return u.useCallback((...t)=>n.current(...t),[n])};function yn(e,n,t){let[r,o]=u.useState(t),i=e!==void 0,l=u.useRef(i),s=u.useRef(!1),a=u.useRef(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,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.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,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.")),[i?e:r,M(m=>(i||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,i){return t.addEventListener(r,o,i),n.add(()=>t.removeEventListener(r,o,i))},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 i=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:o}),this.add(()=>{Object.assign(t.style,{[r]:i})})},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 ro(){let e=typeof document>"u";return"useSyncExternalStore"in C?(n=>n.useSyncExternalStore)(C)(()=>()=>{},()=>!1,()=>!e):!1}function Ue(){let e=ro(),[n,t]=C.useState(Ne.isHandoffComplete);return n&&Ne.isHandoffComplete===!1&&t(!1),C.useEffect(()=>{n!==!0&&t(!0)},[n]),C.useEffect(()=>Ne.handoff(),[]),e?!1:n}var En;let xe=(En=u.useId)!=null?En:function(){let e=Ue(),[n,t]=u.useState(e?()=>Ne.nextId():null);return le(()=>{n===null&&t(Ne.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 Ne.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||{}),oo=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(oo||{});function Cn(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 Mt=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Mt||{});function Pt(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 jn(e){let n=ft(e);Ee().nextFrame(()=>{n&&!Pt(n.activeElement,0)&&Me(e)})}var lo=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(lo||{});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 Me(e){e==null||e.focus({preventScroll:!0})}let io=["textarea","input"].join(",");function so(e){var n,t;return(t=(n=e==null?void 0:e.matches)==null?void 0:n.call(e,io))!=null?t:!1}function At(e,n=t=>t){return e.slice().sort((t,r)=>{let o=n(t),i=n(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ao(e,n){return Ze(Cn(),n,{relativeTo:e})}function Ze(e,n,{sorted:t=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?t?At(e):e:Cn(e);o.length>0&&l.length>1&&(l=l.filter(f=>!o.includes(f))),r=r??i.activeElement;let s=(()=>{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,l.indexOf(r))-1;if(n&4)return Math.max(0,l.indexOf(r))+1;if(n&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),m=n&32?{preventScroll:!0}:{},d=0,h=l.length,b;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}b=l[f],b==null||b.focus(m),d+=s}while(b!==i.activeElement);return n&6&&so(b)&&b.select(),2}function Tn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function uo(){return/Android/gi.test(window.navigator.userAgent)}function On(){return Tn()||uo()}function mt(e,n,t){let r=je(n);u.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,t),()=>document.removeEventListener(e,o,t)},[e,t])}function Nn(e,n,t){let r=je(n);u.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,t),()=>window.removeEventListener(e,o,t)},[e,t])}function Lt(e,n,t=!0){let r=u.useRef(!1);u.useEffect(()=>{requestAnimationFrame(()=>{r.current=t})},[t]);function o(l,s){if(!r.current||l.defaultPrevented)return;let a=s(l);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)||l.composed&&l.composedPath().includes(h))return}return!Pt(a,Mt.Loose)&&a.tabIndex!==-1&&l.preventDefault(),n(l,a)}let i=u.useRef(null);mt("pointerdown",l=>{var s,a;r.current&&(i.current=((a=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:a[0])||l.target)},!0),mt("mousedown",l=>{var s,a;r.current&&(i.current=((a=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:a[0])||l.target)},!0),mt("click",l=>{On()||i.current&&(o(l,()=>i.current),i.current=null)},!0),mt("touchend",l=>o(l,()=>l.target instanceof HTMLElement?l.target:null),!0),Nn("blur",l=>o(l,()=>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 Dt(e,n){let[t,r]=u.useState(()=>kn(e));return le(()=>{r(kn(e))},[e.type,e.as]),le(()=>{t||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&r("button")},[t,n]),t}let In=Symbol();function co(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 Mn({container:e,accept:n,walk:t,enabled:r=!0}){let o=u.useRef(n),i=u.useRef(t);u.useEffect(()=>{o.current=n,i.current=t},[n,t]),le(()=>{if(!e||!r)return;let l=ft(e);if(!l)return;let s=o.current,a=i.current,m=Object.assign(h=>s(h),{acceptNode:s}),d=l.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,m,!1);for(;d.nextNode();)a(d.currentNode)},[e,r,o,i])}function Xe(e,n){let t=u.useRef([]),r=M(e);u.useEffect(()=>{let o=[...t.current];for(let[i,l]of n.entries())if(t.current[i]!==l){let s=r(n,o);return t.current=n,s}},[r,...n])}function pt(...e){return Array.from(new Set(e.flatMap(n=>typeof n=="string"?n.split(" "):[]))).filter(Boolean).join(" ")}var Pe=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Pe||{}),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:i=!0,name:l,mergeRefs:s}){s=s??fo;let a=Pn(n,e);if(i)return ht(a,t,r,l,s);let m=o??0;if(m&2){let{static:d=!1,...h}=a;if(d)return ht(h,t,r,l,s)}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,l,s)}})}return ht(a,t,r,l,s)}function ht(e,n={},t,r,o){let{as:i=t,children:l,refName:s="ref",...a}=_t(e,["unmount","static"]),m=e.ref!==void 0?{[s]:e.ref}:{},d=typeof l=="function"?l(n):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(n));let h={};if(n){let b=!1,f=[];for(let[v,g]of Object.entries(n))typeof g=="boolean"&&(b=!0),g===!0&&f.push(v);b&&(h["data-headlessui-state"]=f.join(" "))}if(i===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=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(`
|
|
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 b=d.props,f=typeof(b==null?void 0:b.className)=="function"?(...g)=>pt(b==null?void 0:b.className(...g),a.className):pt(b==null?void 0:b.className,a.className),v=f?{className:f}:{};return u.cloneElement(d,Object.assign({},Pn(d.props,vt(_t(a,["ref"]))),h,m,{ref:o(d.ref,m.ref)},v))}return u.createElement(i,Object.assign({},_t(a,["ref"]),i!==u.Fragment&&m,i!==u.Fragment&&h),d)}function fo(...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 Pn(...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,...i){let l=t[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});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 mo="div";var He=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(He||{});function po(e,n){var t;let{features:r=1,...o}=e,i={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:i,theirProps:o,slot:{},defaultTag:mo,name:"Hidden"})}let Je=fe(po),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 ho(e){function n(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",n))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}let Oe=[];ho(()=>{function e(n){n.target instanceof HTMLElement&&n.target!==document.body&&Oe[0]!==n.target&&(Oe.unshift(n.target),Oe=Oe.filter(t=>t!=null&&t.isConnected),Oe.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&&vo(t)?!1:r}function vo(e){if(!e)return!1;let n=e.previousElementSibling;for(;n!==null;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}function go(e){throw new Error("Unexpected object: "+e)}var ie=(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))(ie||{});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 i=0;i<t.length;++i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 2:{for(let i=o+1;i<t.length;++i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 3:{for(let i=t.length-1;i>=0;--i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 4:{for(let i=0;i<t.length;++i)if(n.resolveId(t[i],i,t)===e.id)return i;return r}case 5:return null;default:go(e)}}function An(e={},n=null,t=[]){for(let[r,o]of Object.entries(e))Dn(t,Ln(n,r),o);return t}function Ln(e,n){return e?e+"["+n+"]":n}function Dn(e,n,t){if(Array.isArray(t))for(let[r,o]of t.entries())Dn(e,Ln(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 bo(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||{}),xo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(xo||{}),wo=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(wo||{}),yo=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(yo||{}),Eo=(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))(Eo||{});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((l,s)=>l.dataRef.current.order-s.dataRef.current.order):At(r,l=>l.dataRef.current.domRef.current),i=t?o.indexOf(t):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let So={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,i,l;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===ie.Specific?n.idx:zt(n,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var b,f;return(f=(b=e.activeOptionIndex)!=null?b:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?f:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),h=(i=n.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let s=Wt(e);if(s.activeOptionIndex===null){let d=s.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(s.activeOptionIndex=d)}let a=n.focus===ie.Specific?n.idx:zt(n,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),m=(l=n.trigger)!=null?l:2;return e.activeOptionIndex===a&&e.activationTrigger===m?e:{...e,...s,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 i=n.payload,l=Wt(e,a=>(a.push(i),a));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(n.payload.dataRef.current.value)&&(l.activeOptionIndex=l.options.indexOf(i));let s={...e,...l,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(s.activeOptionIndex=0),s},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 i=o.findIndex(l=>l.id===n.id);return i!==-1&&o.splice(i,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 Co(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]),i=Qr({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}),[l,s]=u.useState(0);return le(()=>{s(a=>a+1)},[(n=t.virtual)==null?void 0:n.options]),u.createElement(_n.Provider,{value:i},u.createElement("div",{style:{position:"relative",width:"100%",height:`${i.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&&i.scrollToIndex(t.activeOptionIndex)}}},i.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:`${l}-${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 jo(e,n){return me(n.type,So,e,n)}let To=u.Fragment;function Oo(e,n){let{value:t,defaultValue:r,onChange:o,form:i,name:l,by:s=null,disabled:a=!1,__demoMode:m=!1,nullable:d=!1,multiple:h=!1,immediate:b=!1,virtual:f=null,...v}=e,g=!1,x=null,[E=h?[]:void 0,w]=yn(t,o,r),[y,N]=u.useReducer(jo,{dataRef:u.createRef(),comboboxState:m?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),$=u.useRef(!1),A=u.useRef({static:!1,hold:!1}),R=u.useRef(null),U=u.useRef(null),_=u.useRef(null),L=u.useRef(null),D=M(typeof s=="string"?(P,G)=>{let O=s;return(P==null?void 0:P[O])===(G==null?void 0:G[O])}:s??((P,G)=>P===G)),B=M(P=>y.options.findIndex(G=>D(G.dataRef.current.value,P))),V=u.useCallback(P=>me(S.mode,{1:()=>E.some(G=>D(G,P)),0:()=>D(E,P)}),[E]),Z=M(P=>y.activeOptionIndex===B(P)),S=u.useMemo(()=>({...y,immediate:g,optionsPropsRef:A,labelRef:R,inputRef:U,buttonRef:_,optionsRef:L,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 P=y.options.findIndex(G=>!G.dataRef.current.disabled);if(P!==-1)return P}return y.activeOptionIndex},calculateIndex:B,compare:D,isSelected:V,isActive:Z,nullable:d,__demoMode:m}),[E,r,a,h,d,m,y,x]);le(()=>{},[x,void 0]),le(()=>{y.dataRef.current=S},[S]),Lt([S.buttonRef,S.inputRef,S.optionsRef],()=>ge.closeCombobox(),S.comboboxState===0);let K=u.useMemo(()=>{var P,G,O;return{open:S.comboboxState===0,disabled:a,activeIndex:S.activeOptionIndex,activeOption:S.activeOptionIndex===null?null:S.virtual?S.virtual.options[(P=S.activeOptionIndex)!=null?P:0]:(O=(G=S.options[S.activeOptionIndex])==null?void 0:G.dataRef.current.value)!=null?O:null,value:E}},[S,a,E]),X=M(()=>{if(S.activeOptionIndex!==null){if(S.virtual)se(S.virtual.options[S.activeOptionIndex]);else{let{dataRef:P}=S.options[S.activeOptionIndex];se(P.current.value)}ge.goToOption(ie.Specific,S.activeOptionIndex)}}),T=M(()=>{N({type:0}),$.current=!0}),k=M(()=>{N({type:1}),$.current=!1}),z=M((P,G,O)=>($.current=!1,P===ie.Specific?N({type:2,focus:ie.Specific,idx:G,trigger:O}):N({type:2,focus:P,trigger:O}))),J=M((P,G)=>(N({type:3,payload:{id:P,dataRef:G}}),()=>{S.isActive(G.current.value)&&($.current=!0),N({type:4,id:P})})),ne=M(P=>(N({type:5,id:P}),()=>N({type:5,id:null}))),se=M(P=>me(S.mode,{0(){return w==null?void 0:w(P)},1(){let G=S.value.slice(),O=G.findIndex(Y=>D(Y,P));return O===-1?G.push(P):G.splice(O,1),w==null?void 0:w(G)}})),ae=M(P=>{N({type:6,trigger:P})}),ge=u.useMemo(()=>({onChange:se,registerOption:J,registerLabel:ne,goToOption:z,closeCombobox:k,openCombobox:T,setActivationTrigger:ae,selectActiveOption:X}),[]),we=n===null?{}:{ref:n},W=u.useRef(null),ue=ke();return u.useEffect(()=>{W.current&&r!==void 0&&ue.addEventListener(W.current,"reset",()=>{w==null||w(r)})},[W,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})},l!=null&&E!=null&&An({[l]:E}).map(([P,G],O)=>u.createElement(Je,{features:He.Hidden,ref:O===0?Y=>{var Q;W.current=(Q=Y==null?void 0:Y.closest("form"))!=null?Q:null}:void 0,...vt({key:P,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,disabled:a,name:P,value:G})})),de({ourProps:we,theirProps:v,slot:K,defaultTag:To,name:"Combobox"}))))}let No="input";function ko(e,n){var t,r,o,i,l;let s=xe(),{id:a=`headlessui-combobox-input-${s}`,onChange:m,displayValue:d,type:h="text",...b}=e,f=Re("Combobox.Input"),v=et("Combobox.Input"),g=pe(f.inputRef,n),x=_e(f.inputRef),E=u.useRef(!1),w=ke(),y=M(()=>{v.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),v.goToOption(ie.Nothing)}),N=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,K],[X,T])=>{if(E.current)return;let k=f.inputRef.current;k&&((T===0&&K===1||S!==X)&&(k.value=S),requestAnimationFrame(()=>{if(E.current||!k||(x==null?void 0:x.activeElement)!==k)return;let{selectionStart:z,selectionEnd:J}=k;Math.abs((J??0)-(z??0))===0&&z===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[N,f.comboboxState,x]),Xe(([S],[K])=>{if(S===0&&K===1){if(E.current)return;let X=f.inputRef.current;if(!X)return;let T=X.value,{selectionStart:k,selectionEnd:z,selectionDirection:J}=X;X.value="",X.value=T,J!==null?X.setSelectionRange(k,z,J):X.setSelectionRange(k,z)}},[f.comboboxState]);let $=u.useRef(!1),A=M(()=>{$.current=!0}),R=M(()=>{w.nextFrame(()=>{$.current=!1})}),U=M(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(ie.Next),1:()=>v.openCombobox()});case re.ArrowUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),me(f.comboboxState,{0:()=>v.goToOption(ie.Previous),1:()=>{v.openCombobox(),w.nextFrame(()=>{f.value||v.goToOption(ie.Last)})}});case re.Home:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(ie.First);case re.PageUp:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(ie.First);case re.End:if(S.shiftKey)break;return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(ie.Last);case re.PageDown:return E.current=!1,S.preventDefault(),S.stopPropagation(),v.goToOption(ie.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}}),_=M(S=>{m==null||m(S),f.nullable&&f.mode===0&&S.target.value===""&&y(),v.openCombobox()}),L=M(S=>{var K,X,T;let k=(K=S.relatedTarget)!=null?K:Oe.find(z=>z!==S.currentTarget);if(E.current=!1,!((X=f.optionsRef.current)!=null&&X.contains(k))&&!((T=f.buttonRef.current)!=null&&T.contains(k))&&f.comboboxState===0)return S.preventDefault(),f.mode===0&&(f.nullable&&f.value===null?y():f.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),D=M(S=>{var K,X,T;let k=(K=S.relatedTarget)!=null?K:Oe.find(z=>z!==S.currentTarget);(X=f.buttonRef.current)!=null&&X.contains(k)||(T=f.optionsRef.current)!=null&&T.contains(k)||f.disabled||f.immediate&&f.comboboxState!==0&&(v.openCombobox(),w.nextFrame(()=>{v.setActivationTrigger(1)}))}),B=$t(()=>{if(f.labelId)return[f.labelId].join(" ")},[f.labelId]),V=u.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]),Z={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 K;return!((K=f.virtual)!=null&&K.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":B,"aria-autocomplete":"list",defaultValue:(l=(i=e.defaultValue)!=null?i:f.defaultValue!==void 0?d==null?void 0:d(f.defaultValue):null)!=null?l:f.defaultValue,disabled:f.disabled,onCompositionStart:A,onCompositionEnd:R,onKeyDown:U,onChange:_,onFocus:D,onBlur:L};return de({ourProps:Z,theirProps:b,slot:V,defaultTag:No,name:"Combobox.Input"})}let Io="button";function $o(e,n){var t;let r=Re("Combobox.Button"),o=et("Combobox.Button"),i=pe(r.buttonRef,n),l=xe(),{id:s=`headlessui-combobox-button-${l}`,...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 x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case re.ArrowUp:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),m.nextFrame(()=>{r.value||o.goToOption(ie.Last)})),m.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.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 x;return(x=r.inputRef.current)==null?void 0:x.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 x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),b=$t(()=>{if(r.labelId)return[r.labelId,s].join(" ")},[r.labelId,s]),f=u.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:s,type:Dt(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":b,disabled:r.disabled,onClick:h,onKeyDown:d};return de({ourProps:v,theirProps:a,slot:f,defaultTag:Io,name:"Combobox.Button"})}let Fo="label";function Mo(e,n){let t=xe(),{id:r=`headlessui-combobox-label-${t}`,...o}=e,i=Re("Combobox.Label"),l=et("Combobox.Label"),s=pe(i.labelRef,n);le(()=>l.registerLabel(r),[r]);let a=M(()=>{var d;return(d=i.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),m=u.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return de({ourProps:{ref:s,id:r,onClick:a},theirProps:o,slot:m,defaultTag:Fo,name:"Combobox.Label"})}let Po="ul",Ao=Pe.RenderStrategy|Pe.Static;function Lo(e,n){let t=xe(),{id:r=`headlessui-combobox-options-${t}`,hold:o=!1,...i}=e,l=Re("Combobox.Options"),s=pe(l.optionsRef,n),a=Qe(),m=a!==null?(a&he.Open)===he.Open:l.comboboxState===0;le(()=>{var f;l.optionsPropsRef.current.static=(f=e.static)!=null?f:!1},[l.optionsPropsRef,e.static]),le(()=>{l.optionsPropsRef.current.hold=o},[l.optionsPropsRef,o]),Mn({container:l.optionsRef.current,enabled:l.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=l.labelId)!=null?v:(f=l.buttonRef.current)==null?void 0:f.id},[l.labelId,l.buttonRef.current]),h=u.useMemo(()=>({open:l.comboboxState===0,option:void 0}),[l]),b={"aria-labelledby":d,role:"listbox","aria-multiselectable":l.mode===1?!0:void 0,id:r,ref:s};return l.virtual&&l.comboboxState===0&&Object.assign(i,{children:u.createElement(Co,null,i.children)}),de({ourProps:b,theirProps:i,slot:h,defaultTag:Po,features:Ao,visible:m,name:"Combobox.Options"})}let Do="li";function _o(e,n){var t;let r=xe(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:l,order:s=null,...a}=e,m=Re("Combobox.Option"),d=et("Combobox.Option"),h=m.virtual?m.activeOptionIndex===m.calculateIndex(l):m.activeOptionIndex===null?!1:((t=m.options[m.activeOptionIndex])==null?void 0:t.id)===o,b=m.isSelected(l),f=u.useRef(null),v=je({disabled:i,value:l,domRef:f,order:s}),g=u.useContext(_n),x=pe(n,f,g?g.measureElement:null),E=M(()=>d.onChange(l));le(()=>d.registerOption(o,v),[v,o]);let w=u.useRef(!(m.virtual||m.__demoMode));le(()=>{if(!m.virtual||!m.__demoMode)return;let L=Ee();return L.requestAnimationFrame(()=>{w.current=!0}),L.dispose},[m.virtual,m.__demoMode]),le(()=>{if(!w.current||m.comboboxState!==0||!h||m.activationTrigger===0)return;let L=Ee();return L.requestAnimationFrame(()=>{var D,B;(B=(D=f.current)==null?void 0:D.scrollIntoView)==null||B.call(D,{block:"nearest"})}),L.dispose},[f,h,m.comboboxState,m.activationTrigger,m.activeOptionIndex]);let y=M(L=>{var D;if(i||(D=m.virtual)!=null&&D.disabled(l))return L.preventDefault();E(),On()||requestAnimationFrame(()=>{var B;return(B=m.inputRef.current)==null?void 0:B.focus({preventScroll:!0})}),m.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),N=M(()=>{var L;if(i||(L=m.virtual)!=null&&L.disabled(l))return d.goToOption(ie.Nothing);let D=m.calculateIndex(l);d.goToOption(ie.Specific,D)}),$=Fn(),A=M(L=>$.update(L)),R=M(L=>{var D;if(!$.wasMoved(L)||i||(D=m.virtual)!=null&&D.disabled(l)||h)return;let B=m.calculateIndex(l);d.goToOption(ie.Specific,B,0)}),U=M(L=>{var D;$.wasMoved(L)&&(i||(D=m.virtual)!=null&&D.disabled(l)||h&&(m.optionsPropsRef.current.hold||d.goToOption(ie.Nothing)))}),_=u.useMemo(()=>({active:h,selected:b,disabled:i}),[h,b,i]);return de({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":b,disabled:void 0,onClick:y,onFocus:N,onPointerEnter:A,onMouseEnter:A,onPointerMove:R,onMouseMove:R,onPointerLeave:U,onMouseLeave:U},theirProps:a,slot:_,defaultTag:Do,name:"Combobox.Option"})}let Ro=fe(Oo),Bo=fe($o),zo=fe(ko),Wo=fe(Mo),Uo=fe(Lo),Ho=fe(_o),$e=Object.assign(Ro,{Input:zo,Button:Bo,Label:Wo,Options:Uo,Option:Ho});function Rn(e,n,t,r){let o=je(t);u.useEffect(()=>{e=e??window;function i(l){o.current(l)}return e.addEventListener(n,i,r),()=>e.removeEventListener(n,i,r)},[e,n,r])}function tt(){let e=u.useRef(!1);return le(()=>(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 Vo(){let e=u.useRef(0);return Nn("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 Yo="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 qo(e,n){let t=u.useRef(null),r=pe(t,n),{initialFocus:o,containers:i,features:l=30,...s}=e;Ue()||(l=1);let a=_e(t);Zo({ownerDocument:a},!!(l&16));let m=Xo({ownerDocument:a,container:t,initialFocus:o},!!(l&2));Jo({ownerDocument:a,container:t,containers:i,previousActiveElement:m},!!(l&8));let d=Vo(),h=M(g=>{let x=t.current;x&&(E=>E())(()=>{me(d.current,{[nt.Forwards]:()=>{Ze(x,Ie.First,{skipElements:[g.relatedTarget]})},[nt.Backwards]:()=>{Ze(x,Ie.Last,{skipElements:[g.relatedTarget]})}})})}),b=ke(),f=u.useRef(!1),v={ref:r,onKeyDown(g){g.key=="Tab"&&(f.current=!0,b.requestAnimationFrame(()=>{f.current=!1}))},onBlur(g){let x=zn(i);t.current instanceof HTMLElement&&x.add(t.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Un(x,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&&Me(g.target)))}};return u.createElement(u.Fragment,null,!!(l&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}),de({ourProps:v,theirProps:s,defaultTag:Yo,name:"FocusTrap"}),!!(l&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}))}let Go=fe(qo),rt=Object.assign(Go,{features:Wn});function Ko(e=!0){let n=u.useRef(Oe.slice());return Xe(([t],[r])=>{r===!0&&t===!1&&dt(()=>{n.current.splice(0)}),r===!1&&t===!0&&(n.current=Oe.slice())},[e,Oe,n]),M(()=>{var t;return(t=n.current.find(r=>r!=null&&r.isConnected))!=null?t:null})}function Zo({ownerDocument:e},n){let t=Ko(n);Xe(()=>{n||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Me(t())},[n]),Bn(()=>{n&&Me(t())})}function Xo({ownerDocument:e,container:n,initialFocus:t},r){let o=u.useRef(null),i=tt();return Xe(()=>{if(!r)return;let l=n.current;l&&dt(()=>{if(!i.current)return;let s=e==null?void 0:e.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===s){o.current=s;return}}else if(l.contains(s)){o.current=s;return}t!=null&&t.current?Me(t.current):Ze(l,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 Jo({ownerDocument:e,container:n,containers:t,previousActiveElement:r},o){let i=tt();Rn(e==null?void 0:e.defaultView,"focus",l=>{if(!o||!i.current)return;let s=zn(t);n.current instanceof HTMLElement&&s.add(n.current);let a=r.current;if(!a)return;let m=l.target;m&&m instanceof HTMLElement?Un(s,m)?(r.current=m,Me(m)):(l.preventDefault(),l.stopPropagation(),Me(a)):Me(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 Qo(){return u.useContext(Hn)}function Vt(e){return u.createElement(Hn.Provider,{value:e.force},e.children)}function el(e){let n=Qo(),t=u.useContext(Vn),r=_e(e),[o,i]=u.useState(()=>{if(!n&&t!==null||Ne.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return u.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),u.useEffect(()=>{n||t!==null&&i(t.current)},[t,i,n]),o}let tl=u.Fragment;function nl(e,n){let t=e,r=u.useRef(null),o=pe(co(d=>{r.current=d}),n),i=_e(r),l=el(r),[s]=u.useState(()=>{var d;return Ne.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),a=u.useContext(Yt),m=Ue();return le(()=>{!l||!s||l.contains(s)||(s.setAttribute("data-headlessui-portal",""),l.appendChild(s))},[l,s]),le(()=>{if(s&&a)return a.register(s)},[a,s]),Bn(()=>{var d;!l||!s||(s instanceof Node&&l.contains(s)&&l.removeChild(s),l.childNodes.length<=0&&((d=l.parentElement)==null||d.removeChild(l)))}),m?!l||!s?null:Tt.createPortal(de({ourProps:{ref:o},theirProps:t,defaultTag:tl,name:"Portal"}),s):null}let rl=u.Fragment,Vn=u.createContext(null);function ol(e,n){let{target:t,...r}=e,o={ref:pe(n)};return u.createElement(Vn.Provider,{value:t},de({ourProps:o,theirProps:r,defaultTag:rl,name:"Popover.Group"}))}let Yt=u.createContext(null);function ll(){let e=u.useContext(Yt),n=u.useRef([]),t=M(i=>(n.current.push(i),e&&e.register(i),()=>r(i))),r=M(i=>{let l=n.current.indexOf(i);l!==-1&&n.current.splice(l,1),e&&e.unregister(i)}),o=u.useMemo(()=>({register:t,unregister:r,portals:n}),[t,r,n]);return[n,u.useMemo(()=>function({children:i}){return u.createElement(Yt.Provider,{value:o},i)},[o])]}let il=fe(nl),sl=fe(ol),qt=Object.assign(il,{Group:sl});function al(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}const ul=typeof Object.is=="function"?Object.is:al,{useState:cl,useEffect:dl,useLayoutEffect:fl,useDebugValue:ml}=C;function pl(e,n,t){const r=n(),[{inst:o},i]=cl({inst:{value:r,getSnapshot:n}});return fl(()=>{o.value=r,o.getSnapshot=n,Gt(o)&&i({inst:o})},[e,r,n]),dl(()=>(Gt(o)&&i({inst:o}),e(()=>{Gt(o)&&i({inst:o})})),[e]),ml(r),r}function Gt(e){const n=e.getSnapshot,t=e.value;try{const r=n();return!ul(t,r)}catch{return!0}}function hl(e,n,t){return n()}const vl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gl=!vl,bl=gl?hl:pl,xl="useSyncExternalStore"in C?(e=>e.useSyncExternalStore)(C):bl;function wl(e){return xl(e.subscribe,e.getSnapshot,e.getSnapshot)}function yl(e,n){let t=e(),r=new Set;return{getSnapshot(){return t},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=n[o].call(t,...i);l&&(t=l,r.forEach(s=>s()))}}}function El(){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,i=e-o;t.style(r,"paddingRight",`${i}px`)}}}function Sl(){return Tn()?{before({doc:e,d:n,meta:t}){function r(o){return t.containers.flatMap(i=>i()).some(i=>i.contains(o))}n.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=Ee();s.style(e.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;n.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let a=s.target.closest("a");if(!a)return;let{hash:m}=new URL(a.href),d=e.querySelector(m);d&&!r(d)&&(l=d)}catch{}},!0),n.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;n.style(a,"overscrollBehavior","contain")}else n.style(s.target,"touchAction","none")}),n.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),n.add(()=>{var s;let a=(s=window.scrollY)!=null?s:window.pageYOffset;i!==a&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Cl(){return{before({doc:e,d:n}){n.style(e.documentElement,"overflow","hidden")}}}function jl(e){let n={};for(let t of e)Object.assign(n,t(n));return n}let Be=yl(()=>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:jl(t)},o=[Sl(),El(),Cl()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(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 Tl(e,n,t){let r=wl(Be),o=e?r.get(e):void 0,i=o?o.count>0:!1;return le(()=>{if(!(!e||!n))return Be.dispatch("PUSH",e,t),()=>Be.dispatch("POP",e,t)},[n,e]),i}let Kt=new Map,ot=new Map;function Yn(e,n=!0){le(()=>{var t;if(!n)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var l;if(!r)return;let s=(l=ot.get(r))!=null?l:1;if(s===1?ot.delete(r):ot.set(r,s-1),s!==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 i=(t=ot.get(r))!=null?t:0;return ot.set(r,i+1),i!==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 Ol({defaultContainers:e=[],portals:n,mainTreeNodeRef:t}={}){var r;let o=u.useRef((r=t==null?void 0:t.current)!=null?r:null),i=_e(o),l=M(()=>{var s,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(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])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(b=>h.contains(b))||d.push(h));return d});return{resolveContainers:l,contains:M(s=>l().some(a=>a.contains(s))),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 Nl(){return u.useContext(Zt)}function kl({children:e,onUpdate:n,type:t,element:r,enabled:o}){let i=Nl(),l=M((...s)=>{n==null||n(...s),i(...s)});return le(()=>{let s=o===void 0||o===!0;return s&&l(0,t,r),()=>{s&&l(1,t,r)}},[l,t,r,o]),u.createElement(Zt.Provider,{value:l},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(i=>(n(l=>[...l,i]),()=>n(l=>{let s=l.slice(),a=s.indexOf(i);return a!==-1&&s.splice(a,1),s}))),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 Il="p";function $l(e,n){let t=xe(),{id:r=`headlessui-description-${t}`,...o}=e,i=Gn(),l=pe(n);le(()=>i.register(r),[r,i.register]);let s={ref:l,...i.props,id:r};return de({ourProps:s,theirProps:o,slot:i.slot||{},defaultTag:Il,name:i.name||"Description"})}let Fl=fe($l),Zn=Object.assign(Fl,{});var Ml=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ml||{}),Pl=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Pl||{});let Al={0(e,n){return e.titleId===n.id?e:{...e,titleId:n.id}}},bt=u.createContext(null);bt.displayName="DialogContext";function lt(e){let n=u.useContext(bt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,lt),t}return n}function Ll(e,n,t=()=>[document.body]){Tl(e,n,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],t]}})}function Dl(e,n){return me(n.type,Al,e,n)}let _l="div",Rl=Pe.RenderStrategy|Pe.Static;function Bl(e,n){let t=xe(),{id:r=`headlessui-dialog-${t}`,open:o,onClose:i,initialFocus:l,role:s="dialog",__demoMode:a=!1,...m}=e,[d,h]=u.useState(0),b=u.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(b.current||(b.current=!0,console.warn(`Invalid role [${s}] 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),x=_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 i!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let y=o?0:1,[N,$]=u.useReducer(Dl,{titleId:null,descriptionId:null,panelRef:u.createRef()}),A=M(()=>i(!1)),R=M(O=>$({type:0,id:O})),U=Ue()?a?!1:y===0:!1,_=d>1,L=u.useContext(bt)!==null,[D,B]=ll(),V={get current(){var O;return(O=N.panelRef.current)!=null?O:v.current}},{resolveContainers:Z,mainTreeNodeRef:S,MainTreeNode:K}=Ol({portals:D,defaultContainers:[V]}),X=_?"parent":"leaf",T=f!==null?(f&he.Closing)===he.Closing:!1,k=L||T?!1:U,z=u.useCallback(()=>{var O,Y;return(Y=Array.from((O=x==null?void 0:x.querySelectorAll("body > *"))!=null?O:[]).find(Q=>Q.id==="headlessui-portal-root"?!1:Q.contains(S.current)&&Q instanceof HTMLElement))!=null?Y:null},[S]);Yn(z,k);let J=_?!0:U,ne=u.useCallback(()=>{var O,Y;return(Y=Array.from((O=x==null?void 0:x.querySelectorAll("[data-headlessui-portal]"))!=null?O:[]).find(Q=>Q.contains(S.current)&&Q instanceof HTMLElement))!=null?Y:null},[S]);Yn(ne,J),Lt(Z,O=>{O.preventDefault(),A()},!(!U||_));let ae=!(_||y!==0);Rn(x==null?void 0:x.defaultView,"keydown",O=>{ae&&(O.defaultPrevented||O.key===re.Escape&&(O.preventDefault(),O.stopPropagation(),A()))}),Ll(x,!(T||y!==0||L),Z),u.useEffect(()=>{if(y!==0||!v.current)return;let O=new ResizeObserver(Y=>{for(let Q of Y){let Se=Q.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&A()}});return O.observe(v.current),()=>O.disconnect()},[y,v,A]);let[we,W]=Kn(),ue=u.useMemo(()=>[{dialogState:y,close:A,setTitleId:R},N],[y,N,A,R]),P=u.useMemo(()=>({open:y===0}),[y]),G={ref:g,id:r,role:s,"aria-modal":y===0?!0:void 0,"aria-labelledby":N.titleId,"aria-describedby":we};return u.createElement(kl,{type:"Dialog",enabled:y===0,element:v,onUpdate:M((O,Y)=>{Y==="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(bt.Provider,{value:ue},u.createElement(qt.Group,{target:v},u.createElement(Vt,{force:!1},u.createElement(W,{slot:P,name:"Dialog.Description"},u.createElement(rt,{initialFocus:l,containers:Z,features:U?me(X,{parent:rt.features.RestoreFocus,leaf:rt.features.All&~rt.features.FocusLock}):rt.features.None},u.createElement(B,null,de({ourProps:G,theirProps:m,slot:P,defaultTag:_l,features:Rl,visible:y===0,name:"Dialog"}))))))))),u.createElement(K,null))}let zl="div";function Wl(e,n){let t=xe(),{id:r=`headlessui-dialog-overlay-${t}`,...o}=e,[{dialogState:i,close:l}]=lt("Dialog.Overlay"),s=pe(n),a=M(d=>{if(d.target===d.currentTarget){if(gt(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),l()}}),m=u.useMemo(()=>({open:i===0}),[i]);return de({ourProps:{ref:s,id:r,"aria-hidden":!0,onClick:a},theirProps:o,slot:m,defaultTag:zl,name:"Dialog.Overlay"})}let Ul="div";function Hl(e,n){let t=xe(),{id:r=`headlessui-dialog-backdrop-${t}`,...o}=e,[{dialogState:i},l]=lt("Dialog.Backdrop"),s=pe(n);u.useEffect(()=>{if(l.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[l.panelRef]);let a=u.useMemo(()=>({open:i===0}),[i]);return u.createElement(Vt,{force:!0},u.createElement(qt,null,de({ourProps:{ref:s,id:r,"aria-hidden":!0},theirProps:o,slot:a,defaultTag:Ul,name:"Dialog.Backdrop"})))}let Vl="div";function Yl(e,n){let t=xe(),{id:r=`headlessui-dialog-panel-${t}`,...o}=e,[{dialogState:i},l]=lt("Dialog.Panel"),s=pe(n,l.panelRef),a=u.useMemo(()=>({open:i===0}),[i]),m=M(d=>{d.stopPropagation()});return de({ourProps:{ref:s,id:r,onClick:m},theirProps:o,slot:a,defaultTag:Vl,name:"Dialog.Panel"})}let ql="h2";function Gl(e,n){let t=xe(),{id:r=`headlessui-dialog-title-${t}`,...o}=e,[{dialogState:i,setTitleId:l}]=lt("Dialog.Title"),s=pe(n);u.useEffect(()=>(l(r),()=>l(null)),[r,l]);let a=u.useMemo(()=>({open:i===0}),[i]);return de({ourProps:{ref:s,id:r},theirProps:o,slot:a,defaultTag:ql,name:"Dialog.Title"})}let Kl=fe(Bl),Zl=fe(Hl),Xl=fe(Yl),Jl=fe(Wl),Ql=fe(Gl),Xn=Object.assign(Kl,{Backdrop:Zl,Panel:Xl,Overlay:Jl,Title:Ql,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 i=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),i=!0;let l=i?(t=o.innerText)!=null?t:"":r;return Jn.test(l)&&(l=l.replace(Jn,"")),l}function ei(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 i=document.getElementById(o);if(i){let l=i.getAttribute("aria-label");return typeof l=="string"?l.trim():Qn(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Qn(e).trim()}function ti(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 i=ei(r).trim().toLowerCase();return n.current=o,t.current=i,i})}var ni=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ni||{}),ri=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ri||{}),oi=(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))(oi||{});function Jt(e,n=t=>t){let t=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=At(n(e.items.slice()),i=>i.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let li={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:i=>i.id,resolveDisabled:i=>i.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(l=>{var s;return((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(r))&&!l.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return i===-1||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,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(i=>i.id===n.id);return o!==-1&&r.splice(o,1),r});return{...e,...t,activationTrigger:1}}},Qt=u.createContext(null);Qt.displayName="MenuContext";function xt(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,xt),t}return n}function ii(e,n){return me(n.type,li,e,n)}let si=u.Fragment;function ai(e,n){let{__demoMode:t=!1,...r}=e,o=u.useReducer(ii,{__demoMode:t,menuState:t?0:1,buttonRef:u.createRef(),itemsRef:u.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:l,buttonRef:s},a]=o,m=pe(n);Lt([s,l],(f,v)=>{var g;a({type:1}),Pt(v,Mt.Loose)||(f.preventDefault(),(g=s.current)==null||g.focus())},i===0);let d=M(()=>{a({type:1})}),h=u.useMemo(()=>({open:i===0,close:d}),[i,d]),b={ref:m};return u.createElement(Qt.Provider,{value:o},u.createElement(Bt,{value:me(i,{0:he.Open,1:he.Closed})},de({ourProps:b,theirProps:r,slot:h,defaultTag:si,name:"Menu"})))}let ui="button";function ci(e,n){var t;let r=xe(),{id:o=`headlessui-menu-button-${r}`,...i}=e,[l,s]=xt("Menu.Button"),a=pe(l.buttonRef,n),m=ke(),d=M(g=>{switch(g.key){case re.Space:case re.Enter:case re.ArrowDown:g.preventDefault(),g.stopPropagation(),s({type:0}),m.nextFrame(()=>s({type:2,focus:ie.First}));break;case re.ArrowUp:g.preventDefault(),g.stopPropagation(),s({type:0}),m.nextFrame(()=>s({type:2,focus:ie.Last}));break}}),h=M(g=>{switch(g.key){case re.Space:g.preventDefault();break}}),b=M(g=>{if(gt(g.currentTarget))return g.preventDefault();e.disabled||(l.menuState===0?(s({type:1}),m.nextFrame(()=>{var x;return(x=l.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})})):(g.preventDefault(),s({type:0})))}),f=u.useMemo(()=>({open:l.menuState===0}),[l]),v={ref:a,id:o,type:Dt(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":(t=l.itemsRef.current)==null?void 0:t.id,"aria-expanded":l.menuState===0,onKeyDown:d,onKeyUp:h,onClick:b};return de({ourProps:v,theirProps:i,slot:f,defaultTag:ui,name:"Menu.Button"})}let di="div",fi=Pe.RenderStrategy|Pe.Static;function mi(e,n){var t,r;let o=xe(),{id:i=`headlessui-menu-items-${o}`,...l}=e,[s,a]=xt("Menu.Items"),m=pe(s.itemsRef,n),d=_e(s.itemsRef),h=ke(),b=Qe(),f=b!==null?(b&he.Open)===he.Open:s.menuState===0;u.useEffect(()=>{let w=s.itemsRef.current;w&&s.menuState===0&&w!==(d==null?void 0:d.activeElement)&&w.focus({preventScroll:!0})},[s.menuState,s.itemsRef,d]),Mn({container:s.itemsRef.current,enabled:s.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,N;switch(h.dispose(),w.key){case re.Space:if(s.searchQuery!=="")return w.preventDefault(),w.stopPropagation(),a({type:3,value:w.key});case re.Enter:if(w.preventDefault(),w.stopPropagation(),a({type:1}),s.activeItemIndex!==null){let{dataRef:$}=s.items[s.activeItemIndex];(N=(y=$.current)==null?void 0:y.domRef.current)==null||N.click()}jn(s.buttonRef.current);break;case re.ArrowDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Next});case re.ArrowUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Previous});case re.Home:case re.PageUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.First});case re.End:case re.PageDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Last});case re.Escape:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{var $;return($=s.buttonRef.current)==null?void 0:$.focus({preventScroll:!0})});break;case re.Tab:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{ao(s.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}}),x=u.useMemo(()=>({open:s.menuState===0}),[s]),E={"aria-activedescendant":s.activeItemIndex===null||(t=s.items[s.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(r=s.buttonRef.current)==null?void 0:r.id,id:i,onKeyDown:v,onKeyUp:g,role:"menu",tabIndex:0,ref:m};return de({ourProps:E,theirProps:l,slot:x,defaultTag:di,features:fi,visible:f,name:"Menu.Items"})}let pi=u.Fragment;function hi(e,n){let t=xe(),{id:r=`headlessui-menu-item-${t}`,disabled:o=!1,...i}=e,[l,s]=xt("Menu.Item"),a=l.activeItemIndex!==null?l.items[l.activeItemIndex].id===r:!1,m=u.useRef(null),d=pe(n,m);le(()=>{if(l.__demoMode||l.menuState!==0||!a||l.activationTrigger===0)return;let $=Ee();return $.requestAnimationFrame(()=>{var A,R;(R=(A=m.current)==null?void 0:A.scrollIntoView)==null||R.call(A,{block:"nearest"})}),$.dispose},[l.__demoMode,m,a,l.menuState,l.activationTrigger,l.activeItemIndex]);let h=ti(m),b=u.useRef({disabled:o,domRef:m,get textValue(){return h()}});le(()=>{b.current.disabled=o},[b,o]),le(()=>(s({type:5,id:r,dataRef:b}),()=>s({type:6,id:r})),[b,r]);let f=M(()=>{s({type:1})}),v=M($=>{if(o)return $.preventDefault();s({type:1}),jn(l.buttonRef.current)}),g=M(()=>{if(o)return s({type:2,focus:ie.Nothing});s({type:2,focus:ie.Specific,id:r})}),x=Fn(),E=M($=>x.update($)),w=M($=>{x.wasMoved($)&&(o||a||s({type:2,focus:ie.Specific,id:r,trigger:0}))}),y=M($=>{x.wasMoved($)&&(o||a&&s({type:2,focus:ie.Nothing}))}),N=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:i,slot:N,defaultTag:pi,name:"Menu.Item"})}let vi=fe(ai),gi=fe(ci),bi=fe(mi),xi=fe(hi),wt=Object.assign(vi,{Button:gi,Items:bi,Item:xi}),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 wi(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=M(i=>(n(l=>[...l,i]),()=>n(l=>{let s=l.slice(),a=s.indexOf(i);return a!==-1&&s.splice(a,1),s}))),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 yi="label";function Ei(e,n){let t=xe(),{id:r=`headlessui-label-${t}`,passive:o=!1,...i}=e,l=tr(),s=pe(n);le(()=>l.register(r),[r,l.register]);let a={ref:s,...l.props,id:r};return o&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in i&&delete i.onClick),de({ourProps:a,theirProps:i,slot:l.slot||{},defaultTag:yi,name:l.name||"Label"})}let Si=fe(Ei),Ci=Object.assign(Si,{});function ji(e=0){let[n,t]=u.useState(e),r=tt(),o=u.useCallback(a=>{r.current&&t(m=>m|a)},[n,r]),i=u.useCallback(a=>!!(n&a),[n]),l=u.useCallback(a=>{r.current&&t(m=>m&~a)},[t,r]),s=u.useCallback(a=>{r.current&&t(m=>m^a)},[t]);return{flags:n,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}let en=u.createContext(null);en.displayName="GroupContext";let Ti=u.Fragment;function Oi(e){var n;let[t,r]=u.useState(null),[o,i]=wi(),[l,s]=Kn(),a=u.useMemo(()=>({switch:t,setSwitch:r,labelledby:o,describedby:l}),[t,r,o,l]),m={},d=e;return u.createElement(s,{name:"Switch.Description"},u.createElement(i,{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:Ti,name:"Switch.Group"}))))}let Ni="button";function ki(e,n){var t;let r=xe(),{id:o=`headlessui-switch-${r}`,checked:i,defaultChecked:l=!1,onChange:s,disabled:a=!1,name:m,value:d,form:h,...b}=e,f=u.useContext(en),v=u.useRef(null),g=pe(v,n,f===null?null:f.setSwitch),[x,E]=yn(i,s,l),w=M(()=>E==null?void 0:E(!x)),y=M(_=>{if(gt(_.currentTarget))return _.preventDefault();_.preventDefault(),w()}),N=M(_=>{_.key===re.Space?(_.preventDefault(),w()):_.key===re.Enter&&bo(_.currentTarget)}),$=M(_=>_.preventDefault()),A=u.useMemo(()=>({checked:x}),[x]),R={id:o,ref:g,role:"switch",type:Dt(e,v),tabIndex:e.tabIndex===-1?0:(t=e.tabIndex)!=null?t:0,"aria-checked":x,"aria-labelledby":f==null?void 0:f.labelledby,"aria-describedby":f==null?void 0:f.describedby,disabled:a,onClick:y,onKeyUp:N,onKeyPress:$},U=ke();return u.useEffect(()=>{var _;let L=(_=v.current)==null?void 0:_.closest("form");L&&l!==void 0&&U.addEventListener(L,"reset",()=>{E(l)})},[v,E]),u.createElement(u.Fragment,null,m!=null&&x&&u.createElement(Je,{features:He.Hidden,...vt({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:a,form:h,checked:x,name:m,value:d})}),de({ourProps:R,theirProps:b,slot:A,defaultTag:Ni,name:"Switch"}))}let Ii=fe(ki),$i=Oi,Fi=Object.assign(Ii,{Group:$i,Label:Ci,Description:Zn});function Mi(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 Pi(e,n){let t=Ee();if(!e)return t.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,l]=[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}),s=i+l;if(s!==0){t.group(m=>{m.setTimeout(()=>{n(),m.dispose()},s),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 Ai(e,n,t,r){let o=t?"enter":"leave",i=Ee(),l=r!==void 0?Mi(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=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,...s,...m),i.nextFrame(()=>{nn(e,...n.base,...s,...m),tn(e,...n.base,...s,...a),Pi(e,()=>(nn(e,...n.base,...s),tn(e,...n.base,...n.entered),l()))}),i.dispose}function Li({immediate:e,container:n,direction:t,classes:r,onStart:o,onStop:i}){let l=tt(),s=ke(),a=je(t);le(()=>{e&&(a.current="enter")},[e]),le(()=>{let m=Ee();s.add(m.dispose);let d=n.current;if(d&&a.current!=="idle"&&l.current)return m.dispose(),o.current(a.current),m.add(Ai(d,r.current,a.current==="enter",()=>{m.dispose(),i.current(a.current)})),m.dispose},[t])}function Le(e=""){return e.split(/\s+/).filter(n=>n.length>1)}let yt=u.createContext(null);yt.displayName="TransitionContext";var Di=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Di||{});function _i(){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 Ri(){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=je(e),r=u.useRef([]),o=tt(),i=ke(),l=M((f,v=Ae.Hidden)=>{let g=r.current.findIndex(({el:x})=>x===f);g!==-1&&(me(v,{[Ae.Unmount](){r.current.splice(g,1)},[Ae.Hidden](){r.current[g].state="hidden"}}),i.microTask(()=>{var x;!St(r)&&o.current&&((x=t.current)==null||x.call(t))}))}),s=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"}),()=>l(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(([x])=>x!==f)),n==null||n.chains.current[v].push([f,new Promise(x=>{a.current.push(x)})]),n==null||n.chains.current[v].push([f,new Promise(x=>{Promise.all(d.current[v].map(([E,w])=>w)).then(()=>x())})]),v==="enter"?m.current=m.current.then(()=>n==null?void 0:n.wait.current).then(()=>g(v)):g(v)}),b=M((f,v,g)=>{Promise.all(d.current[v].splice(0).map(([x,E])=>E)).then(()=>{var x;(x=a.current.shift())==null||x()}).then(()=>g(v))});return u.useMemo(()=>({children:r,register:s,unregister:l,onStart:h,onStop:b,wait:m,chains:d}),[s,l,r,h,b,d,m])}function Bi(){}let zi=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function rr(e){var n;let t={};for(let r of zi)t[r]=(n=e[r])!=null?n:Bi;return t}function Wi(e){let n=u.useRef(rr(e));return u.useEffect(()=>{n.current=rr(e)},[e]),n}let Ui="div",or=Pe.RenderStrategy;function Hi(e,n){var t,r;let{beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s,enter:a,enterFrom:m,enterTo:d,entered:h,leave:b,leaveFrom:f,leaveTo:v,...g}=e,x=u.useRef(null),E=pe(x,n),w=(t=g.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:y,appear:N,initial:$}=_i(),[A,R]=u.useState(y?"visible":"hidden"),U=Ri(),{register:_,unregister:L}=U;u.useEffect(()=>_(x),[_,x]),u.useEffect(()=>{if(w===Ae.Hidden&&x.current){if(y&&A!=="visible"){R("visible");return}return me(A,{hidden:()=>L(x),visible:()=>_(x)})}},[A,x,_,L,y,w]);let D=je({base:Le(g.className),enter:Le(a),enterFrom:Le(m),enterTo:Le(d),entered:Le(h),leave:Le(b),leaveFrom:Le(f),leaveTo:Le(v)}),B=Wi({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s}),V=Ue();u.useEffect(()=>{if(V&&A==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,A,V]);let Z=$&&!N,S=N&&y&&$,K=!V||Z?"idle":y?"enter":"leave",X=ji(0),T=M(ae=>me(ae,{enter:()=>{X.addFlag(he.Opening),B.current.beforeEnter()},leave:()=>{X.addFlag(he.Closing),B.current.beforeLeave()},idle:()=>{}})),k=M(ae=>me(ae,{enter:()=>{X.removeFlag(he.Opening),B.current.afterEnter()},leave:()=>{X.removeFlag(he.Closing),B.current.afterLeave()},idle:()=>{}})),z=nr(()=>{R("hidden"),L(x)},U),J=u.useRef(!1);Li({immediate:S,container:x,classes:D,direction:K,onStart:je(ae=>{J.current=!0,z.onStart(x,ae,T)}),onStop:je(ae=>{J.current=!1,z.onStop(x,ae,k),ae==="leave"&&!St(z)&&(R("hidden"),L(x))})});let ne=g,se={ref:E};return S?ne={...ne,className:pt(g.className,...D.current.enter,...D.current.enterFrom)}:J.current&&(ne.className=pt(g.className,(r=x.current)==null?void 0:r.className),ne.className===""&&delete ne.className),u.createElement(Et.Provider,{value:z},u.createElement(Bt,{value:me(A,{visible:he.Open,hidden:he.Closed})|X.flags},de({ourProps:se,theirProps:ne,defaultTag:Ui,features:or,visible:A==="visible",name:"Transition.Child"})))}function Vi(e,n){let{show:t,appear:r=!1,unmount:o=!0,...i}=e,l=u.useRef(null),s=pe(l,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")}),[b,f]=u.useState(!0),v=u.useRef([t]);le(()=>{b!==!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:b}),[t,r,b]);u.useEffect(()=>{if(t)d("visible");else if(!St(h))d("hidden");else{let y=l.current;if(!y)return;let N=y.getBoundingClientRect();N.x===0&&N.y===0&&N.width===0&&N.height===0&&d("hidden")}},[t,h]);let x={unmount:o},E=M(()=>{var y;b&&f(!1),(y=e.beforeEnter)==null||y.call(e)}),w=M(()=>{var y;b&&f(!1),(y=e.beforeLeave)==null||y.call(e)});return u.createElement(Et.Provider,{value:h},u.createElement(yt.Provider,{value:g},de({ourProps:{...x,as:u.Fragment,children:u.createElement(lr,{ref:s,...x,...i,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:u.Fragment,features:or,visible:m==="visible",name:"Transition"})))}function Yi(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(lr,{ref:n,...e}))}let rn=fe(Vi),lr=fe(Hi),qi=fe(Yi),De=Object.assign(rn,{Child:qi,Root:rn});function Gi({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 Ki=C.forwardRef(Gi);function Zi({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 Xi=C.forwardRef(Zi);function Ji({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 Qi=C.forwardRef(Ji);function es({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 ts=C.forwardRef(es);function ns({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(ns);function rs({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 ir=C.forwardRef(rs);function os({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 ls=C.forwardRef(os);function is({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 ss=C.forwardRef(is);function as({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 us=C.forwardRef(as),cs={warning:{color:"bg-yellow-50",icon:c.jsx(ls,{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(us,{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(Qi,{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(ss,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},ds=({type:e="info",title:n,message:t,active:r=!1,time:o=1e3,onClose:i})=>{const[l,s]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(r&&(s(!0),a.current=setTimeout(()=>{s(!1),i&&i()},o)),()=>clearTimeout(a.current)),[r,o,i]);const m=cs[e];return l?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(De,{as:u.Fragment,show:l,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 fs({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 ms=C.forwardRef(fs);function ps({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 hs=C.forwardRef(ps);function vs({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 gs=C.forwardRef(vs);function bs({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 xs=C.forwardRef(bs);function ws({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 ys=C.forwardRef(ws);function Es({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 Ss=C.forwardRef(Es),Cs=({src:e,alt:n,width:t,height:r,className:o="",classNameIcon:i="",isIcon:l=!0,acronym:s=""})=>{function a(){if(typeof s!="string")return s;const m=s.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"}):l?c.jsx(ys,{className:I("bg-white text-default-4",i!==""?i:"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",i!==""?i:"w-7 h-7"),children:a()})})},js=({steps:e,onClick:n})=>{const[t,r]=u.useState(0),o=i=>{r(i),n(i)};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((i,l)=>c.jsx("li",{children:t!==l?c.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>o(l),"data-testid":`step-${l}`,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"})]})},l))})})};var sr={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,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:{}};/*!
|
|
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
|
|
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:$("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:$("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":i==="start"&&o!==null,"mr-2":i==="end"&&o!==null}),v=()=>{a&&a()},g=l?I(dr(h,t),b):I(dr(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:s,onClick:v,disabled:l,"data-testid":`button-solid-${m}`,children:[i==="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}),i==="end"&&o!==null&&c.jsx("span",{children:o})]})})},Os=({label:e=null,checked:n=!1,onChange:t,id:r,className:o="",classNameCheckbox:i="h-4 w-4",style:l={},disabled:s=!1})=>{const[a,m]=u.useState(!1);return u.useEffect(()=>{m(n)},[n]),c.jsxs("div",{className:"flex items-center",style:l,"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",i!==""&&i),"data-testid":`checkbox-${r}`,disabled:s}),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 Ns({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 ks=C.forwardRef(Ns);function Is({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 fr=C.forwardRef(Is);function $s({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 Fs=C.forwardRef($s);function Ms({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 Ps=C.forwardRef(Ms);function As({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 Ls=C.forwardRef(As);function mr({children:e,className:n="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:t="",isOpen:r=!1,setIsOpen:o,showIconSuccess:i=!0,showButton:l=!0,style:s={}}){return c.jsx(De,{show:r,as:u.Fragment,children:c.jsxs(Xn,{as:"div",className:"z-50 relative",onClose:o,"data-testid":"modal",children:[c.jsx(De.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(De.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:s,children:[i&&c.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:c.jsx(ks,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),c.jsx("div",{className:I(t!==""&&t),"data-testid":"content",children:e}),l&&c.jsx("div",{className:"mt-5 sm:mt-6",children:c.jsx(it,{id:"close-modal",onClick:()=>o(!1),children:"Cerrar"})}),c.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const Ds=({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:i="",classNameDescription:l=""})=>{const s=()=>{n(!1),t()};return c.jsxs(mr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[c.jsx("p",{className:I("text-center text-sm",i!==""&&i),children:r}),c.jsx("p",{className:I("text-center text-sm",l!==""&&l),children:o}),c.jsxs("div",{className:"flex w-full justify-center mt-5",children:[c.jsx(ar,{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(it,{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:s,id:"confirmation",children:"Aceptar"})]})]})},_s=({className:e="",style:n={}})=>c.jsx("div",{className:I("w-px",e!==""&&e),style:n}),Rs=({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(hs,{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"})]}),ln=({children:e,childRef:n,message:t="",className:r="",classNameContainer:o="",style:i={}})=>{const[l,s]=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}),s(!0)},b=()=>s(!1),f=c.jsx(De,{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:l,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:b,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:b,style:i,children:v}),typeof window<"u"&&Tt.createPortal(f,document.body)]})},st=u.forwardRef((e,n)=>{const{placeholder:t="",label:r="",htmlFor:o,type:i="text",name:l,handleChange:s,onClick:a=()=>{},value:m,isReadOnly:d=!1,isError:h=!1,helperText:b="",autocomplete:f="off",id:v,classNameLabel:g="",classNameContainerInput:x="",classNameContainer:E="",className:w="",icon:y=null,onKeyDown:N,onFocus:$,min:A,maxWidth:R=5e3,onPaste:U}=e,[_,L]=u.useState(!1),D=Te({"ring-red-300 focus:ring-red-300 text-red-900":h||_,"focus:ring-primary-7 text-gray-500":!h&&!_}),B=V=>{if(s&&s(V),i!=="email")return;const{value:Z}=V.target,S=pn(Z);L(!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",x!==""&&x),children:[c.jsx(ln,{message:i==="password"?"":m,childRef:n,className:"text-sm",classNameContainer:"w-full",children:c.jsx("input",{id:v,name:l,type:i,autoComplete:f,placeholder:t,onChange:B,onClick:a,onKeyDown:N,onFocus:$,onPaste:U,value:m,readOnly:d,"data-testid":`input-${v}`,min:A,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",D,w!==""&&w),style:{maxWidth:`${R}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(ir,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),b.length===0||!h?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${v}`,children:b})]})});st.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 Bs(){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 pr=({height:e="36px",style:n={},styleMenu:t={},label:r="",onChange:o,isReadOnly:i=!1,isError:l=!1,helperText:s="",name:a,id:m,className:d="",classNameLabel:h="",classNameInput:b="",options:f,value:v=-1,defaultValue:g={value:-1,label:"",iconStart:null,iconEnd:null,selectedLabel:""},defaultLabel:x="label",defaultId:E="value",bgOptionSelect:w="bg-primary-7",isSearch:y=!1,loading:N=!1,isSingleOptionAndFirstLoad:$=!0,isTest:A=!1})=>{const R=u.useRef(!0),[U,_]=u.useState(""),[L,D]=u.useState(g),[B,V]=u.useState(!1);u.useEffect(()=>{if((f==null?void 0:f.length)!==1||!R.current)return;R.current=!1;const[T]=f,k=T[E],z=T[x];D({value:k,label:z}),$&&o({target:{value:T,checked:!1,name:a,type:void 0,id:T[E]}})},[f,E,x,o,a,$]),u.useEffect(()=>{if(v===-1||(f==null?void 0:f.length)===0)return;const T=f==null?void 0:f.find(z=>z[E]===v),k=T&&T.selectedLabel?{...T,label:T.selectedLabel}:T;k&&D(k)},[v,f,E]),u.useEffect(()=>{v==="clear"&&(L[E]!==g[E]||L[x]!==g[x]||A)&&D(g)},[g,A,L,v,E,x]);const Z=U===""?f:f.filter(T=>T[x].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(U.toLowerCase())),S=Te({"ring-red-300 focus:ring-red-300 text-red-900":l&&!i,"text-gray-500":!l,"focus:ring-primary-7":!l&&!i}),K=Te({"text-red-400":l&&!i,"text-gray-400":!l}),X=T=>{const k=T.selectedLabel?{...T,label:T.selectedLabel}:T;D(k),o({target:{value:k,checked:!1,name:a,type:void 0,id:T[E]}})};return c.jsxs($e,{as:"div",value:L,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(ln,{className:"text-sm",classNameContainer:"w-full",message:L[x],children:c.jsxs($e.Button,{className:"w-full","data-testid":`listbox-button-${m}`,children:[L.iconStart&&c.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:L.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",!l&&!i&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-primary-7",i&&"focus:ring-gray-300",S,b!==""&&b),onChange:T=>_(T.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:T=>{var k;return(k=T[x])==null?void 0:k.trim()},autoComplete:"off",readOnly:!y||i,style:{height:e,...n},"data-testid":"input-search",onClick:()=>V(i?!1:!B),onBlur:()=>V(!1)})]})}),L.iconEnd&&c.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:L.iconEnd}),!i&&c.jsx($e.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>V(i?!1:!B),"data-testid":"arrow-button",children:c.jsx(on,{className:I("h-5 w-5 ml-auto transition-transform","transform",B&&"rotate-180",K)})}),!i&&c.jsx(c.Fragment,{children:N?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,{})}):(Z??[]).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:Z.map((T,k)=>c.jsx($e.Option,{value:T,className:I(T[E]===L[E]?`${w} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${w}`),"data-testid":`select-${m}-${T[E]}`,onClick:()=>X(T),children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center",children:[T.iconStart&&c.jsx("span",{className:"mr-2","aria-hidden":"true",children:T.iconStart}),c.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:T[x]})]}),T.iconEnd&&c.jsx("span",{className:"ml-2","aria-hidden":"true",children:T.iconEnd})]})},k))}):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"})})})]}),s.length>0&&l&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${m}`,children:s})]})},zs=({isOpenMenu:e=null,placeholder:n="",label:t="",htmlFor:r,name:o,handleChange:i,onClick:l=()=>{},value:s,valueSelect:a,isReadOnly:m=!1,isError:d=!1,helperText:h="",autocomplete:b="on",id:f,classNameLabel:v="",classNameContainer:g="",className:x="",onKeyDown:E,options:w,idSelect:y,isMarginLeft:N=!0,classNameSelect:$="w-20",type:A="text"})=>{const R=u.useRef(null),U=u.useRef(null),{width:_}=vn(),[L,D]=u.useState(0);u.useEffect(()=>{if(!(!R.current||e===null))return U.current=window.setTimeout(()=>{const{offsetWidth:V}=R.current;D(V)},0),()=>window.clearTimeout(U.current)},[e]);const B=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?$(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:`
|
|
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 <`+F+">.")}return j}}function jr(p,j){{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:$("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:R=>l(R),id:y,options:w,value:a,isReadOnly:m,className:F,height:z<=640?"28px":"32px",classNameInput:$(O&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},styleMenu:{width:e===null?"fit-content":`${_}px`},isDisabledFocus:!0})}),c.jsx("input",{ref:U,id:f,name:o,type:D,autoComplete:x,placeholder:n,readOnly:m,"data-testid":`input-${f}`,onClick:s,onKeyDown:E,onChange:R=>l(R),value:i,className:$("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",L,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:$("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:$("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:$("text-sm font-medium text-gray-500 ml-2 self-end",i&&"hidden"),children:o}):c.jsx("p",{className:$("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:O="h-4",classNameInfoBottom:F="h-2",isInputTitle:D=!1,hiddenBorder:U=!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:$("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:$("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:O})})}),D&&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:$(D||U?"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:F})})})]}),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:O=!1,id:F,onClick:D=()=>{},isRelative:U=!0,isMaxWidth:V=!1,isTag:z=!1,isClear:_=!1,clear:k=null,applyButton:L=null,applyButtonText:R="Aplicar",tagsParent:W=[],isClearTagsParent:S=!1,isReadOnly:B,isDisabledApplyButton:Y=!0,isOpenMenu:j=void 0,onScroll:I=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(W.length===0)return;const N=new Map;W.forEach(K=>N.set(K.id,K)),ge(N)},[W]),u.useEffect(()=>{_&&(ie(new Set),ge(new Map),k&&k())},[k,_]);const we=N=>{let K=new Map(ae),Q=new Set(ne),Se=null;if(x!==null&&(N[d]===x&&(Se=crypto.randomUUID()),Se!==null&&(N[d]=Se),Se!==null&&(N[m]=N[m].replace(h,"").trim())),Q.has(N[d])?Q.delete(N[d]):Q.add(N[d]),K.has(N[d])?K.delete(N[d]):K.set(N[d],N),!i){const ze=Array.from(Q),We=Array.from(K);ze.shift(),We.shift(),Q=Q.size===2?new Set(ze):Q,K=K.size===2?new Map(We):K}a(N,Array.from(Q),Se!==null),ie(Q),ge(K)},q=N=>{D(N===!0?-1:F)},ue=N=>{const K=new Set(ne),Q=new Map(ae);K.delete(N[d]),Q.delete(N[d]),a(N,Array.from(K)),ie(K),ge(Q)},A=()=>{if(ne.size===0)return;const N=new Set(ne),K=new Map(ae);N.clear(),K.clear(),a(null,Array.from(N)),ie(N),ge(K)};function X(N){if(typeof N!="string")return N;const K=N.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}return c.jsxs(wt,{as:"div",className:$("inline-block text-left",U&&"relative",o!==""&&o),onClick:()=>q(!0),"data-testid":`menu-${F}`,id:F,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 <`+F+">.")}return j}}function jr(p,j){{if(
|
|
|
62
62
|
width: 414px;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`}),c.jsx(wt.Button,{as:"div",onClick:()=>W(N),"data-testid":`menu-button-${$}`,ref:J,children:e}),!K&&c.jsx("div",{className:I("absolute right-0 z-20",r,N&&"hidden",f&&"w-full"),children:c.jsx(De,{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:T,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":i===""&&"w-max",i!==""&&i),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,U&&"w-custom"),"data-testid":"dropdown-menu",onScroll:k,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",l),children:c.jsx(st,{htmlFor:"search",id:`dropdown-search-${$}`,name:"search",type:"text",placeholder:g,handleChange:O=>v(O,$),icon:g!==""&&c.jsx(gs,{className:"w-4 h-4 text-primary-4"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:x,onKeyDown:O=>O.key===" "&&O.stopPropagation(),autocomplete:"off"})}),B!==null&&c.jsxs("div",{className:I("pt-1.5 justify-end flex items-center",l),children:[c.jsx(it,{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:P,children:"Descartar"}),c.jsx(it,{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:()=>B({id:$,items:Array.from(ae.values())}),children:V})]})]}),_&&c.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(ae).map((O,Y)=>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(Ss,{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,Y)=>c.jsx("div",{className:I(!w&&"py-1",y&&Y===0&&"sticky top-0"),children:w?c.jsx("div",{onClick:Q=>{Q.preventDefault(),a()},"data-testid":`item-component-${Y}`,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-${Y}`,onClick:Q=>{Q.preventDefault(),we(O)},children:G(O[m])})})},Y))})]})})})})]})},sn=50,Vs=({total:e,handleNext:n,handlePrev:t,handleSelectPage:r,page:o=null,pageSize:i=sn})=>{const[l,s]=u.useState(1),[a,m]=u.useState([]),[d,h]=u.useState([]),[b,f]=u.useState(""),v=Math.ceil(e/i);u.useEffect(()=>{const y=[];for(let N=1;N<=v;N++)y.push(N);h(y)},[v]),u.useEffect(()=>{let y=[];const N="...",$="... ",A=" ...";if(d.length<6)y=d;else if(l>=1&&l<=3)y=[1,2,3,4,N,d.length];else if(l===4)y=[...d.slice(0,5),N,d.length];else if(l>4&&l<d.length-2){const R=d.slice(l-2,l),U=d.slice(l,l+1);y=[1,$,...R,...U,A,d.length]}else if(l>d.length-3){const R=d.slice(d.length-4);y=[1,$,...R]}m(y)},[l,d]),u.useEffect(()=>{o!==null&&o!==l&&s(o)},[o,l]);const g=y=>{f(""),s(y),r(y)},x=()=>{f(""),l>1&&s(l-1),l>1&&t(l-1)},E=()=>{f(""),l<d.length&&s(l+1),l<d.length&&n(l+1)},w=y=>{const{value:N}=y.target;if(!/^\d*$/.test(N))return;const $=Math.ceil(e/sn);N>$||f(N)};return u.useEffect(()=>{const y=setTimeout(()=>{const N=Number(b);!isNaN(N)&&N>=1&&N<=v&&(r(N),s(N))},500);return()=>clearTimeout(y)},[b,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:x,"data-testid":"prev",children:[c.jsx(Ki,{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(st,{htmlFor:"",id:"pager",name:"pager",handleChange:w,value:b,className:"pl-1.5 pr-1 h-7"})})]}),a.map((y,N)=>c.jsx(ur,{className:I("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",l===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-${N+1}`,children:y},N))]}),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(Xi,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},Ys=({setForm:e,setValuesDefault:n,className:t="",classNameContainer:r="",classNameContainerImg:o="",src:i=null,alt:l=null,width:s,height:a,title:m="Logo (Opcional)",fileFormatsDescription:d="PNG, JPG, GIF up to 10MB",acceptTypes:h,maxFileSize:b,onError:f,helperText:v="",isError:g=!1,multiple:x=!1,failAllOnError:E=!0,maxNumberOfFiles:w=null})=>{const y=Array.isArray(i)?i[0]:i,N=i===null?"":y.split("."),$=A=>{const{files:R}=A.target;if(!R||R.length===0)return;if(w&&R.length>w){f==null||f(`Solo se permite un máximo de ${w} archivo${w>1?"s":""}`);return}const U=Array.from(R).slice(0,w??R.length),_=U.map(L=>new Promise((D,B)=>{if(h&&!h.includes(L.type)){const Z=U.length>1?"Alguno de los archivos no es de un tipo permitido":"Tipo de archivo no permitido";B(new Error(Z));return}if(b&&L.size>b){B(new Error(`${U.length===1?"El archivo":"Cada archivo"} no puede superar ${b/(1024*1024)} MB`));return}const V=new FileReader;V.onload=()=>D({base64:V.result,type:L.type}),V.onerror=()=>B(new Error("Error al leer el archivo")),V.readAsDataURL(L)}));Promise.allSettled(_).then(L=>{const D=L.filter(K=>K.status==="rejected"),B=L.filter(K=>K.status==="fulfilled").map(K=>K.value);if(E&&D.length>0){const K=D[D.length-1].reason.message;f==null||f(K);return}if(!E&&D.length>0){const K=D[D.length-1].reason.message;f==null||f(K)}if(B.length===0)return;const V=B.length===1?B[0].base64:B.map(K=>K.base64),Z=B[0],S=Z.type.startsWith("image/")?Z.base64:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png";e(K=>({...K,photo:S})),n("photo",V)})};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:[i?c.jsx("div",{className:"flex",children:Array.isArray(i)?i.map((A,R)=>c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(A.split(".")[A.split(".").length-1])||A.startsWith("data:image/")?A:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:l,width:s,height:a,className:I(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:U=>U.currentTarget.style.filter="none","data-testid":"img"},R)):c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(N[N.length-1])||y.startsWith("data:image/")?y:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:l,width:s,height:a,className:I(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:A=>A.currentTarget.style.filter="none","data-testid":"img"})}):c.jsxs("div",{className:"text-center",children:[c.jsx(ms,{"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:x,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})]})},qs=({children:e,openDefault:n=!1,setForm:t,setValuesDefault:r,title:o,type:i,data:l,setData:s,id:a,defaultData:m,showAlert:d,isAdd:h=!0,search:b=null,isPadding:f=!0,isReadOnly:v=!1,isEdit:g=!1,deleteItem:x=null,validateAdd:E=null,loading:w=!1,internalEdit:y=!0,isDataEmpty:N=!0,typeProp:$="value",setAdd:A=null,hasNoRecords:R=!0,tabs:U=null,selectTab:_=null,className:L="mt-7"})=>{const[B,V]=u.useState(!1),[Z,S]=u.useState(!1),[,K]=u.useState(!1),[X,T]=u.useState(""),[k,z]=u.useState(1);u.useEffect(()=>{V(n),K(v)},[n,v]);const J=({e:W,index:ue})=>{const P=Ot(l),{name:G,value:O}=W.target;!(E===null?!1:E({value:O,copyData:P,index:ue}))&&(P[ue][G]=O),s(P),r(a,P),t(Q=>({...Q,[a]:P}))},ne=()=>{if(l.some(ue=>Object.values(ue).some(O=>O[$]===-1))||l.length===0)return d({title:"",message:"Todos los campos son requeridos",type:"warning"});t(ue=>({...ue,data:l})),r(a,l),s([...l,m]),A&&A([...l,m])},se=({index:W,item:ue})=>{if(l.length===1&&!g)return;let P=Ot(l);P.length===1&&(P=[m]),P.length>1&&P.splice(W,1),t(G=>({...G,data:P})),r(a,P),s(P),x&&x({index:W,item:ue,data:P}),W===l.length-1&&g&&P.length===0&&(t(G=>({...G,data:P})),r(a,P),s([...P,m]))},ae=()=>{S(!Z),K(!1)},ge=()=>{if(l.length>1)return;if(l.length===0)return!0;const[W]=l;return!W||typeof W!="object"?!0:Object.keys(W).filter(G=>{const O=W[G];return O&&typeof O=="object"&&"value"in O}).every(G=>W[G].value===-1)},we=({tab:W})=>{z(W.id),_&&_({tab:W})};return c.jsxs("div",{className:I("divide-y divide-gray-200 rounded-lg bg-white shadow",L),children:[c.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>V(!B),"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:[b&&c.jsx(st,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:W=>{b(W),T(W.target.value)},icon:c.jsx(Ps,{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:W=>W.stopPropagation(),onFocus:()=>V(!0)}),B?c.jsx(Fs,{className:"w-5 h-5 text-default-4"}):c.jsx(fr,{className:"w-5 h-5 text-default-4"})]})]}),c.jsx(De,{as:u.Fragment,show:B,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:[U&&c.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:U.map(W=>c.jsx("span",{className:I(k===W.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":k===W.id?"page":void 0,onClick:()=>we({tab:W}),"data-testid":`tab-${W.id}`,children:W.name},W.name))}),c.jsxs("div",{className:I("sm:mt-2.5 py-3.5 relative",f&&U===null&&"px-4 sm:p-6",f&&U!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[y&&!Z&&c.jsx(xs,{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,{})}),N&&ge()&&R&&!w&&(y?!Z:!g)&&c.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!w&&l.map((W,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:W,index:ue,handleChange:J,isEdit:y?Z:g}):e,h&&(y?Z: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",l.length===1&&!g&&"opacity-0"),children:c.jsx(Ls,{className:I("w-6 h-4",(l.length>1||g)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>se({index:ue,item:W}),"data-testid":`delete-item-${ue}-${a}`})})]},ue)),h&&(y?Z: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 ${i}`})]})]})})]})},Gs=({src:e,alt:n,width:t,height:r,className:o="",priority:i=!1,style:l={},id:s="",onClick:a=null,objectFit:m="cover"})=>{const[d,h]=u.useState(!1),b={filter:d?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:m,...t?{width:t}:{},...r?{height:r}:{},...l};return c.jsx("img",{src:e,alt:n,...t?{width:t}:{},...r?{height:r}:{},className:I(o!==""&&o),loading:i?"eager":"lazy",decoding:"async",style:b,onLoad:()=>h(!0),"data-testid":`image-${s}`,onClick:a})},Ks=["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 Zs({value:e,onChange:n,disabled:t,id:r,label:o="",classNameLabel:i="",helperText:l="",isError:s=!1,isReadOnly:a=!1,name:m}){const[d,h]=u.useState(!1),b=u.useRef(null);u.useEffect(()=>{function v(g){d&&b.current&&!b.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":s&&!a,"text-gray-500":!s,"focus:border-primary-7":!s&&!a});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
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:`
|
|
66
66
|
.black-icon::before {
|
|
67
67
|
color: rgb(51, 51, 51);
|
|
68
68
|
}
|
|
69
|
-
`}),o!==""&&c.jsx("p",{className:I("block text-sm font-medium leading-6",i!==""?i:"text-gray-700"),"data-testid":`label-${r}`,children:o}),c.jsxs("div",{style:{position:"relative",width:"100%"},className:I("border rounded-md",f),ref:b,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(fr,{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:Ks.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))})})]}),l.length>0&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${r}`,children:l})]})}const Ct=(e,n,t)=>{const r=t*n,o=r*(1-Math.abs(e/60%2-1)),i=t-r;let l,s,a;return e<60?[l,s,a]=[r,o,0]:e<120?[l,s,a]=[o,r,0]:e<180?[l,s,a]=[0,r,o]:e<240?[l,s,a]=[0,o,r]:e<300?[l,s,a]=[o,0,r]:[l,s,a]=[r,0,o],[Math.round((l+i)*255),Math.round((s+i)*255),Math.round((a+i)*255)]},an=(e,n,t)=>{e/=255,n/=255,t/=255;const r=Math.max(e,n,t),o=Math.min(e,n,t),i=r-o;let l;const s=r,a=r===0?0:i/r;if(r===o)l=0;else{switch(r){case e:l=(n-t)/i+(n<t?6:0);break;case n:l=(t-e)/i+2;break;case t:l=(e-n)/i+4;break}l*=60}return[l,a,s]},ut=(e,n,t)=>"#"+[e,n,t].map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase(),hr=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 Xs({value:e,onChange:n,disabled:t,label:r="",classNameLabel:o="",helperText:i="",isError:l=!1,isReadOnly:s=!1,name:a}){const m=u.useRef(!0),d=u.useRef(null),h=u.useRef(null),[b,f]=u.useState(!1),[v,g]=u.useState([182.2,.849,.494]),[x,E]=u.useState(e),w=u.useCallback(T=>{n({target:{value:T,name:a}})},[a,n]);u.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const T=hr(e);g(an(...T)),E(e.toUpperCase())}},[e]);const[y,N,$]=v,[A,R,U]=Ct(y,N,$),_=ut(A,R,U);u.useEffect(()=>{E(_)},[_]),u.useEffect(()=>{!m.current||s||(m.current=!1,w(_))},[_,w,s]),u.useEffect(()=>{function T(z){if(!d.current||!d.current._dragging)return;const J=d.current.getBoundingClientRect();let ne=(z.touches?z.touches[0].clientX:z.clientX)-J.left,se=(z.touches?z.touches[0].clientY:z.clientY)-J.top;ne=Math.max(0,Math.min(J.width,ne)),se=Math.max(0,Math.min(J.height,se));const ae=ne/J.width,ge=1-se/J.height;g([y,ae,ge]);const[we,W,ue]=Ct(y,ae,ge),P=ut(we,W,ue);E(P),w(P)}function k(){d.current&&(d.current._dragging=!1),window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",k),window.removeEventListener("touchmove",T),window.removeEventListener("touchend",k)}return d.current&&d.current._dragging&&(window.addEventListener("mousemove",T),window.addEventListener("mouseup",k),window.addEventListener("touchmove",T),window.addEventListener("touchend",k)),()=>{window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",k),window.removeEventListener("touchmove",T),window.removeEventListener("touchend",k)}},[w,y]),u.useEffect(()=>{function T(k){b&&h.current&&!h.current.contains(k.target)&&f(!1)}return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[b]);const L=T=>{if(!d.current)return;const k=d.current.getBoundingClientRect();let z=(T.touches?T.touches[0].clientX:T.clientX)-k.left,J=(T.touches?T.touches[0].clientY:T.clientY)-k.top;z=Math.max(0,Math.min(k.width,z)),J=Math.max(0,Math.min(k.height,J));const ne=z/k.width,se=1-J/k.height;g([y,ne,se]);const[ae,ge,we]=Ct(y,ne,se),W=ut(ae,ge,we);E(W),w(W)},D=T=>{t||(d.current&&(d.current._dragging=!0),L(T))},B=()=>{d.current&&(d.current._dragging=!1)},V=T=>{const k=Number(T.target.value);g([k,N,$]);const[z,J,ne]=Ct(k,N,$),se=ut(z,J,ne);E(se),w(se)},Z=T=>{const k=T.target.value;if(E(k),/^#[0-9A-Fa-f]{6}$/.test(k)){const z=hr(k);g(an(...z)),w(k.toUpperCase())}},S=(T,k)=>{const z=[A,R,U];z[T]=Math.max(0,Math.min(255,Number(k)||0)),g(an(...z));const J=ut(...z);E(J),w(J)},K=N*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(!b),children:[c.jsx("div",{className:"rounded border border-default-2 flex-shrink-0 w-6 h-6",style:{backgroundColor:s?"":_}}),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:s?"":x,disabled:t,onChange:Z,readOnly:s}),c.jsx(on,{className:Te("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":b&&!s})})]}),b&&!s&&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:D,onMouseMove:T=>d.current&&d.current._dragging&&L(T),onMouseUp:B,onMouseLeave:B,onTouchStart:D,onTouchMove:T=>d.current&&d.current._dragging&&L(T),onTouchEnd:B,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(${K}px - 8px)`,top:`calc(${X}px - 8px)`,background:_,pointerEvents:"none"}})]}),c.jsx("input",{type:"range",min:0,max:359,value:y,onChange:V,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((T,k)=>c.jsxs("div",{children:[c.jsx("label",{className:"text-center block",children:T}),c.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[A,R,U][k],onChange:z=>S(k,z.target.value),disabled:t,placeholder:T})]},k))})]})]}),i&&l&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:i})]})}const Js=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Qs=({className:e="",label:n="",onChange:t,name:r,id:o,value:i="#FFCEC7"})=>{const[l,s]=u.useState(!1),[a,m]=u.useState("#FFCEC7");hn({id:"menu-colors",close:()=>s(!1)}),u.useEffect(()=>{m(i)},[i]);const d=h=>{m(h),s(!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:()=>s(!l),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",l&&"transform rotate-180")})]}),c.jsx(De,{show:l,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:Js.map((h,b)=>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-${b}`,children:a===h&&c.jsx(ts,{className:"w-3 h-3 text-white",stroke:"2"})},b))})})]})};H.Accordion=qs,H.Alert=ds,H.Avatar=Cs,H.Bullets=js,H.ButtonOutline=ar,H.ButtonPagination=ur,H.ButtonSolid=it,H.Checkbox=Os,H.ConfirmationAbandoningCreation=Ds,H.CoverPhoto=Ys,H.Divider=_s,H.Dropdown=Hs,H.GoBack=Rs,H.IconSelectPicker=Zs,H.Image=Gs,H.Input=st,H.InputDropdown=zs,H.MESSAGE_ABORT_CONTROLLER=Mr,H.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=Pr,H.Modal=mr,H.Pagination=Vs,H.Select=pr,H.SelectColor=Qs,H.SketchColorPicker=Xs,H.Spinner=Bs,H.SpinnerIcon=at,H.Switch=Ws,H.Textarea=Us,H.Tooltip=ln,H.classNames=I,H.copyOptions=Ot,H.generateAvatarInitials=Ir,H.groupBy=$r,H.isPromise=Fr,H.rowsPerPage=sn,H.useCloseModal=hn,H.useForm=Ar,H.useMediaQuery=Lr,H.useWindowDimensions=vn,H.validateEmail=pn,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
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"})});
|