@wellesley/vendor 1.0.1 → 1.0.4

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.
@@ -1,10 +0,0 @@
1
- function Y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,D,k={exports:{}},r={};
2
- /**
3
- * @license React
4
- * react.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */function Q(){if(q)return r;q=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),p=Symbol.iterator;var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d=Object.assign,_={};function h(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||y}function m(){}function v(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||y}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=h.prototype;var b=v.prototype=new m;b.constructor=v,d(b,h.prototype),b.isPureReactComponent=!0;var S=Array.isArray,k=Object.prototype.hasOwnProperty,E={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function $(t,r,n){var o,u={},a=null,c=null;if(null!=r)for(o in void 0!==r.ref&&(c=r.ref),void 0!==r.key&&(a=""+r.key),r)k.call(r,o)&&!w.hasOwnProperty(o)&&(u[o]=r[o]);var i=arguments.length-2;if(1===i)u.children=n;else if(1<i){for(var f=Array(i),l=0;l<i;l++)f[l]=arguments[l+2];u.children=f}if(t&&t.defaultProps)for(o in i=t.defaultProps)void 0===u[o]&&(u[o]=i[o]);return{$$typeof:e,type:t,key:a,ref:c,props:u,_owner:E.current}}function R(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function g(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function j(r,n,o,u,a){var c=typeof r;("undefined"===c||"boolean"===c)&&(r=null);var i=!1;if(null===r)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(r.$$typeof){case e:case t:i=!0}}if(i)return a=a(i=r),r=""===u?"."+g(i,0):u,S(a)?(o="",null!=r&&(o=r.replace(C,"$&/")+"/"),j(a,n,o,"",(function(e){return e}))):null!=a&&(R(a)&&(a=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+r)),n.push(a)),1;if(i=0,u=""===u?".":u+":",S(r))for(var f=0;f<r.length;f++){var l=u+g(c=r[f],f);i+=j(c,n,o,l,a)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(r),"function"==typeof l)for(r=l.call(r),f=0;!(c=r.next()).done;)i+=j(c=c.value,n,o,l=u+g(c,f++),a);else if("object"===c)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return i}function x(e,t,r){if(null==e)return e;var n=[],o=0;return j(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function O(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)}),(function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P={current:null},I={transition:null},D={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:I,ReactCurrentOwner:E};return r.Children={map:x,forEach:function(e,t,r){x(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return x(e,(function(){t++})),t},toArray:function(e){return x(e,(function(e){return e}))||[]},only:function(e){if(!R(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=h,r.Fragment=n,r.Profiler=u,r.PureComponent=v,r.StrictMode=o,r.Suspense=f,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,r.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=d({},t.props),u=t.key,a=t.ref,c=t._owner;if(null!=r){if(void 0!==r.ref&&(a=r.ref,c=E.current),void 0!==r.key&&(u=""+r.key),t.type&&t.type.defaultProps)var i=t.type.defaultProps;for(f in r)k.call(r,f)&&!w.hasOwnProperty(f)&&(o[f]=void 0===r[f]&&void 0!==i?i[f]:r[f])}var f=arguments.length-2;if(1===f)o.children=n;else if(1<f){i=Array(f);for(var l=0;l<f;l++)i[l]=arguments[l+2];o.children=i}return{$$typeof:e,type:t.type,key:u,ref:a,props:o,_owner:c}},r.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},r.createElement=$,r.createFactory=function(e){var t=$.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:i,render:e}},r.isValidElement=R,r.lazy=function(e){return{$$typeof:s,_payload:{_status:-1,_result:e},_init:O}},r.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},r.startTransition=function(e){var t=I.transition;I.transition={};try{e()}finally{I.transition=t}},r.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},r.useCallback=function(e,t){return P.current.useCallback(e,t)},r.useContext=function(e){return P.current.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e){return P.current.useDeferredValue(e)},r.useEffect=function(e,t){return P.current.useEffect(e,t)},r.useId=function(){return P.current.useId()},r.useImperativeHandle=function(e,t,r){return P.current.useImperativeHandle(e,t,r)},r.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},r.useMemo=function(e,t){return P.current.useMemo(e,t)},r.useReducer=function(e,t,r){return P.current.useReducer(e,t,r)},r.useRef=function(e){return P.current.useRef(e)},r.useState=function(e){return P.current.useState(e)},r.useSyncExternalStore=function(e,t,r){return P.current.useSyncExternalStore(e,t,r)},r.useTransition=function(){return P.current.useTransition()},r.version="18.2.0",r}function X(){return D||(D=1,k.exports=Q()),k.exports}export{Y as g,X as r};
@@ -1 +0,0 @@
1
- import{r as c,g as f}from"./index-CCBeWClE.mjs";function i(e,r){for(var t=0;t<r.length;t++){const o=r[t];if("string"!=typeof o&&!Array.isArray(o))for(const r in o)if("default"!==r&&!(r in e)){const t=Object.getOwnPropertyDescriptor(o,r);t&&Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var s=c();const p=f(s),g=i({__proto__:null,default:p},[s]);export{g as R,p as e,s as r};
package/react/index.mjs DELETED
@@ -1 +0,0 @@
1
- import{R as e}from"../index-DoZBmrkt.mjs";const{useState:a,useEffect:u,useContext:o,useReducer:s,useCallback:n,useMemo:r,useRef:m,useImperativeHandle:c,useLayoutEffect:f,useDebugValue:l,Children:p,Component:C,PureComponent:R,Fragment:d,Suspense:E,createContext:i,createElement:x,cloneElement:b,createRef:g,forwardRef:y,lazy:S,memo:h}=e;export{p as Children,C as Component,d as Fragment,R as PureComponent,E as Suspense,b as cloneElement,i as createContext,x as createElement,g as createRef,e as default,y as forwardRef,S as lazy,h as memo,n as useCallback,o as useContext,l as useDebugValue,u as useEffect,c as useImperativeHandle,f as useLayoutEffect,r as useMemo,s as useReducer,m as useRef,a as useState};
@@ -1 +0,0 @@
1
- import"../index-BP11Y_IV.mjs";
@@ -1 +0,0 @@
1
- import{e as b}from"../index-DoZBmrkt.mjs";var he=e=>"checkbox"===e.type,le=e=>e instanceof Date,W=e=>null==e;const ct=e=>"object"==typeof e;var R=e=>!W(e)&&!Array.isArray(e)&&ct(e)&&!le(e),ft=e=>R(e)&&e.target?he(e.target)?e.target.checked:e.target.value:e,Rt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,dt=(e,t)=>e.has(Rt(t)),Ut=e=>{const t=e.constructor&&e.constructor.prototype;return R(t)&&t.hasOwnProperty("isPrototypeOf")},He=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(He&&(e instanceof Blob||e instanceof FileList)||!r&&!R(e))return e;if(t=r?[]:{},r||Ut(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=M(e[r]));else t=e}return t}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],C=e=>void 0===e,c=(e,t,r)=>{if(!t||!R(e))return r;const s=ce(t.split(/[,[\].]+?/)).reduce(((e,t)=>W(e)?e:e[t]),e);return C(s)||s===e?C(e[t])?r:e[t]:s},Y=e=>"boolean"==typeof e;const Ve={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},z={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},te={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},yt=b.createContext(null),ve=()=>b.useContext(yt),tr=e=>{const{children:t,...r}=e;return b.createElement(yt.Provider,{value:r},t)};var gt=(e,t,r,s=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const a=i;return t._proxyFormState[a]!==z.all&&(t._proxyFormState[a]=!s||z.all),r&&(r[a]=!0),e[a]}});return a},K=e=>R(e)&&!Object.keys(e).length,_t=(e,t,r,s)=>{r(e);const{name:a,...i}=e;return K(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!s||z.all)))},G=e=>Array.isArray(e)?e:[e],ht=(e,t,r)=>!e||!t||e===t||G(e).some((e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))));function we(e){const t=b.useRef(e);t.current=e,b.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}function Lt(e){const t=ve(),{control:r=t.control,disabled:s,name:a,exact:i}=e||{},[n,o]=b.useState(r._formState),u=b.useRef(!0),l=b.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=b.useRef(a);return c.current=a,we({disabled:s,next:e=>u.current&&ht(c.current,e.name,i)&&_t(e,l.current,r._updateFormState)&&o({...r._formState,...e}),subject:r._subjects.state}),b.useEffect((()=>(u.current=!0,l.current.isValid&&r._updateValid(!0),()=>{u.current=!1})),[r]),gt(n,r,l.current,!1)}var ee=e=>"string"==typeof e,vt=(e,t,r,s,a)=>ee(e)?(s&&t.watch.add(e),c(r,e,a)):Array.isArray(e)?e.map((e=>(s&&t.watch.add(e),c(r,e)))):(s&&(t.watchAll=!0),r);function Mt(e){const t=ve(),{control:r=t.control,name:s,defaultValue:a,disabled:i,exact:n}=e||{},o=b.useRef(s);o.current=s,we({disabled:i,subject:r._subjects.values,next:e=>{ht(o.current,e.name,n)&&l(M(vt(o.current,r._names,e.values||r._formValues,!1,a)))}});const[u,l]=b.useState(r._getWatch(s,a));return b.useEffect((()=>r._removeUnmounted())),u}var $e=e=>/^\w*$/.test(e),mt=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),k=(e,t,r)=>{let s=-1;const a=$e(t)?[t]:mt(t),i=a.length,n=i-1;for(;++s<i;){const t=a[s];let i=r;if(s!==n){const r=e[t];i=R(r)||Array.isArray(r)?r:isNaN(+a[s+1])?{}:[]}e[t]=i,e=e[t]}return e};function Bt(e){const t=ve(),{name:r,disabled:s,control:a=t.control,shouldUnregister:i}=e,n=dt(a._names.array,r),o=Mt({control:a,name:r,defaultValue:c(a._formValues,r,c(a._defaultValues,r,e.defaultValue)),exact:!0}),u=Lt({control:a,name:r}),l=b.useRef(a.register(r,{...e.rules,value:o,...Y(e.disabled)?{disabled:e.disabled}:{}}));return b.useEffect((()=>{const e=a._options.shouldUnregister||i,t=(e,t)=>{const r=c(a._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=M(c(a._options.defaultValues,r));k(a._defaultValues,r,e),C(c(a._formValues,r))&&k(a._formValues,r,e)}return()=>{(n?e&&!a._state.action:e)?a.unregister(r):t(r,!1)}}),[r,a,n,i]),b.useEffect((()=>{c(a._fields,r)&&a._updateDisabledField({disabled:s,fields:a._fields,name:r,value:c(a._fields,r)._f.value})}),[s,r,a]),{field:{name:r,value:o,...Y(s)||u.disabled?{disabled:u.disabled||s}:{},onChange:b.useCallback((e=>l.current.onChange({target:{value:ft(e),name:r},type:Ve.CHANGE})),[r]),onBlur:b.useCallback((()=>l.current.onBlur({target:{value:c(a._formValues,r),name:r},type:Ve.BLUR})),[r,a]),ref:e=>{const t=c(a._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!c(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!c(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!c(u.validatingFields,r)},error:{enumerable:!0,get:()=>c(u.errors,r)}})}}const rr=e=>e.render(Bt(e)),It="post";function sr(e){const t=ve(),[r,s]=b.useState(!1),{control:a=t.control,onSubmit:i,children:n,action:o,method:u=It,headers:l,encType:d,onError:f,render:m,onSuccess:y,validateStatus:g,...p}=e,_=async t=>{let r=!1,s="";await a.handleSubmit((async e=>{const n=new FormData;let m="";try{m=JSON.stringify(e)}catch{}for(const t of a._names.mount)n.append(t,c(e,t));if(i&&await i({data:e,event:t,method:u,formData:n,formDataJson:m}),o)try{const e=[l&&l["Content-Type"],d].some((e=>e&&e.includes("json"))),t=await fetch(o,{method:u,headers:{...l,...d?{"Content-Type":d}:{}},body:e?m:n});t&&(g?!g(t.status):t.status<200||t.status>=300)?(r=!0,f&&f({response:t}),s=String(t.status)):y&&y({response:t})}catch(e){r=!0,f&&f({error:e})}}))(t),r&&e.control&&(e.control._subjects.state.next({isSubmitSuccessful:!1}),e.control.setError("root.server",{type:s}))};return b.useEffect((()=>{s(!0)}),[]),m?b.createElement(b.Fragment,null,m({submit:_})):b.createElement("form",{noValidate:r,action:o,method:u,encType:d,onSubmit:_,...p},n)}var Nt=(e,t,r,s,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:a||!0}}:{},re=()=>{const e=typeof performance>"u"?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const r=(16*Math.random()+e)%16|0;return("x"==t?r:3&r|8).toString(16)}))},Te=(e,t,r={})=>r.shouldFocus||C(r.shouldFocus)?r.focusName||`${e}.${C(r.focusIndex)?t:r.focusIndex}.`:"",_e=e=>({isOnSubmit:!e||e===z.onSubmit,isOnBlur:e===z.onBlur,isOnChange:e===z.onChange,isOnAll:e===z.all,isOnTouch:e===z.onTouched}),qe=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const oe=(e,t,r,s)=>{for(const a of r||Object.keys(e)){const r=c(e,a);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!s)break;if(e.ref&&t(e.ref,e.name)&&!s)break;oe(i,t)}else R(i)&&oe(i,t)}}};var bt=(e,t,r)=>{const s=ce(c(e,r));return k(s,"root",t[r]),k(e,r,s),e},Je=e=>"file"===e.type,se=e=>"function"==typeof e,Ae=e=>{if(!He)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fe=e=>ee(e),Ke=e=>"radio"===e.type,xe=e=>e instanceof RegExp;const it={value:!1,isValid:!1},at={value:!0,isValid:!0};var Ft=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!C(e[0].attributes.value)?C(e[0].value)||""===e[0].value?at:{value:e[0].value,isValid:!0}:at:it}return it};const nt={isValid:!1,value:null};var Vt=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),nt):nt;function ut(e,t,r="validate"){if(Fe(e)||Array.isArray(e)&&e.every(Fe)||Y(e)&&!e)return{type:r,message:Fe(e)?e:"",ref:t}}var ue=e=>R(e)&&!xe(e)?e:{value:e,message:""},We=async(e,t,r,s,a)=>{const{ref:i,refs:n,required:o,maxLength:u,minLength:l,min:d,max:f,pattern:m,validate:y,name:b,valueAsNumber:g,mount:p,disabled:_}=e._f,h=c(t,b);if(!p||_)return{};const v=n?n[0]:i,V=e=>{s&&v.reportValidity&&(v.setCustomValidity(Y(e)?"":e||""),v.reportValidity())},x={},A=Ke(i),F=he(i),S=A||F,k=(g||Je(i))&&C(i.value)&&C(h)||Ae(i)&&""===i.value||""===h||Array.isArray(h)&&!h.length,w=Nt.bind(null,b,r,x),D=(e,t,r,s=te.maxLength,a=te.minLength)=>{const n=e?t:r;x[b]={type:e?s:a,message:n,ref:i,...w(e?s:a,n)}};if(a?!Array.isArray(h)||!h.length:o&&(!S&&(k||W(h))||Y(h)&&!h||F&&!Ft(n).isValid||A&&!Vt(n).isValid)){const{value:e,message:t}=Fe(o)?{value:!!o,message:o}:ue(o);if(e&&(x[b]={type:te.required,message:t,ref:v,...w(te.required,t)},!r))return V(t),x}if(!(k||W(d)&&W(f))){let e,t;const s=ue(f),a=ue(d);if(W(h)||isNaN(h)){const r=i.valueAsDate||new Date(h),n=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,u="week"==i.type;ee(s.value)&&h&&(e=o?n(h)>n(s.value):u?h>s.value:r>new Date(s.value)),ee(a.value)&&h&&(t=o?n(h)<n(a.value):u?h<a.value:r<new Date(a.value))}else{const r=i.valueAsNumber||h&&+h;W(s.value)||(e=r>s.value),W(a.value)||(t=r<a.value)}if((e||t)&&(D(!!e,s.message,a.message,te.max,te.min),!r))return V(x[b].message),x}if((u||l)&&!k&&(ee(h)||a&&Array.isArray(h))){const e=ue(u),t=ue(l),s=!W(e.value)&&h.length>+e.value,a=!W(t.value)&&h.length<+t.value;if((s||a)&&(D(s,e.message,t.message),!r))return V(x[b].message),x}if(m&&!k&&ee(h)){const{value:e,message:t}=ue(m);if(xe(e)&&!h.match(e)&&(x[b]={type:te.pattern,message:t,ref:i,...w(te.pattern,t)},!r))return V(t),x}if(y)if(se(y)){const e=ut(await y(h,t),v);if(e&&(x[b]={...e,...w(te.validate,e.message)},!r))return V(e.message),x}else if(R(y)){let e={};for(const s in y){if(!K(e)&&!r)break;const a=ut(await y[s](h,t),v,s);a&&(e={...a,...w(s,a.message)},V(a.message),r&&(x[b]=e))}if(!K(e)&&(x[b]={ref:v,...e},!r))return x}return V(!0),x},Oe=(e,t)=>[...e,...G(t)],Re=e=>Array.isArray(e)?e.map((()=>{})):void 0;function Ue(e,t,r){return[...e.slice(0,t),...G(r),...e.slice(t)]}var Le=(e,t,r)=>Array.isArray(e)?(C(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Me=(e,t)=>[...G(t),...G(e)];function Pt(e,t){let r=0;const s=[...e];for(const e of t)s.splice(e-r,1),r++;return ce(s).length?s:[]}var Be=(e,t)=>C(t)?[]:Pt(e,G(t).sort(((e,t)=>e-t))),Ie=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};function jt(e,t){const r=t.slice(0,-1).length;let s=0;for(;s<r;)e=C(e)?s++:e[t[s++]];return e}function qt(e){for(const t in e)if(e.hasOwnProperty(t)&&!C(e[t]))return!1;return!0}function L(e,t){const r=Array.isArray(t)?t:$e(t)?[t]:mt(t),s=1===r.length?e:jt(e,r),a=r.length-1,i=r[a];return s&&delete s[i],0!==a&&(R(s)&&K(s)||Array.isArray(s)&&qt(s))&&L(e,r.slice(0,-1)),e}var lt=(e,t,r)=>(e[t]=r,e);function ir(e){const t=ve(),{control:r=t.control,name:s,keyName:a="id",shouldUnregister:i}=e,[n,o]=b.useState(r._getFieldArray(s)),u=b.useRef(r._getFieldArray(s).map(re)),l=b.useRef(n),d=b.useRef(s),f=b.useRef(!1);d.current=s,l.current=n,r._names.array.add(s),e.rules&&r.register(s,e.rules),we({next:({values:e,name:t})=>{if(t===d.current||!t){const t=c(e,d.current);Array.isArray(t)&&(o(t),u.current=t.map(re))}},subject:r._subjects.array});const m=b.useCallback((e=>{f.current=!0,r._updateFieldArray(s,e)}),[r,s]);return b.useEffect((()=>{if(r._state.action=!1,qe(s,r._names)&&r._subjects.state.next({...r._formState}),f.current&&(!_e(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([s]).then((e=>{const t=c(e.errors,s),a=c(r._formState.errors,s);(a?!t&&a.type||t&&(a.type!==t.type||a.message!==t.message):t&&t.type)&&(t?k(r._formState.errors,s,t):L(r._formState.errors,s),r._subjects.state.next({errors:r._formState.errors}))}));else{const e=c(r._fields,s);e&&e._f&&(!_e(r._options.reValidateMode).isOnSubmit||!_e(r._options.mode).isOnSubmit)&&We(e,r._formValues,r._options.criteriaMode===z.all,r._options.shouldUseNativeValidation,!0).then((e=>!K(e)&&r._subjects.state.next({errors:bt(r._formState.errors,e,s)})))}r._subjects.values.next({name:s,values:{...r._formValues}}),r._names.focus&&oe(r._fields,((e,t)=>{if(r._names.focus&&t.startsWith(r._names.focus)&&e.focus)return e.focus(),1})),r._names.focus="",r._updateValid(),f.current=!1}),[n,s,r]),b.useEffect((()=>(!c(r._formValues,s)&&r._updateFieldArray(s),()=>{(r._options.shouldUnregister||i)&&r.unregister(s)})),[s,r,a,i]),{swap:b.useCallback(((e,t)=>{const a=r._getFieldArray(s);Ie(a,e,t),Ie(u.current,e,t),m(a),o(a),r._updateFieldArray(s,a,Ie,{argA:e,argB:t},!1)}),[m,s,r]),move:b.useCallback(((e,t)=>{const a=r._getFieldArray(s);Le(a,e,t),Le(u.current,e,t),m(a),o(a),r._updateFieldArray(s,a,Le,{argA:e,argB:t},!1)}),[m,s,r]),prepend:b.useCallback(((e,t)=>{const a=G(M(e)),i=Me(r._getFieldArray(s),a);r._names.focus=Te(s,0,t),u.current=Me(u.current,a.map(re)),m(i),o(i),r._updateFieldArray(s,i,Me,{argA:Re(e)})}),[m,s,r]),append:b.useCallback(((e,t)=>{const a=G(M(e)),i=Oe(r._getFieldArray(s),a);r._names.focus=Te(s,i.length-1,t),u.current=Oe(u.current,a.map(re)),m(i),o(i),r._updateFieldArray(s,i,Oe,{argA:Re(e)})}),[m,s,r]),remove:b.useCallback((e=>{const t=Be(r._getFieldArray(s),e);u.current=Be(u.current,e),m(t),o(t),r._updateFieldArray(s,t,Be,{argA:e})}),[m,s,r]),insert:b.useCallback(((e,t,a)=>{const i=G(M(t)),n=Ue(r._getFieldArray(s),e,i);r._names.focus=Te(s,e,a),u.current=Ue(u.current,e,i.map(re)),m(n),o(n),r._updateFieldArray(s,n,Ue,{argA:e,argB:Re(t)})}),[m,s,r]),update:b.useCallback(((e,t)=>{const a=M(t),i=lt(r._getFieldArray(s),e,a);u.current=[...i].map(((t,r)=>t&&r!==e?u.current[r]:re())),m(i),o([...i]),r._updateFieldArray(s,i,lt,{argA:e,argB:a},!0,!1)}),[m,s,r]),replace:b.useCallback((e=>{const t=G(M(e));u.current=t.map(re),m([...t]),o([...t]),r._updateFieldArray(s,[...t],(e=>e),{},!0,!1)}),[m,s,r]),fields:b.useMemo((()=>n.map(((e,t)=>({...e,[a]:u.current[t]||re()})))),[n,a])}}var Ne=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},pe=e=>W(e)||!ct(e);function ae(e,t){if(pe(e)||pe(t))return e===t;if(le(e)&&le(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(const a of r){const r=e[a];if(!s.includes(a))return!1;if("ref"!==a){const e=t[a];if(le(r)&&le(e)||R(r)&&R(e)||Array.isArray(r)&&Array.isArray(e)?!ae(r,e):r!==e)return!1}}return!0}var At=e=>"select-multiple"===e.type,Wt=e=>Ke(e)||he(e),Pe=e=>Ae(e)&&e.isConnected,Ht=e=>R(e)&&Object.values(e).some((e=>e)),xt=e=>{for(const t in e)if(se(e[t]))return!0;return!1};function Se(e,t={}){const r=Array.isArray(e);if(R(e)||r)for(const r in e)Array.isArray(e[r])||R(e[r])&&!xt(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Se(e[r],t[r])):W(e[r])||(t[r]=!0);return t}function pt(e,t,r){const s=Array.isArray(e);if(R(e)||s)for(const s in e)Array.isArray(e[s])||R(e[s])&&!xt(e[s])?C(t)||pe(r[s])?r[s]=Array.isArray(e[s])?Se(e[s],[]):{...Se(e[s])}:pt(e[s],W(t)?{}:t[s],r[s]):r[s]=!ae(e[s],t[s]);return r}var be=(e,t)=>pt(e,t,Se(t)),St=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>C(e)?e:t?""===e?NaN:e&&+e:r&&ee(e)?new Date(e):s?s(e):e;function je(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Je(t)?t.files:Ke(t)?Vt(e.refs).value:At(t)?[...t.selectedOptions].map((({value:e})=>e)):he(t)?Ft(e.refs).value:St(C(t.value)?e.ref.value:t.value,e)}var $t=(e,t,r,s)=>{const a={};for(const r of e){const e=c(t,r);e&&k(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:s}},ge=e=>C(e)?e:xe(e)?e.source:R(e)?xe(e.value)?e.value.source:e.value:e,Jt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function ot(e,t,r){const s=c(e,r);if(s||$e(r))return{error:s,name:r};const a=r.split(".");for(;a.length;){const s=a.join("."),i=c(t,s),n=c(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(n&&n.type)return{name:s,error:n};a.pop()}return{name:r}}var Kt=(e,t,r,s,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?s.isOnBlur:a.isOnBlur)?!e:!(r?s.isOnChange:a.isOnChange)||e),Gt=(e,t)=>!ce(c(e,t)).length&&L(e,t);const Qt={mode:z.onSubmit,reValidateMode:z.onChange,shouldFocusError:!0};function zt(e={}){let t,r={...Qt,...e},s={submitCount:0,isDirty:!1,isLoading:se(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},i=(R(r.defaultValues)||R(r.values))&&M(r.defaultValues||r.values)||{},n=r.shouldUnregister?{}:M(i),o={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Ne(),array:Ne(),state:Ne()},m=_e(r.mode),y=_e(r.reValidateMode),b=r.criteriaMode===z.all,g=async e=>{if(d.isValid||e){const e=r.resolver?K((await V()).errors):await x(a,!0);e!==s.isValid&&f.state.next({isValid:e})}},p=(e,t)=>{(d.isValidating||d.validatingFields)&&(t.forEach((t=>{k(s.validatingFields,t,e)})),s.isValidating=Ht(s.validatingFields),f.state.next({validatingFields:s.validatingFields,isValidating:s.isValidating}))},_=(e,t,r,s)=>{const u=c(a,e);if(u){const a=c(n,e,C(r)?c(i,e):r);C(a)||s&&s.defaultChecked||t?k(n,e,t?a:je(u._f)):S(e,a),o.mount&&g()}},h=(e,t,r,n,o)=>{let u=!1,l=!1;const m={name:e},y=!(!c(a,e)||!c(a,e)._f.disabled);if(!r||n){d.isDirty&&(l=s.isDirty,s.isDirty=m.isDirty=A(),u=l!==m.isDirty);const r=y||ae(c(i,e),t);l=!(y||!c(s.dirtyFields,e)),r||y?L(s.dirtyFields,e):k(s.dirtyFields,e,!0),m.dirtyFields=s.dirtyFields,u=u||d.dirtyFields&&l!==!r}if(r){const t=c(s.touchedFields,e);t||(k(s.touchedFields,e,r),m.touchedFields=s.touchedFields,u=u||d.touchedFields&&t!==r)}return u&&o&&f.state.next(m),u?m:{}},v=(r,a,i,n)=>{const o=c(s.errors,r),u=d.isValid&&Y(a)&&s.isValid!==a;if(e.delayError&&i?(t=(e=>t=>{clearTimeout(l),l=setTimeout(e,t)})((()=>((e,t)=>{k(s.errors,e,t),f.state.next({errors:s.errors})})(r,i))),t(e.delayError)):(clearTimeout(l),t=null,i?k(s.errors,r,i):L(s.errors,r)),(i?!ae(o,i):o)||!K(n)||u){const e={...n,...u&&Y(a)?{isValid:a}:{},errors:s.errors,name:r};s={...s,...e},f.state.next(e)}p(!1,Object.keys(s.validatingFields).filter((e=>e===r)))},V=async e=>r.resolver(n,r.context,$t(e||u.mount,a,r.criteriaMode,r.shouldUseNativeValidation)),x=async(e,t,a={valid:!0})=>{for(const i in e){const o=e[i];if(o){const{_f:e,...i}=o;if(e){const i=u.array.has(e.name),l=await We(o,n,b,r.shouldUseNativeValidation&&!t,i);if(l[e.name]&&(a.valid=!1,t))break;!t&&(c(l,e.name)?i?bt(s.errors,l,e.name):k(s.errors,e.name,l[e.name]):L(s.errors,e.name))}i&&await x(i,t,a)}}return a.valid},A=(e,t)=>(e&&t&&k(n,e,t),!ae(U(),i)),F=(e,t,r)=>vt(e,u,{...o.mount?n:C(t)?i:ee(e)?{[e]:t}:t},r,t),S=(e,t,r={})=>{const s=c(a,e);let i=t;if(s){const r=s._f;r&&(!r.disabled&&k(n,e,St(t,r)),i=Ae(r.ref)&&W(t)?"":t,At(r.ref)?[...r.ref.options].forEach((e=>e.selected=i.includes(e.value))):r.refs?he(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(i)?!!i.find((t=>t===e.value)):i===e.value))):r.refs[0]&&(r.refs[0].checked=!!i):r.refs.forEach((e=>e.checked=e.value===i)):Je(r.ref)?r.ref.value="":(r.ref.value=i,r.ref.type||f.values.next({name:e,values:{...n}})))}(r.shouldDirty||r.shouldTouch)&&h(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&j(e)},w=(e,t,r)=>{for(const s in t){const i=t[s],n=`${e}.${s}`,o=c(a,n);!u.array.has(e)&&pe(i)&&(!o||o._f)||le(i)?S(n,i,r):w(n,i,r)}},D=(e,t,r={})=>{const l=c(a,e),m=u.array.has(e),y=M(t);k(n,e,y),m?(f.array.next({name:e,values:{...n}}),(d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:be(i,n),isDirty:A(e,y)})):!l||l._f||W(y)?S(e,y,r):w(e,y,r),qe(e,u)&&f.state.next({...s}),f.values.next({name:o.mount?e:void 0,values:{...n}})},E=async e=>{const i=e.target;let o=i.name,l=!0;const _=c(a,o),A=e=>{l=Number.isNaN(e)||e===c(n,o,e)};if(_){let F,S;const w=i.type?je(_._f):ft(e),C=e.type===Ve.BLUR||e.type===Ve.FOCUS_OUT,D=!Jt(_._f)&&!r.resolver&&!c(s.errors,o)&&!_._f.deps||Kt(C,c(s.touchedFields,o),s.isSubmitted,y,m),L=qe(o,u,C);k(n,o,w),C?(_._f.onBlur&&_._f.onBlur(e),t&&t(0)):_._f.onChange&&_._f.onChange(e);const M=h(o,w,C,!1),E=!K(M)||L;if(!C&&f.values.next({name:o,type:e.type,values:{...n}}),D)return d.isValid&&g(),E&&f.state.next({name:o,...L?{}:M});if(!C&&L&&f.state.next({...s}),p(!0,[o]),r.resolver){const{errors:e}=await V([o]);if(A(w),l){const t=ot(s.errors,a,o),r=ot(e,a,t.name||o);F=r.error,o=r.name,S=K(e)}}else F=(await We(_,n,b,r.shouldUseNativeValidation))[o],A(w),l&&(F?S=!1:d.isValid&&(S=await x(a,!0)));l&&(_._f.deps&&j(_._f.deps),v(o,S,F,M))}},O=(e,t)=>{if(c(s.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let i,n;const o=G(e);if(p(!0,o),r.resolver){const t=await(async e=>{const{errors:t}=await V(e);if(e)for(const r of e){const e=c(t,r);e?k(s.errors,r,e):L(s.errors,r)}else s.errors=t;return t})(C(e)?e:o);i=K(t),n=e?!o.some((e=>c(t,e))):i}else e?(n=(await Promise.all(o.map((async e=>{const t=c(a,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(n||s.isValid)&&g()):n=i=await x(a);return f.state.next({...!ee(e)||d.isValid&&i!==s.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:s.errors,isValidating:!1}),t.shouldFocus&&!n&&oe(a,O,e?o:u.mount),n},U=e=>{const t={...i,...o.mount?n:{}};return C(e)?t:ee(e)?c(t,e):e.map((e=>c(t,e)))},B=(e,t)=>({invalid:!!c((t||s).errors,e),isDirty:!!c((t||s).dirtyFields,e),isTouched:!!c((t||s).touchedFields,e),isValidating:!!c((t||s).validatingFields,e),error:c((t||s).errors,e)}),T=(e,t,r)=>{const i=(c(a,e,{_f:{}})._f||{}).ref;k(s.errors,e,{...t,ref:i}),f.state.next({name:e,errors:s.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},N=(e,t={})=>{for(const o of e?G(e):u.mount)u.mount.delete(o),u.array.delete(o),t.keepValue||(L(a,o),L(n,o)),!t.keepError&&L(s.errors,o),!t.keepDirty&&L(s.dirtyFields,o),!t.keepTouched&&L(s.touchedFields,o),!t.keepIsValidating&&L(s.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&L(i,o);f.values.next({values:{...n}}),f.state.next({...s,...t.keepDirty?{isDirty:A()}:{}}),!t.keepIsValid&&g()},q=({disabled:e,name:t,field:r,fields:s,value:a})=>{if(Y(e)){const i=e?void 0:C(a)?je(r?r._f:c(s,t)._f):a;k(n,t,i),h(t,i,!1,!1,!0)}},P=(e,t={})=>{let s=c(a,e);const n=Y(t.disabled);return k(a,e,{...s||{},_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),u.mount.add(e),s?q({field:s,disabled:t.disabled,name:e,value:t.value}):_(e,!0,t.value),{...n?{disabled:t.disabled}:{},...r.progressive?{required:!!t.required,min:ge(t.min),max:ge(t.max),minLength:ge(t.minLength),maxLength:ge(t.maxLength),pattern:ge(t.pattern)}:{},name:e,onChange:E,onBlur:E,ref:n=>{if(n){P(e,t),s=c(a,e);const r=C(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,o=Wt(r),u=s._f.refs||[];if(o?u.find((e=>e===r)):r===s._f.ref)return;k(a,e,{_f:{...s._f,...o?{refs:[...u.filter(Pe),r,...Array.isArray(c(i,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),_(e,!1,void 0,r)}else s=c(a,e,{}),s._f&&(s._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!dt(u.array,e)||!o.action)&&u.unMount.add(e)}}},I=()=>r.shouldFocusError&&oe(a,O,u.mount),$=(e,t)=>async i=>{let o;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let u=M(n);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await V();s.errors=e,u=t}else await x(a);if(L(s.errors,"root"),K(s.errors)){f.state.next({errors:{}});try{await e(u,i)}catch(e){o=e}}else t&&await t({...s.errors},i),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:K(s.errors)&&!o,submitCount:s.submitCount+1,errors:s.errors}),o)throw o},H=(t,r={})=>{const l=t?M(t):i,m=M(l),y=K(t),b=y?i:m;if(r.keepDefaultValues||(i=l),!r.keepValues){if(r.keepDirtyValues)for(const e of u.mount)c(s.dirtyFields,e)?k(b,e,c(n,e)):D(e,c(b,e));else{if(He&&C(t))for(const e of u.mount){const t=c(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Ae(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}n=e.shouldUnregister?r.keepDefaultValues?M(i):{}:M(b),f.array.next({values:{...b}}),f.values.next({values:{...b}})}u={mount:r.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!r.keepIsValid||!!r.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:r.keepSubmitCount?s.submitCount:0,isDirty:!y&&(r.keepDirty?s.isDirty:!(!r.keepDefaultValues||ae(t,i))),isSubmitted:!!r.keepIsSubmitted&&s.isSubmitted,dirtyFields:y?[]:r.keepDirtyValues?r.keepDefaultValues&&n?be(i,n):s.dirtyFields:r.keepDefaultValues&&t?be(i,t):{},touchedFields:r.keepTouched?s.touchedFields:{},errors:r.keepErrors?s.errors:{},isSubmitSuccessful:!!r.keepIsSubmitSuccessful&&s.isSubmitSuccessful,isSubmitting:!1})},J=(e,t)=>H(se(e)?e(n):e,t);return{control:{register:P,unregister:N,getFieldState:B,handleSubmit:$,setError:T,_executeSchema:V,_getWatch:F,_getDirty:A,_updateValid:g,_removeUnmounted:()=>{for(const e of u.unMount){const t=c(a,e);t&&(t._f.refs?t._f.refs.every((e=>!Pe(e))):!Pe(t._f.ref))&&N(e)}u.unMount=new Set},_updateFieldArray:(e,t=[],r,u,l=!0,m=!0)=>{if(u&&r){if(o.action=!0,m&&Array.isArray(c(a,e))){const t=r(c(a,e),u.argA,u.argB);l&&k(a,e,t)}if(m&&Array.isArray(c(s.errors,e))){const t=r(c(s.errors,e),u.argA,u.argB);l&&k(s.errors,e,t),Gt(s.errors,e)}if(d.touchedFields&&m&&Array.isArray(c(s.touchedFields,e))){const t=r(c(s.touchedFields,e),u.argA,u.argB);l&&k(s.touchedFields,e,t)}d.dirtyFields&&(s.dirtyFields=be(i,n)),f.state.next({name:e,isDirty:A(e,t),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else k(n,e,t)},_updateDisabledField:q,_getFieldArray:t=>ce(c(o.mount?n:i,t,e.shouldUnregister?c(i,t,[]):[])),_reset:H,_resetDefaultValues:()=>se(r.defaultValues)&&r.defaultValues().then((e=>{J(e,r.resetOptions),f.state.next({isLoading:!1})})),_updateFormState:e=>{s={...s,...e}},_disableForm:e=>{Y(e)&&(f.state.next({disabled:e}),oe(a,((t,r)=>{let s=e;const i=c(a,r);i&&Y(i._f.disabled)&&(s||(s=i._f.disabled)),t.disabled=s}),0,!1))},_subjects:f,_proxyFormState:d,_setErrors:e=>{s.errors=e,f.state.next({errors:s.errors,isValid:!1})},get _fields(){return a},get _formValues(){return n},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return u},set _names(e){u=e},get _formState(){return s},set _formState(e){s=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:j,register:P,handleSubmit:$,watch:(e,t)=>se(e)?f.values.subscribe({next:r=>e(F(void 0,t),r)}):F(e,t,!0),setValue:D,getValues:U,reset:J,resetField:(e,t={})=>{c(a,e)&&(C(t.defaultValue)?D(e,M(c(i,e))):(D(e,t.defaultValue),k(i,e,M(t.defaultValue))),t.keepTouched||L(s.touchedFields,e),t.keepDirty||(L(s.dirtyFields,e),s.isDirty=t.defaultValue?A(e,M(c(i,e))):A()),t.keepError||(L(s.errors,e),d.isValid&&g()),f.state.next({...s}))},clearErrors:e=>{e&&G(e).forEach((e=>L(s.errors,e))),f.state.next({errors:e?s.errors:{}})},unregister:N,setError:T,setFocus:(e,t={})=>{const r=c(a,e),s=r&&r._f;if(s){const e=s.refs?s.refs[0]:s.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:B}}function ar(e={}){const t=b.useRef(),r=b.useRef(),[s,a]=b.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,defaultValues:se(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...zt(e),formState:s});const i=t.current.control;return i._options=e,we({subject:i._subjects.state,next:e=>{_t(e,i._proxyFormState,i._updateFormState,!0)&&a({...i._formState})}}),b.useEffect((()=>i._disableForm(e.disabled)),[i,e.disabled]),b.useEffect((()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==s.isDirty&&i._subjects.state.next({isDirty:e})}}),[i,s.isDirty]),b.useEffect((()=>{e.values&&!ae(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,a((e=>({...e})))):i._resetDefaultValues()}),[e.values,i]),b.useEffect((()=>{e.errors&&i._setErrors(e.errors)}),[e.errors,i]),b.useEffect((()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()})),b.useEffect((()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})}),[e.shouldUnregister,i]),t.current.formState=gt(s,i),t.current}export{rr as Controller,sr as Form,tr as FormProvider,Nt as appendErrors,c as get,k as set,Bt as useController,ir as useFieldArray,ar as useForm,ve as useFormContext,Lt as useFormState,Mt as useWatch};
@@ -1,10 +0,0 @@
1
- import{R as oe,e as Te,r as Oe}from"../index-DoZBmrkt.mjs";import{r as _e}from"../index-CCBeWClE.mjs";var ue,ce,z={exports:{}},B={};
2
- /**
3
- * @license React
4
- * use-sync-external-store-with-selector.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */function Ne(){if(ue)return B;ue=1;var e=_e();var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useSyncExternalStore,r=e.useRef,o=e.useEffect,u=e.useMemo,s=e.useDebugValue;return B.useSyncExternalStoreWithSelector=function(e,c,a,i,p){var f=r(null);if(null===f.current){var l={hasValue:!1,value:null};f.current=l}else l=f.current;f=u((function(){function e(e){if(!o){if(o=!0,n=e,e=i(e),void 0!==p&&l.hasValue){var u=l.value;if(p(u,e))return r=u}return r=e}if(u=r,t(n,e))return u;var s=i(e);return void 0!==p&&p(u,s)?u:(n=e,r=s)}var n,r,o=!1,u=void 0===a?null:a;return[function(){return e(c())},null===u?void 0:function(){return e(u())}]}),[c,a,i,p]);var d=n(e,f[0],f[1]);return o((function(){l.hasValue=!0,l.value=d}),[d]),s(d),d},B}function Me(){return ce||(ce=1,z.exports=Ne()),z.exports}var Ae=Me(),i="default"in oe?Te:oe,se=Symbol.for("react-redux-context"),ie=typeof globalThis<"u"?globalThis:{};function Fe(){if(!i.createContext)return{};const e=ie[se]??(ie[se]=new Map);let t=e.get(i.createContext);return t||(t=i.createContext(null),e.set(i.createContext,t)),t}var T=Fe(),Se=()=>{throw new Error("uSES not initialized!")};function G(e=T){return function(){return i.useContext(e)}}var ve=G(),be=Se,$e=e=>{be=e},ke=(e,t)=>e===t;function Ie(e=T){const t=e===T?ve:G(e),n=(e,n={})=>{const{equalityFn:r=ke,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:u,subscription:s,getServerState:c,stabilityCheck:a,identityFunctionCheck:p}=t();i.useRef(!0);const f=i.useCallback({[e.name]:t=>e(t)}[e.name],[e,a,o.stabilityCheck]),l=be(s.addNestedSub,u.getState,c||u.getState,f,r);return i.useDebugValue(l),l};return Object.assign(n,{withTypes:()=>n}),n}var _t=Ie(),Ue=Symbol.for("react.element"),Ye=Symbol.for("react.portal"),We=Symbol.for("react.fragment"),Le=Symbol.for("react.strict_mode"),Ve=Symbol.for("react.profiler"),qe=Symbol.for("react.provider"),De=Symbol.for("react.context"),je=Symbol.for("react.server_context"),he=Symbol.for("react.forward_ref"),ze=Symbol.for("react.suspense"),Be=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),He=Symbol.for("react.lazy"),Ke=he,Xe=Z;function Ge(e){if("object"==typeof e&&null!==e){const t=e.$$typeof;switch(t){case Ue:{const n=e.type;switch(n){case We:case Ve:case Le:case ze:case Be:return n;default:{const e=n&&n.$$typeof;switch(e){case je:case De:case he:case He:case Z:case qe:return e;default:return t}}}}case Ye:return t}}}function Ze(e){return Ge(e)===Z}function Je(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:u,areStatePropsEqual:s}){let c,a,i,p,f,l=!1;function d(l,d){const y=!u(d,a),m=!o(l,c,d,a);return c=l,a=d,y&&m?(i=e(c,a),t.dependsOnOwnProps&&(p=t(r,a)),f=n(i,p,a),f):y?(e.dependsOnOwnProps&&(i=e(c,a)),t.dependsOnOwnProps&&(p=t(r,a)),f=n(i,p,a),f):m?function(){const t=e(c,a),r=!s(t,i);return i=t,r&&(f=n(i,p,a)),f}():f}return function(o,u){return l?d(o,u):function(o,u){return c=o,a=u,i=e(c,a),p=t(r,a),f=n(i,p,a),l=!0,f}(o,u)}}function Qe(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){return Je(t(e,o),n(e,o),r(e,o),e,o)}function et(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}function K(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function ae(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function Ee(e,t){return function(t,{displayName:n}){const r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=ae(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=ae(o),o=r(t,n)),o},r}}function J(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function tt(e){return e&&"object"==typeof e?K((t=>et(e,t))):e?"function"==typeof e?Ee(e):J(e,"mapDispatchToProps"):K((e=>({dispatch:e})))}function rt(e){return e?"function"==typeof e?Ee(e):J(e,"mapStateToProps"):K((()=>({})))}function nt(e,t,n){return{...n,...e,...t}}function ot(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let o,u=!1;return function(t,n,s){const c=e(t,n,s);return u?r(c,o)||(o=c):(u=!0,o=c),o}}}function ut(e){return e?"function"==typeof e?ot(e):J(e,"mergeProps"):()=>nt}function Ce(e){e()}function ct(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ce((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||null===e||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var le={notify(){},get:()=>[]};function Pe(e,t){let n,r=le,o=0,u=!1;function s(){i.onStateChange&&i.onStateChange()}function c(){o++,n||(n=t?t.addNestedSub(s):e.subscribe(s),r=ct())}function a(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=le)}const i={addNestedSub:function(e){c();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),a())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:s,isSubscribed:function(){return u},trySubscribe:function(){u||(u=!0,c())},tryUnsubscribe:function(){u&&(u=!1,a())},getListeners:()=>r};return i}var st=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",U=st?i.useLayoutEffect:i.useEffect;function fe(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function H(e,t){if(fe(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!fe(e[n[r]],t[n[r]]))return!1;return!0}var it={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},at={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},lt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},me={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ft={[Ke]:lt,[Xe]:me};function de(e){return Ze(e)?me:ft[e.$$typeof]||it}var dt=Object.defineProperty,pt=Object.getOwnPropertyNames,pe=Object.getOwnPropertySymbols,yt=Object.getOwnPropertyDescriptor,St=Object.getPrototypeOf,ye=Object.prototype;function X(e,t){if("string"!=typeof t){if(ye){const n=St(t);n&&n!==ye&&X(e,n)}let n=pt(t);pe&&(n=n.concat(pe(t)));const r=de(e),o=de(t);for(let u=0;u<n.length;++u){const s=n[u];if(!(at[s]||o&&o[s]||r&&r[s])){const n=yt(t,s);try{dt(e,s,n)}catch{}}}}return e}var Re=Se,vt=e=>{Re=e},bt=[null,null];function ht(e,t,n){U((()=>e(...t)),n)}function Et(e,t,n,r,o,u){e.current=r,n.current=!1,o.current&&(o.current=null,u())}function Ct(e,t,n,r,o,u,s,c,a,i,p){if(!e)return()=>{};let f=!1,l=null;const d=()=>{if(f||!c.current)return;const e=t.getState();let n,d;try{n=r(e,o.current)}catch(e){d=e,l=e}d||(l=null),n===u.current?s.current||i():(u.current=n,a.current=n,s.current=!0,p())};return n.onStateChange=d,n.trySubscribe(),d(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,l)throw l}}function Pt(e,t){return e===t}function mt(e,t,n,{pure:r,areStatesEqual:o=Pt,areOwnPropsEqual:u=H,areStatePropsEqual:s=H,areMergedPropsEqual:c=H,forwardRef:a=!1,context:p=T}={}){const f=p,l=rt(e),d=tt(t),y=ut(n),m=!!e;return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:l,initMapDispatchToProps:d,initMergeProps:y,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:u,areMergedPropsEqual:c};function p(t){const[n,o,u]=i.useMemo((()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]}),[t]),s=i.useMemo((()=>{let e=f;return null!=n&&n.Consumer,e}),[n,f]),c=i.useContext(s),a=!!t.store&&!!t.store.getState&&!!t.store.dispatch,p=!!c&&!!c.store,l=a?t.store:c.store,d=p?c.getServerState:l.getState,y=i.useMemo((()=>Qe(l.dispatch,r)),[l]),[b,S]=i.useMemo((()=>{if(!m)return bt;const e=Pe(l,a?void 0:c.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[l,a,c]),h=i.useMemo((()=>a?c:{...c,subscription:b}),[a,c,b]),v=i.useRef(),g=i.useRef(u),w=i.useRef(),P=i.useRef(!1);i.useRef(!1);const O=i.useRef(!1),C=i.useRef();U((()=>(O.current=!0,()=>{O.current=!1})),[]);const x=i.useMemo((()=>()=>w.current&&u===g.current?w.current:y(l.getState(),u)),[l,u]),T=i.useMemo((()=>e=>b?Ct(m,l,b,y,g,v,P,O,w,S,e):()=>{}),[b]);let E;ht(Et,[g,v,P,u,w,S]);try{E=Re(T,x,d?()=>y(d(),u):x)}catch(e){throw C.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${C.current.stack}\n\n`),e}U((()=>{C.current=void 0,w.current=void 0,v.current=E}));const M=i.useMemo((()=>i.createElement(e,{...E,ref:o})),[o,e,E]);return i.useMemo((()=>m?i.createElement(s.Provider,{value:h},M):M),[s,M,h])}const b=i.memo(p);if(b.WrappedComponent=e,b.displayName=p.displayName=n,a){const t=i.forwardRef((function(e,t){return i.createElement(b,{...e,reactReduxForwardedRef:t})}));return t.displayName=n,t.WrappedComponent=e,X(t,e)}return X(b,e)}}var Nt=mt;function Rt({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:u="once"}){const s=i.useMemo((()=>{const t=Pe(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:u}}),[e,r,o,u]),c=i.useMemo((()=>e.getState()),[e]);U((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),c!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,c]);const a=t||T;return i.createElement(a.Provider,{value:s},n)}var Mt=Rt;function we(e=T){const t=e===T?ve:G(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var wt=we();function gt(e=T){const t=e===T?wt:we(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var At=gt(),Ft=Ce;$e(Ae.useSyncExternalStoreWithSelector),vt(Oe.useSyncExternalStore);export{Mt as Provider,T as ReactReduxContext,Ft as batch,Nt as connect,gt as createDispatchHook,Ie as createSelectorHook,we as createStoreHook,H as shallowEqual,At as useDispatch,_t as useSelector,wt as useStore};
@@ -1,11 +0,0 @@
1
- import{r as f,R as zt}from"../index-DoZBmrkt.mjs";import{R as hn}from"../index-BP11Y_IV.mjs";
2
- /**
3
- * @remix-run/router v1.15.2
4
- *
5
- * Copyright (c) Remix Software Inc.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE.md file in the root directory of this source tree.
9
- *
10
- * @license MIT
11
- */function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(this,arguments)}var z;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(z||(z={}));const ir="popstate";function Pr(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:n,v5Compat:a=!1}=e;t=r.map(((e,t)=>c(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let o=l(n??t.length-1),i=z.Pop,s=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function u(){return t[o]}function c(e,r,n){void 0===r&&(r=null);let a=Me(t?u().pathname:"/",e,r,n);return ge("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function d(e){return"string"==typeof e?e:fe(e)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?ce(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){i=z.Push;let n=c(e,r);o+=1,t.splice(o,t.length,n),a&&s&&s({action:i,location:n,delta:1})},replace(e,r){i=z.Replace;let n=c(e,r);t[o]=n,a&&s&&s({action:i,location:n,delta:0})},go(e){i=z.Pop;let r=l(o+e),n=t[r];o=r,s&&s({action:i,location:n,delta:e})},listen:e=>(s=e,()=>{s=null})}}function Cr(e){return void 0===e&&(e={}),Dr((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return Me("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:fe(t)}),null,e)}function Lr(e){return void 0===e&&(e={}),Dr((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=ce(e.location.hash.substr(1));return!r.startsWith("/")&&!r.startsWith(".")&&(r="/"+r),Me("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:fe(t))}),(function(e,t){ge("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function L(e,t){if(!1===e||null===e||typeof e>"u")throw new Error(t)}function ge(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mn(){return Math.random().toString(36).substr(2,8)}function lr(e,t){return{usr:e.state,key:e.key,idx:t}}function Me(e,t,r,n){return void 0===r&&(r=null),K({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?ce(t):t,{state:r,key:t&&t.key||n||mn()})}function fe(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function ce(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Dr(e,t,r,n){void 0===n&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s=z.Pop,l=null,u=c();function c(){return(i.state||{idx:null}).idx}function d(){s=z.Pop;let e=c(),t=null==e?null:e-u;u=e,l&&l({action:s,location:h.location,delta:t})}function f(e){let t="null"!==a.location.origin?a.location.origin:a.location.href,r="string"==typeof e?e:fe(e);return r=r.replace(/ $/,"%20"),L(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==u&&(u=0,i.replaceState(K({},i.state,{idx:u}),""));let h={get action(){return s},get location(){return e(a,i)},listen(e){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(ir,d),l=e,()=>{a.removeEventListener(ir,d),l=null}},createHref:e=>t(a,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=z.Push;let n=Me(h.location,e,t);r&&r(n,e),u=c()+1;let d=lr(n,u),f=h.createHref(n);try{i.pushState(d,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(f)}o&&l&&l({action:s,location:h.location,delta:1})},replace:function(e,t){s=z.Replace;let n=Me(h.location,e,t);r&&r(n,e),u=c();let a=lr(n,u),d=h.createHref(n);i.replaceState(a,"",d),o&&l&&l({action:s,location:h.location,delta:0})},go:e=>i.go(e)};return h}var W;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(W||(W={}));const pn=new Set(["lazy","caseSensitive","path","id","index","children"]);function vn(e){return!0===e.index}function At(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(L(!0!==e.index||!e.children,"Cannot specify children on an index route"),L(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),vn(e)){let r=K({},e,t(e),{id:i});return n[i]=r,r}{let r=K({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=At(e.children,t,o,n)),r}}))}function ke(e,t,r){void 0===r&&(r="/");let n=ee(("string"==typeof t?ce(t):t).pathname||"/",r);if(null==n)return null;let a=_r(e);gn(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=Dn(n);o=Cn(a[e],t)}return o}function Tr(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function _r(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(L(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=de([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(L(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),_r(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:xn(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of Mr(e.path))a(e,t,r);else a(e,t)})),t}function Mr(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=Mr(n.join("/")),s=[];return s.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}function gn(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:Pn(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}const yn=/^:[\w-]+$/,bn=3,wn=2,Rn=1,En=10,Sn=-2,sr=e=>"*"===e;function xn(e,t){let r=e.split("/"),n=r.length;return r.some(sr)&&(n+=Sn),t&&(n+=wn),r.filter((e=>!sr(e))).reduce(((e,t)=>e+(yn.test(t)?bn:""===t?Rn:En)),n)}function Pn(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}function Cn(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],s=e===r.length-1,l="/"===a?t:t.slice(a.length)||"/",u=pt({path:i.relativePath,caseSensitive:i.caseSensitive,end:s},l);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:de([a,u.pathname]),pathnameBase:Mn(de([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=de([a,u.pathnameBase]))}return o}function ao(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(ge(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return L("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function pt(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ln(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=s[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[r];return e[n]=a&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function Ln(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),ge("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Dn(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return ge(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ee(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function Tn(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?ce(e):e;return{pathname:r?r.startsWith("/")?r:_n(r,t):t,search:Fn(n),hash:Un(a)}}function _n(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}function Tt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Fr(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function gt(e,t){let r=Fr(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function yt(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=ce(e):(a=K({},e),L(!a.pathname||!a.pathname.includes("?"),Tt("?","pathname","search",a)),L(!a.pathname||!a.pathname.includes("#"),Tt("#","pathname","hash",a)),L(!a.search||!a.search.includes("#"),Tt("#","search","hash",a)));let o,i=""===e||""===a.pathname,s=i?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=Tn(a,o),u=s&&"/"!==s&&s.endsWith("/"),c=(i||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const de=e=>e.join("/").replace(/\/\/+/g,"/"),Mn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Fn=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Un=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",oo=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),K({},r,{headers:n}))};class Ot extends Error{}class An{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],L(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new Ot("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof Ot)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return L(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:jn(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function On(e){return e instanceof Promise&&!0===e._tracked}function jn(e){if(!On(e))return e;if(e._error)throw e._error;return e._data}const io=function(e,t){return void 0===t&&(t={}),new An(e,"number"==typeof t?{status:t}:t)},In=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,K({},r,{headers:n}))},lo=(e,t)=>{let r=In(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Kt{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Ur(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const Ar=["post","put","patch","delete"],Nn=new Set(Ar),kn=["get",...Ar],Bn=new Set(kn),zn=new Set([301,302,303,307,308]),Kn=new Set([307,308]),_t={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Or={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ir="remix-router-transitions";function Ht(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;let a;if(L(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;a=e=>({hasErrorBoundary:t(e)})}else a=Hn;let o,i={},s=At(e.routes,a,void 0,i),l=e.basename||"/",u=K({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),c=null,d=new Set,f=null,h=null,p=null,m=null!=e.hydrationData,v=ke(s,e.history.location,l),y=null;if(null==v){let t=ie(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=vr(s);v=r,y={[n.id]:t}}let g,b=v.some((e=>e.route.lazy)),w=v.some((e=>e.route.loader));if(b)g=!1;else if(w)if(u.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;g=v.every((e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id])))}else g=null!=e.hydrationData;else g=!0;let E,S,R={historyAction:e.history.action,location:e.history.location,matches:v,initialized:g,navigation:_t,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||y,fetchers:new Map,blockers:new Map},x=z.Pop,D=!1,C=!1,k=new Map,P=null,_=!1,T=!1,A=[],M=[],U=new Map,j=0,O=-1,F=new Map,N=new Set,B=new Map,I=new Map,H=new Set,$=new Map,q=new Map,J=!1;function Y(e,t){void 0===t&&(t={}),R=K({},R,e);let r=[],n=[];u.v7_fetcherPersist&&R.fetchers.forEach(((e,t)=>{"idle"===e.state&&(H.has(t)?n.push(t):r.push(t))})),[...d].forEach((e=>e(R,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),u.v7_fetcherPersist&&(r.forEach((e=>R.fetchers.delete(e))),n.forEach((e=>ae(e))))}function V(t,r,n){var a,i;let l,{flushSync:u}=void 0===n?{}:n,c=null!=R.actionData&&null!=R.navigation.formMethod&&ue(R.navigation.formMethod)&&"loading"===R.navigation.state&&!0!==(null==(a=t.state)?void 0:a._isRedirect);l=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:c?R.actionData:null;let d=r.loaderData?pr(R.loaderData,r.loaderData,r.matches||[],r.errors):R.loaderData,f=R.blockers;f.size>0&&(f=new Map(f),f.forEach(((e,t)=>f.set(t,Ne))));let h,p=!0===D||null!=R.navigation.formMethod&&ue(R.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);if(o&&(s=o,o=void 0),_||x===z.Pop||(x===z.Push?e.history.push(t,t.state):x===z.Replace&&e.history.replace(t,t.state)),x===z.Pop){let e=k.get(R.location.pathname);e&&e.has(t.pathname)?h={currentLocation:R.location,nextLocation:t}:k.has(t.pathname)&&(h={currentLocation:t,nextLocation:R.location})}else if(C){let e=k.get(R.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),k.set(R.location.pathname,e)),h={currentLocation:R.location,nextLocation:t}}Y(K({},r,{actionData:l,loaderData:d,historyAction:x,location:t,initialized:!0,navigation:_t,revalidation:"idle",restoreScrollPosition:ve(t,r.matches||R.matches),preventScrollReset:p,blockers:f}),{viewTransitionOpts:h,flushSync:!0===u}),x=z.Pop,D=!1,C=!1,_=!1,T=!1,A=[],M=[]}async function Z(t,r,n){S&&S.abort(),S=null,x=t,_=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(f&&p){let r=me(e,t);f[r]=p()}}(R.location,R.matches),D=!0===(n&&n.preventScrollReset),C=!0===(n&&n.enableViewTransition);let c=o||s,d=n&&n.overrideNavigation,h=ke(c,r,l),m=!0===(n&&n.flushSync);if(!h){let e=ie(404,{pathname:r.pathname}),{matches:t,route:n}=vr(c);return pe(),void V(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:m})}if(R.initialized&&!T&&qn(R.location,r)&&!(n&&n.submission&&ue(n.submission.formMethod)))return void V(r,{matches:h},{flushSync:m});S=new AbortController;let v,y,g=Ye(e.history,r,S.signal,n&&n.submission);if(n&&n.pendingError)y={[Qe(h).route.id]:n.pendingError};else if(n&&n.submission&&ue(n.submission.formMethod)){let e=await async function(e,t,r,n,o){void 0===o&&(o={}),Q();let s=Qn(t,r);Y({navigation:s},{flushSync:!0===o.flushSync});let c,d=Nt(n,t);if(d.route.action||d.route.lazy){if(c=await qe("action",e,d,n,i,a,l,u.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else c={type:W.error,error:ie(405,{method:e.method,pathname:t.pathname,routeId:d.route.id})};if(_e(c)){let e;return e=o&&null!=o.replace?o.replace:c.location===R.location.pathname+R.location.search,await G(R,c,{submission:r,replace:e}),{shortCircuited:!0}}if(Be(c)){let e=Qe(n,d.route.id);return!0!==(o&&o.replace)&&(x=z.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:c.error}}}if(Te(c))throw ie(400,{type:"defer-action"});return{pendingActionData:{[d.route.id]:c.data}}}(g,r,n.submission,h,{replace:n.replace,flushSync:m});if(e.shortCircuited)return;v=e.pendingActionData,y=e.pendingActionError,d=Mt(r,n.submission),m=!1,g=new Request(g.url,{signal:g.signal})}let{shortCircuited:b,loaderData:w,errors:E}=await async function(t,r,n,a,i,c,d,f,h,p,m){let v=a||Mt(r,i),y=i||c||br(v),g=o||s,[b,w]=cr(e.history,R,n,y,r,u.v7_partialHydration&&!0===f,T,A,M,H,B,N,g,l,p,m);if(pe((e=>!(n&&n.some((t=>t.route.id===e)))||b&&b.some((t=>t.route.id===e)))),O=++j,0===b.length&&0===w.length){let e=le();return V(r,K({matches:n,loaderData:{},errors:m||null},p?{actionData:p}:{},e?{fetchers:new Map(R.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(!(_||u.v7_partialHydration&&f)){w.forEach((e=>{let t=R.fetchers.get(e.key),r=Ge(void 0,t?t.data:void 0);R.fetchers.set(e.key,r)}));let e=p||R.actionData;Y(K({navigation:v},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},w.length>0?{fetchers:new Map(R.fetchers)}:{}),{flushSync:h})}w.forEach((e=>{U.has(e.key)&&oe(e.key),e.controller&&U.set(e.key,e.controller)}));let E=()=>w.forEach((e=>oe(e.key)));S&&S.signal.addEventListener("abort",E);let{results:x,loaderResults:L,fetcherResults:D}=await X(R.matches,n,b,w,t);if(t.signal.aborted)return{shortCircuited:!0};S&&S.signal.removeEventListener("abort",E),w.forEach((e=>U.delete(e.key)));let C=gr(x);if(C){if(C.idx>=b.length){let e=w[C.idx-b.length].key;N.add(e)}return await G(R,C.result,{replace:d}),{shortCircuited:!0}}let{loaderData:k,errors:P}=mr(R,n,b,L,m,w,D,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))})),u.v7_partialHydration&&f&&R.errors&&Object.entries(R.errors).filter((e=>{let[t]=e;return!b.some((e=>e.route.id===t))})).forEach((e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})}));let F=le(),z=ce(O),W=F||z||w.length>0;return K({loaderData:k,errors:P},W?{fetchers:new Map(R.fetchers)}:{})}(g,r,h,d,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,m,v,y);b||(S=null,V(r,K({matches:h},v?{actionData:v}:{},{loaderData:w,errors:E})))}async function G(n,a,o){let{submission:i,fetcherSubmission:s,replace:u}=void 0===o?{}:o;a.revalidate&&(T=!0);let c=Me(n.location,a.location,{_isRedirect:!0});if(L(c,"Expected a location on the redirect navigation"),r){let r=!1;if(a.reloadDocument)r=!0;else if(jr.test(a.location)){const n=e.history.createURL(a.location);r=n.origin!==t.location.origin||null==ee(n.pathname,l)}if(r)return void(u?t.location.replace(a.location):t.location.assign(a.location))}S=null;let d=!0===u?z.Replace:z.Push,{formMethod:f,formAction:h,formEncType:p}=n.navigation;!i&&!s&&f&&h&&p&&(i=br(n.navigation));let m=i||s;if(Kn.has(a.status)&&m&&ue(m.formMethod))await Z(d,c,{submission:K({},m,{formAction:a.location}),preventScrollReset:D});else{let e=Mt(c,i);await Z(d,c,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:D})}}async function X(t,r,n,o,s){let c=await Promise.all([...n.map((e=>qe("loader",s,e,r,i,a,l,u.v7_relativeSplatPath))),...o.map((t=>t.matches&&t.match&&t.controller?qe("loader",Ye(e.history,t.path,t.controller.signal),t.match,t.matches,i,a,l,u.v7_relativeSplatPath):{type:W.error,error:ie(404,{pathname:t.path})}))]),d=c.slice(0,n.length),f=c.slice(n.length);return await Promise.all([yr(t,n,d,d.map((()=>s.signal)),!1,R.loaderData),yr(t,o.map((e=>e.match)),f,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:c,loaderResults:d,fetcherResults:f}}function Q(){T=!0,A.push(...pe()),B.forEach(((e,t)=>{U.has(t)&&(M.push(t),oe(t))}))}function te(e,t,r){void 0===r&&(r={}),R.fetchers.set(e,t),Y({fetchers:new Map(R.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function re(e,t,r,n){void 0===n&&(n={});let a=Qe(R.matches,t);ae(e),Y({errors:{[a.route.id]:r},fetchers:new Map(R.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ne(e){return u.v7_fetcherPersist&&(I.set(e,(I.get(e)||0)+1),H.has(e)&&H.delete(e)),R.fetchers.get(e)||Or}function ae(e){let t=R.fetchers.get(e);U.has(e)&&!(t&&"loading"===t.state&&F.has(e))&&oe(e),B.delete(e),F.delete(e),N.delete(e),H.delete(e),R.fetchers.delete(e)}function oe(e){let t=U.get(e);L(t,"Expected fetch controller: "+e),t.abort(),U.delete(e)}function se(e){for(let t of e){let e=Re(ne(t).data);R.fetchers.set(t,e)}}function le(){let e=[],t=!1;for(let r of N){let n=R.fetchers.get(r);L(n,"Expected fetcher: "+r),"loading"===n.state&&(N.delete(r),e.push(r),t=!0)}return se(e),t}function ce(e){let t=[];for(let[r,n]of F)if(n<e){let e=R.fetchers.get(r);L(e,"Expected fetcher: "+r),"loading"===e.state&&(oe(r),F.delete(r),t.push(r))}return se(t),t.length>0}function de(e){R.blockers.delete(e),q.delete(e)}function fe(e,t){let r=R.blockers.get(e)||Ne;L("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(R.blockers);n.set(e,t),Y({blockers:n})}function he(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===q.size)return;q.size>1&&ge(!1,"A router only supports one blocker at a time");let a=Array.from(q.entries()),[o,i]=a[a.length-1],s=R.blockers.get(o);return s&&"proceeding"===s.state||!i({currentLocation:t,nextLocation:r,historyAction:n})?void 0:o}function pe(e){let t=[];return $.forEach(((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),$.delete(n))})),t}function me(e,t){return h&&h(e,t.map((e=>Tr(e,R.loaderData))))||e.key}function ve(e,t){if(f){let r=me(e,t),n=f[r];if("number"==typeof n)return n}return null}return E={get basename(){return l},get future(){return u},get state(){return R},get routes(){return s},get window(){return t},initialize:function(){if(c=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(J)return void(J=!1);ge(0===q.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=he({currentLocation:R.location,nextLocation:n,historyAction:r});return o&&null!=a?(J=!0,e.history.go(-1*a),void fe(o,{state:"blocked",location:n,proceed(){fe(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(R.blockers);e.set(o,Ne),Y({blockers:e})}})):Z(r,n)})),r){ea(t,k);let e=()=>ta(t,k);t.addEventListener("pagehide",e),P=()=>t.removeEventListener("pagehide",e)}return R.initialized||Z(z.Pop,R.location,{initialHydration:!0}),E},subscribe:function(e){return d.add(e),()=>d.delete(e)},enableScrollRestoration:function(e,t,r){if(f=e,p=t,h=r||null,!m&&R.navigation===_t){m=!0;let e=ve(R.location,R.matches);null!=e&&Y({restoreScrollPosition:e})}return()=>{f=null,p=null,h=null}},navigate:async function t(r,n){if("number"==typeof r)return void e.history.go(r);let a=jt(R.location,R.matches,l,u.v7_prependBasename,r,u.v7_relativeSplatPath,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:o,submission:i,error:s}=ur(u.v7_normalizeFormMethod,!1,a,n),c=R.location,d=Me(R.location,o,n&&n.state);d=K({},d,e.history.encodeLocation(d));let f=n&&null!=n.replace?n.replace:void 0,h=z.Push;!0===f?h=z.Replace:!1===f||null!=i&&ue(i.formMethod)&&i.formAction===R.location.pathname+R.location.search&&(h=z.Replace);let p=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,m=!0===(n&&n.unstable_flushSync),v=he({currentLocation:c,nextLocation:d,historyAction:h});if(!v)return await Z(h,d,{submission:i,pendingError:s,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.unstable_viewTransition,flushSync:m});fe(v,{state:"blocked",location:d,proceed(){fe(v,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,n)},reset(){let e=new Map(R.blockers);e.set(v,Ne),Y({blockers:e})}})},fetch:function(t,r,c,d){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");U.has(t)&&oe(t);let f=!0===(d&&d.unstable_flushSync),h=o||s,p=jt(R.location,R.matches,l,u.v7_prependBasename,c,u.v7_relativeSplatPath,r,null==d?void 0:d.relative),m=ke(h,p,l);if(!m)return void re(t,r,ie(404,{pathname:p}),{flushSync:f});let{path:v,submission:y,error:g}=ur(u.v7_normalizeFormMethod,!0,p,d);if(g)return void re(t,r,g,{flushSync:f});let b=Nt(m,v);D=!0===(d&&d.preventScrollReset),y&&ue(y.formMethod)?async function(t,r,n,c,d,f,h){if(Q(),B.delete(t),!c.route.action&&!c.route.lazy){let e=ie(405,{method:h.formMethod,pathname:n,routeId:r});return void re(t,r,e,{flushSync:f})}let p=R.fetchers.get(t);te(t,Zn(h,p),{flushSync:f});let m=new AbortController,v=Ye(e.history,n,m.signal,h);U.set(t,m);let y=j,g=await qe("action",v,c,d,i,a,l,u.v7_relativeSplatPath);if(v.signal.aborted)return void(U.get(t)===m&&U.delete(t));if(u.v7_fetcherPersist&&H.has(t)){if(_e(g)||Be(g))return void te(t,Re(void 0))}else{if(_e(g))return U.delete(t),O>y?void te(t,Re(void 0)):(N.add(t),te(t,Ge(h)),G(R,g,{fetcherSubmission:h}));if(Be(g))return void re(t,r,g.error)}if(Te(g))throw ie(400,{type:"defer-action"});let b=R.navigation.location||R.location,w=Ye(e.history,b,m.signal),E=o||s,D="idle"!==R.navigation.state?ke(E,R.navigation.location,l):R.matches;L(D,"Didn't find any matches after fetcher action");let C=++j;F.set(t,C);let k=Ge(h,g.data);R.fetchers.set(t,k);let[P,_]=cr(e.history,R,D,h,b,!1,T,A,M,H,B,N,E,l,{[c.route.id]:g.data},void 0);_.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=R.fetchers.get(t),n=Ge(void 0,r?r.data:void 0);R.fetchers.set(t,n),U.has(t)&&oe(t),e.controller&&U.set(t,e.controller)})),Y({fetchers:new Map(R.fetchers)});let z=()=>_.forEach((e=>oe(e.key)));m.signal.addEventListener("abort",z);let{results:K,loaderResults:W,fetcherResults:I}=await X(R.matches,D,P,_,w);if(m.signal.aborted)return;m.signal.removeEventListener("abort",z),F.delete(t),U.delete(t),_.forEach((e=>U.delete(e.key)));let q=gr(K);if(q){if(q.idx>=P.length){let e=_[q.idx-P.length].key;N.add(e)}return G(R,q.result)}let{loaderData:J,errors:Z}=mr(R,R.matches,P,W,void 0,_,I,$);if(R.fetchers.has(t)){let e=Re(g.data);R.fetchers.set(t,e)}ce(C),"loading"===R.navigation.state&&C>O?(L(x,"Expected pending action"),S&&S.abort(),V(R.navigation.location,{matches:D,loaderData:J,errors:Z,fetchers:new Map(R.fetchers)})):(Y({errors:Z,loaderData:pr(R.loaderData,J,D,Z),fetchers:new Map(R.fetchers)}),T=!1)}(t,r,v,b,m,f,y):(B.set(t,{routeId:r,path:v}),async function(t,r,n,o,s,c,d){let f=R.fetchers.get(t);te(t,Ge(d,f?f.data:void 0),{flushSync:c});let h=new AbortController,p=Ye(e.history,n,h.signal);U.set(t,h);let m=j,v=await qe("loader",p,o,s,i,a,l,u.v7_relativeSplatPath);if(Te(v)&&(v=await Br(v,p.signal,!0)||v),U.get(t)===h&&U.delete(t),!p.signal.aborted){if(H.has(t))return void te(t,Re(void 0));if(_e(v))return O>m?void te(t,Re(void 0)):(N.add(t),void await G(R,v));if(Be(v))return void re(t,r,v.error);L(!Te(v),"Unhandled fetcher deferred data"),te(t,Re(v.data))}}(t,r,v,b,m,f,y))},revalidate:function(){if(Q(),Y({revalidation:"loading"}),"submitting"!==R.navigation.state){if("idle"===R.navigation.state)return void Z(R.historyAction,R.location,{startUninterruptedRevalidation:!0});Z(x||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ne,deleteFetcher:function(e){if(u.v7_fetcherPersist){let t=(I.get(e)||0)-1;t<=0?(I.delete(e),H.add(e)):I.set(e,t)}else ae(e);Y({fetchers:new Map(R.fetchers)})},dispose:function(){c&&c(),P&&P(),d.clear(),S&&S.abort(),R.fetchers.forEach(((e,t)=>ae(t))),R.blockers.forEach(((e,t)=>de(t)))},getBlocker:function(e,t){let r=R.blockers.get(e)||Ne;return q.get(e)!==t&&q.set(e,t),r},deleteBlocker:de,_internalFetchControllers:U,_internalActiveDeferreds:$,_internalSetRoutes:function(e){i={},o=At(e,a,void 0,i)}},E}function Wn(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}function jt(e,t,r,n,a,o,i,s){let l,u;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){u=e;break}}else l=t,u=t[t.length-1];let c=yt(a||".",gt(l,o),ee(e.pathname,r)||e.pathname,"path"===s);return null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u&&u.route.index&&!Wt(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:de([r,c.pathname])),fe(c)}function ur(e,t,r,n){if(!n||!Wn(n))return{path:r};if(n.formMethod&&!Xn(n.formMethod))return{path:r,error:ie(405,{method:n.formMethod})};let a,o,i=()=>({path:r,error:ie(400,{type:"invalid-body"})}),s=n.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),u=kr(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!ue(l))return i();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:l,formAction:u,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!ue(l))return i();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:u,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return i()}}}if(L("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=It(n.formData),o=n.formData;else if(n.body instanceof FormData)a=It(n.body),o=n.body;else if(n.body instanceof URLSearchParams)a=n.body,o=hr(a);else if(null==n.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(n.body),o=hr(a)}catch{return i()}let c={formMethod:l,formAction:u,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(ue(c.formMethod))return{path:r,submission:c};let d=ce(r);return t&&d.search&&Wt(d.search)&&a.append("index",""),d.search="?"+a,{path:fe(d),submission:c}}function $n(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}function cr(e,t,r,n,a,o,i,s,l,u,c,d,f,h,p,m){let v=m?Object.values(m)[0]:p?Object.values(p)[0]:void 0,y=e.createURL(t.location),g=e.createURL(a),b=m?Object.keys(m)[0]:void 0,w=$n(r,b).filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(Vn(t.loaderData,t.matches[r],e)||s.some((t=>t===e.route.id)))return!0;let l=t.matches[r],u=e;return dr(e,K({currentUrl:y,currentParams:l.params,nextUrl:g,nextParams:u.params},n,{actionResult:v,defaultShouldRevalidate:i||y.pathname+y.search===g.pathname+g.search||y.search!==g.search||Nr(l,u)}))})),E=[];return c.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||u.has(a))return;let s=ke(f,e.path,h);if(!s)return void E.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=t.fetchers.get(a),p=Nt(s,e.path),m=!1;m=!d.has(a)&&(!!l.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:dr(p,K({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:i})))),m&&E.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:p,controller:new AbortController})})),[w,E]}function Vn(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}function Nr(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function fr(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];L(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;ge(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),!t&&!pn.has(e)&&(o[e]=n[e])}Object.assign(a,o),Object.assign(a,K({},t(a),{lazy:void 0}))}async function qe(e,t,r,n,a,o,i,s,l){void 0===l&&(l={});let u,c,d,f=e=>{let n,a=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:l.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([f(n).catch((t=>{e=t})),fr(r.route,o,a)]);if(e)throw e;c=t[0]}else{if(await fr(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw ie(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:W.data,data:void 0}}c=await f(n)}else{if(!n){let e=new URL(t.url);throw ie(404,{pathname:e.pathname+e.search})}c=await f(n)}L(void 0!==c,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){u=W.error,c=e}finally{d&&t.signal.removeEventListener("abort",d)}if(Gn(c)){let e,a=c.status;if(zn.has(a)){let e=c.headers.get("Location");if(L(e,"Redirects returned/thrown from loaders/actions must have a Location header"),jr.test(e)){if(!l.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=ee(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=jt(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,s);if(l.isStaticRequest)throw c.headers.set("Location",e),c;return{type:W.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(l.isRouteRequest)throw{type:u===W.error?W.error:W.data,response:c};try{let t=c.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==c.body?null:await c.json():await c.text()}catch(e){return{type:W.error,error:e}}return u===W.error?{type:u,error:new Kt(a,c.statusText,e),headers:c.headers}:{type:W.data,data:e,statusCode:c.status,headers:c.headers}}return u===W.error?{type:u,error:c}:Yn(c)?{type:W.deferred,deferredData:c,statusCode:null==(h=c.init)?void 0:h.status,headers:(null==(p=c.init)?void 0:p.headers)&&new Headers(c.init.headers)}:{type:W.data,data:c};var h,p}function Ye(e,t,r,n){let a=e.createURL(kr(t)).toString(),o={signal:r};if(n&&ue(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=It(n.formData):o.body=n.formData}return new Request(a,o)}function It(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function hr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Jn(e,t,r,n,a){let o,i={},s=null,l=!1,u={};return r.forEach(((r,c)=>{let d=t[c].route.id;if(L(!_e(r),"Cannot handle redirect results in processLoaderData"),Be(r)){let t=Qe(e,d),a=r.error;n&&(a=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=a),i[d]=void 0,l||(l=!0,o=Ur(r.error)?r.error.status:500),r.headers&&(u[d]=r.headers)}else Te(r)?(a.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null!=r.statusCode&&200!==r.statusCode&&!l&&(o=r.statusCode),r.headers&&(u[d]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:o||200,loaderHeaders:u}}function mr(e,t,r,n,a,o,i,s){let{loaderData:l,errors:u}=Jn(t,r,n,a,s);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];L(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let s=i[t];if(!a||!a.signal.aborted)if(Be(s)){let t=Qe(e.matches,null==n?void 0:n.route.id);u&&u[t.route.id]||(u=K({},u,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(_e(s))L(!1,"Unhandled fetcher revalidation redirect");else if(Te(s))L(!1,"Unhandled fetcher deferred data");else{let t=Re(s.data);e.fetchers.set(r,t)}}return{loaderData:l,errors:u}}function pr(e,t,r,n){let a=K({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Qe(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function vr(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ie(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?s="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?s="defer() is not supported in actions":"invalid-body"===o&&(s="Unable to encode submission body")):403===e?(i="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",s='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?s="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(s='Invalid request method "'+a.toUpperCase()+'"')),new Kt(e||500,i,new Error(s),!0)}function gr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(_e(r))return{result:r,idx:t}}}function kr(e){return fe(K({},"string"==typeof e?ce(e):e,{hash:""}))}function qn(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}function Te(e){return e.type===W.deferred}function Be(e){return e.type===W.error}function _e(e){return(e&&e.type)===W.redirect}function Yn(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}function Gn(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&typeof e.body<"u"}function Xn(e){return Bn.has(e.toLowerCase())}function ue(e){return Nn.has(e.toLowerCase())}async function yr(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let s=r[i],l=t[i];if(!l)continue;let u=e.find((e=>e.route.id===l.route.id)),c=null!=u&&!Nr(u,l)&&void 0!==(o&&o[l.route.id]);if(Te(s)&&(a||c)){let e=n[i];L(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Br(s,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Br(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:W.data,data:e.deferredData.unwrappedData}}catch(e){return{type:W.error,error:e}}return{type:W.data,data:e.deferredData.data}}}function Wt(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Nt(e,t){let r="string"==typeof t?ce(t).search:t.search;if(e[e.length-1].route.index&&Wt(r||""))return e[e.length-1];let n=Fr(e);return n[n.length-1]}function br(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Mt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ge(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Zn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Re(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ea(e,t){try{let r=e.sessionStorage.getItem(Ir);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch{}}function ta(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(Ir,JSON.stringify(r))}catch(e){ge(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ee.apply(this,arguments)}const et=f.createContext(null),bt=f.createContext(null),vt=f.createContext(null),le=f.createContext(null),tt=f.createContext(null),se=f.createContext({outlet:null,matches:[],isDataRoute:!1}),zr=f.createContext(null);function ra(e,t){let{relative:r}=void 0===t?{}:t;Fe()||L(!1);let{basename:n,navigator:a}=f.useContext(le),{hash:o,pathname:i,search:s}=rt(e,{relative:r}),l=i;return"/"!==n&&(l="/"===i?n:de([n,i])),a.createHref({pathname:l,search:s,hash:o})}function Fe(){return null!=f.useContext(tt)}function he(){return Fe()||L(!1),f.useContext(tt).location}function so(){return f.useContext(tt).navigationType}function uo(e){Fe()||L(!1);let{pathname:t}=he();return f.useMemo((()=>pt(e,t)),[t,e])}function Kr(e){f.useContext(le).static||f.useLayoutEffect(e)}function $t(){let{isDataRoute:e}=f.useContext(se);return e?ya():na()}function na(){Fe()||L(!1);let e=f.useContext(et),{basename:t,future:r,navigator:n}=f.useContext(le),{matches:a}=f.useContext(se),{pathname:o}=he(),i=JSON.stringify(gt(a,r.v7_relativeSplatPath)),s=f.useRef(!1);return Kr((()=>{s.current=!0})),f.useCallback((function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let l=yt(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:de([t,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)}),[t,n,i,o,e])}const Hr=f.createContext(null);function co(){return f.useContext(Hr)}function aa(e){let t=f.useContext(se).outlet;return t&&f.createElement(Hr.Provider,{value:e},t)}function fo(){let{matches:e}=f.useContext(se),t=e[e.length-1];return t?t.params:{}}function rt(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=f.useContext(le),{matches:a}=f.useContext(se),{pathname:o}=he(),i=JSON.stringify(gt(a,n.v7_relativeSplatPath));return f.useMemo((()=>yt(e,JSON.parse(i),o,"path"===r)),[e,i,o,r])}function oa(e,t){return Wr(e,t)}function Wr(e,t,r,n){Fe()||L(!1);let{navigator:a}=f.useContext(le),{matches:o}=f.useContext(se),i=o[o.length-1],s=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u,c=he();if(t){var d;let e="string"==typeof t?ce(t):t;"/"===l||null!=(d=e.pathname)&&d.startsWith(l)||L(!1),u=e}else u=c;let h=u.pathname||"/",p=h;if("/"!==l){let e=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=ke(e,{pathname:p}),v=$r(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:de([l,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:de([l,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,r,n);return t&&v?f.createElement(tt.Provider,{value:{location:Ee({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:z.Pop}},v):v}function ia(){let e=ma(),t=Ur(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},r):null,null)}const la=f.createElement(ia,null);class sa extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?f.createElement(se.Provider,{value:this.props.routeContext},f.createElement(zr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ua(e){let{routeContext:t,match:r,children:n}=e,a=f.useContext(et);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(se.Provider,{value:t},n)}function $r(e,t,r,n){var a;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var o;if(null==(o=r)||!o.errors)return null;e=r.matches}let i=e,s=null==(a=r)?void 0:a.errors;if(null!=s){let e=i.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||L(!1),i=i.slice(0,Math.min(i.length,e+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){l=!0,i=u>=0?i.slice(0,u+1):[i[0]];break}}}return i.reduceRight(((e,n,a)=>{let o,c=!1,d=null,h=null;r&&(o=s&&n.route.id?s[n.route.id]:void 0,d=n.route.errorElement||la,l&&(u<0&&0===a?(ba("route-fallback"),c=!0,h=null):u===a&&(c=!0,h=n.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,a+1)),m=()=>{let t;return t=o?d:c?h:n.route.Component?f.createElement(n.route.Component,null):n.route.element?n.route.element:e,f.createElement(ua,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?f.createElement(sa,{location:r.location,revalidation:r.revalidation,component:d,error:o,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}var wt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(wt||{}),te=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(te||{});function Vt(e){let t=f.useContext(et);return t||L(!1),t}function xe(e){let t=f.useContext(bt);return t||L(!1),t}function ca(e){let t=f.useContext(se);return t||L(!1),t}function nt(e){let t=ca(),r=t.matches[t.matches.length-1];return r.route.id||L(!1),r.route.id}function da(){return nt(te.UseRouteId)}function fa(){return xe(te.UseNavigation).navigation}function ho(){let e=Vt(wt.UseRevalidator),t=xe(te.UseRevalidator);return f.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function ha(){let{matches:e,loaderData:t}=xe(te.UseMatches);return f.useMemo((()=>e.map((e=>Tr(e,t)))),[e,t])}function mo(){let e=xe(te.UseLoaderData),t=nt(te.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function po(e){return xe(te.UseRouteLoaderData).loaderData[e]}function vo(){let e=xe(te.UseActionData),t=nt(te.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ma(){var e;let t=f.useContext(zr),r=xe(te.UseRouteError),n=nt(te.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function pa(){let e=f.useContext(vt);return null==e?void 0:e._data}function go(){let e=f.useContext(vt);return null==e?void 0:e._error}let va=0;function ga(e){let{router:t,basename:r}=Vt(wt.UseBlocker),n=xe(te.UseBlocker),[a,o]=f.useState(""),i=f.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:Ee({},n,{pathname:ee(n.pathname,r)||n.pathname}),nextLocation:Ee({},a,{pathname:ee(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return f.useEffect((()=>{let e=String(++va);return o(e),()=>t.deleteBlocker(e)}),[t]),f.useEffect((()=>{""!==a&&t.getBlocker(a,i)}),[t,a,i]),a&&n.blockers.has(a)?n.blockers.get(a):Ne}function ya(){let{router:e}=Vt(wt.UseNavigateStable),t=nt(te.UseNavigateStable),r=f.useRef(!1);return Kr((()=>{r.current=!0})),f.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,Ee({fromRouteId:t},a)))}),[e,t])}const wr={};function ba(e,t,r){wr[e]||(wr[e]=!0)}const wa="startTransition",Rr=zt[wa];function yo(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:o}=e,i=f.useRef();null==i.current&&(i.current=Pr({initialEntries:n,initialIndex:a,v5Compat:!0}));let s=i.current,[l,u]=f.useState({action:s.action,location:s.location}),{v7_startTransition:c}=o||{},d=f.useCallback((e=>{c&&Rr?Rr((()=>u(e))):u(e)}),[u,c]);return f.useLayoutEffect((()=>s.listen(d)),[s,d]),f.createElement(at,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:o})}function bo(e){let{to:t,replace:r,state:n,relative:a}=e;Fe()||L(!1);let{future:o,static:i}=f.useContext(le),{matches:s}=f.useContext(se),{pathname:l}=he(),u=$t(),c=yt(t,gt(s,o.v7_relativeSplatPath),l,"path"===a),d=JSON.stringify(c);return f.useEffect((()=>u(JSON.parse(d),{replace:r,state:n,relative:a})),[u,d,a,r,n]),null}function wo(e){return aa(e.context)}function Ra(e){L(!1)}function at(e){let{basename:t="/",children:r=null,location:n,navigationType:a=z.Pop,navigator:o,static:i=!1,future:s}=e;Fe()&&L(!1);let l=t.replace(/^\/*/,"/"),u=f.useMemo((()=>({basename:l,navigator:o,static:i,future:Ee({v7_relativeSplatPath:!1},s)})),[l,s,o,i]);"string"==typeof n&&(n=ce(n));let{pathname:c="/",search:d="",hash:h="",state:p=null,key:m="default"}=n,v=f.useMemo((()=>{let e=ee(c,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:p,key:m},navigationType:a}}),[l,c,d,h,p,m,a]);return null==v?null:f.createElement(le.Provider,{value:u},f.createElement(tt.Provider,{children:r,value:v}))}function Ro(e){let{children:t,location:r}=e;return oa(kt(t),r)}function Eo(e){let{children:t,errorElement:r,resolve:n}=e;return f.createElement(Sa,{resolve:n,errorElement:r},f.createElement(xa,null,t))}var oe=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(oe||{});const Ea=new Promise((()=>{}));class Sa extends f.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,a=oe.pending;if(r instanceof Promise)if(this.state.error){a=oe.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,a=void 0!==n._error?oe.error:void 0!==n._data?oe.success:oe.pending):(a=oe.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else a=oe.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(a===oe.error&&n._error instanceof Ot)throw Ea;if(a===oe.error&&!t)throw n._error;if(a===oe.error)return f.createElement(vt.Provider,{value:n,children:t});if(a===oe.success)return f.createElement(vt.Provider,{value:n,children:e});throw n}}function xa(e){let{children:t}=e,r=pa(),n="function"==typeof t?t(r):t;return f.createElement(f.Fragment,null,n)}function kt(e,t){void 0===t&&(t=[]);let r=[];return f.Children.forEach(e,((e,n)=>{if(!f.isValidElement(e))return;let a=[...t,n];if(e.type===f.Fragment)return void r.push.apply(r,kt(e.props.children,a));e.type!==Ra&&L(!1),!e.props.index||!e.props.children||L(!1);let o={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=kt(e.props.children,a)),r.push(o)})),r}function So(e){return $r(e)}function Jt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function xo(e,t){return Ht({basename:null==t?void 0:t.basename,future:Ee({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:Pr({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Jt}).initialize()}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(this,arguments)}function qt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(a[r]=e[r]);return a}const mt="get",Ft="application/x-www-form-urlencoded";function Rt(e){return null!=e&&"string"==typeof e.tagName}function Pa(e){return Rt(e)&&"button"===e.tagName.toLowerCase()}function Ca(e){return Rt(e)&&"form"===e.tagName.toLowerCase()}function La(e){return Rt(e)&&"input"===e.tagName.toLowerCase()}function Da(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ta(e,t){return!(0!==e.button||t&&"_self"!==t||Da(e))}function Bt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}function _a(e,t){let r=Bt(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}let ft=null;function Ma(){if(null===ft)try{new FormData(document.createElement("form"),0),ft=!1}catch{ft=!0}return ft}const Fa=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ut(e){return null==e||Fa.has(e)?e:null}function Ua(e,t){let r,n,a,o,i;if(Ca(e)){let i=e.getAttribute("action");n=i?ee(i,t):null,r=e.getAttribute("method")||mt,a=Ut(e.getAttribute("enctype"))||Ft,o=new FormData(e)}else if(Pa(e)||La(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?ee(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||mt,a=Ut(e.getAttribute("formenctype"))||Ut(i.getAttribute("enctype"))||Ft,o=new FormData(i,e),!Ma()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else{if(Rt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=mt,n=null,a=Ft,i=e}return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const Aa=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Oa=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ja=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],Ia="6";try{window.__reactRouterVersion=Ia}catch{}function Po(e,t){return Ht({basename:null==t?void 0:t.basename,future:Z({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:Cr({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||Vr(),routes:e,mapRouteProperties:Jt,window:null==t?void 0:t.window}).initialize()}function Co(e,t){return Ht({basename:null==t?void 0:t.basename,future:Z({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:Lr({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||Vr(),routes:e,mapRouteProperties:Jt,window:null==t?void 0:t.window}).initialize()}function Vr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Z({},t,{errors:Na(t.errors)})),t}function Na(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new Kt(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch{}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const Jr=f.createContext({isTransitioning:!1}),qr=f.createContext(new Map),ka="startTransition",Se=zt[ka],Ba="flushSync",Er=hn[Ba],za="useId",Sr=zt[za];function Ka(e){Se?Se(e):e()}function Xe(e){Er?Er(e):e()}class Ha{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function Lo(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=f.useState(r.state),[i,s]=f.useState(),[l,u]=f.useState({isTransitioning:!1}),[c,d]=f.useState(),[h,p]=f.useState(),[m,v]=f.useState(),y=f.useRef(new Map),{v7_startTransition:g}=n||{},b=f.useCallback((e=>{g?Ka(e):e()}),[g]),w=f.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:i}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(i&&!l){if(a){Xe((()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})}));let t=r.window.document.startViewTransition((()=>{Xe((()=>o(e)))}));return t.finished.finally((()=>{Xe((()=>{d(void 0),p(void 0),s(void 0),u({isTransitioning:!1})}))})),void Xe((()=>p(t)))}h?(c&&c.resolve(),h.skipTransition(),v({state:e,currentLocation:i.currentLocation,nextLocation:i.nextLocation})):(s(e),u({isTransitioning:!0,flushSync:!1,currentLocation:i.currentLocation,nextLocation:i.nextLocation}))}else a?Xe((()=>o(e))):b((()=>o(e)))}),[r.window,h,c,y,b]);f.useLayoutEffect((()=>r.subscribe(w)),[r,w]),f.useEffect((()=>{l.isTransitioning&&!l.flushSync&&d(new Ha)}),[l]),f.useEffect((()=>{if(c&&i&&r.window){let e=i,t=c.promise,n=r.window.document.startViewTransition((async()=>{b((()=>o(e))),await t}));n.finished.finally((()=>{d(void 0),p(void 0),s(void 0),u({isTransitioning:!1})})),p(n)}}),[b,i,c,r.window]),f.useEffect((()=>{c&&i&&a.location.key===i.location.key&&c.resolve()}),[c,h,a.location,i]),f.useEffect((()=>{!l.isTransitioning&&m&&(s(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[l.isTransitioning,m]),f.useEffect((()=>{}),[]);let E=f.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",R=f.useMemo((()=>({router:r,navigator:E,static:!1,basename:S})),[r,E,S]);return f.createElement(f.Fragment,null,f.createElement(et.Provider,{value:R},f.createElement(bt.Provider,{value:a},f.createElement(qr.Provider,{value:y.current},f.createElement(Jr.Provider,{value:l},f.createElement(at,{basename:S,location:a.location,navigationType:a.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?f.createElement(Wa,{routes:r.routes,future:r.future,state:a}):t))))),null)}function Wa(e){let{routes:t,future:r,state:n}=e;return Wr(t,void 0,n,r)}function Do(e){let{basename:t,children:r,future:n,window:a}=e,o=f.useRef();null==o.current&&(o.current=Cr({window:a,v5Compat:!0}));let i=o.current,[s,l]=f.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=f.useCallback((e=>{u&&Se?Se((()=>l(e))):l(e)}),[l,u]);return f.useLayoutEffect((()=>i.listen(c)),[i,c]),f.createElement(at,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function To(e){let{basename:t,children:r,future:n,window:a}=e,o=f.useRef();null==o.current&&(o.current=Lr({window:a,v5Compat:!0}));let i=o.current,[s,l]=f.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},c=f.useCallback((e=>{u&&Se?Se((()=>l(e))):l(e)}),[l,u]);return f.useLayoutEffect((()=>i.listen(c)),[i,c]),f.createElement(at,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:i,future:n})}function _o(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=f.useState({action:a.action,location:a.location}),{v7_startTransition:s}=n||{},l=f.useCallback((e=>{s&&Se?Se((()=>i(e))):i(e)}),[i,s]);return f.useLayoutEffect((()=>a.listen(l)),[a,l]),f.createElement(at,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const $a=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Va=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ja=f.forwardRef((function(e,t){let r,{onClick:n,relative:a,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=e,h=qt(e,Aa),{basename:p}=f.useContext(le),m=!1;if("string"==typeof u&&Va.test(u)&&(r=u,$a))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=ee(t.pathname,p);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch{}let v=ra(u,{relative:a}),y=Ya(u,{replace:i,state:s,target:l,preventScrollReset:c,relative:a,unstable_viewTransition:d});return f.createElement("a",Z({},h,{href:r||v,onClick:m||o?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:l}))})),Mo=f.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:a="",end:o=!1,style:i,to:s,unstable_viewTransition:l,children:u}=e,c=qt(e,Oa),d=rt(s,{relative:c.relative}),h=he(),p=f.useContext(bt),{navigator:m,basename:v}=f.useContext(le),y=null!=p&&to(d)&&!0===l,g=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,b=h.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=ee(w,v)||w);const E="/"!==g&&g.endsWith("/")?g.length-1:g.length;let S,R=b===g||!o&&b.startsWith(g)&&"/"===b.charAt(E),x=null!=w&&(w===g||!o&&w.startsWith(g)&&"/"===w.charAt(g.length)),L={isActive:R,isPending:x,isTransitioning:y},D=R?r:void 0;S="function"==typeof a?a(L):[a,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof i?i(L):i;return f.createElement(Ja,Z({},c,{"aria-current":D,className:S,ref:t,style:C,to:s,unstable_viewTransition:l}),"function"==typeof u?u(L):u)})),qa=f.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:i,method:s=mt,action:l,onSubmit:u,relative:c,preventScrollReset:d,unstable_viewTransition:h}=e,p=qt(e,ja),m=Gr(),v=Qa(l,{relative:c}),y="get"===s.toLowerCase()?"get":"post";return f.createElement("form",Z({ref:t,method:y,action:v,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:o,state:i,relative:c,preventScrollReset:d,unstable_viewTransition:h})}},p))}));function Fo(e){let{getKey:t,storageKey:r}=e;return Za({getKey:t,storageKey:r}),null}var ze,Ze;function Et(e){let t=f.useContext(et);return t||L(!1),t}function Yt(e){let t=f.useContext(bt);return t||L(!1),t}function Ya(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s}=void 0===t?{}:t,l=$t(),u=he(),c=rt(e,{relative:i});return f.useCallback((t=>{if(Ta(t,r)){t.preventDefault();let r=void 0!==n?n:fe(u)===fe(c);l(e,{replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s})}}),[u,l,c,n,a,r,e,o,i,s])}function Uo(e){let t=f.useRef(Bt(e)),r=f.useRef(!1),n=he(),a=f.useMemo((()=>_a(n.search,r.current?null:t.current)),[n.search]),o=$t(),i=f.useCallback(((e,t)=>{const n=Bt("function"==typeof e?e(a):e);r.current=!0,o("?"+n,t)}),[o,a]);return[a,i]}function Ga(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(ze||(ze={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ze||(Ze={}));let Xa=0,Yr=()=>"__"+String(++Xa)+"__";function Gr(){let{router:e}=Et(ze.UseSubmit),{basename:t}=f.useContext(le),r=da();return f.useCallback((function(n,a){void 0===a&&(a={}),Ga();let{action:o,method:i,encType:s,formData:l,body:u}=Ua(n,t);if(!1===a.navigate){let t=a.fetcherKey||Yr();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[e,t,r])}function Qa(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=f.useContext(le),a=f.useContext(se);a||L(!1);let[o]=a.matches.slice(-1),i=Z({},rt(e||".",{relative:r})),s=he();if(null==e){i.search=s.search;let e=new URLSearchParams(i.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),i.search=e.toString()?"?"+e.toString():"")}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:de([n,i.pathname])),fe(i)}function Ao(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=Et(ze.UseFetcher),a=Yt(Ze.UseFetcher),o=f.useContext(qr),i=f.useContext(se),s=null==(t=i.matches[i.matches.length-1])?void 0:t.route.id;o||L(!1),i||L(!1),null==s&&L(!1);let l=Sr?Sr():"",[u,c]=f.useState(r||l);r&&r!==u?c(r):u||c(Yr()),f.useEffect((()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)})),[n,u]);let d=f.useCallback(((e,t)=>{s||L(!1),n.fetch(u,s,e,t)}),[u,s,n]),h=Gr(),p=f.useCallback(((e,t)=>{h(e,Z({},t,{navigate:!1,fetcherKey:u}))}),[u,h]),m=f.useMemo((()=>f.forwardRef(((e,t)=>f.createElement(qa,Z({},e,{navigate:!1,fetcherKey:u,ref:t}))))),[u]),v=a.fetchers.get(u)||Or,y=o.get(u);return f.useMemo((()=>Z({Form:m,submit:p,load:d},v,{data:y})),[m,p,d,v,y])}function Oo(){let e=Yt(Ze.UseFetchers);return Array.from(e.fetchers.entries()).map((e=>{let[t,r]=e;return Z({},r,{key:t})}))}const xr="react-router-scroll-positions";let ht={};function Za(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Et(ze.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=Yt(Ze.UseScrollRestoration),{basename:i}=f.useContext(le),s=he(),l=ha(),u=fa();f.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),eo(f.useCallback((()=>{if("idle"===u.state){let e=(t?t(s,l):null)||s.key;ht[e]=window.scrollY}try{sessionStorage.setItem(r||xr,JSON.stringify(ht))}catch{}window.history.scrollRestoration="auto"}),[r,t,u.state,s,l])),typeof document<"u"&&(f.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||xr);e&&(ht=JSON.parse(e))}catch{}}),[r]),f.useLayoutEffect((()=>{let e=t&&"/"!==i?(e,r)=>t(Z({},e,{pathname:ee(e.pathname,i)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(ht,(()=>window.scrollY),e);return()=>r&&r()}),[n,i,t]),f.useLayoutEffect((()=>{if(!1!==a){if("number"==typeof a)return void window.scrollTo(0,a);if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==o&&window.scrollTo(0,0)}}),[s,a,o]))}function jo(e,t){let{capture:r}=t||{};f.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function eo(e,t){let{capture:r}={};f.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}}),[e,r])}function Io(e){let{when:t,message:r}=e,n=ga(t);f.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),f.useEffect((()=>{"blocked"===n.state&&!t&&n.reset()}),[n,t])}function to(e,t){void 0===t&&(t={});let r=f.useContext(Jr);null==r&&L(!1);let{basename:n}=Et(ze.useViewTransitionState),a=rt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ee(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=ee(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=pt(a.pathname,i)||null!=pt(a.pathname,o)}export{Ot as AbortedDeferredError,Eo as Await,Do as BrowserRouter,qa as Form,To as HashRouter,Ja as Link,yo as MemoryRouter,Mo as NavLink,bo as Navigate,z as NavigationType,wo as Outlet,Ra as Route,at as Router,Lo as RouterProvider,Ro as Routes,Fo as ScrollRestoration,et as UNSAFE_DataRouterContext,bt as UNSAFE_DataRouterStateContext,qr as UNSAFE_FetchersContext,tt as UNSAFE_LocationContext,le as UNSAFE_NavigationContext,se as UNSAFE_RouteContext,Jr as UNSAFE_ViewTransitionContext,da as UNSAFE_useRouteId,Za as UNSAFE_useScrollRestoration,Po as createBrowserRouter,Co as createHashRouter,xo as createMemoryRouter,fe as createPath,kt as createRoutesFromChildren,kt as createRoutesFromElements,Bt as createSearchParams,io as defer,ao as generatePath,Ur as isRouteErrorResponse,oo as json,pt as matchPath,ke as matchRoutes,ce as parsePath,In as redirect,lo as redirectDocument,So as renderMatches,Tn as resolvePath,_o as unstable_HistoryRouter,Io as unstable_usePrompt,to as unstable_useViewTransitionState,vo as useActionData,go as useAsyncError,pa as useAsyncValue,jo as useBeforeUnload,ga as useBlocker,Ao as useFetcher,Oo as useFetchers,Qa as useFormAction,ra as useHref,Fe as useInRouterContext,Ya as useLinkClickHandler,mo as useLoaderData,he as useLocation,uo as useMatch,ha as useMatches,$t as useNavigate,fa as useNavigation,so as useNavigationType,aa as useOutlet,co as useOutletContext,fo as useParams,rt as useResolvedPath,ho as useRevalidator,ma as useRouteError,po as useRouteLoaderData,oa as useRoutes,Uo as useSearchParams,Gr as useSubmit};
@@ -1 +0,0 @@
1
- import{r as b,e as y}from"../index-DoZBmrkt.mjs";function ut(t){var e,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=ut(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function F(){for(var t,e,n=0,o="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=ut(t))&&(o&&(o+=" "),o+=e);return o}const G=t=>"number"==typeof t&&!isNaN(t),Y=t=>"string"==typeof t,k=t=>"function"==typeof t,nt=t=>Y(t)||k(t)?t:null,it=t=>b.isValidElement(t)||Y(t)||k(t)||G(t);function vt(t,e,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=t;requestAnimationFrame((()=>{s.minHeight="initial",s.height=o+"px",s.transition=`all ${n}ms`,requestAnimationFrame((()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(e,n)}))}))}function st(t){let{enter:e,exit:n,appendPosition:o=!1,collapse:s=!0,collapseDuration:a=300}=t;return function(t){let{children:r,position:i,preventExitTransition:l,done:c,nodeRef:d,isIn:u,playToast:p}=t;const f=o?`${e}--${i}`:e,m=o?`${n}--${i}`:n,g=b.useRef(0);return b.useLayoutEffect((()=>{const t=d.current,e=f.split(" "),n=o=>{o.target===d.current&&(p(),t.removeEventListener("animationend",n),t.removeEventListener("animationcancel",n),0===g.current&&"animationcancel"!==o.type&&t.classList.remove(...e))};t.classList.add(...e),t.addEventListener("animationend",n),t.addEventListener("animationcancel",n)}),[]),b.useEffect((()=>{const t=d.current,e=()=>{t.removeEventListener("animationend",e),s?vt(t,c,a):c()};u||(l?e():(g.current=1,t.className+=` ${m}`,t.addEventListener("animationend",e)))}),[u]),y.createElement(y.Fragment,null,r)}}function ct(t,e){return null!=t?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const $=new Map;let J=[];const lt=new Set,ht=t=>lt.forEach((e=>e(t))),pt=()=>$.size>0;function ft(t,e){var n;if(e)return!(null==(n=$.get(e))||!n.isToastActive(t));let o=!1;return $.forEach((e=>{e.isToastActive(t)&&(o=!0)})),o}function mt(t,e){it(t)&&(pt()||J.push({content:t,options:e}),$.forEach((n=>{n.buildToast(t,e)})))}function dt(t,e){$.forEach((n=>{null!=e&&null!=e&&e.containerId?(null==e?void 0:e.containerId)===n.id&&n.toggle(t,null==e?void 0:e.id):n.toggle(t,null==e?void 0:e.id)}))}function Et(t){const{subscribe:e,getSnapshot:n,setProps:o}=b.useRef(function(t){const e=t.containerId||1;return{subscribe(n){const o=function(t,e,n){let o=1,s=0,a=[],r=[],i=[],l=e;const c=new Map,d=new Set,u=()=>{i=Array.from(c.values()),d.forEach((t=>t()))},p=t=>{r=null==t?[]:r.filter((e=>e!==t)),u()},f=t=>{const{toastId:e,onOpen:o,updateId:s,children:a}=t.props,i=null==s;t.staleId&&c.delete(t.staleId),c.set(e,t),r=[...r,t.props.toastId].filter((e=>e!==t.staleId)),u(),n(ct(t,i?"added":"updated")),i&&k(o)&&o(b.isValidElement(a)&&a.props)};return{id:t,props:l,observe:t=>(d.add(t),()=>d.delete(t)),toggle:(t,e)=>{c.forEach((n=>{null!=e&&e!==n.props.toastId||k(n.toggle)&&n.toggle(t)}))},removeToast:p,toasts:c,clearQueue:()=>{s-=a.length,a=[]},buildToast:(e,r)=>{if((e=>{let{containerId:n,toastId:o,updateId:s}=e;const a=n?n!==t:1!==t,r=c.has(o)&&null==s;return a||r})(r))return;const{toastId:i,updateId:d,data:m,staleId:y,delay:g}=r,h=()=>{p(i)},v=null==d;v&&s++;const T={...l,style:l.toastStyle,key:o++,...Object.fromEntries(Object.entries(r).filter((t=>{let[e,n]=t;return null!=n}))),toastId:i,updateId:d,data:m,closeToast:h,isIn:!1,className:nt(r.className||l.toastClassName),bodyClassName:nt(r.bodyClassName||l.bodyClassName),progressClassName:nt(r.progressClassName||l.progressClassName),autoClose:!r.isLoading&&(E=r.autoClose,I=l.autoClose,!1===E||G(E)&&E>0?E:I),deleteToast(){const t=c.get(i),{onClose:e,children:o}=t.props;k(e)&&e(b.isValidElement(o)&&o.props),n(ct(t,"removed")),c.delete(i),s--,s<0&&(s=0),a.length>0?f(a.shift()):u()}};var E,I;T.closeButton=l.closeButton,!1===r.closeButton||it(r.closeButton)?T.closeButton=r.closeButton:!0===r.closeButton&&(T.closeButton=!it(l.closeButton)||l.closeButton);let _=e;b.isValidElement(e)&&!Y(e.type)?_=b.cloneElement(e,{closeToast:h,toastProps:T,data:m}):k(e)&&(_=e({closeToast:h,toastProps:T,data:m}));const C={content:_,props:T,staleId:y};l.limit&&l.limit>0&&s>l.limit&&v?a.push(C):G(g)?setTimeout((()=>{f(C)}),g):f(C)},setProps(t){l=t},setToggle:(t,e)=>{c.get(t).toggle=e},isToastActive:t=>r.some((e=>e===t)),getSnapshot:()=>l.newestOnTop?i.reverse():i}}(e,t,ht);$.set(e,o);const s=o.observe(n);return J.forEach((t=>mt(t.content,t.options))),J=[],()=>{s(),$.delete(e)}},setProps(t){var n;null==(n=$.get(e))||n.setProps(t)},getSnapshot(){var t;return null==(t=$.get(e))?void 0:t.getSnapshot()}}}(t)).current;o(t);const s=b.useSyncExternalStore(e,n,n);return{getToastToRender:function(t){if(!s)return[];const e=new Map;return s.forEach((t=>{const{position:n}=t.props;e.has(n)||e.set(n,[]),e.get(n).push(t)})),Array.from(e,(e=>t(e[0],e[1])))},isToastActive:ft,count:null==s?void 0:s.length}}function Tt(t){const[e,n]=b.useState(!1),[o,s]=b.useState(!1),a=b.useRef(null),r=b.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:i,pauseOnHover:l,closeToast:c,onClick:d,closeOnClick:u}=t;var p,f;function m(){n(!0)}function y(){n(!1)}function g(n){const o=a.current;r.canDrag&&o&&(r.didMove=!0,e&&y(),r.delta="x"===t.draggableDirection?n.clientX-r.start:n.clientY-r.start,r.start!==n.clientX&&(r.canCloseOnClick=!1),o.style.transform=`translate3d(${"x"===t.draggableDirection?`${r.delta}px, var(--y)`:`0, calc(${r.delta}px + var(--y))`},0)`,o.style.opacity=""+(1-Math.abs(r.delta/r.removalDistance)))}function h(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",h);const e=a.current;if(r.canDrag&&r.didMove&&e){if(r.canDrag=!1,Math.abs(r.delta)>r.removalDistance)return s(!0),t.closeToast(),void t.collapseAll();e.style.transition="transform 0.2s, opacity 0.2s",e.style.removeProperty("transform"),e.style.removeProperty("opacity")}}null==(f=$.get((p={id:t.toastId,containerId:t.containerId,fn:n}).containerId||1))||f.setToggle(p.id,p.fn),b.useEffect((()=>{if(t.pauseOnFocusLoss)return document.hasFocus()||y(),window.addEventListener("focus",m),window.addEventListener("blur",y),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",y)}}),[t.pauseOnFocusLoss]);const v={onPointerDown:function(e){if(!0===t.draggable||t.draggable===e.pointerType){r.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",h);const n=a.current;r.canCloseOnClick=!0,r.canDrag=!0,n.style.transition="none","x"===t.draggableDirection?(r.start=e.clientX,r.removalDistance=n.offsetWidth*(t.draggablePercent/100)):(r.start=e.clientY,r.removalDistance=n.offsetHeight*(80===t.draggablePercent?1.5*t.draggablePercent:t.draggablePercent)/100)}},onPointerUp:function(e){const{top:n,bottom:o,left:s,right:r}=a.current.getBoundingClientRect();"touchend"!==e.nativeEvent.type&&t.pauseOnHover&&e.clientX>=s&&e.clientX<=r&&e.clientY>=n&&e.clientY<=o?y():m()}};return i&&l&&(v.onMouseEnter=y,t.stacked||(v.onMouseLeave=m)),u&&(v.onClick=t=>{d&&d(t),r.canCloseOnClick&&c()}),{playToast:m,pauseToast:y,isRunning:e,preventExitTransition:o,toastRef:a,eventHandlers:v}}function bt(t){let{delay:e,isRunning:n,closeToast:o,type:s="default",hide:a,className:r,style:i,controlledProgress:l,progress:c,rtl:d,isIn:u,theme:p}=t;const f=a||l&&0===c,m={...i,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};l&&(m.transform=`scaleX(${c})`);const g=F("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),h=k(r)?r({rtl:d,type:s,defaultClassName:g}):F(g,r),v={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{u&&o()}};return y.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},y.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${s}`}),y.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:h,style:m,...v}))}let It=1;const gt=()=>""+It++;function _t(t){return t&&(Y(t.toastId)||G(t.toastId))?t.toastId:gt()}function Z(t,e){return mt(t,e),e.toastId}function ot(t,e){return{...e,type:e&&e.type||t,toastId:_t(e)}}function tt(t){return(e,n)=>Z(e,ot(t,n))}function h(t,e){return Z(t,ot("default",e))}h.loading=(t,e)=>Z(t,ot("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),h.promise=function(t,e,n){let o,{pending:s,error:a,success:r}=e;s&&(o=Y(s)?h.loading(s,n):h.loading(s.render,{...n,...s}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(t,e,s)=>{if(null==e)return void h.dismiss(o);const a={type:t,...i,...n,data:s},r=Y(e)?{render:e}:e;return o?h.update(o,{...a,...r}):h(r.render,{...a,...r}),s},c=k(t)?t():t;return c.then((t=>l("success",r,t))).catch((t=>l("error",a,t))),c},h.success=tt("success"),h.info=tt("info"),h.error=tt("error"),h.warning=tt("warning"),h.warn=h.warning,h.dark=(t,e)=>Z(t,ot("default",{theme:"dark",...e})),h.dismiss=function(t){!function(t){var e;if(pt()){if(null==t||Y(e=t)||G(e))$.forEach((e=>{e.removeToast(t)}));else if(t&&("containerId"in t||"id"in t)){const e=$.get(t.containerId);e?e.removeToast(t.id):$.forEach((e=>{e.removeToast(t.id)}))}}else J=J.filter((e=>null!=t&&e.options.toastId!==t))}(t)},h.clearWaitingQueue=function(t){void 0===t&&(t={}),$.forEach((e=>{!e.props.limit||t.containerId&&e.id!==t.containerId||e.clearQueue()}))},h.isActive=ft,h.update=function(t,e){void 0===e&&(e={});const n=((t,e)=>{var n;let{containerId:o}=e;return null==(n=$.get(o||1))?void 0:n.toasts.get(t)})(t,e);if(n){const{props:o,content:s}=n,a={delay:100,...o,...e,toastId:e.toastId||t,updateId:gt()};a.toastId!==t&&(a.staleId=t);const r=a.render||s;delete a.render,Z(r,a)}},h.done=t=>{h.update(t,{progress:1})},h.onChange=function(t){return lt.add(t),()=>{lt.delete(t)}},h.play=t=>dt(!0,t),h.pause=t=>dt(!1,t);const Ct=typeof window<"u"?b.useLayoutEffect:b.useEffect,et=t=>{let{theme:e,type:n,isLoading:o,...s}=t;return y.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===e?"currentColor":`var(--toastify-icon-color-${n})`,...s})},rt={info:function(t){return y.createElement(et,{...t},y.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return y.createElement(et,{...t},y.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return y.createElement(et,{...t},y.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return y.createElement(et,{...t},y.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return y.createElement("div",{className:"Toastify__spinner"})}},Lt=t=>{const{isRunning:e,preventExitTransition:n,toastRef:o,eventHandlers:s,playToast:a}=Tt(t),{closeButton:r,children:i,autoClose:l,onClick:c,type:d,hideProgressBar:u,closeToast:p,transition:f,position:m,className:g,style:h,bodyClassName:v,bodyStyle:T,progressClassName:E,progressStyle:I,updateId:_,role:C,progress:$,rtl:L,toastId:N,deleteToast:P,isIn:w,isLoading:A,closeOnClick:x,theme:B}=t,M=F("Toastify__toast",`Toastify__toast-theme--${B}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":L},{"Toastify__toast--close-on-click":x}),D=k(g)?g({rtl:L,position:m,type:d,defaultClassName:M}):F(M,g),O=function(t){let{theme:e,type:n,isLoading:o,icon:s}=t,a=null;const r={theme:e,type:n};return!1===s||(k(s)?a=s({...r,isLoading:o}):b.isValidElement(s)?a=b.cloneElement(s,r):o?a=rt.spinner():n in rt&&(a=rt[n](r))),a}(t),R=!!$||!l,S={closeToast:p,type:d,theme:B};let z=null;return!1===r||(z=k(r)?r(S):b.isValidElement(r)?b.cloneElement(r,S):function(t){let{closeToast:e,theme:n,ariaLabel:o="close"}=t;return y.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:t=>{t.stopPropagation(),e(t)},"aria-label":o},y.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},y.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(S)),y.createElement(f,{isIn:w,done:P,position:m,preventExitTransition:n,nodeRef:o,playToast:a},y.createElement("div",{id:N,onClick:c,"data-in":w,className:D,...s,style:h,ref:o},y.createElement("div",{...w&&{role:C},className:k(v)?v({type:d}):F("Toastify__toast-body",v),style:T},null!=O&&y.createElement("div",{className:F("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!A})},O),y.createElement("div",null,i)),z,y.createElement(bt,{..._&&!R?{key:`pb-${_}`}:{},rtl:L,theme:B,delay:l,isRunning:e,isIn:w,closeToast:p,hide:u,type:d,style:I,className:E,controlledProgress:R,progress:$||0})))},at=function(t,e){return void 0===e&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},Nt=st(at("bounce",!0)),kt=st(at("slide",!0)),Pt=st(at("zoom")),xt=st(at("flip")),$t={position:"top-right",transition:Nt,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function At(t){let e={...$t,...t};const n=t.stacked,[o,s]=b.useState(!0),a=b.useRef(null),{getToastToRender:r,isToastActive:i,count:l}=Et(e),{className:c,style:d,rtl:u,containerId:p}=e;function f(t){const e=F("Toastify__toast-container",`Toastify__toast-container--${t}`,{"Toastify__toast-container--rtl":u});return k(c)?c({position:t,rtl:u,defaultClassName:e}):F(e,nt(c))}function m(){n&&(s(!0),h.play())}return Ct((()=>{if(n){var t;const n=a.current.querySelectorAll('[data-in="true"]'),s=12,r=null==(t=e.position)?void 0:t.includes("top");let i=0,l=0;Array.from(n).reverse().forEach(((t,e)=>{const n=t;n.classList.add("Toastify__toast--stacked"),e>0&&(n.dataset.collapsed=`${o}`),n.dataset.pos||(n.dataset.pos=r?"top":"bot");const a=i*(o?.2:1)+(o?0:s*e);n.style.setProperty("--y",`${r?a:-1*a}px`),n.style.setProperty("--g",`${s}`),n.style.setProperty("--s",""+(1-(o?l:0))),i+=n.offsetHeight,l+=.025}))}}),[o,l,n]),y.createElement("div",{ref:a,className:"Toastify",id:p,onMouseEnter:()=>{n&&(s(!1),h.pause())},onMouseLeave:m},r(((t,e)=>{const o=e.length?{...d}:{...d,pointerEvents:"none"};return y.createElement("div",{className:f(t),style:o,key:`container-${t}`},e.map((t=>{let{content:e,props:o}=t;return y.createElement(Lt,{...o,stacked:n,collapseAll:m,isIn:i(o.toastId,o.containerId),style:o.style,key:`toast-${o.key}`},e)})))})))}export{Nt as Bounce,xt as Flip,rt as Icons,kt as Slide,At as ToastContainer,Pt as Zoom,vt as collapseToast,st as cssTransition,h as toast,Tt as useToast,Et as useToastContainer};