Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/
Upload File :
Current File : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/index.esm-BgKkBPdO.js

import{a3 as Wr,a4 as Zn,a5 as Qn,a6 as Jn,n as ea,r as b,a7 as Vt,K as q,j as T,f as de,q as jr,h as Ur,a as ie,l as te,m as vr,g as ta,c as Hr,a8 as bt,a9 as ra,aa as na,ab as Qe,v as dt,N as aa,ac as We,ad as hr,ae as oa,af as sa,ag as ia}from"./index-C50MwByD.js";import{e as qr,f as ua,c as qe,g as ca}from"./input-BS5AKlHW.js";const $r=e=>e.hasAttribute("tabindex"),la=e=>$r(e)&&e.tabIndex===-1;function Gr(e){if(!Wr(e)||Zn(e)||Qn(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const n={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in n?n[t]():Jn(e)?!0:$r(e)}function hi(e){return e?Wr(e)&&Gr(e)&&!la(e):!1}const fa=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],da=fa.join(),va=e=>e.offsetWidth>0&&e.offsetHeight>0;function ha(e){const t=Array.from(e.querySelectorAll(da));return t.unshift(e),t.filter(r=>Gr(r)&&va(r))}function ma(e,t){return Array.isArray(e)?e.map(r=>r===null?null:t(r)):ea(e)?Object.keys(e).reduce((r,n)=>(r[n]=t(e[n]),r),{}):e!=null?t(e):null}const mr={easeIn:[.4,0,1,1],easeOut:[0,0,.2,1]},we={enter:{duration:.2,ease:mr.easeOut},exit:{duration:.1,ease:mr.easeIn}},Fe={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})};function ya(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Lt="data-focus-lock",Yr="data-focus-lock-disabled",ba="data-no-focus-lock",ga="data-autofocus-inside",pa="data-no-autofocus";function Et(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xa(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var wa=typeof window<"u"?b.useLayoutEffect:b.useEffect,yr=new WeakMap;function Xr(e,t){var r=xa(null,function(n){return e.forEach(function(a){return Et(a,n)})});return wa(function(){var n=yr.get(r);if(n){var a=new Set(n),o=new Set(e),i=r.current;a.forEach(function(u){o.has(u)||Et(u,null)}),o.forEach(function(u){a.has(u)||Et(u,i)})}yr.set(r,e)},[e]),r}var Mt={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},le=function(){return le=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},le.apply(this,arguments)};function zr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Fa(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,o;n<a;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Kr(e){return e}function Zr(e,t){t===void 0&&(t=Kr);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var i=t(o,n);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(o){for(n=!0;r.length;){var i=r;r=[],i.forEach(o)}r={push:function(u){return o(u)},filter:function(){return r}}},assignMedium:function(o){n=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(o),i=r}var g=function(){var m=i;i=[],m.forEach(o)},h=function(){return Promise.resolve().then(g)};h(),r={push:function(m){i.push(m),h()},filter:function(m){return i=i.filter(m),r}}}};return a}function Yt(e,t){return t===void 0&&(t=Kr),Zr(e,t)}function Qr(e){e===void 0&&(e={});var t=Zr(null);return t.options=le({async:!0,ssr:!1},e),t}var Jr=function(e){var t=e.sideCar,r=zr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,le({},r))};Jr.isSideCarExport=!0;function Sa(e,t){return e.useMedium(t),Jr}var en=Yt({},function(e){var t=e.target,r=e.currentTarget;return{target:t,currentTarget:r}}),tn=Yt(),_a=Yt(),Aa=Qr({async:!0,ssr:typeof document<"u"}),ka=b.createContext(void 0),Ca=[],Xt=b.forwardRef(function(t,r){var n,a=b.useState(),o=a[0],i=a[1],u=b.useRef(),g=b.useRef(!1),h=b.useRef(null),m=b.useState({}),d=m[1],f=t.children,F=t.disabled,S=F===void 0?!1:F,v=t.noFocusGuards,k=v===void 0?!1:v,M=t.persistentFocus,x=M===void 0?!1:M,E=t.crossFrame,O=E===void 0?!0:E,C=t.autoFocus,V=C===void 0?!0:C;t.allowTextSelection;var B=t.group,z=t.className,N=t.whiteList,K=t.hasPositiveIndices,G=t.shards,I=G===void 0?Ca:G,P=t.as,L=P===void 0?"div":P,$=t.lockProps,J=$===void 0?{}:$,re=t.sideCar,ae=t.returnFocus,ue=ae===void 0?!1:ae,ke=t.focusOptions,pe=t.onActivation,Ce=t.onDeactivation,et=b.useState({}),xt=et[0],tt=b.useCallback(function(ne){var he=ne.captureFocusRestore;if(!h.current){var be,me=(be=document)==null?void 0:be.activeElement;h.current=me,me!==document.body&&(h.current=he(me))}u.current&&pe&&pe(u.current),g.current=!0,d()},[pe]),wt=b.useCallback(function(){g.current=!1,Ce&&Ce(u.current),d()},[Ce]),rt=b.useCallback(function(ne){var he=h.current;if(he){var be=(typeof he=="function"?he():he)||document.body,me=typeof ue=="function"?ue(be):ue;if(me){var At=typeof me=="object"?me:void 0;h.current=null,ne?Promise.resolve().then(function(){return be.focus(At)}):be.focus(At)}}},[ue]),Ft=b.useCallback(function(ne){g.current&&en.useMedium(ne)},[]),Ve=tn.useMedium,nt=b.useCallback(function(ne){u.current!==ne&&(u.current=ne,i(ne))},[]),Le=Vt((n={},n[Yr]=S&&"disabled",n[Lt]=B,n),J),Be=k!==!0,St=Be&&k!=="tail",at=Xr([r,nt]),_t=b.useMemo(function(){return{observed:u,shards:I,enabled:!S,active:g.current}},[S,g.current,I,o]);return q.createElement(b.Fragment,null,Be&&[q.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:S?-1:0,style:Mt}),K?q.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:S?-1:1,style:Mt}):null],!S&&q.createElement(re,{id:xt,sideCar:Aa,observed:o,disabled:S,persistentFocus:x,crossFrame:O,autoFocus:V,whiteList:N,shards:I,onActivation:tt,onDeactivation:wt,returnFocus:rt,focusOptions:ke,noFocusGuards:k}),q.createElement(L,Vt({ref:at},Le,{className:z,onBlur:Ve,onFocus:Ft}),q.createElement(ka.Provider,{value:_t},f)),St&&q.createElement("div",{"data-focus-guard":!0,tabIndex:S?-1:0,style:Mt}))});Xt.propTypes={};function Bt(e,t){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Bt(e,t)}function Ea(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Bt(e,t)}function Xe(e){"@babel/helpers - typeof";return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(e)}function Ma(e,t){if(Xe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Oa(e){var t=Ma(e,"string");return Xe(t)=="symbol"?t:t+""}function Pa(e,t,r){return(t=Oa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Na(e,t){function r(n){return n.displayName||n.name||"Component"}return function(a){var o=[],i;function u(){i=e(o.map(function(h){return h.props})),t(i)}var g=function(h){Ea(m,h);function m(){return h.apply(this,arguments)||this}m.peek=function(){return i};var d=m.prototype;return d.componentDidMount=function(){o.push(this),u()},d.componentDidUpdate=function(){u()},d.componentWillUnmount=function(){var F=o.indexOf(this);o.splice(F,1),u()},d.render=function(){return q.createElement(a,this.props)},m}(b.PureComponent);return Pa(g,"displayName","SideEffect("+r(a)+")"),g}}var ve=function(e){for(var t=Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t},_e=function(e){return Array.isArray(e)?e:[e]},rn=function(e){return Array.isArray(e)?e[0]:e},Ia=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},nn=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},an=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},Da=function(e){return e.hasAttribute("inert")},Ta=function(e,t){return!e||an(e)||!Ia(e)&&!Da(e)&&t(nn(e))},on=function(e,t){var r=e.get(t);if(r!==void 0)return r;var n=Ta(t,on.bind(void 0,e));return e.set(t,n),n},Ra=function(e,t){return e&&!an(e)?Ba(e)?t(nn(e)):!1:!0},sn=function(e,t){var r=e.get(t);if(r!==void 0)return r;var n=Ra(t,sn.bind(void 0,e));return e.set(t,n),n},un=function(e){return e.dataset},Va=function(e){return e.tagName==="BUTTON"},cn=function(e){return e.tagName==="INPUT"},ln=function(e){return cn(e)&&e.type==="radio"},La=function(e){return!((cn(e)||Va(e))&&(e.type==="hidden"||e.disabled))},Ba=function(e){var t=e.getAttribute(pa);return![!0,"true",""].includes(t)},zt=function(e){var t;return!!(e&&(!((t=un(e))===null||t===void 0)&&t.focusGuard))},Wt=function(e){return!zt(e)},Wa=function(e){return!!e},ja=function(e,t){var r=Math.max(0,e.tabIndex),n=Math.max(0,t.tabIndex),a=r-n,o=e.index-t.index;if(a){if(!r)return 1;if(!n)return-1}return a||o},Ua=function(e){return e.tabIndex<0&&!e.hasAttribute("tabindex")?0:e.tabIndex},Kt=function(e,t,r){return ve(e).map(function(n,a){var o=Ua(n);return{node:n,index:a,tabIndex:r&&o===-1?(n.dataset||{}).focusGuard?0:-1:o}}).filter(function(n){return!t||n.tabIndex>=0}).sort(ja)},Ha=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Zt=Ha.join(","),qa="".concat(Zt,", [data-focus-guard]"),fn=function(e,t){return ve((e.shadowRoot||e).children).reduce(function(r,n){return r.concat(n.matches(t?qa:Zt)?[n]:[],fn(n))},[])},$a=function(e,t){var r;return e instanceof HTMLIFrameElement&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?Te([e.contentDocument.body],t):[e]},Te=function(e,t){return e.reduce(function(r,n){var a,o=fn(n,t),i=(a=[]).concat.apply(a,o.map(function(u){return $a(u,t)}));return r.concat(i,n.parentNode?ve(n.parentNode.querySelectorAll(Zt)).filter(function(u){return u===n}):[])},[])},Ga=function(e){var t=e.querySelectorAll("[".concat(ga,"]"));return ve(t).map(function(r){return Te([r])}).reduce(function(r,n){return r.concat(n)},[])},Qt=function(e,t){return ve(e).filter(function(r){return on(t,r)}).filter(function(r){return La(r)})},br=function(e,t){return t===void 0&&(t=new Map),ve(e).filter(function(r){return sn(t,r)})},Jt=function(e,t,r){return Kt(Qt(Te(e,r),t),!0,r)},ze=function(e,t){return Kt(Qt(Te(e),t),!1)},Ya=function(e,t){return Qt(Ga(e),t)},Se=function(e,t){return e.shadowRoot?Se(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:ve(e.children).some(function(r){var n;if(r instanceof HTMLIFrameElement){var a=(n=r.contentDocument)===null||n===void 0?void 0:n.body;return a?Se(a,t):!1}return Se(r,t)})},Xa=function(e){for(var t=new Set,r=e.length,n=0;n<r;n+=1)for(var a=n+1;a<r;a+=1){var o=e[n].compareDocumentPosition(e[a]);(o&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(a),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(n)}return e.filter(function(i,u){return!t.has(u)})},dn=function(e){return e.parentNode?dn(e.parentNode):e},er=function(e){var t=_e(e);return t.filter(Boolean).reduce(function(r,n){var a=n.getAttribute(Lt);return r.push.apply(r,a?Xa(ve(dn(n).querySelectorAll("[".concat(Lt,'="').concat(a,'"]:not([').concat(Yr,'="disabled"])')))):[n]),r},[])},za=function(e){try{return e()}catch{return}},Ke=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ke(t.shadowRoot):t instanceof HTMLIFrameElement&&za(function(){return t.contentWindow.document})?Ke(t.contentWindow.document):t}},Ka=function(e,t){return e===t},Za=function(e,t){return!!ve(e.querySelectorAll("iframe")).some(function(r){return Ka(r,t)})},vn=function(e,t){return t===void 0&&(t=Ke(rn(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:er(e).some(function(r){return Se(r,t)||Za(r,t)})},Qa=function(e){e===void 0&&(e=document);var t=Ke(e);return t?ve(e.querySelectorAll("[".concat(ba,"]"))).some(function(r){return Se(r,t)}):!1},Ja=function(e,t){return t.filter(ln).filter(function(r){return r.name===e.name}).filter(function(r){return r.checked})[0]||e},tr=function(e,t){return ln(e)&&e.name?Ja(e,t):e},eo=function(e){var t=new Set;return e.forEach(function(r){return t.add(tr(r,e))}),e.filter(function(r){return t.has(r)})},gr=function(e){return e[0]&&e.length>1?tr(e[0],e):e[0]},pr=function(e,t){return e.indexOf(tr(t,e))},jt="NEW_FOCUS",to=function(e,t,r,n,a){var o=e.length,i=e[0],u=e[o-1],g=zt(n);if(!(n&&e.indexOf(n)>=0)){var h=n!==void 0?r.indexOf(n):-1,m=a?r.indexOf(a):h,d=a?e.indexOf(a):-1;if(h===-1)return d!==-1?d:jt;if(d===-1)return jt;var f=h-m,F=r.indexOf(i),S=r.indexOf(u),v=eo(r),k=n!==void 0?v.indexOf(n):-1,M=a?v.indexOf(a):k,x=v.filter(function(z){return z.tabIndex>=0}),E=n!==void 0?x.indexOf(n):-1,O=a?x.indexOf(a):E,C=E>=0&&O>=0?O-E:M-k;if(!f&&d>=0||t.length===0)return d;var V=pr(e,t[0]),B=pr(e,t[t.length-1]);if(h<=F&&g&&Math.abs(f)>1)return B;if(h>=S&&g&&Math.abs(f)>1)return V;if(f&&Math.abs(C)>1)return d;if(h<=F)return B;if(h>S)return V;if(f)return Math.abs(f)>1?d:(o+d+f)%o}},ro=function(e){return function(t){var r,n=(r=un(t))===null||r===void 0?void 0:r.autofocus;return t.autofocus||n!==void 0&&n!=="false"||e.indexOf(t)>=0}},xr=function(e,t,r){var n=e.map(function(o){var i=o.node;return i}),a=br(n.filter(ro(r)));return a&&a.length?gr(a):gr(br(t))},Ut=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Ut(e.parentNode.host||e.parentNode,t),t},Ot=function(e,t){for(var r=Ut(e),n=Ut(t),a=0;a<r.length;a+=1){var o=r[a];if(n.indexOf(o)>=0)return o}return!1},hn=function(e,t,r){var n=_e(e),a=_e(t),o=n[0],i=!1;return a.filter(Boolean).forEach(function(u){i=Ot(i||u,u)||i,r.filter(Boolean).forEach(function(g){var h=Ot(o,g);h&&(!i||Se(h,i)?i=h:i=Ot(h,i))})}),i},wr=function(e,t){return e.reduce(function(r,n){return r.concat(Ya(n,t))},[])},no=function(e,t){var r=new Map;return t.forEach(function(n){return r.set(n.node,n)}),e.map(function(n){return r.get(n)}).filter(Wa)},ao=function(e,t){var r=Ke(_e(e).length>0?document:rn(e).ownerDocument),n=er(e).filter(Wt),a=hn(r||e,e,n),o=new Map,i=ze(n,o),u=i.filter(function(S){var v=S.node;return Wt(v)});if(u[0]){var g=ze([a],o).map(function(S){var v=S.node;return v}),h=no(g,u),m=h.map(function(S){var v=S.node;return v}),d=h.filter(function(S){var v=S.tabIndex;return v>=0}).map(function(S){var v=S.node;return v}),f=to(m,d,g,r,t);if(f===jt){var F=xr(i,d,wr(n,o))||xr(i,m,wr(n,o));if(F)return{node:F};console.warn("focus-lock: cannot find any node to move focus into");return}return f===void 0?f:h[f]}},oo=function(e){var t=er(e).filter(Wt),r=hn(e,e,t),n=Kt(Te([r],!0),!0,!0),a=Te(t,!1);return n.map(function(o){var i=o.node,u=o.index;return{node:i,index:u,lockItem:a.indexOf(i)>=0,guard:zt(i)}})},rr=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Pt=0,Nt=!1,mn=function(e,t,r){r===void 0&&(r={});var n=ao(e,t);if(!Nt&&n){if(Pt>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Nt=!0,setTimeout(function(){Nt=!1},1);return}Pt++,rr(n.node,r.focusOptions),Pt--}};function je(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var so=function(e){if(!e)return null;for(var t=[],r=e;r&&r!==document.body;)t.push({current:je(r),parent:je(r.parentElement),left:je(r.previousElementSibling),right:je(r.nextElementSibling)}),r=r.parentElement;return{element:je(e),stack:t,ownerDocument:e.ownerDocument}},io=function(e){var t,r,n,a,o;if(e)for(var i=e.stack,u=e.ownerDocument,g=new Map,h=0,m=i;h<m.length;h++){var d=m[h],f=(t=d.parent)===null||t===void 0?void 0:t.call(d);if(f&&u.contains(f)){for(var F=(r=d.left)===null||r===void 0?void 0:r.call(d),S=d.current(),v=f.contains(S)?S:void 0,k=(n=d.right)===null||n===void 0?void 0:n.call(d),M=Jt([f],g),x=(o=(a=v??(F==null?void 0:F.nextElementSibling))!==null&&a!==void 0?a:k)!==null&&o!==void 0?o:F;x;){for(var E=0,O=M;E<O.length;E++){var C=O[E];if(x!=null&&x.contains(C.node))return C.node}x=x.nextElementSibling}if(M.length)return M[0].node}}},yn=function(e){var t=so(e);return function(){return io(t)}},uo=function(e,t,r){if(!e||!t)return console.error("no element or scope given"),{};var n=_e(t);if(n.every(function(i){return!Se(i,e)}))return console.error("Active element is not contained in the scope"),{};var a=r?Jt(n,new Map):ze(n,new Map),o=a.findIndex(function(i){var u=i.node;return u===e});if(o!==-1)return{prev:a[o-1],next:a[o+1],first:a[0],last:a[a.length-1]}},co=function(e,t){var r=t?Jt(_e(e),new Map):ze(_e(e),new Map);return{first:r[0],last:r[r.length-1]}},lo=function(e){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},e)},bn=function(e,t,r){t===void 0&&(t={});var n=lo(t),a=uo(e,n.scope,n.onlyTabbable);if(a){var o=r(a,n.cycle);o&&rr(o.node,n.focusOptions)}},fo=function(e,t){t===void 0&&(t={}),bn(e,t,function(r,n){var a=r.next,o=r.first;return a||n&&o})},vo=function(e,t){t===void 0&&(t={}),bn(e,t,function(r,n){var a=r.prev,o=r.last;return a||n&&o})},gn=function(e,t,r){var n,a=co(e,(n=t.onlyTabbable)!==null&&n!==void 0?n:!0),o=a[r];o&&rr(o.node,t.focusOptions)},ho=function(e,t){t===void 0&&(t={}),gn(e,t,"first")},mo=function(e,t){t===void 0&&(t={}),gn(e,t,"last")};function nr(e){setTimeout(e,1)}var yo=function(t){return t&&"current"in t?t.current:t},pn=function(){return document&&document.activeElement===document.body},bo=function(){return pn()||Qa()},Ne=null,ee=null,Fr=function(){return null},Ie=null,Ze=!1,ar=!1,go=function(){return!0},po=function(t){return(Ne.whiteList||go)(t)},xo=function(t,r){Ie={observerNode:t,portaledElement:r}},wo=function(t){return Ie&&Ie.portaledElement===t};function Sr(e,t,r,n){var a=null,o=e;do{var i=n[o];if(i.guard)i.node.dataset.focusAutoGuard&&(a=i);else if(i.lockItem){if(o!==e)return;a=null}else break}while((o+=r)!==t);a&&(a.node.tabIndex=0)}var Fo=function(t){return t?!!Ze:Ze==="meanwhile"},So=function e(t,r,n){return r&&(r.host===t&&(!r.activeElement||n.contains(r.activeElement))||r.parentNode&&e(t,r.parentNode,n))},_o=function(t,r){return r.some(function(n){return So(t,n,n)})},xn=function(t){return ze(t,new Map)},Ao=function(t){return!xn([t.parentNode]).some(function(r){return r.node===t})},vt=function(){var t=!1;if(Ne){var r=Ne,n=r.observed,a=r.persistentFocus,o=r.autoFocus,i=r.shards,u=r.crossFrame,g=r.focusOptions,h=r.noFocusGuards,m=n||Ie&&Ie.portaledElement;if(pn()&&ee&&ee!==document.body&&(!document.body.contains(ee)||Ao(ee))){var d=Fr();d&&d.focus()}var f=document&&document.activeElement;if(m){var F=[m].concat(i.map(yo).filter(Boolean)),S=function(){if(!Fo(u)||!h||!ee||ar)return!1;var E=xn(F),O=E.findIndex(function(C){var V=C.node;return V===ee});return O===0||O===E.length-1};if((!f||po(f))&&(a||S()||!bo()||!ee&&o)&&(m&&!(vn(F)||f&&_o(f,F)||wo(f))&&(document&&!ee&&f&&!o?(f.blur&&f.blur(),document.body.focus()):(t=mn(F,ee,{focusOptions:g}),Ie={})),ee=document&&document.activeElement,ee!==document.body&&(Fr=yn(ee)),Ze=!1),document&&f!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var v=document&&document.activeElement,k=oo(F),M=k.map(function(x){var E=x.node;return E}).indexOf(v);M>-1&&(k.filter(function(x){var E=x.guard,O=x.node;return E&&O.dataset.focusAutoGuard}).forEach(function(x){var E=x.node;return E.removeAttribute("tabIndex")}),Sr(M,k.length,1,k),Sr(M,-1,-1,k))}}}return t},wn=function(t){vt()&&t&&(t.stopPropagation(),t.preventDefault())},or=function(){return nr(vt)},ko=function(t){var r=t.target,n=t.currentTarget;n.contains(r)||xo(n,r)},Co=function(){return null},Fn=function(){ar=!0},Sn=function(){ar=!1,Ze="just",nr(function(){Ze="meanwhile"})},Eo=function(){document.addEventListener("focusin",wn),document.addEventListener("focusout",or),window.addEventListener("focus",Fn),window.addEventListener("blur",Sn)},Mo=function(){document.removeEventListener("focusin",wn),document.removeEventListener("focusout",or),window.removeEventListener("focus",Fn),window.removeEventListener("blur",Sn)};function Oo(e){return e.filter(function(t){var r=t.disabled;return!r})}var _n={moveFocusInside:mn,focusInside:vn,focusNextElement:fo,focusPrevElement:vo,focusFirstElement:ho,focusLastElement:mo,captureFocusRestore:yn};function Po(e){var t=e.slice(-1)[0];t&&!Ne&&Eo();var r=Ne,n=r&&t&&t.id===r.id;Ne=t,r&&!n&&(r.onDeactivation(),e.filter(function(a){var o=a.id;return o===r.id}).length||r.returnFocus(!t)),t?(ee=null,(!n||r.observed!==t.observed)&&t.onActivation(_n),vt(),nr(vt)):(Mo(),ee=null)}en.assignSyncMedium(ko);tn.assignMedium(or);_a.assignMedium(function(e){return e(_n)});const No=Na(Oo,Po)(Co);var Ht=b.forwardRef(function(t,r){return q.createElement(Xt,Vt({sideCar:No,ref:r},t))}),An=Xt.propTypes||{};An.sideCar;ya(An,["sideCar"]);Ht.propTypes={};const Io=Ht.default??Ht,kn=e=>{const{initialFocusRef:t,finalFocusRef:r,contentRef:n,restoreFocus:a,children:o,isDisabled:i,autoFocus:u,persistentFocus:g,lockFocusAcrossFrames:h}=e,m=b.useCallback(()=>{t!=null&&t.current?t.current.focus():n!=null&&n.current&&ha(n.current).length===0&&requestAnimationFrame(()=>{var S;(S=n.current)==null||S.focus()})},[t,n]),d=b.useCallback(()=>{var F;(F=r==null?void 0:r.current)==null||F.focus()},[r]),f=a&&!r;return T.jsx(Io,{crossFrame:h,persistentFocus:g,autoFocus:u,disabled:i,onActivation:m,onDeactivation:d,returnFocus:f,children:o})};kn.displayName="FocusLock";const Do=de(function(t,r){const n=jr("FormLabel",t),a=Ur(t),{className:o,children:i,requiredIndicator:u=T.jsx(Cn,{}),optionalIndicator:g=null,...h}=a,m=qr(),d=(m==null?void 0:m.getLabelProps(h,r))??{ref:r,...h};return T.jsxs(ie.label,{...d,className:te("chakra-form__label",a.className),__css:{display:"block",textAlign:"start",...n},children:[i,m!=null&&m.isRequired?u:g]})});Do.displayName="FormLabel";const Cn=de(function(t,r){const n=qr(),a=ua();if(!(n!=null&&n.isRequired))return null;const o=te("chakra-form__required-indicator",t.className);return T.jsx(ie.span,{...n==null?void 0:n.getRequiredIndicatorProps(t,r),__css:a.requiredIndicator,className:o})});Cn.displayName="RequiredIndicator";const To=de(function(t,r){const n=jr("Link",t),{className:a,isExternal:o,...i}=Ur(t);return T.jsx(ie.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:r,className:te("chakra-link",a),...i,__css:n})});To.displayName="Link";var Ro=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ee=new WeakMap,ot=new WeakMap,st={},It=0,En=function(e){return e&&(e.host||En(e.parentNode))},Vo=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=En(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Lo=function(e,t,r,n){var a=Vo(t,Array.isArray(e)?e:[e]);st[r]||(st[r]=new WeakMap);var o=st[r],i=[],u=new Set,g=new Set(a),h=function(d){!d||u.has(d)||(u.add(d),h(d.parentNode))};a.forEach(h);var m=function(d){!d||g.has(d)||Array.prototype.forEach.call(d.children,function(f){if(u.has(f))m(f);else try{var F=f.getAttribute(n),S=F!==null&&F!=="false",v=(Ee.get(f)||0)+1,k=(o.get(f)||0)+1;Ee.set(f,v),o.set(f,k),i.push(f),v===1&&S&&ot.set(f,!0),k===1&&f.setAttribute(r,"true"),S||f.setAttribute(n,"true")}catch(M){console.error("aria-hidden: cannot operate on ",f,M)}})};return m(t),u.clear(),It++,function(){i.forEach(function(d){var f=Ee.get(d)-1,F=o.get(d)-1;Ee.set(d,f),o.set(d,F),f||(ot.has(d)||d.removeAttribute(n),ot.delete(d)),F||d.removeAttribute(r)}),It--,It||(Ee=new WeakMap,Ee=new WeakMap,ot=new WeakMap,st={})}},Bo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=Ro(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),Lo(n,a,r,"aria-hidden")):function(){return null}},Wo=Object.defineProperty,jo=(e,t,r)=>t in e?Wo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uo=(e,t,r)=>(jo(e,t+"",r),r);class Ho{constructor(){Uo(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const r=Array.from(this.modals)[this.modals.size-1];return t===r}}const qt=new Ho;function Mn(e,t){const[r,n]=b.useState(0);return b.useEffect(()=>{const a=e.current;if(a){if(t){const o=qt.add(a);n(o)}return()=>{qt.remove(a),n(0)}}},[t,e]),r}function qo(e){const{isOpen:t,onClose:r,id:n,closeOnOverlayClick:a=!0,closeOnEsc:o=!0,useInert:i=!0,onOverlayClick:u,onEsc:g}=e,h=b.useRef(null),m=b.useRef(null),[d,f,F]=Go(n,"chakra-modal","chakra-modal--header","chakra-modal--body");$o(h,t&&i);const S=Mn(h,t),v=b.useRef(null),k=b.useCallback(N=>{v.current=N.target},[]),M=b.useCallback(N=>{N.key==="Escape"&&(N.stopPropagation(),o&&(r==null||r()),g==null||g())},[o,r,g]),[x,E]=b.useState(!1),[O,C]=b.useState(!1),V=b.useCallback((N={},K=null)=>({role:"dialog",...N,ref:vr(K,h),id:d,tabIndex:-1,"aria-modal":!0,"aria-labelledby":x?f:void 0,"aria-describedby":O?F:void 0,onClick:qe(N.onClick,G=>G.stopPropagation())}),[F,O,d,f,x]),B=b.useCallback(N=>{N.stopPropagation(),v.current===N.target&&qt.isTopModal(h.current)&&(a&&(r==null||r()),u==null||u())},[r,a,u]),z=b.useCallback((N={},K=null)=>({...N,ref:vr(K,m),onClick:qe(N.onClick,B),onKeyDown:qe(N.onKeyDown,M),onMouseDown:qe(N.onMouseDown,k)}),[M,k,B]);return{isOpen:t,onClose:r,headerId:f,bodyId:F,setBodyMounted:C,setHeaderMounted:E,dialogRef:h,overlayRef:m,getDialogProps:V,getDialogContainerProps:z,index:S}}function $o(e,t){const r=e.current;b.useEffect(()=>{if(!(!e.current||!t))return Bo(e.current)},[t,e,r])}function Go(e,...t){const r=b.useId(),n=e||r;return b.useMemo(()=>t.map(a=>`${a}-${n}`),[n,t])}const[Yo,Re]=Hr({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[Xo,Ae]=Hr({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),zo=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames||!0},{portalProps:r,children:n,autoFocus:a,trapFocus:o,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:g,blockScrollOnMount:h,allowPinchZoom:m,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:F,animatePresenceProps:S,onCloseComplete:v}=t,k=ta("Modal",t),x={...qo(t),autoFocus:a,trapFocus:o,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:g,blockScrollOnMount:h,allowPinchZoom:m,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:F};return T.jsx(Xo,{value:x,children:T.jsx(Yo,{value:k,children:T.jsx(bt,{...S,onExitComplete:v,children:x.isOpen&&T.jsx(ra,{...r,children:n})})})})};zo.displayName="Modal";var ct="right-scroll-bar-position",lt="width-before-scroll-bar",Ko="with-scroll-bars-hidden",Zo="--removed-body-scroll-bar-size",On=Qr(),Dt=function(){},gt=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:Dt,onWheelCapture:Dt,onTouchMoveCapture:Dt}),a=n[0],o=n[1],i=e.forwardProps,u=e.children,g=e.className,h=e.removeScrollBar,m=e.enabled,d=e.shards,f=e.sideCar,F=e.noIsolation,S=e.inert,v=e.allowPinchZoom,k=e.as,M=k===void 0?"div":k,x=e.gapMode,E=zr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=f,C=Xr([r,t]),V=le(le({},E),a);return b.createElement(b.Fragment,null,m&&b.createElement(O,{sideCar:On,removeScrollBar:h,shards:d,noIsolation:F,inert:S,setCallbacks:o,allowPinchZoom:!!v,lockRef:r,gapMode:x}),i?b.cloneElement(b.Children.only(u),le(le({},V),{ref:C})):b.createElement(M,le({},V,{className:g,ref:C}),u))});gt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gt.classNames={fullWidth:lt,zeroRight:ct};var Qo=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jo(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qo();return t&&e.setAttribute("nonce",t),e}function es(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ts(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rs=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Jo())&&(es(t,r),ts(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ns=function(){var e=rs();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Pn=function(){var e=ns(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},as={left:0,top:0,right:0,gap:0},Tt=function(e){return parseInt(e||"",10)||0},os=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Tt(r),Tt(n),Tt(a)]},ss=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return as;var t=os(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},is=Pn(),De="data-scroll-locked",us=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
  .`.concat(Ko,` {
   overflow: hidden `).concat(n,`;
   padding-right: `).concat(u,"px ").concat(n,`;
  }
  body[`).concat(De,`] {
    overflow: hidden `).concat(n,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
    padding-left: `.concat(a,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(i,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(u,"px ").concat(n,`;
    `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(ct,` {
    right: `).concat(u,"px ").concat(n,`;
  }
  
  .`).concat(lt,` {
    margin-right: `).concat(u,"px ").concat(n,`;
  }
  
  .`).concat(ct," .").concat(ct,` {
    right: 0 `).concat(n,`;
  }
  
  .`).concat(lt," .").concat(lt,` {
    margin-right: 0 `).concat(n,`;
  }
  
  body[`).concat(De,`] {
    `).concat(Zo,": ").concat(u,`px;
  }
`)},_r=function(){var e=parseInt(document.body.getAttribute(De)||"0",10);return isFinite(e)?e:0},cs=function(){b.useEffect(function(){return document.body.setAttribute(De,(_r()+1).toString()),function(){var e=_r()-1;e<=0?document.body.removeAttribute(De):document.body.setAttribute(De,e.toString())}},[])},ls=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;cs();var o=b.useMemo(function(){return ss(a)},[a]);return b.createElement(is,{styles:us(o,!t,a,r?"":"!important")})},$t=!1;if(typeof window<"u")try{var it=Object.defineProperty({},"passive",{get:function(){return $t=!0,!0}});window.addEventListener("test",it,it),window.removeEventListener("test",it,it)}catch{$t=!1}var Me=$t?{passive:!1}:!1,fs=function(e){return e.tagName==="TEXTAREA"},Nn=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!fs(e)&&r[t]==="visible")},ds=function(e){return Nn(e,"overflowY")},vs=function(e){return Nn(e,"overflowX")},Ar=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=In(e,n);if(a){var o=Dn(e,n),i=o[1],u=o[2];if(i>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},hs=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},ms=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},In=function(e,t){return e==="v"?ds(t):vs(t)},Dn=function(e,t){return e==="v"?hs(t):ms(t)},ys=function(e,t){return e==="h"&&t==="rtl"?-1:1},bs=function(e,t,r,n,a){var o=ys(e,window.getComputedStyle(t).direction),i=o*n,u=r.target,g=t.contains(u),h=!1,m=i>0,d=0,f=0;do{var F=Dn(e,u),S=F[0],v=F[1],k=F[2],M=v-k-o*S;(S||M)&&In(e,u)&&(d+=M,f+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!g&&u!==document.body||g&&(t.contains(u)||t===u));return(m&&Math.abs(d)<1||!m&&Math.abs(f)<1)&&(h=!0),h},ut=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kr=function(e){return[e.deltaX,e.deltaY]},Cr=function(e){return e&&"current"in e?e.current:e},gs=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ps=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},xs=0,Oe=[];function ws(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),a=b.useState(xs++)[0],o=b.useState(Pn)[0],i=b.useRef(e);b.useEffect(function(){i.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Fa([e.lockRef.current],(e.shards||[]).map(Cr),!0).filter(Boolean);return v.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(v,k){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var M=ut(v),x=r.current,E="deltaX"in v?v.deltaX:x[0]-M[0],O="deltaY"in v?v.deltaY:x[1]-M[1],C,V=v.target,B=Math.abs(E)>Math.abs(O)?"h":"v";if("touches"in v&&B==="h"&&V.type==="range")return!1;var z=Ar(B,V);if(!z)return!0;if(z?C=B:(C=B==="v"?"h":"v",z=Ar(B,V)),!z)return!1;if(!n.current&&"changedTouches"in v&&(E||O)&&(n.current=C),!C)return!0;var N=n.current||C;return bs(N,k,v,N==="h"?E:O)},[]),g=b.useCallback(function(v){var k=v;if(!(!Oe.length||Oe[Oe.length-1]!==o)){var M="deltaY"in k?kr(k):ut(k),x=t.current.filter(function(C){return C.name===k.type&&(C.target===k.target||k.target===C.shadowParent)&&gs(C.delta,M)})[0];if(x&&x.should){k.cancelable&&k.preventDefault();return}if(!x){var E=(i.current.shards||[]).map(Cr).filter(Boolean).filter(function(C){return C.contains(k.target)}),O=E.length>0?u(k,E[0]):!i.current.noIsolation;O&&k.cancelable&&k.preventDefault()}}},[]),h=b.useCallback(function(v,k,M,x){var E={name:v,delta:k,target:M,should:x,shadowParent:Fs(M)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(O){return O!==E})},1)},[]),m=b.useCallback(function(v){r.current=ut(v),n.current=void 0},[]),d=b.useCallback(function(v){h(v.type,kr(v),v.target,u(v,e.lockRef.current))},[]),f=b.useCallback(function(v){h(v.type,ut(v),v.target,u(v,e.lockRef.current))},[]);b.useEffect(function(){return Oe.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",g,Me),document.addEventListener("touchmove",g,Me),document.addEventListener("touchstart",m,Me),function(){Oe=Oe.filter(function(v){return v!==o}),document.removeEventListener("wheel",g,Me),document.removeEventListener("touchmove",g,Me),document.removeEventListener("touchstart",m,Me)}},[]);var F=e.removeScrollBar,S=e.inert;return b.createElement(b.Fragment,null,S?b.createElement(o,{styles:ps(a)}):null,F?b.createElement(ls,{gapMode:e.gapMode}):null)}function Fs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ss=Sa(On,ws);var Tn=b.forwardRef(function(e,t){return b.createElement(gt,le({},e,{ref:t,sideCar:Ss}))});Tn.classNames=gt.classNames;function _s(e){const{autoFocus:t,trapFocus:r,dialogRef:n,initialFocusRef:a,blockScrollOnMount:o,allowPinchZoom:i,finalFocusRef:u,returnFocusOnClose:g,preserveScrollBarGap:h,lockFocusAcrossFrames:m,isOpen:d}=Ae(),[f,F]=na();b.useEffect(()=>{!f&&F&&setTimeout(F)},[f,F]);const S=Mn(n,d);return T.jsx(kn,{autoFocus:t,isDisabled:!r,initialFocusRef:a,finalFocusRef:u,restoreFocus:g,contentRef:n,lockFocusAcrossFrames:m,children:T.jsx(Tn,{removeScrollBar:!h,allowPinchZoom:i,enabled:S===1&&o,forwardProps:!0,children:e.children})})}const As={initial:({offsetX:e,offsetY:t,transition:r,transitionEnd:n,delay:a})=>({opacity:0,x:e,y:t,transition:(r==null?void 0:r.exit)??Fe.exit(we.exit,a),transitionEnd:n==null?void 0:n.exit}),enter:({transition:e,transitionEnd:t,delay:r})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??Fe.enter(we.enter,r),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:r,transitionEnd:n,reverse:a,delay:o})=>{const i={x:t,y:e};return{opacity:0,transition:(r==null?void 0:r.exit)??Fe.exit(we.exit,o),...a?{...i,transitionEnd:n==null?void 0:n.exit}:{transitionEnd:{...i,...n==null?void 0:n.exit}}}}},$e={initial:"initial",animate:"enter",exit:"exit",variants:As},ks=b.forwardRef(function(t,r){const{unmountOnExit:n,in:a,reverse:o=!0,className:i,offsetX:u=0,offsetY:g=8,transition:h,transitionEnd:m,delay:d,animatePresenceProps:f,...F}=t,S=n?a&&n:!0,v=a||n?"enter":"exit",k={offsetX:u,offsetY:g,reverse:o,transition:h,transitionEnd:m,delay:d};return T.jsx(bt,{...f,custom:k,children:S&&T.jsx(Qe.div,{ref:r,className:te("chakra-offset-slide",i),custom:k,...$e,animate:v,...F})})});ks.displayName="SlideFade";const Cs={exit:({reverse:e,initialScale:t,transition:r,transitionEnd:n,delay:a})=>({opacity:0,...e?{scale:t,transitionEnd:n==null?void 0:n.exit}:{transitionEnd:{scale:t,...n==null?void 0:n.exit}},transition:(r==null?void 0:r.exit)??Fe.exit(we.exit,a)}),enter:({transitionEnd:e,transition:t,delay:r})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??Fe.enter(we.enter,r),transitionEnd:e==null?void 0:e.enter})},Rn={initial:"exit",animate:"enter",exit:"exit",variants:Cs},Es=b.forwardRef(function(t,r){const{unmountOnExit:n,in:a,reverse:o=!0,initialScale:i=.95,className:u,transition:g,transitionEnd:h,delay:m,animatePresenceProps:d,...f}=t,F=n?a&&n:!0,S=a||n?"enter":"exit",v={initialScale:i,reverse:o,transition:g,transitionEnd:h,delay:m};return T.jsx(bt,{...d,custom:v,children:F&&T.jsx(Qe.div,{ref:r,className:te("chakra-offset-slide",u),...Rn,animate:S,custom:v,...f})})});Es.displayName="ScaleFade";const Ms={slideInBottom:{...$e,custom:{offsetY:16,reverse:!0}},slideInRight:{...$e,custom:{offsetX:16,reverse:!0}},slideInTop:{...$e,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...$e,custom:{offsetX:-16,reverse:!0}},scale:{...Rn,custom:{initialScale:.95,reverse:!0}},none:{}},Os=ie(Qe.section),Ps=e=>Ms[e||"none"],Vn=b.forwardRef((e,t)=>{const{preset:r,motionProps:n=Ps(r),...a}=e;return T.jsx(Os,{ref:t,...n,...a})});Vn.displayName="ModalTransition";const Ns=de((e,t)=>{const{className:r,children:n,containerProps:a,motionProps:o,...i}=e,{getDialogProps:u,getDialogContainerProps:g}=Ae(),h=u(i,t),m=g(a),d=te("chakra-modal__content",r),f=Re(),F=dt({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...f.dialog}),S=dt({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...f.dialogContainer}),{motionPreset:v}=Ae();return T.jsx(_s,{children:T.jsx(ie.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:T.jsx(Vn,{preset:v,motionProps:o,className:d,...h,__css:F,children:n})})})});Ns.displayName="ModalContent";const Is=de((e,t)=>{const{className:r,...n}=e,{bodyId:a,setBodyMounted:o}=Ae();b.useEffect(()=>(o(!0),()=>o(!1)),[o]);const i=te("chakra-modal__body",r),u=Re();return T.jsx(ie.div,{ref:t,className:i,id:a,...n,__css:u.body})});Is.displayName="ModalBody";const Ds=de((e,t)=>{const{onClick:r,className:n,...a}=e,{onClose:o}=Ae(),i=te("chakra-modal__close-btn",n),u=Re();return T.jsx(aa,{ref:t,__css:u.closeButton,className:i,onClick:qe(r,g=>{g.stopPropagation(),o()}),...a})});Ds.displayName="ModalCloseButton";const Ts=de((e,t)=>{const{className:r,...n}=e,a=te("chakra-modal__footer",r),o=Re(),i=dt({display:"flex",alignItems:"center",justifyContent:"flex-end",...o.footer});return T.jsx(ie.footer,{ref:t,...n,__css:i,className:a})});Ts.displayName="ModalFooter";const Rs=de((e,t)=>{const{className:r,...n}=e,{headerId:a,setHeaderMounted:o}=Ae();b.useEffect(()=>(o(!0),()=>o(!1)),[o]);const i=te("chakra-modal__header",r),u=Re(),g=dt({flex:0,...u.header});return T.jsx(ie.header,{ref:t,className:i,id:a,...n,__css:g})});Rs.displayName="ModalHeader";const Vs={enter:({transition:e,transitionEnd:t,delay:r}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??Fe.enter(we.enter,r),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:r}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??Fe.exit(we.exit,r),transitionEnd:t==null?void 0:t.exit})},Ln={initial:"exit",animate:"enter",exit:"exit",variants:Vs},Ls=b.forwardRef(function(t,r){const{unmountOnExit:n,in:a,className:o,transition:i,transitionEnd:u,delay:g,animatePresenceProps:h,...m}=t,d=a||n?"enter":"exit",f=n?a&&n:!0,F={transition:i,transitionEnd:u,delay:g};return T.jsx(bt,{...h,custom:F,children:f&&T.jsx(Qe.div,{ref:r,className:te("chakra-fade",o),custom:F,...Ln,animate:d,...m})})});Ls.displayName="Fade";const Bs=ie(Qe.div),Ws=de((e,t)=>{const{className:r,transition:n,motionProps:a,...o}=e,i=te("chakra-modal__overlay",r),g={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Re().overlay},{motionPreset:h}=Ae(),d=a||(h==="none"?{}:Ln);return T.jsx(Bs,{...d,__css:g,ref:t,className:i,...o})});Ws.displayName="ModalOverlay";const Bn=e=>T.jsx(ie.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});Bn.displayName="StackItem";function js(e){const{spacing:t,direction:r}=e,n={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":ma(r,a=>n[a])}}const Us=de((e,t)=>{const{isInline:r,direction:n,align:a,justify:o,spacing:i="0.5rem",wrap:u,children:g,divider:h,className:m,shouldWrapChildren:d,...f}=e,F=r?"row":n??"column",S=b.useMemo(()=>js({spacing:i,direction:F}),[i,F]),v=!!h,k=!d&&!v,M=b.useMemo(()=>{const E=ca(g);return k?E:E.map((O,C)=>{const V=typeof O.key<"u"?O.key:C,B=C+1===E.length,N=d?T.jsx(Bn,{children:O},V):O;if(!v)return N;const K=b.cloneElement(h,{__css:S}),G=B?null:K;return T.jsxs(b.Fragment,{children:[N,G]},V)})},[h,S,v,k,d,g]),x=te("chakra-stack",m);return T.jsx(ie.div,{ref:t,display:"flex",alignItems:a,justifyContent:o,flexDirection:F,flexWrap:u,gap:v?void 0:i,className:x,...f,children:M})});Us.displayName="Stack";function Hs(e,t){const r=e??"bottom",a={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(a==null?void 0:a[t])??r}function qs(e,t){const r=a=>({...t,...a,position:Hs((a==null?void 0:a.position)??(t==null?void 0:t.position),e)}),n=a=>{const o=r(a),i=oa(o);return We.notify(i,o)};return n.update=(a,o)=>{We.update(a,r(o))},n.promise=(a,o)=>{const i=n({...o.loading,status:"loading",duration:null});a.then(u=>n.update(i,{status:"success",duration:5e3,...hr(o.success,u)})).catch(u=>n.update(i,{status:"error",duration:5e3,...hr(o.error,u)}))},n.closeAll=We.closeAll,n.close=We.close,n.isActive=We.isActive,n}function mi(e){const{theme:t}=sa(),r=ia();return b.useMemo(()=>qs(t.direction,{...r,...e}),[e,t.direction,r])}const yi=(e,t,r)=>{e({title:r,status:t,duration:1e3,isClosable:!0,position:"top"})};var Je=e=>e.type==="checkbox",xe=e=>e instanceof Date,Q=e=>e==null;const Wn=e=>typeof e=="object";var W=e=>!Q(e)&&!Array.isArray(e)&&Wn(e)&&!xe(e),$s=e=>W(e)&&e.target?Je(e.target)?e.target.checked:e.target.value:e,Gs=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ys=(e,t)=>e.has(Gs(t)),Xs=e=>{const t=e.constructor&&e.constructor.prototype;return W(t)&&t.hasOwnProperty("isPrototypeOf")},sr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function X(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(sr&&(e instanceof Blob||n))&&(r||W(e)))if(t=r?[]:{},!r&&!Xs(e))t=e;else for(const a in e)e.hasOwnProperty(a)&&(t[a]=X(e[a]));else return e;return t}var pt=e=>Array.isArray(e)?e.filter(Boolean):[],U=e=>e===void 0,A=(e,t,r)=>{if(!t||!W(e))return r;const n=pt(t.split(/[,[\].]+?/)).reduce((a,o)=>Q(a)?a:a[o],e);return U(n)||n===e?U(e[t])?r:e[t]:n},ce=e=>typeof e=="boolean",ir=e=>/^\w*$/.test(e),jn=e=>pt(e.replace(/["|']|\]/g,"").split(/\.|\[/)),R=(e,t,r)=>{let n=-1;const a=ir(t)?[t]:jn(t),o=a.length,i=o-1;for(;++n<o;){const u=a[n];let g=r;if(n!==i){const h=e[u];g=W(h)||Array.isArray(h)?h:isNaN(+a[n+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=g,e=e[u]}};const Er={BLUR:"blur",FOCUS_OUT:"focusout"},oe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ye={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};q.createContext(null);var zs=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const i=o;return t._proxyFormState[i]!==oe.all&&(t._proxyFormState[i]=!n||oe.all),e[i]}});return a};const Ks=typeof window<"u"?b.useLayoutEffect:b.useEffect;var fe=e=>typeof e=="string",Zs=(e,t,r,n,a)=>fe(e)?(n&&t.watch.add(e),A(r,e,a)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),A(r,o))):(n&&(t.watchAll=!0),r),Qs=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Ge=e=>Array.isArray(e)?e:[e],Mr=()=>{let e=[];return{get observers(){return e},next:a=>{for(const o of e)o.next&&o.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(o=>o!==a)}}),unsubscribe:()=>{e=[]}}},Gt=e=>Q(e)||!Wn(e);function ge(e,t){if(Gt(e)||Gt(t))return e===t;if(xe(e)&&xe(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const o=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const i=t[a];if(xe(o)&&xe(i)||W(o)&&W(i)||Array.isArray(o)&&Array.isArray(i)?!ge(o,i):o!==i)return!1}}return!0}var Z=e=>W(e)&&!Object.keys(e).length,ur=e=>e.type==="file",se=e=>typeof e=="function",ht=e=>{if(!sr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Un=e=>e.type==="select-multiple",cr=e=>e.type==="radio",Js=e=>cr(e)||Je(e),Rt=e=>ht(e)&&e.isConnected;function ei(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=U(e)?n++:e[t[n++]];return e}function ti(e){for(const t in e)if(e.hasOwnProperty(t)&&!U(e[t]))return!1;return!0}function H(e,t){const r=Array.isArray(t)?t:ir(t)?[t]:jn(t),n=r.length===1?e:ei(e,r),a=r.length-1,o=r[a];return n&&delete n[o],a!==0&&(W(n)&&Z(n)||Array.isArray(n)&&ti(n))&&H(e,r.slice(0,-1)),e}var Hn=e=>{for(const t in e)if(se(e[t]))return!0;return!1};function mt(e,t={}){const r=Array.isArray(e);if(W(e)||r)for(const n in e)Array.isArray(e[n])||W(e[n])&&!Hn(e[n])?(t[n]=Array.isArray(e[n])?[]:{},mt(e[n],t[n])):Q(e[n])||(t[n]=!0);return t}function qn(e,t,r){const n=Array.isArray(e);if(W(e)||n)for(const a in e)Array.isArray(e[a])||W(e[a])&&!Hn(e[a])?U(t)||Gt(r[a])?r[a]=Array.isArray(e[a])?mt(e[a],[]):{...mt(e[a])}:qn(e[a],Q(t)?{}:t[a],r[a]):r[a]=!ge(e[a],t[a]);return r}var Ue=(e,t)=>qn(e,t,mt(t));const Or={value:!1,isValid:!1},Pr={value:!0,isValid:!0};var $n=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!U(e[0].attributes.value)?U(e[0].value)||e[0].value===""?Pr:{value:e[0].value,isValid:!0}:Pr:Or}return Or},Gn=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>U(e)?e:t?e===""?NaN:e&&+e:r&&fe(e)?new Date(e):n?n(e):e;const Nr={isValid:!1,value:null};var Yn=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Nr):Nr;function Ir(e){const t=e.ref;return ur(t)?t.files:cr(t)?Yn(e.refs).value:Un(t)?[...t.selectedOptions].map(({value:r})=>r):Je(t)?$n(e.refs).value:Gn(U(t.value)?e.ref.value:t.value,e)}var ri=(e,t,r,n)=>{const a={};for(const o of e){const i=A(t,o);i&&R(a,o,i._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},yt=e=>e instanceof RegExp,He=e=>U(e)?e:yt(e)?e.source:W(e)?yt(e.value)?e.value.source:e.value:e,Dr=e=>({isOnSubmit:!e||e===oe.onSubmit,isOnBlur:e===oe.onBlur,isOnChange:e===oe.onChange,isOnAll:e===oe.all,isOnTouch:e===oe.onTouched});const Tr="AsyncFunction";var ni=e=>!!e&&!!e.validate&&!!(se(e.validate)&&e.validate.constructor.name===Tr||W(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Tr)),ai=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Rr=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ye=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const o=A(e,a);if(o){const{_f:i,...u}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],a)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Ye(u,t))break}else if(W(u)&&Ye(u,t))break}}};function Vr(e,t,r){const n=A(e,r);if(n||ir(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const o=a.join("."),i=A(t,o),u=A(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(u&&u.type)return{name:o,error:u};a.pop()}return{name:r}}var oi=(e,t,r,n)=>{r(e);const{name:a,...o}=e;return Z(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||oe.all))},si=(e,t,r)=>!e||!t||e===t||Ge(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ii=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,ui=(e,t)=>!pt(A(e,t)).length&&H(e,t),ci=(e,t,r)=>{const n=Ge(A(e,r));return R(n,"root",t[r]),R(e,r,n),e},ft=e=>fe(e);function Lr(e,t,r="validate"){if(ft(e)||Array.isArray(e)&&e.every(ft)||ce(e)&&!e)return{type:r,message:ft(e)?e:"",ref:t}}var Pe=e=>W(e)&&!yt(e)?e:{value:e,message:""},Br=async(e,t,r,n,a,o)=>{const{ref:i,refs:u,required:g,maxLength:h,minLength:m,min:d,max:f,pattern:F,validate:S,name:v,valueAsNumber:k,mount:M}=e._f,x=A(r,v);if(!M||t.has(v))return{};const E=u?u[0]:i,O=I=>{a&&E.reportValidity&&(E.setCustomValidity(ce(I)?"":I||""),E.reportValidity())},C={},V=cr(i),B=Je(i),z=V||B,N=(k||ur(i))&&U(i.value)&&U(x)||ht(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,K=Qs.bind(null,v,n,C),G=(I,P,L,$=ye.maxLength,J=ye.minLength)=>{const re=I?P:L;C[v]={type:I?$:J,message:re,ref:i,...K(I?$:J,re)}};if(o?!Array.isArray(x)||!x.length:g&&(!z&&(N||Q(x))||ce(x)&&!x||B&&!$n(u).isValid||V&&!Yn(u).isValid)){const{value:I,message:P}=ft(g)?{value:!!g,message:g}:Pe(g);if(I&&(C[v]={type:ye.required,message:P,ref:E,...K(ye.required,P)},!n))return O(P),C}if(!N&&(!Q(d)||!Q(f))){let I,P;const L=Pe(f),$=Pe(d);if(!Q(x)&&!isNaN(x)){const J=i.valueAsNumber||x&&+x;Q(L.value)||(I=J>L.value),Q($.value)||(P=J<$.value)}else{const J=i.valueAsDate||new Date(x),re=ke=>new Date(new Date().toDateString()+" "+ke),ae=i.type=="time",ue=i.type=="week";fe(L.value)&&x&&(I=ae?re(x)>re(L.value):ue?x>L.value:J>new Date(L.value)),fe($.value)&&x&&(P=ae?re(x)<re($.value):ue?x<$.value:J<new Date($.value))}if((I||P)&&(G(!!I,L.message,$.message,ye.max,ye.min),!n))return O(C[v].message),C}if((h||m)&&!N&&(fe(x)||o&&Array.isArray(x))){const I=Pe(h),P=Pe(m),L=!Q(I.value)&&x.length>+I.value,$=!Q(P.value)&&x.length<+P.value;if((L||$)&&(G(L,I.message,P.message),!n))return O(C[v].message),C}if(F&&!N&&fe(x)){const{value:I,message:P}=Pe(F);if(yt(I)&&!x.match(I)&&(C[v]={type:ye.pattern,message:P,ref:i,...K(ye.pattern,P)},!n))return O(P),C}if(S){if(se(S)){const I=await S(x,r),P=Lr(I,E);if(P&&(C[v]={...P,...K(ye.validate,P.message)},!n))return O(P.message),C}else if(W(S)){let I={};for(const P in S){if(!Z(I)&&!n)break;const L=Lr(await S[P](x,r),E,P);L&&(I={...L,...K(P,L.message)},O(L.message),n&&(C[v]=I))}if(!Z(I)&&(C[v]={ref:E,...I},!n))return C}}return O(!0),C};const li={mode:oe.onSubmit,reValidateMode:oe.onChange,shouldFocusError:!0};function fi(e={}){let t={...li,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:se(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const n={};let a=W(t.defaultValues)||W(t.values)?X(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:X(a),i={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},g,h=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...m};const f={array:Mr(),state:Mr()},F=Dr(t.mode),S=Dr(t.reValidateMode),v=t.criteriaMode===oe.all,k=s=>c=>{clearTimeout(h),h=setTimeout(s,c)},M=async s=>{if(!t.disabled&&(m.isValid||d.isValid||s)){const c=t.resolver?Z((await N()).errors):await G(n,!0);c!==r.isValid&&f.state.next({isValid:c})}},x=(s,c)=>{!t.disabled&&(m.isValidating||m.validatingFields||d.isValidating||d.validatingFields)&&((s||Array.from(u.mount)).forEach(l=>{l&&(c?R(r.validatingFields,l,c):H(r.validatingFields,l))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Z(r.validatingFields)}))},E=(s,c=[],l,w,p=!0,y=!0)=>{if(w&&l&&!t.disabled){if(i.action=!0,y&&Array.isArray(A(n,s))){const _=l(A(n,s),w.argA,w.argB);p&&R(n,s,_)}if(y&&Array.isArray(A(r.errors,s))){const _=l(A(r.errors,s),w.argA,w.argB);p&&R(r.errors,s,_),ui(r.errors,s)}if((m.touchedFields||d.touchedFields)&&y&&Array.isArray(A(r.touchedFields,s))){const _=l(A(r.touchedFields,s),w.argA,w.argB);p&&R(r.touchedFields,s,_)}(m.dirtyFields||d.dirtyFields)&&(r.dirtyFields=Ue(a,o)),f.state.next({name:s,isDirty:P(s,c),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else R(o,s,c)},O=(s,c)=>{R(r.errors,s,c),f.state.next({errors:r.errors})},C=s=>{r.errors=s,f.state.next({errors:r.errors,isValid:!1})},V=(s,c,l,w)=>{const p=A(n,s);if(p){const y=A(o,s,U(l)?A(a,s):l);U(y)||w&&w.defaultChecked||c?R(o,s,c?y:Ir(p._f)):J(s,y),i.mount&&M()}},B=(s,c,l,w,p)=>{let y=!1,_=!1;const D={name:s};if(!t.disabled){if(!l||w){(m.isDirty||d.isDirty)&&(_=r.isDirty,r.isDirty=D.isDirty=P(),y=_!==D.isDirty);const j=ge(A(a,s),c);_=!!A(r.dirtyFields,s),j?H(r.dirtyFields,s):R(r.dirtyFields,s,!0),D.dirtyFields=r.dirtyFields,y=y||(m.dirtyFields||d.dirtyFields)&&_!==!j}if(l){const j=A(r.touchedFields,s);j||(R(r.touchedFields,s,l),D.touchedFields=r.touchedFields,y=y||(m.touchedFields||d.touchedFields)&&j!==l)}y&&p&&f.state.next(D)}return y?D:{}},z=(s,c,l,w)=>{const p=A(r.errors,s),y=(m.isValid||d.isValid)&&ce(c)&&r.isValid!==c;if(t.delayError&&l?(g=k(()=>O(s,l)),g(t.delayError)):(clearTimeout(h),g=null,l?R(r.errors,s,l):H(r.errors,s)),(l?!ge(p,l):p)||!Z(w)||y){const _={...w,...y&&ce(c)?{isValid:c}:{},errors:r.errors,name:s};r={...r,..._},f.state.next(_)}},N=async s=>{x(s,!0);const c=await t.resolver(o,t.context,ri(s||u.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(s),c},K=async s=>{const{errors:c}=await N(s);if(s)for(const l of s){const w=A(c,l);w?R(r.errors,l,w):H(r.errors,l)}else r.errors=c;return c},G=async(s,c,l={valid:!0})=>{for(const w in s){const p=s[w];if(p){const{_f:y,..._}=p;if(y){const D=u.array.has(y.name),j=p._f&&ni(p._f);j&&m.validatingFields&&x([w],!0);const Y=await Br(p,u.disabled,o,v,t.shouldUseNativeValidation&&!c,D);if(j&&m.validatingFields&&x([w]),Y[y.name]&&(l.valid=!1,c))break;!c&&(A(Y,y.name)?D?ci(r.errors,Y,y.name):R(r.errors,y.name,Y[y.name]):H(r.errors,y.name))}!Z(_)&&await G(_,c,l)}}return l.valid},I=()=>{for(const s of u.unMount){const c=A(n,s);c&&(c._f.refs?c._f.refs.every(l=>!Rt(l)):!Rt(c._f.ref))&&Ve(s)}u.unMount=new Set},P=(s,c)=>!t.disabled&&(s&&c&&R(o,s,c),!ge(Ce(),a)),L=(s,c,l)=>Zs(s,u,{...i.mount?o:U(c)?a:fe(s)?{[s]:c}:c},l,c),$=s=>pt(A(i.mount?o:a,s,t.shouldUnregister?A(a,s,[]):[])),J=(s,c,l={})=>{const w=A(n,s);let p=c;if(w){const y=w._f;y&&(!y.disabled&&R(o,s,Gn(c,y)),p=ht(y.ref)&&Q(c)?"":c,Un(y.ref)?[...y.ref.options].forEach(_=>_.selected=p.includes(_.value)):y.refs?Je(y.ref)?y.refs.length>1?y.refs.forEach(_=>(!_.defaultChecked||!_.disabled)&&(_.checked=Array.isArray(p)?!!p.find(D=>D===_.value):p===_.value)):y.refs[0]&&(y.refs[0].checked=!!p):y.refs.forEach(_=>_.checked=_.value===p):ur(y.ref)?y.ref.value="":(y.ref.value=p,y.ref.type||f.state.next({name:s,values:X(o)})))}(l.shouldDirty||l.shouldTouch)&&B(s,p,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&pe(s)},re=(s,c,l)=>{for(const w in c){const p=c[w],y=`${s}.${w}`,_=A(n,y);(u.array.has(s)||W(p)||_&&!_._f)&&!xe(p)?re(y,p,l):J(y,p,l)}},ae=(s,c,l={})=>{const w=A(n,s),p=u.array.has(s),y=X(c);R(o,s,y),p?(f.array.next({name:s,values:X(o)}),(m.isDirty||m.dirtyFields||d.isDirty||d.dirtyFields)&&l.shouldDirty&&f.state.next({name:s,dirtyFields:Ue(a,o),isDirty:P(s,y)})):w&&!w._f&&!Q(y)?re(s,y,l):J(s,y,l),Rr(s,u)&&f.state.next({...r}),f.state.next({name:i.mount?s:void 0,values:X(o)})},ue=async s=>{i.mount=!0;const c=s.target;let l=c.name,w=!0;const p=A(n,l),y=_=>{w=Number.isNaN(_)||xe(_)&&isNaN(_.getTime())||ge(_,A(o,l,_))};if(p){let _,D;const j=c.type?Ir(p._f):$s(s),Y=s.type===Er.BLUR||s.type===Er.FOCUS_OUT,Xn=!ai(p._f)&&!t.resolver&&!A(r.errors,l)&&!p._f.deps||ii(Y,A(r.touchedFields,l),r.isSubmitted,S,F),kt=Rr(l,u,Y);R(o,l,j),Y?(p._f.onBlur&&p._f.onBlur(s),g&&g(0)):p._f.onChange&&p._f.onChange(s);const Ct=B(l,j,Y),zn=!Z(Ct)||kt;if(!Y&&f.state.next({name:l,type:s.type,values:X(o)}),Xn)return(m.isValid||d.isValid)&&(t.mode==="onBlur"?Y&&M():Y||M()),zn&&f.state.next({name:l,...kt?{}:Ct});if(!Y&&kt&&f.state.next({...r}),t.resolver){const{errors:fr}=await N([l]);if(y(j),w){const Kn=Vr(r.errors,n,l),dr=Vr(fr,n,Kn.name||l);_=dr.error,l=dr.name,D=Z(fr)}}else x([l],!0),_=(await Br(p,u.disabled,o,v,t.shouldUseNativeValidation))[l],x([l]),y(j),w&&(_?D=!1:(m.isValid||d.isValid)&&(D=await G(n,!0)));w&&(p._f.deps&&pe(p._f.deps),z(l,D,_,Ct))}},ke=(s,c)=>{if(A(r.errors,c)&&s.focus)return s.focus(),1},pe=async(s,c={})=>{let l,w;const p=Ge(s);if(t.resolver){const y=await K(U(s)?s:p);l=Z(y),w=s?!p.some(_=>A(y,_)):l}else s?(w=(await Promise.all(p.map(async y=>{const _=A(n,y);return await G(_&&_._f?{[y]:_}:_)}))).every(Boolean),!(!w&&!r.isValid)&&M()):w=l=await G(n);return f.state.next({...!fe(s)||(m.isValid||d.isValid)&&l!==r.isValid?{}:{name:s},...t.resolver||!s?{isValid:l}:{},errors:r.errors}),c.shouldFocus&&!w&&Ye(n,ke,s?p:u.mount),w},Ce=s=>{const c={...i.mount?o:a};return U(s)?c:fe(s)?A(c,s):s.map(l=>A(c,l))},et=(s,c)=>({invalid:!!A((c||r).errors,s),isDirty:!!A((c||r).dirtyFields,s),error:A((c||r).errors,s),isValidating:!!A(r.validatingFields,s),isTouched:!!A((c||r).touchedFields,s)}),xt=s=>{s&&Ge(s).forEach(c=>H(r.errors,c)),f.state.next({errors:s?r.errors:{}})},tt=(s,c,l)=>{const w=(A(n,s,{_f:{}})._f||{}).ref,p=A(r.errors,s)||{},{ref:y,message:_,type:D,...j}=p;R(r.errors,s,{...j,...c,ref:w}),f.state.next({name:s,errors:r.errors,isValid:!1}),l&&l.shouldFocus&&w&&w.focus&&w.focus()},wt=(s,c)=>se(s)?f.state.subscribe({next:l=>s(L(void 0,c),l)}):L(s,c,!0),rt=s=>f.state.subscribe({next:c=>{si(s.name,c.name,s.exact)&&oi(c,s.formState||m,me,s.reRenderRoot)&&s.callback({values:{...o},...r,...c})}}).unsubscribe,Ft=s=>(i.mount=!0,d={...d,...s.formState},rt({...s,formState:d})),Ve=(s,c={})=>{for(const l of s?Ge(s):u.mount)u.mount.delete(l),u.array.delete(l),c.keepValue||(H(n,l),H(o,l)),!c.keepError&&H(r.errors,l),!c.keepDirty&&H(r.dirtyFields,l),!c.keepTouched&&H(r.touchedFields,l),!c.keepIsValidating&&H(r.validatingFields,l),!t.shouldUnregister&&!c.keepDefaultValue&&H(a,l);f.state.next({values:X(o)}),f.state.next({...r,...c.keepDirty?{isDirty:P()}:{}}),!c.keepIsValid&&M()},nt=({disabled:s,name:c})=>{(ce(s)&&i.mount||s||u.disabled.has(c))&&(s?u.disabled.add(c):u.disabled.delete(c))},Le=(s,c={})=>{let l=A(n,s);const w=ce(c.disabled)||ce(t.disabled);return R(n,s,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:s}},name:s,mount:!0,...c}}),u.mount.add(s),l?nt({disabled:ce(c.disabled)?c.disabled:t.disabled,name:s}):V(s,!0,c.value),{...w?{disabled:c.disabled||t.disabled}:{},...t.progressive?{required:!!c.required,min:He(c.min),max:He(c.max),minLength:He(c.minLength),maxLength:He(c.maxLength),pattern:He(c.pattern)}:{},name:s,onChange:ue,onBlur:ue,ref:p=>{if(p){Le(s,c),l=A(n,s);const y=U(p.value)&&p.querySelectorAll&&p.querySelectorAll("input,select,textarea")[0]||p,_=Js(y),D=l._f.refs||[];if(_?D.find(j=>j===y):y===l._f.ref)return;R(n,s,{_f:{...l._f,..._?{refs:[...D.filter(Rt),y,...Array.isArray(A(a,s))?[{}]:[]],ref:{type:y.type,name:s}}:{ref:y}}}),V(s,!1,void 0,y)}else l=A(n,s,{}),l._f&&(l._f.mount=!1),(t.shouldUnregister||c.shouldUnregister)&&!(Ys(u.array,s)&&i.action)&&u.unMount.add(s)}}},Be=()=>t.shouldFocusError&&Ye(n,ke,u.mount),St=s=>{ce(s)&&(f.state.next({disabled:s}),Ye(n,(c,l)=>{const w=A(n,l);w&&(c.disabled=w._f.disabled||s,Array.isArray(w._f.refs)&&w._f.refs.forEach(p=>{p.disabled=w._f.disabled||s}))},0,!1))},at=(s,c)=>async l=>{let w;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let p=X(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:y,values:_}=await N();r.errors=y,p=_}else await G(n);if(u.disabled.size)for(const y of u.disabled)R(p,y,void 0);if(H(r.errors,"root"),Z(r.errors)){f.state.next({errors:{}});try{await s(p,l)}catch(y){w=y}}else c&&await c({...r.errors},l),Be(),setTimeout(Be);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Z(r.errors)&&!w,submitCount:r.submitCount+1,errors:r.errors}),w)throw w},_t=(s,c={})=>{A(n,s)&&(U(c.defaultValue)?ae(s,X(A(a,s))):(ae(s,c.defaultValue),R(a,s,X(c.defaultValue))),c.keepTouched||H(r.touchedFields,s),c.keepDirty||(H(r.dirtyFields,s),r.isDirty=c.defaultValue?P(s,X(A(a,s))):P()),c.keepError||(H(r.errors,s),m.isValid&&M()),f.state.next({...r}))},ne=(s,c={})=>{const l=s?X(s):a,w=X(l),p=Z(s),y=p?a:w;if(c.keepDefaultValues||(a=l),!c.keepValues){if(c.keepDirtyValues){const _=new Set([...u.mount,...Object.keys(Ue(a,o))]);for(const D of Array.from(_))A(r.dirtyFields,D)?R(y,D,A(o,D)):ae(D,A(y,D))}else{if(sr&&U(s))for(const _ of u.mount){const D=A(n,_);if(D&&D._f){const j=Array.isArray(D._f.refs)?D._f.refs[0]:D._f.ref;if(ht(j)){const Y=j.closest("form");if(Y){Y.reset();break}}}}for(const _ of u.mount)ae(_,A(y,_))}o=X(y),f.array.next({values:{...y}}),f.state.next({values:{...y}})}u={mount:c.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues,i.watch=!!t.shouldUnregister,f.state.next({submitCount:c.keepSubmitCount?r.submitCount:0,isDirty:p?!1:c.keepDirty?r.isDirty:!!(c.keepDefaultValues&&!ge(s,a)),isSubmitted:c.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:p?{}:c.keepDirtyValues?c.keepDefaultValues&&o?Ue(a,o):r.dirtyFields:c.keepDefaultValues&&s?Ue(a,s):c.keepDirty?r.dirtyFields:{},touchedFields:c.keepTouched?r.touchedFields:{},errors:c.keepErrors?r.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},he=(s,c)=>ne(se(s)?s(o):s,c),be=(s,c={})=>{const l=A(n,s),w=l&&l._f;if(w){const p=w.refs?w.refs[0]:w.ref;p.focus&&(p.focus(),c.shouldSelect&&se(p.select)&&p.select())}},me=s=>{r={...r,...s}},lr={control:{register:Le,unregister:Ve,getFieldState:et,handleSubmit:at,setError:tt,_subscribe:rt,_runSchema:N,_getWatch:L,_getDirty:P,_setValid:M,_setFieldArray:E,_setDisabledField:nt,_setErrors:C,_getFieldArray:$,_reset:ne,_resetDefaultValues:()=>se(t.defaultValues)&&t.defaultValues().then(s=>{he(s,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:St,_subjects:f,_proxyFormState:m,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(s){i=s},get _defaultValues(){return a},get _names(){return u},set _names(s){u=s},get _formState(){return r},get _options(){return t},set _options(s){t={...t,...s}}},subscribe:Ft,trigger:pe,register:Le,handleSubmit:at,watch:wt,setValue:ae,getValues:Ce,reset:he,resetField:_t,clearErrors:xt,unregister:Ve,setError:tt,setFocus:be,getFieldState:et};return{...lr,formControl:lr}}function bi(e={}){const t=q.useRef(void 0),r=q.useRef(void 0),[n,a]=q.useState({isDirty:!1,isValidating:!1,isLoading:se(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:se(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:fi(e),formState:n},e.formControl&&e.defaultValues&&!se(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const o=t.current.control;return o._options=e,Ks(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:!0});return a(u=>({...u,isReady:!0})),o._formState.isReady=!0,i},[o]),q.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),q.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode),e.errors&&!Z(e.errors)&&o._setErrors(e.errors)},[o,e.errors,e.mode,e.reValidateMode]),q.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),q.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),q.useEffect(()=>{e.values&&!ge(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,a(i=>({...i}))):o._resetDefaultValues()},[o,e.values]),q.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=zs(n,o),t.current}export{Tn as A,Do as F,To as L,zo as M,ls as R,Us as S,Pa as _,Ns as a,Ws as b,Rs as c,Is as d,Ts as e,yi as f,Ds as g,bi as h,hi as i,ya as j,Xe as k,Bt as l,ma as m,Ea as n,Qr as o,zr as p,Xr as q,le as r,lt as s,Oa as t,mi as u,Pn as v,Fa as w,Sa as x,Bo as y,ct as z};