@dipusevilla/componentes-iu 1.0.28 → 1.0.31
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.cjs.js +10 -10
- package/dist/index.es.js +1267 -1259
- package/dist/index.umd.js +9 -9
- package/dist/types/components/SearchField.d.ts +1 -1
- package/package.json +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),as=require("react-dom");function wn(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const q=wn(y);function kn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var pt={exports:{}},rt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -14,26 +14,26 @@
|
|
|
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 yr;function En(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){function r(
|
|
17
|
+
*/var yr;function En(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===Z?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case j:return"Fragment";case w:return"Profiler";case T:return"StrictMode";case N:return"Suspense";case P:return"SuspenseList";case W:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case _:return"Portal";case S:return(h.displayName||"Context")+".Provider";case v:return(h._context.displayName||"Context")+".Consumer";case M:var E=h.render;return h=h.displayName,h||(h=E.displayName||E.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case G:return E=h.displayName||null,E!==null?E:r(h.type)||"Memo";case F:E=h._payload,h=h._init;try{return r(h(E))}catch{}}return null}function t(h){return""+h}function e(h){try{t(h);var E=!1}catch{E=!0}if(E){E=console;var R=E.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return R.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),t(h)}}function s(h){if(h===j)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===F)return"<...>";try{var E=r(h);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function n(){var h=$.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function o(h){if(I.call(h,"key")){var E=Object.getOwnPropertyDescriptor(h,"key").get;if(E&&E.isReactWarning)return!1}return h.key!==void 0}function l(h,E){function R(){Q||(Q=!0,console.error("%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://react.dev/link/special-props)",E))}R.isReactWarning=!0,Object.defineProperty(h,"key",{get:R,configurable:!0})}function c(){var h=r(this.type);return re[h]||(re[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function d(h,E,R,z,te,le,pe,se){return R=le.ref,h={$$typeof:b,type:h,key:E,props:le,_owner:te},(R!==void 0?R:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:c}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,E,R,z,te,le,pe,se){var Y=E.children;if(Y!==void 0)if(z)if(K(Y)){for(z=0;z<Y.length;z++)p(Y[z]);Object.freeze&&Object.freeze(Y)}else console.error("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 p(Y);if(I.call(E,"key")){Y=r(h);var ne=Object.keys(E).filter(function(ae){return ae!=="key"});z=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",V[Y+z]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,B,H,ne,H),K[H+B]=!0)}if(H=null,L!==void 0&&(e(L),H=""+L),o(F)&&(e(F.key),H=""+F.key),"key"in F){L={};for(var de in F)de!=="key"&&(L[de]=F[de])}else L=F;return H&&l(L,typeof m=="function"?m.displayName||m.name||"Unknown":m),u(m,H,le,re,n(),L,pe,se)}function p(m){typeof m=="object"&&m!==null&&m.$$typeof===b&&m._store&&(m._store.validated=1)}var x=v,b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),G=Symbol.for("react.client.reference"),R=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,X=Array.isArray,ee=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(m){return m()}};var I,J={},Z=x["react-stack-bottom-frame"].bind(x,a)(),h=ee(s(a)),K={};st.Fragment=j,st.jsx=function(m,F,L,B,re){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(m,F,L,!1,B,re,le?Error("react-stack-top-frame"):Z,le?ee(s(m)):h)},st.jsxs=function(m,F,L,B,re){var le=1e4>R.recentlyCreatedOwnerStacks++;return f(m,F,L,!0,B,re,le?Error("react-stack-top-frame"):Z,le?ee(s(m)):h)}}()),st}var vr;function Nn(){return vr||(vr=1,process.env.NODE_ENV==="production"?pt.exports=jn():pt.exports=En()),pt.exports}var i=Nn();function os(r){var t,e,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(e=os(r[t]))&&(s&&(s+=" "),s+=e)}else for(e in r)r[e]&&(s&&(s+=" "),s+=e);return s}function $(){for(var r,t,e=0,s="",n=arguments.length;e<n;e++)(r=arguments[e])&&(t=os(r))&&(s&&(s+=" "),s+=t);return s}const Sn={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-10 h-10",full:"w-full h-full"};function Ce({component:r,size:t="sm",className:e,...s}){return i.jsx(r,{className:$(Sn[t],e),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const _n="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",Fn={primary:"bg-[var(--color-ds-button-primary-bg)] text-[var(--color-ds-button-primary-text)] hover:animate-pulse",outline:"bg-transparent text-[var(--color-ds-text-primary)] ring-1 ring-inset ring-[var(--color-ds-border-default)] hover:bg-[var(--color-ds-background-accent)] hover:text-[var(--color-ds-text-on-accent)]",ghost:"bg-transparent text-[var(--color-ds-text-primary)] hover:animate-pulse"},Tn={sm:"text-ds-sm h-6 px-2",md:"text-ds-md h-10 px-2.5",lg:"text-ds-lg h-12 px-3"},Cn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},On="disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-[var(--color-ds-background-disabled)] disabled:text-[var(--color-ds-text-on-accent)] disabled:ring-1 disabled:ring-inset disabled:ring-[var(--color-ds-border-muted)]";function $e({type:r="button",variant:t="primary",size:e="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:u,className:f}){const p=!!a,x=p&&!c,b=x?Cn[e]:Tn[e];return i.jsxs("button",{type:r,onClick:u,disabled:n,"aria-label":x?l:void 0,style:s?{width:s}:void 0,className:$(_n,Fn[t],b,On,f,p&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Ce,{component:a,size:e}),c,a&&o==="right"&&i.jsx(Ce,{component:a,size:e})]})}function An({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Mn=q.forwardRef(An);function Rn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const is=q.forwardRef(Rn);function Vn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const $n=q.forwardRef(Vn);function Dn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const In=q.forwardRef(Dn);function Ln({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Pn=q.forwardRef(Ln);function zn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const wr=q.forwardRef(zn);function Un({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const Bn=q.forwardRef(Un);function Wn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ls=q.forwardRef(Wn);function Zn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))}const qn=q.forwardRef(Zn);function Gn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Hn=q.forwardRef(Gn);function Yn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const Xn=q.forwardRef(Yn);function Kn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const Jn=q.forwardRef(Kn);function Qn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tr=q.forwardRef(Qn);function Bt({title:r,children:t,defaultOpen:e=!0,className:s}){const[n,a]=v.useState(e),o=v.useRef(null),l=v.useRef(null),[c,u]=v.useState(0),f=()=>{if(l.current){const p=l.current.scrollHeight;u(p)}};return v.useLayoutEffect(()=>{f()},[n]),v.useEffect(()=>{const p=l.current;if(!p)return;const x=new ResizeObserver(()=>{f()});return x.observe(p),()=>{x.disconnect()}},[]),i.jsxs("div",{className:$("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:"flex items-center justify-between w-full hover:bg-[var(--color-ds-surface-hover)] transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"block w-1 h-5 bg-[var(--color-ds-background-accent)] rounded-sm"}),i.jsx("span",{className:"font-semibold text-[var(--color-ds-text-primary)]",children:r})]}),n?i.jsx(In,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(is,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",children:i.jsx("div",{className:"px-6",children:i.jsx("div",{ref:o,className:$("overflow-hidden transition-all duration-300 ease-in-out",n?"opacity-100":"opacity-0"),style:{maxHeight:n?`${c}px`:"0px"},children:i.jsx("div",{ref:l,className:"py-4",children:t})})})})]})}const rr="-",ea=r=>{const t=ra(r),{conflictingClassGroups:e,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(rr);return l[0]===""&&l.length!==1&&l.shift(),cs(l,t)||ta(o)},getConflictingClassGroupIds:(o,l)=>{const c=e[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},cs=(r,t)=>{var o;if(r.length===0)return t.classGroupId;const e=r[0],s=t.nextPart.get(e),n=s?cs(r.slice(1),s):void 0;if(n)return n;if(t.validators.length===0)return;const a=r.join(rr);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},kr=/^\[(.+)\]$/,ta=r=>{if(kr.test(r)){const t=kr.exec(r)[1],e=t==null?void 0:t.substring(0,t.indexOf(":"));if(e)return"arbitrary.."+e}},ra=r=>{const{theme:t,classGroups:e}=r,s={nextPart:new Map,validators:[]};for(const n in e)Wt(e[n],s,n,t);return s},Wt=(r,t,e,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?t:jr(t,n);a.classGroupId=e;return}if(typeof n=="function"){if(sa(n)){Wt(n(s),t,e,s);return}t.validators.push({validator:n,classGroupId:e});return}Object.entries(n).forEach(([a,o])=>{Wt(o,jr(t,a),e,s)})})},jr=(r,t)=>{let e=r;return t.split(rr).forEach(s=>{e.nextPart.has(s)||e.nextPart.set(s,{nextPart:new Map,validators:[]}),e=e.nextPart.get(s)}),e},sa=r=>r.isThemeGetter,na=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,e=new Map,s=new Map;const n=(a,o)=>{e.set(a,o),t++,t>r&&(t=0,s=e,e=new Map)};return{get(a){let o=e.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){e.has(a)?e.set(a,o):n(a,o)}}},Zt="!",qt=":",aa=qt.length,oa=r=>{const{prefix:t,experimentalParseClassName:e}=r;let s=n=>{const a=[];let o=0,l=0,c=0,u;for(let E=0;E<n.length;E++){let j=n[E];if(o===0&&l===0){if(j===qt){a.push(n.slice(c,E)),c=E+aa;continue}if(j==="/"){u=E;continue}}j==="["?o++:j==="]"?o--:j==="("?l++:j===")"&&l--}const f=a.length===0?n:n.substring(c),p=ia(f),x=p!==f,b=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:x,baseClassName:p,maybePostfixModifierPosition:b}};if(t){const n=t+qt,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(e){const n=s;s=a=>e({className:a,parseClassName:n})}return s},ia=r=>r.endsWith(Zt)?r.substring(0,r.length-1):r.startsWith(Zt)?r.substring(1):r,la=r=>{const t=Object.fromEntries(r.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(o=>{o[0]==="["||t[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},ca=r=>({cache:na(r.cacheSize),parseClassName:oa(r),sortModifiers:la(r),...ea(r)}),da=/\s+/,ua=(r,t)=>{const{parseClassName:e,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=t,o=[],l=r.trim().split(da);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:p,modifiers:x,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:j}=e(f);if(p){c=f+(c.length>0?" "+c:c);continue}let T=!!j,w=s(T?E.substring(0,j):E);if(!w){if(!T){c=f+(c.length>0?" "+c:c);continue}if(w=s(E),!w){c=f+(c.length>0?" "+c:c);continue}T=!1}const y=a(x).join(":"),N=b?y+Zt:y,O=N+w;if(o.includes(O))continue;o.push(O);const _=n(w,T);for(let D=0;D<_.length;++D){const Q=_[D];o.push(N+Q)}c=f+(c.length>0?" "+c:c)}return c};function fa(){let r=0,t,e,s="";for(;r<arguments.length;)(t=arguments[r++])&&(e=ds(t))&&(s&&(s+=" "),s+=e);return s}const ds=r=>{if(typeof r=="string")return r;let t,e="";for(let s=0;s<r.length;s++)r[s]&&(t=ds(r[s]))&&(e&&(e+=" "),e+=t);return e};function ha(r,...t){let e,s,n,a=o;function o(c){const u=t.reduce((f,p)=>p(f),r());return e=ca(u),s=e.cache.get,n=e.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const f=ua(c,e);return n(c,f),f}return function(){return a(fa.apply(null,arguments))}}const he=r=>{const t=e=>e[r]||[];return t.isThemeGetter=!0,t},us=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ma=/^\d+\/\d+$/,pa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ga=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ya=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=r=>ma.test(r),te=r=>!!r&&!Number.isNaN(Number(r)),Ie=r=>!!r&&Number.isInteger(Number(r)),$t=r=>r.endsWith("%")&&te(r.slice(0,-1)),Ae=r=>pa.test(r),va=()=>!0,wa=r=>xa.test(r)&&!ga.test(r),hs=()=>!1,ka=r=>ba.test(r),ja=r=>ya.test(r),Ea=r=>!z(r)&&!U(r),Na=r=>Je(r,xs,hs),z=r=>us.test(r),Ue=r=>Je(r,gs,wa),Dt=r=>Je(r,Ca,te),Er=r=>Je(r,ms,hs),Sa=r=>Je(r,ps,ja),xt=r=>Je(r,bs,ka),U=r=>fs.test(r),nt=r=>Qe(r,gs),_a=r=>Qe(r,Oa),Nr=r=>Qe(r,ms),Fa=r=>Qe(r,xs),Ta=r=>Qe(r,ps),gt=r=>Qe(r,bs,!0),Je=(r,t,e)=>{const s=us.exec(r);return s?s[1]?t(s[1]):e(s[2]):!1},Qe=(r,t,e=!1)=>{const s=fs.exec(r);return s?s[1]?t(s[1]):e:!1},ms=r=>r==="position"||r==="percentage",ps=r=>r==="image"||r==="url",xs=r=>r==="length"||r==="size"||r==="bg-size",gs=r=>r==="length",Ca=r=>r==="number",Oa=r=>r==="family-name",bs=r=>r==="shadow",Aa=()=>{const r=he("color"),t=he("font"),e=he("text"),s=he("font-weight"),n=he("tracking"),a=he("leading"),o=he("breakpoint"),l=he("container"),c=he("spacing"),u=he("radius"),f=he("shadow"),p=he("inset-shadow"),x=he("text-shadow"),b=he("drop-shadow"),E=he("blur"),j=he("perspective"),T=he("aspect"),w=he("ease"),y=he("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...O(),U,z],D=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],S=()=>[U,z,c],W=()=>[He,"full","auto",...S()],G=()=>[Ie,"none","subgrid",U,z],R=()=>["auto",{span:["full",Ie,U,z]},Ie,U,z],P=()=>[Ie,"auto",U,z],X=()=>["auto","min","max","fr",U,z],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...S()],Z=()=>[He,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],h=()=>[r,U,z],K=()=>[...O(),Nr,Er,{position:[U,z]}],m=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Fa,Na,{size:[U,z]}],L=()=>[$t,nt,Ue],B=()=>["","none","full",u,U,z],re=()=>["",te,nt,Ue],le=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[te,$t,Nr,Er],H=()=>["","none",E,U,z],ne=()=>["none",te,U,z],de=()=>["none",te,U,z],ae=()=>[te,U,z],je=()=>[He,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ae],breakpoint:[Ae],color:[va],container:[Ae],"drop-shadow":[Ae],ease:["in","out","in-out"],font:[Ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ae],shadow:[Ae],spacing:["px",te],text:[Ae],"text-shadow":[Ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",He,z,U,T]}],container:["container"],columns:[{columns:[te,z,U,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{start:W()}],end:[{end:W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[Ie,"auto",U,z]}],basis:[{basis:[He,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[te,He,"auto","initial","none",z]}],grow:[{grow:["",te,U,z]}],shrink:[{shrink:["",te,U,z]}],order:[{order:[Ie,"first","last","none",U,z]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[l,"screen",...Z()]}],"min-w":[{"min-w":[l,"screen","none",...Z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",e,nt,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,U,Dt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$t,z]}],"font-family":[{font:[_a,z,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,U,z]}],"line-clamp":[{"line-clamp":[te,"none",U,Dt]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",U,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[te,"from-font","auto",U,Ue]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[te,"auto",U,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",U,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:m()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ie,U,z],radial:["",U,z],conic:[Ie,U,z]},Ta,Sa]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[te,U,z]}],"outline-w":[{outline:["",te,nt,Ue]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",f,gt,xt]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",p,gt,xt]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[te,Ue]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",x,gt,xt]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[te,U,z]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[te]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[U,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[te]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:m()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,z]}],filter:[{filter:["","none",U,z]}],blur:[{blur:H()}],brightness:[{brightness:[te,U,z]}],contrast:[{contrast:[te,U,z]}],"drop-shadow":[{"drop-shadow":["","none",b,gt,xt]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",te,U,z]}],"hue-rotate":[{"hue-rotate":[te,U,z]}],invert:[{invert:["",te,U,z]}],saturate:[{saturate:[te,U,z]}],sepia:[{sepia:["",te,U,z]}],"backdrop-filter":[{"backdrop-filter":["","none",U,z]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[te,U,z]}],"backdrop-contrast":[{"backdrop-contrast":[te,U,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",te,U,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[te,U,z]}],"backdrop-invert":[{"backdrop-invert":["",te,U,z]}],"backdrop-opacity":[{"backdrop-opacity":[te,U,z]}],"backdrop-saturate":[{"backdrop-saturate":[te,U,z]}],"backdrop-sepia":[{"backdrop-sepia":["",te,U,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[te,"initial",U,z]}],ease:[{ease:["linear","initial",w,U,z]}],delay:[{delay:[te,U,z]}],animate:[{animate:["none",y,U,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,U,z]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[U,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",U,z]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",U,z]}],fill:[{fill:["none",...h()]}],"stroke-w":[{stroke:[te,nt,Ue,Dt]}],stroke:[{stroke:["none",...h()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ma=ha(Aa);var dt=r=>r.type==="checkbox",Be=r=>r instanceof Date,ye=r=>r==null;const ys=r=>typeof r=="object";var fe=r=>!ye(r)&&!Array.isArray(r)&&ys(r)&&!Be(r),vs=r=>fe(r)&&r.target?dt(r.target)?r.target.checked:r.target.value:r,Ra=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,ws=(r,t)=>r.has(Ra(t)),Va=r=>{const t=r.constructor&&r.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},sr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(r){let t;const e=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)t=new Date(r);else if(r instanceof Set)t=new Set(r);else if(!(sr&&(r instanceof Blob||s))&&(e||fe(r)))if(t=e?[]:{},!e&&!Va(r))t=r;else for(const n in r)r.hasOwnProperty(n)&&(t[n]=ge(r[n]));else return r;return t}var At=r=>Array.isArray(r)?r.filter(Boolean):[],ue=r=>r===void 0,M=(r,t,e)=>{if(!t||!fe(r))return e;const s=At(t.split(/[,[\].]+?/)).reduce((n,a)=>ye(n)?n:n[a],r);return ue(s)||s===r?ue(r[t])?e:r[t]:s},ke=r=>typeof r=="boolean",nr=r=>/^\w*$/.test(r),ks=r=>At(r.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(r,t,e)=>{let s=-1;const n=nr(t)?[t]:ks(t),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=e;if(s!==o){const u=r[l];c=fe(u)||Array.isArray(u)?u:isNaN(+n[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;r[l]=c,r=r[l]}};const St={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Se={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Me={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},js=v.createContext(null),ut=()=>v.useContext(js),$a=r=>{const{children:t,...e}=r;return v.createElement(js.Provider,{value:e},t)};var Es=(r,t,e,s=!0)=>{const n={defaultValues:t._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Se.all&&(t._proxyFormState[o]=!s||Se.all),e&&(e[o]=!0),r[o]}});return n};const ar=typeof window<"u"?q.useLayoutEffect:q.useEffect;function Da(r){const t=ut(),{control:e=t.control,disabled:s,name:n,exact:a}=r||{},[o,l]=v.useState(e._formState),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ar(()=>e._subscribe({name:n,formState:c.current,exact:a,callback:u=>{!s&&l({...e._formState,...u})}}),[n,s,a]),v.useEffect(()=>{c.current.isValid&&e._setValid(!0)},[e]),v.useMemo(()=>Es(o,e,c.current,!1),[o,e])}var Oe=r=>typeof r=="string",Ns=(r,t,e,s,n)=>Oe(r)?(s&&t.watch.add(r),M(e,r,n)):Array.isArray(r)?r.map(a=>(s&&t.watch.add(a),M(e,a))):(s&&(t.watchAll=!0),e);function or(r){const t=ut(),{control:e=t.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=v.useRef(n),[c,u]=v.useState(e._getWatch(s,l.current));return ar(()=>e._subscribe({name:s,formState:{values:!0},exact:o,callback:f=>!a&&u(Ns(s,e._names,f.values||e._formValues,!1,l.current))}),[s,e,a,o]),v.useEffect(()=>e._removeUnmounted()),c}function Ss(r){const t=ut(),{name:e,disabled:s,control:n=t.control,shouldUnregister:a}=r,o=ws(n._names.array,e),l=or({control:n,name:e,defaultValue:M(n._formValues,e,M(n._defaultValues,e,r.defaultValue)),exact:!0}),c=Da({control:n,name:e,exact:!0}),u=v.useRef(r),f=v.useRef(n.register(e,{...r.rules,value:l,...ke(r.disabled)?{disabled:r.disabled}:{}})),p=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!M(c.errors,e)},isDirty:{enumerable:!0,get:()=>!!M(c.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!M(c.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!M(c.validatingFields,e)},error:{enumerable:!0,get:()=>M(c.errors,e)}}),[c,e]),x=v.useCallback(T=>f.current.onChange({target:{value:vs(T),name:e},type:St.CHANGE}),[e]),b=v.useCallback(()=>f.current.onBlur({target:{value:M(n._formValues,e),name:e},type:St.BLUR}),[e,n._formValues]),E=v.useCallback(T=>{const w=M(n._fields,e);w&&T&&(w._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:y=>T.setCustomValidity(y),reportValidity:()=>T.reportValidity()})},[n._fields,e]),j=v.useMemo(()=>({name:e,value:l,...ke(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:x,onBlur:b,ref:E}),[e,s,c.disabled,x,b,E,l]);return v.useEffect(()=>{const T=n._options.shouldUnregister||a;n.register(e,{...u.current.rules,...ke(u.current.disabled)?{disabled:u.current.disabled}:{}});const w=(y,N)=>{const O=M(n._fields,y);O&&O._f&&(O._f.mount=N)};if(w(e,!0),T){const y=ge(M(n._options.defaultValues,e));oe(n._defaultValues,e,y),ue(M(n._formValues,e))&&oe(n._formValues,e,y)}return!o&&n.register(e),()=>{(o?T&&!n._state.action:T)?n.unregister(e):w(e,!1)}},[e,n,o,a]),v.useEffect(()=>{n._setDisabledField({disabled:s,name:e})},[s,e,n]),v.useMemo(()=>({field:j,formState:c,fieldState:p}),[j,c,p])}const Fe=r=>r.render(Ss(r));var _s=(r,t,e,s,n)=>t?{...e[r],types:{...e[r]&&e[r].types?e[r].types:{},[s]:n||!0}}:{},it=r=>Array.isArray(r)?r:[r],Sr=()=>{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},Gt=r=>ye(r)||!ys(r);function Pe(r,t){if(Gt(r)||Gt(t))return r===t;if(Be(r)&&Be(t))return r.getTime()===t.getTime();const e=Object.keys(r),s=Object.keys(t);if(e.length!==s.length)return!1;for(const n of e){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=t[n];if(Be(a)&&Be(o)||fe(a)&&fe(o)||Array.isArray(a)&&Array.isArray(o)?!Pe(a,o):a!==o)return!1}}return!0}var be=r=>fe(r)&&!Object.keys(r).length,ir=r=>r.type==="file",_e=r=>typeof r=="function",_t=r=>{if(!sr)return!1;const t=r?r.ownerDocument:0;return r instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fs=r=>r.type==="select-multiple",lr=r=>r.type==="radio",Ia=r=>lr(r)||dt(r),It=r=>_t(r)&&r.isConnected;function La(r,t){const e=t.slice(0,-1).length;let s=0;for(;s<e;)r=ue(r)?s++:r[t[s++]];return r}function Pa(r){for(const t in r)if(r.hasOwnProperty(t)&&!ue(r[t]))return!1;return!0}function me(r,t){const e=Array.isArray(t)?t:nr(t)?[t]:ks(t),s=e.length===1?r:La(r,e),n=e.length-1,a=e[n];return s&&delete s[a],n!==0&&(fe(s)&&be(s)||Array.isArray(s)&&Pa(s))&&me(r,e.slice(0,-1)),r}var Ts=r=>{for(const t in r)if(_e(r[t]))return!0;return!1};function Ft(r,t={}){const e=Array.isArray(r);if(fe(r)||e)for(const s in r)Array.isArray(r[s])||fe(r[s])&&!Ts(r[s])?(t[s]=Array.isArray(r[s])?[]:{},Ft(r[s],t[s])):ye(r[s])||(t[s]=!0);return t}function Cs(r,t,e){const s=Array.isArray(r);if(fe(r)||s)for(const n in r)Array.isArray(r[n])||fe(r[n])&&!Ts(r[n])?ue(t)||Gt(e[n])?e[n]=Array.isArray(r[n])?Ft(r[n],[]):{...Ft(r[n])}:Cs(r[n],ye(t)?{}:t[n],e[n]):e[n]=!Pe(r[n],t[n]);return e}var at=(r,t)=>Cs(r,t,Ft(t));const _r={value:!1,isValid:!1},Fr={value:!0,isValid:!0};var Os=r=>{if(Array.isArray(r)){if(r.length>1){const t=r.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!ue(r[0].attributes.value)?ue(r[0].value)||r[0].value===""?Fr:{value:r[0].value,isValid:!0}:Fr:_r}return _r},As=(r,{valueAsNumber:t,valueAsDate:e,setValueAs:s})=>ue(r)?r:t?r===""?NaN:r&&+r:e&&Oe(r)?new Date(r):s?s(r):r;const Tr={isValid:!1,value:null};var Ms=r=>Array.isArray(r)?r.reduce((t,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:t,Tr):Tr;function Cr(r){const t=r.ref;return ir(t)?t.files:lr(t)?Ms(r.refs).value:Fs(t)?[...t.selectedOptions].map(({value:e})=>e):dt(t)?Os(r.refs).value:As(ue(t.value)?r.ref.value:t.value,r)}var za=(r,t,e,s)=>{const n={};for(const a of r){const o=M(t,a);o&&oe(n,a,o._f)}return{criteriaMode:e,names:[...r],fields:n,shouldUseNativeValidation:s}},Tt=r=>r instanceof RegExp,ot=r=>ue(r)?r:Tt(r)?r.source:fe(r)?Tt(r.value)?r.value.source:r.value:r,Or=r=>({isOnSubmit:!r||r===Se.onSubmit,isOnBlur:r===Se.onBlur,isOnChange:r===Se.onChange,isOnAll:r===Se.all,isOnTouch:r===Se.onTouched});const Ar="AsyncFunction";var Ua=r=>!!r&&!!r.validate&&!!(_e(r.validate)&&r.validate.constructor.name===Ar||fe(r.validate)&&Object.values(r.validate).find(t=>t.constructor.name===Ar)),Ba=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),Mr=(r,t,e)=>!e&&(t.watchAll||t.watch.has(r)||[...t.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const lt=(r,t,e,s)=>{for(const n of e||Object.keys(r)){const a=M(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!s)return!0;if(o.ref&&t(o.ref,o.name)&&!s)return!0;if(lt(l,t))break}else if(fe(l)&<(l,t))break}}};function Rr(r,t,e){const s=M(r,e);if(s||nr(e))return{error:s,name:e};const n=e.split(".");for(;n.length;){const a=n.join("."),o=M(t,a),l=M(r,a);if(o&&!Array.isArray(o)&&e!==a)return{name:e};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:e}}var Wa=(r,t,e,s)=>{e(r);const{name:n,...a}=r;return be(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!s||Se.all))},Za=(r,t,e)=>!r||!t||r===t||it(r).some(s=>s&&(e?s===t:s.startsWith(t)||t.startsWith(s))),qa=(r,t,e,s,n)=>n.isOnAll?!1:!e&&n.isOnTouch?!(t||r):(e?s.isOnBlur:n.isOnBlur)?!r:(e?s.isOnChange:n.isOnChange)?r:!0,Ga=(r,t)=>!At(M(r,t)).length&&me(r,t),Ha=(r,t,e)=>{const s=it(M(r,e));return oe(s,"root",t[e]),oe(r,e,s),r},jt=r=>Oe(r);function Vr(r,t,e="validate"){if(jt(r)||Array.isArray(r)&&r.every(jt)||ke(r)&&!r)return{type:e,message:jt(r)?r:"",ref:t}}var Ye=r=>fe(r)&&!Tt(r)?r:{value:r,message:""},$r=async(r,t,e,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:f,min:p,max:x,pattern:b,validate:E,name:j,valueAsNumber:T,mount:w}=r._f,y=M(e,j);if(!w||t.has(j))return{};const N=l?l[0]:o,O=P=>{n&&N.reportValidity&&(N.setCustomValidity(ke(P)?"":P||""),N.reportValidity())},_={},D=lr(o),Q=dt(o),S=D||Q,W=(T||ir(o))&&ue(o.value)&&ue(y)||_t(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,G=_s.bind(null,j,s,_),R=(P,X,ee,I=Me.maxLength,J=Me.minLength)=>{const Z=P?X:ee;_[j]={type:P?I:J,message:Z,ref:o,...G(P?I:J,Z)}};if(a?!Array.isArray(y)||!y.length:c&&(!S&&(W||ye(y))||ke(y)&&!y||Q&&!Os(l).isValid||D&&!Ms(l).isValid)){const{value:P,message:X}=jt(c)?{value:!!c,message:c}:Ye(c);if(P&&(_[j]={type:Me.required,message:X,ref:N,...G(Me.required,X)},!s))return O(X),_}if(!W&&(!ye(p)||!ye(x))){let P,X;const ee=Ye(x),I=Ye(p);if(!ye(y)&&!isNaN(y)){const J=o.valueAsNumber||y&&+y;ye(ee.value)||(P=J>ee.value),ye(I.value)||(X=J<I.value)}else{const J=o.valueAsDate||new Date(y),Z=m=>new Date(new Date().toDateString()+" "+m),h=o.type=="time",K=o.type=="week";Oe(ee.value)&&y&&(P=h?Z(y)>Z(ee.value):K?y>ee.value:J>new Date(ee.value)),Oe(I.value)&&y&&(X=h?Z(y)<Z(I.value):K?y<I.value:J<new Date(I.value))}if((P||X)&&(R(!!P,ee.message,I.message,Me.max,Me.min),!s))return O(_[j].message),_}if((u||f)&&!W&&(Oe(y)||a&&Array.isArray(y))){const P=Ye(u),X=Ye(f),ee=!ye(P.value)&&y.length>+P.value,I=!ye(X.value)&&y.length<+X.value;if((ee||I)&&(R(ee,P.message,X.message),!s))return O(_[j].message),_}if(b&&!W&&Oe(y)){const{value:P,message:X}=Ye(b);if(Tt(P)&&!y.match(P)&&(_[j]={type:Me.pattern,message:X,ref:o,...G(Me.pattern,X)},!s))return O(X),_}if(E){if(_e(E)){const P=await E(y,e),X=Vr(P,N);if(X&&(_[j]={...X,...G(Me.validate,X.message)},!s))return O(X.message),_}else if(fe(E)){let P={};for(const X in E){if(!be(P)&&!s)break;const ee=Vr(await E[X](y,e),N,X);ee&&(P={...ee,...G(X,ee.message)},O(ee.message),s&&(_[j]=P))}if(!be(P)&&(_[j]={ref:N,...P},!s))return _}}return O(!0),_};const Ya={mode:Se.onSubmit,reValidateMode:Se.onChange,shouldFocusError:!0};function Xa(r={}){let t={...Ya,...r},e={submitCount:0,isDirty:!1,isReady:!1,isLoading:_e(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const s={};let n=fe(t.defaultValues)||fe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(n),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const x={array:Sr(),state:Sr()},b=t.criteriaMode===Se.all,E=d=>g=>{clearTimeout(u),u=setTimeout(d,g)},j=async d=>{if(!t.disabled&&(f.isValid||p.isValid||d)){const g=t.resolver?be((await Q()).errors):await W(s,!0);g!==e.isValid&&x.state.next({isValid:g})}},T=(d,g)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((d||Array.from(l.mount)).forEach(k=>{k&&(g?oe(e.validatingFields,k,g):me(e.validatingFields,k))}),x.state.next({validatingFields:e.validatingFields,isValidating:!be(e.validatingFields)}))},w=(d,g=[],k,V,A=!0,C=!0)=>{if(V&&k&&!t.disabled){if(o.action=!0,C&&Array.isArray(M(s,d))){const Y=k(M(s,d),V.argA,V.argB);A&&oe(s,d,Y)}if(C&&Array.isArray(M(e.errors,d))){const Y=k(M(e.errors,d),V.argA,V.argB);A&&oe(e.errors,d,Y),Ga(e.errors,d)}if((f.touchedFields||p.touchedFields)&&C&&Array.isArray(M(e.touchedFields,d))){const Y=k(M(e.touchedFields,d),V.argA,V.argB);A&&oe(e.touchedFields,d,Y)}(f.dirtyFields||p.dirtyFields)&&(e.dirtyFields=at(n,a)),x.state.next({name:d,isDirty:R(d,g),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else oe(a,d,g)},y=(d,g)=>{oe(e.errors,d,g),x.state.next({errors:e.errors})},N=d=>{e.errors=d,x.state.next({errors:e.errors,isValid:!1})},O=(d,g,k,V)=>{const A=M(s,d);if(A){const C=M(a,d,ue(k)?M(n,d):k);ue(C)||V&&V.defaultChecked||g?oe(a,d,g?C:Cr(A._f)):ee(d,C),o.mount&&j()}},_=(d,g,k,V,A)=>{let C=!1,Y=!1;const ie={name:d};if(!t.disabled){if(!k||V){(f.isDirty||p.isDirty)&&(Y=e.isDirty,e.isDirty=ie.isDirty=R(),C=Y!==ie.isDirty);const ce=Pe(M(n,d),g);Y=!!M(e.dirtyFields,d),ce?me(e.dirtyFields,d):oe(e.dirtyFields,d,!0),ie.dirtyFields=e.dirtyFields,C=C||(f.dirtyFields||p.dirtyFields)&&Y!==!ce}if(k){const ce=M(e.touchedFields,d);ce||(oe(e.touchedFields,d,k),ie.touchedFields=e.touchedFields,C=C||(f.touchedFields||p.touchedFields)&&ce!==k)}C&&A&&x.state.next(ie)}return C?ie:{}},D=(d,g,k,V)=>{const A=M(e.errors,d),C=(f.isValid||p.isValid)&&ke(g)&&e.isValid!==g;if(t.delayError&&k?(c=E(()=>y(d,k)),c(t.delayError)):(clearTimeout(u),c=null,k?oe(e.errors,d,k):me(e.errors,d)),(k?!Pe(A,k):A)||!be(V)||C){const Y={...V,...C&&ke(g)?{isValid:g}:{},errors:e.errors,name:d};e={...e,...Y},x.state.next(Y)}},Q=async d=>{T(d,!0);const g=await t.resolver(a,t.context,za(d||l.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return T(d),g},S=async d=>{const{errors:g}=await Q(d);if(d)for(const k of d){const V=M(g,k);V?oe(e.errors,k,V):me(e.errors,k)}else e.errors=g;return g},W=async(d,g,k={valid:!0})=>{for(const V in d){const A=d[V];if(A){const{_f:C,...Y}=A;if(C){const ie=l.array.has(C.name),ce=A._f&&Ua(A._f);ce&&f.validatingFields&&T([V],!0);const Ee=await $r(A,l.disabled,a,b,t.shouldUseNativeValidation&&!g,ie);if(ce&&f.validatingFields&&T([V]),Ee[C.name]&&(k.valid=!1,g))break;!g&&(M(Ee,C.name)?ie?Ha(e.errors,Ee,C.name):oe(e.errors,C.name,Ee[C.name]):me(e.errors,C.name))}!be(Y)&&await W(Y,g,k)}}return k.valid},G=()=>{for(const d of l.unMount){const g=M(s,d);g&&(g._f.refs?g._f.refs.every(k=>!It(k)):!It(g._f.ref))&&se(d)}l.unMount=new Set},R=(d,g)=>!t.disabled&&(d&&g&&oe(a,d,g),!Pe(m(),n)),P=(d,g,k)=>Ns(d,l,{...o.mount?a:ue(g)?n:Oe(d)?{[d]:g}:g},k,g),X=d=>At(M(o.mount?a:n,d,t.shouldUnregister?M(n,d,[]):[])),ee=(d,g,k={})=>{const V=M(s,d);let A=g;if(V){const C=V._f;C&&(!C.disabled&&oe(a,d,As(g,C)),A=_t(C.ref)&&ye(g)?"":g,Fs(C.ref)?[...C.ref.options].forEach(Y=>Y.selected=A.includes(Y.value)):C.refs?dt(C.ref)?C.refs.forEach(Y=>{(!Y.defaultChecked||!Y.disabled)&&(Array.isArray(A)?Y.checked=!!A.find(ie=>ie===Y.value):Y.checked=A===Y.value||!!A)}):C.refs.forEach(Y=>Y.checked=Y.value===A):ir(C.ref)?C.ref.value="":(C.ref.value=A,C.ref.type||x.state.next({name:d,values:ge(a)})))}(k.shouldDirty||k.shouldTouch)&&_(d,A,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&K(d)},I=(d,g,k)=>{for(const V in g){if(!g.hasOwnProperty(V))return;const A=g[V],C=`${d}.${V}`,Y=M(s,C);(l.array.has(d)||fe(A)||Y&&!Y._f)&&!Be(A)?I(C,A,k):ee(C,A,k)}},J=(d,g,k={})=>{const V=M(s,d),A=l.array.has(d),C=ge(g);oe(a,d,C),A?(x.array.next({name:d,values:ge(a)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&k.shouldDirty&&x.state.next({name:d,dirtyFields:at(n,a),isDirty:R(d,C)})):V&&!V._f&&!ye(C)?I(d,C,k):ee(d,C,k),Mr(d,l)&&x.state.next({...e}),x.state.next({name:o.mount?d:void 0,values:ge(a)})},Z=async d=>{o.mount=!0;const g=d.target;let k=g.name,V=!0;const A=M(s,k),C=ce=>{V=Number.isNaN(ce)||Be(ce)&&isNaN(ce.getTime())||Pe(ce,M(a,k,ce))},Y=Or(t.mode),ie=Or(t.reValidateMode);if(A){let ce,Ee;const mt=g.type?Cr(A._f):vs(d),De=d.type===St.BLUR||d.type===St.FOCUS_OUT,bn=!Ba(A._f)&&!t.resolver&&!M(e.errors,k)&&!A._f.deps||qa(De,M(e.touchedFields,k),e.isSubmitted,ie,Y),Rt=Mr(k,l,De);oe(a,k,mt),De?(A._f.onBlur&&A._f.onBlur(d),c&&c(0)):A._f.onChange&&A._f.onChange(d);const Vt=_(k,mt,De),yn=!be(Vt)||Rt;if(!De&&x.state.next({name:k,type:d.type,values:ge(a)}),bn)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?De&&j():De||j()),yn&&x.state.next({name:k,...Rt?{}:Vt});if(!De&&Rt&&x.state.next({...e}),t.resolver){const{errors:xr}=await Q([k]);if(C(mt),V){const vn=Rr(e.errors,s,k),gr=Rr(xr,s,vn.name||k);ce=gr.error,k=gr.name,Ee=be(xr)}}else T([k],!0),ce=(await $r(A,l.disabled,a,b,t.shouldUseNativeValidation))[k],T([k]),C(mt),V&&(ce?Ee=!1:(f.isValid||p.isValid)&&(Ee=await W(s,!0)));V&&(A._f.deps&&K(A._f.deps),D(k,Ee,ce,Vt))}},h=(d,g)=>{if(M(e.errors,g)&&d.focus)return d.focus(),1},K=async(d,g={})=>{let k,V;const A=it(d);if(t.resolver){const C=await S(ue(d)?d:A);k=be(C),V=d?!A.some(Y=>M(C,Y)):k}else d?(V=(await Promise.all(A.map(async C=>{const Y=M(s,C);return await W(Y&&Y._f?{[C]:Y}:Y)}))).every(Boolean),!(!V&&!e.isValid)&&j()):V=k=await W(s);return x.state.next({...!Oe(d)||(f.isValid||p.isValid)&&k!==e.isValid?{}:{name:d},...t.resolver||!d?{isValid:k}:{},errors:e.errors}),g.shouldFocus&&!V&<(s,h,d?A:l.mount),V},m=d=>{const g={...o.mount?a:n};return ue(d)?g:Oe(d)?M(g,d):d.map(k=>M(g,k))},F=(d,g)=>({invalid:!!M((g||e).errors,d),isDirty:!!M((g||e).dirtyFields,d),error:M((g||e).errors,d),isValidating:!!M(e.validatingFields,d),isTouched:!!M((g||e).touchedFields,d)}),L=d=>{d&&it(d).forEach(g=>me(e.errors,g)),x.state.next({errors:d?e.errors:{}})},B=(d,g,k)=>{const V=(M(s,d,{_f:{}})._f||{}).ref,A=M(e.errors,d)||{},{ref:C,message:Y,type:ie,...ce}=A;oe(e.errors,d,{...ce,...g,ref:V}),x.state.next({name:d,errors:e.errors,isValid:!1}),k&&k.shouldFocus&&V&&V.focus&&V.focus()},re=(d,g)=>_e(d)?x.state.subscribe({next:k=>d(P(void 0,g),k)}):P(d,g,!0),le=d=>x.state.subscribe({next:g=>{Za(d.name,g.name,d.exact)&&Wa(g,d.formState||f,gn,d.reRenderRoot)&&d.callback({values:{...a},...e,...g})}}).unsubscribe,pe=d=>(o.mount=!0,p={...p,...d.formState},le({...d,formState:p})),se=(d,g={})=>{for(const k of d?it(d):l.mount)l.mount.delete(k),l.array.delete(k),g.keepValue||(me(s,k),me(a,k)),!g.keepError&&me(e.errors,k),!g.keepDirty&&me(e.dirtyFields,k),!g.keepTouched&&me(e.touchedFields,k),!g.keepIsValidating&&me(e.validatingFields,k),!t.shouldUnregister&&!g.keepDefaultValue&&me(n,k);x.state.next({values:ge(a)}),x.state.next({...e,...g.keepDirty?{isDirty:R()}:{}}),!g.keepIsValid&&j()},H=({disabled:d,name:g})=>{(ke(d)&&o.mount||d||l.disabled.has(g))&&(d?l.disabled.add(g):l.disabled.delete(g))},ne=(d,g={})=>{let k=M(s,d);const V=ke(g.disabled)||ke(t.disabled);return oe(s,d,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:d}},name:d,mount:!0,...g}}),l.mount.add(d),k?H({disabled:ke(g.disabled)?g.disabled:t.disabled,name:d}):O(d,!0,g.value),{...V?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:ot(g.min),max:ot(g.max),minLength:ot(g.minLength),maxLength:ot(g.maxLength),pattern:ot(g.pattern)}:{},name:d,onChange:Z,onBlur:Z,ref:A=>{if(A){ne(d,g),k=M(s,d);const C=ue(A.value)&&A.querySelectorAll&&A.querySelectorAll("input,select,textarea")[0]||A,Y=Ia(C),ie=k._f.refs||[];if(Y?ie.find(ce=>ce===C):C===k._f.ref)return;oe(s,d,{_f:{...k._f,...Y?{refs:[...ie.filter(It),C,...Array.isArray(M(n,d))?[{}]:[]],ref:{type:C.type,name:d}}:{ref:C}}}),O(d,!1,void 0,C)}else k=M(s,d,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(ws(l.array,d)&&o.action)&&l.unMount.add(d)}}},de=()=>t.shouldFocusError&<(s,h,l.mount),ae=d=>{ke(d)&&(x.state.next({disabled:d}),lt(s,(g,k)=>{const V=M(s,k);V&&(g.disabled=V._f.disabled||d,Array.isArray(V._f.refs)&&V._f.refs.forEach(A=>{A.disabled=V._f.disabled||d}))},0,!1))},je=(d,g)=>async k=>{let V;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let A=ge(a);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:C,values:Y}=await Q();e.errors=C,A=Y}else await W(s);if(l.disabled.size)for(const C of l.disabled)oe(A,C,void 0);if(me(e.errors,"root"),be(e.errors)){x.state.next({errors:{}});try{await d(A,k)}catch(C){V=C}}else g&&await g({...e.errors},k),de(),setTimeout(de);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:be(e.errors)&&!V,submitCount:e.submitCount+1,errors:e.errors}),V)throw V},ht=(d,g={})=>{M(s,d)&&(ue(g.defaultValue)?J(d,ge(M(n,d))):(J(d,g.defaultValue),oe(n,d,ge(g.defaultValue))),g.keepTouched||me(e.touchedFields,d),g.keepDirty||(me(e.dirtyFields,d),e.isDirty=g.defaultValue?R(d,ge(M(n,d))):R()),g.keepError||(me(e.errors,d),f.isValid&&j()),x.state.next({...e}))},et=(d,g={})=>{const k=d?ge(d):n,V=ge(k),A=be(d),C=A?n:V;if(g.keepDefaultValues||(n=k),!g.keepValues){if(g.keepDirtyValues){const Y=new Set([...l.mount,...Object.keys(at(n,a))]);for(const ie of Array.from(Y))M(e.dirtyFields,ie)?oe(C,ie,M(a,ie)):J(ie,M(C,ie))}else{if(sr&&ue(d))for(const Y of l.mount){const ie=M(s,Y);if(ie&&ie._f){const ce=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(_t(ce)){const Ee=ce.closest("form");if(Ee){Ee.reset();break}}}}for(const Y of l.mount)J(Y,M(C,Y))}a=ge(C),x.array.next({values:{...C}}),x.state.next({values:{...C}})}l={mount:g.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!g.keepIsValid||!!g.keepDirtyValues,o.watch=!!t.shouldUnregister,x.state.next({submitCount:g.keepSubmitCount?e.submitCount:0,isDirty:A?!1:g.keepDirty?e.isDirty:!!(g.keepDefaultValues&&!Pe(d,n)),isSubmitted:g.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:A?{}:g.keepDirtyValues?g.keepDefaultValues&&a?at(n,a):e.dirtyFields:g.keepDefaultValues&&d?at(n,d):g.keepDirty?e.dirtyFields:{},touchedFields:g.keepTouched?e.touchedFields:{},errors:g.keepErrors?e.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(d,g)=>et(_e(d)?d(a):d,g),xn=(d,g={})=>{const k=M(s,d),V=k&&k._f;if(V){const A=V.refs?V.refs[0]:V.ref;A.focus&&(A.focus(),g.shouldSelect&&_e(A.select)&&A.select())}},gn=d=>{e={...e,...d}},pr={control:{register:ne,unregister:se,getFieldState:F,handleSubmit:je,setError:B,_subscribe:le,_runSchema:Q,_getWatch:P,_getDirty:R,_setValid:j,_setFieldArray:w,_setDisabledField:H,_setErrors:N,_getFieldArray:X,_reset:et,_resetDefaultValues:()=>_e(t.defaultValues)&&t.defaultValues().then(d=>{tt(d,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:ae,_subjects:x,_proxyFormState:f,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(d){o=d},get _defaultValues(){return n},get _names(){return l},set _names(d){l=d},get _formState(){return e},get _options(){return t},set _options(d){t={...t,...d}}},subscribe:pe,trigger:K,register:ne,handleSubmit:je,watch:re,setValue:J,getValues:m,reset:tt,resetField:ht,clearErrors:L,unregister:se,setError:B,setFocus:xn,getFieldState:F};return{...pr,formControl:pr}}function Ka(r={}){const t=v.useRef(void 0),e=v.useRef(void 0),[s,n]=v.useState({isDirty:!1,isValidating:!1,isLoading:_e(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,isReady:!1,defaultValues:_e(r.defaultValues)?void 0:r.defaultValues});t.current||(t.current={...r.formControl?r.formControl:Xa(r),formState:s},r.formControl&&r.defaultValues&&!_e(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=t.current.control;return a._options=r,ar(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),v.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),v.useEffect(()=>{r.mode&&(a._options.mode=r.mode),r.reValidateMode&&(a._options.reValidateMode=r.reValidateMode),r.errors&&!be(r.errors)&&a._setErrors(r.errors)},[a,r.errors,r.mode,r.reValidateMode]),v.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,r.shouldUnregister]),v.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),v.useEffect(()=>{r.values&&!Pe(r.values,e.current)?(a._reset(r.values,a._options.resetOptions),e.current=r.values,n(o=>({...o}))):a._resetDefaultValues()},[a,r.values]),v.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=Es(s,a),t.current}const Rs={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ja={sm:"h-6",md:"h-10",lg:"h-12"},Qa={sm:"px-2",md:"px-2.5",lg:"px-3"};function Dr(r,t,e,s,n,a,o){const l=t?"datetime-local":"date",c=$("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Rs[e],Ja[e],Qa[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),p=Ma(c,n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-disabled)] cursor-not-allowed opacity-60":"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",o);return i.jsxs(i.Fragment,{children:[i.jsx("input",{id:r,type:l,disabled:n,"aria-disabled":n,"data-disabled":n?"true":"false",...s,className:p}),i.jsx("div",{children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Vs(r){const{control:t,name:e,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:u=!1,hasError:f=!1,errorMessage:p="",disabled:x=!1,className:b,onChange:E}=r,j=v.useId(),T=e||j;return i.jsxs("div",{className:$("flex flex-col",b),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:T,className:$("pb-2 text-[var(--color-ds-text-primary)]",Rs[o],u&&"sr-only"),children:c}),t&&e?i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n,render:({field:w,fieldState:y})=>Dr(T,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},x,y.error,b)}):Dr(T,a,o,{defaultValue:n,onChange:E},x,f?{message:p}:void 0,b)]})}const eo=({trigger:r,items:t,align:e="left",className:s})=>{const[n,a]=v.useState(!1),o=v.useRef(null),l=v.useRef([]);v.useEffect(()=>{const u=f=>{o.current&&!o.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const c=u=>{var p,x;const f=l.current.findIndex(b=>b===document.activeElement);if(u.key==="Escape")a(!1);else if(u.key==="ArrowDown"){u.preventDefault();const b=(f+1)%t.length;(p=l.current[b])==null||p.focus()}else if(u.key==="ArrowUp"){u.preventDefault();const b=(f-1+t.length)%t.length;(x=l.current[b])==null||x.focus()}};return i.jsxs("div",{className:$("relative inline-block",s),ref:o,children:[i.jsx("button",{type:"button",onClick:()=>a(u=>!u),className:"inline-flex items-center focus:outline-none","aria-haspopup":"menu","aria-expanded":n,children:r}),n&&i.jsx("div",{role:"menu","aria-orientation":"vertical",className:$("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",e==="right"?"right-0":"left-0"),onKeyDown:c,children:t.map((u,f)=>{const{label:p,onSelect:x,disabled:b,icon:E}=u;return i.jsxs("button",{role:"menuitem",type:"button",disabled:b,ref:j=>{l.current[f]=j},className:$("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",b?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{b||(x(),a(!1))},children:[E&&i.jsx(E,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),p]},f)})})]})},to=(r,t,e,s)=>{var a,o,l,c;const n=[e,{code:t,...s||{}}];if((o=(a=r==null?void 0:r.services)==null?void 0:a.logger)!=null&&o.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);We(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Ir={},Ht=(r,t,e,s)=>{We(e)&&Ir[e]||(We(e)&&(Ir[e]=new Date),to(r,t,e,s))},$s=(r,t)=>()=>{if(r.isInitialized)t();else{const e=()=>{setTimeout(()=>{r.off("initialized",e)},0),t()};r.on("initialized",e)}},Yt=(r,t,e)=>{r.loadNamespaces(t,$s(r,e))},Lr=(r,t,e,s)=>{if(We(e)&&(e=[e]),r.options.preload&&r.options.preload.indexOf(t)>-1)return Yt(r,e,s);e.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(t,$s(r,s))},ro=(r,t,e={})=>!t.languages||!t.languages.length?(Ht(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(r,{lng:e.lng,precheck:(s,n)=>{var a;if(((a=e.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),We=r=>typeof r=="string",so=r=>typeof r=="object"&&r!==null,no=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ao={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},oo=r=>ao[r],io=r=>r.replace(no,oo);let lo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:io};const co=()=>lo;let uo;const fo=()=>uo,ho=v.createContext();class mo{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const po=(r,t)=>{const e=v.useRef();return v.useEffect(()=>{e.current=r},[r,t]),e.current},Ds=(r,t,e,s)=>r.getFixedT(t,e,s),xo=(r,t,e,s)=>v.useCallback(Ds(r,t,e,s),[r,t,e,s]),cr=(r,t={})=>{var O,_,D,Q;const{i18n:e}=t,{i18n:s,defaultNS:n}=v.useContext(ho)||{},a=e||s||fo();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new mo),!a){Ht(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const S=(G,R)=>We(R)?R:so(R)&&We(R.defaultValue)?R.defaultValue:Array.isArray(G)?G[G.length-1]:G,W=[S,{},!1];return W.t=S,W.i18n={},W.ready=!1,W}(O=a.options.react)!=null&&O.wait&&Ht(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...co(),...a.options.react,...t},{useSuspense:l,keyPrefix:c}=o;let u=n||((_=a.options)==null?void 0:_.defaultNS);u=We(u)?[u]:u||["translation"],(Q=(D=a.reportNamespaces).addUsedNamespaces)==null||Q.call(D,u);const f=(a.isInitialized||a.initializedStoreOnce)&&u.every(S=>ro(S,a,o)),p=xo(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),x=()=>p,b=()=>Ds(a,t.lng||null,o.nsMode==="fallback"?u:u[0],c),[E,j]=v.useState(x);let T=u.join();t.lng&&(T=`${t.lng}${T}`);const w=po(T),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:S,bindI18nStore:W}=o;y.current=!0,!f&&!l&&(t.lng?Lr(a,t.lng,u,()=>{y.current&&j(b)}):Yt(a,u,()=>{y.current&&j(b)})),f&&w&&w!==T&&y.current&&j(b);const G=()=>{y.current&&j(b)};return S&&(a==null||a.on(S,G)),W&&(a==null||a.store.on(W,G)),()=>{y.current=!1,a&&(S==null||S.split(" ").forEach(R=>a.off(R,G))),W&&a&&W.split(" ").forEach(R=>a.store.off(R,G))}},[a,T]),v.useEffect(()=>{y.current&&f&&j(x)},[a,c,f]);const N=[E,a,f];if(N.t=E,N.i18n=a,N.ready=f,f||!f&&!l)return N;throw new Promise(S=>{t.lng?Lr(a,t.lng,u,()=>S()):Yt(a,u,()=>S())})},Xt={sm:"text-sm",md:"text-base",lg:"text-lg"};function Pr(r,t,e,s,n,a,o,l,c){const{t:u}=cr(),f=v.useRef(null),p=typeof s=="number"&&t.length>=s,x=()=>{var y;!o&&!p&&((y=f.current)==null||y.click())},b=y=>{const N=y.target.files;if(!N)return;const O=Array.from(N);let _=t.concat(O);s&&(_=_.slice(0,s)),e(_),y.target.value=""},E=y=>{if(y.preventDefault(),o||p)return;const N=Array.from(y.dataTransfer.files);let O=t.concat(N);s&&(O=O.slice(0,s)),e(O)},j=y=>{y.preventDefault()},T=y=>{const N=URL.createObjectURL(y);window.open(N)},w=y=>{const N=t.filter((O,_)=>_!==y);e(N)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx($e,{type:"button",variant:"outline",size:a,icon:wr,onClick:x,disabled:o||p,children:u("ds.fileUploader.browse","Browse files")})}),!p&&i.jsxs("div",{className:$("relative flex bg-[var(--color-ds-background-page)] flex-col items-center justify-center border-2 border-dashed border-[var(--color-ds-border-muted)] rounded-lg p-4",o?"opacity-50 cursor-not-allowed":"hover:border-[var(--color-ds-border-default)]",Xt[a],c),onDrop:E,onDragOver:j,children:[i.jsx("input",{id:r,type:"file",ref:f,className:"hidden",multiple:s!==1,accept:n,onChange:b,disabled:o}),i.jsx(Ce,{component:Pn,size:"md",className:"w-8 h-8 text-[var(--color-ds-text-secondary)]"}),i.jsx("p",{className:"mt-3 text-[var(--color-ds-text-secondary)] text-center",children:u("ds.fileUploader.dragDrop","Drag & drop your files here or click to browse")})]}),t.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:t.map((y,N)=>i.jsxs("li",{className:"flex items-center justify-between text-[var(--color-ds-text-secondary)] text-sm",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(wr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:y.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx($e,{variant:"ghost",size:"sm",icon:ls,ariaLabel:u("ds.fileUploader.view","View"),onClick:()=>T(y)}),i.jsx($e,{variant:"ghost",size:"sm",icon:tr,ariaLabel:u("ds.fileUploader.remove","Remove"),onClick:()=>w(N)})]})]},N))}),i.jsx("div",{className:"pt-[5px] min-h-[18px] w-full",children:l!=null&&l.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Is(r){const{control:t,name:e,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:u,labelHidden:f=!1,disabled:p=!1,hasError:x=!1,errorMessage:b="",className:E}=r,j=v.useId(),T=e||j;if(t&&e)return i.jsxs("div",{className:$("flex flex-col",E),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:$("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:N,fieldState:O})=>Pr(T,N.value,_=>N.onChange(_),a,o,l,p,O.error,E)})]});const[w,y]=v.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:$("flex flex-col",E),style:{width:c},children:[u&&i.jsx("label",{htmlFor:T,className:$("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:u}),Pr(T,w,y,a,o,l,p,x?{message:b}:void 0,E)]})}const qe=({count:r=1,width:t,height:e="1em",variant:s="rect",className:n})=>{const a=Array.from({length:r});return i.jsx(i.Fragment,{children:a.map((o,l)=>i.jsx("span",{role:"status","aria-label":"Cargando...",className:$("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:t??"auto",height:e}},l))})},bt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},go={sm:"h-6",md:"h-10",lg:"h-12"},bo={sm:"px-2",md:"px-2.5",lg:"px-3"},zr={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},yo={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Mt({id:r,type:t="text",size:e="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:u,separator:f,suffixButton:p,disabled:x=!1,control:b,name:E,rules:j,defaultValue:T,loading:w=!1,className:y,...N}){const O=v.useId(),[_,D]=v.useState(!1),Q=r||O,S=t==="password",G=c??(t==="number"?qn:void 0),R=S?_?Bn:ls:u,P=$("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",bt[e],go[e],bo[e],o?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]","bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]","disabled:bg-[var(--color-ds-background-disabled)]","disabled:border-[var(--color-ds-border-muted)]","disabled:text-[var(--color-ds-text-disabled)]","disabled:cursor-not-allowed");return w?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2",bt[e]),children:n}),i.jsx(qe,{width:"100%",height:yo[e],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):b&&E?i.jsx(Fe,{name:E,control:b,rules:j,defaultValue:T,render:({field:X,fieldState:ee})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[G&&i.jsx("div",{className:$("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:G,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...X,id:Q,type:S?_?"text":"password":t,disabled:x,"aria-invalid":!!ee.error,className:$(P,G&&"pl-9",R&&"pr-9",y),onInvalid:I=>I.preventDefault(),style:S&&!_?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full pr-2",children:p}),R&&i.jsx("button",{type:"button",onClick:()=>D(I=>!I),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:ee.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:ee.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:Q,className:$("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[G&&i.jsx("div",{className:$("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:G,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...N,id:Q,type:S?_?"text":"password":t,disabled:x,"aria-invalid":o,className:$(P,G&&"pl-9",R&&"pr-9",y),onInvalid:X=>X.preventDefault(),style:S&&!_?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full",children:p}),R&&i.jsx("button",{type:"button",onClick:()=>D(X=>!X),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:R,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:o&&l?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}const vo={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Lt=400,yt=8,Ls=({children:r,size:t="sm",position:e="top",className:s})=>{const[n,a]=v.useState(!1),[o,l]=v.useState({x:0,y:0}),c=v.useRef(null),u=v.useId();v.useEffect(()=>{if(n&&c.current){const x=c.current.getBoundingClientRect();let b=0,E=0;switch(e){case"top":b=x.left+x.width/2-Lt/2,E=x.top-yt;break;case"bottom":b=x.left+x.width/2-Lt/2,E=x.bottom+yt;break;case"left":b=x.left-Lt-yt,E=x.top+x.height/2;break;case"right":b=x.right+yt,E=x.top+x.height/2;break}l({x:b,y:E})}},[n,e]);const f=()=>typeof r=="string"?i.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):i.jsx(i.Fragment,{children:r}),p=n?i.jsx("div",{id:u,role:"tooltip",className:$("fixed z-50 w-[250px] bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)] text-ds-sm rounded p-2 shadow-lg","pointer-events-none"),style:{top:`${o.y}px`,left:`${o.x}px`,transform:e==="left"||e==="right"?"translateY(-50%)":e==="top"?"translateY(-100%)":void 0},children:f()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":u,ref:c,className:$("inline-flex items-center justify-center focus:outline-none",vo[t],"text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]",s),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:i.jsx(Hn,{className:"w-full h-full"})}),as.createPortal(p,document.body)]})};function wo({name:r,label:t,type:e="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:u}){var T;const{control:f,formState:{errors:p}}=ut(),x=!!p[r],b=((T=p[r])==null?void 0:T.message)||"",E="relative",j=n??"w-full";return i.jsxs("div",{className:E,children:[i.jsx(Fe,{name:r,control:f,rules:o,render:({field:w})=>i.jsx(Mt,{label:t,size:s,width:j,placeholder:a,hasError:x,errorMessage:b,loading:l,type:e,...w,disabled:c})}),u&&i.jsx(Ls,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:u})]})}const dr=v.memo(wo);dr.displayName="FormFieldInput";function ko({title:r,headerButtons:t,children:e,className:s}){return i.jsxs("div",{className:$("flex flex-col h-full",s),children:[i.jsxs("div",{className:"flex items-center justify-between py-4",children:[i.jsx("div",{className:`bg-[var(--color-ds-background-accent)] \r
|
|
22
|
+
<%s key={someKey} {...props} />`,z,Y,ne,Y),V[Y+z]=!0)}if(Y=null,R!==void 0&&(e(R),Y=""+R),o(E)&&(e(E.key),Y=""+E.key),"key"in E){R={};for(var ue in E)ue!=="key"&&(R[ue]=E[ue])}else R=E;return Y&&l(R,typeof h=="function"?h.displayName||h.name||"Unknown":h),d(h,Y,le,te,n(),R,pe,se)}function p(h){typeof h=="object"&&h!==null&&h.$$typeof===b&&h._store&&(h._store.validated=1)}var x=y,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),$=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,K=Array.isArray,J=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(h){return h()}};var Q,re={},H=x["react-stack-bottom-frame"].bind(x,a)(),m=J(s(a)),V={};st.Fragment=j,st.jsx=function(h,E,R,z,te){var le=1e4>$.recentlyCreatedOwnerStacks++;return f(h,E,R,!1,z,te,le?Error("react-stack-top-frame"):H,le?J(s(h)):m)},st.jsxs=function(h,E,R,z,te){var le=1e4>$.recentlyCreatedOwnerStacks++;return f(h,E,R,!0,z,te,le?Error("react-stack-top-frame"):H,le?J(s(h)):m)}}()),st}var vr;function Nn(){return vr||(vr=1,process.env.NODE_ENV==="production"?pt.exports=jn():pt.exports=En()),pt.exports}var i=Nn();function os(r){var t,e,s="";if(typeof r=="string"||typeof r=="number")s+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(t=0;t<n;t++)r[t]&&(e=os(r[t]))&&(s&&(s+=" "),s+=e)}else for(e in r)r[e]&&(s&&(s+=" "),s+=e);return s}function L(){for(var r,t,e=0,s="",n=arguments.length;e<n;e++)(r=arguments[e])&&(t=os(r))&&(s&&(s+=" "),s+=t);return s}const Sn={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-10 h-10",full:"w-full h-full"};function Ce({component:r,size:t="sm",className:e,...s}){return i.jsx(r,{className:L(Sn[t],e),"aria-hidden":s["aria-label"]?void 0:!0,...s})}const _n="inline-flex items-center justify-center box-border font-[var(--font-primary)] font-medium rounded-lg transition focus:outline-none",Fn={primary:"bg-[var(--color-ds-button-primary-bg)] text-[var(--color-ds-button-primary-text)] hover:animate-pulse",outline:"bg-transparent text-[var(--color-ds-text-primary)] ring-1 ring-inset ring-[var(--color-ds-border-default)] hover:bg-[var(--color-ds-background-accent)] hover:text-[var(--color-ds-text-on-accent)]",ghost:"bg-transparent text-[var(--color-ds-text-primary)] hover:animate-pulse"},Tn={sm:"text-ds-sm h-6 px-2",md:"text-ds-md h-10 px-2.5",lg:"text-ds-lg h-12 px-3"},Cn={sm:"h-6 w-6 p-0",md:"h-10 w-10 p-0",lg:"h-12 w-12 p-0"},An="disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-[var(--color-ds-background-disabled)] disabled:text-[var(--color-ds-text-on-accent)] disabled:ring-1 disabled:ring-inset disabled:ring-[var(--color-ds-border-muted)]";function $e({type:r="button",variant:t="primary",size:e="sm",width:s,disabled:n=!1,icon:a,iconPosition:o="left",ariaLabel:l,children:c,onClick:d,className:f}){const p=!!a,x=p&&!c,b=x?Cn[e]:Tn[e];return i.jsxs("button",{type:r,onClick:d,disabled:n,"aria-label":x?l:void 0,style:s?{width:s}:void 0,className:L(_n,Fn[t],b,An,f,p&&c&&"gap-2"),children:[a&&o==="left"&&i.jsx(Ce,{component:a,size:e}),c,a&&o==="right"&&i.jsx(Ce,{component:a,size:e})]})}function On({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Rn=q.forwardRef(On);function Mn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const is=q.forwardRef(Mn);function Vn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const $n=q.forwardRef(Vn);function Dn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const In=q.forwardRef(Dn);function Ln({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Pn=q.forwardRef(Ln);function zn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const wr=q.forwardRef(zn);function Un({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const Bn=q.forwardRef(Un);function Wn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ls=q.forwardRef(Wn);function Zn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}))}const qn=q.forwardRef(Zn);function Gn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Hn=q.forwardRef(Gn);function Yn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const Xn=q.forwardRef(Yn);function Kn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const Jn=q.forwardRef(Kn);function Qn({title:r,titleId:t,...e},s){return q.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:s,"aria-labelledby":t},e),r?q.createElement("title",{id:t},r):null,q.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tr=q.forwardRef(Qn);function Bt({title:r,children:t,defaultOpen:e=!0,className:s}){const[n,a]=y.useState(e),o=y.useRef(null),l=y.useRef(null),[c,d]=y.useState(0),f=()=>{if(l.current){const p=l.current.scrollHeight;d(p)}};return y.useLayoutEffect(()=>{f()},[n]),y.useEffect(()=>{const p=l.current;if(!p)return;const x=new ResizeObserver(()=>{f()});return x.observe(p),()=>{x.disconnect()}},[]),i.jsxs("div",{className:L("flex flex-col w-full gap-3",s),children:[i.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:"flex items-center justify-between w-full hover:bg-[var(--color-ds-surface-hover)] transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"block w-1 h-5 bg-[var(--color-ds-background-accent)] rounded-sm"}),i.jsx("span",{className:"font-semibold text-[var(--color-ds-text-primary)]",children:r})]}),n?i.jsx(In,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"}):i.jsx(is,{className:"w-5 h-5 text-[var(--color-ds-text-primary)]"})]}),i.jsx("div",{className:"box-border w-full rounded-lg bg-[var(--color-ds-background-surface)] overflow-hidden",children:i.jsx("div",{className:"px-6",children:i.jsx("div",{ref:o,className:L("overflow-hidden transition-all duration-300 ease-in-out",n?"opacity-100":"opacity-0"),style:{maxHeight:n?`${c}px`:"0px"},children:i.jsx("div",{ref:l,className:"py-4",children:t})})})})]})}const rr="-",ea=r=>{const t=ra(r),{conflictingClassGroups:e,conflictingClassGroupModifiers:s}=r;return{getClassGroupId:o=>{const l=o.split(rr);return l[0]===""&&l.length!==1&&l.shift(),cs(l,t)||ta(o)},getConflictingClassGroupIds:(o,l)=>{const c=e[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},cs=(r,t)=>{var o;if(r.length===0)return t.classGroupId;const e=r[0],s=t.nextPart.get(e),n=s?cs(r.slice(1),s):void 0;if(n)return n;if(t.validators.length===0)return;const a=r.join(rr);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},kr=/^\[(.+)\]$/,ta=r=>{if(kr.test(r)){const t=kr.exec(r)[1],e=t==null?void 0:t.substring(0,t.indexOf(":"));if(e)return"arbitrary.."+e}},ra=r=>{const{theme:t,classGroups:e}=r,s={nextPart:new Map,validators:[]};for(const n in e)Wt(e[n],s,n,t);return s},Wt=(r,t,e,s)=>{r.forEach(n=>{if(typeof n=="string"){const a=n===""?t:jr(t,n);a.classGroupId=e;return}if(typeof n=="function"){if(sa(n)){Wt(n(s),t,e,s);return}t.validators.push({validator:n,classGroupId:e});return}Object.entries(n).forEach(([a,o])=>{Wt(o,jr(t,a),e,s)})})},jr=(r,t)=>{let e=r;return t.split(rr).forEach(s=>{e.nextPart.has(s)||e.nextPart.set(s,{nextPart:new Map,validators:[]}),e=e.nextPart.get(s)}),e},sa=r=>r.isThemeGetter,na=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,e=new Map,s=new Map;const n=(a,o)=>{e.set(a,o),t++,t>r&&(t=0,s=e,e=new Map)};return{get(a){let o=e.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){e.has(a)?e.set(a,o):n(a,o)}}},Zt="!",qt=":",aa=qt.length,oa=r=>{const{prefix:t,experimentalParseClassName:e}=r;let s=n=>{const a=[];let o=0,l=0,c=0,d;for(let _=0;_<n.length;_++){let j=n[_];if(o===0&&l===0){if(j===qt){a.push(n.slice(c,_)),c=_+aa;continue}if(j==="/"){d=_;continue}}j==="["?o++:j==="]"?o--:j==="("?l++:j===")"&&l--}const f=a.length===0?n:n.substring(c),p=ia(f),x=p!==f,b=d&&d>c?d-c:void 0;return{modifiers:a,hasImportantModifier:x,baseClassName:p,maybePostfixModifierPosition:b}};if(t){const n=t+qt,a=s;s=o=>o.startsWith(n)?a(o.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(e){const n=s;s=a=>e({className:a,parseClassName:n})}return s},ia=r=>r.endsWith(Zt)?r.substring(0,r.length-1):r.startsWith(Zt)?r.substring(1):r,la=r=>{const t=Object.fromEntries(r.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(o=>{o[0]==="["||t[o]?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n}},ca=r=>({cache:na(r.cacheSize),parseClassName:oa(r),sortModifiers:la(r),...ea(r)}),ua=/\s+/,da=(r,t)=>{const{parseClassName:e,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=t,o=[],l=r.trim().split(ua);let c="";for(let d=l.length-1;d>=0;d-=1){const f=l[d],{isExternal:p,modifiers:x,hasImportantModifier:b,baseClassName:_,maybePostfixModifierPosition:j}=e(f);if(p){c=f+(c.length>0?" "+c:c);continue}let T=!!j,w=s(T?_.substring(0,j):_);if(!w){if(!T){c=f+(c.length>0?" "+c:c);continue}if(w=s(_),!w){c=f+(c.length>0?" "+c:c);continue}T=!1}const v=a(x).join(":"),S=b?v+Zt:v,M=S+w;if(o.includes(M))continue;o.push(M);const N=n(w,T);for(let P=0;P<N.length;++P){const G=N[P];o.push(S+G)}c=f+(c.length>0?" "+c:c)}return c};function fa(){let r=0,t,e,s="";for(;r<arguments.length;)(t=arguments[r++])&&(e=us(t))&&(s&&(s+=" "),s+=e);return s}const us=r=>{if(typeof r=="string")return r;let t,e="";for(let s=0;s<r.length;s++)r[s]&&(t=us(r[s]))&&(e&&(e+=" "),e+=t);return e};function ha(r,...t){let e,s,n,a=o;function o(c){const d=t.reduce((f,p)=>p(f),r());return e=ca(d),s=e.cache.get,n=e.cache.set,a=l,l(c)}function l(c){const d=s(c);if(d)return d;const f=da(c,e);return n(c,f),f}return function(){return a(fa.apply(null,arguments))}}const he=r=>{const t=e=>e[r]||[];return t.isThemeGetter=!0,t},ds=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ma=/^\d+\/\d+$/,pa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ga=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ba=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ya=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=r=>ma.test(r),ee=r=>!!r&&!Number.isNaN(Number(r)),Ie=r=>!!r&&Number.isInteger(Number(r)),$t=r=>r.endsWith("%")&&ee(r.slice(0,-1)),Oe=r=>pa.test(r),va=()=>!0,wa=r=>xa.test(r)&&!ga.test(r),hs=()=>!1,ka=r=>ba.test(r),ja=r=>ya.test(r),Ea=r=>!U(r)&&!B(r),Na=r=>Je(r,xs,hs),U=r=>ds.test(r),Ue=r=>Je(r,gs,wa),Dt=r=>Je(r,Ca,ee),Er=r=>Je(r,ms,hs),Sa=r=>Je(r,ps,ja),xt=r=>Je(r,bs,ka),B=r=>fs.test(r),nt=r=>Qe(r,gs),_a=r=>Qe(r,Aa),Nr=r=>Qe(r,ms),Fa=r=>Qe(r,xs),Ta=r=>Qe(r,ps),gt=r=>Qe(r,bs,!0),Je=(r,t,e)=>{const s=ds.exec(r);return s?s[1]?t(s[1]):e(s[2]):!1},Qe=(r,t,e=!1)=>{const s=fs.exec(r);return s?s[1]?t(s[1]):e:!1},ms=r=>r==="position"||r==="percentage",ps=r=>r==="image"||r==="url",xs=r=>r==="length"||r==="size"||r==="bg-size",gs=r=>r==="length",Ca=r=>r==="number",Aa=r=>r==="family-name",bs=r=>r==="shadow",Oa=()=>{const r=he("color"),t=he("font"),e=he("text"),s=he("font-weight"),n=he("tracking"),a=he("leading"),o=he("breakpoint"),l=he("container"),c=he("spacing"),d=he("radius"),f=he("shadow"),p=he("inset-shadow"),x=he("text-shadow"),b=he("drop-shadow"),_=he("blur"),j=he("perspective"),T=he("aspect"),w=he("ease"),v=he("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...M(),B,U],P=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto","contain","none"],F=()=>[B,U,c],W=()=>[He,"full","auto",...F()],Z=()=>[Ie,"none","subgrid",B,U],$=()=>["auto",{span:["full",Ie,B,U]},Ie,B,U],I=()=>[Ie,"auto",B,U],K=()=>["auto","min","max","fr",B,U],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],re=()=>["auto",...F()],H=()=>[He,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],m=()=>[r,B,U],V=()=>[...M(),Nr,Er,{position:[B,U]}],h=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",Fa,Na,{size:[B,U]}],R=()=>[$t,nt,Ue],z=()=>["","none","full",d,B,U],te=()=>["",ee,nt,Ue],le=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[ee,$t,Nr,Er],Y=()=>["","none",_,B,U],ne=()=>["none",ee,B,U],ue=()=>["none",ee,B,U],ae=()=>[ee,B,U],je=()=>[He,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oe],breakpoint:[Oe],color:[va],container:[Oe],"drop-shadow":[Oe],ease:["in","out","in-out"],font:[Ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oe],shadow:[Oe],spacing:["px",ee],text:[Oe],"text-shadow":[Oe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",He,U,B,T]}],container:["container"],columns:[{columns:[ee,U,B,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{start:W()}],end:[{end:W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[Ie,"auto",B,U]}],basis:[{basis:[He,"full","auto",l,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ee,He,"auto","initial","none",U]}],grow:[{grow:["",ee,B,U]}],shrink:[{shrink:["",ee,B,U]}],order:[{order:[Ie,"first","last","none",B,U]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[l,"screen",...H()]}],"min-w":[{"min-w":[l,"screen","none",...H()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",e,nt,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,B,Dt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$t,U]}],"font-family":[{font:[_a,U,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,B,U]}],"line-clamp":[{"line-clamp":[ee,"none",B,Dt]}],leading:[{leading:[a,...F()]}],"list-image":[{"list-image":["none",B,U]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,U]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:m()}],"text-color":[{text:m()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[ee,"from-font","auto",B,Ue]}],"text-decoration-color":[{decoration:m()}],"underline-offset":[{"underline-offset":[ee,"auto",B,U]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,U]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B,U]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:h()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ie,B,U],radial:["",B,U],conic:[Ie,B,U]},Ta,Sa]}],"bg-color":[{bg:m()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:m()}],"gradient-via":[{via:m()}],"gradient-to":[{to:m()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:m()}],"border-color-x":[{"border-x":m()}],"border-color-y":[{"border-y":m()}],"border-color-s":[{"border-s":m()}],"border-color-e":[{"border-e":m()}],"border-color-t":[{"border-t":m()}],"border-color-r":[{"border-r":m()}],"border-color-b":[{"border-b":m()}],"border-color-l":[{"border-l":m()}],"divide-color":[{divide:m()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ee,B,U]}],"outline-w":[{outline:["",ee,nt,Ue]}],"outline-color":[{outline:m()}],shadow:[{shadow:["","none",f,gt,xt]}],"shadow-color":[{shadow:m()}],"inset-shadow":[{"inset-shadow":["none",p,gt,xt]}],"inset-shadow-color":[{"inset-shadow":m()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:m()}],"ring-offset-w":[{"ring-offset":[ee,Ue]}],"ring-offset-color":[{"ring-offset":m()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":m()}],"text-shadow":[{"text-shadow":["none",x,gt,xt]}],"text-shadow-color":[{"text-shadow":m()}],opacity:[{opacity:[ee,B,U]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":m()}],"mask-image-linear-to-color":[{"mask-linear-to":m()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":m()}],"mask-image-t-to-color":[{"mask-t-to":m()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":m()}],"mask-image-r-to-color":[{"mask-r-to":m()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":m()}],"mask-image-b-to-color":[{"mask-b-to":m()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":m()}],"mask-image-l-to-color":[{"mask-l-to":m()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":m()}],"mask-image-x-to-color":[{"mask-x-to":m()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":m()}],"mask-image-y-to-color":[{"mask-y-to":m()}],"mask-image-radial":[{"mask-radial":[B,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":m()}],"mask-image-radial-to-color":[{"mask-radial-to":m()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":m()}],"mask-image-conic-to-color":[{"mask-conic-to":m()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:h()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,U]}],filter:[{filter:["","none",B,U]}],blur:[{blur:Y()}],brightness:[{brightness:[ee,B,U]}],contrast:[{contrast:[ee,B,U]}],"drop-shadow":[{"drop-shadow":["","none",b,gt,xt]}],"drop-shadow-color":[{"drop-shadow":m()}],grayscale:[{grayscale:["",ee,B,U]}],"hue-rotate":[{"hue-rotate":[ee,B,U]}],invert:[{invert:["",ee,B,U]}],saturate:[{saturate:[ee,B,U]}],sepia:[{sepia:["",ee,B,U]}],"backdrop-filter":[{"backdrop-filter":["","none",B,U]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[ee,B,U]}],"backdrop-contrast":[{"backdrop-contrast":[ee,B,U]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ee,B,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ee,B,U]}],"backdrop-invert":[{"backdrop-invert":["",ee,B,U]}],"backdrop-opacity":[{"backdrop-opacity":[ee,B,U]}],"backdrop-saturate":[{"backdrop-saturate":[ee,B,U]}],"backdrop-sepia":[{"backdrop-sepia":["",ee,B,U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,U]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ee,"initial",B,U]}],ease:[{ease:["linear","initial",w,B,U]}],delay:[{delay:[ee,B,U]}],animate:[{animate:["none",v,B,U]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,B,U]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[B,U,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:m()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:m()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B,U]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B,U]}],fill:[{fill:["none",...m()]}],"stroke-w":[{stroke:[ee,nt,Ue,Dt]}],stroke:[{stroke:["none",...m()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ra=ha(Oa);var ut=r=>r.type==="checkbox",Be=r=>r instanceof Date,ye=r=>r==null;const ys=r=>typeof r=="object";var fe=r=>!ye(r)&&!Array.isArray(r)&&ys(r)&&!Be(r),vs=r=>fe(r)&&r.target?ut(r.target)?r.target.checked:r.target.value:r,Ma=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,ws=(r,t)=>r.has(Ma(t)),Va=r=>{const t=r.constructor&&r.constructor.prototype;return fe(t)&&t.hasOwnProperty("isPrototypeOf")},sr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(r){let t;const e=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)t=new Date(r);else if(r instanceof Set)t=new Set(r);else if(!(sr&&(r instanceof Blob||s))&&(e||fe(r)))if(t=e?[]:{},!e&&!Va(r))t=r;else for(const n in r)r.hasOwnProperty(n)&&(t[n]=ge(r[n]));else return r;return t}var Ot=r=>Array.isArray(r)?r.filter(Boolean):[],de=r=>r===void 0,O=(r,t,e)=>{if(!t||!fe(r))return e;const s=Ot(t.split(/[,[\].]+?/)).reduce((n,a)=>ye(n)?n:n[a],r);return de(s)||s===r?de(r[t])?e:r[t]:s},ke=r=>typeof r=="boolean",nr=r=>/^\w*$/.test(r),ks=r=>Ot(r.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(r,t,e)=>{let s=-1;const n=nr(t)?[t]:ks(t),a=n.length,o=a-1;for(;++s<a;){const l=n[s];let c=e;if(s!==o){const d=r[l];c=fe(d)||Array.isArray(d)?d:isNaN(+n[s+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;r[l]=c,r=r[l]}};const St={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Se={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Re={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},js=y.createContext(null),dt=()=>y.useContext(js),$a=r=>{const{children:t,...e}=r;return y.createElement(js.Provider,{value:e},t)};var Es=(r,t,e,s=!0)=>{const n={defaultValues:t._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Se.all&&(t._proxyFormState[o]=!s||Se.all),e&&(e[o]=!0),r[o]}});return n};const ar=typeof window<"u"?q.useLayoutEffect:q.useEffect;function Da(r){const t=dt(),{control:e=t.control,disabled:s,name:n,exact:a}=r||{},[o,l]=y.useState(e._formState),c=y.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ar(()=>e._subscribe({name:n,formState:c.current,exact:a,callback:d=>{!s&&l({...e._formState,...d})}}),[n,s,a]),y.useEffect(()=>{c.current.isValid&&e._setValid(!0)},[e]),y.useMemo(()=>Es(o,e,c.current,!1),[o,e])}var Ae=r=>typeof r=="string",Ns=(r,t,e,s,n)=>Ae(r)?(s&&t.watch.add(r),O(e,r,n)):Array.isArray(r)?r.map(a=>(s&&t.watch.add(a),O(e,a))):(s&&(t.watchAll=!0),e);function or(r){const t=dt(),{control:e=t.control,name:s,defaultValue:n,disabled:a,exact:o}=r||{},l=y.useRef(n),[c,d]=y.useState(e._getWatch(s,l.current));return ar(()=>e._subscribe({name:s,formState:{values:!0},exact:o,callback:f=>!a&&d(Ns(s,e._names,f.values||e._formValues,!1,l.current))}),[s,e,a,o]),y.useEffect(()=>e._removeUnmounted()),c}function Ss(r){const t=dt(),{name:e,disabled:s,control:n=t.control,shouldUnregister:a}=r,o=ws(n._names.array,e),l=or({control:n,name:e,defaultValue:O(n._formValues,e,O(n._defaultValues,e,r.defaultValue)),exact:!0}),c=Da({control:n,name:e,exact:!0}),d=y.useRef(r),f=y.useRef(n.register(e,{...r.rules,value:l,...ke(r.disabled)?{disabled:r.disabled}:{}})),p=y.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!O(c.errors,e)},isDirty:{enumerable:!0,get:()=>!!O(c.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!O(c.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!O(c.validatingFields,e)},error:{enumerable:!0,get:()=>O(c.errors,e)}}),[c,e]),x=y.useCallback(T=>f.current.onChange({target:{value:vs(T),name:e},type:St.CHANGE}),[e]),b=y.useCallback(()=>f.current.onBlur({target:{value:O(n._formValues,e),name:e},type:St.BLUR}),[e,n._formValues]),_=y.useCallback(T=>{const w=O(n._fields,e);w&&T&&(w._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:v=>T.setCustomValidity(v),reportValidity:()=>T.reportValidity()})},[n._fields,e]),j=y.useMemo(()=>({name:e,value:l,...ke(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:x,onBlur:b,ref:_}),[e,s,c.disabled,x,b,_,l]);return y.useEffect(()=>{const T=n._options.shouldUnregister||a;n.register(e,{...d.current.rules,...ke(d.current.disabled)?{disabled:d.current.disabled}:{}});const w=(v,S)=>{const M=O(n._fields,v);M&&M._f&&(M._f.mount=S)};if(w(e,!0),T){const v=ge(O(n._options.defaultValues,e));oe(n._defaultValues,e,v),de(O(n._formValues,e))&&oe(n._formValues,e,v)}return!o&&n.register(e),()=>{(o?T&&!n._state.action:T)?n.unregister(e):w(e,!1)}},[e,n,o,a]),y.useEffect(()=>{n._setDisabledField({disabled:s,name:e})},[s,e,n]),y.useMemo(()=>({field:j,formState:c,fieldState:p}),[j,c,p])}const Fe=r=>r.render(Ss(r));var _s=(r,t,e,s,n)=>t?{...e[r],types:{...e[r]&&e[r].types?e[r].types:{},[s]:n||!0}}:{},it=r=>Array.isArray(r)?r:[r],Sr=()=>{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},Gt=r=>ye(r)||!ys(r);function Pe(r,t){if(Gt(r)||Gt(t))return r===t;if(Be(r)&&Be(t))return r.getTime()===t.getTime();const e=Object.keys(r),s=Object.keys(t);if(e.length!==s.length)return!1;for(const n of e){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const o=t[n];if(Be(a)&&Be(o)||fe(a)&&fe(o)||Array.isArray(a)&&Array.isArray(o)?!Pe(a,o):a!==o)return!1}}return!0}var be=r=>fe(r)&&!Object.keys(r).length,ir=r=>r.type==="file",_e=r=>typeof r=="function",_t=r=>{if(!sr)return!1;const t=r?r.ownerDocument:0;return r instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fs=r=>r.type==="select-multiple",lr=r=>r.type==="radio",Ia=r=>lr(r)||ut(r),It=r=>_t(r)&&r.isConnected;function La(r,t){const e=t.slice(0,-1).length;let s=0;for(;s<e;)r=de(r)?s++:r[t[s++]];return r}function Pa(r){for(const t in r)if(r.hasOwnProperty(t)&&!de(r[t]))return!1;return!0}function me(r,t){const e=Array.isArray(t)?t:nr(t)?[t]:ks(t),s=e.length===1?r:La(r,e),n=e.length-1,a=e[n];return s&&delete s[a],n!==0&&(fe(s)&&be(s)||Array.isArray(s)&&Pa(s))&&me(r,e.slice(0,-1)),r}var Ts=r=>{for(const t in r)if(_e(r[t]))return!0;return!1};function Ft(r,t={}){const e=Array.isArray(r);if(fe(r)||e)for(const s in r)Array.isArray(r[s])||fe(r[s])&&!Ts(r[s])?(t[s]=Array.isArray(r[s])?[]:{},Ft(r[s],t[s])):ye(r[s])||(t[s]=!0);return t}function Cs(r,t,e){const s=Array.isArray(r);if(fe(r)||s)for(const n in r)Array.isArray(r[n])||fe(r[n])&&!Ts(r[n])?de(t)||Gt(e[n])?e[n]=Array.isArray(r[n])?Ft(r[n],[]):{...Ft(r[n])}:Cs(r[n],ye(t)?{}:t[n],e[n]):e[n]=!Pe(r[n],t[n]);return e}var at=(r,t)=>Cs(r,t,Ft(t));const _r={value:!1,isValid:!1},Fr={value:!0,isValid:!0};var As=r=>{if(Array.isArray(r)){if(r.length>1){const t=r.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!de(r[0].attributes.value)?de(r[0].value)||r[0].value===""?Fr:{value:r[0].value,isValid:!0}:Fr:_r}return _r},Os=(r,{valueAsNumber:t,valueAsDate:e,setValueAs:s})=>de(r)?r:t?r===""?NaN:r&&+r:e&&Ae(r)?new Date(r):s?s(r):r;const Tr={isValid:!1,value:null};var Rs=r=>Array.isArray(r)?r.reduce((t,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:t,Tr):Tr;function Cr(r){const t=r.ref;return ir(t)?t.files:lr(t)?Rs(r.refs).value:Fs(t)?[...t.selectedOptions].map(({value:e})=>e):ut(t)?As(r.refs).value:Os(de(t.value)?r.ref.value:t.value,r)}var za=(r,t,e,s)=>{const n={};for(const a of r){const o=O(t,a);o&&oe(n,a,o._f)}return{criteriaMode:e,names:[...r],fields:n,shouldUseNativeValidation:s}},Tt=r=>r instanceof RegExp,ot=r=>de(r)?r:Tt(r)?r.source:fe(r)?Tt(r.value)?r.value.source:r.value:r,Ar=r=>({isOnSubmit:!r||r===Se.onSubmit,isOnBlur:r===Se.onBlur,isOnChange:r===Se.onChange,isOnAll:r===Se.all,isOnTouch:r===Se.onTouched});const Or="AsyncFunction";var Ua=r=>!!r&&!!r.validate&&!!(_e(r.validate)&&r.validate.constructor.name===Or||fe(r.validate)&&Object.values(r.validate).find(t=>t.constructor.name===Or)),Ba=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),Rr=(r,t,e)=>!e&&(t.watchAll||t.watch.has(r)||[...t.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const lt=(r,t,e,s)=>{for(const n of e||Object.keys(r)){const a=O(r,n);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!s)return!0;if(o.ref&&t(o.ref,o.name)&&!s)return!0;if(lt(l,t))break}else if(fe(l)&<(l,t))break}}};function Mr(r,t,e){const s=O(r,e);if(s||nr(e))return{error:s,name:e};const n=e.split(".");for(;n.length;){const a=n.join("."),o=O(t,a),l=O(r,a);if(o&&!Array.isArray(o)&&e!==a)return{name:e};if(l&&l.type)return{name:a,error:l};n.pop()}return{name:e}}var Wa=(r,t,e,s)=>{e(r);const{name:n,...a}=r;return be(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!s||Se.all))},Za=(r,t,e)=>!r||!t||r===t||it(r).some(s=>s&&(e?s===t:s.startsWith(t)||t.startsWith(s))),qa=(r,t,e,s,n)=>n.isOnAll?!1:!e&&n.isOnTouch?!(t||r):(e?s.isOnBlur:n.isOnBlur)?!r:(e?s.isOnChange:n.isOnChange)?r:!0,Ga=(r,t)=>!Ot(O(r,t)).length&&me(r,t),Ha=(r,t,e)=>{const s=it(O(r,e));return oe(s,"root",t[e]),oe(r,e,s),r},jt=r=>Ae(r);function Vr(r,t,e="validate"){if(jt(r)||Array.isArray(r)&&r.every(jt)||ke(r)&&!r)return{type:e,message:jt(r)?r:"",ref:t}}var Ye=r=>fe(r)&&!Tt(r)?r:{value:r,message:""},$r=async(r,t,e,s,n,a)=>{const{ref:o,refs:l,required:c,maxLength:d,minLength:f,min:p,max:x,pattern:b,validate:_,name:j,valueAsNumber:T,mount:w}=r._f,v=O(e,j);if(!w||t.has(j))return{};const S=l?l[0]:o,M=I=>{n&&S.reportValidity&&(S.setCustomValidity(ke(I)?"":I||""),S.reportValidity())},N={},P=lr(o),G=ut(o),F=P||G,W=(T||ir(o))&&de(o.value)&&de(v)||_t(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,Z=_s.bind(null,j,s,N),$=(I,K,J,Q=Re.maxLength,re=Re.minLength)=>{const H=I?K:J;N[j]={type:I?Q:re,message:H,ref:o,...Z(I?Q:re,H)}};if(a?!Array.isArray(v)||!v.length:c&&(!F&&(W||ye(v))||ke(v)&&!v||G&&!As(l).isValid||P&&!Rs(l).isValid)){const{value:I,message:K}=jt(c)?{value:!!c,message:c}:Ye(c);if(I&&(N[j]={type:Re.required,message:K,ref:S,...Z(Re.required,K)},!s))return M(K),N}if(!W&&(!ye(p)||!ye(x))){let I,K;const J=Ye(x),Q=Ye(p);if(!ye(v)&&!isNaN(v)){const re=o.valueAsNumber||v&&+v;ye(J.value)||(I=re>J.value),ye(Q.value)||(K=re<Q.value)}else{const re=o.valueAsDate||new Date(v),H=h=>new Date(new Date().toDateString()+" "+h),m=o.type=="time",V=o.type=="week";Ae(J.value)&&v&&(I=m?H(v)>H(J.value):V?v>J.value:re>new Date(J.value)),Ae(Q.value)&&v&&(K=m?H(v)<H(Q.value):V?v<Q.value:re<new Date(Q.value))}if((I||K)&&($(!!I,J.message,Q.message,Re.max,Re.min),!s))return M(N[j].message),N}if((d||f)&&!W&&(Ae(v)||a&&Array.isArray(v))){const I=Ye(d),K=Ye(f),J=!ye(I.value)&&v.length>+I.value,Q=!ye(K.value)&&v.length<+K.value;if((J||Q)&&($(J,I.message,K.message),!s))return M(N[j].message),N}if(b&&!W&&Ae(v)){const{value:I,message:K}=Ye(b);if(Tt(I)&&!v.match(I)&&(N[j]={type:Re.pattern,message:K,ref:o,...Z(Re.pattern,K)},!s))return M(K),N}if(_){if(_e(_)){const I=await _(v,e),K=Vr(I,S);if(K&&(N[j]={...K,...Z(Re.validate,K.message)},!s))return M(K.message),N}else if(fe(_)){let I={};for(const K in _){if(!be(I)&&!s)break;const J=Vr(await _[K](v,e),S,K);J&&(I={...J,...Z(K,J.message)},M(J.message),s&&(N[j]=I))}if(!be(I)&&(N[j]={ref:S,...I},!s))return N}}return M(!0),N};const Ya={mode:Se.onSubmit,reValidateMode:Se.onChange,shouldFocusError:!0};function Xa(r={}){let t={...Ya,...r},e={submitCount:0,isDirty:!1,isReady:!1,isLoading:_e(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const s={};let n=fe(t.defaultValues)||fe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(n),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...f};const x={array:Sr(),state:Sr()},b=t.criteriaMode===Se.all,_=u=>g=>{clearTimeout(d),d=setTimeout(u,g)},j=async u=>{if(!t.disabled&&(f.isValid||p.isValid||u)){const g=t.resolver?be((await G()).errors):await W(s,!0);g!==e.isValid&&x.state.next({isValid:g})}},T=(u,g)=>{!t.disabled&&(f.isValidating||f.validatingFields||p.isValidating||p.validatingFields)&&((u||Array.from(l.mount)).forEach(k=>{k&&(g?oe(e.validatingFields,k,g):me(e.validatingFields,k))}),x.state.next({validatingFields:e.validatingFields,isValidating:!be(e.validatingFields)}))},w=(u,g=[],k,D,A=!0,C=!0)=>{if(D&&k&&!t.disabled){if(o.action=!0,C&&Array.isArray(O(s,u))){const X=k(O(s,u),D.argA,D.argB);A&&oe(s,u,X)}if(C&&Array.isArray(O(e.errors,u))){const X=k(O(e.errors,u),D.argA,D.argB);A&&oe(e.errors,u,X),Ga(e.errors,u)}if((f.touchedFields||p.touchedFields)&&C&&Array.isArray(O(e.touchedFields,u))){const X=k(O(e.touchedFields,u),D.argA,D.argB);A&&oe(e.touchedFields,u,X)}(f.dirtyFields||p.dirtyFields)&&(e.dirtyFields=at(n,a)),x.state.next({name:u,isDirty:$(u,g),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else oe(a,u,g)},v=(u,g)=>{oe(e.errors,u,g),x.state.next({errors:e.errors})},S=u=>{e.errors=u,x.state.next({errors:e.errors,isValid:!1})},M=(u,g,k,D)=>{const A=O(s,u);if(A){const C=O(a,u,de(k)?O(n,u):k);de(C)||D&&D.defaultChecked||g?oe(a,u,g?C:Cr(A._f)):J(u,C),o.mount&&j()}},N=(u,g,k,D,A)=>{let C=!1,X=!1;const ie={name:u};if(!t.disabled){if(!k||D){(f.isDirty||p.isDirty)&&(X=e.isDirty,e.isDirty=ie.isDirty=$(),C=X!==ie.isDirty);const ce=Pe(O(n,u),g);X=!!O(e.dirtyFields,u),ce?me(e.dirtyFields,u):oe(e.dirtyFields,u,!0),ie.dirtyFields=e.dirtyFields,C=C||(f.dirtyFields||p.dirtyFields)&&X!==!ce}if(k){const ce=O(e.touchedFields,u);ce||(oe(e.touchedFields,u,k),ie.touchedFields=e.touchedFields,C=C||(f.touchedFields||p.touchedFields)&&ce!==k)}C&&A&&x.state.next(ie)}return C?ie:{}},P=(u,g,k,D)=>{const A=O(e.errors,u),C=(f.isValid||p.isValid)&&ke(g)&&e.isValid!==g;if(t.delayError&&k?(c=_(()=>v(u,k)),c(t.delayError)):(clearTimeout(d),c=null,k?oe(e.errors,u,k):me(e.errors,u)),(k?!Pe(A,k):A)||!be(D)||C){const X={...D,...C&&ke(g)?{isValid:g}:{},errors:e.errors,name:u};e={...e,...X},x.state.next(X)}},G=async u=>{T(u,!0);const g=await t.resolver(a,t.context,za(u||l.mount,s,t.criteriaMode,t.shouldUseNativeValidation));return T(u),g},F=async u=>{const{errors:g}=await G(u);if(u)for(const k of u){const D=O(g,k);D?oe(e.errors,k,D):me(e.errors,k)}else e.errors=g;return g},W=async(u,g,k={valid:!0})=>{for(const D in u){const A=u[D];if(A){const{_f:C,...X}=A;if(C){const ie=l.array.has(C.name),ce=A._f&&Ua(A._f);ce&&f.validatingFields&&T([D],!0);const Ee=await $r(A,l.disabled,a,b,t.shouldUseNativeValidation&&!g,ie);if(ce&&f.validatingFields&&T([D]),Ee[C.name]&&(k.valid=!1,g))break;!g&&(O(Ee,C.name)?ie?Ha(e.errors,Ee,C.name):oe(e.errors,C.name,Ee[C.name]):me(e.errors,C.name))}!be(X)&&await W(X,g,k)}}return k.valid},Z=()=>{for(const u of l.unMount){const g=O(s,u);g&&(g._f.refs?g._f.refs.every(k=>!It(k)):!It(g._f.ref))&&se(u)}l.unMount=new Set},$=(u,g)=>!t.disabled&&(u&&g&&oe(a,u,g),!Pe(h(),n)),I=(u,g,k)=>Ns(u,l,{...o.mount?a:de(g)?n:Ae(u)?{[u]:g}:g},k,g),K=u=>Ot(O(o.mount?a:n,u,t.shouldUnregister?O(n,u,[]):[])),J=(u,g,k={})=>{const D=O(s,u);let A=g;if(D){const C=D._f;C&&(!C.disabled&&oe(a,u,Os(g,C)),A=_t(C.ref)&&ye(g)?"":g,Fs(C.ref)?[...C.ref.options].forEach(X=>X.selected=A.includes(X.value)):C.refs?ut(C.ref)?C.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(A)?X.checked=!!A.find(ie=>ie===X.value):X.checked=A===X.value||!!A)}):C.refs.forEach(X=>X.checked=X.value===A):ir(C.ref)?C.ref.value="":(C.ref.value=A,C.ref.type||x.state.next({name:u,values:ge(a)})))}(k.shouldDirty||k.shouldTouch)&&N(u,A,k.shouldTouch,k.shouldDirty,!0),k.shouldValidate&&V(u)},Q=(u,g,k)=>{for(const D in g){if(!g.hasOwnProperty(D))return;const A=g[D],C=`${u}.${D}`,X=O(s,C);(l.array.has(u)||fe(A)||X&&!X._f)&&!Be(A)?Q(C,A,k):J(C,A,k)}},re=(u,g,k={})=>{const D=O(s,u),A=l.array.has(u),C=ge(g);oe(a,u,C),A?(x.array.next({name:u,values:ge(a)}),(f.isDirty||f.dirtyFields||p.isDirty||p.dirtyFields)&&k.shouldDirty&&x.state.next({name:u,dirtyFields:at(n,a),isDirty:$(u,C)})):D&&!D._f&&!ye(C)?Q(u,C,k):J(u,C,k),Rr(u,l)&&x.state.next({...e}),x.state.next({name:o.mount?u:void 0,values:ge(a)})},H=async u=>{o.mount=!0;const g=u.target;let k=g.name,D=!0;const A=O(s,k),C=ce=>{D=Number.isNaN(ce)||Be(ce)&&isNaN(ce.getTime())||Pe(ce,O(a,k,ce))},X=Ar(t.mode),ie=Ar(t.reValidateMode);if(A){let ce,Ee;const mt=g.type?Cr(A._f):vs(u),De=u.type===St.BLUR||u.type===St.FOCUS_OUT,bn=!Ba(A._f)&&!t.resolver&&!O(e.errors,k)&&!A._f.deps||qa(De,O(e.touchedFields,k),e.isSubmitted,ie,X),Mt=Rr(k,l,De);oe(a,k,mt),De?(A._f.onBlur&&A._f.onBlur(u),c&&c(0)):A._f.onChange&&A._f.onChange(u);const Vt=N(k,mt,De),yn=!be(Vt)||Mt;if(!De&&x.state.next({name:k,type:u.type,values:ge(a)}),bn)return(f.isValid||p.isValid)&&(t.mode==="onBlur"?De&&j():De||j()),yn&&x.state.next({name:k,...Mt?{}:Vt});if(!De&&Mt&&x.state.next({...e}),t.resolver){const{errors:xr}=await G([k]);if(C(mt),D){const vn=Mr(e.errors,s,k),gr=Mr(xr,s,vn.name||k);ce=gr.error,k=gr.name,Ee=be(xr)}}else T([k],!0),ce=(await $r(A,l.disabled,a,b,t.shouldUseNativeValidation))[k],T([k]),C(mt),D&&(ce?Ee=!1:(f.isValid||p.isValid)&&(Ee=await W(s,!0)));D&&(A._f.deps&&V(A._f.deps),P(k,Ee,ce,Vt))}},m=(u,g)=>{if(O(e.errors,g)&&u.focus)return u.focus(),1},V=async(u,g={})=>{let k,D;const A=it(u);if(t.resolver){const C=await F(de(u)?u:A);k=be(C),D=u?!A.some(X=>O(C,X)):k}else u?(D=(await Promise.all(A.map(async C=>{const X=O(s,C);return await W(X&&X._f?{[C]:X}:X)}))).every(Boolean),!(!D&&!e.isValid)&&j()):D=k=await W(s);return x.state.next({...!Ae(u)||(f.isValid||p.isValid)&&k!==e.isValid?{}:{name:u},...t.resolver||!u?{isValid:k}:{},errors:e.errors}),g.shouldFocus&&!D&<(s,m,u?A:l.mount),D},h=u=>{const g={...o.mount?a:n};return de(u)?g:Ae(u)?O(g,u):u.map(k=>O(g,k))},E=(u,g)=>({invalid:!!O((g||e).errors,u),isDirty:!!O((g||e).dirtyFields,u),error:O((g||e).errors,u),isValidating:!!O(e.validatingFields,u),isTouched:!!O((g||e).touchedFields,u)}),R=u=>{u&&it(u).forEach(g=>me(e.errors,g)),x.state.next({errors:u?e.errors:{}})},z=(u,g,k)=>{const D=(O(s,u,{_f:{}})._f||{}).ref,A=O(e.errors,u)||{},{ref:C,message:X,type:ie,...ce}=A;oe(e.errors,u,{...ce,...g,ref:D}),x.state.next({name:u,errors:e.errors,isValid:!1}),k&&k.shouldFocus&&D&&D.focus&&D.focus()},te=(u,g)=>_e(u)?x.state.subscribe({next:k=>u(I(void 0,g),k)}):I(u,g,!0),le=u=>x.state.subscribe({next:g=>{Za(u.name,g.name,u.exact)&&Wa(g,u.formState||f,gn,u.reRenderRoot)&&u.callback({values:{...a},...e,...g})}}).unsubscribe,pe=u=>(o.mount=!0,p={...p,...u.formState},le({...u,formState:p})),se=(u,g={})=>{for(const k of u?it(u):l.mount)l.mount.delete(k),l.array.delete(k),g.keepValue||(me(s,k),me(a,k)),!g.keepError&&me(e.errors,k),!g.keepDirty&&me(e.dirtyFields,k),!g.keepTouched&&me(e.touchedFields,k),!g.keepIsValidating&&me(e.validatingFields,k),!t.shouldUnregister&&!g.keepDefaultValue&&me(n,k);x.state.next({values:ge(a)}),x.state.next({...e,...g.keepDirty?{isDirty:$()}:{}}),!g.keepIsValid&&j()},Y=({disabled:u,name:g})=>{(ke(u)&&o.mount||u||l.disabled.has(g))&&(u?l.disabled.add(g):l.disabled.delete(g))},ne=(u,g={})=>{let k=O(s,u);const D=ke(g.disabled)||ke(t.disabled);return oe(s,u,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:u}},name:u,mount:!0,...g}}),l.mount.add(u),k?Y({disabled:ke(g.disabled)?g.disabled:t.disabled,name:u}):M(u,!0,g.value),{...D?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:ot(g.min),max:ot(g.max),minLength:ot(g.minLength),maxLength:ot(g.maxLength),pattern:ot(g.pattern)}:{},name:u,onChange:H,onBlur:H,ref:A=>{if(A){ne(u,g),k=O(s,u);const C=de(A.value)&&A.querySelectorAll&&A.querySelectorAll("input,select,textarea")[0]||A,X=Ia(C),ie=k._f.refs||[];if(X?ie.find(ce=>ce===C):C===k._f.ref)return;oe(s,u,{_f:{...k._f,...X?{refs:[...ie.filter(It),C,...Array.isArray(O(n,u))?[{}]:[]],ref:{type:C.type,name:u}}:{ref:C}}}),M(u,!1,void 0,C)}else k=O(s,u,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(ws(l.array,u)&&o.action)&&l.unMount.add(u)}}},ue=()=>t.shouldFocusError&<(s,m,l.mount),ae=u=>{ke(u)&&(x.state.next({disabled:u}),lt(s,(g,k)=>{const D=O(s,k);D&&(g.disabled=D._f.disabled||u,Array.isArray(D._f.refs)&&D._f.refs.forEach(A=>{A.disabled=D._f.disabled||u}))},0,!1))},je=(u,g)=>async k=>{let D;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let A=ge(a);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:C,values:X}=await G();e.errors=C,A=X}else await W(s);if(l.disabled.size)for(const C of l.disabled)oe(A,C,void 0);if(me(e.errors,"root"),be(e.errors)){x.state.next({errors:{}});try{await u(A,k)}catch(C){D=C}}else g&&await g({...e.errors},k),ue(),setTimeout(ue);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:be(e.errors)&&!D,submitCount:e.submitCount+1,errors:e.errors}),D)throw D},ht=(u,g={})=>{O(s,u)&&(de(g.defaultValue)?re(u,ge(O(n,u))):(re(u,g.defaultValue),oe(n,u,ge(g.defaultValue))),g.keepTouched||me(e.touchedFields,u),g.keepDirty||(me(e.dirtyFields,u),e.isDirty=g.defaultValue?$(u,ge(O(n,u))):$()),g.keepError||(me(e.errors,u),f.isValid&&j()),x.state.next({...e}))},et=(u,g={})=>{const k=u?ge(u):n,D=ge(k),A=be(u),C=A?n:D;if(g.keepDefaultValues||(n=k),!g.keepValues){if(g.keepDirtyValues){const X=new Set([...l.mount,...Object.keys(at(n,a))]);for(const ie of Array.from(X))O(e.dirtyFields,ie)?oe(C,ie,O(a,ie)):re(ie,O(C,ie))}else{if(sr&&de(u))for(const X of l.mount){const ie=O(s,X);if(ie&&ie._f){const ce=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(_t(ce)){const Ee=ce.closest("form");if(Ee){Ee.reset();break}}}}for(const X of l.mount)re(X,O(C,X))}a=ge(C),x.array.next({values:{...C}}),x.state.next({values:{...C}})}l={mount:g.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!g.keepIsValid||!!g.keepDirtyValues,o.watch=!!t.shouldUnregister,x.state.next({submitCount:g.keepSubmitCount?e.submitCount:0,isDirty:A?!1:g.keepDirty?e.isDirty:!!(g.keepDefaultValues&&!Pe(u,n)),isSubmitted:g.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:A?{}:g.keepDirtyValues?g.keepDefaultValues&&a?at(n,a):e.dirtyFields:g.keepDefaultValues&&u?at(n,u):g.keepDirty?e.dirtyFields:{},touchedFields:g.keepTouched?e.touchedFields:{},errors:g.keepErrors?e.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1})},tt=(u,g)=>et(_e(u)?u(a):u,g),xn=(u,g={})=>{const k=O(s,u),D=k&&k._f;if(D){const A=D.refs?D.refs[0]:D.ref;A.focus&&(A.focus(),g.shouldSelect&&_e(A.select)&&A.select())}},gn=u=>{e={...e,...u}},pr={control:{register:ne,unregister:se,getFieldState:E,handleSubmit:je,setError:z,_subscribe:le,_runSchema:G,_getWatch:I,_getDirty:$,_setValid:j,_setFieldArray:w,_setDisabledField:Y,_setErrors:S,_getFieldArray:K,_reset:et,_resetDefaultValues:()=>_e(t.defaultValues)&&t.defaultValues().then(u=>{tt(u,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:Z,_disableForm:ae,_subjects:x,_proxyFormState:f,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(u){o=u},get _defaultValues(){return n},get _names(){return l},set _names(u){l=u},get _formState(){return e},get _options(){return t},set _options(u){t={...t,...u}}},subscribe:pe,trigger:V,register:ne,handleSubmit:je,watch:te,setValue:re,getValues:h,reset:tt,resetField:ht,clearErrors:R,unregister:se,setError:z,setFocus:xn,getFieldState:E};return{...pr,formControl:pr}}function Ka(r={}){const t=y.useRef(void 0),e=y.useRef(void 0),[s,n]=y.useState({isDirty:!1,isValidating:!1,isLoading:_e(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,isReady:!1,defaultValues:_e(r.defaultValues)?void 0:r.defaultValues});t.current||(t.current={...r.formControl?r.formControl:Xa(r),formState:s},r.formControl&&r.defaultValues&&!_e(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=t.current.control;return a._options=r,ar(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),y.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),y.useEffect(()=>{r.mode&&(a._options.mode=r.mode),r.reValidateMode&&(a._options.reValidateMode=r.reValidateMode),r.errors&&!be(r.errors)&&a._setErrors(r.errors)},[a,r.errors,r.mode,r.reValidateMode]),y.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,r.shouldUnregister]),y.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),y.useEffect(()=>{r.values&&!Pe(r.values,e.current)?(a._reset(r.values,a._options.resetOptions),e.current=r.values,n(o=>({...o}))):a._resetDefaultValues()},[a,r.values]),y.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=Es(s,a),t.current}const Ms={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},Ja={sm:"h-6",md:"h-10",lg:"h-12"},Qa={sm:"px-2",md:"px-2.5",lg:"px-3"};function Dr(r,t,e,s,n,a,o){const l=t?"datetime-local":"date",c=L("box-border w-full rounded-lg border outline-none transition font-[var(--font-primary)]",Ms[e],Ja[e],Qa[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]"),p=Ra(c,n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-disabled)] cursor-not-allowed opacity-60":"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",o);return i.jsxs(i.Fragment,{children:[i.jsx("input",{id:r,type:l,disabled:n,"aria-disabled":n,"data-disabled":n?"true":"false",...s,className:p}),i.jsx("div",{children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Vs(r){const{control:t,name:e,rules:s,defaultValue:n,showTime:a=!1,size:o="sm",width:l="100%",label:c,labelHidden:d=!1,hasError:f=!1,errorMessage:p="",disabled:x=!1,className:b,onChange:_}=r,j=y.useId(),T=e||j;return i.jsxs("div",{className:L("flex flex-col",b),style:{width:l,maxWidth:"100%"},children:[c&&i.jsx("label",{htmlFor:T,className:L("pb-2 text-[var(--color-ds-text-primary)]",Ms[o],d&&"sr-only"),children:c}),t&&e?i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n,render:({field:w,fieldState:v})=>Dr(T,a,o,{value:w.value,onChange:w.onChange,onBlur:w.onBlur},x,v.error,b)}):Dr(T,a,o,{defaultValue:n,onChange:_},x,f?{message:p}:void 0,b)]})}const eo=({trigger:r,items:t,align:e="left",className:s})=>{const[n,a]=y.useState(!1),o=y.useRef(null),l=y.useRef([]);y.useEffect(()=>{const d=f=>{o.current&&!o.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);const c=d=>{var p,x;const f=l.current.findIndex(b=>b===document.activeElement);if(d.key==="Escape")a(!1);else if(d.key==="ArrowDown"){d.preventDefault();const b=(f+1)%t.length;(p=l.current[b])==null||p.focus()}else if(d.key==="ArrowUp"){d.preventDefault();const b=(f-1+t.length)%t.length;(x=l.current[b])==null||x.focus()}};return i.jsxs("div",{className:L("relative inline-block",s),ref:o,children:[i.jsx("button",{type:"button",onClick:()=>a(d=>!d),className:"inline-flex items-center focus:outline-none","aria-haspopup":"menu","aria-expanded":n,children:r}),n&&i.jsx("div",{role:"menu","aria-orientation":"vertical",className:L("absolute mt-2 min-w-[160px] bg-[var(--color-ds-background-page)]","border border-[var(--color-ds-border-muted)] rounded shadow-lg z-10",e==="right"?"right-0":"left-0"),onKeyDown:c,children:t.map((d,f)=>{const{label:p,onSelect:x,disabled:b,icon:_}=d;return i.jsxs("button",{role:"menuitem",type:"button",disabled:b,ref:j=>{l.current[f]=j},className:L("w-full flex items-center px-4 py-2 text-[var(--color-ds-text-primary)] text-ds-md transition-colors",b?"opacity-50 cursor-not-allowed":"hover:bg-[var(--color-ds-background-surface)]"),onClick:()=>{b||(x(),a(!1))},children:[_&&i.jsx(_,{className:"w-5 h-5 mr-2 text-[var(--color-ds-text-secondary)]"}),p]},f)})})]})},to=(r,t,e,s)=>{var a,o,l,c;const n=[e,{code:t,...s||{}}];if((o=(a=r==null?void 0:r.services)==null?void 0:a.logger)!=null&&o.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);We(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Ir={},Ht=(r,t,e,s)=>{We(e)&&Ir[e]||(We(e)&&(Ir[e]=new Date),to(r,t,e,s))},$s=(r,t)=>()=>{if(r.isInitialized)t();else{const e=()=>{setTimeout(()=>{r.off("initialized",e)},0),t()};r.on("initialized",e)}},Yt=(r,t,e)=>{r.loadNamespaces(t,$s(r,e))},Lr=(r,t,e,s)=>{if(We(e)&&(e=[e]),r.options.preload&&r.options.preload.indexOf(t)>-1)return Yt(r,e,s);e.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(t,$s(r,s))},ro=(r,t,e={})=>!t.languages||!t.languages.length?(Ht(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(r,{lng:e.lng,precheck:(s,n)=>{var a;if(((a=e.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),We=r=>typeof r=="string",so=r=>typeof r=="object"&&r!==null,no=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ao={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},oo=r=>ao[r],io=r=>r.replace(no,oo);let lo={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:io};const co=()=>lo;let uo;const fo=()=>uo,ho=y.createContext();class mo{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const po=(r,t)=>{const e=y.useRef();return y.useEffect(()=>{e.current=r},[r,t]),e.current},Ds=(r,t,e,s)=>r.getFixedT(t,e,s),xo=(r,t,e,s)=>y.useCallback(Ds(r,t,e,s),[r,t,e,s]),cr=(r,t={})=>{var M,N,P,G;const{i18n:e}=t,{i18n:s,defaultNS:n}=y.useContext(ho)||{},a=e||s||fo();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new mo),!a){Ht(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const F=(Z,$)=>We($)?$:so($)&&We($.defaultValue)?$.defaultValue:Array.isArray(Z)?Z[Z.length-1]:Z,W=[F,{},!1];return W.t=F,W.i18n={},W.ready=!1,W}(M=a.options.react)!=null&&M.wait&&Ht(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...co(),...a.options.react,...t},{useSuspense:l,keyPrefix:c}=o;let d=n||((N=a.options)==null?void 0:N.defaultNS);d=We(d)?[d]:d||["translation"],(G=(P=a.reportNamespaces).addUsedNamespaces)==null||G.call(P,d);const f=(a.isInitialized||a.initializedStoreOnce)&&d.every(F=>ro(F,a,o)),p=xo(a,t.lng||null,o.nsMode==="fallback"?d:d[0],c),x=()=>p,b=()=>Ds(a,t.lng||null,o.nsMode==="fallback"?d:d[0],c),[_,j]=y.useState(x);let T=d.join();t.lng&&(T=`${t.lng}${T}`);const w=po(T),v=y.useRef(!0);y.useEffect(()=>{const{bindI18n:F,bindI18nStore:W}=o;v.current=!0,!f&&!l&&(t.lng?Lr(a,t.lng,d,()=>{v.current&&j(b)}):Yt(a,d,()=>{v.current&&j(b)})),f&&w&&w!==T&&v.current&&j(b);const Z=()=>{v.current&&j(b)};return F&&(a==null||a.on(F,Z)),W&&(a==null||a.store.on(W,Z)),()=>{v.current=!1,a&&(F==null||F.split(" ").forEach($=>a.off($,Z))),W&&a&&W.split(" ").forEach($=>a.store.off($,Z))}},[a,T]),y.useEffect(()=>{v.current&&f&&j(x)},[a,c,f]);const S=[_,a,f];if(S.t=_,S.i18n=a,S.ready=f,f||!f&&!l)return S;throw new Promise(F=>{t.lng?Lr(a,t.lng,d,()=>F()):Yt(a,d,()=>F())})},Xt={sm:"text-sm",md:"text-base",lg:"text-lg"};function Pr(r,t,e,s,n,a,o,l,c){const{t:d}=cr(),f=y.useRef(null),p=typeof s=="number"&&t.length>=s,x=()=>{var v;!o&&!p&&((v=f.current)==null||v.click())},b=v=>{const S=v.target.files;if(!S)return;const M=Array.from(S);let N=t.concat(M);s&&(N=N.slice(0,s)),e(N),v.target.value=""},_=v=>{if(v.preventDefault(),o||p)return;const S=Array.from(v.dataTransfer.files);let M=t.concat(S);s&&(M=M.slice(0,s)),e(M)},j=v=>{v.preventDefault()},T=v=>{const S=URL.createObjectURL(v);window.open(S)},w=v=>{const S=t.filter((M,N)=>N!==v);e(S)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"self-start mb-4 w-auto",children:i.jsx($e,{type:"button",variant:"outline",size:a,icon:wr,onClick:x,disabled:o||p,children:d("ds.fileUploader.browse","Browse files")})}),!p&&i.jsxs("div",{className:L("relative flex bg-[var(--color-ds-background-page)] flex-col items-center justify-center border-2 border-dashed border-[var(--color-ds-border-muted)] rounded-lg p-4",o?"opacity-50 cursor-not-allowed":"hover:border-[var(--color-ds-border-default)]",Xt[a],c),onDrop:_,onDragOver:j,children:[i.jsx("input",{id:r,type:"file",ref:f,className:"hidden",multiple:s!==1,accept:n,onChange:b,disabled:o}),i.jsx(Ce,{component:Pn,size:"md",className:"w-8 h-8 text-[var(--color-ds-text-secondary)]"}),i.jsx("p",{className:"mt-3 text-[var(--color-ds-text-secondary)] text-center",children:d("ds.fileUploader.dragDrop","Drag & drop your files here or click to browse")})]}),t.length>0&&i.jsx("ul",{className:"mt-4 space-y-1",children:t.map((v,S)=>i.jsxs("li",{className:"flex items-center justify-between text-[var(--color-ds-text-secondary)] text-sm",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx(wr,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.jsx("span",{className:"truncate pr-2",children:v.name})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx($e,{variant:"ghost",size:"sm",icon:ls,ariaLabel:d("ds.fileUploader.view","View"),onClick:()=>T(v)}),i.jsx($e,{variant:"ghost",size:"sm",icon:tr,ariaLabel:d("ds.fileUploader.remove","Remove"),onClick:()=>w(S)})]})]},S))}),i.jsx("div",{className:"pt-[5px] min-h-[18px] w-full",children:l!=null&&l.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function Is(r){const{control:t,name:e,rules:s,defaultValue:n,maxFiles:a,accept:o,size:l="sm",width:c="100%",label:d,labelHidden:f=!1,disabled:p=!1,hasError:x=!1,errorMessage:b="",className:_}=r,j=y.useId(),T=e||j;if(t&&e)return i.jsxs("div",{className:L("flex flex-col",_),style:{width:c},children:[d&&i.jsx("label",{htmlFor:T,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:d}),i.jsx(Fe,{name:e,control:t,rules:s,defaultValue:n instanceof FileList?Array.from(n):n||[],render:({field:S,fieldState:M})=>Pr(T,S.value,N=>S.onChange(N),a,o,l,p,M.error,_)})]});const[w,v]=y.useState(n instanceof FileList?Array.from(n):n||[]);return i.jsxs("div",{className:L("flex flex-col",_),style:{width:c},children:[d&&i.jsx("label",{htmlFor:T,className:L("pb-[10px] text-[var(--color-ds-text-primary)]",Xt[l],f&&"sr-only"),children:d}),Pr(T,w,v,a,o,l,p,x?{message:b}:void 0,_)]})}const qe=({count:r=1,width:t,height:e="1em",variant:s="rect",className:n})=>{const a=Array.from({length:r});return i.jsx(i.Fragment,{children:a.map((o,l)=>i.jsx("span",{role:"status","aria-label":"Cargando...",className:L("bg-[var(--color-ds-border-muted)] animate-pulse inline-block",s==="circle"?"rounded-full":"rounded",n),style:{width:t??"auto",height:e}},l))})},bt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},go={sm:"h-6",md:"h-10",lg:"h-12"},bo={sm:"px-2",md:"px-2.5",lg:"px-3"},zr={sm:"pl-2",md:"pl-2.5",lg:"pl-3"},yo={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Rt({id:r,type:t="text",size:e="sm",width:s="100%",label:n,labelHidden:a=!1,hasError:o=!1,errorMessage:l="",prefixIcon:c,suffixIcon:d,separator:f,suffixButton:p,disabled:x=!1,control:b,name:_,rules:j,defaultValue:T,loading:w=!1,className:v,...S}){const M=y.useId(),[N,P]=y.useState(!1),G=r||M,F=t==="password",Z=c??(t==="number"?qn:void 0),$=F?N?Bn:ls:d,I=L("box-border w-full rounded-lg border placeholder-[var(--color-ds-text-secondary)] outline-none transition font-[var(--font-primary)] appearance-none",bt[e],go[e],bo[e],o?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]","bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]","disabled:bg-[var(--color-ds-background-disabled)]","disabled:border-[var(--color-ds-border-muted)]","disabled:text-[var(--color-ds-text-disabled)]","disabled:cursor-not-allowed");return w?i.jsxs("div",{className:"flex flex-col",style:{width:s,maxWidth:"100%"},children:[!a&&n&&i.jsx("label",{htmlFor:G,className:L("pb-2",bt[e]),children:n}),i.jsx(qe,{width:"100%",height:yo[e],variant:"rect",className:"rounded-lg"}),i.jsx("div",{className:"min-h-[18px] w-full",children:i.jsx("span",{"aria-hidden":"true",children:" "})})]}):b&&_?i.jsx(Fe,{name:_,control:b,rules:j,defaultValue:T,render:({field:K,fieldState:J})=>i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:G,className:L("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[Z&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:Z,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...K,id:G,type:F?N?"text":"password":t,disabled:x,"aria-invalid":!!J.error,className:L(I,Z&&"pl-9",$&&"pr-9",v),onInvalid:Q=>Q.preventDefault(),style:F&&!N?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full pr-2",children:p}),$&&i.jsx("button",{type:"button",onClick:()=>P(Q=>!Q),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:$,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:J.error?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:J.error.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}):i.jsxs("div",{className:"flex flex-col",style:{width:s},children:[!a&&n&&i.jsx("label",{htmlFor:G,className:L("pb-2 text-[var(--color-ds-text-primary)]",bt[e]),children:n}),i.jsxs("div",{className:"relative flex items-center w-full",children:[Z&&i.jsx("div",{className:L("absolute left-0 flex items-center h-full",zr[e]),children:i.jsx(Ce,{component:Z,size:e,className:"text-[var(--color-ds-text-secondary)]"})}),i.jsx("input",{...S,id:G,type:F?N?"text":"password":t,disabled:x,"aria-invalid":o,className:L(I,Z&&"pl-9",$&&"pr-9",v),onInvalid:K=>K.preventDefault(),style:F&&!N?{WebkitTextSecurity:"disc",MozTextSecurity:"disc"}:void 0}),f&&i.jsx("div",{className:"flex items-center h-full",children:f}),p&&i.jsx("div",{className:"flex items-center h-full",children:p}),$&&i.jsx("button",{type:"button",onClick:()=>P(K=>!K),className:"absolute right-0 flex items-center h-full pr-2",tabIndex:-1,children:i.jsx(Ce,{component:$,size:e,className:"text-[var(--color-ds-text-secondary)]"})})]}),i.jsx("div",{className:"min-h-[18px]",children:o&&l?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:l}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}const vo={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},Lt=400,yt=8,Ls=({children:r,size:t="sm",position:e="top",className:s})=>{const[n,a]=y.useState(!1),[o,l]=y.useState({x:0,y:0}),c=y.useRef(null),d=y.useId();y.useEffect(()=>{if(n&&c.current){const x=c.current.getBoundingClientRect();let b=0,_=0;switch(e){case"top":b=x.left+x.width/2-Lt/2,_=x.top-yt;break;case"bottom":b=x.left+x.width/2-Lt/2,_=x.bottom+yt;break;case"left":b=x.left-Lt-yt,_=x.top+x.height/2;break;case"right":b=x.right+yt,_=x.top+x.height/2;break}l({x:b,y:_})}},[n,e]);const f=()=>typeof r=="string"?i.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):i.jsx(i.Fragment,{children:r}),p=n?i.jsx("div",{id:d,role:"tooltip",className:L("fixed z-50 w-[250px] bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)] text-ds-sm rounded p-2 shadow-lg","pointer-events-none"),style:{top:`${o.y}px`,left:`${o.x}px`,transform:e==="left"||e==="right"?"translateY(-50%)":e==="top"?"translateY(-100%)":void 0},children:f()}):null;return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-describedby":d,ref:c,className:L("inline-flex items-center justify-center focus:outline-none",vo[t],"text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]",s),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:i.jsx(Hn,{className:"w-full h-full"})}),as.createPortal(p,document.body)]})};function wo({name:r,label:t,type:e="text",size:s="sm",width:n,placeholder:a,validation:o,loadingDefaults:l,disabled:c,info:d}){var T;const{control:f,formState:{errors:p}}=dt(),x=!!p[r],b=((T=p[r])==null?void 0:T.message)||"",_="relative",j=n??"w-full";return i.jsxs("div",{className:_,children:[i.jsx(Fe,{name:r,control:f,rules:o,render:({field:w})=>i.jsx(Rt,{label:t,size:s,width:j,placeholder:a,hasError:x,errorMessage:b,loading:l,type:e,...w,disabled:c})}),d&&i.jsx(Ls,{size:s,position:"left",className:"absolute top-1/2 right-2 -translate-y-1/2",children:d})]})}const ur=y.memo(wo);ur.displayName="FormFieldInput";function ko({title:r,headerButtons:t,children:e,className:s}){return i.jsxs("div",{className:L("flex flex-col h-full",s),children:[i.jsxs("div",{className:"flex items-center justify-between py-4",children:[i.jsx("div",{className:`bg-[var(--color-ds-background-accent)] \r
|
|
23
23
|
text-[var(--color-ds-text-on-accent)] \r
|
|
24
24
|
rounded-tr-[20px] \r
|
|
25
25
|
pl-4 pr-10\r
|
|
26
|
-
text-ds-lg`,children:r}),t&&i.jsx("div",{className:"flex items-center space-x-2",children:t})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:e})]})}function Ps({options:r,value:t,onChange:e,children:s}){const n=v.useRef(null),[a,o]=v.useState({left:0,width:0});return v.useLayoutEffect(()=>{const l=n.current;if(!l)return;const c=()=>{const u=r.findIndex(T=>T.value===t);if(u<0)return;const f=l.children[u],p=f.querySelector("span"),x=(p==null?void 0:p.offsetWidth)??f.offsetWidth,b=f.offsetWidth,j=f.offsetLeft+(b-x)/2;o({left:j,width:x})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[t,r]),i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("ul",{ref:n,role:"tablist",className:"flex justify-center overflow-x-auto border-b border-[var(--color-ds-border-default-50)]",children:r.map(l=>{const c=l.value===t;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>e(l.value),className:$("cursor-pointer whitespace-nowrap px-4 py-2 transition-colors duration-150 ease-in-out",c?"text-[var(--color-ds-background-accent)]":"text-[var(--color-ds-text-primary)]"),children:i.jsx("span",{className:"inline-block",children:l.label})},l.value)})}),i.jsx("span",{className:"absolute bottom-0 h-1 bg-[var(--color-ds-background-accent)] transition-all duration-200 ease-in-out rounded-t-full",style:{left:a.left,width:a.width}})]}),i.jsx("div",{className:"mt-4 pb-4 border-b border-[var(--color-ds-border-default-50)]",children:s[t]})]})}const Kt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},jo={sm:"h-6",md:"h-10",lg:"h-12"},Eo={sm:"px-2",md:"px-2.5",lg:"px-3"},Ur={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Br(r,t,e,s,n,a,o,l,c){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("select",{id:r,...s,disabled:n,className:$("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Kt[e],jo[e],Eo[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]",l),children:t.map(u=>i.jsx("option",{value:u.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:u.label},u.value))}),c&&i.jsx("div",{className:"flex items-center h-full pr-2",children:c})]}),!o&&i.jsx("div",{className:"min-h-[18px] w-full",children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function ct(r){const{control:t,name:e,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:u,size:f="sm",width:p="100%",label:x,labelHidden:b=!1,hasError:E=!1,errorMessage:j="",disableErrorPlaceholder:T=!1,disabled:w=!1,className:y,suffixButton:N}=r,O=v.useId(),_=e||O,[D,Q]=v.useState(a),[S,W]=v.useState(!!o);if(v.useEffect(()=>{o&&(W(!0),o().then(G=>Q(G)).finally(()=>W(!1)))},[o,...l]),v.useEffect(()=>{!t&&D.length>0&&(c===void 0||c===""||!D.some(G=>G.value===c))&&(u==null||u(D[0].value))},[D,c,u,t]),t&&e){const{field:G,fieldState:R}=Ss({name:e,control:t,rules:s,defaultValue:n});return v.useEffect(()=>{if(!S&&D.length>0){const P=G.value;(P===void 0||!D.some(X=>X.value===P))&&G.onChange(D[0].value)}},[D,S,G]),i.jsxs("div",{className:$("flex flex-col",y),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:_,className:$("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(_,D,f,{value:G.value,onChange:P=>G.onChange(P.target.value)},w,R.error,T,y,N)]})}return i.jsxs("div",{className:$("flex flex-col",y),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:_,className:$("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),S?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(_,D,f,{value:c,onChange:G=>u==null?void 0:u(G.target.value)},w,E?{message:j}:void 0,T,y,N)]})}const Wr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function zs({groupLabel:r,inputs:t=[],separator:e=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=t.length;return i.jsxs("div",{className:$("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:$("sr-only pb-2",Wr[o]),children:r}),a&&i.jsx("label",{className:$("pb-2",Wr[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:t.map((u,f)=>{const{width:p,className:x,options:b,loadOptions:E,...j}=u,T=Array.isArray(b)||typeof E=="function";let w="rounded-lg";!s&&c>1&&(f===0?w="rounded-l-lg rounded-r-none":f===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const y=$("inline-flex items-center flex-shrink-0 overflow-hidden",typeof p=="string"&&p.startsWith("w-")?p:void 0),N=typeof p=="string"&&!p.startsWith("w-")?{width:p}:void 0,O=$(x,w);return i.jsxs("div",{className:y,style:N,children:[T?i.jsx(ct,{...j,size:o,className:O,options:b,loadOptions:E}):i.jsx(Mt,{...j,size:o,className:O}),s&&f<c-1&&e]},f)})})]})}const Zr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},No={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function Us({groupLabel:r,options:t,control:e,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:u,showVisibleLabel:f=!0}){return i.jsx(Fe,{name:s,control:e,rules:n,defaultValue:a,render:({field:p,fieldState:x})=>{const{value:b,onChange:E}=p;x.error;const j=w=>o?Array.isArray(b)&&b.includes(w):b===w,T=w=>{if(o){const y=Array.isArray(b)?[...b]:[],N=y.indexOf(w);N>=0?y.splice(N,1):y.push(w),E(y)}else E(w)};return i.jsxs("div",{className:$("w-full",u),children:[i.jsx("label",{className:$("sr-only pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),f&&i.jsx("label",{className:$("block pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),i.jsx("div",{className:$(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:t.map(w=>i.jsxs("label",{className:"inline-flex items-center space-x-2 cursor-pointer select-none",children:[i.jsx("input",{type:o?"checkbox":"radio",name:s,value:w.value,checked:j(w.value),onChange:()=>T(w.value),className:$(No[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]")}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-md",children:w.label})]},w.value))})]})}})}function So(r){function t(o){var l,c;for(const u of Object.keys(o)){if((l=o[u])!=null&&l.types||(c=o[u])!=null&&c.message)return u;if(typeof o[u]=="object"){const f=t(o[u]);if(f)return`${u}.${f}`}}return null}const e=t(r);if(!e)return;const s=`[name="${e}"]`,n=`[name^="${e}["], [name^="${e}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const _o={success:"bg-green-100 border-green-500 text-green-800",error:"bg-red-100 border-red-500 text-red-800",info:"bg-blue-100 border-blue-500 text-blue-800",warning:"bg-yellow-100 border-yellow-500 text-yellow-800"},Bs=({id:r,message:t,variant:e="info",duration:s=5e3,onClose:n})=>(v.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:$("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",_o[e]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:t}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let vt;const Fo=new Uint8Array(16);function To(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(Fo)}const xe=[];for(let r=0;r<256;++r)xe.push((r+256).toString(16).slice(1));function Co(r,t=0){return xe[r[t+0]]+xe[r[t+1]]+xe[r[t+2]]+xe[r[t+3]]+"-"+xe[r[t+4]]+xe[r[t+5]]+"-"+xe[r[t+6]]+xe[r[t+7]]+"-"+xe[r[t+8]]+xe[r[t+9]]+"-"+xe[r[t+10]]+xe[r[t+11]]+xe[r[t+12]]+xe[r[t+13]]+xe[r[t+14]]+xe[r[t+15]]}const Oo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qr={randomUUID:Oo};function Ao(r,t,e){if(qr.randomUUID&&!r)return qr.randomUUID();r=r||{};const s=r.random||(r.rng||To)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Co(s)}const Ws=v.createContext(null),Zs=()=>{const r=v.useContext(Ws);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Mo=({children:r})=>{const[t,e]=v.useState([]),s=(a,o="info",l=5e3)=>{const c=Ao();e(u=>[...u,{id:c,message:a,variant:o,duration:l}])},n=a=>{e(o=>o.filter(l=>l.id!==a))};return i.jsxs(Ws.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:t.map(a=>i.jsx(Bs,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Gr=(r,t,e)=>{if(r&&"reportValidity"in r){const s=M(e,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},qs=(r,t)=>{for(const e in t.fields){const s=t.fields[e];s&&s.ref&&"reportValidity"in s.ref?Gr(s.ref,e,r):s&&s.refs&&s.refs.forEach(n=>Gr(n,e,r))}},Ro=(r,t)=>{t.shouldUseNativeValidation&&qs(r,t);const e={};for(const s in r){const n=M(t.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Vo(t.names||Object.keys(r),s)){const o=Object.assign({},M(e,s));oe(o,"root",a),oe(e,s,o)}else oe(e,s,a)}return e},Vo=(r,t)=>{const e=Hr(t);return r.some(s=>Hr(s).match(`^${e}\\.\\d+`))};function Hr(r){return r.replace(/\]|\[/g,"")}function Yr(r,t,e){return e===void 0&&(e={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(t!=null&&t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(r[e.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(u){return a.shouldUseNativeValidation&&qs({},a),{values:e.raw?Object.assign({},s):u,errors:{}}}))}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(!o.inner)throw o;return{values:{},errors:Ro((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(u,f){if(u[f.path]||(u[f.path]={message:f.message,type:f.type}),c){var p=u[f.path].types,x=p&&p[f.type];u[f.path]=_s(f.path,c,u,f.type,x?[].concat(x,f.message):f.message)}return u},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Pt,Xr;function $o(){if(Xr)return Pt;Xr=1;function r(w){this._maxSize=w,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(w){return this._values[w]},r.prototype.set=function(w,y){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=y};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,e=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),u=new r(o);Pt={Cache:r,split:p,normalizePath:f,setter:function(w){var y=f(w);return c.get(w)||c.set(w,function(O,_){for(var D=0,Q=y.length,S=O;D<Q-1;){var W=y[D];if(W==="__proto__"||W==="constructor"||W==="prototype")return O;S=S[y[D++]]}S[y[D]]=_})},getter:function(w,y){var N=f(w);return u.get(w)||u.set(w,function(_){for(var D=0,Q=N.length;D<Q;)if(_!=null||!y)_=_[N[D++]];else return;return _})},join:function(w){return w.reduce(function(y,N){return y+(b(N)||e.test(N)?"["+N+"]":(y?".":"")+N)},"")},forEach:function(w,y,N){x(Array.isArray(w)?w:p(w),y,N)}};function f(w){return l.get(w)||l.set(w,p(w).map(function(y){return y.replace(a,"$2")}))}function p(w){return w.match(t)||[""]}function x(w,y,N){var O=w.length,_,D,Q,S;for(D=0;D<O;D++)_=w[D],_&&(T(_)&&(_='"'+_+'"'),S=b(_),Q=!S&&/^\d+$/.test(_),y.call(N,_,S,Q,D,w))}function b(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function E(w){return w.match(s)&&!w.match(e)}function j(w){return n.test(w)}function T(w){return!b(w)&&(E(w)||j(w))}return Pt}var Ze=$o(),zt,Kr;function Do(){if(Kr)return zt;Kr=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=f=>f.match(r)||[],e=f=>f[0].toUpperCase()+f.slice(1),s=(f,p)=>t(f).join(p).toLowerCase(),n=f=>t(f).reduce((p,x)=>`${p}${p?x[0].toUpperCase()+x.slice(1).toLowerCase():x.toLowerCase()}`,"");return zt={words:t,upperFirst:e,camelCase:n,pascalCase:f=>e(n(f)),snakeCase:f=>s(f,"_"),kebabCase:f=>s(f,"-"),sentenceCase:f=>e(s(f," ")),titleCase:f=>t(f).map(e).join(" ")},zt}var Ut=Do(),wt={exports:{}},Jr;function Io(){if(Jr)return wt.exports;Jr=1,wt.exports=function(n){return r(t(n),n)},wt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},u=o,f=e(a),p=s(n);for(a.forEach(function(b){if(!p.has(b[0])||!p.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)c[u]||x(n[u],u,new Set);return l;function x(b,E,j){if(j.has(b)){var T;try{T=", node was:"+JSON.stringify(b)}catch{T=""}throw new Error("Cyclic dependency"+T)}if(!p.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[E]){c[E]=!0;var w=f.get(b)||new Set;if(w=Array.from(w),E=w.length){j.add(b);do{var y=w[--E];x(y,p.get(y),j)}while(E);j.delete(b)}l[--o]=b}}}function t(n){for(var a=new Set,o=0,l=n.length;o<l;o++){var c=n[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function e(n){for(var a=new Map,o=0,l=n.length;o<l;o++){var c=n[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function s(n){for(var a=new Map,o=0,l=n.length;o<l;o++)a.set(n[o],o);return a}return wt.exports}var Lo=Io();const Po=kn(Lo),zo=Object.prototype.toString,Uo=Error.prototype.toString,Bo=RegExp.prototype.toString,Wo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Zo=/^Symbol\((.*)\)(.*)$/;function qo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Qr(r,t=!1){if(r==null||r===!0||r===!1)return""+r;const e=typeof r;if(e==="number")return qo(r);if(e==="string")return t?`"${r}"`:r;if(e==="function")return"[Function "+(r.name||"anonymous")+"]";if(e==="symbol")return Wo.call(r).replace(Zo,"Symbol($1)");const s=zo.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Uo.call(r)+"]":s==="RegExp"?Bo.call(r):null}function ze(r,t){let e=Qr(r,t);return e!==null?e:JSON.stringify(r,function(s,n){let a=Qr(this[s],t);return a!==null?a:n},2)}function Gs(r){return r==null?[]:[].concat(r)}let Hs,Ys,Xs,Go=/\$\{\s*(\w+)\s*\}/g;Hs=Symbol.toStringTag;class es{constructor(t,e,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Hs]="Error",this.name="ValidationError",this.value=e,this.path=s,this.type=n,this.errors=[],this.inner=[],Gs(t).forEach(a=>{if(we.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ys=Symbol.hasInstance;Xs=Symbol.toStringTag;class we extends Error{static formatError(t,e){const s=e.label||e.path||"this";return e=Object.assign({},e,{path:s,originalPath:e.path}),typeof t=="string"?t.replace(Go,(n,a)=>ze(e[a])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,s,n,a){const o=new es(t,e,s,n);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Xs]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,we)}static[Ys](t){return es[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Te={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:t,value:e,originalValue:s})=>{const n=s!=null&&s!==e?` (cast from the value \`${ze(s,!0)}\`).`:".";return t!=="mixed"?`${r} must be a \`${t}\` type, but the final value was: \`${ze(e,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${ze(e,!0)}\``+n}},ve={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Le={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Jt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ho={isValue:"${path} field must be ${value}"},Et={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Yo={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Xo={notType:r=>{const{path:t,value:e,spec:s}=r,n=s.types.length;if(Array.isArray(e)){if(e.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``;if(e.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``}return we.formatError(Te.notType,r)}};Object.assign(Object.create(null),{mixed:Te,string:ve,number:Le,date:Jt,object:Et,array:Yo,boolean:Ho,tuple:Xo});const ur=r=>r&&r.__isYupSchema__;class Ct{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=e,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new Ct(t,(l,c)=>{var u;let f=o(...l)?n:a;return(u=f==null?void 0:f(c))!=null?u:c})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let s=this.refs.map(a=>a.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),n=this.fn(s,t,e);if(n===void 0||n===t)return t;if(!ur(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}const kt={context:"$",value:"."};class Ge{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===kt.context,this.isValue=this.key[0]===kt.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?kt.context:this.isValue?kt.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Ze.getter(this.path,!0),this.map=e.map}getValue(t,e,s){let n=this.isContext?s:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ge.prototype.__isYupRef=!0;const Ve=r=>r==null;function Xe(r){function t({value:e,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:u,test:f,params:p,message:x,skipAbsent:b}=r;let{parent:E,context:j,abortEarly:T=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function y(R){return Ge.isRef(R)?R.getValue(e,E,j):R}function N(R={}){const P=Object.assign({value:e,originalValue:a,label:o.spec.label,path:R.path||s,spec:o.spec,disableStackTrace:R.disableStackTrace||w},p,R.params);for(const ee of Object.keys(P))P[ee]=y(P[ee]);const X=new we(we.formatError(R.message||x,P),e,P.path,R.type||u,P.disableStackTrace);return X.params=P,X}const O=T?l:c;let _={path:s,parent:E,type:u,from:n.from,createError:N,resolve:y,options:n,originalValue:a,schema:o};const D=R=>{we.isError(R)?O(R):R?c(null):O(N())},Q=R=>{we.isError(R)?O(R):l(R)};if(b&&Ve(e))return D(!0);let W;try{var G;if(W=f.call(_,e,_),typeof((G=W)==null?void 0:G.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(W).then(D,Q)}}catch(R){Q(R);return}D(W)}return t.OPTIONS=r,t}function Ko(r,t,e,s=e){let n,a,o;return t?(Ze.forEach(t,(l,c,u)=>{let f=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:e});let p=r.type==="tuple",x=u?parseInt(f,10):0;if(r.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(e&&x>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);n=e,e=e&&e[x],r=p?r.spec.types[x]:r.innerType}if(!u){if(!r.fields||!r.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${r.type}")`);n=e,e=e&&e[f],r=r.fields[f]}a=f,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:t,schema:r}}class Ot extends Set{describe(){const t=[];for(const e of this.values())t.push(Ge.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const s of this.values())e.push(t(s));return e}clone(){return new Ot(this.values())}merge(t,e){const s=this.clone();return t.forEach(n=>s.add(n)),e.forEach(n=>s.delete(n)),s}}function Ke(r,t=new Map){if(ur(r)||!r||typeof r!="object")return r;if(t.has(r))return t.get(r);let e;if(r instanceof Date)e=new Date(r.getTime()),t.set(r,e);else if(r instanceof RegExp)e=new RegExp(r),t.set(r,e);else if(Array.isArray(r)){e=new Array(r.length),t.set(r,e);for(let s=0;s<r.length;s++)e[s]=Ke(r[s],t)}else if(r instanceof Map){e=new Map,t.set(r,e);for(const[s,n]of r.entries())e.set(s,Ke(n,t))}else if(r instanceof Set){e=new Set,t.set(r,e);for(const s of r)e.add(Ke(s,t))}else if(r instanceof Object){e={},t.set(r,e);for(const[s,n]of Object.entries(r))e[s]=Ke(n,t)}else throw Error(`Unable to clone ${r}`);return e}class Ne{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ot,this._blacklist=new Ot,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Te.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=Ke(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=e,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,s=t.clone();const n=Object.assign({},e.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},e.internalTests,s.internalTests),s._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),s.tests=e.tests,s.exclusiveTests=e.exclusiveTests,s.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...e.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let s=e.conditions;e=e.clone(),e.conditions=[],e=s.reduce((n,a)=>a.resolve(n,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,s,n,a;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=t.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,e={}){let s=this.resolve(Object.assign({value:t},e)),n=e.assert==="ignore-optionality",a=s._cast(t,e);if(e.assert!==!1&&!s.isType(a)){if(n&&Ve(a))return a;let o=ze(t),l=ze(a);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
26
|
+
text-ds-lg`,children:r}),t&&i.jsx("div",{className:"flex items-center space-x-2",children:t})]}),i.jsx("main",{className:"flex-1 overflow-auto",children:e})]})}function Ps({options:r,value:t,onChange:e,children:s}){const n=y.useRef(null),[a,o]=y.useState({left:0,width:0});return y.useLayoutEffect(()=>{const l=n.current;if(!l)return;const c=()=>{const d=r.findIndex(T=>T.value===t);if(d<0)return;const f=l.children[d],p=f.querySelector("span"),x=(p==null?void 0:p.offsetWidth)??f.offsetWidth,b=f.offsetWidth,j=f.offsetLeft+(b-x)/2;o({left:j,width:x})};return c(),window.addEventListener("resize",c),l.addEventListener("scroll",c),()=>{window.removeEventListener("resize",c),l.removeEventListener("scroll",c)}},[t,r]),i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("ul",{ref:n,role:"tablist",className:"flex justify-center overflow-x-auto border-b border-[var(--color-ds-border-default-50)]",children:r.map(l=>{const c=l.value===t;return i.jsx("li",{role:"tab","aria-selected":c,onClick:()=>e(l.value),className:L("cursor-pointer whitespace-nowrap px-4 py-2 transition-colors duration-150 ease-in-out",c?"text-[var(--color-ds-background-accent)]":"text-[var(--color-ds-text-primary)]"),children:i.jsx("span",{className:"inline-block",children:l.label})},l.value)})}),i.jsx("span",{className:"absolute bottom-0 h-1 bg-[var(--color-ds-background-accent)] transition-all duration-200 ease-in-out rounded-t-full",style:{left:a.left,width:a.width}})]}),i.jsx("div",{className:"mt-4 pb-4 border-b border-[var(--color-ds-border-default-50)]",children:s[t]})]})}const Kt={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},jo={sm:"h-6",md:"h-10",lg:"h-12"},Eo={sm:"px-2",md:"px-2.5",lg:"px-3"},Ur={sm:"1.5rem",md:"2.5rem",lg:"3rem"};function Br(r,t,e,s,n,a,o,l,c){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative flex items-center w-full",children:[i.jsx("select",{id:r,...s,disabled:n,className:L("box-border w-full rounded-lg border bg-[var(--color-ds-background-page)] outline-none transition font-[var(--font-primary)]",Kt[e],jo[e],Eo[e],a?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",n?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-primary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]",l),children:t.map(d=>i.jsx("option",{value:d.value,className:"bg-[var(--color-ds-background-page)] text-[var(--color-ds-text-primary)]",children:d.label},d.value))}),c&&i.jsx("div",{className:"flex items-center h-full pr-2",children:c})]}),!o&&i.jsx("div",{className:"min-h-[18px] w-full",children:a!=null&&a.message?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:a.message}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}function ct(r){const{control:t,name:e,rules:s,defaultValue:n,options:a=[],loadOptions:o,reloadDeps:l=[],value:c,onChange:d,size:f="sm",width:p="100%",label:x,labelHidden:b=!1,hasError:_=!1,errorMessage:j="",disableErrorPlaceholder:T=!1,disabled:w=!1,className:v,suffixButton:S}=r,M=y.useId(),N=e||M,[P,G]=y.useState(a),[F,W]=y.useState(!!o);if(y.useEffect(()=>{o&&(W(!0),o().then(Z=>G(Z)).finally(()=>W(!1)))},[o,...l]),y.useEffect(()=>{!t&&P.length>0&&(c===void 0||c===""||!P.some(Z=>Z.value===c))&&(d==null||d(P[0].value))},[P,c,d,t]),t&&e){const{field:Z,fieldState:$}=Ss({name:e,control:t,rules:s,defaultValue:n});return y.useEffect(()=>{if(!F&&P.length>0){const I=Z.value;(I===void 0||!P.some(K=>K.value===I))&&Z.onChange(P[0].value)}},[P,F,Z]),i.jsxs("div",{className:L("flex flex-col",v),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:N,className:L("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),F?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(N,P,f,{value:Z.value,onChange:I=>Z.onChange(I.target.value)},w,$.error,T,v,S)]})}return i.jsxs("div",{className:L("flex flex-col",v),style:{width:p,maxWidth:"100%"},children:[x&&i.jsx("label",{htmlFor:N,className:L("pb-2 text-[var(--color-ds-text-primary)]",Kt[f],b&&"sr-only"),children:x}),F?i.jsx(qe,{width:"100%",height:Ur[f],variant:"rect",className:"rounded-lg"}):Br(N,P,f,{value:c,onChange:Z=>d==null?void 0:d(Z.target.value)},w,_?{message:j}:void 0,T,v,S)]})}const Wr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"};function zs({groupLabel:r,inputs:t=[],separator:e=i.jsx("span",{className:"px-1 select-none",children:"/"}),useSeparator:s=!0,className:n,showVisibleLabel:a=!1,size:o="sm",width:l}){const c=t.length;return i.jsxs("div",{className:L("flex flex-col",n),style:l?{width:l}:void 0,children:[i.jsx("label",{className:L("sr-only pb-2",Wr[o]),children:r}),a&&i.jsx("label",{className:L("pb-2",Wr[o]),children:r}),i.jsx("div",{className:"flex items-center flex-nowrap",children:t.map((d,f)=>{const{width:p,className:x,options:b,loadOptions:_,...j}=d,T=Array.isArray(b)||typeof _=="function";let w="rounded-lg";!s&&c>1&&(f===0?w="rounded-l-lg rounded-r-none":f===c-1?w="rounded-r-lg rounded-l-none":w="rounded-none");const v=L("inline-flex items-center flex-shrink-0 overflow-hidden",typeof p=="string"&&p.startsWith("w-")?p:void 0),S=typeof p=="string"&&!p.startsWith("w-")?{width:p}:void 0,M=L(x,w);return i.jsxs("div",{className:v,style:S,children:[T?i.jsx(ct,{...j,size:o,className:M,options:b,loadOptions:_}):i.jsx(Rt,{...j,size:o,className:M}),s&&f<c-1&&e]},f)})})]})}const Zr={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},No={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function Us({groupLabel:r,options:t,control:e,name:s,rules:n,defaultValue:a,multiple:o=!0,size:l="sm",vertical:c=!0,className:d,showVisibleLabel:f=!0}){return i.jsx(Fe,{name:s,control:e,rules:n,defaultValue:a,render:({field:p,fieldState:x})=>{const{value:b,onChange:_}=p;x.error;const j=w=>o?Array.isArray(b)&&b.includes(w):b===w,T=w=>{if(o){const v=Array.isArray(b)?[...b]:[],S=v.indexOf(w);S>=0?v.splice(S,1):v.push(w),_(v)}else _(w)};return i.jsxs("div",{className:L("w-full",d),children:[i.jsx("label",{className:L("sr-only pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),f&&i.jsx("label",{className:L("block pb-2 text-[var(--color-ds-text-primary)]",Zr[l]),children:r}),i.jsx("div",{className:L(c?"flex flex-col gap-2":"flex flex-wrap gap-4"),children:t.map(w=>i.jsxs("label",{className:"inline-flex items-center space-x-2 cursor-pointer select-none",children:[i.jsx("input",{type:o?"checkbox":"radio",name:s,value:w.value,checked:j(w.value),onChange:()=>T(w.value),className:L(No[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]")}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-md",children:w.label})]},w.value))})]})}})}function So(r){function t(o){var l,c;for(const d of Object.keys(o)){if((l=o[d])!=null&&l.types||(c=o[d])!=null&&c.message)return d;if(typeof o[d]=="object"){const f=t(o[d]);if(f)return`${d}.${f}`}}return null}const e=t(r);if(!e)return;const s=`[name="${e}"]`,n=`[name^="${e}["], [name^="${e}."]`,a=document.querySelector(s)??document.querySelector(n);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.focus({preventScroll:!0}))}const _o={success:"bg-green-100 border-green-500 text-green-800",error:"bg-red-100 border-red-500 text-red-800",info:"bg-blue-100 border-blue-500 text-blue-800",warning:"bg-yellow-100 border-yellow-500 text-yellow-800"},Bs=({id:r,message:t,variant:e="info",duration:s=5e3,onClose:n})=>(y.useEffect(()=>{const a=setTimeout(()=>n(r),s);return()=>clearTimeout(a)},[r,s,n]),i.jsxs("div",{className:L("w-80 max-w-full border-l-4 rounded shadow-md p-4 mb-2 flex justify-between items-start",_o[e]),role:"alert","aria-live":"assertive",children:[i.jsx("span",{className:"flex-1",children:t}),i.jsx("button",{onClick:()=>n(r),className:"ml-4 text-xl font-bold leading-none focus:outline-none",children:"×"})]}));let vt;const Fo=new Uint8Array(16);function To(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(Fo)}const xe=[];for(let r=0;r<256;++r)xe.push((r+256).toString(16).slice(1));function Co(r,t=0){return xe[r[t+0]]+xe[r[t+1]]+xe[r[t+2]]+xe[r[t+3]]+"-"+xe[r[t+4]]+xe[r[t+5]]+"-"+xe[r[t+6]]+xe[r[t+7]]+"-"+xe[r[t+8]]+xe[r[t+9]]+"-"+xe[r[t+10]]+xe[r[t+11]]+xe[r[t+12]]+xe[r[t+13]]+xe[r[t+14]]+xe[r[t+15]]}const Ao=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qr={randomUUID:Ao};function Oo(r,t,e){if(qr.randomUUID&&!r)return qr.randomUUID();r=r||{};const s=r.random||(r.rng||To)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Co(s)}const Ws=y.createContext(null),Zs=()=>{const r=y.useContext(Ws);if(!r)throw new Error("useToast debe usarse dentro de <ToastProvider>");return r},Ro=({children:r})=>{const[t,e]=y.useState([]),s=(a,o="info",l=5e3)=>{const c=Oo();e(d=>[...d,{id:c,message:a,variant:o,duration:l}])},n=a=>{e(o=>o.filter(l=>l.id!==a))};return i.jsxs(Ws.Provider,{value:{show:s},children:[r,i.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col items-end",children:t.map(a=>i.jsx(Bs,{id:a.id,message:a.message,variant:a.variant,duration:a.duration,onClose:n},a.id))})]})},Gr=(r,t,e)=>{if(r&&"reportValidity"in r){const s=O(e,t);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},qs=(r,t)=>{for(const e in t.fields){const s=t.fields[e];s&&s.ref&&"reportValidity"in s.ref?Gr(s.ref,e,r):s&&s.refs&&s.refs.forEach(n=>Gr(n,e,r))}},Mo=(r,t)=>{t.shouldUseNativeValidation&&qs(r,t);const e={};for(const s in r){const n=O(t.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(Vo(t.names||Object.keys(r),s)){const o=Object.assign({},O(e,s));oe(o,"root",a),oe(e,s,o)}else oe(e,s,a)}return e},Vo=(r,t)=>{const e=Hr(t);return r.some(s=>Hr(s).match(`^${e}\\.\\d+`))};function Hr(r){return r.replace(/\]|\[/g,"")}function Yr(r,t,e){return e===void 0&&(e={}),function(s,n,a){try{return Promise.resolve(function(o,l){try{var c=(t!=null&&t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(r[e.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},t,{context:n}))).then(function(d){return a.shouldUseNativeValidation&&qs({},a),{values:e.raw?Object.assign({},s):d,errors:{}}}))}catch(d){return l(d)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(!o.inner)throw o;return{values:{},errors:Mo((l=o,c=!a.shouldUseNativeValidation&&a.criteriaMode==="all",(l.inner||[]).reduce(function(d,f){if(d[f.path]||(d[f.path]={message:f.message,type:f.type}),c){var p=d[f.path].types,x=p&&p[f.type];d[f.path]=_s(f.path,c,d,f.type,x?[].concat(x,f.message):f.message)}return d},{})),a)};var l,c}))}catch(o){return Promise.reject(o)}}}var Pt,Xr;function $o(){if(Xr)return Pt;Xr=1;function r(w){this._maxSize=w,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(w){return this._values[w]},r.prototype.set=function(w,v){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=v};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,e=/^\d+$/,s=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,l=new r(o),c=new r(o),d=new r(o);Pt={Cache:r,split:p,normalizePath:f,setter:function(w){var v=f(w);return c.get(w)||c.set(w,function(M,N){for(var P=0,G=v.length,F=M;P<G-1;){var W=v[P];if(W==="__proto__"||W==="constructor"||W==="prototype")return M;F=F[v[P++]]}F[v[P]]=N})},getter:function(w,v){var S=f(w);return d.get(w)||d.set(w,function(N){for(var P=0,G=S.length;P<G;)if(N!=null||!v)N=N[S[P++]];else return;return N})},join:function(w){return w.reduce(function(v,S){return v+(b(S)||e.test(S)?"["+S+"]":(v?".":"")+S)},"")},forEach:function(w,v,S){x(Array.isArray(w)?w:p(w),v,S)}};function f(w){return l.get(w)||l.set(w,p(w).map(function(v){return v.replace(a,"$2")}))}function p(w){return w.match(t)||[""]}function x(w,v,S){var M=w.length,N,P,G,F;for(P=0;P<M;P++)N=w[P],N&&(T(N)&&(N='"'+N+'"'),F=b(N),G=!F&&/^\d+$/.test(N),v.call(S,N,F,G,P,w))}function b(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function _(w){return w.match(s)&&!w.match(e)}function j(w){return n.test(w)}function T(w){return!b(w)&&(_(w)||j(w))}return Pt}var Ze=$o(),zt,Kr;function Do(){if(Kr)return zt;Kr=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=f=>f.match(r)||[],e=f=>f[0].toUpperCase()+f.slice(1),s=(f,p)=>t(f).join(p).toLowerCase(),n=f=>t(f).reduce((p,x)=>`${p}${p?x[0].toUpperCase()+x.slice(1).toLowerCase():x.toLowerCase()}`,"");return zt={words:t,upperFirst:e,camelCase:n,pascalCase:f=>e(n(f)),snakeCase:f=>s(f,"_"),kebabCase:f=>s(f,"-"),sentenceCase:f=>e(s(f," ")),titleCase:f=>t(f).map(e).join(" ")},zt}var Ut=Do(),wt={exports:{}},Jr;function Io(){if(Jr)return wt.exports;Jr=1,wt.exports=function(n){return r(t(n),n)},wt.exports.array=r;function r(n,a){var o=n.length,l=new Array(o),c={},d=o,f=e(a),p=s(n);for(a.forEach(function(b){if(!p.has(b[0])||!p.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)c[d]||x(n[d],d,new Set);return l;function x(b,_,j){if(j.has(b)){var T;try{T=", node was:"+JSON.stringify(b)}catch{T=""}throw new Error("Cyclic dependency"+T)}if(!p.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[_]){c[_]=!0;var w=f.get(b)||new Set;if(w=Array.from(w),_=w.length){j.add(b);do{var v=w[--_];x(v,p.get(v),j)}while(_);j.delete(b)}l[--o]=b}}}function t(n){for(var a=new Set,o=0,l=n.length;o<l;o++){var c=n[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function e(n){for(var a=new Map,o=0,l=n.length;o<l;o++){var c=n[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function s(n){for(var a=new Map,o=0,l=n.length;o<l;o++)a.set(n[o],o);return a}return wt.exports}var Lo=Io();const Po=kn(Lo),zo=Object.prototype.toString,Uo=Error.prototype.toString,Bo=RegExp.prototype.toString,Wo=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Zo=/^Symbol\((.*)\)(.*)$/;function qo(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Qr(r,t=!1){if(r==null||r===!0||r===!1)return""+r;const e=typeof r;if(e==="number")return qo(r);if(e==="string")return t?`"${r}"`:r;if(e==="function")return"[Function "+(r.name||"anonymous")+"]";if(e==="symbol")return Wo.call(r).replace(Zo,"Symbol($1)");const s=zo.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Uo.call(r)+"]":s==="RegExp"?Bo.call(r):null}function ze(r,t){let e=Qr(r,t);return e!==null?e:JSON.stringify(r,function(s,n){let a=Qr(this[s],t);return a!==null?a:n},2)}function Gs(r){return r==null?[]:[].concat(r)}let Hs,Ys,Xs,Go=/\$\{\s*(\w+)\s*\}/g;Hs=Symbol.toStringTag;class es{constructor(t,e,s,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Hs]="Error",this.name="ValidationError",this.value=e,this.path=s,this.type=n,this.errors=[],this.inner=[],Gs(t).forEach(a=>{if(we.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ys=Symbol.hasInstance;Xs=Symbol.toStringTag;class we extends Error{static formatError(t,e){const s=e.label||e.path||"this";return e=Object.assign({},e,{path:s,originalPath:e.path}),typeof t=="string"?t.replace(Go,(n,a)=>ze(e[a])):typeof t=="function"?t(e):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,e,s,n,a){const o=new es(t,e,s,n);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Xs]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,we)}static[Ys](t){return es[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Te={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:t,value:e,originalValue:s})=>{const n=s!=null&&s!==e?` (cast from the value \`${ze(s,!0)}\`).`:".";return t!=="mixed"?`${r} must be a \`${t}\` type, but the final value was: \`${ze(e,!0)}\``+n:`${r} must match the configured type. The validated value was: \`${ze(e,!0)}\``+n}},ve={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Le={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Jt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ho={isValue:"${path} field must be ${value}"},Et={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Yo={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Xo={notType:r=>{const{path:t,value:e,spec:s}=r,n=s.types.length;if(Array.isArray(e)){if(e.length<n)return`${t} tuple value has too few items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``;if(e.length>n)return`${t} tuple value has too many items, expected a length of ${n} but got ${e.length} for value: \`${ze(e,!0)}\``}return we.formatError(Te.notType,r)}};Object.assign(Object.create(null),{mixed:Te,string:ve,number:Le,date:Jt,object:Et,array:Yo,boolean:Ho,tuple:Xo});const dr=r=>r&&r.__isYupSchema__;class Ct{static fromOptions(t,e){if(!e.then&&!e.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:n,otherwise:a}=e,o=typeof s=="function"?s:(...l)=>l.every(c=>c===s);return new Ct(t,(l,c)=>{var d;let f=o(...l)?n:a;return(d=f==null?void 0:f(c))!=null?d:c})}constructor(t,e){this.fn=void 0,this.refs=t,this.refs=t,this.fn=e}resolve(t,e){let s=this.refs.map(a=>a.getValue(e==null?void 0:e.value,e==null?void 0:e.parent,e==null?void 0:e.context)),n=this.fn(s,t,e);if(n===void 0||n===t)return t;if(!dr(n))throw new TypeError("conditions must return a schema object");return n.resolve(e)}}const kt={context:"$",value:"."};class Ge{constructor(t,e={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===kt.context,this.isValue=this.key[0]===kt.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?kt.context:this.isValue?kt.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&Ze.getter(this.path,!0),this.map=e.map}getValue(t,e,s){let n=this.isContext?s:this.isValue?t:e;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(t,e){return this.getValue(t,e==null?void 0:e.parent,e==null?void 0:e.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ge.prototype.__isYupRef=!0;const Ve=r=>r==null;function Xe(r){function t({value:e,path:s="",options:n,originalValue:a,schema:o},l,c){const{name:d,test:f,params:p,message:x,skipAbsent:b}=r;let{parent:_,context:j,abortEarly:T=o.spec.abortEarly,disableStackTrace:w=o.spec.disableStackTrace}=n;function v($){return Ge.isRef($)?$.getValue(e,_,j):$}function S($={}){const I=Object.assign({value:e,originalValue:a,label:o.spec.label,path:$.path||s,spec:o.spec,disableStackTrace:$.disableStackTrace||w},p,$.params);for(const J of Object.keys(I))I[J]=v(I[J]);const K=new we(we.formatError($.message||x,I),e,I.path,$.type||d,I.disableStackTrace);return K.params=I,K}const M=T?l:c;let N={path:s,parent:_,type:d,from:n.from,createError:S,resolve:v,options:n,originalValue:a,schema:o};const P=$=>{we.isError($)?M($):$?c(null):M(S())},G=$=>{we.isError($)?M($):l($)};if(b&&Ve(e))return P(!0);let W;try{var Z;if(W=f.call(N,e,N),typeof((Z=W)==null?void 0:Z.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${N.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(W).then(P,G)}}catch($){G($);return}P(W)}return t.OPTIONS=r,t}function Ko(r,t,e,s=e){let n,a,o;return t?(Ze.forEach(t,(l,c,d)=>{let f=c?l.slice(1,l.length-1):l;r=r.resolve({context:s,parent:n,value:e});let p=r.type==="tuple",x=d?parseInt(f,10):0;if(r.innerType||p){if(p&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(e&&x>=e.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);n=e,e=e&&e[x],r=p?r.spec.types[x]:r.innerType}if(!d){if(!r.fields||!r.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${r.type}")`);n=e,e=e&&e[f],r=r.fields[f]}a=f,o=c?"["+l+"]":"."+l}),{schema:r,parent:n,parentPath:a}):{parent:n,parentPath:t,schema:r}}class At extends Set{describe(){const t=[];for(const e of this.values())t.push(Ge.isRef(e)?e.describe():e);return t}resolveAll(t){let e=[];for(const s of this.values())e.push(t(s));return e}clone(){return new At(this.values())}merge(t,e){const s=this.clone();return t.forEach(n=>s.add(n)),e.forEach(n=>s.delete(n)),s}}function Ke(r,t=new Map){if(dr(r)||!r||typeof r!="object")return r;if(t.has(r))return t.get(r);let e;if(r instanceof Date)e=new Date(r.getTime()),t.set(r,e);else if(r instanceof RegExp)e=new RegExp(r),t.set(r,e);else if(Array.isArray(r)){e=new Array(r.length),t.set(r,e);for(let s=0;s<r.length;s++)e[s]=Ke(r[s],t)}else if(r instanceof Map){e=new Map,t.set(r,e);for(const[s,n]of r.entries())e.set(s,Ke(n,t))}else if(r instanceof Set){e=new Set,t.set(r,e);for(const s of r)e.add(Ke(s,t))}else if(r instanceof Object){e={},t.set(r,e);for(const[s,n]of Object.entries(r))e[s]=Ke(n,t)}else throw Error(`Unable to clone ${r}`);return e}class Ne{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new At,this._blacklist=new At,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Te.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const e=Object.create(Object.getPrototypeOf(this));return e.type=this.type,e._typeCheck=this._typeCheck,e._whitelist=this._whitelist.clone(),e._blacklist=this._blacklist.clone(),e.internalTests=Object.assign({},this.internalTests),e.exclusiveTests=Object.assign({},this.exclusiveTests),e.deps=[...this.deps],e.conditions=[...this.conditions],e.tests=[...this.tests],e.transforms=[...this.transforms],e.spec=Ke(Object.assign({},this.spec,t)),e}label(t){let e=this.clone();return e.spec.label=t,e}meta(...t){if(t.length===0)return this.spec.meta;let e=this.clone();return e.spec.meta=Object.assign(e.spec.meta||{},t[0]),e}withMutation(t){let e=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=e,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let e=this,s=t.clone();const n=Object.assign({},e.spec,s.spec);return s.spec=n,s.internalTests=Object.assign({},e.internalTests,s.internalTests),s._whitelist=e._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=e._blacklist.merge(t._blacklist,t._whitelist),s.tests=e.tests,s.exclusiveTests=e.exclusiveTests,s.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),s.transforms=[...e.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let e=this;if(e.conditions.length){let s=e.conditions;e=e.clone(),e.conditions=[],e=s.reduce((n,a)=>a.resolve(n,t),e),e=e.resolve(t)}return e}resolveOptions(t){var e,s,n,a;return Object.assign({},t,{from:t.from||[],strict:(e=t.strict)!=null?e:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(n=t.recursive)!=null?n:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,e={}){let s=this.resolve(Object.assign({value:t},e)),n=e.assert==="ignore-optionality",a=s._cast(t,e);if(e.assert!==!1&&!s.isType(a)){if(n&&Ve(a))return a;let o=ze(t),l=ze(a);throw new TypeError(`The value of ${e.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
27
27
|
|
|
28
28
|
attempted value: ${o}
|
|
29
|
-
`+(l!==o?`result of cast: ${l}`:""))}return a}_cast(t,e){let s=t===void 0?t:this.transforms.reduce((n,a)=>a.call(this,n,t,this),t);return s===void 0&&(s=this.getDefault(e)),s}_validate(t,e={},s,n){let{path:a,originalValue:o=t,strict:l=this.spec.strict}=e,c=t;l||(c=this._cast(c,Object.assign({assert:!1},e)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:a,value:c,originalValue:o,options:e,tests:u},s,f=>{if(f.length)return n(f,c);this.runTests({path:a,value:c,originalValue:o,options:e,tests:this.tests},s,n)})}runTests(t,e,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:u}=t,f=j=>{n||(n=!0,e(j,o))},p=j=>{n||(n=!0,s(j,o))},x=a.length,b=[];if(!x)return p([]);let E={value:o,originalValue:l,path:c,options:u,schema:this};for(let j=0;j<a.length;j++){const T=a[j];T(E,f,function(y){y&&(Array.isArray(y)?b.push(...y):b.push(y)),--x<=0&&p(b)})}}asNestedTest({key:t,index:e,parent:s,parentPath:n,originalParent:a,options:o}){const l=t??e;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let u=s[l];const f=Object.assign({},o,{strict:!0,parent:s,value:u,originalValue:a[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${n||""}[${c?l:`"${l}"`}]`:(n?`${n}.`:"")+t});return(p,x,b)=>this.resolve(f)._validate(u,f,x,b)}validate(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(t,e,(c,u)=>{we.isError(c)&&(c.value=u),l(c)},(c,u)=>{c.length?l(new we(c,u,void 0,void 0,a)):o(u)}))}validateSync(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a,o=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(t,Object.assign({},e,{sync:!0}),(l,c)=>{throw we.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new we(l,t,void 0,void 0,o);a=c}),a}isValid(t,e){return this.validate(t,e).then(()=>!0,s=>{if(we.isError(s))return!1;throw s})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(s){if(we.isError(s))return!1;throw s}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):Ke(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const s=this.clone({nullable:t});return s.internalTests.nullable=Xe({message:e,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(t,e){const s=this.clone({optional:t});return s.internalTests.optionality=Xe({message:e,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=Te.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Te.notNull){return this.nullability(!1,t)}required(t=Te.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=Te.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Xe(e),a=e.exclusive||e.name&&s.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(s.exclusiveTests[e.name]=!!e.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===e.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let s=this.clone(),n=Gs(t).map(a=>new Ge(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof e=="function"?new Ct(n,e):Ct.fromOptions(n,e)),s}typeError(t){let e=this.clone();return e.internalTests.typeError=Xe({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=Te.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Xe({message:e,name:"oneOf",skipAbsent:!0,test(n){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),s}notOneOf(t,e=Te.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Xe({message:e,name:"notOneOf",test(n){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),s}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:s,meta:n,optional:a,nullable:o}=e.spec;return{meta:n,label:s,optional:a,nullable:o,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,u,f)=>f.findIndex(p=>p.name===c.name)===u)}}}Ne.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ne.prototype[`${r}At`]=function(t,e,s={}){const{parent:n,parentPath:a,schema:o}=Ko(this,t,e,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:t}))};for(const r of["equals","is"])Ne.prototype[r]=Ne.prototype.oneOf;for(const r of["not","nope"])Ne.prototype[r]=Ne.prototype.notOneOf;const Jo=()=>!0;function Qt(r){return new Ks(r)}class Ks extends Ne{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Jo},t))}}Qt.prototype=Ks.prototype;const Qo=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ei(r){const t=er(r);if(!t)return Date.parse?Date.parse(r):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function er(r){var t,e;const s=Qo.exec(r);return s?{year:Re(s[1]),month:Re(s[2],1)-1,day:Re(s[3],1),hour:Re(s[4]),minute:Re(s[5]),second:Re(s[6]),millisecond:s[7]?Re(s[7].substring(0,3)):0,precision:(t=(e=s[7])==null?void 0:e.length)!=null?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Re(s[10]),minuteOffset:Re(s[11])}:null}function Re(r,t=0){return Number(r)||t}let ti=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ri=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,si=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ni="^\\d{4}-\\d{2}-\\d{2}",ai="\\d{2}:\\d{2}:\\d{2}",oi="(([+-]\\d{2}(:?\\d{2})?)|Z)",ii=new RegExp(`${ni}T${ai}(\\.\\d+)?${oi}$`),li=r=>Ve(r)||r===r.trim(),ci={}.toString();function Js(){return new Qs}class Qs extends Ne{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===ci?t:n})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||Te.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=ve.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,e=ve.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,e=ve.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,e){let s=!1,n,a;return e&&(typeof e=="object"?{excludeEmptyString:s=!1,message:n,name:a}=e:n=e),this.test({name:a||"matches",message:n||ve.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&s||o.search(t)!==-1})}email(t=ve.email){return this.matches(ti,{name:"email",message:t,excludeEmptyString:!0})}url(t=ve.url){return this.matches(ri,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ve.uuid){return this.matches(si,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",s,n;return t&&(typeof t=="object"?{message:e="",allowOffset:s=!1,precision:n=void 0}=t:e=t),this.matches(ii,{name:"datetime",message:e||ve.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||ve.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=er(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:e||ve.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=er(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ve.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:li})}lowercase(t=ve.lowercase){return this.transform(e=>Ve(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toLowerCase()})}uppercase(t=ve.uppercase){return this.transform(e=>Ve(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toUpperCase()})}}Js.prototype=Qs.prototype;let di=r=>r!=+r;function en(){return new tn}class tn extends Ne{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!di(t)}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce)return t;let n=t;if(typeof n=="string"){if(n=n.replace(/\s/g,""),n==="")return NaN;n=+n}return s.isType(n)||n===null?n:parseFloat(n)})})}min(t,e=Le.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(t)}})}max(t,e=Le.max){return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(t)}})}lessThan(t,e=Le.lessThan){return this.test({message:e,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(s){return s<this.resolve(t)}})}moreThan(t,e=Le.moreThan){return this.test({message:e,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(s){return s>this.resolve(t)}})}positive(t=Le.positive){return this.moreThan(0,t)}negative(t=Le.negative){return this.lessThan(0,t)}integer(t=Le.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(t=>Ve(t)?t:t|0)}round(t){var e;let s=["ceil","floor","round","trunc"];if(t=((e=t)==null?void 0:e.toLowerCase())||"round",t==="trunc")return this.truncate();if(s.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ve(n)?n:Math[t](n))}}en.prototype=tn.prototype;let rn=new Date(""),ui=r=>Object.prototype.toString.call(r)==="[object Date]";function fr(){return new ft}class ft extends Ne{constructor(){super({type:"date",check(t){return ui(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=ei(t),isNaN(t)?ft.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let s;if(Ge.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,e=Jt.min){let s=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(t,e=Jt.max){let s=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}ft.INVALID_DATE=rn;fr.prototype=ft.prototype;fr.INVALID_DATE=rn;function fi(r,t=[]){let e=[],s=new Set,n=new Set(t.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=Ze.split(o)[0];s.add(c),n.has(`${l}-${c}`)||e.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Ge.isRef(l)&&l.isSibling?a(l.path,o):ur(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return Po.array(Array.from(s),e).reverse()}function ts(r,t){let e=1/0;return r.some((s,n)=>{var a;if((a=t.path)!=null&&a.includes(s))return e=n,!0}),e}function sn(r){return(t,e)=>ts(r,t)-ts(r,e)}const hi=(r,t,e)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return e.isType(s)?s:r};function Nt(r){if("fields"in r){const t={};for(const[e,s]of Object.entries(r.fields))t[e]=Nt(s);return r.setFields(t)}if(r.type==="array"){const t=r.optional();return t.innerType&&(t.innerType=Nt(t.innerType)),t}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Nt)}):"optional"in r?r.optional():r}const mi=(r,t)=>{const e=[...Ze.normalizePath(t)];if(e.length===1)return e[0]in r;let s=e.pop(),n=Ze.getter(Ze.join(e),!0)(r);return!!(n&&s in n)};let rs=r=>Object.prototype.toString.call(r)==="[object Object]";function ss(r,t){let e=Object.keys(r.fields);return Object.keys(t).filter(s=>e.indexOf(s)===-1)}const pi=sn([]);function nn(r){return new an(r)}class an extends Ne{constructor(t){super({type:"object",check(e){return rs(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=pi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var s;let n=super._cast(t,e);if(n===void 0)return this.getDefault(e);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=e.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(p=>!this._nodes.includes(p))),c={},u=Object.assign({},e,{parent:c,__validating:e.__validating||!1}),f=!1;for(const p of l){let x=a[p],b=p in n;if(x){let E,j=n[p];u.path=(e.path?`${e.path}.`:"")+p,x=x.resolve({value:j,context:e.context,parent:c});let T=x instanceof Ne?x.spec:void 0,w=T==null?void 0:T.strict;if(T!=null&&T.strip){f=f||p in n;continue}E=!e.__validating||!w?x.cast(n[p],u):n[p],E!==void 0&&(c[p]=E)}else b&&!o&&(c[p]=n[p]);(b!==p in c||c[p]!==n[p])&&(f=!0)}return f?c:n}_validate(t,e={},s,n){let{from:a=[],originalValue:o=t,recursive:l=this.spec.recursive}=e;e.from=[{schema:this,value:o},...a],e.__validating=!0,e.originalValue=o,super._validate(t,e,s,(c,u)=>{if(!l||!rs(u)){n(c,u);return}o=o||u;let f=[];for(let p of this._nodes){let x=this.fields[p];!x||Ge.isRef(x)||f.push(x.asNestedTest({options:e,key:p,parent:u,parentPath:e.path,originalParent:o}))}this.runTests({tests:f,value:u,originalValue:o,options:e},s,p=>{n(p.sort(this._sortErrors).concat(c),u)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),s=e.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return e.withMutation(n=>n.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=t;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),e[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),e}setFields(t,e){let s=this.clone();return s.fields=t,s._nodes=fi(t,e),s._sortErrors=sn(Object.keys(t)),e&&(s._excludedEdges=e),s}shape(t,e=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...s._excludedEdges,...e]),s.setFields(Object.assign(s.fields,t),n)})}partial(){const t={};for(const[e,s]of Object.entries(this.fields))t[e]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return Nt(this)}pick(t){const e={};for(const s of t)this.fields[s]&&(e[s]=this.fields[s]);return this.setFields(e,this._excludedEdges.filter(([s,n])=>t.includes(s)&&t.includes(n)))}omit(t){const e=[];for(const s of Object.keys(this.fields))t.includes(s)||e.push(s);return this.pick(e)}from(t,e,s){let n=Ze.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return mi(a,t)&&(o=Object.assign({},a),s||delete o[t],o[e]=n(a)),o})}json(){return this.transform(hi)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Et.exact,test(e){if(e==null)return!0;const s=ss(this.schema,e);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Et.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:e,test(n){if(n==null)return!0;const a=ss(this.schema,n);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,e=Et.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const s={};for(const n of Object.keys(e))s[t(n)]=e[n];return s})}camelCase(){return this.transformKeys(Ut.camelCase)}snakeCase(){return this.transformKeys(Ut.snakeCase)}constantCase(){return this.transformKeys(t=>Ut.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[a,o]of Object.entries(e.fields)){var n;let l=t;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}nn.prototype=an.prototype;function xi({fields:r,explicitSchema:t}){return v.useMemo(()=>{if(t)return Yr(t);const e={};r.forEach(n=>{var o,l,c,u,f,p,x;let a;switch(n.type){case"text":case"password":case"email":if(a=Js(),(o=n.validation)!=null&&o.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}(l=n.validation)!=null&&l.minLength&&(a=a.min(n.validation.minLength.value,n.validation.minLength.message)),(c=n.validation)!=null&&c.maxLength&&(a=a.max(n.validation.maxLength.value,n.validation.maxLength.message)),(u=n.validation)!=null&&u.pattern&&(a=a.matches(n.validation.pattern.value,n.validation.pattern.message)),n.type==="email"&&(a=a.email("Email inválido"));break;case"number":if(a=en(),(f=n.validation)!=null&&f.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"select":case"optionGroup":if(a=Qt(),(p=n.validation)!=null&&p.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"date":if(a=fr(),(x=n.validation)!=null&&x.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;default:a=Qt()}e[n.name]=a});const s=nn().shape(e);return Yr(s)},[r,t])}function gi(r){return v.useMemo(()=>{const t={};return r.forEach(e=>{t[e.name]=e}),t},[r])}function bi(r){const t=v.useMemo(()=>r.filter(o=>o.type==="select"&&o.loadOptions),[r]),[e,s]=v.useState(t.length),[n,a]=v.useState({});return v.useEffect(()=>{t.length!==0&&t.forEach(o=>{o.loadOptions().then(l=>a(c=>({...c,[o.name]:l}))).finally(()=>s(l=>Math.max(0,l-1)))})},[t]),{loadingCount:e,optionsMap:n}}function yi(r,t){const e=v.useMemo(()=>r.filter(o=>o.disabledWhen),[r]),s=v.useMemo(()=>e.map(o=>o.disabledWhen.watchField),[e]),n=or({control:t,name:s}),a={};return e.forEach(o=>{const l=s.indexOf(o.disabledWhen.watchField),c=n[l];a[o.name]=c===o.disabledWhen.watchValue}),a}const ns={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},vi={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function hr({control:r,name:t,rules:e,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:u="",maxLength:f,showCounter:p=!1,className:x,...b}){const E=v.useId(),j=t||E,[T,w]=v.useState(s||"");if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s||"",render:({field:N,fieldState:O})=>{var _;return i.jsx(hr,{...b,size:n,width:a,label:o,labelHidden:l,hasError:!!O.error,errorMessage:((_=O.error)==null?void 0:_.message)||"",maxLength:f,showCounter:p,className:x,value:N.value,onChange:N.onChange})}});v.useEffect(()=>{w(s||"")},[s]);const y=N=>{var O;f!==void 0&&N.target.value.length>f||(w(N.target.value),(O=b.onChange)==null||O.call(b,N))};return i.jsxs("div",{className:$("flex flex-col",x),style:{width:a},children:[o&&i.jsx("label",{htmlFor:j,className:$("pb-2 text-[var(--color-ds-text-primary)]",ns[n],l&&"sr-only"),children:o}),i.jsx("textarea",{id:j,className:$("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",ns[n],vi[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",b.disabled?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-secondary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),value:T,onChange:y,maxLength:f,...b}),i.jsxs("div",{className:"flex justify-between pt-1 min-h-[18px]",children:[c&&u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "}),p&&f!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[T.length,"/",f]})]})]})}const wi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function on({control:r,name:t,rules:e,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:u=!1,errorMessage:f=""}){return i.jsx("div",{className:$("flex flex-col",c),children:i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:p,fieldState:x})=>{const b=x.error;return i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:t,type:"checkbox",className:$(wi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),checked:p.value,onChange:E=>p.onChange(E.target.checked),disabled:o}),i.jsx("span",{className:$("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]"),children:n}),u&&(b==null?void 0:b.message)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:b.message})]})}})})}function ln({name:r,control:t,searchFn:e,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1,searchMode:c="button",minChars:u=3,debounceMs:f=600}){const{watch:p,getValues:x,setValue:b}=ut(),E=or({control:t,name:r}),[j,T]=v.useState([]),[w,y]=v.useState(!1),[N,O]=v.useState(!1),[_,D]=v.useState(""),Q=v.useRef(null),S=v.useRef(null),W=v.useRef(!1),G=v.useMemo(()=>{const I=new Map;for(const J of j)I.set(String(J.value),J.label??"");return I},[j]),R=async I=>{if(!I){T([]),O(!1);return}y(!0);try{const J=await e(I,{watch:p,getValues:x});T(J??[]),O(!0)}finally{y(!1)}};v.useEffect(()=>{function I(J){Q.current&&!Q.current.contains(J.target)&&O(!1)}if(N)return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[N]),v.useEffect(()=>{if(W.current)return;const I=E?String(E):"";if(!I){D("");return}const J=G.get(I);if(J){D(J);return}let Z=!1;return(async()=>{if(s)try{const h=await s(I);Z||D((h==null?void 0:h.label)??I)}catch{Z||D(I)}else D(I)})(),()=>{Z=!0}},[E,G,s]),v.useEffect(()=>{if(c!=="debounced"||l)return;S.current&&(window.clearTimeout(S.current),S.current=null);const I=(_||"").trim();return I.length>=u?S.current=window.setTimeout(()=>{R(I)},f):(T([]),O(!1)),()=>{S.current&&(window.clearTimeout(S.current),S.current=null)}},[_,c,u,f,l]);const P=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",X=a==="sm"?"h-6":a==="md"?"h-10":"h-12",ee=I=>{if(l)return;const J=(_||"").trim();I.key==="Enter"&&(I.preventDefault(),c==="debounced"?J.length>=u&&R(J):R(J)),I.key==="Escape"&&O(!1)};return i.jsx(Fe,{name:r,control:t,render:({field:I,fieldState:J})=>{var Z;return i.jsxs("div",{ref:Q,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${P}`,children:n}),i.jsx(Mt,{className:c==="button"?"rounded-r-none":void 0,type:"text",size:a,width:"100%",value:_,onChange:h=>{const K=h.target.value;W.current=!0,D(K),E&&b(r,"",{shouldDirty:!0})},onKeyDown:ee,onBlur:()=>{W.current=!1},disabled:l,hasError:J.invalid,errorMessage:(Z=J.error)==null?void 0:Z.message,onFocus:()=>{W.current=!0;const h=(_||"").trim();h&&c==="button"&&R(h)},suffixButton:c==="button"?i.jsx($e,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>R((_||"").trim()),disabled:l,children:"Buscar"}):void 0}),w&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(qe,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),N&&!w&&j.length>0&&i.jsx("ul",{className:`
|
|
29
|
+
`+(l!==o?`result of cast: ${l}`:""))}return a}_cast(t,e){let s=t===void 0?t:this.transforms.reduce((n,a)=>a.call(this,n,t,this),t);return s===void 0&&(s=this.getDefault(e)),s}_validate(t,e={},s,n){let{path:a,originalValue:o=t,strict:l=this.spec.strict}=e,c=t;l||(c=this._cast(c,Object.assign({assert:!1},e)));let d=[];for(let f of Object.values(this.internalTests))f&&d.push(f);this.runTests({path:a,value:c,originalValue:o,options:e,tests:d},s,f=>{if(f.length)return n(f,c);this.runTests({path:a,value:c,originalValue:o,options:e,tests:this.tests},s,n)})}runTests(t,e,s){let n=!1,{tests:a,value:o,originalValue:l,path:c,options:d}=t,f=j=>{n||(n=!0,e(j,o))},p=j=>{n||(n=!0,s(j,o))},x=a.length,b=[];if(!x)return p([]);let _={value:o,originalValue:l,path:c,options:d,schema:this};for(let j=0;j<a.length;j++){const T=a[j];T(_,f,function(v){v&&(Array.isArray(v)?b.push(...v):b.push(v)),--x<=0&&p(b)})}}asNestedTest({key:t,index:e,parent:s,parentPath:n,originalParent:a,options:o}){const l=t??e;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=s[l];const f=Object.assign({},o,{strict:!0,parent:s,value:d,originalValue:a[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${n||""}[${c?l:`"${l}"`}]`:(n?`${n}.`:"")+t});return(p,x,b)=>this.resolve(f)._validate(d,f,x,b)}validate(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return new Promise((o,l)=>n._validate(t,e,(c,d)=>{we.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new we(c,d,void 0,void 0,a)):o(d)}))}validateSync(t,e){var s;let n=this.resolve(Object.assign({},e,{value:t})),a,o=(s=e==null?void 0:e.disableStackTrace)!=null?s:n.spec.disableStackTrace;return n._validate(t,Object.assign({},e,{sync:!0}),(l,c)=>{throw we.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new we(l,t,void 0,void 0,o);a=c}),a}isValid(t,e){return this.validate(t,e).then(()=>!0,s=>{if(we.isError(s))return!1;throw s})}isValidSync(t,e){try{return this.validateSync(t,e),!0}catch(s){if(we.isError(s))return!1;throw s}}_getDefault(t){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this,t):Ke(e)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,e){const s=this.clone({nullable:t});return s.internalTests.nullable=Xe({message:e,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),s}optionality(t,e){const s=this.clone({optional:t});return s.internalTests.optionality=Xe({message:e,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=Te.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Te.notNull){return this.nullability(!1,t)}required(t=Te.required){return this.clone().withMutation(e=>e.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let e=this.clone();return e.transforms.push(t),e}test(...t){let e;if(t.length===1?typeof t[0]=="function"?e={test:t[0]}:e=t[0]:t.length===2?e={name:t[0],test:t[1]}:e={name:t[0],message:t[1],test:t[2]},e.message===void 0&&(e.message=Te.default),typeof e.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),n=Xe(e),a=e.exclusive||e.name&&s.exclusiveTests[e.name]===!0;if(e.exclusive&&!e.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return e.name&&(s.exclusiveTests[e.name]=!!e.exclusive),s.tests=s.tests.filter(o=>!(o.OPTIONS.name===e.name&&(a||o.OPTIONS.test===n.OPTIONS.test))),s.tests.push(n),s}when(t,e){!Array.isArray(t)&&typeof t!="string"&&(e=t,t=".");let s=this.clone(),n=Gs(t).map(a=>new Ge(a));return n.forEach(a=>{a.isSibling&&s.deps.push(a.key)}),s.conditions.push(typeof e=="function"?new Ct(n,e):Ct.fromOptions(n,e)),s}typeError(t){let e=this.clone();return e.internalTests.typeError=Xe({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),e}oneOf(t,e=Te.oneOf){let s=this.clone();return t.forEach(n=>{s._whitelist.add(n),s._blacklist.delete(n)}),s.internalTests.whiteList=Xe({message:e,name:"oneOf",skipAbsent:!0,test(n){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(n)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),s}notOneOf(t,e=Te.notOneOf){let s=this.clone();return t.forEach(n=>{s._blacklist.add(n),s._whitelist.delete(n)}),s.internalTests.blacklist=Xe({message:e,name:"notOneOf",test(n){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(n)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),s}strip(t=!0){let e=this.clone();return e.spec.strip=t,e}describe(t){const e=(t?this.resolve(t):this).clone(),{label:s,meta:n,optional:a,nullable:o}=e.spec;return{meta:n,label:s,optional:a,nullable:o,default:e.getDefault(t),type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,f)=>f.findIndex(p=>p.name===c.name)===d)}}}Ne.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])Ne.prototype[`${r}At`]=function(t,e,s={}){const{parent:n,parentPath:a,schema:o}=Ko(this,t,e,s.context);return o[r](n&&n[a],Object.assign({},s,{parent:n,path:t}))};for(const r of["equals","is"])Ne.prototype[r]=Ne.prototype.oneOf;for(const r of["not","nope"])Ne.prototype[r]=Ne.prototype.notOneOf;const Jo=()=>!0;function Qt(r){return new Ks(r)}class Ks extends Ne{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:Jo},t))}}Qt.prototype=Ks.prototype;const Qo=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function ei(r){const t=er(r);if(!t)return Date.parse?Date.parse(r):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let e=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(e=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(e=0-e)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+e,t.second,t.millisecond)}function er(r){var t,e;const s=Qo.exec(r);return s?{year:Me(s[1]),month:Me(s[2],1)-1,day:Me(s[3],1),hour:Me(s[4]),minute:Me(s[5]),second:Me(s[6]),millisecond:s[7]?Me(s[7].substring(0,3)):0,precision:(t=(e=s[7])==null?void 0:e.length)!=null?t:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Me(s[10]),minuteOffset:Me(s[11])}:null}function Me(r,t=0){return Number(r)||t}let ti=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ri=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,si=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ni="^\\d{4}-\\d{2}-\\d{2}",ai="\\d{2}:\\d{2}:\\d{2}",oi="(([+-]\\d{2}(:?\\d{2})?)|Z)",ii=new RegExp(`${ni}T${ai}(\\.\\d+)?${oi}$`),li=r=>Ve(r)||r===r.trim(),ci={}.toString();function Js(){return new Qs}class Qs extends Ne{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===ci?t:n})})}required(t){return super.required(t).withMutation(e=>e.test({message:t||Te.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(e=>e.OPTIONS.name!=="required"),t))}length(t,e=ve.length){return this.test({message:e,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,e=ve.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,e=ve.max){return this.test({name:"max",exclusive:!0,message:e,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,e){let s=!1,n,a;return e&&(typeof e=="object"?{excludeEmptyString:s=!1,message:n,name:a}=e:n=e),this.test({name:a||"matches",message:n||ve.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&s||o.search(t)!==-1})}email(t=ve.email){return this.matches(ti,{name:"email",message:t,excludeEmptyString:!0})}url(t=ve.url){return this.matches(ri,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ve.uuid){return this.matches(si,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let e="",s,n;return t&&(typeof t=="object"?{message:e="",allowOffset:s=!1,precision:n=void 0}=t:e=t),this.matches(ii,{name:"datetime",message:e||ve.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:e||ve.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:a=>{if(!a||s)return!0;const o=er(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:e||ve.datetime_precision,params:{precision:n},skipAbsent:!0,test:a=>{if(!a||n==null)return!0;const o=er(a);return o?o.precision===n:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ve.trim){return this.transform(e=>e!=null?e.trim():e).test({message:t,name:"trim",test:li})}lowercase(t=ve.lowercase){return this.transform(e=>Ve(e)?e:e.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toLowerCase()})}uppercase(t=ve.uppercase){return this.transform(e=>Ve(e)?e:e.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Ve(e)||e===e.toUpperCase()})}}Js.prototype=Qs.prototype;let ui=r=>r!=+r;function en(){return new tn}class tn extends Ne{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!ui(t)}}),this.withMutation(()=>{this.transform((t,e,s)=>{if(!s.spec.coerce)return t;let n=t;if(typeof n=="string"){if(n=n.replace(/\s/g,""),n==="")return NaN;n=+n}return s.isType(n)||n===null?n:parseFloat(n)})})}min(t,e=Le.min){return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(t)}})}max(t,e=Le.max){return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(t)}})}lessThan(t,e=Le.lessThan){return this.test({message:e,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(s){return s<this.resolve(t)}})}moreThan(t,e=Le.moreThan){return this.test({message:e,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(s){return s>this.resolve(t)}})}positive(t=Le.positive){return this.moreThan(0,t)}negative(t=Le.negative){return this.lessThan(0,t)}integer(t=Le.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform(t=>Ve(t)?t:t|0)}round(t){var e;let s=["ceil","floor","round","trunc"];if(t=((e=t)==null?void 0:e.toLowerCase())||"round",t==="trunc")return this.truncate();if(s.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(n=>Ve(n)?n:Math[t](n))}}en.prototype=tn.prototype;let rn=new Date(""),di=r=>Object.prototype.toString.call(r)==="[object Date]";function fr(){return new ft}class ft extends Ne{constructor(){super({type:"date",check(t){return di(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,e,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=ei(t),isNaN(t)?ft.INVALID_DATE:new Date(t)))})}prepareParam(t,e){let s;if(Ge.isRef(t))s=t;else{let n=this.cast(t);if(!this._typeCheck(n))throw new TypeError(`\`${e}\` must be a Date or a value that can be \`cast()\` to a Date`);s=n}return s}min(t,e=Jt.min){let s=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(s)}})}max(t,e=Jt.max){let s=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(s)}})}}ft.INVALID_DATE=rn;fr.prototype=ft.prototype;fr.INVALID_DATE=rn;function fi(r,t=[]){let e=[],s=new Set,n=new Set(t.map(([o,l])=>`${o}-${l}`));function a(o,l){let c=Ze.split(o)[0];s.add(c),n.has(`${l}-${c}`)||e.push([l,c])}for(const o of Object.keys(r)){let l=r[o];s.add(o),Ge.isRef(l)&&l.isSibling?a(l.path,o):dr(l)&&"deps"in l&&l.deps.forEach(c=>a(c,o))}return Po.array(Array.from(s),e).reverse()}function ts(r,t){let e=1/0;return r.some((s,n)=>{var a;if((a=t.path)!=null&&a.includes(s))return e=n,!0}),e}function sn(r){return(t,e)=>ts(r,t)-ts(r,e)}const hi=(r,t,e)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return e.isType(s)?s:r};function Nt(r){if("fields"in r){const t={};for(const[e,s]of Object.entries(r.fields))t[e]=Nt(s);return r.setFields(t)}if(r.type==="array"){const t=r.optional();return t.innerType&&(t.innerType=Nt(t.innerType)),t}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Nt)}):"optional"in r?r.optional():r}const mi=(r,t)=>{const e=[...Ze.normalizePath(t)];if(e.length===1)return e[0]in r;let s=e.pop(),n=Ze.getter(Ze.join(e),!0)(r);return!!(n&&s in n)};let rs=r=>Object.prototype.toString.call(r)==="[object Object]";function ss(r,t){let e=Object.keys(r.fields);return Object.keys(t).filter(s=>e.indexOf(s)===-1)}const pi=sn([]);function nn(r){return new an(r)}class an extends Ne{constructor(t){super({type:"object",check(e){return rs(e)||typeof e=="function"}}),this.fields=Object.create(null),this._sortErrors=pi,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,e={}){var s;let n=super._cast(t,e);if(n===void 0)return this.getDefault(e);if(!this._typeCheck(n))return n;let a=this.fields,o=(s=e.stripUnknown)!=null?s:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(n).filter(p=>!this._nodes.includes(p))),c={},d=Object.assign({},e,{parent:c,__validating:e.__validating||!1}),f=!1;for(const p of l){let x=a[p],b=p in n;if(x){let _,j=n[p];d.path=(e.path?`${e.path}.`:"")+p,x=x.resolve({value:j,context:e.context,parent:c});let T=x instanceof Ne?x.spec:void 0,w=T==null?void 0:T.strict;if(T!=null&&T.strip){f=f||p in n;continue}_=!e.__validating||!w?x.cast(n[p],d):n[p],_!==void 0&&(c[p]=_)}else b&&!o&&(c[p]=n[p]);(b!==p in c||c[p]!==n[p])&&(f=!0)}return f?c:n}_validate(t,e={},s,n){let{from:a=[],originalValue:o=t,recursive:l=this.spec.recursive}=e;e.from=[{schema:this,value:o},...a],e.__validating=!0,e.originalValue=o,super._validate(t,e,s,(c,d)=>{if(!l||!rs(d)){n(c,d);return}o=o||d;let f=[];for(let p of this._nodes){let x=this.fields[p];!x||Ge.isRef(x)||f.push(x.asNestedTest({options:e,key:p,parent:d,parentPath:e.path,originalParent:o}))}this.runTests({tests:f,value:d,originalValue:o,options:e},s,p=>{n(p.sort(this._sortErrors).concat(c),d)})})}clone(t){const e=super.clone(t);return e.fields=Object.assign({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}concat(t){let e=super.concat(t),s=e.fields;for(let[n,a]of Object.entries(this.fields)){const o=s[n];s[n]=o===void 0?a:o}return e.withMutation(n=>n.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let e={};return this._nodes.forEach(s=>{var n;const a=this.fields[s];let o=t;(n=o)!=null&&n.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[s]})),e[s]=a&&"getDefault"in a?a.getDefault(o):void 0}),e}setFields(t,e){let s=this.clone();return s.fields=t,s._nodes=fi(t,e),s._sortErrors=sn(Object.keys(t)),e&&(s._excludedEdges=e),s}shape(t,e=[]){return this.clone().withMutation(s=>{let n=s._excludedEdges;return e.length&&(Array.isArray(e[0])||(e=[e]),n=[...s._excludedEdges,...e]),s.setFields(Object.assign(s.fields,t),n)})}partial(){const t={};for(const[e,s]of Object.entries(this.fields))t[e]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return Nt(this)}pick(t){const e={};for(const s of t)this.fields[s]&&(e[s]=this.fields[s]);return this.setFields(e,this._excludedEdges.filter(([s,n])=>t.includes(s)&&t.includes(n)))}omit(t){const e=[];for(const s of Object.keys(this.fields))t.includes(s)||e.push(s);return this.pick(e)}from(t,e,s){let n=Ze.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return mi(a,t)&&(o=Object.assign({},a),s||delete o[t],o[e]=n(a)),o})}json(){return this.transform(hi)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Et.exact,test(e){if(e==null)return!0;const s=ss(this.schema,e);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,e=Et.noUnknown){typeof t!="boolean"&&(e=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:e,test(n){if(n==null)return!0;const a=ss(this.schema,n);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,e=Et.noUnknown){return this.noUnknown(!t,e)}transformKeys(t){return this.transform(e=>{if(!e)return e;const s={};for(const n of Object.keys(e))s[t(n)]=e[n];return s})}camelCase(){return this.transformKeys(Ut.camelCase)}snakeCase(){return this.transformKeys(Ut.snakeCase)}constantCase(){return this.transformKeys(t=>Ut.snakeCase(t).toUpperCase())}describe(t){const e=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[a,o]of Object.entries(e.fields)){var n;let l=t;(n=l)!=null&&n.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[a]})),s.fields[a]=o.describe(l)}return s}}nn.prototype=an.prototype;function xi({fields:r,explicitSchema:t}){return y.useMemo(()=>{if(t)return Yr(t);const e={};r.forEach(n=>{var o,l,c,d,f,p,x;let a;switch(n.type){case"text":case"password":case"email":if(a=Js(),(o=n.validation)!=null&&o.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}(l=n.validation)!=null&&l.minLength&&(a=a.min(n.validation.minLength.value,n.validation.minLength.message)),(c=n.validation)!=null&&c.maxLength&&(a=a.max(n.validation.maxLength.value,n.validation.maxLength.message)),(d=n.validation)!=null&&d.pattern&&(a=a.matches(n.validation.pattern.value,n.validation.pattern.message)),n.type==="email"&&(a=a.email("Email inválido"));break;case"number":if(a=en(),(f=n.validation)!=null&&f.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"select":case"optionGroup":if(a=Qt(),(p=n.validation)!=null&&p.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;case"date":if(a=fr(),(x=n.validation)!=null&&x.required){const b=typeof n.validation.required=="string"?n.validation.required:"Campo obligatorio";a=a.required(b)}break;default:a=Qt()}e[n.name]=a});const s=nn().shape(e);return Yr(s)},[r,t])}function gi(r){return y.useMemo(()=>{const t={};return r.forEach(e=>{t[e.name]=e}),t},[r])}function bi(r){const t=y.useMemo(()=>r.filter(o=>o.type==="select"&&o.loadOptions),[r]),[e,s]=y.useState(t.length),[n,a]=y.useState({});return y.useEffect(()=>{t.length!==0&&t.forEach(o=>{o.loadOptions().then(l=>a(c=>({...c,[o.name]:l}))).finally(()=>s(l=>Math.max(0,l-1)))})},[t]),{loadingCount:e,optionsMap:n}}function yi(r,t){const e=y.useMemo(()=>r.filter(o=>o.disabledWhen),[r]),s=y.useMemo(()=>e.map(o=>o.disabledWhen.watchField),[e]),n=or({control:t,name:s}),a={};return e.forEach(o=>{const l=s.indexOf(o.disabledWhen.watchField),c=n[l];a[o.name]=c===o.disabledWhen.watchValue}),a}const ns={sm:"text-ds-sm",md:"text-ds-md",lg:"text-ds-lg"},vi={sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"};function hr({control:r,name:t,rules:e,defaultValue:s,size:n="sm",width:a="100%",label:o,labelHidden:l=!1,hasError:c=!1,errorMessage:d="",maxLength:f,showCounter:p=!1,className:x,...b}){const _=y.useId(),j=t||_,[T,w]=y.useState(s||"");if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s||"",render:({field:S,fieldState:M})=>{var N;return i.jsx(hr,{...b,size:n,width:a,label:o,labelHidden:l,hasError:!!M.error,errorMessage:((N=M.error)==null?void 0:N.message)||"",maxLength:f,showCounter:p,className:x,value:S.value,onChange:S.onChange})}});y.useEffect(()=>{w(s||"")},[s]);const v=S=>{var M;f!==void 0&&S.target.value.length>f||(w(S.target.value),(M=b.onChange)==null||M.call(b,S))};return i.jsxs("div",{className:L("flex flex-col",x),style:{width:a},children:[o&&i.jsx("label",{htmlFor:j,className:L("pb-2 text-[var(--color-ds-text-primary)]",ns[n],l&&"sr-only"),children:o}),i.jsx("textarea",{id:j,className:L("box-border bg-[var(--color-ds-background-page)] w-full resize vertical rounded-lg border outline-none transition font-[var(--font-primary)]",ns[n],vi[n],c?"border-[var(--color-ds-border-error)]":"border-[var(--color-ds-border-default)]",b.disabled?"bg-[var(--color-ds-background-disabled)] border-[var(--color-ds-border-muted)] text-[var(--color-ds-text-secondary)] cursor-not-allowed":"text-[var(--color-ds-text-primary)]"),value:T,onChange:v,maxLength:f,...b}),i.jsxs("div",{className:"flex justify-between pt-1 min-h-[18px]",children:[c&&d?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d}):i.jsx("span",{"aria-hidden":"true",children:" "}),p&&f!==void 0&&i.jsxs("span",{className:"text-xs text-[var(--color-ds-text-secondary)]",children:[T.length,"/",f]})]})]})}const wi={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"};function on({control:r,name:t,rules:e,defaultValue:s=!1,label:n,labelHidden:a=!1,disabled:o=!1,size:l="sm",className:c,hasError:d=!1,errorMessage:f=""}){return i.jsx("div",{className:L("flex flex-col",c),children:i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:p,fieldState:x})=>{const b=x.error;return i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{id:t,type:"checkbox",className:L(wi[l],"text-[var(--color-ds-button-primary-bg)]","border-[var(--color-ds-border-default)]",o&&"opacity-50 cursor-not-allowed"),checked:p.value,onChange:_=>p.onChange(_.target.checked),disabled:o}),i.jsx("span",{className:L("text-[var(--color-ds-text-primary)] text-ds-md",o&&"text-[var(--color-ds-text-secondary)]"),children:n}),d&&(b==null?void 0:b.message)&&i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:b.message})]})}})})}function ln({name:r,control:t,searchFn:e,resolveByValue:s,label:n,size:a="sm",width:o="100%",disabled:l=!1,searchMode:c="button",minChars:d=3,debounceMs:f=600}){const p=dt(),{watch:x,getValues:b,setValue:_}=p,j=or({control:t,name:r}),[T,w]=y.useState([]),[v,S]=y.useState(!1),[M,N]=y.useState(!1),[P,G]=y.useState(""),F=y.useRef(null),W=y.useRef(null),Z=y.useRef(!1),$=y.useRef(!1),I=y.useRef(!0),K=y.useMemo(()=>{const m=new Map;for(const V of T)m.set(String(V.value).trim(),V.label??"");return m},[T]),J=async m=>{const V=(m??"").trim();if(!V){w([]),N(!1);return}S(!0);try{const h=await e(V,{watch:x,getValues:b});w(h??[]),N(!0)}finally{S(!1)}};y.useEffect(()=>{function m(V){F.current&&!F.current.contains(V.target)&&N(!1)}if(M)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[M]),y.useEffect(()=>{if(Z.current)return;const V=(j?String(j):"").trim();if(!V){G(""),N(!1);return}const h=K.get(V);if(h){G(h),N(!1),I.current=!0;return}let E=!1;return(async()=>{if(s)try{const R=await s(V,{watch:x,getValues:b});E||(G((R==null?void 0:R.label)??V),N(!1),I.current=!0)}catch{E||(G(V),N(!1),I.current=!0)}else G(V),N(!1),I.current=!0})(),()=>{E=!0}},[j,K,s,x,b]),y.useEffect(()=>{if(c!=="debounced"||l)return;if(I.current){I.current=!1;return}if(!$.current)return;W.current&&(window.clearTimeout(W.current),W.current=null);const m=(P||"").trim();return m.length>=d?W.current=window.setTimeout(()=>{J(m)},f):(w([]),N(!1)),()=>{W.current&&(window.clearTimeout(W.current),W.current=null)}},[P,c,d,f,l]);const Q=a==="sm"?"text-ds-sm":a==="md"?"text-ds-md":"text-ds-lg",re=a==="sm"?"h-6":a==="md"?"h-10":"h-12",H=m=>{if(l)return;const V=(P||"").trim();m.key==="Enter"&&(m.preventDefault(),c==="debounced"?V.length>=d&&J(V):J(V)),m.key==="Escape"&&N(!1)};return i.jsx(Fe,{name:r,control:t,render:({field:m,fieldState:V})=>{var h;return i.jsxs("div",{ref:F,className:"relative flex flex-col",style:{width:o},children:[n&&i.jsx("label",{className:`pb-2 text-[var(--color-ds-text-primary)] ${Q}`,children:n}),i.jsx(Rt,{className:c==="button"?"rounded-r-none":void 0,type:"text",size:a,width:"100%",value:P,onChange:E=>{const R=E.target.value;Z.current=!0,$.current=!0,G(R),(j?String(j):"").trim()&&_(r,"",{shouldDirty:!0})},onKeyDown:H,onBlur:()=>{Z.current=!1},disabled:l,hasError:V.invalid,errorMessage:(h=V.error)==null?void 0:h.message,onFocus:()=>{if(Z.current=!0,c==="button"&&$.current){const E=(P||"").trim();E&&J(E)}},suffixButton:c==="button"?i.jsx($e,{type:"button",className:"!rounded-l-none",size:a,variant:"primary",onClick:()=>J((P||"").trim()),disabled:l,children:"Buscar"}):void 0}),v&&i.jsx("div",{className:"absolute top-14 left-0 right-0 z-10",children:i.jsx(qe,{width:"100%",height:a==="sm"?"1.5rem":a==="md"?"2.5rem":"3rem",variant:"rect",className:"rounded-lg"})}),M&&!v&&T.length>0&&i.jsx("ul",{className:`
|
|
30
30
|
absolute top-14 left-0 right-0
|
|
31
31
|
border-[var(--color-ds-border-default)]
|
|
32
32
|
rounded-lg bg-[var(--color-ds-background-page)]
|
|
33
|
-
shadow-lg ${
|
|
34
|
-
`,children:
|
|
33
|
+
shadow-lg ${Q} max-h-48 overflow-auto z-10
|
|
34
|
+
`,children:T.map(E=>i.jsx("li",{className:`px-2 ${re} flex items-center cursor-pointer
|
|
35
35
|
text-[var(--color-ds-text-primary)]
|
|
36
|
-
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{b(r,String(h.value),{shouldDirty:!0,shouldValidate:!0}),D(h.label??String(h.value)),W.current=!1,O(!1)},children:h.label},String(h.value)))})]})}})}function ki({schema:r}){const{layout:t,fields:e,onSubmit:s,successMessage:n,errorMessage:a,footerButtons:o,defaultValues:l,loadDefaultValues:c,validationSchema:u}=r,{show:f}=Zs(),{t:p}=cr(),x=xi({fields:e,explicitSchema:u}),b=Ka({resolver:x,mode:"onBlur",reValidateMode:"onChange",defaultValues:l??{}}),E=v.useMemo(()=>({getValues:b.getValues,watch:b.watch}),[b.getValues,b.watch]),{control:j,reset:T,watch:w,handleSubmit:y,formState:{errors:N,isSubmitting:O}}=b,[_,D]=v.useState(!1);v.useEffect(()=>{c&&(D(!0),c().then(Z=>T(Z)).finally(()=>D(!1)))},[c,T]);const{loadingCount:Q,optionsMap:S}=bi(e),W=gi(e),G=yi(e,j),R=v.useMemo(()=>{const Z={};return t.forEach((h,K)=>{h.type==="tabs"&&(Z[K]=h.tabs[0].key)}),Z},[t]),[P,X]=v.useState(R),ee=v.useCallback(Z=>{if(_)return!1;const h=b.getValues(),{watchField:K,watchValue:m}=Z;return!(K in h)||h[K]===void 0?!1:typeof m=="function"?m(h):h[K]===m},[b,_]),I=v.useMemo(()=>e.filter(Z=>"clearWhen"in Z&&Z.clearWhen).map(Z=>({name:Z.name,rule:Z.clearWhen})),[e]);v.useEffect(()=>{if(!I.length)return;const Z=K=>{I.forEach(({name:m,rule:F})=>{if(!(F.watchField in K)||K[F.watchField]===void 0)return;if(typeof F.watchValue=="function"?F.watchValue(K):K[F.watchField]===F.watchValue){const B=F.clearTo??"";K[m]!==B&&b.setValue(m,B,{shouldDirty:!0,shouldValidate:!0})}})},h=b.watch((K,m)=>{if(!(m!=null&&m.name)||!I.some(({rule:B})=>B.watchField===m.name))return;const L=b.getValues();Z(L)});return()=>{var K;return(K=h==null?void 0:h.unsubscribe)==null?void 0:K.call(h)}},[b,I]);const J=v.useCallback(Z=>{var re,le,pe,se;let h;if(typeof Z=="string"){if(h=W[Z],!h)return null}else h=Z;if("visibleWhen"in h&&h.visibleWhen&&!ee(h.visibleWhen))return null;let K=!!h.disabled;const m="disabledWhen"in h&&!!h.disabledWhen;if(m&&(ee(h.disabledWhen)?K=!0:K=!1),!m&&"name"in h&&h.name&&G[h.name]&&(K=!0),h.type==="search"){const H=de=>h.searchFn(de,E),ne={};return h.searchMode&&(ne.searchMode=h.searchMode),h.minChars&&(ne.minChars=h.minChars),h.debounceMs&&(ne.debounceMs=h.debounceMs),h.resolveByValue&&(ne.resolveByValue=h.resolveByValue),i.jsx(ln,{name:h.name,control:j,searchFn:H,label:h.label,size:h.size,width:h.width,disabled:K||O,...ne},h.name)}if(h.type==="inputGroup"){const H=h,ne=H.inputs.map(de=>{var tt;const ae=typeof de=="string"?W[de]:de;if(!ae)return null;let je=!!ae.disabled;const ht="disabledWhen"in ae&&!!ae.disabledWhen;ht&&(ee(ae.disabledWhen)?je=!0:je=!1),!ht&&G[ae.name]&&(je=!0);const et={name:ae.name,control:j,rules:ae.validation,defaultValue:void 0,label:ae.label,size:ae.size,width:ae.width,placeholder:ae.placeholder,hasError:!!N[ae.name],errorMessage:((tt=N[ae.name])==null?void 0:tt.message)||"",loading:_,disabled:je,suffixButton:ae.suffixButton};return ae.type==="select"?{...et,options:ae.options??S[ae.name]??[],loadOptions:ae.options?void 0:ae.loadOptions}:et}).filter(de=>de!==null);return i.jsx(zs,{groupLabel:H.groupLabel,inputs:ne,separator:H.separator,useSeparator:H.useSeparator,className:H.className,showVisibleLabel:H.showVisibleLabel,size:H.size},`inputGroup_${H.groupLabel}`)}if(h.type==="button"){const H=h;return i.jsx("div",{className:"self-center",children:i.jsx($e,{type:"button",variant:H.variant,size:H.size,width:H.width,icon:H.icon,iconPosition:H.iconPosition,ariaLabel:H.ariaLabel,onClick:H.onClick,disabled:K||O,children:H.label})},H.name)}const F=h.suffixButton,L=typeof F=="string"?J(F):F,B={name:h.name,control:j,disabled:K||O,label:h.label,size:h.size,width:h.width,placeholder:h.placeholder,info:h.info,suffixButton:L};switch(h.type){case"select":return i.jsx(Fe,{name:h.name,control:j,render:({field:H})=>{var ne;return i.jsx(ct,{...B,value:H.value,onChange:H.onChange,options:h.options??S[h.name]??[],loadOptions:h.options?void 0:h.loadOptions,hasError:!!N[h.name],errorMessage:(ne=N[h.name])==null?void 0:ne.message,suffixButton:L})}},h.name);case"textarea":return i.jsx(Fe,{name:h.name,control:j,render:({field:H,fieldState:ne})=>{var de;return i.jsx(hr,{...B,value:H.value,onChange:H.onChange,maxLength:h.maxLength,showCounter:!!h.showCounter,hasError:!!ne.error,errorMessage:((de=ne.error)==null?void 0:de.message)||""})}},h.name);case"file":return i.jsx(Is,{...B,defaultValue:[],maxFiles:h.maxFiles,accept:h.accept,hasError:!!N[h.name],errorMessage:(re=N[h.name])==null?void 0:re.message},h.name);case"checkbox":return i.jsx(on,{...B,defaultValue:!1,hasError:!!N[h.name],errorMessage:(le=N[h.name])==null?void 0:le.message,name:h.name},h.name);case"date":return i.jsx(Vs,{...B,defaultValue:"",showTime:!!h.showTime,hasError:!!N[h.name],errorMessage:(pe=N[h.name])==null?void 0:pe.message},h.name);case"optionGroup":return i.jsx(Us,{...B,options:h.options||[],multiple:h.multiple,vertical:h.vertical,groupLabel:h.groupLabel,defaultValue:h.defaultValue,className:h.width?void 0:"w-full",name:h.name},h.name);default:return i.jsx(dr,{...B,type:h.type,loadingDefaults:_,hasError:!!N[h.name],errorMessage:(se=N[h.name])==null?void 0:se.message,suffixButton:L,name:h.name},h.name)}},[W,j,N,O,_,S,ee,G]);return i.jsx($a,{...b,children:i.jsxs("form",{noValidate:!0,onSubmit:y(async Z=>{await s(Z),f(n??p("ds.form.saveSuccess"),"success")},Z=>{console.log("❌ errores de validación:",Z),So(Z),f(a??p("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((Z,h)=>Z.type==="rows"?i.jsx(v.Fragment,{children:Z.sections.map((K,m)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:K.sectionTitle,defaultOpen:K.defaultOpen,children:K.rows.map((F,L)=>i.jsxs("div",{children:[F.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:F.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:F.columns.map((B,re)=>{var le;return i.jsx("div",{className:`${B.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:B.fields?B.fields.map(pe=>J(pe)):(le=B.rows)==null?void 0:le.map((pe,se)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:pe.columns.map((H,ne)=>{var de;return i.jsx("div",{className:`${H.width} px-2`,children:(de=H.fields)==null?void 0:de.map(ae=>J(ae))},ne)})})},se))})},re)})})]},L))})},m))},h):i.jsx(Ps,{options:Z.tabs.map(K=>({label:K.label,value:K.key})),value:P[h],onChange:K=>X(m=>({...m,[h]:K})),children:Object.fromEntries(Z.tabs.map(K=>[K.key,i.jsx("div",{className:"space-y-6",children:K.sections.map((m,F)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:m.sectionTitle,defaultOpen:m.defaultOpen,children:m.rows.map((L,B)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:L.columns.map((re,le)=>{var pe;return i.jsx("div",{className:`${re.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(pe=re.fields)==null?void 0:pe.map((se,H)=>i.jsx(v.Fragment,{children:J(se)},H))})},le)})})},B))})},F))},K.key)]))},h)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:o??i.jsx($e,{type:"submit",variant:"primary",icon:Mn,size:"sm",disabled:O||_||Q>0,children:p(O?"ds.form.sending":"ds.form.submit")})})]})})}const ji={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function cn({icon:r,size:t="md",ariaLabel:e,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":e,disabled:s,onClick:n,className:$("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",ji[t],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:$(t==="sm"?"h-4 w-4":t==="md"?"h-5 w-5":"h-6 w-6")})})}function dn({dark:r,onToggle:t}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:t,className:$("relative inline-flex items-center transition-colors focus:outline-none duration-200 ease-in-out","bg-[var(--color-ds-background-accent)]","h-6 w-12 rounded-full"),children:i.jsxs("div",{className:$("absolute bg-[var(--color-ds-background-page)] flex items-center justify-center rounded-full transition-transform duration-200 ease-in-out","h-5 w-5",r?"translate-x-6":"translate-x-1"),children:[i.jsx(Ce,{component:Jn,size:"sm",className:$("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Ce,{component:Xn,size:"sm",className:$("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const un=v.createContext({theme:"light",toggle:()=>{}});function Ei({children:r}){const[t,e]=v.useState(!1),[s,n]=v.useState("light");v.useEffect(()=>{if(typeof window>"u")return;const o=localStorage.getItem("ds-theme");o==="light"||o==="dark"?n(o):window.matchMedia("(prefers-color-scheme: dark)").matches&&n("dark"),e(!0)},[]),v.useEffect(()=>{t&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,t]);const a=()=>n(o=>o==="light"?"dark":"light");return t?i.jsx(un.Provider,{value:{theme:s,toggle:a},children:r}):null}const fn=()=>v.useContext(un),hn=({pinnedPages:r,onRemovePinned:t,onBack:e,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:u})=>{const f=r.slice(0,3),{toggle:p}=fn(),{t:x,i18n:b}=cr(),E=j=>{b.changeLanguage(j),o(j)};return i.jsxs("header",{className:"flex items-center bg-[var(--color-ds-background-page)] py-2",children:[i.jsx("div",{className:"flex items-center space-x-2",children:f.map(j=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:j.href,className:$("inline-flex items-center rounded-lg","py-1 px-1 my-1 text-ds-sm","bg-transparent text-[var(--color-ds-text-primary)]","transition-colors duration-200 ease-in-out","hover:bg-[var(--color-ds-border-muted)] hover:animate-pulse"),children:j.label}),i.jsx(cn,{icon:tr,size:"sm",ariaLabel:`${x("remove")} ${j.label}`,onClick:()=>t(j.id)})]},j.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ct,{size:"sm",width:"auto",options:a,value:n,onChange:E,disableErrorPlaceholder:!0}),i.jsx(ct,{size:"sm",width:"auto",options:c,value:l,onChange:u,disableErrorPlaceholder:!0}),i.jsx(dn,{dark:s,onToggle:p})]})]})},Ni=({loading:r=!1,ariaLabel:t="Cargando..."})=>r?i.jsxs("div",{className:`\r
|
|
36
|
+
hover:bg-[var(--color-ds-background-surface)]`,onClick:()=>{const R=String(E.value).trim();_(r,R,{shouldDirty:!0,shouldValidate:!0}),G(E.label??R),Z.current=!1,$.current=!1,N(!1)},children:E.label},String(E.value)))})]})}})}function ki({schema:r}){const{layout:t,fields:e,onSubmit:s,successMessage:n,errorMessage:a,footerButtons:o,defaultValues:l,loadDefaultValues:c,validationSchema:d}=r,{show:f}=Zs(),{t:p}=cr(),x=xi({fields:e,explicitSchema:d}),b=Ka({resolver:x,mode:"onBlur",reValidateMode:"onChange",defaultValues:l??{}}),_=y.useMemo(()=>({getValues:b.getValues,watch:b.watch}),[b.getValues,b.watch]),{control:j,reset:T,watch:w,handleSubmit:v,formState:{errors:S,isSubmitting:M}}=b,[N,P]=y.useState(!1);y.useEffect(()=>{c&&(P(!0),c().then(H=>T(H)).finally(()=>P(!1)))},[c,T]);const{loadingCount:G,optionsMap:F}=bi(e),W=gi(e),Z=yi(e,j),$=y.useMemo(()=>{const H={};return t.forEach((m,V)=>{m.type==="tabs"&&(H[V]=m.tabs[0].key)}),H},[t]),[I,K]=y.useState($),J=y.useCallback(H=>{if(N)return!1;const m=b.getValues(),{watchField:V,watchValue:h}=H;return!(V in m)||m[V]===void 0?!1:typeof h=="function"?h(m):m[V]===h},[b,N]),Q=y.useMemo(()=>e.filter(H=>"clearWhen"in H&&H.clearWhen).map(H=>({name:H.name,rule:H.clearWhen})),[e]);y.useEffect(()=>{if(!Q.length)return;const H=V=>{Q.forEach(({name:h,rule:E})=>{if(!(E.watchField in V)||V[E.watchField]===void 0)return;if(typeof E.watchValue=="function"?E.watchValue(V):V[E.watchField]===E.watchValue){const z=E.clearTo??"";V[h]!==z&&b.setValue(h,z,{shouldDirty:!0,shouldValidate:!0})}})},m=b.watch((V,h)=>{if(!(h!=null&&h.name)||!Q.some(({rule:z})=>z.watchField===h.name))return;const R=b.getValues();H(R)});return()=>{var V;return(V=m==null?void 0:m.unsubscribe)==null?void 0:V.call(m)}},[b,Q]);const re=y.useCallback(H=>{var te,le,pe,se;let m;if(typeof H=="string"){if(m=W[H],!m)return null}else m=H;if("visibleWhen"in m&&m.visibleWhen&&!J(m.visibleWhen))return null;let V=!!m.disabled;const h="disabledWhen"in m&&!!m.disabledWhen;if(h&&(J(m.disabledWhen)?V=!0:V=!1),!h&&"name"in m&&m.name&&Z[m.name]&&(V=!0),m.type==="search"){const Y=ue=>m.searchFn(ue,_),ne={};return m.searchMode&&(ne.searchMode=m.searchMode),m.minChars&&(ne.minChars=m.minChars),m.debounceMs&&(ne.debounceMs=m.debounceMs),m.resolveByValue&&(ne.resolveByValue=m.resolveByValue),i.jsx(ln,{name:m.name,control:j,searchFn:Y,label:m.label,size:m.size,width:m.width,disabled:V||M,...ne},m.name)}if(m.type==="inputGroup"){const Y=m,ne=Y.inputs.map(ue=>{var tt;const ae=typeof ue=="string"?W[ue]:ue;if(!ae)return null;let je=!!ae.disabled;const ht="disabledWhen"in ae&&!!ae.disabledWhen;ht&&(J(ae.disabledWhen)?je=!0:je=!1),!ht&&Z[ae.name]&&(je=!0);const et={name:ae.name,control:j,rules:ae.validation,defaultValue:void 0,label:ae.label,size:ae.size,width:ae.width,placeholder:ae.placeholder,hasError:!!S[ae.name],errorMessage:((tt=S[ae.name])==null?void 0:tt.message)||"",loading:N,disabled:je,suffixButton:ae.suffixButton};return ae.type==="select"?{...et,options:ae.options??F[ae.name]??[],loadOptions:ae.options?void 0:ae.loadOptions}:et}).filter(ue=>ue!==null);return i.jsx(zs,{groupLabel:Y.groupLabel,inputs:ne,separator:Y.separator,useSeparator:Y.useSeparator,className:Y.className,showVisibleLabel:Y.showVisibleLabel,size:Y.size},`inputGroup_${Y.groupLabel}`)}if(m.type==="button"){const Y=m;return i.jsx("div",{className:"self-center",children:i.jsx($e,{type:"button",variant:Y.variant,size:Y.size,width:Y.width,icon:Y.icon,iconPosition:Y.iconPosition,ariaLabel:Y.ariaLabel,onClick:Y.onClick,disabled:V||M,children:Y.label})},Y.name)}const E=m.suffixButton,R=typeof E=="string"?re(E):E,z={name:m.name,control:j,disabled:V||M,label:m.label,size:m.size,width:m.width,placeholder:m.placeholder,info:m.info,suffixButton:R};switch(m.type){case"select":return i.jsx(Fe,{name:m.name,control:j,render:({field:Y})=>{var ne;return i.jsx(ct,{...z,value:Y.value,onChange:Y.onChange,options:m.options??F[m.name]??[],loadOptions:m.options?void 0:m.loadOptions,hasError:!!S[m.name],errorMessage:(ne=S[m.name])==null?void 0:ne.message,suffixButton:R})}},m.name);case"textarea":return i.jsx(Fe,{name:m.name,control:j,render:({field:Y,fieldState:ne})=>{var ue;return i.jsx(hr,{...z,value:Y.value,onChange:Y.onChange,maxLength:m.maxLength,showCounter:!!m.showCounter,hasError:!!ne.error,errorMessage:((ue=ne.error)==null?void 0:ue.message)||""})}},m.name);case"file":return i.jsx(Is,{...z,defaultValue:[],maxFiles:m.maxFiles,accept:m.accept,hasError:!!S[m.name],errorMessage:(te=S[m.name])==null?void 0:te.message},m.name);case"checkbox":return i.jsx(on,{...z,defaultValue:!1,hasError:!!S[m.name],errorMessage:(le=S[m.name])==null?void 0:le.message,name:m.name},m.name);case"date":return i.jsx(Vs,{...z,defaultValue:"",showTime:!!m.showTime,hasError:!!S[m.name],errorMessage:(pe=S[m.name])==null?void 0:pe.message},m.name);case"optionGroup":return i.jsx(Us,{...z,options:m.options||[],multiple:m.multiple,vertical:m.vertical,groupLabel:m.groupLabel,defaultValue:m.defaultValue,className:m.width?void 0:"w-full",name:m.name},m.name);default:return i.jsx(ur,{...z,type:m.type,loadingDefaults:N,hasError:!!S[m.name],errorMessage:(se=S[m.name])==null?void 0:se.message,suffixButton:R,name:m.name},m.name)}},[W,j,S,M,N,F,J,Z]);return i.jsx($a,{...b,children:i.jsxs("form",{noValidate:!0,onSubmit:v(async H=>{await s(H),f(n??p("ds.form.saveSuccess"),"success")},H=>{console.log("❌ errores de validación:",H),So(H),f(a??p("ds.form.saveError"),"error")}),className:"space-y-6",children:[t.map((H,m)=>H.type==="rows"?i.jsx(y.Fragment,{children:H.sections.map((V,h)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:V.sectionTitle,defaultOpen:V.defaultOpen,children:V.rows.map((E,R)=>i.jsxs("div",{children:[E.title&&i.jsx("h2",{className:"mb-2 text-lg text-[var(--color-ds-text-primary)]",children:E.title}),i.jsx("div",{className:"flex flex-wrap -mx-2",children:E.columns.map((z,te)=>{var le;return i.jsx("div",{className:`${z.width} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:z.fields?z.fields.map(pe=>re(pe)):(le=z.rows)==null?void 0:le.map((pe,se)=>i.jsx("div",{className:"mb-1",children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:pe.columns.map((Y,ne)=>{var ue;return i.jsx("div",{className:`${Y.width} px-2`,children:(ue=Y.fields)==null?void 0:ue.map(ae=>re(ae))},ne)})})},se))})},te)})})]},R))})},h))},m):i.jsx(Ps,{options:H.tabs.map(V=>({label:V.label,value:V.key})),value:I[m],onChange:V=>K(h=>({...h,[m]:V})),children:Object.fromEntries(H.tabs.map(V=>[V.key,i.jsx("div",{className:"space-y-6",children:V.sections.map((h,E)=>i.jsx("div",{className:"mb-6",children:i.jsx(Bt,{title:h.sectionTitle,defaultOpen:h.defaultOpen,children:h.rows.map((R,z)=>i.jsx("div",{children:i.jsx("div",{className:"flex flex-wrap -mx-2",children:R.columns.map((te,le)=>{var pe;return i.jsx("div",{className:`${te.width??"flex-1"} px-2 flex flex-col`,children:i.jsx("div",{className:"space-y-4",children:(pe=te.fields)==null?void 0:pe.map((se,Y)=>i.jsx(y.Fragment,{children:re(se)},Y))})},le)})})},z))})},E))},V.key)]))},m)),i.jsx("footer",{className:"py-4 w-full flex justify-center space-x-4",children:o??i.jsx($e,{type:"submit",variant:"primary",icon:Rn,size:"sm",disabled:M||N||G>0,children:p(M?"ds.form.sending":"ds.form.submit")})})]})})}const ji={sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"};function cn({icon:r,size:t="md",ariaLabel:e,disabled:s=!1,onClick:n,...a}){return i.jsx("button",{type:"button","aria-label":e,disabled:s,onClick:n,className:L("inline-flex items-center justify-center","rounded-full","bg-transparent","text-[var(--color-ds-text-primary)]","transition-transform","focus:outline-none",ji[t],s?"opacity-50 cursor-not-allowed":["hover:scale-110","hover:animate-pulse"]),...a,children:i.jsx(r,{className:L(t==="sm"?"h-4 w-4":t==="md"?"h-5 w-5":"h-6 w-6")})})}function un({dark:r,onToggle:t}){return i.jsx("button",{type:"button","aria-pressed":r,"aria-label":r?"Cambiar a modo claro":"Cambiar a modo oscuro",onClick:t,className:L("relative inline-flex items-center transition-colors focus:outline-none duration-200 ease-in-out","bg-[var(--color-ds-background-accent)]","h-6 w-12 rounded-full"),children:i.jsxs("div",{className:L("absolute bg-[var(--color-ds-background-page)] flex items-center justify-center rounded-full transition-transform duration-200 ease-in-out","h-5 w-5",r?"translate-x-6":"translate-x-1"),children:[i.jsx(Ce,{component:Jn,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-0":"opacity-100 text-[var(--color-ds-background-accent)]")}),i.jsx(Ce,{component:Xn,size:"sm",className:L("absolute transition-opacity duration-200 ease-in-out",r?"opacity-100 text-[var(--color-ds-background-accent)]":"opacity-0")})]})})}const dn=y.createContext({theme:"light",toggle:()=>{}});function Ei({children:r}){const[t,e]=y.useState(!1),[s,n]=y.useState("light");y.useEffect(()=>{if(typeof window>"u")return;const o=localStorage.getItem("ds-theme");o==="light"||o==="dark"?n(o):window.matchMedia("(prefers-color-scheme: dark)").matches&&n("dark"),e(!0)},[]),y.useEffect(()=>{t&&(document.documentElement.classList.toggle("dark",s==="dark"),s==="dark"?localStorage.setItem("ds-theme","dark"):localStorage.removeItem("ds-theme"))},[s,t]);const a=()=>n(o=>o==="light"?"dark":"light");return t?i.jsx(dn.Provider,{value:{theme:s,toggle:a},children:r}):null}const fn=()=>y.useContext(dn),hn=({pinnedPages:r,onRemovePinned:t,onBack:e,dark:s,locale:n,languageOptions:a,onChangeLocale:o,profile:l,profileOptions:c,onChangeProfile:d})=>{const f=r.slice(0,3),{toggle:p}=fn(),{t:x,i18n:b}=cr(),_=j=>{o(j)};return i.jsxs("header",{className:"flex items-center bg-[var(--color-ds-background-page)] py-2",children:[i.jsx("div",{className:"flex items-center space-x-2",children:f.map(j=>i.jsxs("div",{className:"flex items-center",children:[i.jsx("a",{href:j.href,className:L("inline-flex items-center rounded-lg","py-1 px-1 my-1 text-ds-sm","bg-transparent text-[var(--color-ds-text-primary)]","transition-colors duration-200 ease-in-out","hover:bg-[var(--color-ds-border-muted)] hover:animate-pulse"),children:j.label}),i.jsx(cn,{icon:tr,size:"sm",ariaLabel:`${x("remove")} ${j.label}`,onClick:()=>t(j.id)})]},j.id))}),i.jsx("div",{className:"flex-grow"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ct,{size:"sm",width:"auto",options:a,value:n,onChange:_,disableErrorPlaceholder:!0}),i.jsx(ct,{size:"sm",width:"auto",options:c,value:l,onChange:d,disableErrorPlaceholder:!0}),i.jsx(un,{dark:s,onToggle:p})]})]})},Ni=({loading:r=!1,ariaLabel:t="Cargando..."})=>r?i.jsxs("div",{className:`\r
|
|
37
37
|
fixed inset-0\r
|
|
38
38
|
flex items-center justify-center\r
|
|
39
39
|
bg-[var(--color-ds-background-surface)]/90\r
|
|
@@ -44,7 +44,7 @@ attempted value: ${o}
|
|
|
44
44
|
border-gray-200\r
|
|
45
45
|
border-t-[var(--color-ds-button-primary-bg)]\r
|
|
46
46
|
animate-spin\r
|
|
47
|
-
`}),i.jsx("span",{className:"sr-only",children:t})]}):null,Si=({isOpen:r,onClose:t,title:e,children:s,footer:n})=>(
|
|
47
|
+
`}),i.jsx("span",{className:"sr-only",children:t})]}):null,Si=({isOpen:r,onClose:t,title:e,children:s,footer:n})=>(y.useEffect(()=>{const a=o=>o.key==="Escape"&&t();return r&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[r,t]),r?as.createPortal(i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[var(--color-ds-text-primary)]/50 z-40",onClick:t}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-4 z-50",children:i.jsxs("div",{className:`\r
|
|
48
48
|
relative\r
|
|
49
49
|
bg-[var(--color-ds-background-page)]\r
|
|
50
50
|
dark:bg-[var(--color-ds-background-surface)]\r
|
|
@@ -58,4 +58,4 @@ attempted value: ${o}
|
|
|
58
58
|
dark:bg-[var(--color-ds-background-surface)]\r
|
|
59
59
|
hover:bg-[var(--color-ds-background-accent)]/10\r
|
|
60
60
|
focus:outline-none\r
|
|
61
|
-
`,children:[i.jsx(tr,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),i.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),i.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&i.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),mr=({items:r,selected:t,onSelect:e,level:s=0})=>{const[n,a]=v.useState(new Set),o=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return i.jsx("ul",{className:$(s>0?"mt-1":"mt-0"),children:r.map(l=>{var E;const c=l.value===t,u=n.has(l.value),f=["pl-2","pl-2","pl-2"][s]||"pl-4",p=s===0?u||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",x=s===0&&(u||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((E=l.children)!=null&&E.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>b?o(l.value):e(l.value),"aria-expanded":b?u:void 0,className:$("w-full flex items-center justify-between h-8 transition-colors",f,p),children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&i.jsx(l.icon,{className:"w-5 h-5 ml-2"}),i.jsx("span",{className:"text-ds-sm",children:l.label})]}),b&&(u?i.jsx(is,{className:$("w-4 h-4",x)}):i.jsx($n,{className:$("w-4 h-4",x)}))]}),b&&i.jsx("div",{className:$("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",u?"max-h-screen":"max-h-0"),children:i.jsx(mr,{items:l.children,selected:t,onSelect:e,level:s+1})})]},l.value)})})},_i="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Fi="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",mn=({appName:r,orgName:t,username:e,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=fn(),u=c==="dark"?_i:Fi;return i.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[i.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[i.jsx("img",{src:u,alt:"Logo Diputación",className:"w-20 h-20"}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:r}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),i.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),i.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:i.jsx(mr,{items:n,selected:a,onSelect:o})}),i.jsx("div",{className:"px-4 w-full py-3",children:i.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function Ti({sidebar:r,header:t,children:e}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[i.jsx(mn,{...r}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-auto px-10 [scrollbar-gutter:stable_both-edges]",children:[i.jsx(hn,{...t}),i.jsx("main",{className:"flex-1 ",children:e})]})]})}function Ci({columns:r,data:t,loadData:e,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:u,className:f}){const p=t!==void 0,[x,b]=v.useState([]),[E,j]=v.useState(!1),T=v.useRef(null);v.useEffect(()=>{var F;if(!e||p)return;(F=T.current)==null||F.abort();const m=new AbortController;return T.current=m,j(!0),e().then(L=>{m.signal.aborted||b(L)}).finally(()=>{m.signal.aborted||j(!1)}),()=>m.abort()},[e,p]);const w=v.useMemo(()=>p?t:x,[t,x,p]),y=s??(e?E:!1),[N,O]=v.useState(new Set),[_,D]=v.useState(1),[Q,S]=v.useState(c==null?void 0:c.sortBy),[W,G]=v.useState((c==null?void 0:c.sortDir)??"asc"),R=m=>typeof n=="function"?n(m):m[n],P=v.useRef(null);v.useEffect(()=>{P.current!==w&&(O(new Set),D(1),P.current=w)},[w]);const X=v.useMemo(()=>{if(!Q)return w;const m=W==="asc"?1:-1;return[...w].sort((F,L)=>{const B=F[Q],re=L[Q];return B==null?-m:re==null||B>re?m:B<re?-m:0})},[w,Q,W]),ee=Math.max(1,Math.ceil(X.length/l)),I=v.useMemo(()=>{const m=(_-1)*l;return X.slice(m,m+l)},[X,_,l]),J=m=>{const F=new Set(N);F.has(m)?F.delete(m):F.add(m),O(F),o==null||o(w.filter(L=>F.has(R(L))))},Z=()=>{const m=I.every(L=>N.has(R(L))),F=new Set(N);I.forEach(L=>{m?F.delete(R(L)):F.add(R(L))}),O(F),o==null||o(w.filter(L=>F.has(R(L))))},h=m=>{if(!m.sortable)return;const F=typeof m.accessor=="string"?m.accessor:m.sortKey;if(Q===F){const L=W==="asc"?"desc":"asc";G(L),u==null||u(F,L)}else S(F),G("asc"),u==null||u(F,"asc");D(1)},K=()=>y?i.jsx("tbody",{children:Array.from({length:l}).map((m,F)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(qe,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((L,B)=>i.jsx("td",{children:i.jsx(qe,{width:"100%",height:"1em",variant:"rect"})},B))]},F))}):I.length?i.jsx("tbody",{children:I.map(m=>{const F=R(m);return i.jsxs("tr",{className:"hover:bg-gray-50",children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:N.has(F),onChange:()=>J(F)})}),r.map((L,B)=>{const re=L.render?L.render(m):typeof L.accessor=="function"?L.accessor(m):m[L.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:re},B)})]},F)})}):i.jsx("tbody",{children:i.jsx("tr",{children:i.jsx("td",{colSpan:r.length+(a?1:0),children:"No hay datos"})})});return i.jsxs("div",{className:$("w-full overflow-auto",f),children:[i.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[a&&i.jsx("th",{children:i.jsx("input",{type:"checkbox",checked:I.length>0&&I.every(m=>N.has(R(m))),onChange:Z})}),r.map(m=>{const F=typeof m.accessor=="string"?m.accessor:m.header,L=Q===(typeof m.accessor=="string"?m.accessor:m.sortKey);return i.jsx("th",{className:$("px-4 py-2 text-left text-sm font-medium text-gray-700",m.width),onClick:()=>h(m),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:m.header}),m.sortable&&i.jsx("span",{className:"text-xs",children:L?W==="asc"?"▲":"▼":"⇵"})]})},F)})]})}),K()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:y?"Cargando...":`Página ${_} de ${ee}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx($e,{size:"sm",variant:"outline",disabled:y||_<=1,onClick:()=>D(m=>Math.max(1,m-1)),children:"Prev"}),i.jsx($e,{size:"sm",variant:"outline",disabled:y||_>=ee,onClick:()=>D(m=>Math.min(ee,m+1)),children:"Next"})]})]})]})}function pn({control:r,name:t,rules:e,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:u="",className:f}){const p=v.useId();if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:b,fieldState:E})=>{var j;return i.jsx(pn,{checked:b.value,onChange:b.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((j=E.error)==null?void 0:j.message)||"",className:f})}});const x=!!n;return i.jsxs("div",{className:$("flex flex-col",f),children:[i.jsxs("label",{className:$("inline-flex items-center space-x-3 select-none",o&&"opacity-50 cursor-not-allowed"),htmlFor:p,children:[l&&c==="left"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),i.jsx("button",{id:p,type:"button",role:"switch","aria-checked":x,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!x)),className:$("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:i.jsx("div",{className:$("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",x?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),i.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:u?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}exports.Button=$e;exports.Checkbox=on;exports.CollapsibleSection=Bt;exports.DateInput=Vs;exports.DropdownMenu=eo;exports.FileUploader=Is;exports.FormFieldInput=dr;exports.FormPageLayout=ko;exports.FormRenderer=ki;exports.Header=hn;exports.Icon=Ce;exports.IconButton=cn;exports.InfoButton=Ls;exports.Input=Mt;exports.InputGroup=zs;exports.LoadingScreen=Ni;exports.Modal=Si;exports.OptionGroup=Us;exports.PageLayout=Ti;exports.SearchField=ln;exports.Select=ct;exports.Sidebar=mn;exports.SidebarNav=mr;exports.SkeletonLoader=qe;exports.Table=Ci;exports.Tabs=Ps;exports.TextArea=hr;exports.ThemeProvider=Ei;exports.ThemeToggle=dn;exports.Toast=Bs;exports.ToastProvider=Mo;exports.ToggleSwitch=pn;exports.useToast=Zs;
|
|
61
|
+
`,children:[i.jsx(tr,{className:"w-5 h-5 text-[var(--color-ds-text-secondary)] hover:text-[var(--color-ds-text-primary)]"}),i.jsx("span",{className:"sr-only",children:"Cerrar modal"})]})]}),i.jsx("div",{className:"px-6 py-6 text-[var(--color-ds-text-primary)]",children:s}),n&&i.jsx("div",{className:"px-6 py-4 border-t border-[var(--color-ds-border-muted)] bg-[var(--color-ds-background-surface)]",children:n})]})})]}),document.body):null),mr=({items:r,selected:t,onSelect:e,level:s=0})=>{const[n,a]=y.useState(new Set),o=l=>{const c=new Set(n);s===0?(c.clear(),n.has(l)||c.add(l)):c.has(l)?c.delete(l):c.add(l),a(c)};return i.jsx("ul",{className:L(s>0?"mt-1":"mt-0"),children:r.map(l=>{var _;const c=l.value===t,d=n.has(l.value),f=["pl-2","pl-2","pl-2"][s]||"pl-4",p=s===0?d||c?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":c?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",x=s===0&&(d||c)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((_=l.children)!=null&&_.length);return i.jsxs("li",{children:[i.jsxs("button",{type:"button",onClick:()=>b?o(l.value):e(l.value),"aria-expanded":b?d:void 0,className:L("w-full flex items-center justify-between h-8 transition-colors",f,p),children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[s===0&&l.icon&&i.jsx(l.icon,{className:"w-5 h-5 ml-2"}),i.jsx("span",{className:"text-ds-sm",children:l.label})]}),b&&(d?i.jsx(is,{className:L("w-4 h-4",x)}):i.jsx($n,{className:L("w-4 h-4",x)}))]}),b&&i.jsx("div",{className:L("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",d?"max-h-screen":"max-h-0"),children:i.jsx(mr,{items:l.children,selected:t,onSelect:e,level:s+1})})]},l.value)})})},_i="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Fi="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",mn=({appName:r,orgName:t,username:e,footerText:s,navItems:n,selectedNav:a,onSelectNav:o,width:l="200px"})=>{const{theme:c}=fn(),d=c==="dark"?_i:Fi;return i.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)]",style:{width:l},children:[i.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[i.jsx("img",{src:d,alt:"Logo Diputación",className:"w-20 h-20"}),i.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:r}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),i.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:e}),i.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),i.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:i.jsx(mr,{items:n,selected:a,onSelect:o})}),i.jsx("div",{className:"px-4 w-full py-3",children:i.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:s})})]})};function Ti({sidebar:r,header:t,children:e}){return i.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[i.jsx(mn,{...r}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-auto px-10 [scrollbar-gutter:stable_both-edges]",children:[i.jsx(hn,{...t}),i.jsx("main",{className:"flex-1 ",children:e})]})]})}function Ci({columns:r,data:t,loadData:e,loading:s,idAccessor:n,multiSelect:a=!1,onSelectionChange:o,pageSize:l=10,initialSort:c,onSort:d,className:f}){const p=t!==void 0,[x,b]=y.useState([]),[_,j]=y.useState(!1),T=y.useRef(null);y.useEffect(()=>{var E;if(!e||p)return;(E=T.current)==null||E.abort();const h=new AbortController;return T.current=h,j(!0),e().then(R=>{h.signal.aborted||b(R)}).finally(()=>{h.signal.aborted||j(!1)}),()=>h.abort()},[e,p]);const w=y.useMemo(()=>p?t:x,[t,x,p]),v=s??(e?_:!1),[S,M]=y.useState(new Set),[N,P]=y.useState(1),[G,F]=y.useState(c==null?void 0:c.sortBy),[W,Z]=y.useState((c==null?void 0:c.sortDir)??"asc"),$=h=>typeof n=="function"?n(h):h[n],I=y.useRef(null);y.useEffect(()=>{I.current!==w&&(M(new Set),P(1),I.current=w)},[w]);const K=y.useMemo(()=>{if(!G)return w;const h=W==="asc"?1:-1;return[...w].sort((E,R)=>{const z=E[G],te=R[G];return z==null?-h:te==null||z>te?h:z<te?-h:0})},[w,G,W]),J=Math.max(1,Math.ceil(K.length/l)),Q=y.useMemo(()=>{const h=(N-1)*l;return K.slice(h,h+l)},[K,N,l]),re=h=>{const E=new Set(S);E.has(h)?E.delete(h):E.add(h),M(E),o==null||o(w.filter(R=>E.has($(R))))},H=()=>{const h=Q.every(R=>S.has($(R))),E=new Set(S);Q.forEach(R=>{h?E.delete($(R)):E.add($(R))}),M(E),o==null||o(w.filter(R=>E.has($(R))))},m=h=>{if(!h.sortable)return;const E=typeof h.accessor=="string"?h.accessor:h.sortKey;if(G===E){const R=W==="asc"?"desc":"asc";Z(R),d==null||d(E,R)}else F(E),Z("asc"),d==null||d(E,"asc");P(1)},V=()=>v?i.jsx("tbody",{children:Array.from({length:l}).map((h,E)=>i.jsxs("tr",{children:[a&&i.jsx("td",{children:i.jsx(qe,{width:"1rem",height:"1rem",variant:"circle"})}),r.map((R,z)=>i.jsx("td",{children:i.jsx(qe,{width:"100%",height:"1em",variant:"rect"})},z))]},E))}):Q.length?i.jsx("tbody",{children:Q.map(h=>{const E=$(h);return i.jsxs("tr",{className:"hover:bg-gray-50",children:[a&&i.jsx("td",{children:i.jsx("input",{type:"checkbox",checked:S.has(E),onChange:()=>re(E)})}),r.map((R,z)=>{const te=R.render?R.render(h):typeof R.accessor=="function"?R.accessor(h):h[R.accessor];return i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm",children:te},z)})]},E)})}):i.jsx("tbody",{children:i.jsx("tr",{children:i.jsx("td",{colSpan:r.length+(a?1:0),children:"No hay datos"})})});return i.jsxs("div",{className:L("w-full overflow-auto",f),children:[i.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[a&&i.jsx("th",{children:i.jsx("input",{type:"checkbox",checked:Q.length>0&&Q.every(h=>S.has($(h))),onChange:H})}),r.map(h=>{const E=typeof h.accessor=="string"?h.accessor:h.header,R=G===(typeof h.accessor=="string"?h.accessor:h.sortKey);return i.jsx("th",{className:L("px-4 py-2 text-left text-sm font-medium text-gray-700",h.width),onClick:()=>m(h),children:i.jsxs("div",{className:"inline-flex items-center space-x-1 cursor-pointer",children:[i.jsx("span",{children:h.header}),h.sortable&&i.jsx("span",{className:"text-xs",children:R?W==="asc"?"▲":"▼":"⇵"})]})},E)})]})}),V()]}),i.jsxs("div",{className:"flex items-center justify-between py-2 px-4",children:[i.jsx("span",{className:"text-sm text-gray-700",children:v?"Cargando...":`Página ${N} de ${J}`}),i.jsxs("div",{className:"space-x-2",children:[i.jsx($e,{size:"sm",variant:"outline",disabled:v||N<=1,onClick:()=>P(h=>Math.max(1,h-1)),children:"Prev"}),i.jsx($e,{size:"sm",variant:"outline",disabled:v||N>=J,onClick:()=>P(h=>Math.min(J,h+1)),children:"Next"})]})]})]})}function pn({control:r,name:t,rules:e,defaultValue:s=!1,checked:n,onChange:a,disabled:o=!1,label:l,labelPosition:c="right",errorMessage:d="",className:f}){const p=y.useId();if(r&&t)return i.jsx(Fe,{name:t,control:r,rules:e,defaultValue:s,render:({field:b,fieldState:_})=>{var j;return i.jsx(pn,{checked:b.value,onChange:b.onChange,disabled:o,label:l,labelPosition:c,errorMessage:((j=_.error)==null?void 0:j.message)||"",className:f})}});const x=!!n;return i.jsxs("div",{className:L("flex flex-col",f),children:[i.jsxs("label",{className:L("inline-flex items-center space-x-3 select-none",o&&"opacity-50 cursor-not-allowed"),htmlFor:p,children:[l&&c==="left"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l}),i.jsx("button",{id:p,type:"button",role:"switch","aria-checked":x,disabled:o,onClick:()=>!o&&(a==null?void 0:a(!x)),className:L("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:i.jsx("div",{className:L("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",x?"translate-x-9":"translate-x-1")})}),l&&c==="right"&&i.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:l})]}),i.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:d?i.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:d}):i.jsx("span",{"aria-hidden":"true",children:" "})})]})}exports.Button=$e;exports.Checkbox=on;exports.CollapsibleSection=Bt;exports.DateInput=Vs;exports.DropdownMenu=eo;exports.FileUploader=Is;exports.FormFieldInput=ur;exports.FormPageLayout=ko;exports.FormRenderer=ki;exports.Header=hn;exports.Icon=Ce;exports.IconButton=cn;exports.InfoButton=Ls;exports.Input=Rt;exports.InputGroup=zs;exports.LoadingScreen=Ni;exports.Modal=Si;exports.OptionGroup=Us;exports.PageLayout=Ti;exports.SearchField=ln;exports.Select=ct;exports.Sidebar=mn;exports.SidebarNav=mr;exports.SkeletonLoader=qe;exports.Table=Ci;exports.Tabs=Ps;exports.TextArea=hr;exports.ThemeProvider=Ei;exports.ThemeToggle=un;exports.Toast=Bs;exports.ToastProvider=Ro;exports.ToggleSwitch=pn;exports.useToast=Zs;
|