var Bb=Object.defineProperty;var Sb=(n,r,a)=>r in n?Bb(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Br=(n,r,a)=>Sb(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();try{}catch(n){console.error("[wxt] Failed to initialize plugins",n)}function xi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Nb(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var r=n.default;if(typeof r=="function"){var a=function s(){return this instanceof s?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};a.prototype=r.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var o=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(a,s,o.get?o:{enumerable:!0,get:function(){return n[s]}})}),a}var vf={exports:{}},Ol={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var z0;function Tb(){if(z0)return Ol;z0=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(s,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:n,type:s,key:c,ref:o!==void 0?o:null,props:u}}return Ol.Fragment=r,Ol.jsx=a,Ol.jsxs=a,Ol}var Y0;function Qb(){return Y0||(Y0=1,vf.exports=Tb()),vf.exports}var p=Qb(),xf={exports:{}},Fl={},Cf={exports:{}},wf={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var P0;function Db(){return P0||(P0=1,function(n){function r(K,ie){var Ne=K.length;K.push(ie);e:for(;0<Ne;){var _e=Ne-1>>>1,G=K[_e];if(0<o(G,ie))K[_e]=ie,K[Ne]=G,Ne=_e;else break e}}function a(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var ie=K[0],Ne=K.pop();if(Ne!==ie){K[0]=Ne;e:for(var _e=0,G=K.length,ne=G>>>1;_e<ne;){var Ee=2*(_e+1)-1,ke=K[Ee],He=Ee+1,Ke=K[He];if(0>o(ke,Ne))He<G&&0>o(Ke,ke)?(K[_e]=Ke,K[He]=Ne,_e=He):(K[_e]=ke,K[Ee]=Ne,_e=Ee);else if(He<G&&0>o(Ke,Ne))K[_e]=Ke,K[He]=Ne,_e=He;else break e}}return ie}function o(K,ie){var Ne=K.sortIndex-ie.sortIndex;return Ne!==0?Ne:K.id-ie.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();n.unstable_now=function(){return c.now()-d}}var m=[],A=[],b=1,v=null,B=3,T=!1,Q=!1,k=!1,R=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function q(K){for(var ie=a(A);ie!==null;){if(ie.callback===null)s(A);else if(ie.startTime<=K)s(A),ie.sortIndex=ie.expirationTime,r(m,ie);else break;ie=a(A)}}function V(K){if(k=!1,q(K),!Q)if(a(m)!==null)Q=!0,ae||(ae=!0,me());else{var ie=a(A);ie!==null&&pe(V,ie.startTime-K)}}var ae=!1,ge=-1,te=5,J=-1;function P(){return R?!0:!(n.unstable_now()-J<te)}function $(){if(R=!1,ae){var K=n.unstable_now();J=K;var ie=!0;try{e:{Q=!1,k&&(k=!1,O(ge),ge=-1),T=!0;var Ne=B;try{t:{for(q(K),v=a(m);v!==null&&!(v.expirationTime>K&&P());){var _e=v.callback;if(typeof _e=="function"){v.callback=null,B=v.priorityLevel;var G=_e(v.expirationTime<=K);if(K=n.unstable_now(),typeof G=="function"){v.callback=G,q(K),ie=!0;break t}v===a(m)&&s(m),q(K)}else s(m);v=a(m)}if(v!==null)ie=!0;else{var ne=a(A);ne!==null&&pe(V,ne.startTime-K),ie=!1}}break e}finally{v=null,B=Ne,T=!1}ie=void 0}}finally{ie?me():ae=!1}}}var me;if(typeof _=="function")me=function(){_($)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Be=he.port2;he.port1.onmessage=$,me=function(){Be.postMessage(null)}}else me=function(){N($,0)};function pe(K,ie){ge=N(function(){K(n.unstable_now())},ie)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(K){K.callback=null},n.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<K?Math.floor(1e3/K):5},n.unstable_getCurrentPriorityLevel=function(){return B},n.unstable_next=function(K){switch(B){case 1:case 2:case 3:var ie=3;break;default:ie=B}var Ne=B;B=ie;try{return K()}finally{B=Ne}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(K,ie){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var Ne=B;B=K;try{return ie()}finally{B=Ne}},n.unstable_scheduleCallback=function(K,ie,Ne){var _e=n.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?_e+Ne:_e):Ne=_e,K){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=Ne+G,K={id:b++,callback:ie,priorityLevel:K,startTime:Ne,expirationTime:G,sortIndex:-1},Ne>_e?(K.sortIndex=Ne,r(A,K),a(m)===null&&K===a(A)&&(k?(O(ge),ge=-1):k=!0,pe(V,Ne-_e))):(K.sortIndex=G,r(m,K),Q||T||(Q=!0,ae||(ae=!0,me()))),K},n.unstable_shouldYield=P,n.unstable_wrapCallback=function(K){var ie=B;return function(){var Ne=B;B=ie;try{return K.apply(this,arguments)}finally{B=Ne}}}}(wf)),wf}var K0;function Rb(){return K0||(K0=1,Cf.exports=Db()),Cf.exports}var If={exports:{}},ct={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var J0;function kb(){if(J0)return ct;J0=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.iterator;function B(G){return G===null||typeof G!="object"?null:(G=v&&G[v]||G["@@iterator"],typeof G=="function"?G:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,k={};function R(G,ne,Ee){this.props=G,this.context=ne,this.refs=k,this.updater=Ee||T}R.prototype.isReactComponent={},R.prototype.setState=function(G,ne){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,ne,"setState")},R.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=R.prototype;function O(G,ne,Ee){this.props=G,this.context=ne,this.refs=k,this.updater=Ee||T}var _=O.prototype=new N;_.constructor=O,Q(_,R.prototype),_.isPureReactComponent=!0;var q=Array.isArray,V={H:null,A:null,T:null,S:null,V:null},ae=Object.prototype.hasOwnProperty;function ge(G,ne,Ee,ke,He,Ke){return Ee=Ke.ref,{$$typeof:n,type:G,key:ne,ref:Ee!==void 0?Ee:null,props:Ke}}function te(G,ne){return ge(G.type,ne,void 0,void 0,void 0,G.props)}function J(G){return typeof G=="object"&&G!==null&&G.$$typeof===n}function P(G){var ne={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(Ee){return ne[Ee]})}var $=/\/+/g;function me(G,ne){return typeof G=="object"&&G!==null&&G.key!=null?P(""+G.key):ne.toString(36)}function he(){}function Be(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(he,he):(G.status="pending",G.then(function(ne){G.status==="pending"&&(G.status="fulfilled",G.value=ne)},function(ne){G.status==="pending"&&(G.status="rejected",G.reason=ne)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function pe(G,ne,Ee,ke,He){var Ke=typeof G;(Ke==="undefined"||Ke==="boolean")&&(G=null);var Ge=!1;if(G===null)Ge=!0;else switch(Ke){case"bigint":case"string":case"number":Ge=!0;break;case"object":switch(G.$$typeof){case n:case r:Ge=!0;break;case b:return Ge=G._init,pe(Ge(G._payload),ne,Ee,ke,He)}}if(Ge)return He=He(G),Ge=ke===""?"."+me(G,0):ke,q(He)?(Ee="",Ge!=null&&(Ee=Ge.replace($,"$&/")+"/"),pe(He,ne,Ee,"",function(Et){return Et})):He!=null&&(J(He)&&(He=te(He,Ee+(He.key==null||G&&G.key===He.key?"":(""+He.key).replace($,"$&/")+"/")+Ge)),ne.push(He)),1;Ge=0;var yt=ke===""?".":ke+":";if(q(G))for(var We=0;We<G.length;We++)ke=G[We],Ke=yt+me(ke,We),Ge+=pe(ke,ne,Ee,Ke,He);else if(We=B(G),typeof We=="function")for(G=We.call(G),We=0;!(ke=G.next()).done;)ke=ke.value,Ke=yt+me(ke,We++),Ge+=pe(ke,ne,Ee,Ke,He);else if(Ke==="object"){if(typeof G.then=="function")return pe(Be(G),ne,Ee,ke,He);throw ne=String(G),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Ge}function K(G,ne,Ee){if(G==null)return G;var ke=[],He=0;return pe(G,ke,"","",function(Ke){return ne.call(Ee,Ke,He++)}),ke}function ie(G){if(G._status===-1){var ne=G._result;ne=ne(),ne.then(function(Ee){(G._status===0||G._status===-1)&&(G._status=1,G._result=Ee)},function(Ee){(G._status===0||G._status===-1)&&(G._status=2,G._result=Ee)}),G._status===-1&&(G._status=0,G._result=ne)}if(G._status===1)return G._result.default;throw G._result}var Ne=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)};function _e(){}return ct.Children={map:K,forEach:function(G,ne,Ee){K(G,function(){ne.apply(this,arguments)},Ee)},count:function(G){var ne=0;return K(G,function(){ne++}),ne},toArray:function(G){return K(G,function(ne){return ne})||[]},only:function(G){if(!J(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},ct.Component=R,ct.Fragment=a,ct.Profiler=o,ct.PureComponent=O,ct.StrictMode=s,ct.Suspense=m,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,ct.__COMPILER_RUNTIME={__proto__:null,c:function(G){return V.H.useMemoCache(G)}},ct.cache=function(G){return function(){return G.apply(null,arguments)}},ct.cloneElement=function(G,ne,Ee){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var ke=Q({},G.props),He=G.key,Ke=void 0;if(ne!=null)for(Ge in ne.ref!==void 0&&(Ke=void 0),ne.key!==void 0&&(He=""+ne.key),ne)!ae.call(ne,Ge)||Ge==="key"||Ge==="__self"||Ge==="__source"||Ge==="ref"&&ne.ref===void 0||(ke[Ge]=ne[Ge]);var Ge=arguments.length-2;if(Ge===1)ke.children=Ee;else if(1<Ge){for(var yt=Array(Ge),We=0;We<Ge;We++)yt[We]=arguments[We+2];ke.children=yt}return ge(G.type,He,void 0,void 0,Ke,ke)},ct.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:u,_context:G},G},ct.createElement=function(G,ne,Ee){var ke,He={},Ke=null;if(ne!=null)for(ke in ne.key!==void 0&&(Ke=""+ne.key),ne)ae.call(ne,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(He[ke]=ne[ke]);var Ge=arguments.length-2;if(Ge===1)He.children=Ee;else if(1<Ge){for(var yt=Array(Ge),We=0;We<Ge;We++)yt[We]=arguments[We+2];He.children=yt}if(G&&G.defaultProps)for(ke in Ge=G.defaultProps,Ge)He[ke]===void 0&&(He[ke]=Ge[ke]);return ge(G,Ke,void 0,void 0,null,He)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(G){return{$$typeof:d,render:G}},ct.isValidElement=J,ct.lazy=function(G){return{$$typeof:b,_payload:{_status:-1,_result:G},_init:ie}},ct.memo=function(G,ne){return{$$typeof:A,type:G,compare:ne===void 0?null:ne}},ct.startTransition=function(G){var ne=V.T,Ee={};V.T=Ee;try{var ke=G(),He=V.S;He!==null&&He(Ee,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(_e,Ne)}catch(Ke){Ne(Ke)}finally{V.T=ne}},ct.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},ct.use=function(G){return V.H.use(G)},ct.useActionState=function(G,ne,Ee){return V.H.useActionState(G,ne,Ee)},ct.useCallback=function(G,ne){return V.H.useCallback(G,ne)},ct.useContext=function(G){return V.H.useContext(G)},ct.useDebugValue=function(){},ct.useDeferredValue=function(G,ne){return V.H.useDeferredValue(G,ne)},ct.useEffect=function(G,ne,Ee){var ke=V.H;if(typeof Ee=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ke.useEffect(G,ne)},ct.useId=function(){return V.H.useId()},ct.useImperativeHandle=function(G,ne,Ee){return V.H.useImperativeHandle(G,ne,Ee)},ct.useInsertionEffect=function(G,ne){return V.H.useInsertionEffect(G,ne)},ct.useLayoutEffect=function(G,ne){return V.H.useLayoutEffect(G,ne)},ct.useMemo=function(G,ne){return V.H.useMemo(G,ne)},ct.useOptimistic=function(G,ne){return V.H.useOptimistic(G,ne)},ct.useReducer=function(G,ne,Ee){return V.H.useReducer(G,ne,Ee)},ct.useRef=function(G){return V.H.useRef(G)},ct.useState=function(G){return V.H.useState(G)},ct.useSyncExternalStore=function(G,ne,Ee){return V.H.useSyncExternalStore(G,ne,Ee)},ct.useTransition=function(){return V.H.useTransition()},ct.version="19.1.0",ct}var X0;function AA(){return X0||(X0=1,If.exports=kb()),If.exports}var Bf={exports:{}},Fr={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var $0;function Lb(){if($0)return Fr;$0=1;var n=AA();function r(m){var A="https://react.dev/errors/"+m;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)A+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,A,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:A,implementation:b}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,A){if(m==="font")return"";if(typeof A=="string")return A==="use-credentials"?A:""}return Fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Fr.createPortal=function(m,A){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)throw Error(r(299));return u(m,A,null,b)},Fr.flushSync=function(m){var A=c.T,b=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=A,s.p=b,s.d.f()}},Fr.preconnect=function(m,A){typeof m=="string"&&(A?(A=A.crossOrigin,A=typeof A=="string"?A==="use-credentials"?A:"":void 0):A=null,s.d.C(m,A))},Fr.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Fr.preinit=function(m,A){if(typeof m=="string"&&A&&typeof A.as=="string"){var b=A.as,v=d(b,A.crossOrigin),B=typeof A.integrity=="string"?A.integrity:void 0,T=typeof A.fetchPriority=="string"?A.fetchPriority:void 0;b==="style"?s.d.S(m,typeof A.precedence=="string"?A.precedence:void 0,{crossOrigin:v,integrity:B,fetchPriority:T}):b==="script"&&s.d.X(m,{crossOrigin:v,integrity:B,fetchPriority:T,nonce:typeof A.nonce=="string"?A.nonce:void 0})}},Fr.preinitModule=function(m,A){if(typeof m=="string")if(typeof A=="object"&&A!==null){if(A.as==null||A.as==="script"){var b=d(A.as,A.crossOrigin);s.d.M(m,{crossOrigin:b,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0})}}else A==null&&s.d.M(m)},Fr.preload=function(m,A){if(typeof m=="string"&&typeof A=="object"&&A!==null&&typeof A.as=="string"){var b=A.as,v=d(b,A.crossOrigin);s.d.L(m,b,{crossOrigin:v,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0,type:typeof A.type=="string"?A.type:void 0,fetchPriority:typeof A.fetchPriority=="string"?A.fetchPriority:void 0,referrerPolicy:typeof A.referrerPolicy=="string"?A.referrerPolicy:void 0,imageSrcSet:typeof A.imageSrcSet=="string"?A.imageSrcSet:void 0,imageSizes:typeof A.imageSizes=="string"?A.imageSizes:void 0,media:typeof A.media=="string"?A.media:void 0})}},Fr.preloadModule=function(m,A){if(typeof m=="string")if(A){var b=d(A.as,A.crossOrigin);s.d.m(m,{as:typeof A.as=="string"&&A.as!=="script"?A.as:void 0,crossOrigin:b,integrity:typeof A.integrity=="string"?A.integrity:void 0})}else s.d.m(m)},Fr.requestFormReset=function(m){s.d.r(m)},Fr.unstable_batchedUpdates=function(m,A){return m(A)},Fr.useFormState=function(m,A,b){return c.H.useFormState(m,A,b)},Fr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Fr.version="19.1.0",Fr}var W0;function Ub(){if(W0)return Bf.exports;W0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Bf.exports=Lb(),Bf.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Z0;function Mb(){if(Z0)return Fl;Z0=1;var n=Rb(),r=AA(),a=Ub();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(u(e)!==e)throw Error(s(188))}function m(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var f=i.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===i)return d(f),e;if(g===l)return d(f),t;g=g.sibling}throw Error(s(188))}if(i.return!==l.return)i=f,l=g;else{for(var C=!1,L=f.child;L;){if(L===i){C=!0,i=f,l=g;break}if(L===l){C=!0,l=f,i=g;break}L=L.sibling}if(!C){for(L=g.child;L;){if(L===i){C=!0,i=g,l=f;break}if(L===l){C=!0,l=g,i=f;break}L=L.sibling}if(!C)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),B=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),ge=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function Be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case R:return"Profiler";case k:return"StrictMode";case V:return"Suspense";case ae:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case _:return(e.displayName||"Context")+".Provider";case O:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ge:return t=e.displayName||null,t!==null?t:Be(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return Be(e(t))}catch{}}return null}var pe=Array.isArray,K=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},_e=[],G=-1;function ne(e){return{current:e}}function Ee(e){0>G||(e.current=_e[G],_e[G]=null,G--)}function ke(e,t){G++,_e[G]=e.current,e.current=t}var He=ne(null),Ke=ne(null),Ge=ne(null),yt=ne(null);function We(e,t){switch(ke(Ge,t),ke(Ke,e),ke(He,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?E0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=E0(t),e=b0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ee(He),ke(He,e)}function Et(){Ee(He),Ee(Ke),Ee(Ge)}function Kt(e){e.memoizedState!==null&&ke(yt,e);var t=He.current,i=b0(t,e.type);t!==i&&(ke(Ke,e),ke(He,i))}function Nr(e){Ke.current===e&&(Ee(He),Ee(Ke)),yt.current===e&&(Ee(yt),kl._currentValue=Ne)}var Lt=Object.prototype.hasOwnProperty,Ht=n.unstable_scheduleCallback,jt=n.unstable_cancelCallback,br=n.unstable_shouldYield,Qe=n.unstable_requestPaint,Fe=n.unstable_now,nt=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,j=n.unstable_UserBlockingPriority,X=n.unstable_NormalPriority,le=n.unstable_LowPriority,Te=n.unstable_IdlePriority,Re=n.log,xe=n.unstable_setDisableYieldValue,Ve=null,S=null;function E(e){if(typeof Re=="function"&&xe(e),S&&typeof S.setStrictMode=="function")try{S.setStrictMode(Ve,e)}catch{}}var x=Math.clz32?Math.clz32:fe,H=Math.log,W=Math.LN2;function fe(e){return e>>>=0,e===0?32:31-(H(e)/W|0)|0}var be=256,Le=4194304;function gt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ft(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var f=0,g=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var L=l&134217727;return L!==0?(l=L&~g,l!==0?f=gt(l):(C&=L,C!==0?f=gt(C):i||(i=L&~e,i!==0&&(f=gt(i))))):(L=l&~g,L!==0?f=gt(L):C!==0?f=gt(C):i||(i=l&~e,i!==0&&(f=gt(i)))),f===0?0:t!==0&&t!==f&&(t&g)===0&&(g=f&-f,i=t&-t,g>=i||g===32&&(i&4194048)!==0)?t:f}function bt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function es(){var e=be;return be<<=1,(be&4194048)===0&&(be=256),e}function sn(){var e=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),e}function Ma(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Pn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ts(e,t,i,l,f,g){var C=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var L=e.entanglements,z=e.expirationTimes,ce=e.hiddenUpdates;for(i=C&~i;0<i;){var ve=31-x(i),Se=1<<ve;L[ve]=0,z[ve]=-1;var de=ce[ve];if(de!==null)for(ce[ve]=null,ve=0;ve<de.length;ve++){var Ae=de[ve];Ae!==null&&(Ae.lane&=-536870913)}i&=~Se}l!==0&&Me(e,l,0),g!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=g&~(C&~t))}function Me(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-x(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&4194090}function rs(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-x(i),f=1<<l;f&t|e[l]&t&&(e[l]|=t),i&=~f}}function Ci(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _a(){var e=ie.p;return e!==0?e:(e=window.event,e===void 0?32:F0(e.type))}function wi(e,t){var i=ie.p;try{return ie.p=e,t()}finally{ie.p=i}}var Jr=Math.random().toString(36).slice(2),_t="__reactFiber$"+Jr,dr="__reactProps$"+Jr,Jt="__reactContainer$"+Jr,Oa="__reactEvents$"+Jr,Kn="__reactListeners$"+Jr,ns="__reactHandles$"+Jr,Ii="__reactResources$"+Jr,En="__reactMarker$"+Jr;function tr(e){delete e[_t],delete e[dr],delete e[Oa],delete e[Kn],delete e[ns]}function kn(e){var t=e[_t];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Jt]||i[_t]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=w0(e);e!==null;){if(i=e[_t])return i;e=w0(e)}return t}e=i,i=e.parentNode}return null}function Jn(e){if(e=e[_t]||e[Jt]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Gr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Ln(e){var t=e[Ii];return t||(t=e[Ii]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[En]=!0}var Bi=new Set,fa={};function Un(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(fa[e]=t,e=0;e<t.length;e++)Bi.add(t[e])}var Xr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fa={},Si={};function as(e){return Lt.call(Si,e)?!0:Lt.call(Fa,e)?!1:Xr.test(e)?Si[e]=!0:(Fa[e]=!0,!1)}function bn(e,t,i){if(as(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Aa(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Ur(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}var ja,Mn;function vn(e){if(ja===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ja=t&&t[1]||"",Mn=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ja+e+Mn}var $t=!1;function Ha(e,t){if(!e||$t)return"";$t=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(Ae){var de=Ae}Reflect.construct(e,[],Se)}else{try{Se.call()}catch(Ae){de=Ae}e.call(Se.prototype)}}else{try{throw Error()}catch(Ae){de=Ae}(Se=e())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(Ae){if(Ae&&de&&typeof Ae.stack=="string")return[Ae.stack,de.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),C=g[0],L=g[1];if(C&&L){var z=C.split(`
`),ce=L.split(`
`);for(f=l=0;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;for(;f<ce.length&&!ce[f].includes("DetermineComponentFrameRoot");)f++;if(l===z.length||f===ce.length)for(l=z.length-1,f=ce.length-1;1<=l&&0<=f&&z[l]!==ce[f];)f--;for(;1<=l&&0<=f;l--,f--)if(z[l]!==ce[f]){if(l!==1||f!==1)do if(l--,f--,0>f||z[l]!==ce[f]){var ve=`
`+z[l].replace(" at new "," at ");return e.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",e.displayName)),ve}while(1<=l&&0<=f);break}}}finally{$t=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?vn(i):""}function is(e){switch(e.tag){case 26:case 27:case 5:return vn(e.type);case 16:return vn("Lazy");case 13:return vn("Suspense");case 19:return vn("SuspenseList");case 0:case 15:return Ha(e.type,!1);case 11:return Ha(e.type.render,!1);case 1:return Ha(e.type,!0);case 31:return vn("Activity");default:return""}}function ss(e){try{var t="";do t+=is(e),e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}function Ot(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tt(e){var t=ut(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,g=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(C){l=""+C,g.call(this,C)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _n(e){e._valueTracker||(e._valueTracker=Tt(e))}function Xn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=ut(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function rr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ga=/[\n"\\]/g;function Tr(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ni(e,t,i,l,f,g,C,L){e.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.type=C:e.removeAttribute("type"),t!=null?C==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ot(t)):e.value!==""+Ot(t)&&(e.value=""+Ot(t)):C!=="submit"&&C!=="reset"||e.removeAttribute("value"),t!=null?ha(e,C,Ot(t)):i!=null?ha(e,C,Ot(i)):l!=null&&e.removeAttribute("value"),f==null&&g!=null&&(e.defaultChecked=!!g),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+Ot(L):e.removeAttribute("name")}function $n(e,t,i,l,f,g,C,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||t!=null))return;i=i!=null?""+Ot(i):"",t=t!=null?""+Ot(t):i,L||t===e.value||(e.value=t),e.defaultValue=t}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=L?e.checked:!!l,e.defaultChecked=!!l,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.name=C)}function ha(e,t,i){t==="number"&&rr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function xn(e,t,i,l){if(e=e.options,t){t={};for(var f=0;f<i.length;f++)t["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=t.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Ot(i),t=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function Va(e,t,i){if(t!=null&&(t=""+Ot(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ot(i):""}function Ti(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(s(92));if(pe(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=Ot(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l)}function Cn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ga=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function I(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||ga.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function D(e,t,i){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in t)l=t[f],t.hasOwnProperty(f)&&i[f]!==l&&I(e,f,l)}else for(var g in t)t.hasOwnProperty(g)&&I(e,g,t[g])}function F(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ee=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),we=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ie(e){return we.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ue=null;function je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vt=null,Oe=null;function Ar(e){var t=Jn(e);if(t&&(e=t.stateNode)){var i=e[dr]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ni(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Tr(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var f=l[dr]||null;if(!f)throw Error(s(90));Ni(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&Xn(l)}break e;case"textarea":Va(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&xn(e,!!i.multiple,t,!1)}}}var Wt=!1;function Vr(e,t,i){if(Wt)return e(t,i);Wt=!0;try{var l=e(t);return l}finally{if(Wt=!1,(vt!==null||Oe!==null)&&(Po(),vt&&(t=vt,e=Oe,Oe=vt=null,Ar(t),e)))for(t=0;t<e.length;t++)Ar(e[t])}}function ln(e,t){var i=e.stateNode;if(i===null)return null;var l=i[dr]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var Ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vt=!1;if(Ut)try{var Mr={};Object.defineProperty(Mr,"passive",{get:function(){Vt=!0}}),window.addEventListener("test",Mr,Mr),window.removeEventListener("test",Mr,Mr)}catch{Vt=!1}var nr=null,h=null,y=null;function w(){if(y)return y;var e,t=h,i=t.length,l,f="value"in nr?nr.value:nr.textContent,g=f.length;for(e=0;e<i&&t[e]===f[e];e++);var C=i-e;for(l=1;l<=C&&t[i-l]===f[g-l];l++);return y=f.slice(e,1<l?1-l:void 0)}function U(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Y(){return!0}function oe(){return!1}function ye(e){function t(i,l,f,g,C){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=C,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(i=e[L],this[L]=i?i(g):g[L]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Y:oe,this.isPropagationStopped=oe,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Y)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Y)},persist:function(){},isPersistent:Y}),t}var qe={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},st=ye(qe),at=b({},qe,{view:0,detail:0}),qt=ye(at),xr,ls,Qi,Di=b({},at,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$s,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Qi&&(Qi&&e.type==="mousemove"?(xr=e.screenX-Qi.screenX,ls=e.screenY-Qi.screenY):ls=xr=0,Qi=e),xr)},movementY:function(e){return"movementY"in e?e.movementY:ls}}),lo=ye(Di),oo=b({},Di,{dataTransfer:0}),oc=ye(oo),uc=b({},at,{relatedTarget:0}),Js=ye(uc),cc=b({},qe,{animationName:0,elapsedTime:0,pseudoElement:0}),dc=ye(cc),fc=b({},qe,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ac=ye(fc),hc=b({},qe,{data:0}),Xs=ye(hc),gc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mc={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pc[e])?!!t[e]:!1}function $s(){return yc}var Ec=b({},at,{key:function(e){if(e.key){var t=gc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=U(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$s,charCode:function(e){return e.type==="keypress"?U(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?U(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bc=ye(Ec),uo=b({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),co=ye(uo),vc=b({},at,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$s}),xc=ye(vc),Cc=b({},qe,{propertyName:0,elapsedTime:0,pseudoElement:0}),wc=ye(Cc),Ic=b({},Di,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),fo=ye(Ic),Bc=b({},qe,{newState:0,oldState:0}),Sc=ye(Bc),Nc=[9,13,27,32],qa=Ut&&"CompositionEvent"in window,za=null;Ut&&"documentMode"in document&&(za=document.documentMode);var Ao=Ut&&"TextEvent"in window&&!za,Ws=Ut&&(!qa||za&&8<za&&11>=za),se=" ",De=!1;function ze(e,t){switch(e){case"keyup":return Nc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $e(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var et=!1;function wt(e,t){switch(e){case"compositionend":return $e(t);case"keypress":return t.which!==32?null:(De=!0,se);case"textInput":return e=t.data,e===se&&De?null:e;default:return null}}function on(e,t){if(et)return e==="compositionend"||!qa&&ze(e,t)?(e=w(),y=h=nr=null,et=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ws&&t.locale!=="ko"?null:t.data;default:return null}}var $r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$r[e.type]:t==="textarea"}function Wr(e,t,i,l){vt?Oe?Oe.push(l):Oe=[l]:vt=l,t=Zo(t,"onChange"),0<t.length&&(i=new st("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var ma=null,un=null;function Tc(e){h0(e,0)}function ho(e){var t=Gr(e);if(Xn(t))return e}function UA(e,t){if(e==="change")return t}var MA=!1;if(Ut){var Qc;if(Ut){var Dc="oninput"in document;if(!Dc){var _A=document.createElement("div");_A.setAttribute("oninput","return;"),Dc=typeof _A.oninput=="function"}Qc=Dc}else Qc=!1;MA=Qc&&(!document.documentMode||9<document.documentMode)}function OA(){ma&&(ma.detachEvent("onpropertychange",FA),un=ma=null)}function FA(e){if(e.propertyName==="value"&&ho(un)){var t=[];Wr(t,un,e,je(e)),Vr(Tc,t)}}function rE(e,t,i){e==="focusin"?(OA(),ma=t,un=i,ma.attachEvent("onpropertychange",FA)):e==="focusout"&&OA()}function nE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ho(un)}function aE(e,t){if(e==="click")return ho(t)}function iE(e,t){if(e==="input"||e==="change")return ho(t)}function sE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:sE;function Zs(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!Lt.call(t,f)||!cn(e[f],t[f]))return!1}return!0}function jA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function HA(e,t){var i=jA(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=jA(i)}}function GA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?GA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function VA(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rr(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=rr(e.document)}return t}function Rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lE=Ut&&"documentMode"in document&&11>=document.documentMode,os=null,kc=null,el=null,Lc=!1;function qA(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Lc||os==null||os!==rr(l)||(l=os,"selectionStart"in l&&Rc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),el&&Zs(el,l)||(el=l,l=Zo(kc,"onSelect"),0<l.length&&(t=new st("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=os)))}function Ri(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var us={animationend:Ri("Animation","AnimationEnd"),animationiteration:Ri("Animation","AnimationIteration"),animationstart:Ri("Animation","AnimationStart"),transitionrun:Ri("Transition","TransitionRun"),transitionstart:Ri("Transition","TransitionStart"),transitioncancel:Ri("Transition","TransitionCancel"),transitionend:Ri("Transition","TransitionEnd")},Uc={},zA={};Ut&&(zA=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function ki(e){if(Uc[e])return Uc[e];if(!us[e])return e;var t=us[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in zA)return Uc[e]=t[i];return e}var YA=ki("animationend"),PA=ki("animationiteration"),KA=ki("animationstart"),oE=ki("transitionrun"),uE=ki("transitionstart"),cE=ki("transitioncancel"),JA=ki("transitionend"),XA=new Map,Mc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Mc.push("scrollEnd");function On(e,t){XA.set(e,t),Un(t,[e])}var $A=new WeakMap;function wn(e,t){if(typeof e=="object"&&e!==null){var i=$A.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ss(t)},$A.set(e,t),t)}return{value:e,source:t,stack:ss(t)}}var In=[],cs=0,_c=0;function go(){for(var e=cs,t=_c=cs=0;t<e;){var i=In[t];In[t++]=null;var l=In[t];In[t++]=null;var f=In[t];In[t++]=null;var g=In[t];if(In[t++]=null,l!==null&&f!==null){var C=l.pending;C===null?f.next=f:(f.next=C.next,C.next=f),l.pending=f}g!==0&&WA(i,f,g)}}function mo(e,t,i,l){In[cs++]=e,In[cs++]=t,In[cs++]=i,In[cs++]=l,_c|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Oc(e,t,i,l){return mo(e,t,i,l),po(e)}function ds(e,t){return mo(e,null,null,t),po(e)}function WA(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var f=!1,g=e.return;g!==null;)g.childLanes|=i,l=g.alternate,l!==null&&(l.childLanes|=i),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(f=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,f&&t!==null&&(f=31-x(i),e=g.hiddenUpdates,l=e[f],l===null?e[f]=[t]:l.push(t),t.lane=i|536870912),g):null}function po(e){if(50<Il)throw Il=0,qd=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fs={};function dE(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,i,l){return new dE(e,t,i,l)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pa(e,t){var i=e.alternate;return i===null?(i=dn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function ZA(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yo(e,t,i,l,f,g){var C=0;if(l=e,typeof e=="function")Fc(e)&&(C=1);else if(typeof e=="string")C=Ab(e,i,He.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=dn(31,i,t,f),e.elementType=J,e.lanes=g,e;case Q:return Li(i.children,f,g,t);case k:C=8,f|=24;break;case R:return e=dn(12,i,t,f|2),e.elementType=R,e.lanes=g,e;case V:return e=dn(13,i,t,f),e.elementType=V,e.lanes=g,e;case ae:return e=dn(19,i,t,f),e.elementType=ae,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:case _:C=10;break e;case O:C=9;break e;case q:C=11;break e;case ge:C=14;break e;case te:C=16,l=null;break e}C=29,i=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=dn(C,i,t,f),t.elementType=e,t.type=l,t.lanes=g,t}function Li(e,t,i,l){return e=dn(7,e,l,t),e.lanes=i,e}function jc(e,t,i){return e=dn(6,e,null,t),e.lanes=i,e}function Hc(e,t,i){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var As=[],hs=0,Eo=null,bo=0,Bn=[],Sn=0,Ui=null,ya=1,Ea="";function Mi(e,t){As[hs++]=bo,As[hs++]=Eo,Eo=e,bo=t}function eh(e,t,i){Bn[Sn++]=ya,Bn[Sn++]=Ea,Bn[Sn++]=Ui,Ui=e;var l=ya;e=Ea;var f=32-x(l)-1;l&=~(1<<f),i+=1;var g=32-x(t)+f;if(30<g){var C=f-f%5;g=(l&(1<<C)-1).toString(32),l>>=C,f-=C,ya=1<<32-x(t)+f|i<<f|l,Ea=g+e}else ya=1<<g|i<<f|l,Ea=e}function Gc(e){e.return!==null&&(Mi(e,1),eh(e,1,0))}function Vc(e){for(;e===Eo;)Eo=As[--hs],As[hs]=null,bo=As[--hs],As[hs]=null;for(;e===Ui;)Ui=Bn[--Sn],Bn[Sn]=null,Ea=Bn[--Sn],Bn[Sn]=null,ya=Bn[--Sn],Bn[Sn]=null}var qr=null,Zt=null,It=!1,_i=null,Wn=!1,qc=Error(s(519));function Oi(e){var t=Error(s(418,""));throw nl(wn(t,e)),qc}function th(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[_t]=e,t[dr]=l,i){case"dialog":pt("cancel",t),pt("close",t);break;case"iframe":case"object":case"embed":pt("load",t);break;case"video":case"audio":for(i=0;i<Sl.length;i++)pt(Sl[i],t);break;case"source":pt("error",t);break;case"img":case"image":case"link":pt("error",t),pt("load",t);break;case"details":pt("toggle",t);break;case"input":pt("invalid",t),$n(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),_n(t);break;case"select":pt("invalid",t);break;case"textarea":pt("invalid",t),Ti(t,l.value,l.defaultValue,l.children),_n(t)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||y0(t.textContent,i)?(l.popover!=null&&(pt("beforetoggle",t),pt("toggle",t)),l.onScroll!=null&&pt("scroll",t),l.onScrollEnd!=null&&pt("scrollend",t),l.onClick!=null&&(t.onclick=eu),t=!0):t=!1,t||Oi(e)}function rh(e){for(qr=e.return;qr;)switch(qr.tag){case 5:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:qr=qr.return}}function tl(e){if(e!==qr)return!1;if(!It)return rh(e),It=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||lf(e.type,e.memoizedProps)),i=!i),i&&Zt&&Oi(e),rh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(i=e.data,i==="/$"){if(t===0){Zt=jn(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++;e=e.nextSibling}Zt=null}}else t===27?(t=Zt,li(e.type)?(e=df,df=null,Zt=e):Zt=t):Zt=qr?jn(e.stateNode.nextSibling):null;return!0}function rl(){Zt=qr=null,It=!1}function nh(){var e=_i;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),_i=null),e}function nl(e){_i===null?_i=[e]:_i.push(e)}var zc=ne(null),Fi=null,ba=null;function Ya(e,t,i){ke(zc,t._currentValue),t._currentValue=i}function va(e){e._currentValue=zc.current,Ee(zc)}function Yc(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Pc(e,t,i,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var g=f.dependencies;if(g!==null){var C=f.child;g=g.firstContext;e:for(;g!==null;){var L=g;g=f;for(var z=0;z<t.length;z++)if(L.context===t[z]){g.lanes|=i,L=g.alternate,L!==null&&(L.lanes|=i),Yc(g.return,i,e),l||(C=null);break e}g=L.next}}else if(f.tag===18){if(C=f.return,C===null)throw Error(s(341));C.lanes|=i,g=C.alternate,g!==null&&(g.lanes|=i),Yc(C,i,e),C=null}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===e){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}}function al(e,t,i,l){e=null;for(var f=t,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var C=f.alternate;if(C===null)throw Error(s(387));if(C=C.memoizedProps,C!==null){var L=f.type;cn(f.pendingProps.value,C.value)||(e!==null?e.push(L):e=[L])}}else if(f===yt.current){if(C=f.alternate,C===null)throw Error(s(387));C.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(kl):e=[kl])}f=f.return}e!==null&&Pc(t,e,i,l),t.flags|=262144}function vo(e){for(e=e.firstContext;e!==null;){if(!cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ji(e){Fi=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Or(e){return ah(Fi,e)}function xo(e,t){return Fi===null&&ji(e),ah(e,t)}function ah(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ba===null){if(e===null)throw Error(s(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return i}var fE=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},AE=n.unstable_scheduleCallback,hE=n.unstable_NormalPriority,hr={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kc(){return{controller:new fE,data:new Map,refCount:0}}function il(e){e.refCount--,e.refCount===0&&AE(hE,function(){e.controller.abort()})}var sl=null,Jc=0,gs=0,ms=null;function gE(e,t){if(sl===null){var i=sl=[];Jc=0,gs=$d(),ms={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Jc++,t.then(ih,ih),t}function ih(){if(--Jc===0&&sl!==null){ms!==null&&(ms.status="fulfilled");var e=sl;sl=null,gs=0,ms=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function mE(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var f=0;f<i.length;f++)(0,i[f])(t)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var sh=K.S;K.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&gE(e,t),sh!==null&&sh(e,t)};var Hi=ne(null);function Xc(){var e=Hi.current;return e!==null?e:Ft.pooledCache}function Co(e,t){t===null?ke(Hi,Hi.current):ke(Hi,t.pool)}function lh(){var e=Xc();return e===null?null:{parent:hr._currentValue,pool:e}}var ll=Error(s(460)),oh=Error(s(474)),wo=Error(s(542)),$c={then:function(){}};function uh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Io(){}function ch(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Io,Io),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fh(e),e;default:if(typeof t.status=="string")t.then(Io,Io);else{if(e=Ft,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=l}},function(l){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fh(e),e}throw ol=t,ll}}var ol=null;function dh(){if(ol===null)throw Error(s(459));var e=ol;return ol=null,e}function fh(e){if(e===ll||e===wo)throw Error(s(483))}var Pa=!1;function Wc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(St&2)!==0){var f=l.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),l.pending=t,t=po(e),WA(e,null,i),t}return mo(e,l,t,i),po(e)}function ul(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,rs(e,i)}}function ed(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?f=g=C:g=g.next=C,i=i.next}while(i!==null);g===null?f=g=t:g=g.next=t}else f=g=t;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var td=!1;function cl(){if(td){var e=ms;if(e!==null)throw e}}function dl(e,t,i,l){td=!1;var f=e.updateQueue;Pa=!1;var g=f.firstBaseUpdate,C=f.lastBaseUpdate,L=f.shared.pending;if(L!==null){f.shared.pending=null;var z=L,ce=z.next;z.next=null,C===null?g=ce:C.next=ce,C=z;var ve=e.alternate;ve!==null&&(ve=ve.updateQueue,L=ve.lastBaseUpdate,L!==C&&(L===null?ve.firstBaseUpdate=ce:L.next=ce,ve.lastBaseUpdate=z))}if(g!==null){var Se=f.baseState;C=0,ve=ce=z=null,L=g;do{var de=L.lane&-536870913,Ae=de!==L.lane;if(Ae?(xt&de)===de:(l&de)===de){de!==0&&de===gs&&(td=!0),ve!==null&&(ve=ve.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var rt=e,Ze=L;de=t;var Rt=i;switch(Ze.tag){case 1:if(rt=Ze.payload,typeof rt=="function"){Se=rt.call(Rt,Se,de);break e}Se=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=Ze.payload,de=typeof rt=="function"?rt.call(Rt,Se,de):rt,de==null)break e;Se=b({},Se,de);break e;case 2:Pa=!0}}de=L.callback,de!==null&&(e.flags|=64,Ae&&(e.flags|=8192),Ae=f.callbacks,Ae===null?f.callbacks=[de]:Ae.push(de))}else Ae={lane:de,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ve===null?(ce=ve=Ae,z=Se):ve=ve.next=Ae,C|=de;if(L=L.next,L===null){if(L=f.shared.pending,L===null)break;Ae=L,L=Ae.next,Ae.next=null,f.lastBaseUpdate=Ae,f.shared.pending=null}}while(!0);ve===null&&(z=Se),f.baseState=z,f.firstBaseUpdate=ce,f.lastBaseUpdate=ve,g===null&&(f.shared.lanes=0),ni|=C,e.lanes=C,e.memoizedState=Se}}function Ah(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function hh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ah(i[e],t)}var ps=ne(null),Bo=ne(0);function gh(e,t){e=Na,ke(Bo,e),ke(ps,t),Na=e|t.baseLanes}function rd(){ke(Bo,Na),ke(ps,ps.current)}function nd(){Na=Bo.current,Ee(ps),Ee(Bo)}var Xa=0,At=null,Qt=null,lr=null,So=!1,ys=!1,Gi=!1,No=0,fl=0,Es=null,pE=0;function ar(){throw Error(s(321))}function ad(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!cn(e[i],t[i]))return!1;return!0}function id(e,t,i,l,f,g){return Xa=g,At=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,K.H=e===null||e.memoizedState===null?Wh:Zh,Gi=!1,g=i(l,f),Gi=!1,ys&&(g=ph(t,i,l,f)),mh(e),g}function mh(e){K.H=Lo;var t=Qt!==null&&Qt.next!==null;if(Xa=0,lr=Qt=At=null,So=!1,fl=0,Es=null,t)throw Error(s(300));e===null||Cr||(e=e.dependencies,e!==null&&vo(e)&&(Cr=!0))}function ph(e,t,i,l){At=e;var f=0;do{if(ys&&(Es=null),fl=0,ys=!1,25<=f)throw Error(s(301));if(f+=1,lr=Qt=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}K.H=wE,g=t(i,l)}while(ys);return g}function yE(){var e=K.H,t=e.useState()[0];return t=typeof t.then=="function"?Al(t):t,e=e.useState()[0],(Qt!==null?Qt.memoizedState:null)!==e&&(At.flags|=1024),t}function sd(){var e=No!==0;return No=0,e}function ld(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function od(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}Xa=0,lr=Qt=At=null,ys=!1,fl=No=0,Es=null}function Zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?At.memoizedState=lr=e:lr=lr.next=e,lr}function or(){if(Qt===null){var e=At.alternate;e=e!==null?e.memoizedState:null}else e=Qt.next;var t=lr===null?At.memoizedState:lr.next;if(t!==null)lr=t,Qt=e;else{if(e===null)throw At.alternate===null?Error(s(467)):Error(s(310));Qt=e,e={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},lr===null?At.memoizedState=lr=e:lr=lr.next=e}return lr}function ud(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Al(e){var t=fl;return fl+=1,Es===null&&(Es=[]),e=ch(Es,e,t),t=At,(lr===null?t.memoizedState:lr.next)===null&&(t=t.alternate,K.H=t===null||t.memoizedState===null?Wh:Zh),e}function To(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Al(e);if(e.$$typeof===_)return Or(e)}throw Error(s(438,String(e)))}function cd(e){var t=null,i=At.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=At.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=ud(),At.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=P;return t.index++,i}function xa(e,t){return typeof t=="function"?t(e):t}function Qo(e){var t=or();return dd(t,Qt,e)}function dd(e,t,i){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var f=e.baseQueue,g=l.pending;if(g!==null){if(f!==null){var C=f.next;f.next=g.next,g.next=C}t.baseQueue=f=g,l.pending=null}if(g=e.baseState,f===null)e.memoizedState=g;else{t=f.next;var L=C=null,z=null,ce=t,ve=!1;do{var Se=ce.lane&-536870913;if(Se!==ce.lane?(xt&Se)===Se:(Xa&Se)===Se){var de=ce.revertLane;if(de===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Se===gs&&(ve=!0);else if((Xa&de)===de){ce=ce.next,de===gs&&(ve=!0);continue}else Se={lane:0,revertLane:ce.revertLane,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},z===null?(L=z=Se,C=g):z=z.next=Se,At.lanes|=de,ni|=de;Se=ce.action,Gi&&i(g,Se),g=ce.hasEagerState?ce.eagerState:i(g,Se)}else de={lane:Se,revertLane:ce.revertLane,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},z===null?(L=z=de,C=g):z=z.next=de,At.lanes|=Se,ni|=Se;ce=ce.next}while(ce!==null&&ce!==t);if(z===null?C=g:z.next=L,!cn(g,e.memoizedState)&&(Cr=!0,ve&&(i=ms,i!==null)))throw i;e.memoizedState=g,e.baseState=C,e.baseQueue=z,l.lastRenderedState=g}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function fd(e){var t=or(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,f=i.pending,g=t.memoizedState;if(f!==null){i.pending=null;var C=f=f.next;do g=e(g,C.action),C=C.next;while(C!==f);cn(g,t.memoizedState)||(Cr=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),i.lastRenderedState=g}return[g,l]}function yh(e,t,i){var l=At,f=or(),g=It;if(g){if(i===void 0)throw Error(s(407));i=i()}else i=t();var C=!cn((Qt||f).memoizedState,i);C&&(f.memoizedState=i,Cr=!0),f=f.queue;var L=vh.bind(null,l,f,e);if(hl(2048,8,L,[e]),f.getSnapshot!==t||C||lr!==null&&lr.memoizedState.tag&1){if(l.flags|=2048,bs(9,Do(),bh.bind(null,l,f,i,t),null),Ft===null)throw Error(s(349));g||(Xa&124)!==0||Eh(l,t,i)}return i}function Eh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=At.updateQueue,t===null?(t=ud(),At.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function bh(e,t,i,l){t.value=i,t.getSnapshot=l,xh(t)&&Ch(e)}function vh(e,t,i){return i(function(){xh(t)&&Ch(e)})}function xh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!cn(e,i)}catch{return!0}}function Ch(e){var t=ds(e,2);t!==null&&mn(t,e,2)}function Ad(e){var t=Zr();if(typeof e=="function"){var i=e;if(e=i(),Gi){E(!0);try{i()}finally{E(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},t}function wh(e,t,i,l){return e.baseState=i,dd(e,Qt,typeof l=="function"?l:xa)}function EE(e,t,i,l,f){if(ko(e))throw Error(s(485));if(e=t.action,e!==null){var g={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};K.T!==null?i(!0):g.isTransition=!1,l(g),i=t.pending,i===null?(g.next=t.pending=g,Ih(t,g)):(g.next=i.next,t.pending=i.next=g)}}function Ih(e,t){var i=t.action,l=t.payload,f=e.state;if(t.isTransition){var g=K.T,C={};K.T=C;try{var L=i(f,l),z=K.S;z!==null&&z(C,L),Bh(e,t,L)}catch(ce){hd(e,t,ce)}finally{K.T=g}}else try{g=i(f,l),Bh(e,t,g)}catch(ce){hd(e,t,ce)}}function Bh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Sh(e,t,l)},function(l){return hd(e,t,l)}):Sh(e,t,i)}function Sh(e,t,i){t.status="fulfilled",t.value=i,Nh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Ih(e,i)))}function hd(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Nh(t),t=t.next;while(t!==l)}e.action=null}function Nh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Th(e,t){return t}function Qh(e,t){if(It){var i=Ft.formState;if(i!==null){e:{var l=At;if(It){if(Zt){t:{for(var f=Zt,g=Wn;f.nodeType!==8;){if(!g){f=null;break t}if(f=jn(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Zt=jn(f.nextSibling),l=f.data==="F!";break e}}Oi(l)}l=!1}l&&(t=i[0])}}return i=Zr(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Th,lastRenderedState:t},i.queue=l,i=Jh.bind(null,At,l),l.dispatch=i,l=Ad(!1),g=Ed.bind(null,At,!1,l.queue),l=Zr(),f={state:t,dispatch:null,action:e,pending:null},l.queue=f,i=EE.bind(null,At,f,g,i),f.dispatch=i,l.memoizedState=e,[t,i,!1]}function Dh(e){var t=or();return Rh(t,Qt,e)}function Rh(e,t,i){if(t=dd(e,t,Th)[0],e=Qo(xa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Al(t)}catch(C){throw C===ll?wo:C}else l=t;t=or();var f=t.queue,g=f.dispatch;return i!==t.memoizedState&&(At.flags|=2048,bs(9,Do(),bE.bind(null,f,i),null)),[l,g,e]}function bE(e,t){e.action=t}function kh(e){var t=or(),i=Qt;if(i!==null)return Rh(t,i,e);or(),t=t.memoizedState,i=or();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function bs(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=At.updateQueue,t===null&&(t=ud(),At.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Do(){return{destroy:void 0,resource:void 0}}function Lh(){return or().memoizedState}function Ro(e,t,i,l){var f=Zr();l=l===void 0?null:l,At.flags|=e,f.memoizedState=bs(1|t,Do(),i,l)}function hl(e,t,i,l){var f=or();l=l===void 0?null:l;var g=f.memoizedState.inst;Qt!==null&&l!==null&&ad(l,Qt.memoizedState.deps)?f.memoizedState=bs(t,g,i,l):(At.flags|=e,f.memoizedState=bs(1|t,g,i,l))}function Uh(e,t){Ro(8390656,8,e,t)}function Mh(e,t){hl(2048,8,e,t)}function _h(e,t){return hl(4,2,e,t)}function Oh(e,t){return hl(4,4,e,t)}function Fh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jh(e,t,i){i=i!=null?i.concat([e]):null,hl(4,4,Fh.bind(null,t,e),i)}function gd(){}function Hh(e,t){var i=or();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&ad(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Gh(e,t){var i=or();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&ad(t,l[1]))return l[0];if(l=e(),Gi){E(!0);try{e()}finally{E(!1)}}return i.memoizedState=[l,t],l}function md(e,t,i){return i===void 0||(Xa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=i,e=zg(),At.lanes|=e,ni|=e,i)}function Vh(e,t,i,l){return cn(i,t)?i:ps.current!==null?(e=md(e,i,l),cn(e,t)||(Cr=!0),e):(Xa&42)===0?(Cr=!0,e.memoizedState=i):(e=zg(),At.lanes|=e,ni|=e,t)}function qh(e,t,i,l,f){var g=ie.p;ie.p=g!==0&&8>g?g:8;var C=K.T,L={};K.T=L,Ed(e,!1,t,i);try{var z=f(),ce=K.S;if(ce!==null&&ce(L,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ve=mE(z,l);gl(e,t,ve,gn(e))}else gl(e,t,l,gn(e))}catch(Se){gl(e,t,{then:function(){},status:"rejected",reason:Se},gn())}finally{ie.p=g,K.T=C}}function vE(){}function pd(e,t,i,l){if(e.tag!==5)throw Error(s(476));var f=zh(e).queue;qh(e,f,t,Ne,i===null?vE:function(){return Yh(e),i(l)})}function zh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:Ne},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Yh(e){var t=zh(e).next.queue;gl(e,t,{},gn())}function yd(){return Or(kl)}function Ph(){return or().memoizedState}function Kh(){return or().memoizedState}function xE(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=gn();e=Ka(i);var l=Ja(t,e,i);l!==null&&(mn(l,t,i),ul(l,t,i)),t={cache:Kc()},e.payload=t;return}t=t.return}}function CE(e,t,i){var l=gn();i={lane:l,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},ko(e)?Xh(t,i):(i=Oc(e,t,i,l),i!==null&&(mn(i,e,l),$h(i,t,l)))}function Jh(e,t,i){var l=gn();gl(e,t,i,l)}function gl(e,t,i,l){var f={lane:l,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(ko(e))Xh(t,f);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var C=t.lastRenderedState,L=g(C,i);if(f.hasEagerState=!0,f.eagerState=L,cn(L,C))return mo(e,t,f,0),Ft===null&&go(),!1}catch{}finally{}if(i=Oc(e,t,f,l),i!==null)return mn(i,e,l),$h(i,t,l),!0}return!1}function Ed(e,t,i,l){if(l={lane:2,revertLane:$d(),action:l,hasEagerState:!1,eagerState:null,next:null},ko(e)){if(t)throw Error(s(479))}else t=Oc(e,i,l,2),t!==null&&mn(t,e,2)}function ko(e){var t=e.alternate;return e===At||t!==null&&t===At}function Xh(e,t){ys=So=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function $h(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,rs(e,i)}}var Lo={readContext:Or,use:To,useCallback:ar,useContext:ar,useEffect:ar,useImperativeHandle:ar,useLayoutEffect:ar,useInsertionEffect:ar,useMemo:ar,useReducer:ar,useRef:ar,useState:ar,useDebugValue:ar,useDeferredValue:ar,useTransition:ar,useSyncExternalStore:ar,useId:ar,useHostTransitionStatus:ar,useFormState:ar,useActionState:ar,useOptimistic:ar,useMemoCache:ar,useCacheRefresh:ar},Wh={readContext:Or,use:To,useCallback:function(e,t){return Zr().memoizedState=[e,t===void 0?null:t],e},useContext:Or,useEffect:Uh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ro(4194308,4,Fh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){Ro(4,2,e,t)},useMemo:function(e,t){var i=Zr();t=t===void 0?null:t;var l=e();if(Gi){E(!0);try{e()}finally{E(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Zr();if(i!==void 0){var f=i(t);if(Gi){E(!0);try{i(t)}finally{E(!1)}}}else f=t;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=CE.bind(null,At,e),[l.memoizedState,e]},useRef:function(e){var t=Zr();return e={current:e},t.memoizedState=e},useState:function(e){e=Ad(e);var t=e.queue,i=Jh.bind(null,At,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:gd,useDeferredValue:function(e,t){var i=Zr();return md(i,e,t)},useTransition:function(){var e=Ad(!1);return e=qh.bind(null,At,e.queue,!0,!1),Zr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=At,f=Zr();if(It){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Ft===null)throw Error(s(349));(xt&124)!==0||Eh(l,t,i)}f.memoizedState=i;var g={value:i,getSnapshot:t};return f.queue=g,Uh(vh.bind(null,l,g,e),[e]),l.flags|=2048,bs(9,Do(),bh.bind(null,l,g,i,t),null),i},useId:function(){var e=Zr(),t=Ft.identifierPrefix;if(It){var i=Ea,l=ya;i=(l&~(1<<32-x(l)-1)).toString(32)+i,t="«"+t+"R"+i,i=No++,0<i&&(t+="H"+i.toString(32)),t+="»"}else i=pE++,t="«"+t+"r"+i.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:yd,useFormState:Qh,useActionState:Qh,useOptimistic:function(e){var t=Zr();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ed.bind(null,At,!0,i),i.dispatch=t,[e,t]},useMemoCache:cd,useCacheRefresh:function(){return Zr().memoizedState=xE.bind(null,At)}},Zh={readContext:Or,use:To,useCallback:Hh,useContext:Or,useEffect:Mh,useImperativeHandle:jh,useInsertionEffect:_h,useLayoutEffect:Oh,useMemo:Gh,useReducer:Qo,useRef:Lh,useState:function(){return Qo(xa)},useDebugValue:gd,useDeferredValue:function(e,t){var i=or();return Vh(i,Qt.memoizedState,e,t)},useTransition:function(){var e=Qo(xa)[0],t=or().memoizedState;return[typeof e=="boolean"?e:Al(e),t]},useSyncExternalStore:yh,useId:Ph,useHostTransitionStatus:yd,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var i=or();return wh(i,Qt,e,t)},useMemoCache:cd,useCacheRefresh:Kh},wE={readContext:Or,use:To,useCallback:Hh,useContext:Or,useEffect:Mh,useImperativeHandle:jh,useInsertionEffect:_h,useLayoutEffect:Oh,useMemo:Gh,useReducer:fd,useRef:Lh,useState:function(){return fd(xa)},useDebugValue:gd,useDeferredValue:function(e,t){var i=or();return Qt===null?md(i,e,t):Vh(i,Qt.memoizedState,e,t)},useTransition:function(){var e=fd(xa)[0],t=or().memoizedState;return[typeof e=="boolean"?e:Al(e),t]},useSyncExternalStore:yh,useId:Ph,useHostTransitionStatus:yd,useFormState:kh,useActionState:kh,useOptimistic:function(e,t){var i=or();return Qt!==null?wh(i,Qt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:cd,useCacheRefresh:Kh},vs=null,ml=0;function Uo(e){var t=ml;return ml+=1,vs===null&&(vs=[]),ch(vs,e,t)}function pl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mo(e,t){throw t.$$typeof===v?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function eg(e){var t=e._init;return t(e._payload)}function tg(e){function t(re,Z){if(e){var ue=re.deletions;ue===null?(re.deletions=[Z],re.flags|=16):ue.push(Z)}}function i(re,Z){if(!e)return null;for(;Z!==null;)t(re,Z),Z=Z.sibling;return null}function l(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function f(re,Z){return re=pa(re,Z),re.index=0,re.sibling=null,re}function g(re,Z,ue){return re.index=ue,e?(ue=re.alternate,ue!==null?(ue=ue.index,ue<Z?(re.flags|=67108866,Z):ue):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function C(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function L(re,Z,ue,Ce){return Z===null||Z.tag!==6?(Z=jc(ue,re.mode,Ce),Z.return=re,Z):(Z=f(Z,ue),Z.return=re,Z)}function z(re,Z,ue,Ce){var Ye=ue.type;return Ye===Q?ve(re,Z,ue.props.children,Ce,ue.key):Z!==null&&(Z.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===te&&eg(Ye)===Z.type)?(Z=f(Z,ue.props),pl(Z,ue),Z.return=re,Z):(Z=yo(ue.type,ue.key,ue.props,null,re.mode,Ce),pl(Z,ue),Z.return=re,Z)}function ce(re,Z,ue,Ce){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ue.containerInfo||Z.stateNode.implementation!==ue.implementation?(Z=Hc(ue,re.mode,Ce),Z.return=re,Z):(Z=f(Z,ue.children||[]),Z.return=re,Z)}function ve(re,Z,ue,Ce,Ye){return Z===null||Z.tag!==7?(Z=Li(ue,re.mode,Ce,Ye),Z.return=re,Z):(Z=f(Z,ue),Z.return=re,Z)}function Se(re,Z,ue){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=jc(""+Z,re.mode,ue),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case B:return ue=yo(Z.type,Z.key,Z.props,null,re.mode,ue),pl(ue,Z),ue.return=re,ue;case T:return Z=Hc(Z,re.mode,ue),Z.return=re,Z;case te:var Ce=Z._init;return Z=Ce(Z._payload),Se(re,Z,ue)}if(pe(Z)||me(Z))return Z=Li(Z,re.mode,ue,null),Z.return=re,Z;if(typeof Z.then=="function")return Se(re,Uo(Z),ue);if(Z.$$typeof===_)return Se(re,xo(re,Z),ue);Mo(re,Z)}return null}function de(re,Z,ue,Ce){var Ye=Z!==null?Z.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ye!==null?null:L(re,Z,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case B:return ue.key===Ye?z(re,Z,ue,Ce):null;case T:return ue.key===Ye?ce(re,Z,ue,Ce):null;case te:return Ye=ue._init,ue=Ye(ue._payload),de(re,Z,ue,Ce)}if(pe(ue)||me(ue))return Ye!==null?null:ve(re,Z,ue,Ce,null);if(typeof ue.then=="function")return de(re,Z,Uo(ue),Ce);if(ue.$$typeof===_)return de(re,Z,xo(re,ue),Ce);Mo(re,ue)}return null}function Ae(re,Z,ue,Ce,Ye){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return re=re.get(ue)||null,L(Z,re,""+Ce,Ye);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case B:return re=re.get(Ce.key===null?ue:Ce.key)||null,z(Z,re,Ce,Ye);case T:return re=re.get(Ce.key===null?ue:Ce.key)||null,ce(Z,re,Ce,Ye);case te:var ht=Ce._init;return Ce=ht(Ce._payload),Ae(re,Z,ue,Ce,Ye)}if(pe(Ce)||me(Ce))return re=re.get(ue)||null,ve(Z,re,Ce,Ye,null);if(typeof Ce.then=="function")return Ae(re,Z,ue,Uo(Ce),Ye);if(Ce.$$typeof===_)return Ae(re,Z,ue,xo(Z,Ce),Ye);Mo(Z,Ce)}return null}function rt(re,Z,ue,Ce){for(var Ye=null,ht=null,Je=Z,tt=Z=0,Ir=null;Je!==null&&tt<ue.length;tt++){Je.index>tt?(Ir=Je,Je=null):Ir=Je.sibling;var Ct=de(re,Je,ue[tt],Ce);if(Ct===null){Je===null&&(Je=Ir);break}e&&Je&&Ct.alternate===null&&t(re,Je),Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct,Je=Ir}if(tt===ue.length)return i(re,Je),It&&Mi(re,tt),Ye;if(Je===null){for(;tt<ue.length;tt++)Je=Se(re,ue[tt],Ce),Je!==null&&(Z=g(Je,Z,tt),ht===null?Ye=Je:ht.sibling=Je,ht=Je);return It&&Mi(re,tt),Ye}for(Je=l(Je);tt<ue.length;tt++)Ir=Ae(Je,re,tt,ue[tt],Ce),Ir!==null&&(e&&Ir.alternate!==null&&Je.delete(Ir.key===null?tt:Ir.key),Z=g(Ir,Z,tt),ht===null?Ye=Ir:ht.sibling=Ir,ht=Ir);return e&&Je.forEach(function(fi){return t(re,fi)}),It&&Mi(re,tt),Ye}function Ze(re,Z,ue,Ce){if(ue==null)throw Error(s(151));for(var Ye=null,ht=null,Je=Z,tt=Z=0,Ir=null,Ct=ue.next();Je!==null&&!Ct.done;tt++,Ct=ue.next()){Je.index>tt?(Ir=Je,Je=null):Ir=Je.sibling;var fi=de(re,Je,Ct.value,Ce);if(fi===null){Je===null&&(Je=Ir);break}e&&Je&&fi.alternate===null&&t(re,Je),Z=g(fi,Z,tt),ht===null?Ye=fi:ht.sibling=fi,ht=fi,Je=Ir}if(Ct.done)return i(re,Je),It&&Mi(re,tt),Ye;if(Je===null){for(;!Ct.done;tt++,Ct=ue.next())Ct=Se(re,Ct.value,Ce),Ct!==null&&(Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct);return It&&Mi(re,tt),Ye}for(Je=l(Je);!Ct.done;tt++,Ct=ue.next())Ct=Ae(Je,re,tt,Ct.value,Ce),Ct!==null&&(e&&Ct.alternate!==null&&Je.delete(Ct.key===null?tt:Ct.key),Z=g(Ct,Z,tt),ht===null?Ye=Ct:ht.sibling=Ct,ht=Ct);return e&&Je.forEach(function(Ib){return t(re,Ib)}),It&&Mi(re,tt),Ye}function Rt(re,Z,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===Q&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case B:e:{for(var Ye=ue.key;Z!==null;){if(Z.key===Ye){if(Ye=ue.type,Ye===Q){if(Z.tag===7){i(re,Z.sibling),Ce=f(Z,ue.props.children),Ce.return=re,re=Ce;break e}}else if(Z.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===te&&eg(Ye)===Z.type){i(re,Z.sibling),Ce=f(Z,ue.props),pl(Ce,ue),Ce.return=re,re=Ce;break e}i(re,Z);break}else t(re,Z);Z=Z.sibling}ue.type===Q?(Ce=Li(ue.props.children,re.mode,Ce,ue.key),Ce.return=re,re=Ce):(Ce=yo(ue.type,ue.key,ue.props,null,re.mode,Ce),pl(Ce,ue),Ce.return=re,re=Ce)}return C(re);case T:e:{for(Ye=ue.key;Z!==null;){if(Z.key===Ye)if(Z.tag===4&&Z.stateNode.containerInfo===ue.containerInfo&&Z.stateNode.implementation===ue.implementation){i(re,Z.sibling),Ce=f(Z,ue.children||[]),Ce.return=re,re=Ce;break e}else{i(re,Z);break}else t(re,Z);Z=Z.sibling}Ce=Hc(ue,re.mode,Ce),Ce.return=re,re=Ce}return C(re);case te:return Ye=ue._init,ue=Ye(ue._payload),Rt(re,Z,ue,Ce)}if(pe(ue))return rt(re,Z,ue,Ce);if(me(ue)){if(Ye=me(ue),typeof Ye!="function")throw Error(s(150));return ue=Ye.call(ue),Ze(re,Z,ue,Ce)}if(typeof ue.then=="function")return Rt(re,Z,Uo(ue),Ce);if(ue.$$typeof===_)return Rt(re,Z,xo(re,ue),Ce);Mo(re,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,Z!==null&&Z.tag===6?(i(re,Z.sibling),Ce=f(Z,ue),Ce.return=re,re=Ce):(i(re,Z),Ce=jc(ue,re.mode,Ce),Ce.return=re,re=Ce),C(re)):i(re,Z)}return function(re,Z,ue,Ce){try{ml=0;var Ye=Rt(re,Z,ue,Ce);return vs=null,Ye}catch(Je){if(Je===ll||Je===wo)throw Je;var ht=dn(29,Je,null,re.mode);return ht.lanes=Ce,ht.return=re,ht}finally{}}}var xs=tg(!0),rg=tg(!1),Nn=ne(null),Zn=null;function $a(e){var t=e.alternate;ke(gr,gr.current&1),ke(Nn,e),Zn===null&&(t===null||ps.current!==null||t.memoizedState!==null)&&(Zn=e)}function ng(e){if(e.tag===22){if(ke(gr,gr.current),ke(Nn,e),Zn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Zn=e)}}else Wa()}function Wa(){ke(gr,gr.current),ke(Nn,Nn.current)}function Ca(e){Ee(Nn),Zn===e&&(Zn=null),Ee(gr)}var gr=ne(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||cf(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function bd(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:b({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var vd={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=gn(),f=Ka(l);f.payload=t,i!=null&&(f.callback=i),t=Ja(e,f,l),t!==null&&(mn(t,e,l),ul(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=gn(),f=Ka(l);f.tag=1,f.payload=t,i!=null&&(f.callback=i),t=Ja(e,f,l),t!==null&&(mn(t,e,l),ul(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=gn(),l=Ka(i);l.tag=2,t!=null&&(l.callback=t),t=Ja(e,l,i),t!==null&&(mn(t,e,i),ul(t,e,i))}};function ag(e,t,i,l,f,g,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,C):t.prototype&&t.prototype.isPureReactComponent?!Zs(i,l)||!Zs(f,g):!0}function ig(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&vd.enqueueReplaceState(t,t.state,null)}function Vi(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=b({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}var Oo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function sg(e){Oo(e)}function lg(e){console.error(e)}function og(e){Oo(e)}function Fo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ug(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function xd(e,t,i){return i=Ka(i),i.tag=3,i.payload={element:null},i.callback=function(){Fo(e,t)},i}function cg(e){return e=Ka(e),e.tag=3,e}function dg(e,t,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;e.payload=function(){return f(g)},e.callback=function(){ug(t,i,l)}}var C=i.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(e.callback=function(){ug(t,i,l),typeof f!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L!==null?L:""})})}function IE(e,t,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&al(t,i,f,!0),i=Nn.current,i!==null){switch(i.tag){case 13:return Zn===null?Yd():i.alternate===null&&er===0&&(er=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===$c?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),Kd(e,l,f)),!1;case 22:return i.flags|=65536,l===$c?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),Kd(e,l,f)),!1}throw Error(s(435,i.tag))}return Kd(e,l,f),Yd(),!1}if(It)return t=Nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,l!==qc&&(e=Error(s(422),{cause:l}),nl(wn(e,i)))):(l!==qc&&(t=Error(s(423),{cause:l}),nl(wn(t,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=wn(l,i),f=xd(e.stateNode,l,f),ed(e,f),er!==4&&(er=2)),!1;var g=Error(s(520),{cause:l});if(g=wn(g,i),wl===null?wl=[g]:wl.push(g),er!==4&&(er=2),t===null)return!0;l=wn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=xd(i.stateNode,l,e),ed(i,e),!1;case 1:if(t=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ai===null||!ai.has(g))))return i.flags|=65536,f&=-f,i.lanes|=f,f=cg(f),dg(f,e,i,l),ed(i,f),!1}i=i.return}while(i!==null);return!1}var fg=Error(s(461)),Cr=!1;function Qr(e,t,i,l){t.child=e===null?rg(t,null,i,l):xs(t,e.child,i,l)}function Ag(e,t,i,l,f){i=i.render;var g=t.ref;if("ref"in l){var C={};for(var L in l)L!=="ref"&&(C[L]=l[L])}else C=l;return ji(t),l=id(e,t,i,C,g,f),L=sd(),e!==null&&!Cr?(ld(e,t,f),wa(e,t,f)):(It&&L&&Gc(t),t.flags|=1,Qr(e,t,l,f),t.child)}function hg(e,t,i,l,f){if(e===null){var g=i.type;return typeof g=="function"&&!Fc(g)&&g.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=g,gg(e,t,g,l,f)):(e=yo(i.type,null,l,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Qd(e,f)){var C=g.memoizedProps;if(i=i.compare,i=i!==null?i:Zs,i(C,l)&&e.ref===t.ref)return wa(e,t,f)}return t.flags|=1,e=pa(g,l),e.ref=t.ref,e.return=t,t.child=e}function gg(e,t,i,l,f){if(e!==null){var g=e.memoizedProps;if(Zs(g,l)&&e.ref===t.ref)if(Cr=!1,t.pendingProps=l=g,Qd(e,f))(e.flags&131072)!==0&&(Cr=!0);else return t.lanes=e.lanes,wa(e,t,f)}return Cd(e,t,i,l,f)}function mg(e,t,i){var l=t.pendingProps,f=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=g!==null?g.baseLanes|i:i,e!==null){for(f=t.child=e.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;t.childLanes=g&~l}else t.childLanes=0,t.child=null;return pg(e,t,l,i)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Co(t,g!==null?g.cachePool:null),g!==null?gh(t,g):rd(),ng(t);else return t.lanes=t.childLanes=536870912,pg(e,t,g!==null?g.baseLanes|i:i,i)}else g!==null?(Co(t,g.cachePool),gh(t,g),Wa(),t.memoizedState=null):(e!==null&&Co(t,null),rd(),Wa());return Qr(e,t,f,i),t.child}function pg(e,t,i,l){var f=Xc();return f=f===null?null:{parent:hr._currentValue,pool:f},t.memoizedState={baseLanes:i,cachePool:f},e!==null&&Co(t,null),rd(),ng(t),e!==null&&al(e,t,l,!0),null}function jo(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Cd(e,t,i,l,f){return ji(t),i=id(e,t,i,l,void 0,f),l=sd(),e!==null&&!Cr?(ld(e,t,f),wa(e,t,f)):(It&&l&&Gc(t),t.flags|=1,Qr(e,t,i,f),t.child)}function yg(e,t,i,l,f,g){return ji(t),t.updateQueue=null,i=ph(t,l,i,f),mh(e),l=sd(),e!==null&&!Cr?(ld(e,t,g),wa(e,t,g)):(It&&l&&Gc(t),t.flags|=1,Qr(e,t,i,g),t.child)}function Eg(e,t,i,l,f){if(ji(t),t.stateNode===null){var g=fs,C=i.contextType;typeof C=="object"&&C!==null&&(g=Or(C)),g=new i(l,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=vd,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=l,g.state=t.memoizedState,g.refs={},Wc(t),C=i.contextType,g.context=typeof C=="object"&&C!==null?Or(C):fs,g.state=t.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(bd(t,i,C,l),g.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&vd.enqueueReplaceState(g,g.state,null),dl(t,l,g,f),cl(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){g=t.stateNode;var L=t.memoizedProps,z=Vi(i,L);g.props=z;var ce=g.context,ve=i.contextType;C=fs,typeof ve=="object"&&ve!==null&&(C=Or(ve));var Se=i.getDerivedStateFromProps;ve=typeof Se=="function"||typeof g.getSnapshotBeforeUpdate=="function",L=t.pendingProps!==L,ve||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(L||ce!==C)&&ig(t,g,l,C),Pa=!1;var de=t.memoizedState;g.state=de,dl(t,l,g,f),cl(),ce=t.memoizedState,L||de!==ce||Pa?(typeof Se=="function"&&(bd(t,i,Se,l),ce=t.memoizedState),(z=Pa||ag(t,i,z,l,de,ce,C))?(ve||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=ce),g.props=l,g.state=ce,g.context=C,l=z):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{g=t.stateNode,Zc(e,t),C=t.memoizedProps,ve=Vi(i,C),g.props=ve,Se=t.pendingProps,de=g.context,ce=i.contextType,z=fs,typeof ce=="object"&&ce!==null&&(z=Or(ce)),L=i.getDerivedStateFromProps,(ce=typeof L=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==Se||de!==z)&&ig(t,g,l,z),Pa=!1,de=t.memoizedState,g.state=de,dl(t,l,g,f),cl();var Ae=t.memoizedState;C!==Se||de!==Ae||Pa||e!==null&&e.dependencies!==null&&vo(e.dependencies)?(typeof L=="function"&&(bd(t,i,L,l),Ae=t.memoizedState),(ve=Pa||ag(t,i,ve,l,de,Ae,z)||e!==null&&e.dependencies!==null&&vo(e.dependencies))?(ce||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,Ae,z),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,Ae,z)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Ae),g.props=l,g.state=Ae,g.context=z,l=ve):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&de===e.memoizedState||(t.flags|=1024),l=!1)}return g=l,jo(e,t),l=(t.flags&128)!==0,g||l?(g=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&l?(t.child=xs(t,e.child,null,f),t.child=xs(t,null,i,f)):Qr(e,t,i,f),t.memoizedState=g.state,e=t.child):e=wa(e,t,f),e}function bg(e,t,i,l){return rl(),t.flags|=256,Qr(e,t,i,l),t.child}var wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Id(e){return{baseLanes:e,cachePool:lh()}}function Bd(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Tn),e}function vg(e,t,i){var l=t.pendingProps,f=!1,g=(t.flags&128)!==0,C;if((C=g)||(C=e!==null&&e.memoizedState===null?!1:(gr.current&2)!==0),C&&(f=!0,t.flags&=-129),C=(t.flags&32)!==0,t.flags&=-33,e===null){if(It){if(f?$a(t):Wa(),It){var L=Zt,z;if(z=L){e:{for(z=L,L=Wn;z.nodeType!==8;){if(!L){L=null;break e}if(z=jn(z.nextSibling),z===null){L=null;break e}}L=z}L!==null?(t.memoizedState={dehydrated:L,treeContext:Ui!==null?{id:ya,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},z=dn(18,null,null,0),z.stateNode=L,z.return=t,t.child=z,qr=t,Zt=null,z=!0):z=!1}z||Oi(t)}if(L=t.memoizedState,L!==null&&(L=L.dehydrated,L!==null))return cf(L)?t.lanes=32:t.lanes=536870912,null;Ca(t)}return L=l.children,l=l.fallback,f?(Wa(),f=t.mode,L=Ho({mode:"hidden",children:L},f),l=Li(l,f,i,null),L.return=t,l.return=t,L.sibling=l,t.child=L,f=t.child,f.memoizedState=Id(i),f.childLanes=Bd(e,C,i),t.memoizedState=wd,l):($a(t),Sd(t,L))}if(z=e.memoizedState,z!==null&&(L=z.dehydrated,L!==null)){if(g)t.flags&256?($a(t),t.flags&=-257,t=Nd(e,t,i)):t.memoizedState!==null?(Wa(),t.child=e.child,t.flags|=128,t=null):(Wa(),f=l.fallback,L=t.mode,l=Ho({mode:"visible",children:l.children},L),f=Li(f,L,i,null),f.flags|=2,l.return=t,f.return=t,l.sibling=f,t.child=l,xs(t,e.child,null,i),l=t.child,l.memoizedState=Id(i),l.childLanes=Bd(e,C,i),t.memoizedState=wd,t=f);else if($a(t),cf(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var ce=C.dgst;C=ce,l=Error(s(419)),l.stack="",l.digest=C,nl({value:l,source:null,stack:null}),t=Nd(e,t,i)}else if(Cr||al(e,t,i,!1),C=(i&e.childLanes)!==0,Cr||C){if(C=Ft,C!==null&&(l=i&-i,l=(l&42)!==0?1:Ci(l),l=(l&(C.suspendedLanes|i))!==0?0:l,l!==0&&l!==z.retryLane))throw z.retryLane=l,ds(e,l),mn(C,e,l),fg;L.data==="$?"||Yd(),t=Nd(e,t,i)}else L.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,Zt=jn(L.nextSibling),qr=t,It=!0,_i=null,Wn=!1,e!==null&&(Bn[Sn++]=ya,Bn[Sn++]=Ea,Bn[Sn++]=Ui,ya=e.id,Ea=e.overflow,Ui=t),t=Sd(t,l.children),t.flags|=4096);return t}return f?(Wa(),f=l.fallback,L=t.mode,z=e.child,ce=z.sibling,l=pa(z,{mode:"hidden",children:l.children}),l.subtreeFlags=z.subtreeFlags&65011712,ce!==null?f=pa(ce,f):(f=Li(f,L,i,null),f.flags|=2),f.return=t,l.return=t,l.sibling=f,t.child=l,l=f,f=t.child,L=e.child.memoizedState,L===null?L=Id(i):(z=L.cachePool,z!==null?(ce=hr._currentValue,z=z.parent!==ce?{parent:ce,pool:ce}:z):z=lh(),L={baseLanes:L.baseLanes|i,cachePool:z}),f.memoizedState=L,f.childLanes=Bd(e,C,i),t.memoizedState=wd,l):($a(t),i=e.child,e=i.sibling,i=pa(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(C=t.deletions,C===null?(t.deletions=[e],t.flags|=16):C.push(e)),t.child=i,t.memoizedState=null,i)}function Sd(e,t){return t=Ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ho(e,t){return e=dn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Nd(e,t,i){return xs(t,e.child,null,i),e=Sd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xg(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Yc(e.return,t,i)}function Td(e,t,i,l,f){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=i,g.tailMode=f)}function Cg(e,t,i){var l=t.pendingProps,f=l.revealOrder,g=l.tail;if(Qr(e,t,l.children,i),l=gr.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xg(e,i,t);else if(e.tag===19)xg(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}switch(ke(gr,l),f){case"forwards":for(i=t.child,f=null;i!==null;)e=i.alternate,e!==null&&_o(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=t.child,t.child=null):(f=i.sibling,i.sibling=null),Td(t,!1,f,i,g);break;case"backwards":for(i=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&_o(e)===null){t.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Td(t,!0,i,null,g);break;case"together":Td(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ni|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(al(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=pa(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=pa(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Qd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vo(e)))}function BE(e,t,i){switch(t.tag){case 3:We(t,t.stateNode.containerInfo),Ya(t,hr,e.memoizedState.cache),rl();break;case 27:case 5:Kt(t);break;case 4:We(t,t.stateNode.containerInfo);break;case 10:Ya(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?($a(t),t.flags|=128,null):(i&t.child.childLanes)!==0?vg(e,t,i):($a(t),e=wa(e,t,i),e!==null?e.sibling:null);$a(t);break;case 19:var f=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(al(e,t,i,!1),l=(i&t.childLanes)!==0),f){if(l)return Cg(e,t,i);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ke(gr,gr.current),l)break;return null;case 22:case 23:return t.lanes=0,mg(e,t,i);case 24:Ya(t,hr,e.memoizedState.cache)}return wa(e,t,i)}function wg(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Cr=!0;else{if(!Qd(e,i)&&(t.flags&128)===0)return Cr=!1,BE(e,t,i);Cr=(e.flags&131072)!==0}else Cr=!1,It&&(t.flags&1048576)!==0&&eh(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,f=l._init;if(l=f(l._payload),t.type=l,typeof l=="function")Fc(l)?(e=Vi(l,e),t.tag=1,t=Eg(null,t,l,e,i)):(t.tag=0,t=Cd(null,t,l,e,i));else{if(l!=null){if(f=l.$$typeof,f===q){t.tag=11,t=Ag(null,t,l,e,i);break e}else if(f===ge){t.tag=14,t=hg(null,t,l,e,i);break e}}throw t=Be(l)||l,Error(s(306,t,""))}}return t;case 0:return Cd(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,f=Vi(l,t.pendingProps),Eg(e,t,l,f,i);case 3:e:{if(We(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var g=t.memoizedState;f=g.element,Zc(e,t),dl(t,l,null,i);var C=t.memoizedState;if(l=C.cache,Ya(t,hr,l),l!==g.cache&&Pc(t,[hr],i,!0),cl(),l=C.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:C.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=bg(e,t,l,i);break e}else if(l!==f){f=wn(Error(s(424)),t),nl(f),t=bg(e,t,l,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Zt=jn(e.firstChild),qr=t,It=!0,_i=null,Wn=!0,i=rg(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(rl(),l===f){t=wa(e,t,i);break e}Qr(e,t,l,i)}t=t.child}return t;case 26:return jo(e,t),e===null?(i=N0(t.type,null,t.pendingProps,null))?t.memoizedState=i:It||(i=t.type,e=t.pendingProps,l=tu(Ge.current).createElement(i),l[_t]=t,l[dr]=e,Rr(l,i,e),Gt(l),t.stateNode=l):t.memoizedState=N0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Kt(t),e===null&&It&&(l=t.stateNode=I0(t.type,t.pendingProps,Ge.current),qr=t,Wn=!0,f=Zt,li(t.type)?(df=f,Zt=jn(l.firstChild)):Zt=f),Qr(e,t,t.pendingProps.children,i),jo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&It&&((f=l=Zt)&&(l=eb(l,t.type,t.pendingProps,Wn),l!==null?(t.stateNode=l,qr=t,Zt=jn(l.firstChild),Wn=!1,f=!0):f=!1),f||Oi(t)),Kt(t),f=t.type,g=t.pendingProps,C=e!==null?e.memoizedProps:null,l=g.children,lf(f,g)?l=null:C!==null&&lf(f,C)&&(t.flags|=32),t.memoizedState!==null&&(f=id(e,t,yE,null,null,i),kl._currentValue=f),jo(e,t),Qr(e,t,l,i),t.child;case 6:return e===null&&It&&((e=i=Zt)&&(i=tb(i,t.pendingProps,Wn),i!==null?(t.stateNode=i,qr=t,Zt=null,e=!0):e=!1),e||Oi(t)),null;case 13:return vg(e,t,i);case 4:return We(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=xs(t,null,l,i):Qr(e,t,l,i),t.child;case 11:return Ag(e,t,t.type,t.pendingProps,i);case 7:return Qr(e,t,t.pendingProps,i),t.child;case 8:return Qr(e,t,t.pendingProps.children,i),t.child;case 12:return Qr(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,Ya(t,t.type,l.value),Qr(e,t,l.children,i),t.child;case 9:return f=t.type._context,l=t.pendingProps.children,ji(t),f=Or(f),l=l(f),t.flags|=1,Qr(e,t,l,i),t.child;case 14:return hg(e,t,t.type,t.pendingProps,i);case 15:return gg(e,t,t.type,t.pendingProps,i);case 19:return Cg(e,t,i);case 31:return l=t.pendingProps,i=t.mode,l={mode:l.mode,children:l.children},e===null?(i=Ho(l,i),i.ref=t.ref,t.child=i,i.return=t,t=i):(i=pa(e.child,l),i.ref=t.ref,t.child=i,i.return=t,t=i),t;case 22:return mg(e,t,i);case 24:return ji(t),l=Or(hr),e===null?(f=Xc(),f===null&&(f=Ft,g=Kc(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=i),f=g),t.memoizedState={parent:l,cache:f},Wc(t),Ya(t,hr,f)):((e.lanes&i)!==0&&(Zc(e,t),dl(t,null,null,i),cl()),f=e.memoizedState,g=t.memoizedState,f.parent!==l?(f={parent:l,cache:l},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Ya(t,hr,l)):(l=g.cache,Ya(t,hr,l),l!==f.cache&&Pc(t,[hr],i,!0))),Qr(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Ia(e){e.flags|=4}function Ig(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!k0(t)){if(t=Nn.current,t!==null&&((xt&4194048)===xt?Zn!==null:(xt&62914560)!==xt&&(xt&536870912)===0||t!==Zn))throw ol=$c,oh;e.flags|=8192}}function Go(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?sn():536870912,e.lanes|=t,Bs|=t)}function yl(e,t){if(!It)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function SE(e,t,i){var l=t.pendingProps;switch(Vc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(t),null;case 1:return Xt(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),va(hr),Et(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(tl(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nh())),Xt(t),null;case 26:return i=t.memoizedState,e===null?(Ia(t),i!==null?(Xt(t),Ig(t,i)):(Xt(t),t.flags&=-16777217)):i?i!==e.memoizedState?(Ia(t),Xt(t),Ig(t,i)):(Xt(t),t.flags&=-16777217):(e.memoizedProps!==l&&Ia(t),Xt(t),t.flags&=-16777217),null;case 27:Nr(t),i=Ge.current;var f=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Xt(t),null}e=He.current,tl(t)?th(t):(e=I0(f,l,i),t.stateNode=e,Ia(t))}return Xt(t),null;case 5:if(Nr(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Xt(t),null}if(e=He.current,tl(t))th(t);else{switch(f=tu(Ge.current),e){case 1:e=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:e=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":e=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":e=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":e=f.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?f.createElement(i,{is:l.is}):f.createElement(i)}}e[_t]=t,e[dr]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)e.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=e;e:switch(Rr(e,i,l),i){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ia(t)}}return Xt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ia(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=Ge.current,tl(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,f=qr,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[_t]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||y0(e.nodeValue,i)),e||Oi(t)}else e=tu(e).createTextNode(l),e[_t]=t,t.stateNode=e}return Xt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=tl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[_t]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xt(t),f=!1}else f=nh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(Ca(t),t):(Ca(t),null)}if(Ca(t),(t.flags&128)!==0)return t.lanes=i,t;if(i=l!==null,e=e!==null&&e.memoizedState!==null,i){l=t.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var g=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)}return i!==e&&i&&(t.child.flags|=8192),Go(t,t.updateQueue),Xt(t),null;case 4:return Et(),e===null&&tf(t.stateNode.containerInfo),Xt(t),null;case 10:return va(t.type),Xt(t),null;case 19:if(Ee(gr),f=t.memoizedState,f===null)return Xt(t),null;if(l=(t.flags&128)!==0,g=f.rendering,g===null)if(l)yl(f,!1);else{if(er!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=_o(e),g!==null){for(t.flags|=128,yl(f,!1),e=g.updateQueue,t.updateQueue=e,Go(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)ZA(i,e),i=i.sibling;return ke(gr,gr.current&1|2),t.child}e=e.sibling}f.tail!==null&&Fe()>zo&&(t.flags|=128,l=!0,yl(f,!1),t.lanes=4194304)}else{if(!l)if(e=_o(g),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Go(t,e),yl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!It)return Xt(t),null}else 2*Fe()-f.renderingStartTime>zo&&i!==536870912&&(t.flags|=128,l=!0,yl(f,!1),t.lanes=4194304);f.isBackwards?(g.sibling=t.child,t.child=g):(e=f.last,e!==null?e.sibling=g:t.child=g,f.last=g)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Fe(),t.sibling=null,e=gr.current,ke(gr,l?e&1|2:e&1),t):(Xt(t),null);case 22:case 23:return Ca(t),nd(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(Xt(t),t.subtreeFlags&6&&(t.flags|=8192)):Xt(t),i=t.updateQueue,i!==null&&Go(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&Ee(Hi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),va(hr),Xt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function NE(e,t){switch(Vc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(hr),Et(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nr(t),null;case 13:if(Ca(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(gr),null;case 4:return Et(),null;case 10:return va(t.type),null;case 22:case 23:return Ca(t),nd(),e!==null&&Ee(Hi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(hr),null;case 25:return null;default:return null}}function Bg(e,t){switch(Vc(t),t.tag){case 3:va(hr),Et();break;case 26:case 27:case 5:Nr(t);break;case 4:Et();break;case 13:Ca(t);break;case 19:Ee(gr);break;case 10:va(t.type);break;case 22:case 23:Ca(t),nd(),e!==null&&Ee(Hi);break;case 24:va(hr)}}function El(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&e)===e){l=void 0;var g=i.create,C=i.inst;l=g(),C.destroy=l}i=i.next}while(i!==f)}}catch(L){Mt(t,t.return,L)}}function Za(e,t,i){try{var l=t.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&e)===e){var C=l.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,f=t;var z=i,ce=L;try{ce()}catch(ve){Mt(f,z,ve)}}}l=l.next}while(l!==g)}}catch(ve){Mt(t,t.return,ve)}}function Sg(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{hh(t,i)}catch(l){Mt(e,e.return,l)}}}function Ng(e,t,i){i.props=Vi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){Mt(e,t,l)}}function bl(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(f){Mt(e,t,f)}}function ea(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){Mt(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Mt(e,t,f)}else i.current=null}function Tg(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){Mt(e,e.return,f)}}function Dd(e,t,i){try{var l=e.stateNode;JE(l,e.type,i,t),l[dr]=t}catch(f){Mt(e,e.return,f)}}function Qg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&li(e.type)||e.tag===4}function Rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&li(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kd(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=eu));else if(l!==4&&(l===27&&li(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(kd(e,t,i),e=e.sibling;e!==null;)kd(e,t,i),e=e.sibling}function Vo(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&li(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Vo(e,t,i),e=e.sibling;e!==null;)Vo(e,t,i),e=e.sibling}function Dg(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);Rr(t,l,i),t[_t]=e,t[dr]=i}catch(g){Mt(e,e.return,g)}}var Ba=!1,ir=!1,Ld=!1,Rg=typeof WeakSet=="function"?WeakSet:Set,wr=null;function TE(e,t){if(e=e.containerInfo,af=lu,e=VA(e),Rc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var C=0,L=-1,z=-1,ce=0,ve=0,Se=e,de=null;t:for(;;){for(var Ae;Se!==i||f!==0&&Se.nodeType!==3||(L=C+f),Se!==g||l!==0&&Se.nodeType!==3||(z=C+l),Se.nodeType===3&&(C+=Se.nodeValue.length),(Ae=Se.firstChild)!==null;)de=Se,Se=Ae;for(;;){if(Se===e)break t;if(de===i&&++ce===f&&(L=C),de===g&&++ve===l&&(z=C),(Ae=Se.nextSibling)!==null)break;Se=de,de=Se.parentNode}Se=Ae}i=L===-1||z===-1?null:{start:L,end:z}}else i=null}i=i||{start:0,end:0}}else i=null;for(sf={focusedElem:e,selectionRange:i},lu=!1,wr=t;wr!==null;)if(t=wr,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,wr=e;else for(;wr!==null;){switch(t=wr,g=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,i=t,f=g.memoizedProps,g=g.memoizedState,l=i.stateNode;try{var rt=Vi(i.type,f,i.elementType===i.type);e=l.getSnapshotBeforeUpdate(rt,g),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ze){Mt(i,i.return,Ze)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)uf(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":uf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,wr=e;break}wr=t.return}}function kg(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ei(e,i),l&4&&El(5,i);break;case 1:if(ei(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(C){Mt(i,i.return,C)}else{var f=Vi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(C){Mt(i,i.return,C)}}l&64&&Sg(i),l&512&&bl(i,i.return);break;case 3:if(ei(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{hh(e,t)}catch(C){Mt(i,i.return,C)}}break;case 27:t===null&&l&4&&Dg(i);case 26:case 5:ei(e,i),t===null&&l&4&&Tg(i),l&512&&bl(i,i.return);break;case 12:ei(e,i);break;case 13:ei(e,i),l&4&&Mg(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=OE.bind(null,i),rb(e,i))));break;case 22:if(l=i.memoizedState!==null||Ba,!l){t=t!==null&&t.memoizedState!==null||ir,f=Ba;var g=ir;Ba=l,(ir=t)&&!g?ti(e,i,(i.subtreeFlags&8772)!==0):ei(e,i),Ba=f,ir=g}break;case 30:break;default:ei(e,i)}}function Lg(e){var t=e.alternate;t!==null&&(e.alternate=null,Lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var zt=null,en=!1;function Sa(e,t,i){for(i=i.child;i!==null;)Ug(e,t,i),i=i.sibling}function Ug(e,t,i){if(S&&typeof S.onCommitFiberUnmount=="function")try{S.onCommitFiberUnmount(Ve,i)}catch{}switch(i.tag){case 26:ir||ea(i,t),Sa(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ir||ea(i,t);var l=zt,f=en;li(i.type)&&(zt=i.stateNode,en=!1),Sa(e,t,i),Tl(i.stateNode),zt=l,en=f;break;case 5:ir||ea(i,t);case 6:if(l=zt,f=en,zt=null,Sa(e,t,i),zt=l,en=f,zt!==null)if(en)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(i.stateNode)}catch(g){Mt(i,t,g)}else try{zt.removeChild(i.stateNode)}catch(g){Mt(i,t,g)}break;case 18:zt!==null&&(en?(e=zt,C0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),_l(e)):C0(zt,i.stateNode));break;case 4:l=zt,f=en,zt=i.stateNode.containerInfo,en=!0,Sa(e,t,i),zt=l,en=f;break;case 0:case 11:case 14:case 15:ir||Za(2,i,t),ir||Za(4,i,t),Sa(e,t,i);break;case 1:ir||(ea(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Ng(i,t,l)),Sa(e,t,i);break;case 21:Sa(e,t,i);break;case 22:ir=(l=ir)||i.memoizedState!==null,Sa(e,t,i),ir=l;break;default:Sa(e,t,i)}}function Mg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_l(e)}catch(i){Mt(t,t.return,i)}}function QE(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Rg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Rg),t;default:throw Error(s(435,e.tag))}}function Ud(e,t){var i=QE(e);t.forEach(function(l){var f=FE.bind(null,e,l);i.has(l)||(i.add(l),l.then(f,f))})}function fn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],g=e,C=t,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(li(L.type)){zt=L.stateNode,en=!1;break e}break;case 5:zt=L.stateNode,en=!1;break e;case 3:case 4:zt=L.stateNode.containerInfo,en=!0;break e}L=L.return}if(zt===null)throw Error(s(160));Ug(g,C,f),zt=null,en=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)_g(t,e),t=t.sibling}var Fn=null;function _g(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fn(t,e),An(e),l&4&&(Za(3,e,e.return),El(3,e),Za(5,e,e.return));break;case 1:fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),l&64&&Ba&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=Fn;if(fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),l&4){var g=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[En]||g[_t]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),Rr(g,l,i),g[_t]=e,Gt(g),l=g;break e;case"link":var C=D0("link","href",f).get(l+(i.href||""));if(C){for(var L=0;L<C.length;L++)if(g=C[L],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){C.splice(L,1);break t}}g=f.createElement(l),Rr(g,l,i),f.head.appendChild(g);break;case"meta":if(C=D0("meta","content",f).get(l+(i.content||""))){for(L=0;L<C.length;L++)if(g=C[L],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){C.splice(L,1);break t}}g=f.createElement(l),Rr(g,l,i),f.head.appendChild(g);break;default:throw Error(s(468,l))}g[_t]=e,Gt(g),l=g}e.stateNode=l}else R0(f,e.type,e.stateNode);else e.stateNode=Q0(f,l,e.memoizedProps);else g!==l?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,l===null?R0(f,e.type,e.stateNode):Q0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Dd(e,e.memoizedProps,i.memoizedProps)}break;case 27:fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),i!==null&&l&4&&Dd(e,e.memoizedProps,i.memoizedProps);break;case 5:if(fn(t,e),An(e),l&512&&(ir||i===null||ea(i,i.return)),e.flags&32){f=e.stateNode;try{Cn(f,"")}catch(Ae){Mt(e,e.return,Ae)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,Dd(e,f,i!==null?i.memoizedProps:f)),l&1024&&(Ld=!0);break;case 6:if(fn(t,e),An(e),l&4){if(e.stateNode===null)throw Error(s(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ae){Mt(e,e.return,Ae)}}break;case 3:if(au=null,f=Fn,Fn=ru(t.containerInfo),fn(t,e),Fn=f,An(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{_l(t.containerInfo)}catch(Ae){Mt(e,e.return,Ae)}Ld&&(Ld=!1,Og(e));break;case 4:l=Fn,Fn=ru(e.stateNode.containerInfo),fn(t,e),An(e),Fn=l;break;case 12:fn(t,e),An(e);break;case 13:fn(t,e),An(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Hd=Fe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ud(e,l)));break;case 22:f=e.memoizedState!==null;var z=i!==null&&i.memoizedState!==null,ce=Ba,ve=ir;if(Ba=ce||f,ir=ve||z,fn(t,e),ir=ve,Ba=ce,An(e),l&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(i===null||z||Ba||ir||qi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){z=i=t;try{if(g=z.stateNode,f)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=z.stateNode;var Se=z.memoizedProps.style,de=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;L.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Ae){Mt(z,z.return,Ae)}}}else if(t.tag===6){if(i===null){z=t;try{z.stateNode.nodeValue=f?"":z.memoizedProps}catch(Ae){Mt(z,z.return,Ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Ud(e,i))));break;case 19:fn(t,e),An(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ud(e,l)));break;case 30:break;case 21:break;default:fn(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Qg(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var f=i.stateNode,g=Rd(e);Vo(e,g,f);break;case 5:var C=i.stateNode;i.flags&32&&(Cn(C,""),i.flags&=-33);var L=Rd(e);Vo(e,L,C);break;case 3:case 4:var z=i.stateNode.containerInfo,ce=Rd(e);kd(e,ce,z);break;default:throw Error(s(161))}}catch(ve){Mt(e,e.return,ve)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Og(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Og(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ei(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kg(e,t.alternate,t),t=t.sibling}function qi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Za(4,t,t.return),qi(t);break;case 1:ea(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Ng(t,t.return,i),qi(t);break;case 27:Tl(t.stateNode);case 26:case 5:ea(t,t.return),qi(t);break;case 22:t.memoizedState===null&&qi(t);break;case 30:qi(t);break;default:qi(t)}e=e.sibling}}function ti(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,f=e,g=t,C=g.flags;switch(g.tag){case 0:case 11:case 15:ti(f,g,i),El(4,g);break;case 1:if(ti(f,g,i),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ce){Mt(l,l.return,ce)}if(l=g,f=l.updateQueue,f!==null){var L=l.stateNode;try{var z=f.shared.hiddenCallbacks;if(z!==null)for(f.shared.hiddenCallbacks=null,f=0;f<z.length;f++)Ah(z[f],L)}catch(ce){Mt(l,l.return,ce)}}i&&C&64&&Sg(g),bl(g,g.return);break;case 27:Dg(g);case 26:case 5:ti(f,g,i),i&&l===null&&C&4&&Tg(g),bl(g,g.return);break;case 12:ti(f,g,i);break;case 13:ti(f,g,i),i&&C&4&&Mg(f,g);break;case 22:g.memoizedState===null&&ti(f,g,i),bl(g,g.return);break;case 30:break;default:ti(f,g,i)}t=t.sibling}}function Md(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&il(i))}function _d(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&il(e))}function ta(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fg(e,t,i,l),t=t.sibling}function Fg(e,t,i,l){var f=t.flags;switch(t.tag){case 0:case 11:case 15:ta(e,t,i,l),f&2048&&El(9,t);break;case 1:ta(e,t,i,l);break;case 3:ta(e,t,i,l),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&il(e)));break;case 12:if(f&2048){ta(e,t,i,l),e=t.stateNode;try{var g=t.memoizedProps,C=g.id,L=g.onPostCommit;typeof L=="function"&&L(C,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Mt(t,t.return,z)}}else ta(e,t,i,l);break;case 13:ta(e,t,i,l);break;case 23:break;case 22:g=t.stateNode,C=t.alternate,t.memoizedState!==null?g._visibility&2?ta(e,t,i,l):vl(e,t):g._visibility&2?ta(e,t,i,l):(g._visibility|=2,Cs(e,t,i,l,(t.subtreeFlags&10256)!==0)),f&2048&&Md(C,t);break;case 24:ta(e,t,i,l),f&2048&&_d(t.alternate,t);break;default:ta(e,t,i,l)}}function Cs(e,t,i,l,f){for(f=f&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var g=e,C=t,L=i,z=l,ce=C.flags;switch(C.tag){case 0:case 11:case 15:Cs(g,C,L,z,f),El(8,C);break;case 23:break;case 22:var ve=C.stateNode;C.memoizedState!==null?ve._visibility&2?Cs(g,C,L,z,f):vl(g,C):(ve._visibility|=2,Cs(g,C,L,z,f)),f&&ce&2048&&Md(C.alternate,C);break;case 24:Cs(g,C,L,z,f),f&&ce&2048&&_d(C.alternate,C);break;default:Cs(g,C,L,z,f)}t=t.sibling}}function vl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,f=l.flags;switch(l.tag){case 22:vl(i,l),f&2048&&Md(l.alternate,l);break;case 24:vl(i,l),f&2048&&_d(l.alternate,l);break;default:vl(i,l)}t=t.sibling}}var xl=8192;function ws(e){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)jg(e),e=e.sibling}function jg(e){switch(e.tag){case 26:ws(e),e.flags&xl&&e.memoizedState!==null&&gb(Fn,e.memoizedState,e.memoizedProps);break;case 5:ws(e);break;case 3:case 4:var t=Fn;Fn=ru(e.stateNode.containerInfo),ws(e),Fn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=xl,xl=16777216,ws(e),xl=t):ws(e));break;default:ws(e)}}function Hg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Cl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];wr=l,Vg(l,e)}Hg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gg(e),e=e.sibling}function Gg(e){switch(e.tag){case 0:case 11:case 15:Cl(e),e.flags&2048&&Za(9,e,e.return);break;case 3:Cl(e);break;case 12:Cl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qo(e)):Cl(e);break;default:Cl(e)}}function qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];wr=l,Vg(l,e)}Hg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),qo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,qo(t));break;default:qo(t)}e=e.sibling}}function Vg(e,t){for(;wr!==null;){var i=wr;switch(i.tag){case 0:case 11:case 15:Za(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:il(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,wr=l;else e:for(i=e;wr!==null;){l=wr;var f=l.sibling,g=l.return;if(Lg(l),l===i){wr=null;break e}if(f!==null){f.return=g,wr=f;break e}wr=g}}}var DE={getCacheForType:function(e){var t=Or(hr),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i}},RE=typeof WeakMap=="function"?WeakMap:Map,St=0,Ft=null,mt=null,xt=0,Nt=0,hn=null,ri=!1,Is=!1,Od=!1,Na=0,er=0,ni=0,zi=0,Fd=0,Tn=0,Bs=0,wl=null,tn=null,jd=!1,Hd=0,zo=1/0,Yo=null,ai=null,Dr=0,ii=null,Ss=null,Ns=0,Gd=0,Vd=null,qg=null,Il=0,qd=null;function gn(){if((St&2)!==0&&xt!==0)return xt&-xt;if(K.T!==null){var e=gs;return e!==0?e:$d()}return _a()}function zg(){Tn===0&&(Tn=(xt&536870912)===0||It?es():536870912);var e=Nn.current;return e!==null&&(e.flags|=32),Tn}function mn(e,t,i){(e===Ft&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)&&(Ts(e,0),si(e,xt,Tn,!1)),Pn(e,i),((St&2)===0||e!==Ft)&&(e===Ft&&((St&2)===0&&(zi|=i),er===4&&si(e,xt,Tn,!1)),ra(e))}function Yg(e,t,i){if((St&6)!==0)throw Error(s(327));var l=!i&&(t&124)===0&&(t&e.expiredLanes)===0||bt(e,t),f=l?UE(e,t):Pd(e,t,!0),g=l;do{if(f===0){Is&&!l&&si(e,t,0,!1);break}else{if(i=e.current.alternate,g&&!kE(i)){f=Pd(e,t,!1),g=!1;continue}if(f===2){if(g=t,e.errorRecoveryDisabledLanes&g)var C=0;else C=e.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){t=C;e:{var L=e;f=wl;var z=L.current.memoizedState.isDehydrated;if(z&&(Ts(L,C).flags|=256),C=Pd(L,C,!1),C!==2){if(Od&&!z){L.errorRecoveryDisabledLanes|=g,zi|=g,f=4;break e}g=tn,tn=f,g!==null&&(tn===null?tn=g:tn.push.apply(tn,g))}f=C}if(g=!1,f!==2)continue}}if(f===1){Ts(e,0),si(e,t,0,!0);break}e:{switch(l=e,g=f,g){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:si(l,t,Tn,!ri);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(f=Hd+300-Fe(),10<f)){if(si(l,t,Tn,!ri),ft(l,0,!0)!==0)break e;l.timeoutHandle=v0(Pg.bind(null,l,i,tn,Yo,jd,t,Tn,zi,Bs,ri,g,2,-0,0),f);break e}Pg(l,i,tn,Yo,jd,t,Tn,zi,Bs,ri,g,0,-0,0)}}break}while(!0);ra(e)}function Pg(e,t,i,l,f,g,C,L,z,ce,ve,Se,de,Ae){if(e.timeoutHandle=-1,Se=t.subtreeFlags,(Se&8192||(Se&16785408)===16785408)&&(Rl={stylesheets:null,count:0,unsuspend:hb},jg(t),Se=mb(),Se!==null)){e.cancelPendingCommit=Se(e0.bind(null,e,t,g,i,l,f,C,L,z,ve,1,de,Ae)),si(e,g,C,!ce);return}e0(e,t,g,i,l,f,C,L,z)}function kE(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],g=f.getSnapshot;f=f.value;try{if(!cn(g(),f))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function si(e,t,i,l){t&=~Fd,t&=~zi,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var f=t;0<f;){var g=31-x(f),C=1<<g;l[g]=-1,f&=~C}i!==0&&Me(e,i,t)}function Po(){return(St&6)===0?(Bl(0),!1):!0}function zd(){if(mt!==null){if(Nt===0)var e=mt.return;else e=mt,ba=Fi=null,od(e),vs=null,ml=0,e=mt;for(;e!==null;)Bg(e.alternate,e),e=e.return;mt=null}}function Ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,$E(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),zd(),Ft=e,mt=i=pa(e.current,null),xt=t,Nt=0,hn=null,ri=!1,Is=bt(e,t),Od=!1,Bs=Tn=Fd=zi=ni=er=0,tn=wl=null,jd=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var f=31-x(l),g=1<<f;t|=e[f],l&=~g}return Na=t,go(),i}function Kg(e,t){At=null,K.H=Lo,t===ll||t===wo?(t=dh(),Nt=3):t===oh?(t=dh(),Nt=4):Nt=t===fg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,mt===null&&(er=1,Fo(e,wn(t,e.current)))}function Jg(){var e=K.H;return K.H=Lo,e===null?Lo:e}function Xg(){var e=K.A;return K.A=DE,e}function Yd(){er=4,ri||(xt&4194048)!==xt&&Nn.current!==null||(Is=!0),(ni&134217727)===0&&(zi&134217727)===0||Ft===null||si(Ft,xt,Tn,!1)}function Pd(e,t,i){var l=St;St|=2;var f=Jg(),g=Xg();(Ft!==e||xt!==t)&&(Yo=null,Ts(e,t)),t=!1;var C=er;e:do try{if(Nt!==0&&mt!==null){var L=mt,z=hn;switch(Nt){case 8:zd(),C=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(t=!0);var ce=Nt;if(Nt=0,hn=null,Qs(e,L,z,ce),i&&Is){C=0;break e}break;default:ce=Nt,Nt=0,hn=null,Qs(e,L,z,ce)}}LE(),C=er;break}catch(ve){Kg(e,ve)}while(!0);return t&&e.shellSuspendCounter++,ba=Fi=null,St=l,K.H=f,K.A=g,mt===null&&(Ft=null,xt=0,go()),C}function LE(){for(;mt!==null;)$g(mt)}function UE(e,t){var i=St;St|=2;var l=Jg(),f=Xg();Ft!==e||xt!==t?(Yo=null,zo=Fe()+500,Ts(e,t)):Is=bt(e,t);e:do try{if(Nt!==0&&mt!==null){t=mt;var g=hn;t:switch(Nt){case 1:Nt=0,hn=null,Qs(e,t,g,1);break;case 2:case 9:if(uh(g)){Nt=0,hn=null,Wg(t);break}t=function(){Nt!==2&&Nt!==9||Ft!==e||(Nt=7),ra(e)},g.then(t,t);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:uh(g)?(Nt=0,hn=null,Wg(t)):(Nt=0,hn=null,Qs(e,t,g,7));break;case 5:var C=null;switch(mt.tag){case 26:C=mt.memoizedState;case 5:case 27:var L=mt;if(!C||k0(C)){Nt=0,hn=null;var z=L.sibling;if(z!==null)mt=z;else{var ce=L.return;ce!==null?(mt=ce,Ko(ce)):mt=null}break t}}Nt=0,hn=null,Qs(e,t,g,5);break;case 6:Nt=0,hn=null,Qs(e,t,g,6);break;case 8:zd(),er=6;break e;default:throw Error(s(462))}}ME();break}catch(ve){Kg(e,ve)}while(!0);return ba=Fi=null,K.H=l,K.A=f,St=i,mt!==null?0:(Ft=null,xt=0,go(),er)}function ME(){for(;mt!==null&&!br();)$g(mt)}function $g(e){var t=wg(e.alternate,e,Na);e.memoizedProps=e.pendingProps,t===null?Ko(e):mt=t}function Wg(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=yg(i,t,t.pendingProps,t.type,void 0,xt);break;case 11:t=yg(i,t,t.pendingProps,t.type.render,t.ref,xt);break;case 5:od(t);default:Bg(i,t),t=mt=ZA(t,Na),t=wg(i,t,Na)}e.memoizedProps=e.pendingProps,t===null?Ko(e):mt=t}function Qs(e,t,i,l){ba=Fi=null,od(t),vs=null,ml=0;var f=t.return;try{if(IE(e,f,t,i,xt)){er=1,Fo(e,wn(i,e.current)),mt=null;return}}catch(g){if(f!==null)throw mt=f,g;er=1,Fo(e,wn(i,e.current)),mt=null;return}t.flags&32768?(It||l===1?e=!0:Is||(xt&536870912)!==0?e=!1:(ri=e=!0,(l===2||l===9||l===3||l===6)&&(l=Nn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Zg(t,e)):Ko(t)}function Ko(e){var t=e;do{if((t.flags&32768)!==0){Zg(t,ri);return}e=t.return;var i=SE(t.alternate,t,Na);if(i!==null){mt=i;return}if(t=t.sibling,t!==null){mt=t;return}mt=t=e}while(t!==null);er===0&&(er=5)}function Zg(e,t){do{var i=NE(e.alternate,e);if(i!==null){i.flags&=32767,mt=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){mt=e;return}mt=e=i}while(e!==null);er=6,mt=null}function e0(e,t,i,l,f,g,C,L,z){e.cancelPendingCommit=null;do Jo();while(Dr!==0);if((St&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(g=t.lanes|t.childLanes,g|=_c,ts(e,i,g,C,L,z),e===Ft&&(mt=Ft=null,xt=0),Ss=t,ii=e,Ns=i,Gd=g,Vd=f,qg=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jE(X,function(){return i0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=K.T,K.T=null,f=ie.p,ie.p=2,C=St,St|=4;try{TE(e,t,i)}finally{St=C,ie.p=f,K.T=l}}Dr=1,t0(),r0(),n0()}}function t0(){if(Dr===1){Dr=0;var e=ii,t=Ss,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=K.T,K.T=null;var l=ie.p;ie.p=2;var f=St;St|=4;try{_g(t,e);var g=sf,C=VA(e.containerInfo),L=g.focusedElem,z=g.selectionRange;if(C!==L&&L&&L.ownerDocument&&GA(L.ownerDocument.documentElement,L)){if(z!==null&&Rc(L)){var ce=z.start,ve=z.end;if(ve===void 0&&(ve=ce),"selectionStart"in L)L.selectionStart=ce,L.selectionEnd=Math.min(ve,L.value.length);else{var Se=L.ownerDocument||document,de=Se&&Se.defaultView||window;if(de.getSelection){var Ae=de.getSelection(),rt=L.textContent.length,Ze=Math.min(z.start,rt),Rt=z.end===void 0?Ze:Math.min(z.end,rt);!Ae.extend&&Ze>Rt&&(C=Rt,Rt=Ze,Ze=C);var re=HA(L,Ze),Z=HA(L,Rt);if(re&&Z&&(Ae.rangeCount!==1||Ae.anchorNode!==re.node||Ae.anchorOffset!==re.offset||Ae.focusNode!==Z.node||Ae.focusOffset!==Z.offset)){var ue=Se.createRange();ue.setStart(re.node,re.offset),Ae.removeAllRanges(),Ze>Rt?(Ae.addRange(ue),Ae.extend(Z.node,Z.offset)):(ue.setEnd(Z.node,Z.offset),Ae.addRange(ue))}}}}for(Se=[],Ae=L;Ae=Ae.parentNode;)Ae.nodeType===1&&Se.push({element:Ae,left:Ae.scrollLeft,top:Ae.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Se.length;L++){var Ce=Se[L];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}lu=!!af,sf=af=null}finally{St=f,ie.p=l,K.T=i}}e.current=t,Dr=2}}function r0(){if(Dr===2){Dr=0;var e=ii,t=Ss,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=K.T,K.T=null;var l=ie.p;ie.p=2;var f=St;St|=4;try{kg(e,t.alternate,t)}finally{St=f,ie.p=l,K.T=i}}Dr=3}}function n0(){if(Dr===4||Dr===3){Dr=0,Qe();var e=ii,t=Ss,i=Ns,l=qg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dr=5:(Dr=0,Ss=ii=null,a0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ai=null),vr(i),t=t.stateNode,S&&typeof S.onCommitFiberRoot=="function")try{S.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=K.T,f=ie.p,ie.p=2,K.T=null;try{for(var g=e.onRecoverableError,C=0;C<l.length;C++){var L=l[C];g(L.value,{componentStack:L.stack})}}finally{K.T=t,ie.p=f}}(Ns&3)!==0&&Jo(),ra(e),f=e.pendingLanes,(i&4194090)!==0&&(f&42)!==0?e===qd?Il++:(Il=0,qd=e):Il=0,Bl(0)}}function a0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,il(t)))}function Jo(e){return t0(),r0(),n0(),i0()}function i0(){if(Dr!==5)return!1;var e=ii,t=Gd;Gd=0;var i=vr(Ns),l=K.T,f=ie.p;try{ie.p=32>i?32:i,K.T=null,i=Vd,Vd=null;var g=ii,C=Ns;if(Dr=0,Ss=ii=null,Ns=0,(St&6)!==0)throw Error(s(331));var L=St;if(St|=4,Gg(g.current),Fg(g,g.current,C,i),St=L,Bl(0,!1),S&&typeof S.onPostCommitFiberRoot=="function")try{S.onPostCommitFiberRoot(Ve,g)}catch{}return!0}finally{ie.p=f,K.T=l,a0(e,t)}}function s0(e,t,i){t=wn(i,t),t=xd(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(Pn(e,2),ra(e))}function Mt(e,t,i){if(e.tag===3)s0(e,e,i);else for(;t!==null;){if(t.tag===3){s0(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ai===null||!ai.has(l))){e=wn(i,e),i=cg(2),l=Ja(t,i,2),l!==null&&(dg(i,l,t,e),Pn(l,2),ra(l));break}}t=t.return}}function Kd(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new RE;var f=new Set;l.set(t,f)}else f=l.get(t),f===void 0&&(f=new Set,l.set(t,f));f.has(i)||(Od=!0,f.add(i),e=_E.bind(null,e,t,i),t.then(e,e))}function _E(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ft===e&&(xt&i)===i&&(er===4||er===3&&(xt&62914560)===xt&&300>Fe()-Hd?(St&2)===0&&Ts(e,0):Fd|=i,Bs===xt&&(Bs=0)),ra(e)}function l0(e,t){t===0&&(t=sn()),e=ds(e,t),e!==null&&(Pn(e,t),ra(e))}function OE(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),l0(e,i)}function FE(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),l0(e,i)}function jE(e,t){return Ht(e,t)}var Xo=null,Ds=null,Jd=!1,$o=!1,Xd=!1,Yi=0;function ra(e){e!==Ds&&e.next===null&&(Ds===null?Xo=Ds=e:Ds=Ds.next=e),$o=!0,Jd||(Jd=!0,GE())}function Bl(e,t){if(!Xd&&$o){Xd=!0;do for(var i=!1,l=Xo;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var C=l.suspendedLanes,L=l.pingedLanes;g=(1<<31-x(42|e)+1)-1,g&=f&~(C&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,d0(l,g))}else g=xt,g=ft(l,l===Ft?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(g&3)===0||bt(l,g)||(i=!0,d0(l,g));l=l.next}while(i);Xd=!1}}function HE(){o0()}function o0(){$o=Jd=!1;var e=0;Yi!==0&&(XE()&&(e=Yi),Yi=0);for(var t=Fe(),i=null,l=Xo;l!==null;){var f=l.next,g=u0(l,t);g===0?(l.next=null,i===null?Xo=f:i.next=f,f===null&&(Ds=i)):(i=l,(e!==0||(g&3)!==0)&&($o=!0)),l=f}Bl(e)}function u0(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var C=31-x(g),L=1<<C,z=f[C];z===-1?((L&i)===0||(L&l)!==0)&&(f[C]=ot(L,t)):z<=t&&(e.expiredLanes|=L),g&=~L}if(t=Ft,i=xt,i=ft(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&jt(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||bt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&jt(l),vr(i)){case 2:case 8:i=j;break;case 32:i=X;break;case 268435456:i=Te;break;default:i=X}return l=c0.bind(null,e),i=Ht(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&jt(l),e.callbackPriority=2,e.callbackNode=null,2}function c0(e,t){if(Dr!==0&&Dr!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Jo()&&e.callbackNode!==i)return null;var l=xt;return l=ft(e,e===Ft?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Yg(e,l,t),u0(e,Fe()),e.callbackNode!=null&&e.callbackNode===i?c0.bind(null,e):null)}function d0(e,t){if(Jo())return null;Yg(e,t,!0)}function GE(){WE(function(){(St&6)!==0?Ht(lt,HE):o0()})}function $d(){return Yi===0&&(Yi=es()),Yi}function f0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ie(""+e)}function A0(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function VE(e,t,i,l,f){if(t==="submit"&&i&&i.stateNode===f){var g=f0((f[dr]||null).action),C=l.submitter;C&&(t=(t=C[dr]||null)?f0(t.formAction):C.getAttribute("formAction"),t!==null&&(g=t,C=null));var L=new st("action","action",null,l,f);e.push({event:L,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Yi!==0){var z=C?A0(f,C):new FormData(f);pd(i,{pending:!0,data:z,method:f.method,action:g},null,z)}}else typeof g=="function"&&(L.preventDefault(),z=C?A0(f,C):new FormData(f),pd(i,{pending:!0,data:z,method:f.method,action:g},g,z))},currentTarget:f}]})}}for(var Wd=0;Wd<Mc.length;Wd++){var Zd=Mc[Wd],qE=Zd.toLowerCase(),zE=Zd[0].toUpperCase()+Zd.slice(1);On(qE,"on"+zE)}On(YA,"onAnimationEnd"),On(PA,"onAnimationIteration"),On(KA,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(oE,"onTransitionRun"),On(uE,"onTransitionStart"),On(cE,"onTransitionCancel"),On(JA,"onTransitionEnd"),fr("onMouseEnter",["mouseout","mouseover"]),fr("onMouseLeave",["mouseout","mouseover"]),fr("onPointerEnter",["pointerout","pointerover"]),fr("onPointerLeave",["pointerout","pointerover"]),Un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Un("onBeforeInput",["compositionend","keypress","textInput","paste"]),Un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),YE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sl));function h0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],f=l.event;l=l.listeners;e:{var g=void 0;if(t)for(var C=l.length-1;0<=C;C--){var L=l[C],z=L.instance,ce=L.currentTarget;if(L=L.listener,z!==g&&f.isPropagationStopped())break e;g=L,f.currentTarget=ce;try{g(f)}catch(ve){Oo(ve)}f.currentTarget=null,g=z}else for(C=0;C<l.length;C++){if(L=l[C],z=L.instance,ce=L.currentTarget,L=L.listener,z!==g&&f.isPropagationStopped())break e;g=L,f.currentTarget=ce;try{g(f)}catch(ve){Oo(ve)}f.currentTarget=null,g=z}}}}function pt(e,t){var i=t[Oa];i===void 0&&(i=t[Oa]=new Set);var l=e+"__bubble";i.has(l)||(g0(t,e,2,!1),i.add(l))}function ef(e,t,i){var l=0;t&&(l|=4),g0(i,e,l,t)}var Wo="_reactListening"+Math.random().toString(36).slice(2);function tf(e){if(!e[Wo]){e[Wo]=!0,Bi.forEach(function(i){i!=="selectionchange"&&(YE.has(i)||ef(i,!1,e),ef(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wo]||(t[Wo]=!0,ef("selectionchange",!1,t))}}function g0(e,t,i,l){switch(F0(t)){case 2:var f=Eb;break;case 8:f=bb;break;default:f=mf}i=f.bind(null,t,i,e),f=void 0,!Vt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(t,i,{capture:!0,passive:f}):e.addEventListener(t,i,!0):f!==void 0?e.addEventListener(t,i,{passive:f}):e.addEventListener(t,i,!1)}function rf(e,t,i,l,f){var g=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var C=l.tag;if(C===3||C===4){var L=l.stateNode.containerInfo;if(L===f)break;if(C===4)for(C=l.return;C!==null;){var z=C.tag;if((z===3||z===4)&&C.stateNode.containerInfo===f)return;C=C.return}for(;L!==null;){if(C=kn(L),C===null)return;if(z=C.tag,z===5||z===6||z===26||z===27){l=g=C;continue e}L=L.parentNode}}l=l.return}Vr(function(){var ce=g,ve=je(i),Se=[];e:{var de=XA.get(e);if(de!==void 0){var Ae=st,rt=e;switch(e){case"keypress":if(U(i)===0)break e;case"keydown":case"keyup":Ae=bc;break;case"focusin":rt="focus",Ae=Js;break;case"focusout":rt="blur",Ae=Js;break;case"beforeblur":case"afterblur":Ae=Js;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ae=lo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ae=oc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ae=xc;break;case YA:case PA:case KA:Ae=dc;break;case JA:Ae=wc;break;case"scroll":case"scrollend":Ae=qt;break;case"wheel":Ae=fo;break;case"copy":case"cut":case"paste":Ae=Ac;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ae=co;break;case"toggle":case"beforetoggle":Ae=Sc}var Ze=(t&4)!==0,Rt=!Ze&&(e==="scroll"||e==="scrollend"),re=Ze?de!==null?de+"Capture":null:de;Ze=[];for(var Z=ce,ue;Z!==null;){var Ce=Z;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||re===null||(Ce=ln(Z,re),Ce!=null&&Ze.push(Nl(Z,Ce,ue))),Rt)break;Z=Z.return}0<Ze.length&&(de=new Ae(de,rt,null,i,ve),Se.push({event:de,listeners:Ze}))}}if((t&7)===0){e:{if(de=e==="mouseover"||e==="pointerover",Ae=e==="mouseout"||e==="pointerout",de&&i!==Ue&&(rt=i.relatedTarget||i.fromElement)&&(kn(rt)||rt[Jt]))break e;if((Ae||de)&&(de=ve.window===ve?ve:(de=ve.ownerDocument)?de.defaultView||de.parentWindow:window,Ae?(rt=i.relatedTarget||i.toElement,Ae=ce,rt=rt?kn(rt):null,rt!==null&&(Rt=u(rt),Ze=rt.tag,rt!==Rt||Ze!==5&&Ze!==27&&Ze!==6)&&(rt=null)):(Ae=null,rt=ce),Ae!==rt)){if(Ze=lo,Ce="onMouseLeave",re="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Ze=co,Ce="onPointerLeave",re="onPointerEnter",Z="pointer"),Rt=Ae==null?de:Gr(Ae),ue=rt==null?de:Gr(rt),de=new Ze(Ce,Z+"leave",Ae,i,ve),de.target=Rt,de.relatedTarget=ue,Ce=null,kn(ve)===ce&&(Ze=new Ze(re,Z+"enter",rt,i,ve),Ze.target=ue,Ze.relatedTarget=Rt,Ce=Ze),Rt=Ce,Ae&&rt)t:{for(Ze=Ae,re=rt,Z=0,ue=Ze;ue;ue=Rs(ue))Z++;for(ue=0,Ce=re;Ce;Ce=Rs(Ce))ue++;for(;0<Z-ue;)Ze=Rs(Ze),Z--;for(;0<ue-Z;)re=Rs(re),ue--;for(;Z--;){if(Ze===re||re!==null&&Ze===re.alternate)break t;Ze=Rs(Ze),re=Rs(re)}Ze=null}else Ze=null;Ae!==null&&m0(Se,de,Ae,Ze,!1),rt!==null&&Rt!==null&&m0(Se,Rt,rt,Ze,!0)}}e:{if(de=ce?Gr(ce):window,Ae=de.nodeName&&de.nodeName.toLowerCase(),Ae==="select"||Ae==="input"&&de.type==="file")var Ye=UA;else if(_r(de))if(MA)Ye=iE;else{Ye=nE;var ht=rE}else Ae=de.nodeName,!Ae||Ae.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ce&&F(ce.elementType)&&(Ye=UA):Ye=aE;if(Ye&&(Ye=Ye(e,ce))){Wr(Se,Ye,i,ve);break e}ht&&ht(e,de,ce),e==="focusout"&&ce&&de.type==="number"&&ce.memoizedProps.value!=null&&ha(de,"number",de.value)}switch(ht=ce?Gr(ce):window,e){case"focusin":(_r(ht)||ht.contentEditable==="true")&&(os=ht,kc=ce,el=null);break;case"focusout":el=kc=os=null;break;case"mousedown":Lc=!0;break;case"contextmenu":case"mouseup":case"dragend":Lc=!1,qA(Se,i,ve);break;case"selectionchange":if(lE)break;case"keydown":case"keyup":qA(Se,i,ve)}var Je;if(qa)e:{switch(e){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else et?ze(e,i)&&(tt="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(tt="onCompositionStart");tt&&(Ws&&i.locale!=="ko"&&(et||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&et&&(Je=w()):(nr=ve,h="value"in nr?nr.value:nr.textContent,et=!0)),ht=Zo(ce,tt),0<ht.length&&(tt=new Xs(tt,e,null,i,ve),Se.push({event:tt,listeners:ht}),Je?tt.data=Je:(Je=$e(i),Je!==null&&(tt.data=Je)))),(Je=Ao?wt(e,i):on(e,i))&&(tt=Zo(ce,"onBeforeInput"),0<tt.length&&(ht=new Xs("onBeforeInput","beforeinput",null,i,ve),Se.push({event:ht,listeners:tt}),ht.data=Je)),VE(Se,e,ce,i,ve)}h0(Se,t)})}function Nl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Zo(e,t){for(var i=t+"Capture",l=[];e!==null;){var f=e,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=ln(e,i),f!=null&&l.unshift(Nl(e,f,g)),f=ln(e,t),f!=null&&l.push(Nl(e,f,g))),e.tag===3)return l;e=e.return}return[]}function Rs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function m0(e,t,i,l,f){for(var g=t._reactName,C=[];i!==null&&i!==l;){var L=i,z=L.alternate,ce=L.stateNode;if(L=L.tag,z!==null&&z===l)break;L!==5&&L!==26&&L!==27||ce===null||(z=ce,f?(ce=ln(i,g),ce!=null&&C.unshift(Nl(i,ce,z))):f||(ce=ln(i,g),ce!=null&&C.push(Nl(i,ce,z)))),i=i.return}C.length!==0&&e.push({event:t,listeners:C})}var PE=/\r\n?/g,KE=/\u0000|\uFFFD/g;function p0(e){return(typeof e=="string"?e:""+e).replace(PE,`
`).replace(KE,"")}function y0(e,t){return t=p0(t),p0(e)===t}function eu(){}function Dt(e,t,i,l,f,g){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Cn(e,""+l);break;case"className":Aa(e,"class",l);break;case"tabIndex":Aa(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Aa(e,i,l);break;case"style":D(e,l,g);break;case"data":if(t!=="object"){Aa(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Ie(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(i==="formAction"?(t!=="input"&&Dt(e,t,"name",f.name,f,null),Dt(e,t,"formEncType",f.formEncType,f,null),Dt(e,t,"formMethod",f.formMethod,f,null),Dt(e,t,"formTarget",f.formTarget,f,null)):(Dt(e,t,"encType",f.encType,f,null),Dt(e,t,"method",f.method,f,null),Dt(e,t,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Ie(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=eu);break;case"onScroll":l!=null&&pt("scroll",e);break;case"onScrollEnd":l!=null&&pt("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Ie(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":pt("beforetoggle",e),pt("toggle",e),bn(e,"popover",l);break;case"xlinkActuate":Ur(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ur(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ur(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ur(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ur(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ur(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ur(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ur(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ur(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":bn(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=ee.get(i)||i,bn(e,i,l))}}function nf(e,t,i,l,f,g){switch(i){case"style":D(e,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Cn(e,l):(typeof l=="number"||typeof l=="bigint")&&Cn(e,""+l);break;case"onScroll":l!=null&&pt("scroll",e);break;case"onScrollEnd":l!=null&&pt("scrollend",e);break;case"onClick":l!=null&&(e.onclick=eu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fa.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),t=i.slice(2,f?i.length-7:void 0),g=e[dr]||null,g=g!=null?g[i]:null,typeof g=="function"&&e.removeEventListener(t,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,f);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):bn(e,i,l)}}}function Rr(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pt("error",e),pt("load",e);var l=!1,f=!1,g;for(g in i)if(i.hasOwnProperty(g)){var C=i[g];if(C!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Dt(e,t,g,C,i,null)}}f&&Dt(e,t,"srcSet",i.srcSet,i,null),l&&Dt(e,t,"src",i.src,i,null);return;case"input":pt("invalid",e);var L=g=C=f=null,z=null,ce=null;for(l in i)if(i.hasOwnProperty(l)){var ve=i[l];if(ve!=null)switch(l){case"name":f=ve;break;case"type":C=ve;break;case"checked":z=ve;break;case"defaultChecked":ce=ve;break;case"value":g=ve;break;case"defaultValue":L=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,t));break;default:Dt(e,t,l,ve,i,null)}}$n(e,g,L,z,ce,C,f,!1),_n(e);return;case"select":pt("invalid",e),l=C=g=null;for(f in i)if(i.hasOwnProperty(f)&&(L=i[f],L!=null))switch(f){case"value":g=L;break;case"defaultValue":C=L;break;case"multiple":l=L;default:Dt(e,t,f,L,i,null)}t=g,i=C,e.multiple=!!l,t!=null?xn(e,!!l,t,!1):i!=null&&xn(e,!!l,i,!0);return;case"textarea":pt("invalid",e),g=f=l=null;for(C in i)if(i.hasOwnProperty(C)&&(L=i[C],L!=null))switch(C){case"value":l=L;break;case"defaultValue":f=L;break;case"children":g=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:Dt(e,t,C,L,i,null)}Ti(e,l,f,g),_n(e);return;case"option":for(z in i)if(i.hasOwnProperty(z)&&(l=i[z],l!=null))switch(z){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Dt(e,t,z,l,i,null)}return;case"dialog":pt("beforetoggle",e),pt("toggle",e),pt("cancel",e),pt("close",e);break;case"iframe":case"object":pt("load",e);break;case"video":case"audio":for(l=0;l<Sl.length;l++)pt(Sl[l],e);break;case"image":pt("error",e),pt("load",e);break;case"details":pt("toggle",e);break;case"embed":case"source":case"link":pt("error",e),pt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in i)if(i.hasOwnProperty(ce)&&(l=i[ce],l!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Dt(e,t,ce,l,i,null)}return;default:if(F(t)){for(ve in i)i.hasOwnProperty(ve)&&(l=i[ve],l!==void 0&&nf(e,t,ve,l,i,void 0));return}}for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null&&Dt(e,t,L,l,i,null))}function JE(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,C=null,L=null,z=null,ce=null,ve=null;for(Ae in i){var Se=i[Ae];if(i.hasOwnProperty(Ae)&&Se!=null)switch(Ae){case"checked":break;case"value":break;case"defaultValue":z=Se;default:l.hasOwnProperty(Ae)||Dt(e,t,Ae,null,l,Se)}}for(var de in l){var Ae=l[de];if(Se=i[de],l.hasOwnProperty(de)&&(Ae!=null||Se!=null))switch(de){case"type":g=Ae;break;case"name":f=Ae;break;case"checked":ce=Ae;break;case"defaultChecked":ve=Ae;break;case"value":C=Ae;break;case"defaultValue":L=Ae;break;case"children":case"dangerouslySetInnerHTML":if(Ae!=null)throw Error(s(137,t));break;default:Ae!==Se&&Dt(e,t,de,Ae,l,Se)}}Ni(e,C,L,z,ce,ve,g,f);return;case"select":Ae=C=L=de=null;for(g in i)if(z=i[g],i.hasOwnProperty(g)&&z!=null)switch(g){case"value":break;case"multiple":Ae=z;default:l.hasOwnProperty(g)||Dt(e,t,g,null,l,z)}for(f in l)if(g=l[f],z=i[f],l.hasOwnProperty(f)&&(g!=null||z!=null))switch(f){case"value":de=g;break;case"defaultValue":L=g;break;case"multiple":C=g;default:g!==z&&Dt(e,t,f,g,l,z)}t=L,i=C,l=Ae,de!=null?xn(e,!!i,de,!1):!!l!=!!i&&(t!=null?xn(e,!!i,t,!0):xn(e,!!i,i?[]:"",!1));return;case"textarea":Ae=de=null;for(L in i)if(f=i[L],i.hasOwnProperty(L)&&f!=null&&!l.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Dt(e,t,L,null,l,f)}for(C in l)if(f=l[C],g=i[C],l.hasOwnProperty(C)&&(f!=null||g!=null))switch(C){case"value":de=f;break;case"defaultValue":Ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==g&&Dt(e,t,C,f,l,g)}Va(e,de,Ae);return;case"option":for(var rt in i)if(de=i[rt],i.hasOwnProperty(rt)&&de!=null&&!l.hasOwnProperty(rt))switch(rt){case"selected":e.selected=!1;break;default:Dt(e,t,rt,null,l,de)}for(z in l)if(de=l[z],Ae=i[z],l.hasOwnProperty(z)&&de!==Ae&&(de!=null||Ae!=null))switch(z){case"selected":e.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Dt(e,t,z,de,l,Ae)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ze in i)de=i[Ze],i.hasOwnProperty(Ze)&&de!=null&&!l.hasOwnProperty(Ze)&&Dt(e,t,Ze,null,l,de);for(ce in l)if(de=l[ce],Ae=i[ce],l.hasOwnProperty(ce)&&de!==Ae&&(de!=null||Ae!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,t));break;default:Dt(e,t,ce,de,l,Ae)}return;default:if(F(t)){for(var Rt in i)de=i[Rt],i.hasOwnProperty(Rt)&&de!==void 0&&!l.hasOwnProperty(Rt)&&nf(e,t,Rt,void 0,l,de);for(ve in l)de=l[ve],Ae=i[ve],!l.hasOwnProperty(ve)||de===Ae||de===void 0&&Ae===void 0||nf(e,t,ve,de,l,Ae);return}}for(var re in i)de=i[re],i.hasOwnProperty(re)&&de!=null&&!l.hasOwnProperty(re)&&Dt(e,t,re,null,l,de);for(Se in l)de=l[Se],Ae=i[Se],!l.hasOwnProperty(Se)||de===Ae||de==null&&Ae==null||Dt(e,t,Se,de,l,Ae)}var af=null,sf=null;function tu(e){return e.nodeType===9?e:e.ownerDocument}function E0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function b0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function lf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var of=null;function XE(){var e=window.event;return e&&e.type==="popstate"?e===of?!1:(of=e,!0):(of=null,!1)}var v0=typeof setTimeout=="function"?setTimeout:void 0,$E=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,WE=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(e){return x0.resolve(null).then(e).catch(ZE)}:v0;function ZE(e){setTimeout(function(){throw e})}function li(e){return e==="head"}function C0(e,t){var i=t,l=0,f=0;do{var g=i.nextSibling;if(e.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"){if(0<l&&8>l){i=l;var C=e.ownerDocument;if(i&1&&Tl(C.documentElement),i&2&&Tl(C.body),i&4)for(i=C.head,Tl(i),C=i.firstChild;C;){var L=C.nextSibling,z=C.nodeName;C[En]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=L}}if(f===0){e.removeChild(g),_l(t);return}f--}else i==="$"||i==="$?"||i==="$!"?f++:l=i.charCodeAt(0)-48;else l=0;i=g}while(i);_l(t)}function uf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":uf(i),tr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function eb(e,t,i,l){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[En])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function tb(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=jn(e.nextSibling),e===null))return null;return e}function cf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function rb(e,t){var i=e.ownerDocument;if(e.data!=="$?"||i.readyState==="complete")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function jn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var df=null;function w0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}function I0(e,t,i){switch(t=tu(i),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Tl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tr(e)}var Qn=new Map,B0=new Set;function ru(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ta=ie.d;ie.d={f:nb,r:ab,D:ib,C:sb,L:lb,m:ob,X:cb,S:ub,M:db};function nb(){var e=Ta.f(),t=Po();return e||t}function ab(e){var t=Jn(e);t!==null&&t.tag===5&&t.type==="form"?Yh(t):Ta.r(e)}var ks=typeof document>"u"?null:document;function S0(e,t,i){var l=ks;if(l&&typeof t=="string"&&t){var f=Tr(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),B0.has(f)||(B0.add(f),e={rel:e,crossOrigin:i,href:t},l.querySelector(f)===null&&(t=l.createElement("link"),Rr(t,"link",e),Gt(t),l.head.appendChild(t)))}}function ib(e){Ta.D(e),S0("dns-prefetch",e,null)}function sb(e,t){Ta.C(e,t),S0("preconnect",e,t)}function lb(e,t,i){Ta.L(e,t,i);var l=ks;if(l&&e&&t){var f='link[rel="preload"][as="'+Tr(t)+'"]';t==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Tr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Tr(i.imageSizes)+'"]')):f+='[href="'+Tr(e)+'"]';var g=f;switch(t){case"style":g=Ls(e);break;case"script":g=Us(e)}Qn.has(g)||(e=b({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qn.set(g,e),l.querySelector(f)!==null||t==="style"&&l.querySelector(Ql(g))||t==="script"&&l.querySelector(Dl(g))||(t=l.createElement("link"),Rr(t,"link",e),Gt(t),l.head.appendChild(t)))}}function ob(e,t){Ta.m(e,t);var i=ks;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+Tr(l)+'"][href="'+Tr(e)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Us(e)}if(!Qn.has(g)&&(e=b({rel:"modulepreload",href:e},t),Qn.set(g,e),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Dl(g)))return}l=i.createElement("link"),Rr(l,"link",e),Gt(l),i.head.appendChild(l)}}}function ub(e,t,i){Ta.S(e,t,i);var l=ks;if(l&&e){var f=Ln(l).hoistableStyles,g=Ls(e);t=t||"default";var C=f.get(g);if(!C){var L={loading:0,preload:null};if(C=l.querySelector(Ql(g)))L.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qn.get(g))&&ff(e,i);var z=C=l.createElement("link");Gt(z),Rr(z,"link",e),z._p=new Promise(function(ce,ve){z.onload=ce,z.onerror=ve}),z.addEventListener("load",function(){L.loading|=1}),z.addEventListener("error",function(){L.loading|=2}),L.loading|=4,nu(C,t,l)}C={type:"stylesheet",instance:C,count:1,state:L},f.set(g,C)}}}function cb(e,t){Ta.X(e,t);var i=ks;if(i&&e){var l=Ln(i).hoistableScripts,f=Us(e),g=l.get(f);g||(g=i.querySelector(Dl(f)),g||(e=b({src:e,async:!0},t),(t=Qn.get(f))&&Af(e,t),g=i.createElement("script"),Gt(g),Rr(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function db(e,t){Ta.M(e,t);var i=ks;if(i&&e){var l=Ln(i).hoistableScripts,f=Us(e),g=l.get(f);g||(g=i.querySelector(Dl(f)),g||(e=b({src:e,async:!0,type:"module"},t),(t=Qn.get(f))&&Af(e,t),g=i.createElement("script"),Gt(g),Rr(g,"link",e),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function N0(e,t,i,l){var f=(f=Ge.current)?ru(f):null;if(!f)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Ls(i.href),i=Ln(f).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ls(i.href);var g=Ln(f).hoistableStyles,C=g.get(e);if(C||(f=f.ownerDocument||f,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,C),(g=f.querySelector(Ql(e)))&&!g._p&&(C.instance=g,C.state.loading=5),Qn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Qn.set(e,i),g||fb(f,e,i,C.state))),t&&l===null)throw Error(s(528,""));return C}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Us(i),i=Ln(f).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ls(e){return'href="'+Tr(e)+'"'}function Ql(e){return'link[rel="stylesheet"]['+e+"]"}function T0(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function fb(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Rr(t,"link",i),Gt(t),e.head.appendChild(t))}function Us(e){return'[src="'+Tr(e)+'"]'}function Dl(e){return"script[async]"+e}function Q0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Tr(i.href)+'"]');if(l)return t.instance=l,Gt(l),l;var f=b({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Gt(l),Rr(l,"style",f),nu(l,i.precedence,e),t.instance=l;case"stylesheet":f=Ls(i.href);var g=e.querySelector(Ql(f));if(g)return t.state.loading|=4,t.instance=g,Gt(g),g;l=T0(i),(f=Qn.get(f))&&ff(l,f),g=(e.ownerDocument||e).createElement("link"),Gt(g);var C=g;return C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Rr(g,"link",l),t.state.loading|=4,nu(g,i.precedence,e),t.instance=g;case"script":return g=Us(i.src),(f=e.querySelector(Dl(g)))?(t.instance=f,Gt(f),f):(l=i,(f=Qn.get(g))&&(l=b({},i),Af(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Gt(f),Rr(f,"link",l),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,nu(l,i.precedence,e));return t.instance}function nu(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,C=0;C<l.length;C++){var L=l[C];if(L.dataset.precedence===t)g=L;else if(g!==f)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Af(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var au=null;function D0(e,t,i){if(au===null){var l=new Map,f=au=new Map;f.set(i,l)}else f=au,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var g=i[f];if(!(g[En]||g[_t]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(t)||"";C=e+C;var L=l.get(C);L?L.push(g):l.set(C,[g])}}return l}function R0(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Ab(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function k0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Rl=null;function hb(){}function gb(e,t,i){if(Rl===null)throw Error(s(475));var l=Rl;if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var f=Ls(i.href),g=e.querySelector(Ql(f));if(g){e=g._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=iu.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=g,Gt(g);return}g=e.ownerDocument||e,i=T0(i),(f=Qn.get(f))&&ff(i,f),g=g.createElement("link"),Gt(g);var C=g;C._p=new Promise(function(L,z){C.onload=L,C.onerror=z}),Rr(g,"link",i),t.instance=g}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(l.count++,t=iu.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function mb(){if(Rl===null)throw Error(s(475));var e=Rl;return e.stylesheets&&e.count===0&&hf(e,e.stylesheets),0<e.count?function(t){var i=setTimeout(function(){if(e.stylesheets&&hf(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(i)}}:null}function iu(){if(this.count--,this.count===0){if(this.stylesheets)hf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var su=null;function hf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,su=new Map,t.forEach(pb,e),su=null,iu.call(e))}function pb(e,t){if(!(t.state.loading&4)){var i=su.get(e);if(i)var l=i.get(null);else{i=new Map,su.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var C=f[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(i.set(C.dataset.precedence,C),l=C)}l&&i.set(null,l)}f=t.instance,C=f.getAttribute("data-precedence"),g=i.get(C)||l,g===l&&i.set(null,f),i.set(C,f),this.count++,l=iu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var kl={$$typeof:_,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function yb(e,t,i,l,f,g,C,L){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ma(0),this.hiddenUpdates=Ma(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function L0(e,t,i,l,f,g,C,L,z,ce,ve,Se){return e=new yb(e,t,i,C,L,z,ce,Se),t=1,g===!0&&(t|=24),g=dn(3,null,null,t),e.current=g,g.stateNode=e,t=Kc(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:l,isDehydrated:i,cache:t},Wc(g),e}function U0(e){return e?(e=fs,e):fs}function M0(e,t,i,l,f,g){f=U0(f),l.context===null?l.context=f:l.pendingContext=f,l=Ka(t),l.payload={element:i},g=g===void 0?null:g,g!==null&&(l.callback=g),i=Ja(e,l,t),i!==null&&(mn(i,e,t),ul(i,e,t))}function _0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function gf(e,t){_0(e,t),(e=e.alternate)&&_0(e,t)}function O0(e){if(e.tag===13){var t=ds(e,67108864);t!==null&&mn(t,e,67108864),gf(e,67108864)}}var lu=!0;function Eb(e,t,i,l){var f=K.T;K.T=null;var g=ie.p;try{ie.p=2,mf(e,t,i,l)}finally{ie.p=g,K.T=f}}function bb(e,t,i,l){var f=K.T;K.T=null;var g=ie.p;try{ie.p=8,mf(e,t,i,l)}finally{ie.p=g,K.T=f}}function mf(e,t,i,l){if(lu){var f=pf(l);if(f===null)rf(e,t,l,ou,i),j0(e,l);else if(xb(f,e,t,i,l))l.stopPropagation();else if(j0(e,l),t&4&&-1<vb.indexOf(e)){for(;f!==null;){var g=Jn(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=gt(g.pendingLanes);if(C!==0){var L=g;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var z=1<<31-x(C);L.entanglements[1]|=z,C&=~z}ra(g),(St&6)===0&&(zo=Fe()+500,Bl(0))}}break;case 13:L=ds(g,2),L!==null&&mn(L,g,2),Po(),gf(g,2)}if(g=pf(l),g===null&&rf(e,t,l,ou,i),g===f)break;f=g}f!==null&&l.stopPropagation()}else rf(e,t,l,null,i)}}function pf(e){return e=je(e),yf(e)}var ou=null;function yf(e){if(ou=null,e=kn(e),e!==null){var t=u(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=c(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ou=e,null}function F0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nt()){case lt:return 2;case j:return 8;case X:case le:return 32;case Te:return 268435456;default:return 32}default:return 32}}var Ef=!1,oi=null,ui=null,ci=null,Ll=new Map,Ul=new Map,di=[],vb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function j0(e,t){switch(e){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":Ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ul.delete(t.pointerId)}}function Ml(e,t,i,l,f,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},t!==null&&(t=Jn(t),t!==null&&O0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function xb(e,t,i,l,f){switch(t){case"focusin":return oi=Ml(oi,e,t,i,l,f),!0;case"dragenter":return ui=Ml(ui,e,t,i,l,f),!0;case"mouseover":return ci=Ml(ci,e,t,i,l,f),!0;case"pointerover":var g=f.pointerId;return Ll.set(g,Ml(Ll.get(g)||null,e,t,i,l,f)),!0;case"gotpointercapture":return g=f.pointerId,Ul.set(g,Ml(Ul.get(g)||null,e,t,i,l,f)),!0}return!1}function H0(e){var t=kn(e.target);if(t!==null){var i=u(t);if(i!==null){if(t=i.tag,t===13){if(t=c(i),t!==null){e.blockedOn=t,wi(e.priority,function(){if(i.tag===13){var l=gn();l=Ci(l);var f=ds(i,l);f!==null&&mn(f,i,l),gf(i,l)}});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=pf(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Ue=l,i.target.dispatchEvent(l),Ue=null}else return t=Jn(i),t!==null&&O0(t),e.blockedOn=i,!1;t.shift()}return!0}function G0(e,t,i){uu(e)&&i.delete(t)}function Cb(){Ef=!1,oi!==null&&uu(oi)&&(oi=null),ui!==null&&uu(ui)&&(ui=null),ci!==null&&uu(ci)&&(ci=null),Ll.forEach(G0),Ul.forEach(G0)}function cu(e,t){e.blockedOn===t&&(e.blockedOn=null,Ef||(Ef=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Cb)))}var du=null;function V0(e){du!==e&&(du=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){du===e&&(du=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],f=e[t+2];if(typeof l!="function"){if(yf(l||i)===null)continue;break}var g=Jn(i);g!==null&&(e.splice(t,3),t-=3,pd(g,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function _l(e){function t(z){return cu(z,e)}oi!==null&&cu(oi,e),ui!==null&&cu(ui,e),ci!==null&&cu(ci,e),Ll.forEach(t),Ul.forEach(t);for(var i=0;i<di.length;i++){var l=di[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<di.length&&(i=di[0],i.blockedOn===null);)H0(i),i.blockedOn===null&&di.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],g=i[l+1],C=f[dr]||null;if(typeof g=="function")C||V0(i);else if(C){var L=null;if(g&&g.hasAttribute("formAction")){if(f=g,C=g[dr]||null)L=C.formAction;else if(yf(f)!==null)continue}else L=C.action;typeof L=="function"?i[l+1]=L:(i.splice(l,3),l-=3),V0(i)}}}function bf(e){this._internalRoot=e}fu.prototype.render=bf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,l=gn();M0(i,l,e,t,null,null)},fu.prototype.unmount=bf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;M0(e.current,2,null,e,null,null),Po(),t[Jt]=null}};function fu(e){this._internalRoot=e}fu.prototype.unstable_scheduleHydration=function(e){if(e){var t=_a();e={blockedOn:null,target:e,priority:t};for(var i=0;i<di.length&&t!==0&&t<di[i].priority;i++);di.splice(i,0,e),i===0&&H0(e)}};var q0=r.version;if(q0!=="19.1.0")throw Error(s(527,q0,"19.1.0"));ie.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=m(t),e=e!==null?A(e):null,e=e===null?null:e.stateNode,e};var wb={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Au=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Au.isDisabled&&Au.supportsFiber)try{Ve=Au.inject(wb),S=Au}catch{}}return Fl.createRoot=function(e,t){if(!o(e))throw Error(s(299));var i=!1,l="",f=sg,g=lg,C=og,L=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(C=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(L=t.unstable_transitionCallbacks)),t=L0(e,1,!1,null,null,i,l,f,g,C,L,null),e[Jt]=t.current,tf(e),new bf(t)},Fl.hydrateRoot=function(e,t,i){if(!o(e))throw Error(s(299));var l=!1,f="",g=sg,C=lg,L=og,z=null,ce=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(C=i.onCaughtError),i.onRecoverableError!==void 0&&(L=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(z=i.unstable_transitionCallbacks),i.formState!==void 0&&(ce=i.formState)),t=L0(e,1,!0,t,i??null,l,f,g,C,L,z,ce),t.context=U0(null),i=t.current,l=gn(),l=Ci(l),f=Ka(l),f.callback=null,Ja(i,f,l),i=l,t.current.lanes=i,Pn(t,i),ra(t),e[Jt]=t.current,tf(e),new fu(t)},Fl.version="19.1.0",Fl}var em;function _b(){if(em)return xf.exports;em=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),xf.exports=Mb(),xf.exports}var Ob=_b();const Fb=xi(Ob);var M=AA();const pn=xi(M),jb=(n,r,a,s)=>{var u,c,d,m;const o=[a,{code:r,...s||{}}];if((c=(u=n==null?void 0:n.services)==null?void 0:u.logger)!=null&&c.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);Ji(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(m=(d=n==null?void 0:n.services)==null?void 0:d.logger)!=null&&m.warn?n.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},tm={},$f=(n,r,a,s)=>{Ji(a)&&tm[a]||(Ji(a)&&(tm[a]=new Date),jb(n,r,a,s))},Up=(n,r)=>()=>{if(n.isInitialized)r();else{const a=()=>{setTimeout(()=>{n.off("initialized",a)},0),r()};n.on("initialized",a)}},Wf=(n,r,a)=>{n.loadNamespaces(r,Up(n,a))},rm=(n,r,a,s)=>{if(Ji(a)&&(a=[a]),n.options.preload&&n.options.preload.indexOf(r)>-1)return Wf(n,a,s);a.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(r,Up(n,s))},Hb=(n,r,a={})=>!r.languages||!r.languages.length?($f(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(n,{lng:a.lng,precheck:(s,o)=>{var u;if(((u=a.bindI18n)==null?void 0:u.indexOf("languageChanging"))>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!o(s.isLanguageChangingTo,n))return!1}}),Ji=n=>typeof n=="string",Gb=n=>typeof n=="object"&&n!==null,Vb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},zb=n=>qb[n],Yb=n=>n.replace(Vb,zb);let Zf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Yb};const Pb=(n={})=>{Zf={...Zf,...n}},Kb=()=>Zf;let Mp;const Jb=n=>{Mp=n},Xb=()=>Mp,$b={type:"3rdParty",init(n){Pb(n.options.react),Jb(n)}},Wb=M.createContext();class Zb{constructor(){this.usedNamespaces={}}addUsedNamespaces(r){r.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const ev=(n,r)=>{const a=M.useRef();return M.useEffect(()=>{a.current=n},[n,r]),a.current},_p=(n,r,a,s)=>n.getFixedT(r,a,s),tv=(n,r,a,s)=>M.useCallback(_p(n,r,a,s),[n,r,a,s]),Bt=(n,r={})=>{var q,V,ae,ge;const{i18n:a}=r,{i18n:s,defaultNS:o}=M.useContext(Wb)||{},u=a||s||Xb();if(u&&!u.reportNamespaces&&(u.reportNamespaces=new Zb),!u){$f(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const te=(P,$)=>Ji($)?$:Gb($)&&Ji($.defaultValue)?$.defaultValue:Array.isArray(P)?P[P.length-1]:P,J=[te,{},!1];return J.t=te,J.i18n={},J.ready=!1,J}(q=u.options.react)!=null&&q.wait&&$f(u,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...Kb(),...u.options.react,...r},{useSuspense:d,keyPrefix:m}=c;let A=o||((V=u.options)==null?void 0:V.defaultNS);A=Ji(A)?[A]:A||["translation"],(ge=(ae=u.reportNamespaces).addUsedNamespaces)==null||ge.call(ae,A);const b=(u.isInitialized||u.initializedStoreOnce)&&A.every(te=>Hb(te,u,c)),v=tv(u,r.lng||null,c.nsMode==="fallback"?A:A[0],m),B=()=>v,T=()=>_p(u,r.lng||null,c.nsMode==="fallback"?A:A[0],m),[Q,k]=M.useState(B);let R=A.join();r.lng&&(R=`${r.lng}${R}`);const N=ev(R),O=M.useRef(!0);M.useEffect(()=>{const{bindI18n:te,bindI18nStore:J}=c;O.current=!0,!b&&!d&&(r.lng?rm(u,r.lng,A,()=>{O.current&&k(T)}):Wf(u,A,()=>{O.current&&k(T)})),b&&N&&N!==R&&O.current&&k(T);const P=()=>{O.current&&k(T)};return te&&(u==null||u.on(te,P)),J&&(u==null||u.store.on(J,P)),()=>{O.current=!1,u&&(te==null||te.split(" ").forEach($=>u.off($,P))),J&&u&&J.split(" ").forEach($=>u.store.off($,P))}},[u,R]),M.useEffect(()=>{O.current&&b&&k(B)},[u,m,b]);const _=[Q,u,b];if(_.t=Q,_.i18n=u,_.ready=b,b||!b&&!d)return _;throw new Promise(te=>{r.lng?rm(u,r.lng,A,()=>te()):Wf(u,A,()=>te())})};var jl={},nm;function rv(){if(nm)return jl;nm=1,Object.defineProperty(jl,"__esModule",{value:!0}),jl.parse=c,jl.serialize=A;const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,u=(()=>{const B=function(){};return B.prototype=Object.create(null),B})();function c(B,T){const Q=new u,k=B.length;if(k<2)return Q;const R=(T==null?void 0:T.decode)||b;let N=0;do{const O=B.indexOf("=",N);if(O===-1)break;const _=B.indexOf(";",N),q=_===-1?k:_;if(O>q){N=B.lastIndexOf(";",O-1)+1;continue}const V=d(B,N,O),ae=m(B,O,V),ge=B.slice(V,ae);if(Q[ge]===void 0){let te=d(B,O+1,q),J=m(B,q,te);const P=R(B.slice(te,J));Q[ge]=P}N=q+1}while(N<k);return Q}function d(B,T,Q){do{const k=B.charCodeAt(T);if(k!==32&&k!==9)return T}while(++T<Q);return Q}function m(B,T,Q){for(;T>Q;){const k=B.charCodeAt(--T);if(k!==32&&k!==9)return T+1}return Q}function A(B,T,Q){const k=(Q==null?void 0:Q.encode)||encodeURIComponent;if(!n.test(B))throw new TypeError(`argument name is invalid: ${B}`);const R=k(T);if(!r.test(R))throw new TypeError(`argument val is invalid: ${T}`);let N=B+"="+R;if(!Q)return N;if(Q.maxAge!==void 0){if(!Number.isInteger(Q.maxAge))throw new TypeError(`option maxAge is invalid: ${Q.maxAge}`);N+="; Max-Age="+Q.maxAge}if(Q.domain){if(!a.test(Q.domain))throw new TypeError(`option domain is invalid: ${Q.domain}`);N+="; Domain="+Q.domain}if(Q.path){if(!s.test(Q.path))throw new TypeError(`option path is invalid: ${Q.path}`);N+="; Path="+Q.path}if(Q.expires){if(!v(Q.expires)||!Number.isFinite(Q.expires.valueOf()))throw new TypeError(`option expires is invalid: ${Q.expires}`);N+="; Expires="+Q.expires.toUTCString()}if(Q.httpOnly&&(N+="; HttpOnly"),Q.secure&&(N+="; Secure"),Q.partitioned&&(N+="; Partitioned"),Q.priority)switch(typeof Q.priority=="string"?Q.priority.toLowerCase():void 0){case"low":N+="; Priority=Low";break;case"medium":N+="; Priority=Medium";break;case"high":N+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${Q.priority}`)}if(Q.sameSite)switch(typeof Q.sameSite=="string"?Q.sameSite.toLowerCase():Q.sameSite){case!0:case"strict":N+="; SameSite=Strict";break;case"lax":N+="; SameSite=Lax";break;case"none":N+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${Q.sameSite}`)}return N}function b(B){if(B.indexOf("%")===-1)return B;try{return decodeURIComponent(B)}catch{return B}}function v(B){return o.call(B)==="[object Date]"}return jl}rv();var am="popstate";function nv(n={}){function r(o,u){let{pathname:c="/",search:d="",hash:m=""}=Wi(o.location.hash.substring(1));return!c.startsWith("/")&&!c.startsWith(".")&&(c="/"+c),eA("",{pathname:c,search:d,hash:m},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function a(o,u){let c=o.document.querySelector("base"),d="";if(c&&c.getAttribute("href")){let m=o.location.href,A=m.indexOf("#");d=A===-1?m:m.slice(0,A)}return d+"#"+(typeof u=="string"?u:to(u))}function s(o,u){Rn(o.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(u)})`)}return iv(r,a,s,n)}function Pt(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function Rn(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function av(){return Math.random().toString(36).substring(2,10)}function im(n,r){return{usr:n.state,key:n.key,idx:r}}function eA(n,r,a=null,s){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?Wi(r):r,state:a,key:r&&r.key||s||av()}}function to({pathname:n="/",search:r="",hash:a=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function Wi(n){let r={};if(n){let a=n.indexOf("#");a>=0&&(r.hash=n.substring(a),n=n.substring(0,a));let s=n.indexOf("?");s>=0&&(r.search=n.substring(s),n=n.substring(0,s)),n&&(r.pathname=n)}return r}function iv(n,r,a,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,c=o.history,d="POP",m=null,A=b();A==null&&(A=0,c.replaceState({...c.state,idx:A},""));function b(){return(c.state||{idx:null}).idx}function v(){d="POP";let R=b(),N=R==null?null:R-A;A=R,m&&m({action:d,location:k.location,delta:N})}function B(R,N){d="PUSH";let O=eA(k.location,R,N);a&&a(O,R),A=b()+1;let _=im(O,A),q=k.createHref(O);try{c.pushState(_,"",q)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(q)}u&&m&&m({action:d,location:k.location,delta:1})}function T(R,N){d="REPLACE";let O=eA(k.location,R,N);a&&a(O,R),A=b();let _=im(O,A),q=k.createHref(O);c.replaceState(_,"",q),u&&m&&m({action:d,location:k.location,delta:0})}function Q(R){return sv(R)}let k={get action(){return d},get location(){return n(o,c)},listen(R){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(am,v),m=R,()=>{o.removeEventListener(am,v),m=null}},createHref(R){return r(o,R)},createURL:Q,encodeLocation(R){let N=Q(R);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:B,replace:T,go(R){return c.go(R)}};return k}function sv(n,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Pt(a,"No window.location.(origin|href) available to create URL");let s=typeof n=="string"?n:to(n);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function Op(n,r,a="/"){return lv(n,r,a,!1)}function lv(n,r,a,s){let o=typeof r=="string"?Wi(r):r,u=Ua(o.pathname||"/",a);if(u==null)return null;let c=Fp(n);ov(c);let d=null;for(let m=0;d==null&&m<c.length;++m){let A=Ev(u);d=pv(c[m],A,s)}return d}function Fp(n,r=[],a=[],s=""){let o=(u,c,d)=>{let m={relativePath:d===void 0?u.path||"":d,caseSensitive:u.caseSensitive===!0,childrenIndex:c,route:u};m.relativePath.startsWith("/")&&(Pt(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length));let A=La([s,m.relativePath]),b=a.concat(m);u.children&&u.children.length>0&&(Pt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${A}".`),Fp(u.children,r,b,A)),!(u.path==null&&!u.index)&&r.push({path:A,score:gv(A,u.index),routesMeta:b})};return n.forEach((u,c)=>{var d;if(u.path===""||!((d=u.path)!=null&&d.includes("?")))o(u,c);else for(let m of jp(u.path))o(u,c,m)}),r}function jp(n){let r=n.split("/");if(r.length===0)return[];let[a,...s]=r,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let c=jp(s.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),o&&d.push(...c),d.map(m=>n.startsWith("/")&&m===""?"/":m)}function ov(n){n.sort((r,a)=>r.score!==a.score?a.score-r.score:mv(r.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var uv=/^:[\w-]+$/,cv=3,dv=2,fv=1,Av=10,hv=-2,sm=n=>n==="*";function gv(n,r){let a=n.split("/"),s=a.length;return a.some(sm)&&(s+=hv),r&&(s+=dv),a.filter(o=>!sm(o)).reduce((o,u)=>o+(uv.test(u)?cv:u===""?fv:Av),s)}function mv(n,r){return n.length===r.length&&n.slice(0,-1).every((s,o)=>s===r[o])?n[n.length-1]-r[r.length-1]:0}function pv(n,r,a=!1){let{routesMeta:s}=n,o={},u="/",c=[];for(let d=0;d<s.length;++d){let m=s[d],A=d===s.length-1,b=u==="/"?r:r.slice(u.length)||"/",v=Lu({path:m.relativePath,caseSensitive:m.caseSensitive,end:A},b),B=m.route;if(!v&&A&&a&&!s[s.length-1].route.index&&(v=Lu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},b)),!v)return null;Object.assign(o,v.params),c.push({params:o,pathname:La([u,v.pathname]),pathnameBase:Cv(La([u,v.pathnameBase])),route:B}),v.pathnameBase!=="/"&&(u=La([u,v.pathnameBase]))}return c}function Lu(n,r){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[a,s]=yv(n.path,n.caseSensitive,n.end),o=r.match(a);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:s.reduce((A,{paramName:b,isOptional:v},B)=>{if(b==="*"){let Q=d[B]||"";c=u.slice(0,u.length-Q.length).replace(/(.)\/+$/,"$1")}const T=d[B];return v&&!T?A[b]=void 0:A[b]=(T||"").replace(/%2F/g,"/"),A},{}),pathname:u,pathnameBase:c,pattern:n}}function yv(n,r=!1,a=!0){Rn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m)=>(s.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(s.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),s]}function Ev(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Rn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function Ua(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,s=n.charAt(a);return s&&s!=="/"?null:n.slice(a)||"/"}function bv(n,r="/"){let{pathname:a,search:s="",hash:o=""}=typeof n=="string"?Wi(n):n;return{pathname:a?a.startsWith("/")?a:vv(a,r):r,search:wv(s),hash:Iv(o)}}function vv(n,r){let a=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Sf(n,r,a,s){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xv(n){return n.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function hA(n){let r=xv(n);return r.map((a,s)=>s===r.length-1?a.pathname:a.pathnameBase)}function gA(n,r,a,s=!1){let o;typeof n=="string"?o=Wi(n):(o={...n},Pt(!o.pathname||!o.pathname.includes("?"),Sf("?","pathname","search",o)),Pt(!o.pathname||!o.pathname.includes("#"),Sf("#","pathname","hash",o)),Pt(!o.search||!o.search.includes("#"),Sf("#","search","hash",o)));let u=n===""||o.pathname==="",c=u?"/":o.pathname,d;if(c==null)d=a;else{let v=r.length-1;if(!s&&c.startsWith("..")){let B=c.split("/");for(;B[0]==="..";)B.shift(),v-=1;o.pathname=B.join("/")}d=v>=0?r[v]:"/"}let m=bv(o,d),A=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(A||b)&&(m.pathname+="/"),m}var La=n=>n.join("/").replace(/\/\/+/g,"/"),Cv=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),wv=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Iv=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Bv(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var Hp=["POST","PUT","PATCH","DELETE"];new Set(Hp);var Sv=["GET",...Hp];new Set(Sv);var zs=M.createContext(null);zs.displayName="DataRouter";var Wu=M.createContext(null);Wu.displayName="DataRouterState";var Gp=M.createContext({isTransitioning:!1});Gp.displayName="ViewTransition";var Nv=M.createContext(new Map);Nv.displayName="Fetchers";var Tv=M.createContext(null);Tv.displayName="Await";var Vn=M.createContext(null);Vn.displayName="Navigation";var ao=M.createContext(null);ao.displayName="Location";var qn=M.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName="Route";var mA=M.createContext(null);mA.displayName="RouteError";function Qv(n,{relative:r}={}){Pt(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=M.useContext(Vn),{hash:o,pathname:u,search:c}=io(n,{relative:r}),d=u;return a!=="/"&&(d=u==="/"?a:La([a,u])),s.createHref({pathname:d,search:c,hash:o})}function Ys(){return M.useContext(ao)!=null}function zn(){return Pt(Ys(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(ao).location}var Vp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qp(n){M.useContext(Vn).static||M.useLayoutEffect(n)}function kr(){let{isDataRoute:n}=M.useContext(qn);return n?Vv():Dv()}function Dv(){Pt(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let n=M.useContext(zs),{basename:r,navigator:a}=M.useContext(Vn),{matches:s}=M.useContext(qn),{pathname:o}=zn(),u=JSON.stringify(hA(s)),c=M.useRef(!1);return qp(()=>{c.current=!0}),M.useCallback((m,A={})=>{if(Rn(c.current,Vp),!c.current)return;if(typeof m=="number"){a.go(m);return}let b=gA(m,JSON.parse(u),o,A.relative==="path");n==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:La([r,b.pathname])),(A.replace?a.replace:a.push)(b,A.state,A)},[r,a,u,o,n])}M.createContext(null);function pA(){let{matches:n}=M.useContext(qn),r=n[n.length-1];return r?r.params:{}}function io(n,{relative:r}={}){let{matches:a}=M.useContext(qn),{pathname:s}=zn(),o=JSON.stringify(hA(a));return M.useMemo(()=>gA(n,JSON.parse(o),s,r==="path"),[n,o,s,r])}function Rv(n,r){return zp(n,r)}function zp(n,r,a,s){var O;Pt(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o,static:u}=M.useContext(Vn),{matches:c}=M.useContext(qn),d=c[c.length-1],m=d?d.params:{},A=d?d.pathname:"/",b=d?d.pathnameBase:"/",v=d&&d.route;{let _=v&&v.path||"";Yp(A,!v||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${A}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let B=zn(),T;if(r){let _=typeof r=="string"?Wi(r):r;Pt(b==="/"||((O=_.pathname)==null?void 0:O.startsWith(b)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${b}" but pathname "${_.pathname}" was given in the \`location\` prop.`),T=_}else T=B;let Q=T.pathname||"/",k=Q;if(b!=="/"){let _=b.replace(/^\//,"").split("/");k="/"+Q.replace(/^\//,"").split("/").slice(_.length).join("/")}let R=!u&&a&&a.matches&&a.matches.length>0?a.matches:Op(n,{pathname:k});Rn(v||R!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Rn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=_v(R&&R.map(_=>Object.assign({},_,{params:Object.assign({},m,_.params),pathname:La([b,o.encodeLocation?o.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:La([b,o.encodeLocation?o.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),c,a,s);return r&&N?M.createElement(ao.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},N):N}function kv(){let n=Gv(),r=Bv(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",n),c=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:u},"ErrorBoundary")," or"," ",M.createElement("code",{style:u},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},r),a?M.createElement("pre",{style:o},a):null,c)}var Lv=M.createElement(kv,null),Uv=class extends M.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){console.error("React Router caught the following error during render",n,r)}render(){return this.state.error!==void 0?M.createElement(qn.Provider,{value:this.props.routeContext},M.createElement(mA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Mv({routeContext:n,match:r,children:a}){let s=M.useContext(zs);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),M.createElement(qn.Provider,{value:n},a)}function _v(n,r=[],a=null,s=null){if(n==null){if(!a)return null;if(a.errors)n=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)n=a.matches;else return null}let o=n,u=a==null?void 0:a.errors;if(u!=null){let m=o.findIndex(A=>A.route.id&&(u==null?void 0:u[A.route.id])!==void 0);Pt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,d=-1;if(a)for(let m=0;m<o.length;m++){let A=o[m];if((A.route.HydrateFallback||A.route.hydrateFallbackElement)&&(d=m),A.route.id){let{loaderData:b,errors:v}=a,B=A.route.loader&&!b.hasOwnProperty(A.route.id)&&(!v||v[A.route.id]===void 0);if(A.route.lazy||B){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((m,A,b)=>{let v,B=!1,T=null,Q=null;a&&(v=u&&A.route.id?u[A.route.id]:void 0,T=A.route.errorElement||Lv,c&&(d<0&&b===0?(Yp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),B=!0,Q=null):d===b&&(B=!0,Q=A.route.hydrateFallbackElement||null)));let k=r.concat(o.slice(0,b+1)),R=()=>{let N;return v?N=T:B?N=Q:A.route.Component?N=M.createElement(A.route.Component,null):A.route.element?N=A.route.element:N=m,M.createElement(Mv,{match:A,routeContext:{outlet:m,matches:k,isDataRoute:a!=null},children:N})};return a&&(A.route.ErrorBoundary||A.route.errorElement||b===0)?M.createElement(Uv,{location:a.location,revalidation:a.revalidation,component:T,error:v,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):R()},null)}function yA(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ov(n){let r=M.useContext(zs);return Pt(r,yA(n)),r}function Fv(n){let r=M.useContext(Wu);return Pt(r,yA(n)),r}function jv(n){let r=M.useContext(qn);return Pt(r,yA(n)),r}function EA(n){let r=jv(n),a=r.matches[r.matches.length-1];return Pt(a.route.id,`${n} can only be used on routes that contain a unique "id"`),a.route.id}function Hv(){return EA("useRouteId")}function Gv(){var s;let n=M.useContext(mA),r=Fv("useRouteError"),a=EA("useRouteError");return n!==void 0?n:(s=r.errors)==null?void 0:s[a]}function Vv(){let{router:n}=Ov("useNavigate"),r=EA("useNavigate"),a=M.useRef(!1);return qp(()=>{a.current=!0}),M.useCallback(async(o,u={})=>{Rn(a.current,Vp),a.current&&(typeof o=="number"?n.navigate(o):await n.navigate(o,{fromRouteId:r,...u}))},[n,r])}var lm={};function Yp(n,r,a){!r&&!lm[n]&&(lm[n]=!0,Rn(!1,a))}M.memo(qv);function qv({routes:n,future:r,state:a}){return zp(n,void 0,a,r)}function zv({to:n,replace:r,state:a,relative:s}){Pt(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=M.useContext(Vn);Rn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=M.useContext(qn),{pathname:c}=zn(),d=kr(),m=gA(n,hA(u),c,s==="path"),A=JSON.stringify(m);return M.useEffect(()=>{d(JSON.parse(A),{replace:r,state:a,relative:s})},[d,A,s,r,a]),null}function Pp(n){Pt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Yv({basename:n="/",children:r=null,location:a,navigationType:s="POP",navigator:o,static:u=!1}){Pt(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=n.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:c,navigator:o,static:u,future:{}}),[c,o,u]);typeof a=="string"&&(a=Wi(a));let{pathname:m="/",search:A="",hash:b="",state:v=null,key:B="default"}=a,T=M.useMemo(()=>{let Q=Ua(m,c);return Q==null?null:{location:{pathname:Q,search:A,hash:b,state:v,key:B},navigationType:s}},[c,m,A,b,v,B,s]);return Rn(T!=null,`<Router basename="${c}"> is not able to match the URL "${m}${A}${b}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:M.createElement(Vn.Provider,{value:d},M.createElement(ao.Provider,{children:r,value:T}))}function Pv({children:n,location:r}){return Rv(tA(n),r)}function tA(n,r=[]){let a=[];return M.Children.forEach(n,(s,o)=>{if(!M.isValidElement(s))return;let u=[...r,o];if(s.type===M.Fragment){a.push.apply(a,tA(s.props.children,u));return}Pt(s.type===Pp,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=tA(s.props.children,u)),a.push(c)}),a}var wu="get",Iu="application/x-www-form-urlencoded";function Zu(n){return n!=null&&typeof n.tagName=="string"}function Kv(n){return Zu(n)&&n.tagName.toLowerCase()==="button"}function Jv(n){return Zu(n)&&n.tagName.toLowerCase()==="form"}function Xv(n){return Zu(n)&&n.tagName.toLowerCase()==="input"}function $v(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Wv(n,r){return n.button===0&&(!r||r==="_self")&&!$v(n)}var hu=null;function Zv(){if(hu===null)try{new FormData(document.createElement("form"),0),hu=!1}catch{hu=!0}return hu}var ex=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nf(n){return n!=null&&!ex.has(n)?(Rn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):n}function tx(n,r){let a,s,o,u,c;if(Jv(n)){let d=n.getAttribute("action");s=d?Ua(d,r):null,a=n.getAttribute("method")||wu,o=Nf(n.getAttribute("enctype"))||Iu,u=new FormData(n)}else if(Kv(n)||Xv(n)&&(n.type==="submit"||n.type==="image")){let d=n.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||d.getAttribute("action");if(s=m?Ua(m,r):null,a=n.getAttribute("formmethod")||d.getAttribute("method")||wu,o=Nf(n.getAttribute("formenctype"))||Nf(d.getAttribute("enctype"))||Iu,u=new FormData(d,n),!Zv()){let{name:A,type:b,value:v}=n;if(b==="image"){let B=A?`${A}.`:"";u.append(`${B}x`,"0"),u.append(`${B}y`,"0")}else A&&u.append(A,v)}}else{if(Zu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=wu,s=null,o=Iu,c=n}return u&&o==="text/plain"&&(c=u,u=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:u,body:c}}function bA(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}async function rx(n,r){if(n.id in r)return r[n.id];try{let a=await import(n.module);return r[n.id]=a,a}catch(a){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nx(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function ax(n,r,a){let s=await Promise.all(n.map(async o=>{let u=r.routes[o.route.id];if(u){let c=await rx(u,a);return c.links?c.links():[]}return[]}));return ox(s.flat(1).filter(nx).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function om(n,r,a,s,o,u){let c=(m,A)=>a[A]?m.route.id!==a[A].route.id:!0,d=(m,A)=>{var b;return a[A].pathname!==m.pathname||((b=a[A].route.path)==null?void 0:b.endsWith("*"))&&a[A].params["*"]!==m.params["*"]};return u==="assets"?r.filter((m,A)=>c(m,A)||d(m,A)):u==="data"?r.filter((m,A)=>{var v;let b=s.routes[m.route.id];if(!b||!b.hasLoader)return!1;if(c(m,A)||d(m,A))return!0;if(m.route.shouldRevalidate){let B=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((v=a[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof B=="boolean")return B}return!0}):[]}function ix(n,r,{includeHydrateFallback:a}={}){return sx(n.map(s=>{let o=r.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function sx(n){return[...new Set(n)]}function lx(n){let r={},a=Object.keys(n).sort();for(let s of a)r[s]=n[s];return r}function ox(n,r){let a=new Set;return new Set(r),n.reduce((s,o)=>{let u=JSON.stringify(lx(o));return a.has(u)||(a.add(u),s.push({key:u,link:o})),s},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ux=new Set([100,101,204,205]);function cx(n,r){let a=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return a.pathname==="/"?a.pathname="_root.data":r&&Ua(a.pathname,r)==="/"?a.pathname=`${r.replace(/\/$/,"")}/_root.data`:a.pathname=`${a.pathname.replace(/\/$/,"")}.data`,a}function Kp(){let n=M.useContext(zs);return bA(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function dx(){let n=M.useContext(Wu);return bA(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var vA=M.createContext(void 0);vA.displayName="FrameworkContext";function Jp(){let n=M.useContext(vA);return bA(n,"You must render this element inside a <HydratedRouter> element"),n}function fx(n,r){let a=M.useContext(vA),[s,o]=M.useState(!1),[u,c]=M.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:A,onMouseLeave:b,onTouchStart:v}=r,B=M.useRef(null);M.useEffect(()=>{if(n==="render"&&c(!0),n==="viewport"){let k=N=>{N.forEach(O=>{c(O.isIntersecting)})},R=new IntersectionObserver(k,{threshold:.5});return B.current&&R.observe(B.current),()=>{R.disconnect()}}},[n]),M.useEffect(()=>{if(s){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[s]);let T=()=>{o(!0)},Q=()=>{o(!1),c(!1)};return a?n!=="intent"?[u,B,{}]:[u,B,{onFocus:Hl(d,T),onBlur:Hl(m,Q),onMouseEnter:Hl(A,T),onMouseLeave:Hl(b,Q),onTouchStart:Hl(v,T)}]:[!1,B,{}]}function Hl(n,r){return a=>{n&&n(a),a.defaultPrevented||r(a)}}function Ax({page:n,...r}){let{router:a}=Kp(),s=M.useMemo(()=>Op(a.routes,n,a.basename),[a.routes,n,a.basename]);return s?M.createElement(gx,{page:n,matches:s,...r}):null}function hx(n){let{manifest:r,routeModules:a}=Jp(),[s,o]=M.useState([]);return M.useEffect(()=>{let u=!1;return ax(n,r,a).then(c=>{u||o(c)}),()=>{u=!0}},[n,r,a]),s}function gx({page:n,matches:r,...a}){let s=zn(),{manifest:o,routeModules:u}=Jp(),{basename:c}=Kp(),{loaderData:d,matches:m}=dx(),A=M.useMemo(()=>om(n,r,m,o,s,"data"),[n,r,m,o,s]),b=M.useMemo(()=>om(n,r,m,o,s,"assets"),[n,r,m,o,s]),v=M.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let Q=new Set,k=!1;if(r.forEach(N=>{var _;let O=o.routes[N.route.id];!O||!O.hasLoader||(!A.some(q=>q.route.id===N.route.id)&&N.route.id in d&&((_=u[N.route.id])!=null&&_.shouldRevalidate)||O.hasClientLoader?k=!0:Q.add(N.route.id))}),Q.size===0)return[];let R=cx(n,c);return k&&Q.size>0&&R.searchParams.set("_routes",r.filter(N=>Q.has(N.route.id)).map(N=>N.route.id).join(",")),[R.pathname+R.search]},[c,d,s,o,A,r,n,u]),B=M.useMemo(()=>ix(b,o),[b,o]),T=hx(b);return M.createElement(M.Fragment,null,v.map(Q=>M.createElement("link",{key:Q,rel:"prefetch",as:"fetch",href:Q,...a})),B.map(Q=>M.createElement("link",{key:Q,rel:"modulepreload",href:Q,...a})),T.map(({key:Q,link:k})=>M.createElement("link",{key:Q,...k})))}function mx(...n){return r=>{n.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var Xp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xp&&(window.__reactRouterVersion="7.6.0")}catch{}function px({basename:n,children:r,window:a}){let s=M.useRef();s.current==null&&(s.current=nv({window:a,v5Compat:!0}));let o=s.current,[u,c]=M.useState({action:o.action,location:o.location}),d=M.useCallback(m=>{M.startTransition(()=>c(m))},[c]);return M.useLayoutEffect(()=>o.listen(d),[o,d]),M.createElement(Yv,{basename:n,children:r,location:u.location,navigationType:u.action,navigator:o})}var $p=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ec=M.forwardRef(function({onClick:r,discover:a="render",prefetch:s="none",relative:o,reloadDocument:u,replace:c,state:d,target:m,to:A,preventScrollReset:b,viewTransition:v,...B},T){let{basename:Q}=M.useContext(Vn),k=typeof A=="string"&&$p.test(A),R,N=!1;if(typeof A=="string"&&k&&(R=A,Xp))try{let J=new URL(window.location.href),P=A.startsWith("//")?new URL(J.protocol+A):new URL(A),$=Ua(P.pathname,Q);P.origin===J.origin&&$!=null?A=$+P.search+P.hash:N=!0}catch{Rn(!1,`<Link to="${A}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=Qv(A,{relative:o}),[_,q,V]=fx(s,B),ae=vx(A,{replace:c,state:d,target:m,preventScrollReset:b,relative:o,viewTransition:v});function ge(J){r&&r(J),J.defaultPrevented||ae(J)}let te=M.createElement("a",{...B,...V,href:R||O,onClick:N||u?r:ge,ref:mx(T,q),target:m,"data-discover":!k&&a==="render"?"true":void 0});return _&&!k?M.createElement(M.Fragment,null,te,M.createElement(Ax,{page:O})):te});ec.displayName="Link";var yx=M.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:s="",end:o=!1,style:u,to:c,viewTransition:d,children:m,...A},b){let v=io(c,{relative:A.relative}),B=zn(),T=M.useContext(Wu),{navigator:Q,basename:k}=M.useContext(Vn),R=T!=null&&Bx(v)&&d===!0,N=Q.encodeLocation?Q.encodeLocation(v).pathname:v.pathname,O=B.pathname,_=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;a||(O=O.toLowerCase(),_=_?_.toLowerCase():null,N=N.toLowerCase()),_&&k&&(_=Ua(_,k)||_);const q=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let V=O===N||!o&&O.startsWith(N)&&O.charAt(q)==="/",ae=_!=null&&(_===N||!o&&_.startsWith(N)&&_.charAt(N.length)==="/"),ge={isActive:V,isPending:ae,isTransitioning:R},te=V?r:void 0,J;typeof s=="function"?J=s(ge):J=[s,V?"active":null,ae?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let P=typeof u=="function"?u(ge):u;return M.createElement(ec,{...A,"aria-current":te,className:J,ref:b,style:P,to:c,viewTransition:d},typeof m=="function"?m(ge):m)});yx.displayName="NavLink";var Ex=M.forwardRef(({discover:n="render",fetcherKey:r,navigate:a,reloadDocument:s,replace:o,state:u,method:c=wu,action:d,onSubmit:m,relative:A,preventScrollReset:b,viewTransition:v,...B},T)=>{let Q=wx(),k=Ix(d,{relative:A}),R=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&$p.test(d),O=_=>{if(m&&m(_),_.defaultPrevented)return;_.preventDefault();let q=_.nativeEvent.submitter,V=(q==null?void 0:q.getAttribute("formmethod"))||c;Q(q||_.currentTarget,{fetcherKey:r,method:V,navigate:a,replace:o,state:u,relative:A,preventScrollReset:b,viewTransition:v})};return M.createElement("form",{ref:T,method:R,action:k,onSubmit:s?m:O,...B,"data-discover":!N&&n==="render"?"true":void 0})});Ex.displayName="Form";function bx(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wp(n){let r=M.useContext(zs);return Pt(r,bx(n)),r}function vx(n,{target:r,replace:a,state:s,preventScrollReset:o,relative:u,viewTransition:c}={}){let d=kr(),m=zn(),A=io(n,{relative:u});return M.useCallback(b=>{if(Wv(b,r)){b.preventDefault();let v=a!==void 0?a:to(m)===to(A);d(n,{replace:v,state:s,preventScrollReset:o,relative:u,viewTransition:c})}},[m,d,A,a,s,r,n,o,u,c])}var xx=0,Cx=()=>`__${String(++xx)}__`;function wx(){let{router:n}=Wp("useSubmit"),{basename:r}=M.useContext(Vn),a=Hv();return M.useCallback(async(s,o={})=>{let{action:u,method:c,encType:d,formData:m,body:A}=tx(s,r);if(o.navigate===!1){let b=o.fetcherKey||Cx();await n.fetch(b,a,o.action||u,{preventScrollReset:o.preventScrollReset,formData:m,body:A,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await n.navigate(o.action||u,{preventScrollReset:o.preventScrollReset,formData:m,body:A,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,r,a])}function Ix(n,{relative:r}={}){let{basename:a}=M.useContext(Vn),s=M.useContext(qn);Pt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...io(n||".",{relative:r})},c=zn();if(n==null){u.search=c.search;let d=new URLSearchParams(u.search),m=d.getAll("index");if(m.some(b=>b==="")){d.delete("index"),m.filter(v=>v).forEach(v=>d.append("index",v));let b=d.toString();u.search=b?`?${b}`:""}}return(!n||n===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(u.pathname=u.pathname==="/"?a:La([a,u.pathname])),to(u)}function Bx(n,r={}){let a=M.useContext(Gp);Pt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Wp("useViewTransitionState"),o=io(n,{relative:r.relative});if(!a.isTransitioning)return!1;let u=Ua(a.currentLocation.pathname,s)||a.currentLocation.pathname,c=Ua(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Lu(o.pathname,c)!=null||Lu(o.pathname,u)!=null}[...ux];const Sx=()=>{const{t:n}=Bt(),r=kr(),a=zn(),[s,o]=M.useState("credentials");M.useEffect(()=>{const b=a.pathname.substring(1),B=["credentials","emails","settings"].find(T=>b===T||b.startsWith(`${T}/`));B&&o(B)},[a]);const u=b=>{o(b),r(`/${b}`)};return["/login","/auth-settings","/unlock","/unlock-success","/upgrade"].includes(a.pathname)||new URLSearchParams(window.location.search).get("mode")==="inline_unlock"?null:p.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"flex justify-around items-center h-14",children:[p.jsxs("button",{onClick:()=>u("credentials"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="credentials"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.credentials")})]}),p.jsxs("button",{onClick:()=>u("emails"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="emails"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.emails")})]}),p.jsxs("button",{onClick:()=>u("settings"),className:`flex flex-col items-center justify-center w-1/3 h-full ${s==="settings"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[p.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p.jsx("span",{className:"text-xs mt-1",children:n("menu.settings")})]})]})})};var um=Object.prototype.hasOwnProperty;function rA(n,r){var a,s;if(n===r)return!0;if(n&&r&&(a=n.constructor)===r.constructor){if(a===Date)return n.getTime()===r.getTime();if(a===RegExp)return n.toString()===r.toString();if(a===Array){if((s=n.length)===r.length)for(;s--&&rA(n[s],r[s]););return s===-1}if(!a||typeof n=="object"){s=0;for(a in n)if(um.call(n,a)&&++s&&!um.call(r,a)||!(a in r)||!rA(n[a],r[a]))return!1;return Object.keys(r).length===s}}return n!==n&&r!==r}const Nx=new Error("request for lock canceled");var Tx=function(n,r,a,s){function o(u){return u instanceof a?u:new a(function(c){c(u)})}return new(a||(a=Promise))(function(u,c){function d(b){try{A(s.next(b))}catch(v){c(v)}}function m(b){try{A(s.throw(b))}catch(v){c(v)}}function A(b){b.done?u(b.value):o(b.value).then(d,m)}A((s=s.apply(n,r||[])).next())})};class Qx{constructor(r,a=Nx){this._value=r,this._cancelError=a,this._queue=[],this._weightedWaiters=[]}acquire(r=1,a=0){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);return new Promise((s,o)=>{const u={resolve:s,reject:o,weight:r,priority:a},c=Zp(this._queue,d=>a<=d.priority);c===-1&&r<=this._value?this._dispatchItem(u):this._queue.splice(c+1,0,u)})}runExclusive(r){return Tx(this,arguments,void 0,function*(a,s=1,o=0){const[u,c]=yield this.acquire(s,o);try{return yield a(u)}finally{c()}})}waitForUnlock(r=1,a=0){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);return this._couldLockImmediately(r,a)?Promise.resolve():new Promise(s=>{this._weightedWaiters[r-1]||(this._weightedWaiters[r-1]=[]),Dx(this._weightedWaiters[r-1],{resolve:s,priority:a})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(r){this._value=r,this._dispatchQueue()}release(r=1){if(r<=0)throw new Error(`invalid weight ${r}: must be positive`);this._value+=r,this._dispatchQueue()}cancel(){this._queue.forEach(r=>r.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(r){const a=this._value;this._value-=r.weight,r.resolve([a,this._newReleaser(r.weight)])}_newReleaser(r){let a=!1;return()=>{a||(a=!0,this.release(r))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let r=this._value;r>0;r--){const a=this._weightedWaiters[r-1];a&&(a.forEach(s=>s.resolve()),this._weightedWaiters[r-1]=[])}else{const r=this._queue[0].priority;for(let a=this._value;a>0;a--){const s=this._weightedWaiters[a-1];if(!s)continue;const o=s.findIndex(u=>u.priority<=r);(o===-1?s:s.splice(0,o)).forEach(u=>u.resolve())}}}_couldLockImmediately(r,a){return(this._queue.length===0||this._queue[0].priority<a)&&r<=this._value}}function Dx(n,r){const a=Zp(n,s=>r.priority<=s.priority);n.splice(a+1,0,r)}function Zp(n,r){for(let a=n.length-1;a>=0;a--)if(r(n[a]))return a;return-1}var Rx=function(n,r,a,s){function o(u){return u instanceof a?u:new a(function(c){c(u)})}return new(a||(a=Promise))(function(u,c){function d(b){try{A(s.next(b))}catch(v){c(v)}}function m(b){try{A(s.throw(b))}catch(v){c(v)}}function A(b){b.done?u(b.value):o(b.value).then(d,m)}A((s=s.apply(n,r||[])).next())})};class kx{constructor(r){this._semaphore=new Qx(1,r)}acquire(){return Rx(this,arguments,void 0,function*(r=0){const[,a]=yield this._semaphore.acquire(1,r);return a})}runExclusive(r,a=0){return this._semaphore.runExclusive(()=>r(),1,a)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(r=0){return this._semaphore.waitForUnlock(1,r)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var Dp,Rp;const Bu=((Rp=(Dp=globalThis.browser)==null?void 0:Dp.runtime)==null?void 0:Rp.id)==null?globalThis.chrome:globalThis.browser,Xe=Lx();function Lx(){const n={local:gu("local"),session:gu("session"),sync:gu("sync"),managed:gu("managed")},r=k=>{const R=n[k];if(R==null){const N=Object.keys(n).join(", ");throw Error(`Invalid area "${k}". Options: ${N}`)}return R},a=k=>{const R=k.indexOf(":"),N=k.substring(0,R),O=k.substring(R+1);if(O==null)throw Error(`Storage key should be in the form of "area:key", but received "${k}"`);return{driverArea:N,driverKey:O,driver:r(N)}},s=k=>k+"$",o=(k,R)=>{const N={...k};return Object.entries(R).forEach(([O,_])=>{_==null?delete N[O]:N[O]=_}),N},u=(k,R)=>k??R??null,c=k=>typeof k=="object"&&!Array.isArray(k)?k:{},d=async(k,R,N)=>{const O=await k.getItem(R);return u(O,(N==null?void 0:N.fallback)??(N==null?void 0:N.defaultValue))},m=async(k,R)=>{const N=s(R),O=await k.getItem(N);return c(O)},A=async(k,R,N)=>{await k.setItem(R,N??null)},b=async(k,R,N)=>{const O=s(R),_=c(await k.getItem(O));await k.setItem(O,o(_,N))},v=async(k,R,N)=>{if(await k.removeItem(R),N!=null&&N.removeMeta){const O=s(R);await k.removeItem(O)}},B=async(k,R,N)=>{const O=s(R);if(N==null)await k.removeItem(O);else{const _=c(await k.getItem(O));[N].flat().forEach(q=>delete _[q]),await k.setItem(O,_)}},T=(k,R,N)=>k.watch(R,N);return{getItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);return await d(N,O,R)},getItems:async k=>{const R=new Map,N=new Map,O=[];k.forEach(q=>{let V,ae;typeof q=="string"?V=q:"getValue"in q?(V=q.key,ae={fallback:q.fallback}):(V=q.key,ae=q.options),O.push(V);const{driverArea:ge,driverKey:te}=a(V),J=R.get(ge)??[];R.set(ge,J.concat(te)),N.set(V,ae)});const _=new Map;return await Promise.all(Array.from(R.entries()).map(async([q,V])=>{(await n[q].getItems(V)).forEach(ge=>{const te=`${q}:${ge.key}`,J=N.get(te),P=u(ge.value,(J==null?void 0:J.fallback)??(J==null?void 0:J.defaultValue));_.set(te,P)})})),O.map(q=>({key:q,value:_.get(q)}))},getMeta:async k=>{const{driver:R,driverKey:N}=a(k);return await m(R,N)},getMetas:async k=>{const R=k.map(_=>{const q=typeof _=="string"?_:_.key,{driverArea:V,driverKey:ae}=a(q);return{key:q,driverArea:V,driverKey:ae,driverMetaKey:s(ae)}}),N=R.reduce((_,q)=>{var V;return _[V=q.driverArea]??(_[V]=[]),_[q.driverArea].push(q),_},{}),O={};return await Promise.all(Object.entries(N).map(async([_,q])=>{const V=await Bu.storage[_].get(q.map(ae=>ae.driverMetaKey));q.forEach(ae=>{O[ae.key]=V[ae.driverMetaKey]??{}})})),R.map(_=>({key:_.key,meta:O[_.key]}))},setItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await A(N,O,R)},setItems:async k=>{const R={};k.forEach(N=>{const{driverArea:O,driverKey:_}=a("key"in N?N.key:N.item.key);R[O]??(R[O]=[]),R[O].push({key:_,value:N.value})}),await Promise.all(Object.entries(R).map(async([N,O])=>{await r(N).setItems(O)}))},setMeta:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await b(N,O,R)},setMetas:async k=>{const R={};k.forEach(N=>{const{driverArea:O,driverKey:_}=a("key"in N?N.key:N.item.key);R[O]??(R[O]=[]),R[O].push({key:_,properties:N.meta})}),await Promise.all(Object.entries(R).map(async([N,O])=>{const _=r(N),q=O.map(({key:te})=>s(te));console.log(N,q);const V=await _.getItems(q),ae=Object.fromEntries(V.map(({key:te,value:J})=>[te,c(J)])),ge=O.map(({key:te,properties:J})=>{const P=s(te);return{key:P,value:o(ae[P]??{},J)}});await _.setItems(ge)}))},removeItem:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await v(N,O,R)},removeItems:async k=>{const R={};k.forEach(N=>{let O,_;typeof N=="string"?O=N:"getValue"in N?O=N.key:"item"in N?(O=N.item.key,_=N.options):(O=N.key,_=N.options);const{driverArea:q,driverKey:V}=a(O);R[q]??(R[q]=[]),R[q].push(V),_!=null&&_.removeMeta&&R[q].push(s(V))}),await Promise.all(Object.entries(R).map(async([N,O])=>{await r(N).removeItems(O)}))},clear:async k=>{await r(k).clear()},removeMeta:async(k,R)=>{const{driver:N,driverKey:O}=a(k);await B(N,O,R)},snapshot:async(k,R)=>{var _;const O=await r(k).snapshot();return(_=R==null?void 0:R.excludeKeys)==null||_.forEach(q=>{delete O[q],delete O[s(q)]}),O},restoreSnapshot:async(k,R)=>{await r(k).restoreSnapshot(R)},watch:(k,R)=>{const{driver:N,driverKey:O}=a(k);return T(N,O,R)},unwatch(){Object.values(n).forEach(k=>{k.unwatch()})},defineItem:(k,R)=>{const{driver:N,driverKey:O}=a(k),{version:_=1,migrations:q={}}=R??{};if(_<1)throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");const V=async()=>{var K;const P=s(O),[{value:$},{value:me}]=await N.getItems([O,P]);if($==null)return;const he=(me==null?void 0:me.v)??1;if(he>_)throw Error(`Version downgrade detected (v${he} -> v${_}) for "${k}"`);if(he===_)return;console.debug(`[@wxt-dev/storage] Running storage migration for ${k}: v${he} -> v${_}`);const Be=Array.from({length:_-he},(ie,Ne)=>he+Ne+1);let pe=$;for(const ie of Be)try{pe=await((K=q==null?void 0:q[ie])==null?void 0:K.call(q,pe))??pe}catch(Ne){throw new Ux(k,ie,{cause:Ne})}await N.setItems([{key:O,value:pe},{key:P,value:{...me,v:_}}]),console.debug(`[@wxt-dev/storage] Storage migration completed for ${k} v${_}`,{migratedValue:pe})},ae=(R==null?void 0:R.migrations)==null?Promise.resolve():V().catch(P=>{console.error(`[@wxt-dev/storage] Migration failed for ${k}`,P)}),ge=new kx,te=()=>(R==null?void 0:R.fallback)??(R==null?void 0:R.defaultValue)??null,J=()=>ge.runExclusive(async()=>{const P=await N.getItem(O);if(P!=null||(R==null?void 0:R.init)==null)return P;const $=await R.init();return await N.setItem(O,$),$});return ae.then(J),{key:k,get defaultValue(){return te()},get fallback(){return te()},getValue:async()=>(await ae,R!=null&&R.init?await J():await d(N,O,R)),getMeta:async()=>(await ae,await m(N,O)),setValue:async P=>(await ae,await A(N,O,P)),setMeta:async P=>(await ae,await b(N,O,P)),removeValue:async P=>(await ae,await v(N,O,P)),removeMeta:async P=>(await ae,await B(N,O,P)),watch:P=>T(N,O,($,me)=>P($??te(),me??te())),migrate:V}}}}function gu(n){const r=()=>{if(Bu.runtime==null)throw Error(["'wxt/storage' must be loaded in a web extension environment",`
 - If thrown during a build, see https://github.com/wxt-dev/wxt/issues/371`,` - If thrown during tests, mock 'wxt/browser' correctly. See https://wxt.dev/guide/go-further/testing.html
`].join(`
`));if(Bu.storage==null)throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");const s=Bu.storage[n];if(s==null)throw Error(`"browser.storage.${n}" is undefined`);return s},a=new Set;return{getItem:async s=>(await r().get(s))[s],getItems:async s=>{const o=await r().get(s);return s.map(u=>({key:u,value:o[u]??null}))},setItem:async(s,o)=>{o==null?await r().remove(s):await r().set({[s]:o})},setItems:async s=>{const o=s.reduce((u,{key:c,value:d})=>(u[c]=d,u),{});await r().set(o)},removeItem:async s=>{await r().remove(s)},removeItems:async s=>{await r().remove(s)},clear:async()=>{await r().clear()},snapshot:async()=>await r().get(),restoreSnapshot:async s=>{await r().set(s)},watch(s,o){const u=c=>{const d=c[s];d!=null&&(rA(d.newValue,d.oldValue)||o(d.newValue??null,d.oldValue??null))};return r().onChanged.addListener(u),a.add(u),()=>{r().onChanged.removeListener(u),a.delete(u)}},unwatch(){a.forEach(s=>{r().onChanged.removeListener(s)}),a.clear()}}}class Ux extends Error{constructor(r,a,s){super(`v${a} migration failed for "${r}"`,s),this.key=r,this.version=a}}var mu={exports:{}},cm;function Mx(){if(cm)return mu.exports;cm=1;const n=a=>typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?()=>{const s=crypto.getRandomValues(new Uint8Array(1))[0];return(s>=a?s%a:s).toString(a)}:()=>Math.floor(Math.random()*a).toString(a),r=(a=7,s=!1)=>Array.from({length:a},n(s?16:36)).join("");return mu.exports=r,mu.exports.default=r,mu.exports}var _x=Mx();const Uu=xi(_x);var Ox=()=>`uid::${Uu(7)}`,Fx=(n,r=["endpointName","fingerprint"])=>typeof n=="object"&&n!==null&&r.every(a=>a in n),jx=n=>{if(!Fx(n))throw new TypeError("Invalid connection args");return JSON.stringify(n)},Hx=()=>{let n=[];return{add:(...r)=>{n=[...n,...r]},remove:r=>{n=typeof r=="string"?n.filter(a=>a.message.transactionId!==r):n.filter(a=>!r.includes(a))},entries:()=>n}},Tf=class{static toBackground(n,r){return n.postMessage(r)}static toExtensionContext(n,r){return n.postMessage(r)}},Su={exports:{}},Gx=Su.exports,dm;function Vx(){return dm||(dm=1,function(n,r){(function(a,s){s(n)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Gx,function(a){if(typeof globalThis!="object"||typeof chrome!="object"||!chrome||!chrome.runtime||!chrome.runtime.id)throw new Error("This script should only be loaded in a browser extension.");if(typeof globalThis.browser>"u"||Object.getPrototypeOf(globalThis.browser)!==Object.prototype){const s="The message port closed before a response was received.",o="Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)",u=c=>{const d={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(Object.keys(d).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class m extends WeakMap{constructor(J,P=void 0){super(P),this.createItem=J}get(J){return this.has(J)||this.set(J,this.createItem(J)),super.get(J)}}const A=te=>te&&typeof te=="object"&&typeof te.then=="function",b=(te,J)=>(...P)=>{c.runtime.lastError?te.reject(new Error(c.runtime.lastError.message)):J.singleCallbackArg||P.length<=1&&J.singleCallbackArg!==!1?te.resolve(P[0]):te.resolve(P)},v=te=>te==1?"argument":"arguments",B=(te,J)=>function($,...me){if(me.length<J.minArgs)throw new Error(`Expected at least ${J.minArgs} ${v(J.minArgs)} for ${te}(), got ${me.length}`);if(me.length>J.maxArgs)throw new Error(`Expected at most ${J.maxArgs} ${v(J.maxArgs)} for ${te}(), got ${me.length}`);return new Promise((he,Be)=>{if(J.fallbackToNoCallback)try{$[te](...me,b({resolve:he,reject:Be},J))}catch(pe){console.warn(`${te} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,pe),$[te](...me),J.fallbackToNoCallback=!1,J.noCallback=!0,he()}else J.noCallback?($[te](...me),he()):$[te](...me,b({resolve:he,reject:Be},J))})},T=(te,J,P)=>new Proxy(J,{apply($,me,he){return P.call(me,te,...he)}});let Q=Function.call.bind(Object.prototype.hasOwnProperty);const k=(te,J={},P={})=>{let $=Object.create(null),me={has(Be,pe){return pe in te||pe in $},get(Be,pe,K){if(pe in $)return $[pe];if(!(pe in te))return;let ie=te[pe];if(typeof ie=="function")if(typeof J[pe]=="function")ie=T(te,te[pe],J[pe]);else if(Q(P,pe)){let Ne=B(pe,P[pe]);ie=T(te,te[pe],Ne)}else ie=ie.bind(te);else if(typeof ie=="object"&&ie!==null&&(Q(J,pe)||Q(P,pe)))ie=k(ie,J[pe],P[pe]);else if(Q(P,"*"))ie=k(ie,J[pe],P["*"]);else return Object.defineProperty($,pe,{configurable:!0,enumerable:!0,get(){return te[pe]},set(Ne){te[pe]=Ne}}),ie;return $[pe]=ie,ie},set(Be,pe,K,ie){return pe in $?$[pe]=K:te[pe]=K,!0},defineProperty(Be,pe,K){return Reflect.defineProperty($,pe,K)},deleteProperty(Be,pe){return Reflect.deleteProperty($,pe)}},he=Object.create(te);return new Proxy(he,me)},R=te=>({addListener(J,P,...$){J.addListener(te.get(P),...$)},hasListener(J,P){return J.hasListener(te.get(P))},removeListener(J,P){J.removeListener(te.get(P))}}),N=new m(te=>typeof te!="function"?te:function(P){const $=k(P,{},{getContent:{minArgs:0,maxArgs:0}});te($)});let O=!1;const _=new m(te=>typeof te!="function"?te:function(P,$,me){let he=!1,Be,pe=new Promise(_e=>{Be=function(G){O||(console.warn(o,new Error().stack),O=!0),he=!0,_e(G)}}),K;try{K=te(P,$,Be)}catch(_e){K=Promise.reject(_e)}const ie=K!==!0&&A(K);if(K!==!0&&!ie&&!he)return!1;const Ne=_e=>{_e.then(G=>{me(G)},G=>{let ne;G&&(G instanceof Error||typeof G.message=="string")?ne=G.message:ne="An unexpected error occurred",me({__mozWebExtensionPolyfillReject__:!0,message:ne})}).catch(G=>{console.error("Failed to send onMessage rejected reply",G)})};return Ne(ie?K:pe),!0}),q=({reject:te,resolve:J},P)=>{c.runtime.lastError?c.runtime.lastError.message===s?J():te(new Error(c.runtime.lastError.message)):P&&P.__mozWebExtensionPolyfillReject__?te(new Error(P.message)):J(P)},V=(te,J,P,...$)=>{if($.length<J.minArgs)throw new Error(`Expected at least ${J.minArgs} ${v(J.minArgs)} for ${te}(), got ${$.length}`);if($.length>J.maxArgs)throw new Error(`Expected at most ${J.maxArgs} ${v(J.maxArgs)} for ${te}(), got ${$.length}`);return new Promise((me,he)=>{const Be=q.bind(null,{resolve:me,reject:he});$.push(Be),P.sendMessage(...$)})},ae={devtools:{network:{onRequestFinished:R(N)}},runtime:{onMessage:R(_),onMessageExternal:R(_),sendMessage:V.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:V.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},ge={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return d.privacy={network:{"*":ge},services:{"*":ge},websites:{"*":ge}},k(c,ae,d)};a.exports=u(chrome)}else a.exports=globalThis.browser})}(Su)),Su.exports}var qx=Vx();const zx=xi(qx);var Yx=(n="")=>{const r=Ox();let a,s=[];const o=Hx(),u=new Set,c=new Set,d=(A,b)=>{switch(A.status){case"undeliverable":s.some(v=>v.message.messageID===A.message.messageID)||(s=[...s,{message:A.message,resolvedDestination:A.resolvedDestination}]);return;case"deliverable":s=s.reduce((v,B)=>B.resolvedDestination===A.deliverableTo?(Tf.toBackground(b,{type:"deliver",message:B.message}),v):[...v,B],[]);return;case"delivered":A.receipt.message.messageType==="message"&&o.add(A.receipt);return;case"incoming":A.message.messageType==="reply"&&o.remove(A.message.messageID),u.forEach(v=>v(A.message,b));return;case"terminated":{const v=o.entries().filter(B=>A.fingerprint===B.to);o.remove(v),v.forEach(({message:B})=>c.forEach(T=>T(B)))}}},m=()=>{a=zx.runtime.connect({name:jx({endpointName:n,fingerprint:r})}),a.onMessage.addListener(d),a.onDisconnect.addListener(m),Tf.toBackground(a,{type:"sync",pendingResponses:o.entries(),pendingDeliveries:[...new Set(s.map(({resolvedDestination:A})=>A))]})};return m(),{onFailure(A){c.add(A)},onMessage(A){u.add(A)},postMessage(A){Tf.toBackground(a,{type:"deliver",message:A})}}},Px=Object.defineProperty,Kx=Object.defineProperties,Jx=Object.getOwnPropertyDescriptors,fm=Object.getOwnPropertySymbols,Xx=Object.prototype.hasOwnProperty,$x=Object.prototype.propertyIsEnumerable,Am=(n,r,a)=>r in n?Px(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a,ey=(n,r)=>{for(var a in r||(r={}))Xx.call(r,a)&&Am(n,a,r[a]);if(fm)for(var a of fm(r))$x.call(r,a)&&Am(n,a,r[a]);return n},ty=(n,r)=>Kx(n,Jx(r)),Wx=/^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/,ry=n=>{const[,r,a,s]=n.match(Wx)||[];return{context:r,tabId:+a,frameId:s?+s:void 0}};const Zx=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],nA=Symbol(".toJSON was called"),eC=n=>{n[nA]=!0;const r=n.toJSON();return delete n[nA],r},ny=({from:n,seen:r,to_:a,forceEnumerable:s,maxDepth:o,depth:u})=>{const c=a||(Array.isArray(n)?[]:{});if(r.push(n),u>=o)return c;if(typeof n.toJSON=="function"&&n[nA]!==!0)return eC(n);for(const[d,m]of Object.entries(n)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){c[d]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){c[d]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){c[d]=m;continue}if(!r.includes(n[d])){u++,c[d]=ny({from:n[d],seen:[...r],forceEnumerable:s,maxDepth:o,depth:u});continue}c[d]="[Circular]"}}for(const{property:d,enumerable:m}of Zx)typeof n[d]=="string"&&Object.defineProperty(c,d,{value:n[d],enumerable:!0,configurable:!0,writable:!0});return c};function tC(n,r={}){const{maxDepth:a=Number.POSITIVE_INFINITY}=r;return typeof n=="object"&&n!==null?ny({from:n,seen:[],forceEnumerable:!0,maxDepth:a,depth:0}):typeof n=="function"?`[Function: ${n.name||"anonymous"}]`:n}let ay=()=>({events:{},emit(n,...r){(this.events[n]||[]).forEach(a=>a(...r))},on(n,r){return(this.events[n]=this.events[n]||[]).push(r),()=>this.events[n]=(this.events[n]||[]).filter(a=>a!==r)}});var rC=(n,r,a)=>{const s=Uu(),o=new Map,u=new Map,c=d=>{if(d.destination.context===n&&!d.destination.frameId&&!d.destination.tabId){const{transactionId:m,messageID:A,messageType:b}=d,v=()=>{const T=o.get(m);if(T){const{err:Q,data:k}=d;if(Q){const R=Q,N=self[R.name],O=new(typeof N=="function"?N:Error)(R.message);for(const _ in R)O[_]=R[_];T.reject(O)}else T.resolve(k);o.delete(m)}},B=async()=>{let T,Q,k=!1;try{const R=u.get(A);if(typeof R=="function")T=await R({sender:d.origin,id:A,data:d.data,timestamp:d.timestamp});else throw k=!0,new Error(`[webext-bridge] No handler registered in '${n}' to accept messages with id '${A}'`)}catch(R){Q=R}finally{if(Q&&(d.err=tC(Q)),c(ty(ey({},d),{messageType:"reply",data:T,origin:{context:n,tabId:null},destination:d.origin,hops:[]})),Q&&!k)throw T}};switch(b){case"reply":return v();case"message":return B()}}return d.hops.push(`${n}::${s}`),r(d)};return{handleMessage:c,endTransaction:d=>{const m=o.get(d);m==null||m.reject("Transaction was ended before it could complete"),o.delete(d)},sendMessage:(d,m,A="background")=>{const b=typeof A=="string"?ry(A):A,v="Bridge#sendMessage ->";if(!b.context)throw new TypeError(`${v} Destination must be any one of known destinations`);return new Promise((B,T)=>{const Q={messageID:d,data:m,destination:b,messageType:"message",transactionId:Uu(),origin:{context:n,tabId:null},hops:[],timestamp:Date.now()};o.set(Q.transactionId,{resolve:B,reject:T});try{c(Q)}catch(k){o.delete(Q.transactionId),T(k)}})},onMessage:(d,m)=>(u.set(d,m),()=>u.delete(d))}},js=class{constructor(n,r){this.endpointRuntime=n,this.streamInfo=r,this.emitter=ay(),this.isClosed=!1,this.handleStreamClose=()=>{this.isClosed||(this.isClosed=!0,this.emitter.emit("closed",!0),this.emitter.events={})},js.initDone||(n.onMessage("__crx_bridge_stream_transfer__",a=>{const{streamId:s,streamTransfer:o,action:u}=a.data,c=js.openStreams.get(s);c&&!c.isClosed&&(u==="transfer"&&c.emitter.emit("message",o),u==="close"&&(js.openStreams.delete(s),c.handleStreamClose()))}),js.initDone=!0),js.openStreams.set(this.streamInfo.streamId,this)}get info(){return this.streamInfo}send(n){if(this.isClosed)throw new Error("Attempting to send a message over closed stream. Use stream.onClose(<callback>) to keep an eye on stream status");this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:n,action:"transfer"},this.streamInfo.endpoint)}close(n){n&&this.send(n),this.handleStreamClose(),this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:null,action:"close"},this.streamInfo.endpoint)}onMessage(n){return this.getDisposable("message",n)}onClose(n){return this.getDisposable("closed",n)}getDisposable(n,r){const a=this.emitter.on(n,r);return Object.assign(a,{dispose:a,close:a})}},Mu=js;Mu.initDone=!1;Mu.openStreams=new Map;var nC=n=>{const r=new Map,a=new Map,s=ay();n.onMessage("__crx_bridge_stream_open__",c=>new Promise(d=>{const{sender:m,data:A}=c,{channel:b}=A;let v=!1,B=()=>{};const T=()=>{const Q=a.get(b);typeof Q=="function"?(Q(new Mu(n,ty(ey({},A),{endpoint:m}))),v&&B(),d(!0)):v||(v=!0,B=s.on("did-change-stream-callbacks",T))};T()}));async function o(c,d){if(r.has(c))throw new Error("webext-bridge: A Stream is already open at this channel");const m=typeof d=="string"?ry(d):d,A={streamId:Uu(),channel:c,endpoint:m},b=new Mu(n,A);return b.onClose(()=>r.delete(c)),await n.sendMessage("__crx_bridge_stream_open__",A,m),r.set(c,b),b}function u(c,d){if(a.has(c))throw new Error("webext-bridge: This channel has already been claimed. Stream allows only one-on-one communication");a.set(c,d),s.emit("did-change-stream-callbacks")}return{openStream:o,onOpenStreamChannel:u}},iy=Yx("popup"),xA=rC("popup",n=>iy.postMessage(n));iy.onMessage(xA.handleMessage);var{sendMessage:Dn,onMessage:D2}=xA;nC(xA);var Qf={},Gl={},hm;function aC(){if(hm)return Gl;hm=1,Gl.byteLength=d,Gl.toByteArray=A,Gl.fromByteArray=B;for(var n=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=s.length;o<u;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;r[45]=62,r[95]=63;function c(T){var Q=T.length;if(Q%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=T.indexOf("=");k===-1&&(k=Q);var R=k===Q?0:4-k%4;return[k,R]}function d(T){var Q=c(T),k=Q[0],R=Q[1];return(k+R)*3/4-R}function m(T,Q,k){return(Q+k)*3/4-k}function A(T){var Q,k=c(T),R=k[0],N=k[1],O=new a(m(T,R,N)),_=0,q=N>0?R-4:R,V;for(V=0;V<q;V+=4)Q=r[T.charCodeAt(V)]<<18|r[T.charCodeAt(V+1)]<<12|r[T.charCodeAt(V+2)]<<6|r[T.charCodeAt(V+3)],O[_++]=Q>>16&255,O[_++]=Q>>8&255,O[_++]=Q&255;return N===2&&(Q=r[T.charCodeAt(V)]<<2|r[T.charCodeAt(V+1)]>>4,O[_++]=Q&255),N===1&&(Q=r[T.charCodeAt(V)]<<10|r[T.charCodeAt(V+1)]<<4|r[T.charCodeAt(V+2)]>>2,O[_++]=Q>>8&255,O[_++]=Q&255),O}function b(T){return n[T>>18&63]+n[T>>12&63]+n[T>>6&63]+n[T&63]}function v(T,Q,k){for(var R,N=[],O=Q;O<k;O+=3)R=(T[O]<<16&16711680)+(T[O+1]<<8&65280)+(T[O+2]&255),N.push(b(R));return N.join("")}function B(T){for(var Q,k=T.length,R=k%3,N=[],O=16383,_=0,q=k-R;_<q;_+=O)N.push(v(T,_,_+O>q?q:_+O));return R===1?(Q=T[k-1],N.push(n[Q>>2]+n[Q<<4&63]+"==")):R===2&&(Q=(T[k-2]<<8)+T[k-1],N.push(n[Q>>10]+n[Q>>4&63]+n[Q<<2&63]+"=")),N.join("")}return Gl}var pu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var gm;function iC(){return gm||(gm=1,pu.read=function(n,r,a,s,o){var u,c,d=o*8-s-1,m=(1<<d)-1,A=m>>1,b=-7,v=a?o-1:0,B=a?-1:1,T=n[r+v];for(v+=B,u=T&(1<<-b)-1,T>>=-b,b+=d;b>0;u=u*256+n[r+v],v+=B,b-=8);for(c=u&(1<<-b)-1,u>>=-b,b+=s;b>0;c=c*256+n[r+v],v+=B,b-=8);if(u===0)u=1-A;else{if(u===m)return c?NaN:(T?-1:1)*(1/0);c=c+Math.pow(2,s),u=u-A}return(T?-1:1)*c*Math.pow(2,u-s)},pu.write=function(n,r,a,s,o,u){var c,d,m,A=u*8-o-1,b=(1<<A)-1,v=b>>1,B=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=s?0:u-1,Q=s?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(d=isNaN(r)?1:0,c=b):(c=Math.floor(Math.log(r)/Math.LN2),r*(m=Math.pow(2,-c))<1&&(c--,m*=2),c+v>=1?r+=B/m:r+=B*Math.pow(2,1-v),r*m>=2&&(c++,m/=2),c+v>=b?(d=0,c=b):c+v>=1?(d=(r*m-1)*Math.pow(2,o),c=c+v):(d=r*Math.pow(2,v-1)*Math.pow(2,o),c=0));o>=8;n[a+T]=d&255,T+=Q,d/=256,o-=8);for(c=c<<o|d,A+=o;A>0;n[a+T]=c&255,T+=Q,c/=256,A-=8);n[a+T-Q]|=k*128}),pu}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var mm;function sC(){return mm||(mm=1,function(n){const r=aC(),a=iC(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=d,n.SlowBuffer=O,n.INSPECT_MAX_BYTES=50;const o=2147483647;n.kMaxLength=o,d.TYPED_ARRAY_SUPPORT=u(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const S=new Uint8Array(1),E={foo:function(){return 42}};return Object.setPrototypeOf(E,Uint8Array.prototype),Object.setPrototypeOf(S,E),S.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function c(S){if(S>o)throw new RangeError('The value "'+S+'" is invalid for option "size"');const E=new Uint8Array(S);return Object.setPrototypeOf(E,d.prototype),E}function d(S,E,x){if(typeof S=="number"){if(typeof E=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(S)}return m(S,E,x)}d.poolSize=8192;function m(S,E,x){if(typeof S=="string")return B(S,E);if(ArrayBuffer.isView(S))return Q(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(le(S,ArrayBuffer)||S&&le(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(S,SharedArrayBuffer)||S&&le(S.buffer,SharedArrayBuffer)))return k(S,E,x);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=S.valueOf&&S.valueOf();if(H!=null&&H!==S)return d.from(H,E,x);const W=R(S);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return d.from(S[Symbol.toPrimitive]("string"),E,x);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}d.from=function(S,E,x){return m(S,E,x)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function A(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function b(S,E,x){return A(S),S<=0?c(S):E!==void 0?typeof x=="string"?c(S).fill(E,x):c(S).fill(E):c(S)}d.alloc=function(S,E,x){return b(S,E,x)};function v(S){return A(S),c(S<0?0:N(S)|0)}d.allocUnsafe=function(S){return v(S)},d.allocUnsafeSlow=function(S){return v(S)};function B(S,E){if((typeof E!="string"||E==="")&&(E="utf8"),!d.isEncoding(E))throw new TypeError("Unknown encoding: "+E);const x=_(S,E)|0;let H=c(x);const W=H.write(S,E);return W!==x&&(H=H.slice(0,W)),H}function T(S){const E=S.length<0?0:N(S.length)|0,x=c(E);for(let H=0;H<E;H+=1)x[H]=S[H]&255;return x}function Q(S){if(le(S,Uint8Array)){const E=new Uint8Array(S);return k(E.buffer,E.byteOffset,E.byteLength)}return T(S)}function k(S,E,x){if(E<0||S.byteLength<E)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<E+(x||0))throw new RangeError('"length" is outside of buffer bounds');let H;return E===void 0&&x===void 0?H=new Uint8Array(S):x===void 0?H=new Uint8Array(S,E):H=new Uint8Array(S,E,x),Object.setPrototypeOf(H,d.prototype),H}function R(S){if(d.isBuffer(S)){const E=N(S.length)|0,x=c(E);return x.length===0||S.copy(x,0,0,E),x}if(S.length!==void 0)return typeof S.length!="number"||Te(S.length)?c(0):T(S);if(S.type==="Buffer"&&Array.isArray(S.data))return T(S.data)}function N(S){if(S>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return S|0}function O(S){return+S!=S&&(S=0),d.alloc(+S)}d.isBuffer=function(E){return E!=null&&E._isBuffer===!0&&E!==d.prototype},d.compare=function(E,x){if(le(E,Uint8Array)&&(E=d.from(E,E.offset,E.byteLength)),le(x,Uint8Array)&&(x=d.from(x,x.offset,x.byteLength)),!d.isBuffer(E)||!d.isBuffer(x))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(E===x)return 0;let H=E.length,W=x.length;for(let fe=0,be=Math.min(H,W);fe<be;++fe)if(E[fe]!==x[fe]){H=E[fe],W=x[fe];break}return H<W?-1:W<H?1:0},d.isEncoding=function(E){switch(String(E).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(E,x){if(!Array.isArray(E))throw new TypeError('"list" argument must be an Array of Buffers');if(E.length===0)return d.alloc(0);let H;if(x===void 0)for(x=0,H=0;H<E.length;++H)x+=E[H].length;const W=d.allocUnsafe(x);let fe=0;for(H=0;H<E.length;++H){let be=E[H];if(le(be,Uint8Array))fe+be.length>W.length?(d.isBuffer(be)||(be=d.from(be)),be.copy(W,fe)):Uint8Array.prototype.set.call(W,be,fe);else if(d.isBuffer(be))be.copy(W,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=be.length}return W};function _(S,E){if(d.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||le(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const x=S.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&x===0)return 0;let W=!1;for(;;)switch(E){case"ascii":case"latin1":case"binary":return x;case"utf8":case"utf-8":return Fe(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x*2;case"hex":return x>>>1;case"base64":return j(S).length;default:if(W)return H?-1:Fe(S).length;E=(""+E).toLowerCase(),W=!0}}d.byteLength=_;function q(S,E,x){let H=!1;if((E===void 0||E<0)&&(E=0),E>this.length||((x===void 0||x>this.length)&&(x=this.length),x<=0)||(x>>>=0,E>>>=0,x<=E))return"";for(S||(S="utf8");;)switch(S){case"hex":return _e(this,E,x);case"utf8":case"utf-8":return Be(this,E,x);case"ascii":return ie(this,E,x);case"latin1":case"binary":return Ne(this,E,x);case"base64":return he(this,E,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,E,x);default:if(H)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),H=!0}}d.prototype._isBuffer=!0;function V(S,E,x){const H=S[E];S[E]=S[x],S[x]=H}d.prototype.swap16=function(){const E=this.length;if(E%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;x<E;x+=2)V(this,x,x+1);return this},d.prototype.swap32=function(){const E=this.length;if(E%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let x=0;x<E;x+=4)V(this,x,x+3),V(this,x+1,x+2);return this},d.prototype.swap64=function(){const E=this.length;if(E%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let x=0;x<E;x+=8)V(this,x,x+7),V(this,x+1,x+6),V(this,x+2,x+5),V(this,x+3,x+4);return this},d.prototype.toString=function(){const E=this.length;return E===0?"":arguments.length===0?Be(this,0,E):q.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(E){if(!d.isBuffer(E))throw new TypeError("Argument must be a Buffer");return this===E?!0:d.compare(this,E)===0},d.prototype.inspect=function(){let E="";const x=n.INSPECT_MAX_BYTES;return E=this.toString("hex",0,x).replace(/(.{2})/g,"$1 ").trim(),this.length>x&&(E+=" ... "),"<Buffer "+E+">"},s&&(d.prototype[s]=d.prototype.inspect),d.prototype.compare=function(E,x,H,W,fe){if(le(E,Uint8Array)&&(E=d.from(E,E.offset,E.byteLength)),!d.isBuffer(E))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof E);if(x===void 0&&(x=0),H===void 0&&(H=E?E.length:0),W===void 0&&(W=0),fe===void 0&&(fe=this.length),x<0||H>E.length||W<0||fe>this.length)throw new RangeError("out of range index");if(W>=fe&&x>=H)return 0;if(W>=fe)return-1;if(x>=H)return 1;if(x>>>=0,H>>>=0,W>>>=0,fe>>>=0,this===E)return 0;let be=fe-W,Le=H-x;const gt=Math.min(be,Le),ft=this.slice(W,fe),bt=E.slice(x,H);for(let ot=0;ot<gt;++ot)if(ft[ot]!==bt[ot]){be=ft[ot],Le=bt[ot];break}return be<Le?-1:Le<be?1:0};function ae(S,E,x,H,W){if(S.length===0)return-1;if(typeof x=="string"?(H=x,x=0):x>2147483647?x=2147483647:x<-2147483648&&(x=-2147483648),x=+x,Te(x)&&(x=W?0:S.length-1),x<0&&(x=S.length+x),x>=S.length){if(W)return-1;x=S.length-1}else if(x<0)if(W)x=0;else return-1;if(typeof E=="string"&&(E=d.from(E,H)),d.isBuffer(E))return E.length===0?-1:ge(S,E,x,H,W);if(typeof E=="number")return E=E&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(S,E,x):Uint8Array.prototype.lastIndexOf.call(S,E,x):ge(S,[E],x,H,W);throw new TypeError("val must be string, number or Buffer")}function ge(S,E,x,H,W){let fe=1,be=S.length,Le=E.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(S.length<2||E.length<2)return-1;fe=2,be/=2,Le/=2,x/=2}function gt(bt,ot){return fe===1?bt[ot]:bt.readUInt16BE(ot*fe)}let ft;if(W){let bt=-1;for(ft=x;ft<be;ft++)if(gt(S,ft)===gt(E,bt===-1?0:ft-bt)){if(bt===-1&&(bt=ft),ft-bt+1===Le)return bt*fe}else bt!==-1&&(ft-=ft-bt),bt=-1}else for(x+Le>be&&(x=be-Le),ft=x;ft>=0;ft--){let bt=!0;for(let ot=0;ot<Le;ot++)if(gt(S,ft+ot)!==gt(E,ot)){bt=!1;break}if(bt)return ft}return-1}d.prototype.includes=function(E,x,H){return this.indexOf(E,x,H)!==-1},d.prototype.indexOf=function(E,x,H){return ae(this,E,x,H,!0)},d.prototype.lastIndexOf=function(E,x,H){return ae(this,E,x,H,!1)};function te(S,E,x,H){x=Number(x)||0;const W=S.length-x;H?(H=Number(H),H>W&&(H=W)):H=W;const fe=E.length;H>fe/2&&(H=fe/2);let be;for(be=0;be<H;++be){const Le=parseInt(E.substr(be*2,2),16);if(Te(Le))return be;S[x+be]=Le}return be}function J(S,E,x,H){return X(Fe(E,S.length-x),S,x,H)}function P(S,E,x,H){return X(nt(E),S,x,H)}function $(S,E,x,H){return X(j(E),S,x,H)}function me(S,E,x,H){return X(lt(E,S.length-x),S,x,H)}d.prototype.write=function(E,x,H,W){if(x===void 0)W="utf8",H=this.length,x=0;else if(H===void 0&&typeof x=="string")W=x,H=this.length,x=0;else if(isFinite(x))x=x>>>0,isFinite(H)?(H=H>>>0,W===void 0&&(W="utf8")):(W=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-x;if((H===void 0||H>fe)&&(H=fe),E.length>0&&(H<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let be=!1;for(;;)switch(W){case"hex":return te(this,E,x,H);case"utf8":case"utf-8":return J(this,E,x,H);case"ascii":case"latin1":case"binary":return P(this,E,x,H);case"base64":return $(this,E,x,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,E,x,H);default:if(be)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),be=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(S,E,x){return E===0&&x===S.length?r.fromByteArray(S):r.fromByteArray(S.slice(E,x))}function Be(S,E,x){x=Math.min(S.length,x);const H=[];let W=E;for(;W<x;){const fe=S[W];let be=null,Le=fe>239?4:fe>223?3:fe>191?2:1;if(W+Le<=x){let gt,ft,bt,ot;switch(Le){case 1:fe<128&&(be=fe);break;case 2:gt=S[W+1],(gt&192)===128&&(ot=(fe&31)<<6|gt&63,ot>127&&(be=ot));break;case 3:gt=S[W+1],ft=S[W+2],(gt&192)===128&&(ft&192)===128&&(ot=(fe&15)<<12|(gt&63)<<6|ft&63,ot>2047&&(ot<55296||ot>57343)&&(be=ot));break;case 4:gt=S[W+1],ft=S[W+2],bt=S[W+3],(gt&192)===128&&(ft&192)===128&&(bt&192)===128&&(ot=(fe&15)<<18|(gt&63)<<12|(ft&63)<<6|bt&63,ot>65535&&ot<1114112&&(be=ot))}}be===null?(be=65533,Le=1):be>65535&&(be-=65536,H.push(be>>>10&1023|55296),be=56320|be&1023),H.push(be),W+=Le}return K(H)}const pe=4096;function K(S){const E=S.length;if(E<=pe)return String.fromCharCode.apply(String,S);let x="",H=0;for(;H<E;)x+=String.fromCharCode.apply(String,S.slice(H,H+=pe));return x}function ie(S,E,x){let H="";x=Math.min(S.length,x);for(let W=E;W<x;++W)H+=String.fromCharCode(S[W]&127);return H}function Ne(S,E,x){let H="";x=Math.min(S.length,x);for(let W=E;W<x;++W)H+=String.fromCharCode(S[W]);return H}function _e(S,E,x){const H=S.length;(!E||E<0)&&(E=0),(!x||x<0||x>H)&&(x=H);let W="";for(let fe=E;fe<x;++fe)W+=Re[S[fe]];return W}function G(S,E,x){const H=S.slice(E,x);let W="";for(let fe=0;fe<H.length-1;fe+=2)W+=String.fromCharCode(H[fe]+H[fe+1]*256);return W}d.prototype.slice=function(E,x){const H=this.length;E=~~E,x=x===void 0?H:~~x,E<0?(E+=H,E<0&&(E=0)):E>H&&(E=H),x<0?(x+=H,x<0&&(x=0)):x>H&&(x=H),x<E&&(x=E);const W=this.subarray(E,x);return Object.setPrototypeOf(W,d.prototype),W};function ne(S,E,x){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+E>x)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E],fe=1,be=0;for(;++be<x&&(fe*=256);)W+=this[E+be]*fe;return W},d.prototype.readUintBE=d.prototype.readUIntBE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E+--x],fe=1;for(;x>0&&(fe*=256);)W+=this[E+--x]*fe;return W},d.prototype.readUint8=d.prototype.readUInt8=function(E,x){return E=E>>>0,x||ne(E,1,this.length),this[E]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(E,x){return E=E>>>0,x||ne(E,2,this.length),this[E]|this[E+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(E,x){return E=E>>>0,x||ne(E,2,this.length),this[E]<<8|this[E+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),(this[E]|this[E+1]<<8|this[E+2]<<16)+this[E+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]*16777216+(this[E+1]<<16|this[E+2]<<8|this[E+3])},d.prototype.readBigUInt64LE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=x+this[++E]*2**8+this[++E]*2**16+this[++E]*2**24,fe=this[++E]+this[++E]*2**8+this[++E]*2**16+H*2**24;return BigInt(W)+(BigInt(fe)<<BigInt(32))}),d.prototype.readBigUInt64BE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=x*2**24+this[++E]*2**16+this[++E]*2**8+this[++E],fe=this[++E]*2**24+this[++E]*2**16+this[++E]*2**8+H;return(BigInt(W)<<BigInt(32))+BigInt(fe)}),d.prototype.readIntLE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=this[E],fe=1,be=0;for(;++be<x&&(fe*=256);)W+=this[E+be]*fe;return fe*=128,W>=fe&&(W-=Math.pow(2,8*x)),W},d.prototype.readIntBE=function(E,x,H){E=E>>>0,x=x>>>0,H||ne(E,x,this.length);let W=x,fe=1,be=this[E+--W];for(;W>0&&(fe*=256);)be+=this[E+--W]*fe;return fe*=128,be>=fe&&(be-=Math.pow(2,8*x)),be},d.prototype.readInt8=function(E,x){return E=E>>>0,x||ne(E,1,this.length),this[E]&128?(255-this[E]+1)*-1:this[E]},d.prototype.readInt16LE=function(E,x){E=E>>>0,x||ne(E,2,this.length);const H=this[E]|this[E+1]<<8;return H&32768?H|4294901760:H},d.prototype.readInt16BE=function(E,x){E=E>>>0,x||ne(E,2,this.length);const H=this[E+1]|this[E]<<8;return H&32768?H|4294901760:H},d.prototype.readInt32LE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]|this[E+1]<<8|this[E+2]<<16|this[E+3]<<24},d.prototype.readInt32BE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),this[E]<<24|this[E+1]<<16|this[E+2]<<8|this[E+3]},d.prototype.readBigInt64LE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=this[E+4]+this[E+5]*2**8+this[E+6]*2**16+(H<<24);return(BigInt(W)<<BigInt(32))+BigInt(x+this[++E]*2**8+this[++E]*2**16+this[++E]*2**24)}),d.prototype.readBigInt64BE=xe(function(E){E=E>>>0,Ht(E,"offset");const x=this[E],H=this[E+7];(x===void 0||H===void 0)&&jt(E,this.length-8);const W=(x<<24)+this[++E]*2**16+this[++E]*2**8+this[++E];return(BigInt(W)<<BigInt(32))+BigInt(this[++E]*2**24+this[++E]*2**16+this[++E]*2**8+H)}),d.prototype.readFloatLE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),a.read(this,E,!0,23,4)},d.prototype.readFloatBE=function(E,x){return E=E>>>0,x||ne(E,4,this.length),a.read(this,E,!1,23,4)},d.prototype.readDoubleLE=function(E,x){return E=E>>>0,x||ne(E,8,this.length),a.read(this,E,!0,52,8)},d.prototype.readDoubleBE=function(E,x){return E=E>>>0,x||ne(E,8,this.length),a.read(this,E,!1,52,8)};function Ee(S,E,x,H,W,fe){if(!d.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(E>W||E<fe)throw new RangeError('"value" argument is out of bounds');if(x+H>S.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(E,x,H,W){if(E=+E,x=x>>>0,H=H>>>0,!W){const Le=Math.pow(2,8*H)-1;Ee(this,E,x,H,Le,0)}let fe=1,be=0;for(this[x]=E&255;++be<H&&(fe*=256);)this[x+be]=E/fe&255;return x+H},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(E,x,H,W){if(E=+E,x=x>>>0,H=H>>>0,!W){const Le=Math.pow(2,8*H)-1;Ee(this,E,x,H,Le,0)}let fe=H-1,be=1;for(this[x+fe]=E&255;--fe>=0&&(be*=256);)this[x+fe]=E/be&255;return x+H},d.prototype.writeUint8=d.prototype.writeUInt8=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,1,255,0),this[x]=E&255,x+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,65535,0),this[x]=E&255,this[x+1]=E>>>8,x+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,65535,0),this[x]=E>>>8,this[x+1]=E&255,x+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,4294967295,0),this[x+3]=E>>>24,this[x+2]=E>>>16,this[x+1]=E>>>8,this[x]=E&255,x+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,4294967295,0),this[x]=E>>>24,this[x+1]=E>>>16,this[x+2]=E>>>8,this[x+3]=E&255,x+4};function ke(S,E,x,H,W){Lt(E,H,W,S,x,7);let fe=Number(E&BigInt(4294967295));S[x++]=fe,fe=fe>>8,S[x++]=fe,fe=fe>>8,S[x++]=fe,fe=fe>>8,S[x++]=fe;let be=Number(E>>BigInt(32)&BigInt(4294967295));return S[x++]=be,be=be>>8,S[x++]=be,be=be>>8,S[x++]=be,be=be>>8,S[x++]=be,x}function He(S,E,x,H,W){Lt(E,H,W,S,x,7);let fe=Number(E&BigInt(4294967295));S[x+7]=fe,fe=fe>>8,S[x+6]=fe,fe=fe>>8,S[x+5]=fe,fe=fe>>8,S[x+4]=fe;let be=Number(E>>BigInt(32)&BigInt(4294967295));return S[x+3]=be,be=be>>8,S[x+2]=be,be=be>>8,S[x+1]=be,be=be>>8,S[x]=be,x+8}d.prototype.writeBigUInt64LE=xe(function(E,x=0){return ke(this,E,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=xe(function(E,x=0){return He(this,E,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(E,x,H,W){if(E=+E,x=x>>>0,!W){const gt=Math.pow(2,8*H-1);Ee(this,E,x,H,gt-1,-gt)}let fe=0,be=1,Le=0;for(this[x]=E&255;++fe<H&&(be*=256);)E<0&&Le===0&&this[x+fe-1]!==0&&(Le=1),this[x+fe]=(E/be>>0)-Le&255;return x+H},d.prototype.writeIntBE=function(E,x,H,W){if(E=+E,x=x>>>0,!W){const gt=Math.pow(2,8*H-1);Ee(this,E,x,H,gt-1,-gt)}let fe=H-1,be=1,Le=0;for(this[x+fe]=E&255;--fe>=0&&(be*=256);)E<0&&Le===0&&this[x+fe+1]!==0&&(Le=1),this[x+fe]=(E/be>>0)-Le&255;return x+H},d.prototype.writeInt8=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,1,127,-128),E<0&&(E=255+E+1),this[x]=E&255,x+1},d.prototype.writeInt16LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,32767,-32768),this[x]=E&255,this[x+1]=E>>>8,x+2},d.prototype.writeInt16BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,2,32767,-32768),this[x]=E>>>8,this[x+1]=E&255,x+2},d.prototype.writeInt32LE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,2147483647,-2147483648),this[x]=E&255,this[x+1]=E>>>8,this[x+2]=E>>>16,this[x+3]=E>>>24,x+4},d.prototype.writeInt32BE=function(E,x,H){return E=+E,x=x>>>0,H||Ee(this,E,x,4,2147483647,-2147483648),E<0&&(E=4294967295+E+1),this[x]=E>>>24,this[x+1]=E>>>16,this[x+2]=E>>>8,this[x+3]=E&255,x+4},d.prototype.writeBigInt64LE=xe(function(E,x=0){return ke(this,E,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=xe(function(E,x=0){return He(this,E,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(S,E,x,H,W,fe){if(x+H>S.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("Index out of range")}function Ge(S,E,x,H,W){return E=+E,x=x>>>0,W||Ke(S,E,x,4),a.write(S,E,x,H,23,4),x+4}d.prototype.writeFloatLE=function(E,x,H){return Ge(this,E,x,!0,H)},d.prototype.writeFloatBE=function(E,x,H){return Ge(this,E,x,!1,H)};function yt(S,E,x,H,W){return E=+E,x=x>>>0,W||Ke(S,E,x,8),a.write(S,E,x,H,52,8),x+8}d.prototype.writeDoubleLE=function(E,x,H){return yt(this,E,x,!0,H)},d.prototype.writeDoubleBE=function(E,x,H){return yt(this,E,x,!1,H)},d.prototype.copy=function(E,x,H,W){if(!d.isBuffer(E))throw new TypeError("argument should be a Buffer");if(H||(H=0),!W&&W!==0&&(W=this.length),x>=E.length&&(x=E.length),x||(x=0),W>0&&W<H&&(W=H),W===H||E.length===0||this.length===0)return 0;if(x<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),E.length-x<W-H&&(W=E.length-x+H);const fe=W-H;return this===E&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(x,H,W):Uint8Array.prototype.set.call(E,this.subarray(H,W),x),fe},d.prototype.fill=function(E,x,H,W){if(typeof E=="string"){if(typeof x=="string"?(W=x,x=0,H=this.length):typeof H=="string"&&(W=H,H=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!d.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(E.length===1){const be=E.charCodeAt(0);(W==="utf8"&&be<128||W==="latin1")&&(E=be)}}else typeof E=="number"?E=E&255:typeof E=="boolean"&&(E=Number(E));if(x<0||this.length<x||this.length<H)throw new RangeError("Out of range index");if(H<=x)return this;x=x>>>0,H=H===void 0?this.length:H>>>0,E||(E=0);let fe;if(typeof E=="number")for(fe=x;fe<H;++fe)this[fe]=E;else{const be=d.isBuffer(E)?E:d.from(E,W),Le=be.length;if(Le===0)throw new TypeError('The value "'+E+'" is invalid for argument "value"');for(fe=0;fe<H-x;++fe)this[fe+x]=be[fe%Le]}return this};const We={};function Et(S,E,x){We[S]=class extends x{constructor(){super(),Object.defineProperty(this,"message",{value:E.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}Et("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Et("ERR_INVALID_ARG_TYPE",function(S,E){return`The "${S}" argument must be of type number. Received type ${typeof E}`},TypeError),Et("ERR_OUT_OF_RANGE",function(S,E,x){let H=`The value of "${S}" is out of range.`,W=x;return Number.isInteger(x)&&Math.abs(x)>2**32?W=Kt(String(x)):typeof x=="bigint"&&(W=String(x),(x>BigInt(2)**BigInt(32)||x<-(BigInt(2)**BigInt(32)))&&(W=Kt(W)),W+="n"),H+=` It must be ${E}. Received ${W}`,H},RangeError);function Kt(S){let E="",x=S.length;const H=S[0]==="-"?1:0;for(;x>=H+4;x-=3)E=`_${S.slice(x-3,x)}${E}`;return`${S.slice(0,x)}${E}`}function Nr(S,E,x){Ht(E,"offset"),(S[E]===void 0||S[E+x]===void 0)&&jt(E,S.length-(x+1))}function Lt(S,E,x,H,W,fe){if(S>x||S<E){const be=typeof E=="bigint"?"n":"";let Le;throw E===0||E===BigInt(0)?Le=`>= 0${be} and < 2${be} ** ${(fe+1)*8}${be}`:Le=`>= -(2${be} ** ${(fe+1)*8-1}${be}) and < 2 ** ${(fe+1)*8-1}${be}`,new We.ERR_OUT_OF_RANGE("value",Le,S)}Nr(H,W,fe)}function Ht(S,E){if(typeof S!="number")throw new We.ERR_INVALID_ARG_TYPE(E,"number",S)}function jt(S,E,x){throw Math.floor(S)!==S?(Ht(S,x),new We.ERR_OUT_OF_RANGE("offset","an integer",S)):E<0?new We.ERR_BUFFER_OUT_OF_BOUNDS:new We.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${E}`,S)}const br=/[^+/0-9A-Za-z-_]/g;function Qe(S){if(S=S.split("=")[0],S=S.trim().replace(br,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function Fe(S,E){E=E||1/0;let x;const H=S.length;let W=null;const fe=[];for(let be=0;be<H;++be){if(x=S.charCodeAt(be),x>55295&&x<57344){if(!W){if(x>56319){(E-=3)>-1&&fe.push(239,191,189);continue}else if(be+1===H){(E-=3)>-1&&fe.push(239,191,189);continue}W=x;continue}if(x<56320){(E-=3)>-1&&fe.push(239,191,189),W=x;continue}x=(W-55296<<10|x-56320)+65536}else W&&(E-=3)>-1&&fe.push(239,191,189);if(W=null,x<128){if((E-=1)<0)break;fe.push(x)}else if(x<2048){if((E-=2)<0)break;fe.push(x>>6|192,x&63|128)}else if(x<65536){if((E-=3)<0)break;fe.push(x>>12|224,x>>6&63|128,x&63|128)}else if(x<1114112){if((E-=4)<0)break;fe.push(x>>18|240,x>>12&63|128,x>>6&63|128,x&63|128)}else throw new Error("Invalid code point")}return fe}function nt(S){const E=[];for(let x=0;x<S.length;++x)E.push(S.charCodeAt(x)&255);return E}function lt(S,E){let x,H,W;const fe=[];for(let be=0;be<S.length&&!((E-=2)<0);++be)x=S.charCodeAt(be),H=x>>8,W=x%256,fe.push(W),fe.push(H);return fe}function j(S){return r.toByteArray(Qe(S))}function X(S,E,x,H){let W;for(W=0;W<H&&!(W+x>=E.length||W>=S.length);++W)E[W+x]=S[W];return W}function le(S,E){return S instanceof E||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===E.name}function Te(S){return S!==S}const Re=function(){const S="0123456789abcdef",E=new Array(256);for(let x=0;x<16;++x){const H=x*16;for(let W=0;W<16;++W)E[H+W]=S[x]+S[W]}return E}();function xe(S){return typeof BigInt>"u"?Ve:S}function Ve(){throw new Error("BigInt not supported")}}(Qf)),Qf}var Xi=sC(),Nu={exports:{}},lC=Nu.exports,pm;function oC(){return pm||(pm=1,function(n,r){(function(a,s){n.exports=s()})(lC,function(){return(()=>{var a,s,o={773:(d,m,A)=>{var b,v=typeof self<"u"&&self.Module!==void 0?self.Module:{},B={};for(b in v)v.hasOwnProperty(b)&&(B[b]=v[b]);var T,Q,k,R;T=typeof window=="object",Q=typeof importScripts=="function",k=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",R=!T&&!k&&!Q;var N,O,_,q,V,ae="";k?(ae=Q?A(967).dirname(ae)+"/":"//",N=function(Qe,Fe){return q||(q=A(145)),V||(V=A(967)),Qe=V.normalize(Qe),q.readFileSync(Qe,Fe?null:"utf8")},_=function(Qe){var Fe=N(Qe,!0);return Fe.buffer||(Fe=new Uint8Array(Fe)),$(Fe.buffer),Fe},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),d.exports=v,process.on("uncaughtException",function(Qe){if(!(Qe instanceof jt))throw Qe}),process.on("unhandledRejection",Ee),v.inspect=function(){return"[Emscripten Module object]"}):R?(typeof read<"u"&&(N=function(Qe){return read(Qe)}),_=function(Qe){var Fe;return typeof readbuffer=="function"?new Uint8Array(readbuffer(Qe)):($(typeof(Fe=read(Qe,"binary"))=="object"),Fe)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(T||Q)&&(Q?ae=self.location.href:typeof document<"u"&&document.currentScript&&(ae=document.currentScript.src),ae=ae.indexOf("blob:")!==0?ae.substr(0,ae.lastIndexOf("/")+1):"",N=function(Qe){var Fe=new XMLHttpRequest;return Fe.open("GET",Qe,!1),Fe.send(null),Fe.responseText},Q&&(_=function(Qe){var Fe=new XMLHttpRequest;return Fe.open("GET",Qe,!1),Fe.responseType="arraybuffer",Fe.send(null),new Uint8Array(Fe.response)}),O=function(Qe,Fe,nt){var lt=new XMLHttpRequest;lt.open("GET",Qe,!0),lt.responseType="arraybuffer",lt.onload=function(){lt.status==200||lt.status==0&&lt.response?Fe(lt.response):nt()},lt.onerror=nt,lt.send(null)}),v.print||console.log.bind(console);var ge,te,J=v.printErr||console.warn.bind(console);for(b in B)B.hasOwnProperty(b)&&(v[b]=B[b]);B=null,v.arguments&&v.arguments,v.thisProgram&&v.thisProgram,v.quit&&v.quit,v.wasmBinary&&(ge=v.wasmBinary),v.noExitRuntime,typeof WebAssembly!="object"&&Ee("no native wasm support detected");var P=!1;function $(Qe,Fe){Qe||Ee("Assertion failed: "+Fe)}var me,he,Be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function pe(Qe){me=Qe,v.HEAP8=new Int8Array(Qe),v.HEAP16=new Int16Array(Qe),v.HEAP32=new Int32Array(Qe),v.HEAPU8=he=new Uint8Array(Qe),v.HEAPU16=new Uint16Array(Qe),v.HEAPU32=new Uint32Array(Qe),v.HEAPF32=new Float32Array(Qe),v.HEAPF64=new Float64Array(Qe)}v.INITIAL_MEMORY;var K,ie=[],Ne=[],_e=[],G=0,ne=null;function Ee(Qe){throw v.onAbort&&v.onAbort(Qe),J(Qe+=""),P=!0,Qe="abort("+Qe+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(Qe)}function ke(Qe){return Qe.startsWith("data:application/octet-stream;base64,")}function He(Qe){return Qe.startsWith("file://")}v.preloadedImages={},v.preloadedAudios={};var Ke,Ge="argon2.wasm";function yt(Qe){try{if(Qe==Ge&&ge)return new Uint8Array(ge);if(_)return _(Qe);throw"both async and sync fetching of the wasm failed"}catch(Fe){Ee(Fe)}}function We(Qe){for(;Qe.length>0;){var Fe=Qe.shift();if(typeof Fe!="function"){var nt=Fe.func;typeof nt=="number"?Fe.arg===void 0?K.get(nt)():K.get(nt)(Fe.arg):nt(Fe.arg===void 0?null:Fe.arg)}else Fe(v)}}function Et(Qe){try{return te.grow(Qe-me.byteLength+65535>>>16),pe(te.buffer),1}catch{}}ke(Ge)||(Ke=Ge,Ge=v.locateFile?v.locateFile(Ke,ae):ae+Ke);var Kt,Nr={a:function(Qe,Fe,nt){he.copyWithin(Qe,Fe,Fe+nt)},b:function(Qe){var Fe,nt=he.length,lt=2147418112;if((Qe>>>=0)>lt)return!1;for(var j=1;j<=4;j*=2){var X=nt*(1+.2/j);if(X=Math.min(X,Qe+100663296),Et(Math.min(lt,((Fe=Math.max(Qe,X))%65536>0&&(Fe+=65536-Fe%65536),Fe))))return!0}return!1}},Lt=(function(){var Qe={a:Nr};function Fe(j,X){var le,Te=j.exports;v.asm=Te,pe((te=v.asm.c).buffer),K=v.asm.k,le=v.asm.d,Ne.unshift(le),function(Re){if(G--,v.monitorRunDependencies&&v.monitorRunDependencies(G),G==0&&ne){var xe=ne;ne=null,xe()}}()}function nt(j){Fe(j.instance)}function lt(j){return function(){if(!ge&&(T||Q)){if(typeof fetch=="function"&&!He(Ge))return fetch(Ge,{credentials:"same-origin"}).then(function(X){if(!X.ok)throw"failed to load wasm binary file at '"+Ge+"'";return X.arrayBuffer()}).catch(function(){return yt(Ge)});if(O)return new Promise(function(X,le){O(Ge,function(Te){X(new Uint8Array(Te))},le)})}return Promise.resolve().then(function(){return yt(Ge)})}().then(function(X){return WebAssembly.instantiate(X,Qe)}).then(j,function(X){J("failed to asynchronously prepare wasm: "+X),Ee(X)})}if(G++,v.monitorRunDependencies&&v.monitorRunDependencies(G),v.instantiateWasm)try{return v.instantiateWasm(Qe,Fe)}catch(j){return J("Module.instantiateWasm callback failed with error: "+j),!1}ge||typeof WebAssembly.instantiateStreaming!="function"||ke(Ge)||He(Ge)||typeof fetch!="function"?lt(nt):fetch(Ge,{credentials:"same-origin"}).then(function(j){return WebAssembly.instantiateStreaming(j,Qe).then(nt,function(X){return J("wasm streaming compile failed: "+X),J("falling back to ArrayBuffer instantiation"),lt(nt)})})}(),v.___wasm_call_ctors=function(){return(v.___wasm_call_ctors=v.asm.d).apply(null,arguments)},v._argon2_hash=function(){return(v._argon2_hash=v.asm.e).apply(null,arguments)},v._malloc=function(){return(Lt=v._malloc=v.asm.f).apply(null,arguments)}),Ht=(v._free=function(){return(v._free=v.asm.g).apply(null,arguments)},v._argon2_verify=function(){return(v._argon2_verify=v.asm.h).apply(null,arguments)},v._argon2_error_message=function(){return(v._argon2_error_message=v.asm.i).apply(null,arguments)},v._argon2_encodedlen=function(){return(v._argon2_encodedlen=v.asm.j).apply(null,arguments)},v._argon2_hash_ext=function(){return(v._argon2_hash_ext=v.asm.l).apply(null,arguments)},v._argon2_verify_ext=function(){return(v._argon2_verify_ext=v.asm.m).apply(null,arguments)},v.stackAlloc=function(){return(Ht=v.stackAlloc=v.asm.n).apply(null,arguments)});function jt(Qe){this.name="ExitStatus",this.message="Program terminated with exit("+Qe+")",this.status=Qe}function br(Qe){function Fe(){Kt||(Kt=!0,v.calledRun=!0,P||(We(Ne),v.onRuntimeInitialized&&v.onRuntimeInitialized(),function(){if(v.postRun)for(typeof v.postRun=="function"&&(v.postRun=[v.postRun]);v.postRun.length;)nt=v.postRun.shift(),_e.unshift(nt);var nt;We(_e)}()))}G>0||(function(){if(v.preRun)for(typeof v.preRun=="function"&&(v.preRun=[v.preRun]);v.preRun.length;)nt=v.preRun.shift(),ie.unshift(nt);var nt;We(ie)}(),G>0||(v.setStatus?(v.setStatus("Running..."),setTimeout(function(){setTimeout(function(){v.setStatus("")},1),Fe()},1)):Fe()))}if(v.allocate=function(Qe,Fe){var nt;return nt=Fe==1?Ht(Qe.length):Lt(Qe.length),Qe.subarray||Qe.slice?he.set(Qe,nt):he.set(new Uint8Array(Qe),nt),nt},v.UTF8ToString=function(Qe,Fe){return Qe?function(nt,lt,j){for(var X=lt+j,le=lt;nt[le]&&!(le>=X);)++le;if(le-lt>16&&nt.subarray&&Be)return Be.decode(nt.subarray(lt,le));for(var Te="";lt<le;){var Re=nt[lt++];if(128&Re){var xe=63&nt[lt++];if((224&Re)!=192){var Ve=63&nt[lt++];if((Re=(240&Re)==224?(15&Re)<<12|xe<<6|Ve:(7&Re)<<18|xe<<12|Ve<<6|63&nt[lt++])<65536)Te+=String.fromCharCode(Re);else{var S=Re-65536;Te+=String.fromCharCode(55296|S>>10,56320|1023&S)}}else Te+=String.fromCharCode((31&Re)<<6|xe)}else Te+=String.fromCharCode(Re)}return Te}(he,Qe,Fe):""},v.ALLOC_NORMAL=0,ne=function Qe(){Kt||br(),Kt||(ne=Qe)},v.run=br,v.preInit)for(typeof v.preInit=="function"&&(v.preInit=[v.preInit]);v.preInit.length>0;)v.preInit.pop()();br(),d.exports=v,v.unloadRuntime=function(){typeof self<"u"&&delete self.Module,v=te=K=me=he=void 0,delete d.exports}},631:function(d,m,A){var b,v;(v=typeof(b=function(){const B=typeof self<"u"?self:this,T={Argon2d:0,Argon2i:1,Argon2id:2};function Q(_){if(Q._promise)return Q._promise;if(Q._module)return Promise.resolve(Q._module);let q;return q=B.process&&B.process.versions&&B.process.versions.node?k().then(V=>new Promise(ae=>{V.postRun=()=>ae(V)})):(B.loadArgon2WasmBinary?B.loadArgon2WasmBinary():Promise.resolve(A(721)).then(V=>function(ae){const ge=atob(ae),te=new Uint8Array(new ArrayBuffer(ge.length));for(let J=0;J<ge.length;J++)te[J]=ge.charCodeAt(J);return te}(V))).then(V=>function(ae,ge){return new Promise(te=>(B.Module={wasmBinary:ae,wasmMemory:ge,postRun(){te(Module)}},k()))}(V,_?function(ae){const P=Math.min(Math.max(Math.ceil(ae*1024/65536),256)+256,32767);return new WebAssembly.Memory({initial:P,maximum:32767})}(_):void 0)),Q._promise=q,q.then(V=>(Q._module=V,delete Q._promise,V))}function k(){return B.loadArgon2WasmModule?B.loadArgon2WasmModule():Promise.resolve(A(773))}function R(_,q){return _.allocate(q,"i8",_.ALLOC_NORMAL)}function N(_,q){return R(_,new Uint8Array([...q,0]))}function O(_){if(typeof _!="string")return _;if(typeof TextEncoder=="function")return new TextEncoder().encode(_);if(typeof Buffer=="function")return Buffer.from(_);throw new Error("Don't know how to encode UTF8")}return{ArgonType:T,hash:function(_){const q=_.mem||1024;return Q(q).then(V=>{const ae=_.time||1,ge=_.parallelism||1,te=O(_.pass),J=N(V,te),P=te.length,$=O(_.salt),me=N(V,$),he=$.length,Be=_.type||T.Argon2d,pe=V.allocate(new Array(_.hashLen||24),"i8",V.ALLOC_NORMAL),K=_.secret?R(V,_.secret):0,ie=_.secret?_.secret.byteLength:0,Ne=_.ad?R(V,_.ad):0,_e=_.ad?_.ad.byteLength:0,G=_.hashLen||24,ne=V._argon2_encodedlen(ae,q,ge,he,G,Be),Ee=V.allocate(new Array(ne+1),"i8",V.ALLOC_NORMAL);let ke,He,Ke;try{He=V._argon2_hash_ext(ae,q,ge,J,P,me,he,pe,G,Ee,ne,Be,K,ie,Ne,_e,19)}catch(Ge){ke=Ge}if(He!==0||ke){try{ke||(ke=V.UTF8ToString(V._argon2_error_message(He)))}catch{}Ke={message:ke,code:He}}else{let Ge="";const yt=new Uint8Array(G);for(let We=0;We<G;We++){const Et=V.HEAP8[pe+We];yt[We]=Et,Ge+=("0"+(255&Et).toString(16)).slice(-2)}Ke={hash:yt,hashHex:Ge,encoded:V.UTF8ToString(Ee)}}try{V._free(J),V._free(me),V._free(pe),V._free(Ee),Ne&&V._free(Ne),K&&V._free(K)}catch{}if(ke)throw Ke;return Ke})},verify:function(_){return Q().then(q=>{const V=O(_.pass),ae=N(q,V),ge=V.length,te=_.secret?R(q,_.secret):0,J=_.secret?_.secret.byteLength:0,P=_.ad?R(q,_.ad):0,$=_.ad?_.ad.byteLength:0,me=N(q,O(_.encoded));let he,Be,pe,K=_.type;if(K===void 0){let ie=_.encoded.split("$")[1];ie&&(ie=ie.replace("a","A"),K=T[ie]||T.Argon2d)}try{Be=q._argon2_verify_ext(me,ae,ge,te,J,P,$,K)}catch(ie){he=ie}if(Be||he){try{he||(he=q.UTF8ToString(q._argon2_error_message(Be)))}catch{}pe={message:he,code:Be}}try{q._free(ae),q._free(me)}catch{}if(he)throw pe;return pe})},unloadRuntime:function(){Q._module&&(Q._module.unloadRuntime(),delete Q._promise,delete Q._module)}}})=="function"?b.apply(m,[]):b)===void 0||(d.exports=v)},721:function(d,m){d.exports=" "},145:()=>{},967:()=>{}},u={};function c(d){var m=u[d];if(m!==void 0)return m.exports;var A=u[d]={exports:{}};return o[d].call(A.exports,A,A.exports,c),A.exports}return s=Object.getPrototypeOf?d=>Object.getPrototypeOf(d):d=>d.__proto__,c.t=function(d,m){if(1&m&&(d=this(d)),8&m||typeof d=="object"&&d&&(4&m&&d.__esModule||16&m&&typeof d.then=="function"))return d;var A=Object.create(null);c.r(A);var b={};a=a||[null,s({}),s([]),s(s)];for(var v=2&m&&d;typeof v=="object"&&!~a.indexOf(v);v=s(v))Object.getOwnPropertyNames(v).forEach(B=>b[B]=()=>d[B]);return b.default=()=>d,c.d(A,b),A},c.d=(d,m)=>{for(var A in m)c.o(m,A)&&!c.o(d,A)&&Object.defineProperty(d,A,{enumerable:!0,get:m[A]})},c.o=(d,m)=>Object.prototype.hasOwnProperty.call(d,m),c.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},c(631)})()})}(Nu)),Nu.exports}var uC=oC();const cC=xi(uC);class Yt{static async deriveKeyFromPassword(r,a,s="Argon2Id",o='{"Iterations":2,"MemorySize":19456,"DegreeOfParallelism":1}'){const u=JSON.parse(o);try{if(s!=="Argon2Id")throw new Error("Unsupported encryption type");return(await cC.hash({pass:r,salt:a,time:u.Iterations,mem:u.MemorySize,parallelism:u.DegreeOfParallelism,hashLen:32,type:2})).hash}catch(c){throw console.error("Argon2 hashing failed:",c),c}}static async symmetricEncrypt(r,a){if(!r)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),A=>A.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["encrypt"]),o=crypto.getRandomValues(new Uint8Array(12)),c=new TextEncoder().encode(r),d=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},s,c),m=new Uint8Array(o.length+d.byteLength);return m.set(o,0),m.set(new Uint8Array(d),o.length),btoa(Array.from(m).map(A=>String.fromCharCode(A)).join(""))}static async symmetricDecrypt(r,a){if(!r)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),A=>A.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),o=Uint8Array.from(atob(r),A=>A.charCodeAt(0)),u=o.slice(0,12),c=o.slice(12),d=await crypto.subtle.decrypt({name:"AES-GCM",iv:u},s,c);return new TextDecoder().decode(d)}static async symmetricDecryptBytes(r,a){if(!r||r.length===0)return r;const s=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),d=>d.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),o=r.slice(0,12),u=r.slice(12),c=await crypto.subtle.decrypt({name:"AES-GCM",iv:o},s,u);return new Uint8Array(c)}static async generateRsaKeyPair(){const r=await crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),a=await crypto.subtle.exportKey("jwk",r.publicKey),s=await crypto.subtle.exportKey("jwk",r.privateKey);return{publicKey:JSON.stringify(a),privateKey:JSON.stringify(s)}}static async encryptWithPublicKey(r,a){const s=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),o=new TextEncoder().encode(r),u=await crypto.subtle.encrypt({name:"RSA-OAEP"},s,o);return btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(u))))}static async decryptWithPrivateKey(r,a){try{const s=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),o=Uint8Array.from(atob(r),c=>c.charCodeAt(0)),u=await crypto.subtle.decrypt({name:"RSA-OAEP"},s,o);return new Uint8Array(u)}catch(s){throw console.error("RSA decryption failed:",s),new Error(`Failed to decrypt: ${s instanceof Error?s.message:"Unknown error"}`)}}static async decryptEmail(r,a){try{const s=a.find(d=>d.PublicKey===r.encryptionKey);if(!s)throw new Error("Encryption key not found");const o=await Yt.decryptWithPrivateKey(r.encryptedSymmetricKey,s.PrivateKey),u=Xi.Buffer.from(o).toString("base64"),c={...r};return c.subject=await Yt.symmetricDecrypt(r.subject,u),c.fromDisplay=await Yt.symmetricDecrypt(r.fromDisplay,u),c.fromDomain=await Yt.symmetricDecrypt(r.fromDomain,u),c.fromLocal=await Yt.symmetricDecrypt(r.fromLocal,u),r.messageHtml&&(c.messageHtml=await Yt.symmetricDecrypt(r.messageHtml,u)),r.messagePlain&&(c.messagePlain=await Yt.symmetricDecrypt(r.messagePlain,u)),c}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt email")}}static async decryptEmailList(r,a){return Promise.all(r.map(async s=>{try{const o=a.find(m=>m.PublicKey===s.encryptionKey);if(!o)throw new Error("Encryption key not found");const u=await Yt.decryptWithPrivateKey(s.encryptedSymmetricKey,o.PrivateKey),c=Xi.Buffer.from(u).toString("base64"),d={...s};return d.subject=await Yt.symmetricDecrypt(s.subject,c),d.fromDisplay=await Yt.symmetricDecrypt(s.fromDisplay,c),d.fromDomain=await Yt.symmetricDecrypt(s.fromDomain,c),d.fromLocal=await Yt.symmetricDecrypt(s.fromLocal,c),s.messagePreview&&(d.messagePreview=await Yt.symmetricDecrypt(s.messagePreview,c)),d}catch(o){throw new Error(o instanceof Error?o.message:"Failed to decrypt email")}}))}static async decryptAttachment(r,a,s){try{const o=s.find(d=>d.PublicKey===a.encryptionKey);if(!o)throw new Error("Encryption key not found");const u=await Yt.decryptWithPrivateKey(a.encryptedSymmetricKey,o.PrivateKey),c=Xi.Buffer.from(u).toString("base64");return await Yt.symmetricDecryptBytes(r,c)}catch(o){throw new Error(o instanceof Error?o.message:"Failed to decrypt attachment")}}}var Df={exports:{}};const dC={},fC=Object.freeze(Object.defineProperty({__proto__:null,default:dC},Symbol.toStringTag,{value:"Module"})),ym=Nb(fC);var Em;function AC(){return Em||(Em=1,function(n,r){var a=void 0,s=function(o){return a||(a=new Promise(function(u,c){var d=typeof o<"u"?o:{},m=d.onAbort;d.onAbort=function(h){c(new Error(h)),m&&m(h)},d.postRun=d.postRun||[],d.postRun.push(function(){u(d)}),n=void 0;var A;A||(A=typeof d<"u"?d:{});var b=typeof window=="object",v=typeof WorkerGlobalScope<"u",B=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";A.onRuntimeInitialized=function(){function h(se,De){switch(typeof De){case"boolean":Nc(se,De?1:0);break;case"number":Ic(se,De);break;case"string":Bc(se,De,-1,-1);break;case"object":if(De===null)fo(se);else if(De.length!=null){var ze=F(De,D);Sc(se,ze,De.length,-1),Wt(ze)}else qa(se,"Wrong API use : tried to return a value of an unknown type ("+De+").",-1);break;default:fo(se)}}function y(se,De){for(var ze=[],$e=0;$e<se;$e+=1){var et=Lt(De+4*$e,"i32"),wt=co(et);if(wt===1||wt===2)et=wc(et);else if(wt===3)et=xc(et);else if(wt===4){wt=et,et=vc(wt),wt=Cc(wt);for(var on=new Uint8Array(et),$r=0;$r<et;$r+=1)on[$r]=P[wt+$r];et=on}else et=null;ze.push(et)}return ze}function w(se,De){this.Qa=se,this.db=De,this.Oa=1,this.lb=[]}function U(se,De){if(this.db=De,De=Ve(se)+1,this.eb=Ar(De),this.eb===null)throw Error("Unable to allocate memory for the SQL string");S(se,$,this.eb,De),this.kb=this.eb,this.Za=this.pb=null}function Y(se){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),se!=null){var De=this.filename,ze="/",$e=De;if(ze&&(ze=typeof ze=="string"?ze:_a(ze),$e=De?lt(ze+"/"+De):ze),De=gt(!0,!0),$e=Un($e,De),se){if(typeof se=="string"){ze=Array(se.length);for(var et=0,wt=se.length;et<wt;++et)ze[et]=se.charCodeAt(et);se=ze}Ur($e,De|146),ze=Mn($e,577),is(ze,se,0,se.length,0),vn(ze),Ur($e,De)}}this.handleError(qe(this.filename,oe)),this.db=Lt(oe,"i32"),Ao(this.db),this.fb={},this.Sa={}}var oe=Vt(4),ye=A.cwrap,qe=ye("sqlite3_open","number",["string","number"]),st=ye("sqlite3_close_v2","number",["number"]),at=ye("sqlite3_exec","number",["number","string","number","number","number"]),qt=ye("sqlite3_changes","number",["number"]),xr=ye("sqlite3_prepare_v2","number",["number","string","number","number","number"]),ls=ye("sqlite3_sql","string",["number"]),Qi=ye("sqlite3_normalized_sql","string",["number"]),Di=ye("sqlite3_prepare_v2","number",["number","number","number","number","number"]),lo=ye("sqlite3_bind_text","number",["number","number","number","number","number"]),oo=ye("sqlite3_bind_blob","number",["number","number","number","number","number"]),oc=ye("sqlite3_bind_double","number",["number","number","number"]),uc=ye("sqlite3_bind_int","number",["number","number","number"]),Js=ye("sqlite3_bind_parameter_index","number",["number","string"]),cc=ye("sqlite3_step","number",["number"]),dc=ye("sqlite3_errmsg","string",["number"]),fc=ye("sqlite3_column_count","number",["number"]),Ac=ye("sqlite3_data_count","number",["number"]),hc=ye("sqlite3_column_double","number",["number","number"]),Xs=ye("sqlite3_column_text","string",["number","number"]),gc=ye("sqlite3_column_blob","number",["number","number"]),mc=ye("sqlite3_column_bytes","number",["number","number"]),pc=ye("sqlite3_column_type","number",["number","number"]),yc=ye("sqlite3_column_name","string",["number","number"]),$s=ye("sqlite3_reset","number",["number"]),Ec=ye("sqlite3_clear_bindings","number",["number"]),bc=ye("sqlite3_finalize","number",["number"]),uo=ye("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),co=ye("sqlite3_value_type","number",["number"]),vc=ye("sqlite3_value_bytes","number",["number"]),xc=ye("sqlite3_value_text","string",["number"]),Cc=ye("sqlite3_value_blob","number",["number"]),wc=ye("sqlite3_value_double","number",["number"]),Ic=ye("sqlite3_result_double","",["number","number"]),fo=ye("sqlite3_result_null","",["number"]),Bc=ye("sqlite3_result_text","",["number","string","number","number"]),Sc=ye("sqlite3_result_blob","",["number","number","number","number"]),Nc=ye("sqlite3_result_int","",["number","number"]),qa=ye("sqlite3_result_error","",["number","string","number"]),za=ye("sqlite3_aggregate_context","number",["number","number"]),Ao=ye("RegisterExtensionFunctions","number",["number"]),Ws=ye("sqlite3_update_hook","number",["number","number","number"]);w.prototype.bind=function(se){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(se)?this.Cb(se):se!=null&&typeof se=="object"?this.Db(se):!0},w.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var se=cc(this.Qa);switch(se){case 100:return!0;case 101:return!1;default:throw this.db.handleError(se)}},w.prototype.wb=function(se){return se==null&&(se=this.Oa,this.Oa+=1),hc(this.Qa,se)},w.prototype.Gb=function(se){if(se==null&&(se=this.Oa,this.Oa+=1),se=Xs(this.Qa,se),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(se)},w.prototype.Hb=function(se){return se==null&&(se=this.Oa,this.Oa+=1),Xs(this.Qa,se)},w.prototype.getBlob=function(se){se==null&&(se=this.Oa,this.Oa+=1);var De=mc(this.Qa,se);se=gc(this.Qa,se);for(var ze=new Uint8Array(De),$e=0;$e<De;$e+=1)ze[$e]=P[se+$e];return ze},w.prototype.get=function(se,De){De=De||{},se!=null&&this.bind(se)&&this.step(),se=[];for(var ze=Ac(this.Qa),$e=0;$e<ze;$e+=1)switch(pc(this.Qa,$e)){case 1:var et=De.useBigInt?this.Gb($e):this.wb($e);se.push(et);break;case 2:se.push(this.wb($e));break;case 3:se.push(this.Hb($e));break;case 4:se.push(this.getBlob($e));break;default:se.push(null)}return se},w.prototype.getColumnNames=function(){for(var se=[],De=fc(this.Qa),ze=0;ze<De;ze+=1)se.push(yc(this.Qa,ze));return se},w.prototype.getAsObject=function(se,De){se=this.get(se,De),De=this.getColumnNames();for(var ze={},$e=0;$e<De.length;$e+=1)ze[De[$e]]=se[$e];return ze},w.prototype.getSQL=function(){return ls(this.Qa)},w.prototype.getNormalizedSQL=function(){return Qi(this.Qa)},w.prototype.run=function(se){return se!=null&&this.bind(se),this.step(),this.reset()},w.prototype.sb=function(se,De){De==null&&(De=this.Oa,this.Oa+=1),se=E(se);var ze=F(se,D);this.lb.push(ze),this.db.handleError(lo(this.Qa,De,ze,se.length-1,0))},w.prototype.Bb=function(se,De){De==null&&(De=this.Oa,this.Oa+=1);var ze=F(se,D);this.lb.push(ze),this.db.handleError(oo(this.Qa,De,ze,se.length,0))},w.prototype.rb=function(se,De){De==null&&(De=this.Oa,this.Oa+=1),this.db.handleError((se===(se|0)?uc:oc)(this.Qa,De,se))},w.prototype.Eb=function(se){se==null&&(se=this.Oa,this.Oa+=1),oo(this.Qa,se,0,0,0)},w.prototype.tb=function(se,De){switch(De==null&&(De=this.Oa,this.Oa+=1),typeof se){case"string":this.sb(se,De);return;case"number":this.rb(se,De);return;case"bigint":this.sb(se.toString(),De);return;case"boolean":this.rb(se+0,De);return;case"object":if(se===null){this.Eb(De);return}if(se.length!=null){this.Bb(se,De);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+se+")."},w.prototype.Db=function(se){var De=this;return Object.keys(se).forEach(function(ze){var $e=Js(De.Qa,ze);$e!==0&&De.tb(se[ze],$e)}),!0},w.prototype.Cb=function(se){for(var De=0;De<se.length;De+=1)this.tb(se[De],De+1);return!0},w.prototype.reset=function(){return this.freemem(),Ec(this.Qa)===0&&$s(this.Qa)===0},w.prototype.freemem=function(){for(var se;(se=this.lb.pop())!==void 0;)Wt(se)},w.prototype.free=function(){this.freemem();var se=bc(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,se},U.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.mb(),Error("Database closed");var se=Mr(),De=Vt(4);jt(oe),jt(De);try{this.db.handleError(Di(this.db.db,this.kb,-1,oe,De)),this.kb=Lt(De,"i32");var ze=Lt(oe,"i32");return ze===0?(this.mb(),{done:!0}):(this.Za=new w(ze,this.db),this.db.fb[ze]=this.Za,{value:this.Za,done:!1})}catch($e){throw this.pb=Fe(this.kb),this.mb(),$e}finally{Ut(se)}},U.prototype.mb=function(){Wt(this.eb),this.eb=null},U.prototype.getRemainingSQL=function(){return this.pb!==null?this.pb:Fe(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(U.prototype[Symbol.iterator]=function(){return this}),Y.prototype.run=function(se,De){if(!this.db)throw"Database closed";if(De){se=this.prepare(se,De);try{se.step()}finally{se.free()}}else this.handleError(at(this.db,se,0,0,oe));return this},Y.prototype.exec=function(se,De,ze){if(!this.db)throw"Database closed";var $e=Mr(),et=null;try{var wt=ga(se),on=Vt(4);for(se=[];Lt(wt,"i8")!==0;){jt(oe),jt(on),this.handleError(Di(this.db,wt,-1,oe,on));var $r=Lt(oe,"i32");if(wt=Lt(on,"i32"),$r!==0){var _r=null;for(et=new w($r,this),De!=null&&et.bind(De);et.step();)_r===null&&(_r={columns:et.getColumnNames(),values:[]},se.push(_r)),_r.values.push(et.get(null,ze));et.free()}}return se}catch(Wr){throw et&&et.free(),Wr}finally{Ut($e)}},Y.prototype.each=function(se,De,ze,$e,et){typeof De=="function"&&($e=ze,ze=De,De=void 0),se=this.prepare(se,De);try{for(;se.step();)ze(se.getAsObject(null,et))}finally{se.free()}if(typeof $e=="function")return $e()},Y.prototype.prepare=function(se,De){if(jt(oe),this.handleError(xr(this.db,se,-1,oe,0)),se=Lt(oe,"i32"),se===0)throw"Nothing to prepare";var ze=new w(se,this);return De!=null&&ze.bind(De),this.fb[se]=ze},Y.prototype.iterateStatements=function(se){return new U(se,this)},Y.prototype.export=function(){Object.values(this.fb).forEach(function(De){De.free()}),Object.values(this.Sa).forEach(Ue),this.Sa={},this.handleError(st(this.db));var se=ss(this.filename);return this.handleError(qe(this.filename,oe)),this.db=Lt(oe,"i32"),Ao(this.db),se},Y.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(se){se.free()}),Object.values(this.Sa).forEach(Ue),this.Sa={},this.Ya&&(Ue(this.Ya),this.Ya=void 0),this.handleError(st(this.db)),as("/"+this.filename),this.db=null)},Y.prototype.handleError=function(se){if(se===0)return null;throw se=dc(this.db),Error(se)},Y.prototype.getRowsModified=function(){return qt(this.db)},Y.prototype.create_function=function(se,De){Object.prototype.hasOwnProperty.call(this.Sa,se)&&(Ue(this.Sa[se]),delete this.Sa[se]);var ze=je(function($e,et,wt){et=y(et,wt);try{var on=De.apply(null,et)}catch($r){qa($e,$r,-1);return}h($e,on)},"viii");return this.Sa[se]=ze,this.handleError(uo(this.db,se,De.length,1,0,ze,0,0,0)),this},Y.prototype.create_aggregate=function(se,De){var ze=De.init||function(){return null},$e=De.finalize||function(_r){return _r},et=De.step;if(!et)throw"An aggregate function must have a step function in "+se;var wt={};Object.hasOwnProperty.call(this.Sa,se)&&(Ue(this.Sa[se]),delete this.Sa[se]),De=se+"__finalize",Object.hasOwnProperty.call(this.Sa,De)&&(Ue(this.Sa[De]),delete this.Sa[De]);var on=je(function(_r,Wr,ma){var un=za(_r,1);Object.hasOwnProperty.call(wt,un)||(wt[un]=ze()),Wr=y(Wr,ma),Wr=[wt[un]].concat(Wr);try{wt[un]=et.apply(null,Wr)}catch(Tc){delete wt[un],qa(_r,Tc,-1)}},"viii"),$r=je(function(_r){var Wr=za(_r,1);try{var ma=$e(wt[Wr])}catch(un){delete wt[Wr],qa(_r,un,-1);return}h(_r,ma),delete wt[Wr]},"vi");return this.Sa[se]=on,this.Sa[De]=$r,this.handleError(uo(this.db,se,et.length-1,1,0,0,on,$r,0)),this},Y.prototype.updateHook=function(se){this.Ya&&(Ws(this.db,0,0),Ue(this.Ya),this.Ya=void 0),se&&(this.Ya=je(function(De,ze,$e,et,wt){switch(ze){case 18:De="insert";break;case 23:De="update";break;case 9:De="delete";break;default:throw"unknown operationCode in updateHook callback: "+ze}if($e=$e?Qe($,$e):"",et=et?Qe($,et):"",wt>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";se(De,$e,et,Number(wt))},"viiiij"),Ws(this.db,this.Ya,0))},A.Database=Y};var T={...A},Q="./this.program",k=(h,y)=>{throw y},R="",N,O;if(B){var _=ym;R=__dirname+"/",O=h=>(h=Ne(h)?new URL(h):h,_.readFileSync(h)),N=async h=>(h=Ne(h)?new URL(h):h,_.readFileSync(h,void 0)),!A.thisProgram&&1<process.argv.length&&(Q=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),n.exports=A,k=(h,y)=>{throw process.exitCode=h,y}}else(b||v)&&(v?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),R=R.startsWith("blob:")?"":R.slice(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1),v&&(O=h=>{var y=new XMLHttpRequest;return y.open("GET",h,!1),y.responseType="arraybuffer",y.send(null),new Uint8Array(y.response)}),N=async h=>{if(Ne(h))return new Promise((w,U)=>{var Y=new XMLHttpRequest;Y.open("GET",h,!0),Y.responseType="arraybuffer",Y.onload=()=>{Y.status==200||Y.status==0&&Y.response?w(Y.response):U(Y.status)},Y.onerror=U,Y.send(null)});var y=await fetch(h,{credentials:"same-origin"});if(y.ok)return y.arrayBuffer();throw Error(y.status+" : "+y.url)});var q=A.print||console.log.bind(console),V=A.printErr||console.error.bind(console);Object.assign(A,T),T=null,A.thisProgram&&(Q=A.thisProgram);var ae=A.wasmBinary,ge,te=!1,J,P,$,me,he,Be,pe,K,ie,Ne=h=>h.startsWith("file://");function _e(){var h=ge.buffer;A.HEAP8=P=new Int8Array(h),A.HEAP16=me=new Int16Array(h),A.HEAPU8=$=new Uint8Array(h),A.HEAPU16=new Uint16Array(h),A.HEAP32=he=new Int32Array(h),A.HEAPU32=Be=new Uint32Array(h),A.HEAPF32=pe=new Float32Array(h),A.HEAPF64=ie=new Float64Array(h),A.HEAP64=K=new BigInt64Array(h),A.HEAPU64=new BigUint64Array(h)}var G=0,ne=null;function Ee(h){var y;throw(y=A.onAbort)==null||y.call(A,h),h="Aborted("+h+")",V(h),te=!0,new WebAssembly.RuntimeError(h+". Build with -sASSERTIONS for more info.")}var ke;async function He(h){if(!ae)try{var y=await N(h);return new Uint8Array(y)}catch{}if(h==ke&&ae)h=new Uint8Array(ae);else if(O)h=O(h);else throw"both async and sync fetching of the wasm failed";return h}async function Ke(h,y){try{var w=await He(h);return await WebAssembly.instantiate(w,y)}catch(U){V(`failed to asynchronously prepare wasm: ${U}`),Ee(U)}}async function Ge(h){var y=ke;if(!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Ne(y)&&!B)try{var w=fetch(y,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(w,h)}catch(U){V(`wasm streaming compile failed: ${U}`),V("falling back to ArrayBuffer instantiation")}return Ke(y,h)}class yt{constructor(y){Br(this,"name","ExitStatus");this.message=`Program terminated with exit(${y})`,this.status=y}}var We=h=>{for(;0<h.length;)h.shift()(A)},Et=[],Kt=[],Nr=()=>{var h=A.preRun.shift();Kt.unshift(h)};function Lt(h,y="i8"){switch(y.endsWith("*")&&(y="*"),y){case"i1":return P[h];case"i8":return P[h];case"i16":return me[h>>1];case"i32":return he[h>>2];case"i64":return K[h>>3];case"float":return pe[h>>2];case"double":return ie[h>>3];case"*":return Be[h>>2];default:Ee(`invalid type for getValue: ${y}`)}}var Ht=A.noExitRuntime||!0;function jt(h){var y="i32";switch(y.endsWith("*")&&(y="*"),y){case"i1":P[h]=0;break;case"i8":P[h]=0;break;case"i16":me[h>>1]=0;break;case"i32":he[h>>2]=0;break;case"i64":K[h>>3]=BigInt(0);break;case"float":pe[h>>2]=0;break;case"double":ie[h>>3]=0;break;case"*":Be[h>>2]=0;break;default:Ee(`invalid type for setValue: ${y}`)}}var br=typeof TextDecoder<"u"?new TextDecoder:void 0,Qe=(h,y=0,w=NaN)=>{var U=y+w;for(w=y;h[w]&&!(w>=U);)++w;if(16<w-y&&h.buffer&&br)return br.decode(h.subarray(y,w));for(U="";y<w;){var Y=h[y++];if(Y&128){var oe=h[y++]&63;if((Y&224)==192)U+=String.fromCharCode((Y&31)<<6|oe);else{var ye=h[y++]&63;Y=(Y&240)==224?(Y&15)<<12|oe<<6|ye:(Y&7)<<18|oe<<12|ye<<6|h[y++]&63,65536>Y?U+=String.fromCharCode(Y):(Y-=65536,U+=String.fromCharCode(55296|Y>>10,56320|Y&1023))}}else U+=String.fromCharCode(Y)}return U},Fe=(h,y)=>h?Qe($,h,y):"",nt=(h,y)=>{for(var w=0,U=h.length-1;0<=U;U--){var Y=h[U];Y==="."?h.splice(U,1):Y===".."?(h.splice(U,1),w++):w&&(h.splice(U,1),w--)}if(y)for(;w;w--)h.unshift("..");return h},lt=h=>{var y=h.charAt(0)==="/",w=h.slice(-1)==="/";return(h=nt(h.split("/").filter(U=>!!U),!y).join("/"))||y||(h="."),h&&w&&(h+="/"),(y?"/":"")+h},j=h=>{var y=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(h).slice(1);return h=y[0],y=y[1],!h&&!y?".":(y&&(y=y.slice(0,-1)),h+y)},X=h=>h&&h.match(/([^\/]+|\/)\/*$/)[1],le=()=>{if(B){var h=ym;return y=>h.randomFillSync(y)}return y=>crypto.getRandomValues(y)},Te=h=>{(Te=le())(h)},Re=(...h)=>{for(var y="",w=!1,U=h.length-1;-1<=U&&!w;U--){if(w=0<=U?h[U]:"/",typeof w!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!w)return"";y=w+"/"+y,w=w.charAt(0)==="/"}return y=nt(y.split("/").filter(Y=>!!Y),!w).join("/"),(w?"/":"")+y||"."},xe=[],Ve=h=>{for(var y=0,w=0;w<h.length;++w){var U=h.charCodeAt(w);127>=U?y++:2047>=U?y+=2:55296<=U&&57343>=U?(y+=4,++w):y+=3}return y},S=(h,y,w,U)=>{if(!(0<U))return 0;var Y=w;U=w+U-1;for(var oe=0;oe<h.length;++oe){var ye=h.charCodeAt(oe);if(55296<=ye&&57343>=ye){var qe=h.charCodeAt(++oe);ye=65536+((ye&1023)<<10)|qe&1023}if(127>=ye){if(w>=U)break;y[w++]=ye}else{if(2047>=ye){if(w+1>=U)break;y[w++]=192|ye>>6}else{if(65535>=ye){if(w+2>=U)break;y[w++]=224|ye>>12}else{if(w+3>=U)break;y[w++]=240|ye>>18,y[w++]=128|ye>>12&63}y[w++]=128|ye>>6&63}y[w++]=128|ye&63}}return y[w]=0,w-Y},E=(h,y)=>{var w=Array(Ve(h)+1);return h=S(h,w,0,w.length),y&&(w.length=h),w},x=[];function H(h,y){x[h]={input:[],output:[],cb:y},Gt(h,W)}var W={open(h){var y=x[h.node.rdev];if(!y)throw new Me(43);h.tty=y,h.seekable=!1},close(h){h.tty.cb.fsync(h.tty)},fsync(h){h.tty.cb.fsync(h.tty)},read(h,y,w,U){if(!h.tty||!h.tty.cb.xb)throw new Me(60);for(var Y=0,oe=0;oe<U;oe++){try{var ye=h.tty.cb.xb(h.tty)}catch{throw new Me(29)}if(ye===void 0&&Y===0)throw new Me(6);if(ye==null)break;Y++,y[w+oe]=ye}return Y&&(h.node.atime=Date.now()),Y},write(h,y,w,U){if(!h.tty||!h.tty.cb.qb)throw new Me(60);try{for(var Y=0;Y<U;Y++)h.tty.cb.qb(h.tty,y[w+Y])}catch{throw new Me(29)}return U&&(h.node.mtime=h.node.ctime=Date.now()),Y}},fe={xb(){e:{if(!xe.length){var h=null;if(B){var y=Buffer.alloc(256),w=0,U=process.stdin.fd;try{w=_.readSync(U,y,0,256)}catch(Y){if(Y.toString().includes("EOF"))w=0;else throw Y}0<w&&(h=y.slice(0,w).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(h=window.prompt("Input: "),h!==null&&(h+=`
`));if(!h){h=null;break e}xe=E(h,!0)}h=xe.shift()}return h},qb(h,y){y===null||y===10?(q(Qe(h.output)),h.output=[]):y!=0&&h.output.push(y)},fsync(h){var y;0<((y=h.output)==null?void 0:y.length)&&(q(Qe(h.output)),h.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},be={qb(h,y){y===null||y===10?(V(Qe(h.output)),h.output=[]):y!=0&&h.output.push(y)},fsync(h){var y;0<((y=h.output)==null?void 0:y.length)&&(V(Qe(h.output)),h.output=[])}},Le={Wa:null,Xa(){return Le.createNode(null,"/",16895,0)},createNode(h,y,w,U){if((w&61440)===24576||(w&61440)===4096)throw new Me(63);return Le.Wa||(Le.Wa={dir:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua,lookup:Le.La.lookup,hb:Le.La.hb,rename:Le.La.rename,unlink:Le.La.unlink,rmdir:Le.La.rmdir,readdir:Le.La.readdir,symlink:Le.La.symlink},stream:{Va:Le.Ma.Va}},file:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua},stream:{Va:Le.Ma.Va,read:Le.Ma.read,write:Le.Ma.write,ib:Le.Ma.ib,jb:Le.Ma.jb}},link:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua,readlink:Le.La.readlink},stream:{}},ub:{node:{Ta:Le.La.Ta,Ua:Le.La.Ua},stream:Ln}}),w=dr(h,y,w,U),Jt(w.mode)?(w.La=Le.Wa.dir.node,w.Ma=Le.Wa.dir.stream,w.Na={}):(w.mode&61440)===32768?(w.La=Le.Wa.file.node,w.Ma=Le.Wa.file.stream,w.Ra=0,w.Na=null):(w.mode&61440)===40960?(w.La=Le.Wa.link.node,w.Ma=Le.Wa.link.stream):(w.mode&61440)===8192&&(w.La=Le.Wa.ub.node,w.Ma=Le.Wa.ub.stream),w.atime=w.mtime=w.ctime=Date.now(),h&&(h.Na[y]=w,h.atime=h.mtime=h.ctime=w.atime),w},Sb(h){return h.Na?h.Na.subarray?h.Na.subarray(0,h.Ra):new Uint8Array(h.Na):new Uint8Array(0)},La:{Ta(h){var y={};return y.dev=(h.mode&61440)===8192?h.id:1,y.ino=h.id,y.mode=h.mode,y.nlink=1,y.uid=0,y.gid=0,y.rdev=h.rdev,Jt(h.mode)?y.size=4096:(h.mode&61440)===32768?y.size=h.Ra:(h.mode&61440)===40960?y.size=h.link.length:y.size=0,y.atime=new Date(h.atime),y.mtime=new Date(h.mtime),y.ctime=new Date(h.ctime),y.blksize=4096,y.blocks=Math.ceil(y.size/y.blksize),y},Ua(h,y){for(var w of["mode","atime","mtime","ctime"])y[w]!=null&&(h[w]=y[w]);y.size!==void 0&&(y=y.size,h.Ra!=y&&(y==0?(h.Na=null,h.Ra=0):(w=h.Na,h.Na=new Uint8Array(y),w&&h.Na.set(w.subarray(0,Math.min(y,h.Ra))),h.Ra=y)))},lookup(){throw Le.vb},hb(h,y,w,U){return Le.createNode(h,y,w,U)},rename(h,y,w){try{var U=_t(y,w)}catch{}if(U){if(Jt(h.mode))for(var Y in U.Na)throw new Me(55);Jr(U)}delete h.parent.Na[h.name],y.Na[w]=h,h.name=w,y.ctime=y.mtime=h.parent.ctime=h.parent.mtime=Date.now()},unlink(h,y){delete h.Na[y],h.ctime=h.mtime=Date.now()},rmdir(h,y){var w=_t(h,y),U;for(U in w.Na)throw new Me(55);delete h.Na[y],h.ctime=h.mtime=Date.now()},readdir(h){return[".","..",...Object.keys(h.Na)]},symlink(h,y,w){return h=Le.createNode(h,y,41471,0),h.link=w,h},readlink(h){if((h.mode&61440)!==40960)throw new Me(28);return h.link}},Ma:{read(h,y,w,U,Y){var oe=h.node.Na;if(Y>=h.node.Ra)return 0;if(h=Math.min(h.node.Ra-Y,U),8<h&&oe.subarray)y.set(oe.subarray(Y,Y+h),w);else for(U=0;U<h;U++)y[w+U]=oe[Y+U];return h},write(h,y,w,U,Y,oe){if(y.buffer===P.buffer&&(oe=!1),!U)return 0;if(h=h.node,h.mtime=h.ctime=Date.now(),y.subarray&&(!h.Na||h.Na.subarray)){if(oe)return h.Na=y.subarray(w,w+U),h.Ra=U;if(h.Ra===0&&Y===0)return h.Na=y.slice(w,w+U),h.Ra=U;if(Y+U<=h.Ra)return h.Na.set(y.subarray(w,w+U),Y),U}oe=Y+U;var ye=h.Na?h.Na.length:0;if(ye>=oe||(oe=Math.max(oe,ye*(1048576>ye?2:1.125)>>>0),ye!=0&&(oe=Math.max(oe,256)),ye=h.Na,h.Na=new Uint8Array(oe),0<h.Ra&&h.Na.set(ye.subarray(0,h.Ra),0)),h.Na.subarray&&y.subarray)h.Na.set(y.subarray(w,w+U),Y);else for(oe=0;oe<U;oe++)h.Na[Y+oe]=y[w+oe];return h.Ra=Math.max(h.Ra,Y+U),U},Va(h,y,w){if(w===1?y+=h.position:w===2&&(h.node.mode&61440)===32768&&(y+=h.node.Ra),0>y)throw new Me(28);return y},ib(h,y,w,U,Y){if((h.node.mode&61440)!==32768)throw new Me(43);if(h=h.node.Na,Y&2||!h||h.buffer!==P.buffer){Y=!0,U=65536*Math.ceil(y/65536);var oe=Vr(65536,U);if(oe&&$.fill(0,oe,oe+U),U=oe,!U)throw new Me(48);h&&((0<w||w+y<h.length)&&(h.subarray?h=h.subarray(w,w+y):h=Array.prototype.slice.call(h,w,w+y)),P.set(h,U))}else Y=!1,U=h.byteOffset;return{Kb:U,Ab:Y}},jb(h,y,w,U){return Le.Ma.write(h,y,0,U,w,!1),0}}},gt=(h,y)=>{var w=0;return h&&(w|=365),y&&(w|=146),w},ft=null,bt={},ot=[],es=1,sn=null,Ma=!1,Pn=!0,ts={},Me=class{constructor(h){Br(this,"name","ErrnoError");this.Pa=h}},rs=class{constructor(){Br(this,"gb",{});Br(this,"node",null)}get flags(){return this.gb.flags}set flags(h){this.gb.flags=h}get position(){return this.gb.position}set position(h){this.gb.position=h}},Ci=class{constructor(h,y,w,U){Br(this,"La",{});Br(this,"Ma",{});Br(this,"ab",null);h||(h=this),this.parent=h,this.Xa=h.Xa,this.id=es++,this.name=y,this.mode=w,this.rdev=U,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(h){h?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(h){h?this.mode|=146:this.mode&=-147}};function vr(h,y={}){if(!h)throw new Me(44);y.nb??(y.nb=!0),h.charAt(0)==="/"||(h="//"+h);var w=0;e:for(;40>w;w++){h=h.split("/").filter(qe=>!!qe);for(var U=ft,Y="/",oe=0;oe<h.length;oe++){var ye=oe===h.length-1;if(ye&&y.parent)break;if(h[oe]!==".")if(h[oe]==="..")Y=j(Y),U=U.parent;else{Y=lt(Y+"/"+h[oe]);try{U=_t(U,h[oe])}catch(qe){if((qe==null?void 0:qe.Pa)===44&&ye&&y.Jb)return{path:Y};throw qe}if(!U.ab||ye&&!y.nb||(U=U.ab.root),(U.mode&61440)===40960&&(!ye||y.$a)){if(!U.La.readlink)throw new Me(52);U=U.La.readlink(U),U.charAt(0)==="/"||(U=j(Y)+"/"+U),h=U+"/"+h.slice(oe+1).join("/");continue e}}}return{path:Y,node:U}}throw new Me(32)}function _a(h){for(var y;;){if(h===h.parent)return h=h.Xa.zb,y?h[h.length-1]!=="/"?`${h}/${y}`:h+y:h;y=y?`${h.name}/${y}`:h.name,h=h.parent}}function wi(h,y){for(var w=0,U=0;U<y.length;U++)w=(w<<5)-w+y.charCodeAt(U)|0;return(h+w>>>0)%sn.length}function Jr(h){var y=wi(h.parent.id,h.name);if(sn[y]===h)sn[y]=h.bb;else for(y=sn[y];y;){if(y.bb===h){y.bb=h.bb;break}y=y.bb}}function _t(h,y){var w=Jt(h.mode)?(w=Kn(h,"x"))?w:h.La.lookup?0:2:54;if(w)throw new Me(w);for(w=sn[wi(h.id,y)];w;w=w.bb){var U=w.name;if(w.parent.id===h.id&&U===y)return w}return h.La.lookup(h,y)}function dr(h,y,w,U){return h=new Ci(h,y,w,U),y=wi(h.parent.id,h.name),h.bb=sn[y],sn[y]=h}function Jt(h){return(h&61440)===16384}function Oa(h){var y=["r","w","rw"][h&3];return h&512&&(y+="w"),y}function Kn(h,y){if(Pn)return 0;if(!y.includes("r")||h.mode&292){if(y.includes("w")&&!(h.mode&146)||y.includes("x")&&!(h.mode&73))return 2}else return 2;return 0}function ns(h,y){if(!Jt(h.mode))return 54;try{return _t(h,y),20}catch{}return Kn(h,"wx")}function Ii(h,y,w){try{var U=_t(h,y)}catch(Y){return Y.Pa}if(h=Kn(h,"wx"))return h;if(w){if(!Jt(U.mode))return 54;if(U===U.parent||_a(U)==="/")return 10}else if(Jt(U.mode))return 31;return 0}function En(h){if(!h)throw new Me(63);return h}function tr(h){if(h=ot[h],!h)throw new Me(8);return h}function kn(h,y=-1){if(h=Object.assign(new rs,h),y==-1)e:{for(y=0;4096>=y;y++)if(!ot[y])break e;throw new Me(33)}return h.fd=y,ot[y]=h}function Jn(h,y=-1){var w,U;return h=kn(h,y),(U=(w=h.Ma)==null?void 0:w.Rb)==null||U.call(w,h),h}function Gr(h,y,w){var U=h==null?void 0:h.Ma.Ua;h=U?h:y,U??(U=y.La.Ua),En(U),U(h,w)}var Ln={open(h){var y,w;h.Ma=bt[h.node.rdev].Ma,(w=(y=h.Ma).open)==null||w.call(y,h)},Va(){throw new Me(70)}};function Gt(h,y){bt[h]={Ma:y}}function Bi(h,y){var w=y==="/";if(w&&ft)throw new Me(10);if(!w&&y){var U=vr(y,{nb:!1});if(y=U.path,U=U.node,U.ab)throw new Me(10);if(!Jt(U.mode))throw new Me(54)}y={type:h,Wb:{},zb:y,Ib:[]},h=h.Xa(y),h.Xa=y,y.root=h,w?ft=h:U&&(U.ab=y,U.Xa&&U.Xa.Ib.push(y))}function fa(h,y,w){var U=vr(h,{parent:!0}).node;if(h=X(h),!h)throw new Me(28);if(h==="."||h==="..")throw new Me(20);var Y=ns(U,h);if(Y)throw new Me(Y);if(!U.La.hb)throw new Me(63);return U.La.hb(U,h,y,w)}function Un(h,y=438){return fa(h,y&4095|32768,0)}function fr(h,y=511){return fa(h,y&1023|16384,0)}function Xr(h,y,w){typeof w>"u"&&(w=y,y=438),fa(h,y|8192,w)}function Fa(h,y){if(!Re(h))throw new Me(44);var w=vr(y,{parent:!0}).node;if(!w)throw new Me(44);y=X(y);var U=ns(w,y);if(U)throw new Me(U);if(!w.La.symlink)throw new Me(63);w.La.symlink(w,y,h)}function Si(h){var y=vr(h,{parent:!0}).node;h=X(h);var w=_t(y,h),U=Ii(y,h,!0);if(U)throw new Me(U);if(!y.La.rmdir)throw new Me(63);if(w.ab)throw new Me(10);y.La.rmdir(y,h),Jr(w)}function as(h){var y=vr(h,{parent:!0}).node;if(!y)throw new Me(44);h=X(h);var w=_t(y,h),U=Ii(y,h,!1);if(U)throw new Me(U);if(!y.La.unlink)throw new Me(63);if(w.ab)throw new Me(10);y.La.unlink(y,h),Jr(w)}function bn(h,y){return h=vr(h,{$a:!y}).node,En(h.La.Ta)(h)}function Aa(h,y,w,U){Gr(h,y,{mode:w&4095|y.mode&-4096,ctime:Date.now(),Fb:U})}function Ur(h,y){h=typeof h=="string"?vr(h,{$a:!0}).node:h,Aa(null,h,y)}function ja(h,y,w){if(Jt(y.mode))throw new Me(31);if((y.mode&61440)!==32768)throw new Me(28);var U=Kn(y,"w");if(U)throw new Me(U);Gr(h,y,{size:w,timestamp:Date.now()})}function Mn(h,y,w=438){if(h==="")throw new Me(44);if(typeof y=="string"){var U={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[y];if(typeof U>"u")throw Error(`Unknown file open mode: ${y}`);y=U}if(w=y&64?w&4095|32768:0,typeof h=="object")U=h;else{var Y=h.endsWith("/");h=vr(h,{$a:!(y&131072),Jb:!0}),U=h.node,h=h.path}var oe=!1;if(y&64)if(U){if(y&128)throw new Me(20)}else{if(Y)throw new Me(31);U=fa(h,w|511,0),oe=!0}if(!U)throw new Me(44);if((U.mode&61440)===8192&&(y&=-513),y&65536&&!Jt(U.mode))throw new Me(54);if(!oe&&(Y=U?(U.mode&61440)===40960?32:Jt(U.mode)&&(Oa(y)!=="r"||y&576)?31:Kn(U,Oa(y)):44))throw new Me(Y);return y&512&&!oe&&(Y=U,Y=typeof Y=="string"?vr(Y,{$a:!0}).node:Y,ja(null,Y,0)),y&=-131713,Y=kn({node:U,path:_a(U),flags:y,seekable:!0,position:0,Ma:U.Ma,Lb:[],error:!1}),Y.Ma.open&&Y.Ma.open(Y),oe&&Ur(U,w&511),!A.logReadFiles||y&1||h in ts||(ts[h]=1),Y}function vn(h){if(h.fd===null)throw new Me(8);h.ob&&(h.ob=null);try{h.Ma.close&&h.Ma.close(h)}catch(y){throw y}finally{ot[h.fd]=null}h.fd=null}function $t(h,y,w){if(h.fd===null)throw new Me(8);if(!h.seekable||!h.Ma.Va)throw new Me(70);if(w!=0&&w!=1&&w!=2)throw new Me(28);h.position=h.Ma.Va(h,y,w),h.Lb=[]}function Ha(h,y,w,U,Y){if(0>U||0>Y)throw new Me(28);if(h.fd===null)throw new Me(8);if((h.flags&2097155)===1)throw new Me(8);if(Jt(h.node.mode))throw new Me(31);if(!h.Ma.read)throw new Me(28);var oe=typeof Y<"u";if(!oe)Y=h.position;else if(!h.seekable)throw new Me(70);return y=h.Ma.read(h,y,w,U,Y),oe||(h.position+=y),y}function is(h,y,w,U,Y){if(0>U||0>Y)throw new Me(28);if(h.fd===null)throw new Me(8);if((h.flags&2097155)===0)throw new Me(8);if(Jt(h.node.mode))throw new Me(31);if(!h.Ma.write)throw new Me(28);h.seekable&&h.flags&1024&&$t(h,0,2);var oe=typeof Y<"u";if(!oe)Y=h.position;else if(!h.seekable)throw new Me(70);return y=h.Ma.write(h,y,w,U,Y,void 0),oe||(h.position+=y),y}function ss(h){var y,w=Mn(h,w||0);h=bn(h).size;var U=new Uint8Array(h);return Ha(w,U,0,h,0),y=U,vn(w),y}function Ot(h,y,w){h=lt("/dev/"+h);var U=gt(!!y,!!w);Ot.yb??(Ot.yb=64);var Y=Ot.yb++<<8|0;Gt(Y,{open(oe){oe.seekable=!1},close(){var oe;(oe=w==null?void 0:w.buffer)!=null&&oe.length&&w(10)},read(oe,ye,qe,st){for(var at=0,qt=0;qt<st;qt++){try{var xr=y()}catch{throw new Me(29)}if(xr===void 0&&at===0)throw new Me(6);if(xr==null)break;at++,ye[qe+qt]=xr}return at&&(oe.node.atime=Date.now()),at},write(oe,ye,qe,st){for(var at=0;at<st;at++)try{w(ye[qe+at])}catch{throw new Me(29)}return st&&(oe.node.mtime=oe.node.ctime=Date.now()),at}}),Xr(h,U,Y)}var ut={};function Tt(h,y,w){if(y.charAt(0)==="/")return y;if(h=h===-100?"/":tr(h).path,y.length==0){if(!w)throw new Me(44);return h}return h+"/"+y}function _n(h,y){he[h>>2]=y.dev,he[h+4>>2]=y.mode,Be[h+8>>2]=y.nlink,he[h+12>>2]=y.uid,he[h+16>>2]=y.gid,he[h+20>>2]=y.rdev,K[h+24>>3]=BigInt(y.size),he[h+32>>2]=4096,he[h+36>>2]=y.blocks;var w=y.atime.getTime(),U=y.mtime.getTime(),Y=y.ctime.getTime();return K[h+40>>3]=BigInt(Math.floor(w/1e3)),Be[h+48>>2]=w%1e3*1e6,K[h+56>>3]=BigInt(Math.floor(U/1e3)),Be[h+64>>2]=U%1e3*1e6,K[h+72>>3]=BigInt(Math.floor(Y/1e3)),Be[h+80>>2]=Y%1e3*1e6,K[h+88>>3]=BigInt(y.ino),0}var Xn=void 0,rr=()=>{var h=he[+Xn>>2];return Xn+=4,h},Ga=0,Tr=[0,31,60,91,121,152,182,213,244,274,305,335],Ni=[0,31,59,90,120,151,181,212,243,273,304,334],$n={},ha=h=>{var y;J=h,Ht||0<Ga||((y=A.onExit)==null||y.call(A,h),te=!0),k(h,new yt(h))},xn=h=>{if(!te)try{if(h(),!(Ht||0<Ga))try{J=h=J,ha(h)}catch(y){y instanceof yt||y=="unwind"||k(1,y)}}catch(y){y instanceof yt||y=="unwind"||k(1,y)}},Va={},Ti=()=>{if(!Cn){var h={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Q||"./this.program"},y;for(y in Va)Va[y]===void 0?delete h[y]:h[y]=Va[y];var w=[];for(y in h)w.push(`${y}=${h[y]}`);Cn=w}return Cn},Cn,ga=h=>{var y=Ve(h)+1,w=Vt(y);return S(h,$,w,y),w},I=(h,y,w,U)=>{var Y={string:at=>{var qt=0;return at!=null&&at!==0&&(qt=ga(at)),qt},array:at=>{var qt=Vt(at.length);return P.set(at,qt),qt}};h=A["_"+h];var oe=[],ye=0;if(U)for(var qe=0;qe<U.length;qe++){var st=Y[w[qe]];st?(ye===0&&(ye=Mr()),oe[qe]=st(U[qe])):oe[qe]=U[qe]}return w=h(...oe),w=function(at){return ye!==0&&Ut(ye),y==="string"?at?Qe($,at):"":y==="boolean"?!!at:at}(w)},D=0,F=(h,y)=>(y=y==1?Vt(h.length):Ar(h.length),h.subarray||h.slice||(h=new Uint8Array(h)),$.set(h,y),y),ee,we=[],Ie,Ue=h=>{ee.delete(Ie.get(h)),Ie.set(h,null),we.push(h)},je=(h,y)=>{if(!ee){ee=new WeakMap;var w=Ie.length;if(ee)for(var U=0;U<0+w;U++){var Y=Ie.get(U);Y&&ee.set(Y,U)}}if(w=ee.get(h)||0)return w;if(we.length)w=we.pop();else{try{Ie.grow(1)}catch(st){throw st instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":st}w=Ie.length-1}try{Ie.set(w,h)}catch(st){if(!(st instanceof TypeError))throw st;if(typeof WebAssembly.Function=="function"){var oe=WebAssembly.Function;U={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},Y={parameters:[],results:y[0]=="v"?[]:[U[y[0]]]};for(var ye=1;ye<y.length;++ye)Y.parameters.push(U[y[ye]]);y=new oe(Y,h)}else{U=[1],Y=y.slice(0,1),y=y.slice(1),ye={i:127,p:127,j:126,f:125,d:124,e:111},U.push(96);var qe=y.length;128>qe?U.push(qe):U.push(qe%128|128,qe>>7);for(oe of y)U.push(ye[oe]);Y=="v"?U.push(0):U.push(1,ye[Y]),y=[0,97,115,109,1,0,0,0,1],oe=U.length,128>oe?y.push(oe):y.push(oe%128|128,oe>>7),y.push(...U),y.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),y=new WebAssembly.Module(new Uint8Array(y)),y=new WebAssembly.Instance(y,{e:{f:h}}).exports.f}Ie.set(w,y)}return ee.set(h,w),w};sn=Array(4096),Bi(Le,"/"),fr("/tmp"),fr("/home"),fr("/home/web_user"),function(){fr("/dev"),Gt(259,{read:()=>0,write:(U,Y,oe,ye)=>ye,Va:()=>0}),Xr("/dev/null",259),H(1280,fe),H(1536,be),Xr("/dev/tty",1280),Xr("/dev/tty1",1536);var h=new Uint8Array(1024),y=0,w=()=>(y===0&&(Te(h),y=h.byteLength),h[--y]);Ot("random",w),Ot("urandom",w),fr("/dev/shm"),fr("/dev/shm/tmp")}(),function(){fr("/proc");var h=fr("/proc/self");fr("/proc/self/fd"),Bi({Xa(){var y=dr(h,"fd",16895,73);return y.Ma={Va:Le.Ma.Va},y.La={lookup(w,U){w=+U;var Y=tr(w);return w={parent:null,Xa:{zb:"fake"},La:{readlink:()=>Y.path},id:w+1},w.parent=w},readdir(){return Array.from(ot.entries()).filter(([,w])=>w).map(([w])=>w.toString())}},y}},"/proc/self/fd")}(),Le.vb=new Me(44),Le.vb.stack="<generic error, no stack>";var vt={a:(h,y,w,U)=>Ee(`Assertion failed: ${h?Qe($,h):""}, at: `+[y?y?Qe($,y):"":"unknown filename",w,U?U?Qe($,U):"":"unknown function"]),i:function(h,y){try{return h=h?Qe($,h):"",Ur(h,y),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},L:function(h,y,w){try{if(y=y?Qe($,y):"",y=Tt(h,y),w&-8)return-28;var U=vr(y,{$a:!0}).node;return U?(h="",w&4&&(h+="r"),w&2&&(h+="w"),w&1&&(h+="x"),h&&Kn(U,h)?-2:0):-44}catch(Y){if(typeof ut>"u"||Y.name!=="ErrnoError")throw Y;return-Y.Pa}},j:function(h,y){try{var w=tr(h);return Aa(w,w.node,y,!1),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},h:function(h){try{var y=tr(h);return Gr(y,y.node,{timestamp:Date.now(),Fb:!1}),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},b:function(h,y,w){Xn=w;try{var U=tr(h);switch(y){case 0:var Y=rr();if(0>Y)break;for(;ot[Y];)Y++;return Jn(U,Y).fd;case 1:case 2:return 0;case 3:return U.flags;case 4:return Y=rr(),U.flags|=Y,0;case 12:return Y=rr(),me[Y+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(oe){if(typeof ut>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},g:function(h,y){try{var w=tr(h),U=w.node,Y=w.Ma.Ta;h=Y?w:U,Y??(Y=U.La.Ta),En(Y);var oe=Y(h);return _n(y,oe)}catch(ye){if(typeof ut>"u"||ye.name!=="ErrnoError")throw ye;return-ye.Pa}},H:function(h,y){y=-9007199254740992>y||9007199254740992<y?NaN:Number(y);try{if(isNaN(y))return 61;var w=tr(h);if(0>y||(w.flags&2097155)===0)throw new Me(28);return ja(w,w.node,y),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},G:function(h,y){try{if(y===0)return-28;var w=Ve("/")+1;return y<w?-68:(S("/",$,h,y),w)}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},K:function(h,y){try{return h=h?Qe($,h):"",_n(y,bn(h,!0))}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},C:function(h,y,w){try{return y=y?Qe($,y):"",y=Tt(h,y),fr(y,w),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},J:function(h,y,w,U){try{y=y?Qe($,y):"";var Y=U&256;return y=Tt(h,y,U&4096),_n(w,Y?bn(y,!0):bn(y))}catch(oe){if(typeof ut>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},x:function(h,y,w,U){Xn=U;try{y=y?Qe($,y):"",y=Tt(h,y);var Y=U?rr():0;return Mn(y,w,Y).fd}catch(oe){if(typeof ut>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},v:function(h,y,w,U){try{if(y=y?Qe($,y):"",y=Tt(h,y),0>=U)return-28;var Y=vr(y).node;if(!Y)throw new Me(44);if(!Y.La.readlink)throw new Me(28);var oe=Y.La.readlink(Y),ye=Math.min(U,Ve(oe)),qe=P[w+ye];return S(oe,$,w,U+1),P[w+ye]=qe,ye}catch(st){if(typeof ut>"u"||st.name!=="ErrnoError")throw st;return-st.Pa}},u:function(h){try{return h=h?Qe($,h):"",Si(h),0}catch(y){if(typeof ut>"u"||y.name!=="ErrnoError")throw y;return-y.Pa}},f:function(h,y){try{return h=h?Qe($,h):"",_n(y,bn(h))}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return-w.Pa}},r:function(h,y,w){try{return y=y?Qe($,y):"",y=Tt(h,y),w===0?as(y):w===512?Si(y):Ee("Invalid flags passed to unlinkat"),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},q:function(h,y,w){try{y=y?Qe($,y):"",y=Tt(h,y,!0);var U=Date.now(),Y,oe;if(w){var ye=Be[w>>2]+4294967296*he[w+4>>2],qe=he[w+8>>2];qe==1073741823?Y=U:qe==1073741822?Y=null:Y=1e3*ye+qe/1e6,w+=16,ye=Be[w>>2]+4294967296*he[w+4>>2],qe=he[w+8>>2],qe==1073741823?oe=U:qe==1073741822?oe=null:oe=1e3*ye+qe/1e6}else oe=Y=U;if((oe??Y)!==null){h=Y;var st=vr(y,{$a:!0}).node;En(st.La.Ua)(st,{atime:h,mtime:oe})}return 0}catch(at){if(typeof ut>"u"||at.name!=="ErrnoError")throw at;return-at.Pa}},m:()=>Ee(""),l:()=>{Ht=!1,Ga=0},A:function(h,y){h=-9007199254740992>h||9007199254740992<h?NaN:Number(h),h=new Date(1e3*h),he[y>>2]=h.getSeconds(),he[y+4>>2]=h.getMinutes(),he[y+8>>2]=h.getHours(),he[y+12>>2]=h.getDate(),he[y+16>>2]=h.getMonth(),he[y+20>>2]=h.getFullYear()-1900,he[y+24>>2]=h.getDay();var w=h.getFullYear();he[y+28>>2]=(w%4!==0||w%100===0&&w%400!==0?Ni:Tr)[h.getMonth()]+h.getDate()-1|0,he[y+36>>2]=-(60*h.getTimezoneOffset()),w=new Date(h.getFullYear(),6,1).getTimezoneOffset();var U=new Date(h.getFullYear(),0,1).getTimezoneOffset();he[y+32>>2]=(w!=U&&h.getTimezoneOffset()==Math.min(U,w))|0},y:function(h,y,w,U,Y,oe,ye){Y=-9007199254740992>Y||9007199254740992<Y?NaN:Number(Y);try{if(isNaN(Y))return 61;var qe=tr(U);if((y&2)!==0&&(w&2)===0&&(qe.flags&2097155)!==2)throw new Me(2);if((qe.flags&2097155)===1)throw new Me(2);if(!qe.Ma.ib)throw new Me(43);if(!h)throw new Me(28);var st=qe.Ma.ib(qe,h,Y,y,w),at=st.Kb;return he[oe>>2]=st.Ab,Be[ye>>2]=at,0}catch(qt){if(typeof ut>"u"||qt.name!=="ErrnoError")throw qt;return-qt.Pa}},z:function(h,y,w,U,Y,oe){oe=-9007199254740992>oe||9007199254740992<oe?NaN:Number(oe);try{var ye=tr(Y);if(w&2){if(w=oe,(ye.node.mode&61440)!==32768)throw new Me(43);if(!(U&2)){var qe=$.slice(h,h+y);ye.Ma.jb&&ye.Ma.jb(ye,qe,w,y,U)}}}catch(st){if(typeof ut>"u"||st.name!=="ErrnoError")throw st;return-st.Pa}},n:(h,y)=>{if($n[h]&&(clearTimeout($n[h].id),delete $n[h]),!y)return 0;var w=setTimeout(()=>{delete $n[h],xn(()=>ln(h,performance.now()))},y);return $n[h]={id:w,Xb:y},0},B:(h,y,w,U)=>{var Y=new Date().getFullYear(),oe=new Date(Y,0,1).getTimezoneOffset();Y=new Date(Y,6,1).getTimezoneOffset(),Be[h>>2]=60*Math.max(oe,Y),he[y>>2]=+(oe!=Y),y=ye=>{var qe=Math.abs(ye);return`UTC${0<=ye?"-":"+"}${String(Math.floor(qe/60)).padStart(2,"0")}${String(qe%60).padStart(2,"0")}`},h=y(oe),y=y(Y),Y<oe?(S(h,$,w,17),S(y,$,U,17)):(S(h,$,U,17),S(y,$,w,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:h=>{var y=$.length;if(h>>>=0,2147483648<h)return!1;for(var w=1;4>=w;w*=2){var U=y*(1+.2/w);U=Math.min(U,h+100663296);e:{U=(Math.min(2147483648,65536*Math.ceil(Math.max(h,U)/65536))-ge.buffer.byteLength+65535)/65536|0;try{ge.grow(U),_e();var Y=1;break e}catch{}Y=void 0}if(Y)return!0}return!1},E:(h,y)=>{var w=0;return Ti().forEach((U,Y)=>{var oe=y+w;for(Y=Be[h+4*Y>>2]=oe,oe=0;oe<U.length;++oe)P[Y++]=U.charCodeAt(oe);P[Y]=0,w+=U.length+1}),0},F:(h,y)=>{var w=Ti();Be[h>>2]=w.length;var U=0;return w.forEach(Y=>U+=Y.length+1),Be[y>>2]=U,0},e:function(h){try{var y=tr(h);return vn(y),0}catch(w){if(typeof ut>"u"||w.name!=="ErrnoError")throw w;return w.Pa}},p:function(h,y){try{var w=tr(h);return P[y]=w.tty?2:Jt(w.mode)?3:(w.mode&61440)===40960?7:4,me[y+2>>1]=0,K[y+8>>3]=BigInt(0),K[y+16>>3]=BigInt(0),0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},w:function(h,y,w,U){try{e:{var Y=tr(h);h=y;for(var oe,ye=y=0;ye<w;ye++){var qe=Be[h>>2],st=Be[h+4>>2];h+=8;var at=Ha(Y,P,qe,st,oe);if(0>at){var qt=-1;break e}if(y+=at,at<st)break;typeof oe<"u"&&(oe+=at)}qt=y}return Be[U>>2]=qt,0}catch(xr){if(typeof ut>"u"||xr.name!=="ErrnoError")throw xr;return xr.Pa}},D:function(h,y,w,U){y=-9007199254740992>y||9007199254740992<y?NaN:Number(y);try{if(isNaN(y))return 61;var Y=tr(h);return $t(Y,y,w),K[U>>3]=BigInt(Y.position),Y.ob&&y===0&&w===0&&(Y.ob=null),0}catch(oe){if(typeof ut>"u"||oe.name!=="ErrnoError")throw oe;return oe.Pa}},I:function(h){var w;try{var y=tr(h);return(w=y.Ma)!=null&&w.fsync?y.Ma.fsync(y):0}catch(U){if(typeof ut>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},t:function(h,y,w,U){try{e:{var Y=tr(h);h=y;for(var oe,ye=y=0;ye<w;ye++){var qe=Be[h>>2],st=Be[h+4>>2];h+=8;var at=is(Y,P,qe,st,oe);if(0>at){var qt=-1;break e}if(y+=at,at<st)break;typeof oe<"u"&&(oe+=at)}qt=y}return Be[U>>2]=qt,0}catch(xr){if(typeof ut>"u"||xr.name!=="ErrnoError")throw xr;return xr.Pa}},k:ha},Oe;(async function(){var w;function h(U){var Y;return Oe=U.exports,ge=Oe.M,_e(),Ie=Oe.O,G--,(Y=A.monitorRunDependencies)==null||Y.call(A,G),G==0&&ne&&(U=ne,ne=null,U()),Oe}G++,(w=A.monitorRunDependencies)==null||w.call(A,G);var y={a:vt};return A.instantiateWasm?new Promise(U=>{A.instantiateWasm(y,(Y,oe)=>{h(Y),U(Y.exports)})}):(ke??(ke=A.locateFile?A.locateFile("sql-wasm.wasm",R):R+"sql-wasm.wasm"),h((await Ge(y)).instance))})(),A._sqlite3_free=h=>(A._sqlite3_free=Oe.P)(h),A._sqlite3_value_text=h=>(A._sqlite3_value_text=Oe.Q)(h),A._sqlite3_prepare_v2=(h,y,w,U,Y)=>(A._sqlite3_prepare_v2=Oe.R)(h,y,w,U,Y),A._sqlite3_step=h=>(A._sqlite3_step=Oe.S)(h),A._sqlite3_reset=h=>(A._sqlite3_reset=Oe.T)(h),A._sqlite3_exec=(h,y,w,U,Y)=>(A._sqlite3_exec=Oe.U)(h,y,w,U,Y),A._sqlite3_finalize=h=>(A._sqlite3_finalize=Oe.V)(h),A._sqlite3_column_name=(h,y)=>(A._sqlite3_column_name=Oe.W)(h,y),A._sqlite3_column_text=(h,y)=>(A._sqlite3_column_text=Oe.X)(h,y),A._sqlite3_column_type=(h,y)=>(A._sqlite3_column_type=Oe.Y)(h,y),A._sqlite3_errmsg=h=>(A._sqlite3_errmsg=Oe.Z)(h),A._sqlite3_clear_bindings=h=>(A._sqlite3_clear_bindings=Oe._)(h),A._sqlite3_value_blob=h=>(A._sqlite3_value_blob=Oe.$)(h),A._sqlite3_value_bytes=h=>(A._sqlite3_value_bytes=Oe.aa)(h),A._sqlite3_value_double=h=>(A._sqlite3_value_double=Oe.ba)(h),A._sqlite3_value_int=h=>(A._sqlite3_value_int=Oe.ca)(h),A._sqlite3_value_type=h=>(A._sqlite3_value_type=Oe.da)(h),A._sqlite3_result_blob=(h,y,w,U)=>(A._sqlite3_result_blob=Oe.ea)(h,y,w,U),A._sqlite3_result_double=(h,y)=>(A._sqlite3_result_double=Oe.fa)(h,y),A._sqlite3_result_error=(h,y,w)=>(A._sqlite3_result_error=Oe.ga)(h,y,w),A._sqlite3_result_int=(h,y)=>(A._sqlite3_result_int=Oe.ha)(h,y),A._sqlite3_result_int64=(h,y)=>(A._sqlite3_result_int64=Oe.ia)(h,y),A._sqlite3_result_null=h=>(A._sqlite3_result_null=Oe.ja)(h),A._sqlite3_result_text=(h,y,w,U)=>(A._sqlite3_result_text=Oe.ka)(h,y,w,U),A._sqlite3_aggregate_context=(h,y)=>(A._sqlite3_aggregate_context=Oe.la)(h,y),A._sqlite3_column_count=h=>(A._sqlite3_column_count=Oe.ma)(h),A._sqlite3_data_count=h=>(A._sqlite3_data_count=Oe.na)(h),A._sqlite3_column_blob=(h,y)=>(A._sqlite3_column_blob=Oe.oa)(h,y),A._sqlite3_column_bytes=(h,y)=>(A._sqlite3_column_bytes=Oe.pa)(h,y),A._sqlite3_column_double=(h,y)=>(A._sqlite3_column_double=Oe.qa)(h,y),A._sqlite3_bind_blob=(h,y,w,U,Y)=>(A._sqlite3_bind_blob=Oe.ra)(h,y,w,U,Y),A._sqlite3_bind_double=(h,y,w)=>(A._sqlite3_bind_double=Oe.sa)(h,y,w),A._sqlite3_bind_int=(h,y,w)=>(A._sqlite3_bind_int=Oe.ta)(h,y,w),A._sqlite3_bind_text=(h,y,w,U,Y)=>(A._sqlite3_bind_text=Oe.ua)(h,y,w,U,Y),A._sqlite3_bind_parameter_index=(h,y)=>(A._sqlite3_bind_parameter_index=Oe.va)(h,y),A._sqlite3_sql=h=>(A._sqlite3_sql=Oe.wa)(h),A._sqlite3_normalized_sql=h=>(A._sqlite3_normalized_sql=Oe.xa)(h),A._sqlite3_changes=h=>(A._sqlite3_changes=Oe.ya)(h),A._sqlite3_close_v2=h=>(A._sqlite3_close_v2=Oe.za)(h),A._sqlite3_create_function_v2=(h,y,w,U,Y,oe,ye,qe,st)=>(A._sqlite3_create_function_v2=Oe.Aa)(h,y,w,U,Y,oe,ye,qe,st),A._sqlite3_update_hook=(h,y,w)=>(A._sqlite3_update_hook=Oe.Ba)(h,y,w),A._sqlite3_open=(h,y)=>(A._sqlite3_open=Oe.Ca)(h,y);var Ar=A._malloc=h=>(Ar=A._malloc=Oe.Da)(h),Wt=A._free=h=>(Wt=A._free=Oe.Ea)(h);A._RegisterExtensionFunctions=h=>(A._RegisterExtensionFunctions=Oe.Fa)(h);var Vr=(h,y)=>(Vr=Oe.Ga)(h,y),ln=(h,y)=>(ln=Oe.Ha)(h,y),Ut=h=>(Ut=Oe.Ia)(h),Vt=h=>(Vt=Oe.Ja)(h),Mr=()=>(Mr=Oe.Ka)();A.stackSave=()=>Mr(),A.stackRestore=h=>Ut(h),A.stackAlloc=h=>Vt(h),A.cwrap=(h,y,w,U)=>{var Y=!w||w.every(oe=>oe==="number"||oe==="boolean");return y!=="string"&&Y&&!U?A["_"+h]:(...oe)=>I(h,y,w,oe)},A.addFunction=je,A.removeFunction=Ue,A.UTF8ToString=Fe,A.ALLOC_NORMAL=D,A.allocate=F,A.allocateUTF8OnStack=ga;function nr(){function h(){var Y;if(A.calledRun=!0,!te){if(!A.noFSInit&&!Ma){var y,w;Ma=!0,U??(U=A.stdin),y??(y=A.stdout),w??(w=A.stderr),U?Ot("stdin",U):Fa("/dev/tty","/dev/stdin"),y?Ot("stdout",null,y):Fa("/dev/tty","/dev/stdout"),w?Ot("stderr",null,w):Fa("/dev/tty1","/dev/stderr"),Mn("/dev/stdin",0),Mn("/dev/stdout",1),Mn("/dev/stderr",1)}if(Oe.N(),Pn=!1,(Y=A.onRuntimeInitialized)==null||Y.call(A),A.postRun)for(typeof A.postRun=="function"&&(A.postRun=[A.postRun]);A.postRun.length;){var U=A.postRun.shift();Et.unshift(U)}We(Et)}}if(0<G)ne=nr;else{if(A.preRun)for(typeof A.preRun=="function"&&(A.preRun=[A.preRun]);A.preRun.length;)Nr();We(Kt),0<G?ne=nr:A.setStatus?(A.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>A.setStatus(""),1),h()},1)):h()}}if(A.preInit)for(typeof A.preInit=="function"&&(A.preInit=[A.preInit]);0<A.preInit.length;)A.preInit.pop()();return nr(),d}),a)};n.exports=s,n.exports.default=s}(Df)),Df.exports}var hC=AC();const gC=xi(hC);var bm=`
\uFEFFCREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

BEGIN TRANSACTION;
CREATE TABLE "Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "Gender" VARCHAR NULL,
    "FirstName" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "BirthDate" TEXT NOT NULL,
    "AddressStreet" VARCHAR NULL,
    "AddressCity" VARCHAR NULL,
    "AddressState" VARCHAR NULL,
    "AddressZipCode" VARCHAR NULL,
    "AddressCountry" VARCHAR NULL,
    "Hobbies" TEXT NULL,
    "EmailPrefix" TEXT NULL,
    "PhoneMobile" TEXT NULL,
    "BankAccountIBAN" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Services" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Services" PRIMARY KEY,
    "Name" TEXT NULL,
    "Url" TEXT NULL,
    "Logo" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

CREATE TABLE "Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "Username" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "ServiceId" TEXT NOT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Attachment" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachment" PRIMARY KEY,
    "Filename" TEXT NOT NULL,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Attachment_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Passwords" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passwords" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Attachment_CredentialId" ON "Attachment" ("CredentialId");

CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708094944_1.0.0-InitialMigration', '9.0.4');

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');

BEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');

BEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');

COMMIT;
`,vm={1:`\uFEFFBEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');

COMMIT;`,2:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');

COMMIT;`,3:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "EncryptionKeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "IsPrimary" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');

COMMIT;`,4:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "Settings" (
    "Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
    "Value" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');

COMMIT;`,5:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Aliases" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
    "BirthDate" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Email" TEXT NULL,
    "FirstName" VARCHAR NULL,
    "Gender" VARCHAR NULL,
    "LastName" VARCHAR NULL,
    "NickName" VARCHAR NULL,
    "UpdatedAt" TEXT NOT NULL
);

INSERT INTO "ef_temp_Aliases" ("Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt")
SELECT "Id", "BirthDate", "CreatedAt", "Email", "FirstName", "Gender", "LastName", "NickName", "UpdatedAt"
FROM "Aliases";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Aliases";

ALTER TABLE "ef_temp_Aliases" RENAME TO "Aliases";

COMMIT;

PRAGMA foreign_keys = 1;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');`,6:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Credentials" PRIMARY KEY,
    "AliasId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "Notes" TEXT NULL,
    "ServiceId" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "Username" TEXT NULL,
    CONSTRAINT "FK_Credentials_Aliases_AliasId" FOREIGN KEY ("AliasId") REFERENCES "Aliases" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_Credentials_Services_ServiceId" FOREIGN KEY ("ServiceId") REFERENCES "Services" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Credentials" ("Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username")
SELECT "Id", "AliasId", "CreatedAt", "Notes", "ServiceId", "UpdatedAt", "Username"
FROM "Credentials";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Credentials";

ALTER TABLE "ef_temp_Credentials" RENAME TO "Credentials";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");

CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');`,7:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Services" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Passwords" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "EncryptionKeys" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Credentials" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');

COMMIT;`,8:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "Attachment" RENAME TO "Attachments";

CREATE TABLE "ef_temp_Attachments" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Attachments" PRIMARY KEY,
    "Blob" BLOB NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "Filename" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Attachments" ("Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt")
SELECT "Id", "Blob", "CreatedAt", "CredentialId", "Filename", "IsDeleted", "UpdatedAt"
FROM "Attachments";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');`,9:`\uFEFFBEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');

COMMIT;`},zr=[{revision:1,version:"1.0.0",description:"Initial Migration",releaseVersion:"0.1.0"},{revision:2,version:"1.0.1",description:"Empty Test Migration",releaseVersion:"0.2.0"},{revision:3,version:"1.0.2",description:"Change Email Column",releaseVersion:"0.3.0"},{revision:4,version:"1.1.0",description:"Add Pki Tables",releaseVersion:"0.4.0"},{revision:5,version:"1.2.0",description:"Add Settings Table",releaseVersion:"0.4.0"},{revision:6,version:"1.3.0",description:"Update Identity Structure",releaseVersion:"0.5.0"},{revision:7,version:"1.3.1",description:"Make Username Optional",releaseVersion:"0.5.0"},{revision:8,version:"1.4.0",description:"Add Sync Support",releaseVersion:"0.6.0"},{revision:9,version:"1.4.1",description:"Rename Attachments Plural",releaseVersion:"0.6.0"},{revision:10,version:"1.5.0",description:"Add 2FA Tokens to credentials",releaseVersion:"0.14.0"}],aA=class{getCreateVaultSql(){try{return{success:!0,sqlCommands:[bm],version:zr[zr.length-1].version,migrationNumber:zr[zr.length-1].revision}}catch(n){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:n instanceof Error?n.message:"Unknown error creating vault SQL"}}}getUpgradeVaultSql(n,r){try{const a=r??zr[zr.length-1].revision,s=zr.find(c=>c.revision===a);if(!s)return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target migration number ${a} not found`};if(n>=a)return{success:!0,sqlCommands:[],version:s.version,migrationNumber:a};const o=zr.filter(c=>c.revision>n&&c.revision<=a),u=[];for(const c of o){const d=c.revision-1,m=vm[d];m&&u.push(m)}return{success:!0,sqlCommands:u,version:s.version,migrationNumber:a}}catch(a){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:a instanceof Error?a.message:"Unknown error generating upgrade SQL"}}}getUpgradeToLatestSql(n){return this.getUpgradeVaultSql(n)}getUpgradeToVersionSql(n,r){const a=zr.find(s=>s.version===r);return a?this.getUpgradeVaultSql(n,a.revision):{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target version ${r} not found`}}getVersionCheckSql(){return["SELECT name FROM sqlite_master WHERE type='table' AND name='Settings';","SELECT Value FROM Settings WHERE Key = 'vault_version' AND IsDeleted = 0 LIMIT 1;","SELECT Value FROM Settings WHERE Key = 'vault_migration_number' AND IsDeleted = 0 LIMIT 1;"]}getVaultValidationSql(){return`SELECT name FROM sqlite_master WHERE type='table' AND name IN
            ('Aliases', 'Services', 'Credentials', 'Passwords', 'Attachments', 'EncryptionKeys', 'Settings', 'TotpCodes');`}parseVaultVersionInfo(n,r,a){let s="0.0.0",o=0;n&&(r?s=r:(s="1.0.0",o=1),a&&(o=parseInt(a,10)));const u=zr[zr.length-1],c=o<u.revision,d=zr.filter(m=>m.revision>o);return{currentVersion:s,currentMigrationNumber:o,targetVersion:u.version,targetMigrationNumber:u.revision,needsUpgrade:c,availableUpgrades:d}}validateVaultStructure(n){const r=["Aliases","Services","Credentials","Passwords","Attachments","EncryptionKeys","Settings","TotpCodes"];return n.filter(s=>r.includes(s)).length>=5}getAllVersions(){return[...zr]}getLatestVersion(){return zr[zr.length-1]}getMigrationSql(n){return vm[n]}getCompleteSchemaSql(){return bm}};const xm="UklGRjoEAABXRUJQVlA4IC4EAAAwFwCdASqAAIAAPpFCm0olo6Ihp5IraLASCWUA0eb/0s56RrLtCnYfLPiBshdXWMx8j1Ez65f169iA4xUDBTEV6ylMQeCIj2b7RngGi7gKZ9WjKdSoy9R8JcgOmjCMlDmLG20KhNo/i/Dc/Ah5GAvGfm8kfniV3AkR6fxN6eKwjDc6xrDgSfS48G5uGV6WzQt24YAVlLSK9BMwndzfHnePK1KFchFrL7O3ulB8cGNCeomu4o+l0SrS/JKblJ4WTzj0DAD++lCUEouSfgRKdiV2TiYCD+H+l3tANKSPQFPQuzi7rbvxqGeRmXB9kDwURaoSTTpYjA9REMUi9uA6aV7PWtBNXgUzMLowYMZeos6Xvyhb34GmufswMHA5ZyYpxzjTphOak4ZjNOiz8aScO5ygiTx99SqwX/uL+HSeVOSraHw8IymrMwm+jLxqN8BS8dGcItLlm/ioulqH2j4V8glDgSut+ExkxiD7m8TGPrrjCQNJbRDzpOFsyCyfBZupvp8QjGKW2KGziSZeIWes4aTB9tRmeEBhnUrmTDZQuXcc67Fg82KHrSfaeeOEq6jjuUjQ8wUnzM4Zz3dhrwSyslVz/WvnKqYkr4V/TTXPFF5EjF4rM1bHZ8bK63EfTnK41+n3n4gEFoYP4mXkNH0hntnYcdTqiE7Gn+q0BpRRxnkpBSZlA6Wa70jpW0FGqkw5e591A5/H+OV+60WAo+4Mi+NlsKrvLZ9EiVaPnoEFZlJQx1fA777AJ2MjXJ4KSsrWDWJi1lE8yPs8V6XvcC0chDTYt8456sKXAagCZyY+fzQriFMaddXyKQdG8qBqcdYjAsiIcjzaRFBBoOK9sU+sFY7N6B6+xtrlu3c37rQKkI3O2EoiJOris54EjJ5OFuumA0M6riNUuBf/MEPFBVx1JRcUEs+upEBsCnwYski7FT3TTqHrx7v5AjgFN97xhPTkmVpu6sxRnWBi1fxIRp8eWZeFM6mUcGgVk1WeVb1yhdV9hoMo2TsNEPE0tHo/wvuSJSzbZo7wibeXM9v/rRfKcx7X93rfiXVnyQ9f/5CaAQ4lxedPp/6uzLtOS4FyL0bCNeZ6L5w+AiuyWCTDFIYaUzhwfG+/YTQpWyeZCdQIKzhV+3GeXI2cxoP0ER/DlOKymf1gm+zRU3sqf1lBVQ0y+mK/Awl9bS3uaaQmI0FUyUwHUKP7PKuXnO+LcwDv4OfPT6hph8smc1EtMe5ib/apar/qZ9dyaEaElALJ1KKxnHziuvVl8atk1fINSQh7OtXDyqbPw9o/nGIpTnv5iFmwmWJLis2oyEgPkJqyx0vYI8rjkVEzKc8eQavAJBYSpjMwM193Swt+yJyjvaGYWPnqExxKiNarpB2WSO7soCAZXhS1uEYHryrK47BH6W1dRiruqT0xpLih3MXiwU3VDwAAAA==";class _u{constructor(){Br(this,"db",null);Br(this,"isInTransaction",!1)}async initializeFromBase64(r){try{const a=atob(r),s=new Uint8Array(a.length);for(let u=0;u<a.length;u++)s[u]=a.charCodeAt(u);const o=await gC({locateFile:u=>`src/${u}`});this.db=new o.Database(s)}catch(a){throw console.error("Error initializing SQLite database:",a),a}}beginTransaction(){if(!this.db)throw new Error("Database not initialized");if(this.isInTransaction)throw new Error("Transaction already in progress");try{this.db.run("BEGIN TRANSACTION"),this.isInTransaction=!0}catch(r){throw console.error("Error beginning transaction:",r),r}}async commitTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("COMMIT"),this.isInTransaction=!1}catch(r){throw console.error("Error committing transaction:",r),r}}rollbackTransaction(){if(!this.db)throw new Error("Database not initialized");if(!this.isInTransaction)throw new Error("No transaction in progress");try{this.db.run("ROLLBACK"),this.isInTransaction=!1}catch(r){throw console.error("Error rolling back transaction:",r),r}}exportToBase64(){if(!this.db)throw new Error("Database not initialized");try{const r=this.db.export();let a="";for(let s=0;s<r.length;s++)a+=String.fromCharCode(r[s]);return btoa(a)}catch(r){throw console.error("Error exporting SQLite database:",r),r}}executeQuery(r,a=[]){if(!this.db)throw new Error("Database not initialized");try{const s=this.db.prepare(r);s.bind(a);const o=[];for(;s.step();)o.push(s.getAsObject());return s.free(),o}catch(s){throw console.error("Error executing query:",s),s}}executeUpdate(r,a=[]){if(!this.db)throw new Error("Database not initialized");try{const s=this.db.prepare(r);s.bind(a),s.step();const o=this.db.getRowsModified();return s.free(),o}catch(s){throw console.error("Error executing update:",s),s}}close(){this.db&&(this.db.close(),this.db=null)}getCredentialById(r){const s=this.executeQuery(`
        SELECT DISTINCT
            c.Id,
            c.Username,
            c.Notes,
            c.ServiceId,
            s.Name as ServiceName,
            s.Url as ServiceUrl,
            s.Logo as Logo,
            a.FirstName,
            a.LastName,
            a.NickName,
            a.BirthDate,
            a.Gender,
            a.Email,
            p.Value as Password
        FROM Credentials c
        LEFT JOIN Services s ON c.ServiceId = s.Id
        LEFT JOIN Aliases a ON c.AliasId = a.Id
        LEFT JOIN Passwords p ON p.CredentialId = c.Id
        WHERE c.IsDeleted = 0
        AND c.Id = ?`,[r]);if(s.length===0)return null;const o=s[0];return{Id:o.Id,Username:o.Username,Password:o.Password,ServiceName:o.ServiceName,ServiceUrl:o.ServiceUrl,Logo:o.Logo,Notes:o.Notes,Alias:{FirstName:o.FirstName,LastName:o.LastName,NickName:o.NickName,BirthDate:o.BirthDate,Gender:o.Gender,Email:o.Email}}}getAllCredentials(){return this.executeQuery(`
            SELECT DISTINCT
                c.Id,
                c.Username,
                c.Notes,
                c.ServiceId,
                s.Name as ServiceName,
                s.Url as ServiceUrl,
                s.Logo as Logo,
                a.FirstName,
                a.LastName,
                a.NickName,
                a.BirthDate,
                a.Gender,
                a.Email,
                p.Value as Password
            FROM Credentials c
            LEFT JOIN Services s ON c.ServiceId = s.Id
            LEFT JOIN Aliases a ON c.AliasId = a.Id
            LEFT JOIN Passwords p ON p.CredentialId = c.Id
            WHERE c.IsDeleted = 0
            ORDER BY c.CreatedAt DESC`).map(s=>({Id:s.Id,Username:s.Username,Password:s.Password,ServiceName:s.ServiceName,ServiceUrl:s.ServiceUrl,Logo:s.Logo,Notes:s.Notes,Alias:{FirstName:s.FirstName,LastName:s.LastName,NickName:s.NickName,BirthDate:s.BirthDate,Gender:s.Gender,Email:s.Email}}))}getAllEmailAddresses(){return this.executeQuery(`
      SELECT DISTINCT
        a.Email
      FROM Credentials c
      LEFT JOIN Aliases a ON c.AliasId = a.Id
      WHERE a.Email IS NOT NULL AND a.Email != '' AND c.IsDeleted = 0
    `).map(s=>s.Email)}getAllEncryptionKeys(){return this.executeQuery(`SELECT
                x.PublicKey,
                x.PrivateKey,
                x.IsPrimary
            FROM EncryptionKeys x`)}getSetting(r,a=""){const s=this.executeQuery(`SELECT
                s.Value
            FROM Settings s
            WHERE s.Key = ?`,[r]);return s.length>0?s[0].Value:a}getDefaultEmailDomain(r,a){const s=this.getSetting("DefaultEmailDomain"),o=d=>!!(d&&d!=="DISABLED.TLD"&&(r.includes(d)||a.includes(d)));if(s&&o(s))return s;const u=r.find(o);if(u)return u;const c=a.find(o);return c||null}getDefaultIdentityLanguage(){return this.getSetting("DefaultIdentityLanguage","en")}getDefaultIdentityGender(){return this.getSetting("DefaultIdentityGender","random")}getPasswordSettings(){const r=this.getSetting("PasswordGenerationSettings"),a={Length:18,UseLowercase:!0,UseUppercase:!0,UseNumbers:!0,UseSpecialChars:!0,UseNonAmbiguousChars:!1};try{if(r)return{...a,...JSON.parse(r)}}catch(s){console.warn("Failed to parse password settings:",s)}return a}async createCredential(r,a){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();let s=null;try{if(r.Logo)if(typeof r.Logo=="object"&&!ArrayBuffer.isView(r.Logo)){const v=Object.values(r.Logo);s=new Uint8Array(v)}else(Array.isArray(r.Logo)||r.Logo instanceof ArrayBuffer||r.Logo instanceof Uint8Array)&&(s=new Uint8Array(r.Logo))}catch(v){console.warn("Failed to convert logo to Uint8Array:",v),s=null}const o=`
                INSERT INTO Services (Id, Name, Url, Logo, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?)`,u=crypto.randomUUID().toUpperCase(),c=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23);this.executeUpdate(o,[u,r.ServiceName,r.ServiceUrl??null,s,c,c,0]);const d=`
                INSERT INTO Aliases (Id, FirstName, LastName, NickName, BirthDate, Gender, Email, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,m=crypto.randomUUID().toUpperCase();this.executeUpdate(d,[m,r.Alias.FirstName??null,r.Alias.LastName??null,r.Alias.NickName??null,r.Alias.BirthDate??null,r.Alias.Gender??null,r.Alias.Email??null,c,c,0]);const A=`
                INSERT INTO Credentials (Id, Username, Notes, ServiceId, AliasId, CreatedAt, UpdatedAt, IsDeleted)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,b=crypto.randomUUID().toUpperCase();if(this.executeUpdate(A,[b,r.Username??null,r.Notes??null,u,m,c,c,0]),r.Password){const v=`
                    INSERT INTO Passwords (Id, Value, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
                    VALUES (?, ?, ?, ?, ?, ?)`,B=crypto.randomUUID().toUpperCase();this.executeUpdate(v,[B,r.Password,b,c,c,0])}if(a)for(const v of a){const B=`
            INSERT INTO Attachments (Id, Filename, Blob, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
            VALUES (?, ?, ?, ?, ?, ?, ?)`,T=crypto.randomUUID().toUpperCase();this.executeUpdate(B,[T,v.Filename,v.Blob,b,c,c,0])}return await this.commitTransaction(),b}catch(s){throw this.rollbackTransaction(),console.error("Error creating credential:",s),s}}getDatabaseVersion(){if(!this.db)throw new Error("Database not initialized");try{const r=this.executeQuery(`
        SELECT MigrationId
        FROM __EFMigrationsHistory
        ORDER BY MigrationId DESC
        LIMIT 1`);if(r.length===0)throw new Error("No migrations found in the database.");const a=r[0].MigrationId,o=/_(\d+\.\d+\.\d+)-/.exec(a);let u=null;o!=null&&o[1]&&(u=o[1]);const m=new aA().getAllVersions().find(A=>A.version===u);if(!m)throw new Error("This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.");return m}catch(r){throw console.error("Error getting database version:",r),r}}async getLatestDatabaseVersion(){const a=new aA().getAllVersions();return a[a.length-1]}async hasPendingMigrations(){try{const r=this.getDatabaseVersion(),a=await this.getLatestDatabaseVersion();return r.revision<a.revision}catch(r){throw console.error("Error checking pending migrations:",r),r}}getTotpCodesForCredential(r){if(!this.db)throw new Error("Database not initialized");try{return this.tableExists("TotpCodes")?this.executeQuery(`
        SELECT
          Id,
          Name,
          SecretKey,
          CredentialId
        FROM TotpCodes
        WHERE CredentialId = ? AND IsDeleted = 0`,[r]):[]}catch(a){return console.error("Error getting TOTP codes:",a),[]}}getAttachmentsForCredential(r){if(!this.db)throw new Error("Database not initialized");try{return this.tableExists("Attachments")?this.executeQuery(`
        SELECT
          Id,
          Filename,
          Blob,
          CredentialId,
          CreatedAt,
          UpdatedAt,
          IsDeleted
        FROM Attachments
        WHERE CredentialId = ? AND IsDeleted = 0`,[r]):[]}catch(a){return console.error("Error getting attachments:",a),[]}}async deleteCredentialById(r){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();const a=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23),s=`
        UPDATE Credentials
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = ?`,o=`
        UPDATE Aliases
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = (
          SELECT AliasId
          FROM Credentials
          WHERE Id = ?
        )`,u=`
        UPDATE Services
        SET IsDeleted = 1,
            UpdatedAt = ?
        WHERE Id = (
          SELECT ServiceId
          FROM Credentials
          WHERE Id = ?
        )`,c=this.executeUpdate(s,[a,r]);return this.executeUpdate(o,[a,r]),this.executeUpdate(u,[a,r]),await this.commitTransaction(),c}catch(a){throw this.rollbackTransaction(),console.error("Error deleting credential:",a),a}}async updateCredentialById(r,a,s){if(!this.db)throw new Error("Database not initialized");try{this.beginTransaction();const o=new Date().toISOString().replace("T"," ").replace("Z","").substring(0,23),u=this.getCredentialById(r.Id);if(!u)throw new Error("Credential not found");const c=`
        UPDATE Services
        SET Name = ?,
            Url = ?,
            Logo = COALESCE(?, Logo),
            UpdatedAt = ?
        WHERE Id = (
          SELECT ServiceId
          FROM Credentials
          WHERE Id = ?
        )`;let d=null;try{if(r.Logo)if(typeof r.Logo=="object"&&!ArrayBuffer.isView(r.Logo)){const v=Object.values(r.Logo);d=new Uint8Array(v)}else(Array.isArray(r.Logo)||r.Logo instanceof ArrayBuffer||r.Logo instanceof Uint8Array)&&(d=new Uint8Array(r.Logo))}catch(v){console.warn("Failed to convert logo to Uint8Array:",v),d=null}this.executeUpdate(c,[r.ServiceName,r.ServiceUrl??null,d,o,r.Id]);const m=`
        UPDATE Aliases
        SET FirstName = ?,
            LastName = ?,
            NickName = ?,
            BirthDate = ?,
            Gender = ?,
            Email = ?,
            UpdatedAt = ?
        WHERE Id = (
          SELECT AliasId
          FROM Credentials
          WHERE Id = ?
        )`;let A=r.Alias.BirthDate;if(A&&u.Alias.BirthDate){const v=new Date(A),B=new Date(u.Alias.BirthDate);v.getTime()===B.getTime()&&(A=u.Alias.BirthDate)}if(this.executeUpdate(m,[r.Alias.FirstName??null,r.Alias.LastName??null,r.Alias.NickName??null,A??null,r.Alias.Gender??null,r.Alias.Email??null,o,r.Id]),this.executeUpdate(`
        UPDATE Credentials
        SET Username = ?,
            Notes = ?,
            UpdatedAt = ?
        WHERE Id = ?`,[r.Username??null,r.Notes??null,o,r.Id]),r.Password!==u.Password&&(this.executeQuery(`
          SELECT Id
          FROM Passwords
          WHERE CredentialId = ?`,[r.Id]).length===0?this.executeUpdate(`
            INSERT INTO Passwords (Id, Value, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
            VALUES (?, ?, ?, ?, ?, ?)`,[crypto.randomUUID().toUpperCase(),r.Password,r.Id,o,o,0]):this.executeUpdate(`
            UPDATE Passwords
            SET Value = ?, UpdatedAt = ?
            WHERE CredentialId = ?`,[r.Password,o,r.Id])),s){const v=s.map(T=>T.Id),B=a.filter(T=>!v.includes(T));for(const T of B)this.executeUpdate(`
            UPDATE Attachments
            SET IsDeleted = 1,
                UpdatedAt = ?
            WHERE Id = ?`,[o,T]);for(const T of s)a.includes(T.Id)||this.executeUpdate(`
              INSERT INTO Attachments (Id, Filename, Blob, CredentialId, CreatedAt, UpdatedAt, IsDeleted)
              VALUES (?, ?, ?, ?, ?, ?, ?)`,[T.Id,T.Filename,T.Blob,r.Id,o,o,0])}return await this.commitTransaction(),1}catch(o){throw this.rollbackTransaction(),console.error("Error updating credential:",o),o}}static imgSrcFromBytes(r){if(r)try{const a=this.toUint8Array(r),s=this.base64Encode(a);return`data:${this.detectMimeType(a)};base64,${s}`}catch(a){return console.error("Error setting logo:",a),`data:image/x-icon;base64,${xm}`}else return`data:image/x-icon;base64,${xm}`}static detectMimeType(r){const a=()=>{const u=new TextDecoder().decode(r.slice(0,5)).toLowerCase();return u.includes("<?xml")||u.includes("<svg")},s=()=>r[0]===0&&r[1]===0&&r[2]===1&&r[3]===0,o=()=>r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71;return a()?"image/svg+xml":s()?"image/x-icon":o()?"image/png":"image/x-icon"}static toUint8Array(r){if(r instanceof Uint8Array)return r;if(Array.isArray(r))return new Uint8Array(r);const a=Object.keys(r).length,s=new Uint8Array(a);for(let o=0;o<a;o++)s[o]=r[o];return s}static base64Encode(r){try{const a=Array.from(this.toUint8Array(r));return btoa(a.reduce((s,o)=>s+String.fromCharCode(o),""))}catch(a){return console.error("Error encoding to base64:",a),null}}tableExists(r){if(!this.db)throw new Error("Database not initialized");try{return this.executeQuery(`
        SELECT name FROM sqlite_master
        WHERE type='table' AND name=?`,[r]).length>0}catch(a){return console.error(`Error checking if table ${r} exists:`,a),!1}}executeRaw(r){if(!this.db)throw new Error("Database not initialized");try{const a=r.split(";");for(const s of a){const o=s.trim();o.length===0||o.toUpperCase().startsWith("BEGIN TRANSACTION")||o.toUpperCase().startsWith("COMMIT")||o.toUpperCase().startsWith("ROLLBACK")||this.db.run(o)}}catch(a){throw console.error("Error executing raw SQL:",a),a}}}const sy=M.createContext(void 0),mC=({children:n})=>{const[r,a]=M.useState(null),[s,o]=M.useState(!1),[u,c]=M.useState(!1),[d,m]=M.useState(null),A=M.useCallback(async(R,N)=>{const O=await Yt.symmetricDecrypt(R.vault.blob,N),_=new _u;await _.initializeFromBase64(O),a(_),o(!0),c(!0),m({publicEmailDomains:R.vault.publicEmailDomainList,privateEmailDomains:R.vault.privateEmailDomainList,vaultRevisionNumber:R.vault.currentRevisionNumber});const q={vaultBlob:R.vault.blob,derivedKey:N,publicEmailDomainList:R.vault.publicEmailDomainList,privateEmailDomainList:R.vault.privateEmailDomainList,vaultRevisionNumber:R.vault.currentRevisionNumber};return await Dn("STORE_VAULT",q,"background"),_},[]),b=M.useCallback(async()=>{try{const R=await Dn("GET_VAULT",{},"background");if(R!=null&&R.vault){const N=new _u;await N.initializeFromBase64(R.vault),a(N),o(!0),c(!0),m({publicEmailDomains:R.publicEmailDomains??[],privateEmailDomains:R.privateEmailDomains??[],vaultRevisionNumber:R.vaultRevisionNumber??0})}else o(!0),c(!1)}catch(R){console.error("Error retrieving vault from background:",R),o(!0),c(!1)}},[]),v=M.useCallback(async()=>d,[d]),B=M.useCallback(async R=>{m({publicEmailDomains:(d==null?void 0:d.publicEmailDomains)??[],privateEmailDomains:(d==null?void 0:d.privateEmailDomains)??[],vaultRevisionNumber:R})},[d]),T=M.useCallback(async()=>r?await r.hasPendingMigrations():!1,[r]);M.useEffect(()=>{s||b()},[s,b]);const Q=M.useCallback(()=>{a(null),o(!1),c(!1),Dn("CLEAR_VAULT",{},"background")},[]),k=M.useMemo(()=>({sqliteClient:r,dbInitialized:s,dbAvailable:u,initializeDatabase:A,clearDatabase:Q,getVaultMetadata:v,setCurrentVaultRevisionNumber:B,hasPendingMigrations:T}),[r,s,u,A,Q,v,B,T]);return p.jsx(sy.Provider,{value:k,children:n})},Lr=()=>{const n=M.useContext(sy);if(n===void 0)throw new Error("useDb must be used within a DbProvider");return n},Tu="local:aliasvault_disabled_sites",Ou="local:aliasvault_global_autofill_popup_enabled",Cm="local:aliasvault_global_context_menu_enabled",Fu="local:aliasvault_vault_locked_dismiss_until",yu="local:aliasvault_temporary_disabled_sites",ly=M.createContext(void 0),pC=({children:n})=>{const[r,a]=M.useState(!1),[s,o]=M.useState(!1),[u,c]=M.useState(null),[d,m]=M.useState(null),A=Lr(),b=M.useCallback(async()=>{let R=!1;const N=await Xe.getItem("local:accessToken"),O=await Xe.getItem("local:refreshToken"),_=await Xe.getItem("local:username");return N&&O&&_&&(c(_),a(!0),R=!0),o(!0),{isLoggedIn:R}},[c,a]);M.useEffect(()=>{b()},[b]);const v=M.useCallback(async(R,N,O)=>{await Xe.setItem("local:username",R),await Xe.setItem("local:accessToken",N),await Xe.setItem("local:refreshToken",O),c(R)},[]),B=M.useCallback(async()=>{a(!0),await Xe.setItem(Fu,0)},[]),T=M.useCallback(async R=>{await Dn("CLEAR_VAULT",{},"background"),await Xe.removeItems(["local:username","local:accessToken","local:refreshToken"]),A==null||A.clearDatabase(),R&&m(R),c(null),a(!1)},[A]),Q=M.useCallback(()=>{m(null)},[]),k=M.useMemo(()=>({isLoggedIn:r,isInitialized:s,username:u,initializeAuth:b,setAuthTokens:v,login:B,logout:T,globalMessage:d,clearGlobalMessage:Q}),[r,s,u,b,d,v,B,T,Q]);return p.jsx(ly.Provider,{value:k,children:n})},Yn=()=>{const n=M.useContext(ly);if(n===void 0)throw new Error("useAuth must be used within an AuthProvider");return n},yC=({routes:n=[],rightButtons:r})=>{const{t:a}=Bt(),s=Yn(),o=kr(),u=zn(),c=n==null?void 0:n.find(A=>{const b=A.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${b}$`).test(u.pathname)}),d=()=>{o("/auth-settings")},m=()=>{u.pathname==="/upgrade"||u.pathname==="/login"||u.pathname==="/unlock"||(s.isLoggedIn?o("/credentials"):o("/"))};return p.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:p.jsxs("div",{className:"flex items-center h-16 px-4",children:[c!=null&&c.showBackButton?p.jsx("button",{id:"back",onClick:()=>o(-1),className:"flex items-center gap-2 hover:bg-gray-100 dark:hover:bg-gray-700 pr-2 pt-1.5 pb-1.5 rounded-lg group",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("svg",{className:"w-5 h-5 text-gray-500 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),c.title&&p.jsx("h1",{className:"text-lg font-medium text-gray-900 dark:text-white ml-2",children:c.title})]})}):p.jsx("div",{className:"flex items-center",children:p.jsxs("button",{onClick:()=>m(),className:"flex items-center hover:opacity-80 transition-opacity",children:[p.jsx("img",{src:"/assets/images/logo.svg",alt:"AliasVault",className:"h-8 w-8 mr-2"}),p.jsx("h1",{className:"text-gray-900 dark:text-white text-xl font-bold",children:a("common.appName")}),p.jsx("span",{className:"text-primary-500 text-[10px] ml-1 font-normal",children:"BETA"})]})}),p.jsx("div",{className:"flex-grow"}),p.jsx("div",{className:"flex items-center gap-2",children:s.isLoggedIn?r:p.jsxs(p.Fragment,{children:[r,p.jsxs("button",{id:"settings",onClick:d,className:"p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",children:[p.jsx("span",{className:"sr-only",children:a("common.settings")}),p.jsx("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})]})]})})]})})},Ps=()=>{const n={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},r=p.jsxs(p.Fragment,{children:[p.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),p.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:n})]});return p.jsx("div",{className:"inline-flex items-center",children:r})},oy=M.createContext(void 0),EC=({children:n})=>{const[r,a]=M.useState(null),s=M.useCallback(u=>{a(u)},[]),o=M.useMemo(()=>({setHeaderButtons:s,headerButtons:r}),[s,r]);return p.jsx(oy.Provider,{value:o,children:n})},ca=()=>{const n=M.useContext(oy);if(n===void 0)throw new Error("useHeaderButtons must be used within a HeaderButtonsProvider");return n},bC=()=>{const{isLoading:n}=yn();if(!n)return null;const r={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},a=p.jsxs(p.Fragment,{children:[p.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),p.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:r})]});return p.jsx("div",{className:"fixed inset-0 w-full h-full z-50 bg-gray-200 dark:bg-gray-500 bg-opacity-90 flex items-center justify-center",children:p.jsx("div",{className:"relative",children:a})})},uy=M.createContext(void 0),vC=({children:n})=>{const[r,a]=M.useState(!0),[s,o]=M.useState(!1),[u,c]=M.useState(void 0),d=b=>{o(!0),c(b)},m=()=>{o(!1),c(void 0)},A=M.useMemo(()=>({isLoading:s,loadingMessage:u,showLoading:d,hideLoading:m,isInitialLoading:r,setIsInitialLoading:a}),[s,u,r]);return p.jsxs(uy.Provider,{value:A,children:[p.jsx(bC,{message:u}),n]})},yn=()=>{const n=M.useContext(uy);if(n===void 0)throw new Error("useLoading must be used within a LoadingProvider");return n},xC="session:lastVisitedPage",CC="session:lastVisitedTime",wC="session:navigationHistory",cy=M.createContext(void 0),IC=({children:n})=>{const r=zn(),{isInitialized:a,isLoggedIn:s}=Yn(),{dbInitialized:o,dbAvailable:u,upgradeRequired:c}=Lr(),d=a&&o,m=d&&(!s||!u&&!c),A=M.useCallback(async()=>{if(d&&!m&&!["/","/reinitialize","/login","/unlock","/unlock-success","/auth-settings","/upgrade","/logout"].includes(r.pathname)){const B=r.pathname.split("/").filter(Boolean),T=[];let Q="";for(const k of B)Q+="/"+k,T.push({pathname:Q,search:r.search,hash:r.hash});await Promise.all([Xe.setItem(xC,r.pathname),Xe.setItem(CC,Date.now()),Xe.setItem(wC,T)])}},[r,d,m]);M.useEffect(()=>{d&&A()},[r.pathname,r.search,r.hash,d,A]);const b=M.useMemo(()=>({storeCurrentPage:A,isFullyInitialized:d,requiresAuth:m}),[A,d,m]);return p.jsx(cy.Provider,{value:b,children:n})},BC=()=>{const n=M.useContext(cy);if(n===void 0)throw new Error("useNavigation must be used within a NavigationProvider");return n};var Rf,wm;function SC(){if(wm)return Rf;wm=1;function n(N){this._maxSize=N,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(N){return this._values[N]},n.prototype.set=function(N,O){return this._size>=this._maxSize&&this.clear(),N in this._values||this._size++,this._values[N]=O};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,a=/^\d+$/,s=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,u=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,d=new n(c),m=new n(c),A=new n(c);Rf={Cache:n,split:v,normalizePath:b,setter:function(N){var O=b(N);return m.get(N)||m.set(N,function(q,V){for(var ae=0,ge=O.length,te=q;ae<ge-1;){var J=O[ae];if(J==="__proto__"||J==="constructor"||J==="prototype")return q;te=te[O[ae++]]}te[O[ae]]=V})},getter:function(N,O){var _=b(N);return A.get(N)||A.set(N,function(V){for(var ae=0,ge=_.length;ae<ge;)if(V!=null||!O)V=V[_[ae++]];else return;return V})},join:function(N){return N.reduce(function(O,_){return O+(T(_)||a.test(_)?"["+_+"]":(O?".":"")+_)},"")},forEach:function(N,O,_){B(Array.isArray(N)?N:v(N),O,_)}};function b(N){return d.get(N)||d.set(N,v(N).map(function(O){return O.replace(u,"$2")}))}function v(N){return N.match(r)||[""]}function B(N,O,_){var q=N.length,V,ae,ge,te;for(ae=0;ae<q;ae++)V=N[ae],V&&(R(V)&&(V='"'+V+'"'),te=T(V),ge=!te&&/^\d+$/.test(V),O.call(_,V,te,ge,ae,N))}function T(N){return typeof N=="string"&&N&&["'",'"'].indexOf(N.charAt(0))!==-1}function Q(N){return N.match(s)&&!N.match(a)}function k(N){return o.test(N)}function R(N){return!T(N)&&(Q(N)||k(N))}return Rf}var $i=SC(),kf,Im;function NC(){if(Im)return kf;Im=1;const n=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=b=>b.match(n)||[],a=b=>b[0].toUpperCase()+b.slice(1),s=(b,v)=>r(b).join(v).toLowerCase(),o=b=>r(b).reduce((v,B)=>`${v}${v?B[0].toUpperCase()+B.slice(1).toLowerCase():B.toLowerCase()}`,"");return kf={words:r,upperFirst:a,camelCase:o,pascalCase:b=>a(o(b)),snakeCase:b=>s(b,"_"),kebabCase:b=>s(b,"-"),sentenceCase:b=>a(s(b," ")),titleCase:b=>r(b).map(a).join(" ")},kf}var Lf=NC(),Eu={exports:{}},Bm;function TC(){if(Bm)return Eu.exports;Bm=1,Eu.exports=function(o){return n(r(o),o)},Eu.exports.array=n;function n(o,u){var c=o.length,d=new Array(c),m={},A=c,b=a(u),v=s(o);for(u.forEach(function(T){if(!v.has(T[0])||!v.has(T[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});A--;)m[A]||B(o[A],A,new Set);return d;function B(T,Q,k){if(k.has(T)){var R;try{R=", node was:"+JSON.stringify(T)}catch{R=""}throw new Error("Cyclic dependency"+R)}if(!v.has(T))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(T));if(!m[Q]){m[Q]=!0;var N=b.get(T)||new Set;if(N=Array.from(N),Q=N.length){k.add(T);do{var O=N[--Q];B(O,v.get(O),k)}while(Q);k.delete(T)}d[--c]=T}}}function r(o){for(var u=new Set,c=0,d=o.length;c<d;c++){var m=o[c];u.add(m[0]),u.add(m[1])}return Array.from(u)}function a(o){for(var u=new Map,c=0,d=o.length;c<d;c++){var m=o[c];u.has(m[0])||u.set(m[0],new Set),u.has(m[1])||u.set(m[1],new Set),u.get(m[0]).add(m[1])}return u}function s(o){for(var u=new Map,c=0,d=o.length;c<d;c++)u.set(o[c],c);return u}return Eu.exports}var QC=TC();const DC=xi(QC),RC=Object.prototype.toString,kC=Error.prototype.toString,LC=RegExp.prototype.toString,UC=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",MC=/^Symbol\((.*)\)(.*)$/;function _C(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Sm(n,r=!1){if(n==null||n===!0||n===!1)return""+n;const a=typeof n;if(a==="number")return _C(n);if(a==="string")return r?`"${n}"`:n;if(a==="function")return"[Function "+(n.name||"anonymous")+"]";if(a==="symbol")return UC.call(n).replace(MC,"Symbol($1)");const s=RC.call(n).slice(8,-1);return s==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):s==="Error"||n instanceof Error?"["+kC.call(n)+"]":s==="RegExp"?LC.call(n):null}function vi(n,r){let a=Sm(n,r);return a!==null?a:JSON.stringify(n,function(s,o){let u=Sm(this[s],r);return u!==null?u:o},2)}function dy(n){return n==null?[]:[].concat(n)}let fy,Ay,hy,OC=/\$\{\s*(\w+)\s*\}/g;fy=Symbol.toStringTag;class Nm{constructor(r,a,s,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[fy]="Error",this.name="ValidationError",this.value=a,this.path=s,this.type=o,this.errors=[],this.inner=[],dy(r).forEach(u=>{if(Hr.isError(u)){this.errors.push(...u.errors);const c=u.inner.length?u.inner:[u];this.inner.push(...c)}else this.errors.push(u)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ay=Symbol.hasInstance;hy=Symbol.toStringTag;class Hr extends Error{static formatError(r,a){const s=a.label||a.path||"this";return a=Object.assign({},a,{path:s,originalPath:a.path}),typeof r=="string"?r.replace(OC,(o,u)=>vi(a[u])):typeof r=="function"?r(a):r}static isError(r){return r&&r.name==="ValidationError"}constructor(r,a,s,o,u){const c=new Nm(r,a,s,o);if(u)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[hy]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Hr)}static[Ay](r){return Nm[Symbol.hasInstance](r)||super[Symbol.hasInstance](r)}}let ia={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:r,value:a,originalValue:s})=>{const o=s!=null&&s!==a?` (cast from the value \`${vi(s,!0)}\`).`:".";return r!=="mixed"?`${n} must be a \`${r}\` type, but the final value was: \`${vi(a,!0)}\``+o:`${n} must match the configured type. The validated value was: \`${vi(a,!0)}\``+o}},rn={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},FC={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},iA={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},jC={isValue:"${path} field must be ${value}"},Qu={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},HC={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},GC={notType:n=>{const{path:r,value:a,spec:s}=n,o=s.types.length;if(Array.isArray(a)){if(a.length<o)return`${r} tuple value has too few items, expected a length of ${o} but got ${a.length} for value: \`${vi(a,!0)}\``;if(a.length>o)return`${r} tuple value has too many items, expected a length of ${o} but got ${a.length} for value: \`${vi(a,!0)}\``}return Hr.formatError(ia.notType,n)}};Object.assign(Object.create(null),{mixed:ia,string:rn,number:FC,date:iA,object:Qu,array:HC,boolean:jC,tuple:GC});const CA=n=>n&&n.__isYupSchema__;class ju{static fromOptions(r,a){if(!a.then&&!a.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:o,otherwise:u}=a,c=typeof s=="function"?s:(...d)=>d.every(m=>m===s);return new ju(r,(d,m)=>{var A;let b=c(...d)?o:u;return(A=b==null?void 0:b(m))!=null?A:m})}constructor(r,a){this.fn=void 0,this.refs=r,this.refs=r,this.fn=a}resolve(r,a){let s=this.refs.map(u=>u.getValue(a==null?void 0:a.value,a==null?void 0:a.parent,a==null?void 0:a.context)),o=this.fn(s,r,a);if(o===void 0||o===r)return r;if(!CA(o))throw new TypeError("conditions must return a schema object");return o.resolve(a)}}const bu={context:"$",value:"."};class Zi{constructor(r,a={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof r!="string")throw new TypeError("ref must be a string, got: "+r);if(this.key=r.trim(),r==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===bu.context,this.isValue=this.key[0]===bu.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?bu.context:this.isValue?bu.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&$i.getter(this.path,!0),this.map=a.map}getValue(r,a,s){let o=this.isContext?s:this.isValue?r:a;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(r,a){return this.getValue(r,a==null?void 0:a.parent,a==null?void 0:a.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(r){return r&&r.__isYupRef}}Zi.prototype.__isYupRef=!0;const Pi=n=>n==null;function Ms(n){function r({value:a,path:s="",options:o,originalValue:u,schema:c},d,m){const{name:A,test:b,params:v,message:B,skipAbsent:T}=n;let{parent:Q,context:k,abortEarly:R=c.spec.abortEarly,disableStackTrace:N=c.spec.disableStackTrace}=o;function O($){return Zi.isRef($)?$.getValue(a,Q,k):$}function _($={}){const me=Object.assign({value:a,originalValue:u,label:c.spec.label,path:$.path||s,spec:c.spec,disableStackTrace:$.disableStackTrace||N},v,$.params);for(const Be of Object.keys(me))me[Be]=O(me[Be]);const he=new Hr(Hr.formatError($.message||B,me),a,me.path,$.type||A,me.disableStackTrace);return he.params=me,he}const q=R?d:m;let V={path:s,parent:Q,type:A,from:o.from,createError:_,resolve:O,options:o,originalValue:u,schema:c};const ae=$=>{Hr.isError($)?q($):$?m(null):q(_())},ge=$=>{Hr.isError($)?q($):d($)};if(T&&Pi(a))return ae(!0);let J;try{var P;if(J=b.call(V,a,V),typeof((P=J)==null?void 0:P.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${V.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(J).then(ae,ge)}}catch($){ge($);return}ae(J)}return r.OPTIONS=n,r}function VC(n,r,a,s=a){let o,u,c;return r?($i.forEach(r,(d,m,A)=>{let b=m?d.slice(1,d.length-1):d;n=n.resolve({context:s,parent:o,value:a});let v=n.type==="tuple",B=A?parseInt(b,10):0;if(n.innerType||v){if(v&&!A)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(a&&B>=a.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${d}, in the path: ${r}. because there is no value at that index. `);o=a,a=a&&a[B],n=v?n.spec.types[B]:n.innerType}if(!A){if(!n.fields||!n.fields[b])throw new Error(`The schema does not contain the path: ${r}. (failed at: ${c} which is a type: "${n.type}")`);o=a,a=a&&a[b],n=n.fields[b]}u=b,c=m?"["+d+"]":"."+d}),{schema:n,parent:o,parentPath:u}):{parent:o,parentPath:r,schema:n}}class Hu extends Set{describe(){const r=[];for(const a of this.values())r.push(Zi.isRef(a)?a.describe():a);return r}resolveAll(r){let a=[];for(const s of this.values())a.push(r(s));return a}clone(){return new Hu(this.values())}merge(r,a){const s=this.clone();return r.forEach(o=>s.add(o)),a.forEach(o=>s.delete(o)),s}}function Gs(n,r=new Map){if(CA(n)||!n||typeof n!="object")return n;if(r.has(n))return r.get(n);let a;if(n instanceof Date)a=new Date(n.getTime()),r.set(n,a);else if(n instanceof RegExp)a=new RegExp(n),r.set(n,a);else if(Array.isArray(n)){a=new Array(n.length),r.set(n,a);for(let s=0;s<n.length;s++)a[s]=Gs(n[s],r)}else if(n instanceof Map){a=new Map,r.set(n,a);for(const[s,o]of n.entries())a.set(s,Gs(o,r))}else if(n instanceof Set){a=new Set,r.set(n,a);for(const s of n)a.add(Gs(s,r))}else if(n instanceof Object){a={},r.set(n,a);for(const[s,o]of Object.entries(n))a[s]=Gs(o,r)}else throw Error(`Unable to clone ${n}`);return a}class ua{constructor(r){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Hu,this._blacklist=new Hu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ia.notType)}),this.type=r.type,this._typeCheck=r.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},r==null?void 0:r.spec),this.withMutation(a=>{a.nonNullable()})}get _type(){return this.type}clone(r){if(this._mutate)return r&&Object.assign(this.spec,r),this;const a=Object.create(Object.getPrototypeOf(this));return a.type=this.type,a._typeCheck=this._typeCheck,a._whitelist=this._whitelist.clone(),a._blacklist=this._blacklist.clone(),a.internalTests=Object.assign({},this.internalTests),a.exclusiveTests=Object.assign({},this.exclusiveTests),a.deps=[...this.deps],a.conditions=[...this.conditions],a.tests=[...this.tests],a.transforms=[...this.transforms],a.spec=Gs(Object.assign({},this.spec,r)),a}label(r){let a=this.clone();return a.spec.label=r,a}meta(...r){if(r.length===0)return this.spec.meta;let a=this.clone();return a.spec.meta=Object.assign(a.spec.meta||{},r[0]),a}withMutation(r){let a=this._mutate;this._mutate=!0;let s=r(this);return this._mutate=a,s}concat(r){if(!r||r===this)return this;if(r.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${r.type}`);let a=this,s=r.clone();const o=Object.assign({},a.spec,s.spec);return s.spec=o,s.internalTests=Object.assign({},a.internalTests,s.internalTests),s._whitelist=a._whitelist.merge(r._whitelist,r._blacklist),s._blacklist=a._blacklist.merge(r._blacklist,r._whitelist),s.tests=a.tests,s.exclusiveTests=a.exclusiveTests,s.withMutation(u=>{r.tests.forEach(c=>{u.test(c.OPTIONS)})}),s.transforms=[...a.transforms,...s.transforms],s}isType(r){return r==null?!!(this.spec.nullable&&r===null||this.spec.optional&&r===void 0):this._typeCheck(r)}resolve(r){let a=this;if(a.conditions.length){let s=a.conditions;a=a.clone(),a.conditions=[],a=s.reduce((o,u)=>u.resolve(o,r),a),a=a.resolve(r)}return a}resolveOptions(r){var a,s,o,u;return Object.assign({},r,{from:r.from||[],strict:(a=r.strict)!=null?a:this.spec.strict,abortEarly:(s=r.abortEarly)!=null?s:this.spec.abortEarly,recursive:(o=r.recursive)!=null?o:this.spec.recursive,disableStackTrace:(u=r.disableStackTrace)!=null?u:this.spec.disableStackTrace})}cast(r,a={}){let s=this.resolve(Object.assign({value:r},a)),o=a.assert==="ignore-optionality",u=s._cast(r,a);if(a.assert!==!1&&!s.isType(u)){if(o&&Pi(u))return u;let c=vi(r),d=vi(u);throw new TypeError(`The value of ${a.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}". 

attempted value: ${c} 
`+(d!==c?`result of cast: ${d}`:""))}return u}_cast(r,a){let s=r===void 0?r:this.transforms.reduce((o,u)=>u.call(this,o,r,this),r);return s===void 0&&(s=this.getDefault(a)),s}_validate(r,a={},s,o){let{path:u,originalValue:c=r,strict:d=this.spec.strict}=a,m=r;d||(m=this._cast(m,Object.assign({assert:!1},a)));let A=[];for(let b of Object.values(this.internalTests))b&&A.push(b);this.runTests({path:u,value:m,originalValue:c,options:a,tests:A},s,b=>{if(b.length)return o(b,m);this.runTests({path:u,value:m,originalValue:c,options:a,tests:this.tests},s,o)})}runTests(r,a,s){let o=!1,{tests:u,value:c,originalValue:d,path:m,options:A}=r,b=k=>{o||(o=!0,a(k,c))},v=k=>{o||(o=!0,s(k,c))},B=u.length,T=[];if(!B)return v([]);let Q={value:c,originalValue:d,path:m,options:A,schema:this};for(let k=0;k<u.length;k++){const R=u[k];R(Q,b,function(O){O&&(Array.isArray(O)?T.push(...O):T.push(O)),--B<=0&&v(T)})}}asNestedTest({key:r,index:a,parent:s,parentPath:o,originalParent:u,options:c}){const d=r??a;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const m=typeof d=="number";let A=s[d];const b=Object.assign({},c,{strict:!0,parent:s,value:A,originalValue:u[d],key:void 0,[m?"index":"key"]:d,path:m||d.includes(".")?`${o||""}[${m?d:`"${d}"`}]`:(o?`${o}.`:"")+r});return(v,B,T)=>this.resolve(b)._validate(A,b,B,T)}validate(r,a){var s;let o=this.resolve(Object.assign({},a,{value:r})),u=(s=a==null?void 0:a.disableStackTrace)!=null?s:o.spec.disableStackTrace;return new Promise((c,d)=>o._validate(r,a,(m,A)=>{Hr.isError(m)&&(m.value=A),d(m)},(m,A)=>{m.length?d(new Hr(m,A,void 0,void 0,u)):c(A)}))}validateSync(r,a){var s;let o=this.resolve(Object.assign({},a,{value:r})),u,c=(s=a==null?void 0:a.disableStackTrace)!=null?s:o.spec.disableStackTrace;return o._validate(r,Object.assign({},a,{sync:!0}),(d,m)=>{throw Hr.isError(d)&&(d.value=m),d},(d,m)=>{if(d.length)throw new Hr(d,r,void 0,void 0,c);u=m}),u}isValid(r,a){return this.validate(r,a).then(()=>!0,s=>{if(Hr.isError(s))return!1;throw s})}isValidSync(r,a){try{return this.validateSync(r,a),!0}catch(s){if(Hr.isError(s))return!1;throw s}}_getDefault(r){let a=this.spec.default;return a==null?a:typeof a=="function"?a.call(this,r):Gs(a)}getDefault(r){return this.resolve(r||{})._getDefault(r)}default(r){return arguments.length===0?this._getDefault():this.clone({default:r})}strict(r=!0){return this.clone({strict:r})}nullability(r,a){const s=this.clone({nullable:r});return s.internalTests.nullable=Ms({message:a,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),s}optionality(r,a){const s=this.clone({optional:r});return s.internalTests.optionality=Ms({message:a,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(r=ia.defined){return this.optionality(!1,r)}nullable(){return this.nullability(!0)}nonNullable(r=ia.notNull){return this.nullability(!1,r)}required(r=ia.required){return this.clone().withMutation(a=>a.nonNullable(r).defined(r))}notRequired(){return this.clone().withMutation(r=>r.nullable().optional())}transform(r){let a=this.clone();return a.transforms.push(r),a}test(...r){let a;if(r.length===1?typeof r[0]=="function"?a={test:r[0]}:a=r[0]:r.length===2?a={name:r[0],test:r[1]}:a={name:r[0],message:r[1],test:r[2]},a.message===void 0&&(a.message=ia.default),typeof a.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),o=Ms(a),u=a.exclusive||a.name&&s.exclusiveTests[a.name]===!0;if(a.exclusive&&!a.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return a.name&&(s.exclusiveTests[a.name]=!!a.exclusive),s.tests=s.tests.filter(c=>!(c.OPTIONS.name===a.name&&(u||c.OPTIONS.test===o.OPTIONS.test))),s.tests.push(o),s}when(r,a){!Array.isArray(r)&&typeof r!="string"&&(a=r,r=".");let s=this.clone(),o=dy(r).map(u=>new Zi(u));return o.forEach(u=>{u.isSibling&&s.deps.push(u.key)}),s.conditions.push(typeof a=="function"?new ju(o,a):ju.fromOptions(o,a)),s}typeError(r){let a=this.clone();return a.internalTests.typeError=Ms({message:r,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),a}oneOf(r,a=ia.oneOf){let s=this.clone();return r.forEach(o=>{s._whitelist.add(o),s._blacklist.delete(o)}),s.internalTests.whiteList=Ms({message:a,name:"oneOf",skipAbsent:!0,test(o){let u=this.schema._whitelist,c=u.resolveAll(this.resolve);return c.includes(o)?!0:this.createError({params:{values:Array.from(u).join(", "),resolved:c}})}}),s}notOneOf(r,a=ia.notOneOf){let s=this.clone();return r.forEach(o=>{s._blacklist.add(o),s._whitelist.delete(o)}),s.internalTests.blacklist=Ms({message:a,name:"notOneOf",test(o){let u=this.schema._blacklist,c=u.resolveAll(this.resolve);return c.includes(o)?this.createError({params:{values:Array.from(u).join(", "),resolved:c}}):!0}}),s}strip(r=!0){let a=this.clone();return a.spec.strip=r,a}describe(r){const a=(r?this.resolve(r):this).clone(),{label:s,meta:o,optional:u,nullable:c}=a.spec;return{meta:o,label:s,optional:u,nullable:c,default:a.getDefault(r),type:a.type,oneOf:a._whitelist.describe(),notOneOf:a._blacklist.describe(),tests:a.tests.map(m=>({name:m.OPTIONS.name,params:m.OPTIONS.params})).filter((m,A,b)=>b.findIndex(v=>v.name===m.name)===A)}}}ua.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])ua.prototype[`${n}At`]=function(r,a,s={}){const{parent:o,parentPath:u,schema:c}=VC(this,r,a,s.context);return c[n](o&&o[u],Object.assign({},s,{parent:o,path:r}))};for(const n of["equals","is"])ua.prototype[n]=ua.prototype.oneOf;for(const n of["not","nope"])ua.prototype[n]=ua.prototype.notOneOf;const qC=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function zC(n){const r=sA(n);if(!r)return Date.parse?Date.parse(n):Number.NaN;if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let a=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(a=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(a=0-a)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+a,r.second,r.millisecond)}function sA(n){var r,a;const s=qC.exec(n);return s?{year:Qa(s[1]),month:Qa(s[2],1)-1,day:Qa(s[3],1),hour:Qa(s[4]),minute:Qa(s[5]),second:Qa(s[6]),millisecond:s[7]?Qa(s[7].substring(0,3)):0,precision:(r=(a=s[7])==null?void 0:a.length)!=null?r:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:Qa(s[10]),minuteOffset:Qa(s[11])}:null}function Qa(n,r=0){return Number(n)||r}let YC=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,PC=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,KC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,JC="^\\d{4}-\\d{2}-\\d{2}",XC="\\d{2}:\\d{2}:\\d{2}",$C="(([+-]\\d{2}(:?\\d{2})?)|Z)",WC=new RegExp(`${JC}T${XC}(\\.\\d+)?${$C}$`),ZC=n=>Pi(n)||n===n.trim(),ew={}.toString();function Yr(){return new gy}class gy extends ua{constructor(){super({type:"string",check(r){return r instanceof String&&(r=r.valueOf()),typeof r=="string"}}),this.withMutation(()=>{this.transform((r,a,s)=>{if(!s.spec.coerce||s.isType(r)||Array.isArray(r))return r;const o=r!=null&&r.toString?r.toString():r;return o===ew?r:o})})}required(r){return super.required(r).withMutation(a=>a.test({message:r||ia.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(r=>(r.tests=r.tests.filter(a=>a.OPTIONS.name!=="required"),r))}length(r,a=rn.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:r},skipAbsent:!0,test(s){return s.length===this.resolve(r)}})}min(r,a=rn.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(s){return s.length>=this.resolve(r)}})}max(r,a=rn.max){return this.test({name:"max",exclusive:!0,message:a,params:{max:r},skipAbsent:!0,test(s){return s.length<=this.resolve(r)}})}matches(r,a){let s=!1,o,u;return a&&(typeof a=="object"?{excludeEmptyString:s=!1,message:o,name:u}=a:o=a),this.test({name:u||"matches",message:o||rn.matches,params:{regex:r},skipAbsent:!0,test:c=>c===""&&s||c.search(r)!==-1})}email(r=rn.email){return this.matches(YC,{name:"email",message:r,excludeEmptyString:!0})}url(r=rn.url){return this.matches(PC,{name:"url",message:r,excludeEmptyString:!0})}uuid(r=rn.uuid){return this.matches(KC,{name:"uuid",message:r,excludeEmptyString:!1})}datetime(r){let a="",s,o;return r&&(typeof r=="object"?{message:a="",allowOffset:s=!1,precision:o=void 0}=r:a=r),this.matches(WC,{name:"datetime",message:a||rn.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:a||rn.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:u=>{if(!u||s)return!0;const c=sA(u);return c?!!c.z:!1}}).test({name:"datetime_precision",message:a||rn.datetime_precision,params:{precision:o},skipAbsent:!0,test:u=>{if(!u||o==null)return!0;const c=sA(u);return c?c.precision===o:!1}})}ensure(){return this.default("").transform(r=>r===null?"":r)}trim(r=rn.trim){return this.transform(a=>a!=null?a.trim():a).test({message:r,name:"trim",test:ZC})}lowercase(r=rn.lowercase){return this.transform(a=>Pi(a)?a:a.toLowerCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>Pi(a)||a===a.toLowerCase()})}uppercase(r=rn.uppercase){return this.transform(a=>Pi(a)?a:a.toUpperCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>Pi(a)||a===a.toUpperCase()})}}Yr.prototype=gy.prototype;let tw=new Date(""),rw=n=>Object.prototype.toString.call(n)==="[object Date]";class wA extends ua{constructor(){super({type:"date",check(r){return rw(r)&&!isNaN(r.getTime())}}),this.withMutation(()=>{this.transform((r,a,s)=>!s.spec.coerce||s.isType(r)||r===null?r:(r=zC(r),isNaN(r)?wA.INVALID_DATE:new Date(r)))})}prepareParam(r,a){let s;if(Zi.isRef(r))s=r;else{let o=this.cast(r);if(!this._typeCheck(o))throw new TypeError(`\`${a}\` must be a Date or a value that can be \`cast()\` to a Date`);s=o}return s}min(r,a=iA.min){let s=this.prepareParam(r,"min");return this.test({message:a,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(o){return o>=this.resolve(s)}})}max(r,a=iA.max){let s=this.prepareParam(r,"max");return this.test({message:a,name:"max",exclusive:!0,params:{max:r},skipAbsent:!0,test(o){return o<=this.resolve(s)}})}}wA.INVALID_DATE=tw;function nw(n,r=[]){let a=[],s=new Set,o=new Set(r.map(([c,d])=>`${c}-${d}`));function u(c,d){let m=$i.split(c)[0];s.add(m),o.has(`${d}-${m}`)||a.push([d,m])}for(const c of Object.keys(n)){let d=n[c];s.add(c),Zi.isRef(d)&&d.isSibling?u(d.path,c):CA(d)&&"deps"in d&&d.deps.forEach(m=>u(m,c))}return DC.array(Array.from(s),a).reverse()}function Tm(n,r){let a=1/0;return n.some((s,o)=>{var u;if((u=r.path)!=null&&u.includes(s))return a=o,!0}),a}function my(n){return(r,a)=>Tm(n,r)-Tm(n,a)}const aw=(n,r,a)=>{if(typeof n!="string")return n;let s=n;try{s=JSON.parse(n)}catch{}return a.isType(s)?s:n};function Du(n){if("fields"in n){const r={};for(const[a,s]of Object.entries(n.fields))r[a]=Du(s);return n.setFields(r)}if(n.type==="array"){const r=n.optional();return r.innerType&&(r.innerType=Du(r.innerType)),r}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Du)}):"optional"in n?n.optional():n}const iw=(n,r)=>{const a=[...$i.normalizePath(r)];if(a.length===1)return a[0]in n;let s=a.pop(),o=$i.getter($i.join(a),!0)(n);return!!(o&&s in o)};let Qm=n=>Object.prototype.toString.call(n)==="[object Object]";function Dm(n,r){let a=Object.keys(n.fields);return Object.keys(r).filter(s=>a.indexOf(s)===-1)}const sw=my([]);function Gu(n){return new py(n)}class py extends ua{constructor(r){super({type:"object",check(a){return Qm(a)||typeof a=="function"}}),this.fields=Object.create(null),this._sortErrors=sw,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{r&&this.shape(r)})}_cast(r,a={}){var s;let o=super._cast(r,a);if(o===void 0)return this.getDefault(a);if(!this._typeCheck(o))return o;let u=this.fields,c=(s=a.stripUnknown)!=null?s:this.spec.noUnknown,d=[].concat(this._nodes,Object.keys(o).filter(v=>!this._nodes.includes(v))),m={},A=Object.assign({},a,{parent:m,__validating:a.__validating||!1}),b=!1;for(const v of d){let B=u[v],T=v in o;if(B){let Q,k=o[v];A.path=(a.path?`${a.path}.`:"")+v,B=B.resolve({value:k,context:a.context,parent:m});let R=B instanceof ua?B.spec:void 0,N=R==null?void 0:R.strict;if(R!=null&&R.strip){b=b||v in o;continue}Q=!a.__validating||!N?B.cast(o[v],A):o[v],Q!==void 0&&(m[v]=Q)}else T&&!c&&(m[v]=o[v]);(T!==v in m||m[v]!==o[v])&&(b=!0)}return b?m:o}_validate(r,a={},s,o){let{from:u=[],originalValue:c=r,recursive:d=this.spec.recursive}=a;a.from=[{schema:this,value:c},...u],a.__validating=!0,a.originalValue=c,super._validate(r,a,s,(m,A)=>{if(!d||!Qm(A)){o(m,A);return}c=c||A;let b=[];for(let v of this._nodes){let B=this.fields[v];!B||Zi.isRef(B)||b.push(B.asNestedTest({options:a,key:v,parent:A,parentPath:a.path,originalParent:c}))}this.runTests({tests:b,value:A,originalValue:c,options:a},s,v=>{o(v.sort(this._sortErrors).concat(m),A)})})}clone(r){const a=super.clone(r);return a.fields=Object.assign({},this.fields),a._nodes=this._nodes,a._excludedEdges=this._excludedEdges,a._sortErrors=this._sortErrors,a}concat(r){let a=super.concat(r),s=a.fields;for(let[o,u]of Object.entries(this.fields)){const c=s[o];s[o]=c===void 0?u:c}return a.withMutation(o=>o.setFields(s,[...this._excludedEdges,...r._excludedEdges]))}_getDefault(r){if("default"in this.spec)return super._getDefault(r);if(!this._nodes.length)return;let a={};return this._nodes.forEach(s=>{var o;const u=this.fields[s];let c=r;(o=c)!=null&&o.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[s]})),a[s]=u&&"getDefault"in u?u.getDefault(c):void 0}),a}setFields(r,a){let s=this.clone();return s.fields=r,s._nodes=nw(r,a),s._sortErrors=my(Object.keys(r)),a&&(s._excludedEdges=a),s}shape(r,a=[]){return this.clone().withMutation(s=>{let o=s._excludedEdges;return a.length&&(Array.isArray(a[0])||(a=[a]),o=[...s._excludedEdges,...a]),s.setFields(Object.assign(s.fields,r),o)})}partial(){const r={};for(const[a,s]of Object.entries(this.fields))r[a]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(r)}deepPartial(){return Du(this)}pick(r){const a={};for(const s of r)this.fields[s]&&(a[s]=this.fields[s]);return this.setFields(a,this._excludedEdges.filter(([s,o])=>r.includes(s)&&r.includes(o)))}omit(r){const a=[];for(const s of Object.keys(this.fields))r.includes(s)||a.push(s);return this.pick(a)}from(r,a,s){let o=$i.getter(r,!0);return this.transform(u=>{if(!u)return u;let c=u;return iw(u,r)&&(c=Object.assign({},u),s||delete c[r],c[a]=o(u)),c})}json(){return this.transform(aw)}exact(r){return this.test({name:"exact",exclusive:!0,message:r||Qu.exact,test(a){if(a==null)return!0;const s=Dm(this.schema,a);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(r=!0,a=Qu.noUnknown){typeof r!="boolean"&&(a=r,r=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:a,test(o){if(o==null)return!0;const u=Dm(this.schema,o);return!r||u.length===0||this.createError({params:{unknown:u.join(", ")}})}});return s.spec.noUnknown=r,s}unknown(r=!0,a=Qu.noUnknown){return this.noUnknown(!r,a)}transformKeys(r){return this.transform(a=>{if(!a)return a;const s={};for(const o of Object.keys(a))s[r(o)]=a[o];return s})}camelCase(){return this.transformKeys(Lf.camelCase)}snakeCase(){return this.transformKeys(Lf.snakeCase)}constantCase(){return this.transformKeys(r=>Lf.snakeCase(r).toUpperCase())}describe(r){const a=(r?this.resolve(r):this).clone(),s=super.describe(r);s.fields={};for(const[u,c]of Object.entries(a.fields)){var o;let d=r;(o=d)!=null&&o.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[u]})),s.fields[u]=c.describe(d)}return s}}Gu.prototype=py.prototype;const lw={loginTitle:"Log in to AliasVault",username:"Username or email",usernamePlaceholder:"name / name@company.com",password:"Password",passwordPlaceholder:"Enter your password",rememberMe:"Remember me",loginButton:"Login",noAccount:"No account yet?",createVault:"Create new vault",twoFactorTitle:"Please enter the authentication code from your authenticator app.",authCode:"Authentication Code",authCodePlaceholder:"Enter 6-digit code",verify:"Verify",cancel:"Cancel",twoFactorNote:"Note: if you don't have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.",masterPassword:"Master Password",unlockVault:"Unlock Vault",unlockTitle:"Unlock Your Vault",unlockDescription:"Enter your master password to unlock your vault.",logout:"Logout",logoutConfirm:"Are you sure you want to logout?",sessionExpired:"Your session has expired. Please log in again.",unlockSuccess:"Vault unlocked successfully!",unlockSuccessTitle:"Your vault is successfully unlocked",unlockSuccessDescription:"You can now use autofill in login forms in your browser.",closePopup:"Close this popup",browseVault:"Browse vault contents",connectingTo:"Connecting to",switchAccounts:"Switch accounts?",loggedIn:"Logged in",errors:{invalidCode:"Please enter a valid 6-digit authentication code.",serverError:"Could not reach AliasVault server. Please try again later or contact support if the problem persists.",noToken:"Login failed -- no token returned",migrationError:"An error occurred while checking for pending migrations.",wrongPassword:"Incorrect password. Please try again.",accountLocked:"Account temporarily locked due to too many failed attempts.",networkError:"Network error. Please check your connection and try again.",loginDataMissing:"Login session expired. Please try again."}},ow={credentials:"Credentials",emails:"Emails",settings:"Settings"},uw={appName:"AliasVault",loading:"Loading...",error:"Error",success:"Success",cancel:"Cancel",use:"Use",delete:"Delete",close:"Close",copied:"Copied!",openInNewWindow:"Open in new window",language:"Language",enabled:"Enabled",disabled:"Disabled",showPassword:"Show password",hidePassword:"Hide password",copyToClipboard:"Copy to clipboard",loadingEmails:"Loading emails...",loadingTotpCodes:"Loading TOTP codes...",attachments:"Attachments",loadingAttachments:"Loading attachments...",settings:"Settings",recentEmails:"Recent emails",loginCredentials:"Login credentials",twoFactorAuthentication:"Two-factor authentication",alias:"Alias",notes:"Notes",fullName:"Full Name",firstName:"First Name",lastName:"Last Name",birthDate:"Birth Date",nickname:"Nickname",email:"Email",username:"Username",password:"Password",syncingVault:"Syncing vault",savingChangesToVault:"Saving changes to vault",uploadingVaultToServer:"Uploading vault to server",checkingVaultUpdates:"Checking for vault updates",syncingUpdatedVault:"Syncing updated vault",executingOperation:"Executing operation...",loadMore:"Load more",errors:{VaultMergeRequired:"Your vault needs to be updated. Please login on the AliasVault website and follow the steps.",VaultOutdated:"Your vault is outdated. Please login on the AliasVault website and follow the steps.",NoVaultFound:"Your account does not have a vault yet. Please complete the tutorial in the AliasVault web client before using the browser extension.",serverNotAvailable:"The AliasVault server is not available. Please try again later or contact support if the problem persists.",clientVersionNotSupported:"This version of the AliasVault browser extension is not supported by the server anymore. Please update your browser extension to the latest version.",serverVersionNotSupported:"The AliasVault server needs to be updated to a newer version in order to use this browser extension. Please contact support if you need help.",unknownError:"An unknown error occurred",failedToStoreVault:"Failed to store vault",vaultNotAvailable:"Vault not available",failedToGetVault:"Failed to get vault",vaultIsLocked:"Vault is locked",failedToGetCredentials:"Failed to get credentials",failedToCreateIdentity:"Failed to create identity",failedToGetDefaultEmailDomain:"Failed to get default email domain",failedToGetDefaultIdentitySettings:"Failed to get default identity settings",failedToGetPasswordSettings:"Failed to get password settings",failedToUploadVault:"Failed to upload vault",noDerivedKeyAvailable:"No derived key available for encryption",failedToUploadVaultToServer:"Failed to upload new vault to server",noVaultOrDerivedKeyFound:"No vault or derived key found"},apiErrors:{UNKNOWN_ERROR:"An unknown error occurred. Please try again.",ACCOUNT_LOCKED:"Account temporarily locked due to too many failed attempts. Please try again later.",ACCOUNT_BLOCKED:"Your account has been disabled. If you believe this is a mistake, please contact support.",USER_NOT_FOUND:"Invalid username or password. Please try again.",INVALID_AUTHENTICATOR_CODE:"Invalid authenticator code. Please try again.",INVALID_RECOVERY_CODE:"Invalid recovery code. Please try again.",REFRESH_TOKEN_REQUIRED:"Refresh token is required.",USER_NOT_FOUND_IN_TOKEN:"User not found in token.",USER_NOT_FOUND_IN_DATABASE:"User not found in database.",INVALID_REFRESH_TOKEN:"Invalid refresh token.",REFRESH_TOKEN_REVOKED_SUCCESSFULLY:"Refresh token revoked successfully.",PUBLIC_REGISTRATION_DISABLED:"New account registration is currently disabled on this server. Please contact the administrator.",USERNAME_REQUIRED:"Username is required.",USERNAME_ALREADY_IN_USE:"Username is already in use.",USERNAME_AVAILABLE:"Username is available.",USERNAME_MISMATCH:"Username does not match the current user.",PASSWORD_MISMATCH:"The provided password does not match your current password.",ACCOUNT_SUCCESSFULLY_DELETED:"Account successfully deleted.",USERNAME_EMPTY_OR_WHITESPACE:"Username cannot be empty or whitespace.",USERNAME_TOO_SHORT:"Username too short: must be at least 3 characters long.",USERNAME_TOO_LONG:"Username too long: cannot be longer than 40 characters.",USERNAME_INVALID_EMAIL:"Invalid email address.",USERNAME_INVALID_CHARACTERS:"Username is invalid, can only contain letters or digits.",VAULT_NOT_UP_TO_DATE:"Your vault is not up-to-date. Please synchronize your vault and try again.",INTERNAL_SERVER_ERROR:"Internal server error.",VAULT_ERROR:"The local vault is not up-to-date. Please synchronize your vault by refreshing the page and try again."}},cw={or:"or",new:"New",cancel:"Cancel",search:"Search",vaultLocked:"AliasVault is locked.",creatingNewAlias:"Creating new alias...",noMatchesFound:"No matches found",searchVault:"Search vault...",serviceName:"Service name",email:"Email",username:"Username",password:"Password",enterServiceName:"Enter service name",enterEmailAddress:"Enter email address",enterUsername:"Enter username",hideFor1Hour:"Hide for 1 hour (current site)",hidePermanently:"Hide permanently (current site)",createRandomAlias:"Create random alias",createUsernamePassword:"Create username/password",randomAlias:"Random alias",usernamePassword:"Username/password",createAndSaveAlias:"Create and save alias",createAndSaveCredential:"Create and save credential",randomIdentityDescription:"Generate a random identity with a random email address accessible in AliasVault.",randomIdentityDescriptionDropdown:"Random identity with random email",manualCredentialDescription:"Specify your own email address and username.",manualCredentialDescriptionDropdown:"Manual username and password",failedToCreateIdentity:"Failed to create identity. Please try again.",enterEmailAndOrUsername:"Enter email and/or username",autofillWithAliasVault:"Autofill with AliasVault",generateRandomPassword:"Generate random password (copy to clipboard)",generateNewPassword:"Generate new password",togglePasswordVisibility:"Toggle password visibility",passwordCopiedToClipboard:"Password copied to clipboard",enterEmailAndOrUsernameError:"Enter email and/or username",openAliasVaultToUpgrade:"Open AliasVault to upgrade",vaultUpgradeRequired:"Vault upgrade required.",dismissPopup:"Dismiss popup"},dw={title:"Credentials",addCredential:"Add Credential",editCredential:"Edit Credential",deleteCredential:"Delete Credential",credentialDetails:"Credential Details",serviceName:"Service Name",serviceNamePlaceholder:"e.g., Gmail, Facebook, Bank",website:"Website",websitePlaceholder:"https://example.com",username:"Username",usernamePlaceholder:"Enter username",password:"Password",passwordPlaceholder:"Enter password",generatePassword:"Generate Password",copyPassword:"Copy Password",showPassword:"Show Password",hidePassword:"Hide Password",notes:"Notes",notesPlaceholder:"Additional notes...",totp:"Two-Factor Authentication",totpCode:"TOTP Code",copyTotp:"Copy TOTP",totpSecret:"TOTP Secret",totpSecretPlaceholder:"Enter TOTP secret key",noCredentials:"No credentials found",noCredentialsDescription:"Add your first credential to get started",searchCredentials:"Search credentials...",searchPlaceholder:"Search credentials...",welcomeTitle:"Welcome to AliasVault!",welcomeDescription:"To use the AliasVault browser extension: navigate to a website and use the AliasVault autofill popup to create a new credential.",lastUsed:"Last used",createdAt:"Created",updatedAt:"Last updated",autofill:"Autofill",fillForm:"Fill Form",copyUsername:"Copy Username",openWebsite:"Open Website",favorite:"Favorite",unfavorite:"Remove from Favorites",deleteConfirm:"Are you sure you want to delete this credential?",deleteSuccess:"Credential deleted successfully",saveSuccess:"Credential saved successfully",copySuccess:"Copied to clipboard",tags:"Tags",addTag:"Add Tag",removeTag:"Remove Tag",folder:"Folder",selectFolder:"Select Folder",createFolder:"Create Folder",saveCredential:"Save credential",deleteCredentialTitle:"Delete Credential",deleteCredentialConfirm:"Are you sure you want to delete this credential? This action cannot be undone.",randomAlias:"Random Alias",manual:"Manual",service:"Service",serviceUrl:"Service URL",loginCredentials:"Login Credentials",generateRandomUsername:"Generate random username",generateRandomPassword:"Generate random password",changePasswordComplexity:"Change password complexity",passwordLength:"Password length",includeLowercase:"Include lowercase letters",includeUppercase:"Include uppercase letters",includeNumbers:"Include numbers",includeSpecialChars:"Include special characters",avoidAmbiguousChars:"Avoid ambiguous characters (o, 0, etc.)",generateNewPreview:"Generate new preview",generateRandomAlias:"Generate Random Alias",alias:"Alias",firstName:"First Name",lastName:"Last Name",nickName:"Nick Name",gender:"Gender",birthDate:"Birth Date",birthDatePlaceholder:"YYYY-MM-DD",metadata:"Metadata",errors:{invalidUrl:"Please enter a valid URL",saveError:"Failed to save credential",loadError:"Failed to load credentials",deleteError:"Failed to delete credential",copyError:"Failed to copy to clipboard"},validation:{required:"This field is required",serviceNameRequired:"Service name is required",invalidUrl:"Invalid URL format",invalidEmail:"Invalid email format",invalidDateFormat:"Date must be in YYYY-MM-DD format"}},fw={title:"Emails",deleteEmailTitle:"Delete Email",deleteEmailConfirm:"Are you sure you want to permanently delete this email?",from:"From",to:"To",date:"Date",emailContent:"Email content",attachments:"Attachments",emailNotFound:"Email not found",noEmails:"No emails found",noEmailsDescription:"You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",dateFormat:{justNow:"just now",minutesAgo_single:"{{count}} min ago",minutesAgo_plural:"{{count}} mins ago",hoursAgo_single:"{{count}} hr ago",hoursAgo_plural:"{{count}} hrs ago",yesterday:"yesterday"},errors:{emailLoadError:"An error occurred while loading emails. Please try again later.",emailUnexpectedError:"An unexpected error occurred while loading emails. Please try again later."},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"The current chosen email address is already in use. Please change the email address by editing this credential.",CLAIM_DOES_NOT_EXIST:"An error occurred while trying to load the emails. Please try to edit and save the credential entry to synchronize the database, then try again."}},Aw={title:"Settings",serverUrl:"Server URL",language:"Language",autofillEnabled:"Enable Autofill",version:"Version",openInNewWindow:"Open in new window",openWebApp:"Open web app",loggedIn:"Logged in",logout:"Logout",globalSettings:"Global Settings",autofillPopup:"Autofill popup",activeOnAllSites:"Active on all sites (unless disabled below)",disabledOnAllSites:"Disabled on all sites",enabled:"Enabled",disabled:"Disabled",rightClickContextMenu:"Right-click context menu",siteSpecificSettings:"Site-Specific Settings",autofillPopupOn:"Autofill popup on: ",enabledForThisSite:"Enabled for this site",disabledForThisSite:"Disabled for this site",temporarilyDisabledUntil:"Temporarily disabled until ",resetAllSiteSettings:"Reset all site-specific settings",appearance:"Appearance",theme:"Theme",useDefault:"Use default",light:"Light",dark:"Dark",keyboardShortcuts:"Keyboard Shortcuts",configureKeyboardShortcuts:"Configure keyboard shortcuts",configure:"Configure",versionPrefix:"Version ",validation:{apiUrlRequired:"API URL is required",apiUrlInvalid:"Please enter a valid API URL",clientUrlRequired:"Client URL is required",clientUrlInvalid:"Please enter a valid client URL"}},hw={title:"Upgrade Vault",subtitle:"AliasVault has updated and your vault needs to be upgraded. This should only take a few seconds.",versionInformation:"Version Information",yourVault:"Your vault:",newVersion:"New version:",upgrade:"Upgrade Vault",upgrading:"Upgrading...",logout:"Logout",whatsNew:"What's New",whatsNewDescription:"An upgrade is required to support the following changes:",noDescriptionAvailable:"No description available for this version.",okay:"Ok",status:{preparingUpgrade:"Preparing upgrade...",vaultAlreadyUpToDate:"Vault is already up to date",startingDatabaseTransaction:"Starting database transaction...",applyingDatabaseMigrations:"Applying database migrations...",applyingMigration:"Applying migration {{current}} of {{total}}...",committingChanges:"Committing changes..."},alerts:{error:"Error",unableToGetVersionInfo:"Unable to get version information. Please try again.",selfHostedServer:"Self-Hosted Server",selfHostedWarning:"If you're using a self-hosted server, make sure to also update your self-hosted instance as otherwise logging in to the web client will stop working.",cancel:"Cancel",continueUpgrade:"Continue Upgrade",upgradeFailed:"Upgrade Failed",failedToApplyMigration:"Failed to apply migration ({{current}} of {{total}})",unknownErrorDuringUpgrade:"An unknown error occurred during the upgrade. Please try again."}},gw={auth:lw,menu:ow,common:uw,content:cw,credentials:dw,emails:fw,settings:Aw,upgrade:hw},mw={loginTitle:"Inloggen bij AliasVault",username:"Gebruikersnaam of e-mail",usernamePlaceholder:"naam / naam@bedrijf.com",password:"Wachtwoord",passwordPlaceholder:"Voer je wachtwoord in",rememberMe:"Onthoud mij",loginButton:"Inloggen",noAccount:"Nog geen account?",createVault:"Nieuwe vault aanmaken",twoFactorTitle:"Voer de authenticatiecode van je authenticator-app in.",authCode:"Authenticatiecode",authCodePlaceholder:"Voer 6-cijferige code in",verify:"Verifiëren",cancel:"Annuleren",twoFactorNote:"Opmerking: als je geen toegang hebt tot je authenticator, kunt je je 2FA resetten door met een in te loggen via de website.",masterPassword:"Hoofdwachtwoord",unlockVault:"Vault ontgrendelen",unlockTitle:"Ontgrendel je vault",unlockDescription:"Voer je hoofdwachtwoord in om je vault te ontgrendelen.",logout:"Uitloggen",logoutConfirm:"Weet je zeker dat je wilt uitloggen?",sessionExpired:"Je sessie is verlopen. Log opnieuw in.",unlockSuccess:"Vault succesvol ontgrendeld!",unlockSuccessTitle:"Je vault is succesvol ontgrendeld",unlockSuccessDescription:"Je kunt nu automatisch invullen gebruiken in inlogformulieren in je browser.",closePopup:"Sluit deze popup",browseVault:"Bekijk vault inhoud",connectingTo:"Verbinden met",switchAccounts:"Wisselen van account?",loggedIn:"Ingelogd",errors:{invalidCode:"Voer een geldige 6-cijferige code in.",serverError:"Kon de AliasVault server niet bereiken. Probeer het later opnieuw of neem contact op met support als het probleem aanhoudt.",noToken:"Inloggen mislukt -- geen token ontvangen",migrationError:"Er is een fout opgetreden bij het controleren op updates.",wrongPassword:"Onjuist wachtwoord. Probeer het opnieuw.",accountLocked:"Account tijdelijk vergrendeld vanwege te veel mislukte pogingen.",networkError:"Netwerkfout. Controleer de verbinding en probeer het opnieuw.",loginDataMissing:"Sessie verlopen. Probeer het opnieuw."}},pw={credentials:"Credentials",emails:"E-mails",settings:"Instellingen"},yw={appName:"AliasVault",loading:"Laden...",error:"Fout",success:"Succes",cancel:"Annuleren",use:"Gebruik",delete:"Verwijderen",close:"Sluiten",copied:"Gekopieerd!",openInNewWindow:"Openen in nieuw venster",language:"Taal",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",copyToClipboard:"Naar klembord kopiëren",loadingEmails:"E-mails laden...",loadingTotpCodes:"TOTP-codes laden...",attachments:"Bijlagen",loadingAttachments:"Bijlagen laden...",settings:"Instellingen",recentEmails:"Recente e-mails",loginCredentials:"Inloggegevens",twoFactorAuthentication:"Tweestapsverificatie",alias:"Alias",notes:"Notities",fullName:"Volledige naam",firstName:"Voornaam",lastName:"Achternaam",birthDate:"Geboortedatum",nickname:"Bijnaam",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",syncingVault:"Vault synchroniseren",savingChangesToVault:"Wijzigingen opslaan in vault",uploadingVaultToServer:"Vault uploaden naar server",checkingVaultUpdates:"Controleren op vault updates",syncingUpdatedVault:"Bijgewerkte vault synchroniseren",executingOperation:"Actie uitvoeren...",loadMore:"Laad meer",errors:{VaultMergeRequired:"Je vault moet worden bijgewerkt. Log in op de AliasVault website en volg de stappen.",VaultOutdated:"Je vault is verouderd. Log in op de AliasVault website en volg de stappen.",NoVaultFound:"Je account heeft nog geen vault. Voltooi eerst de tutorial in de AliasVault webclient voordat je de browserextensie gebruikt.",serverNotAvailable:"De AliasVault server is niet beschikbaar. Probeer het later opnieuw of neem contact op met de ondersteuning als het probleem aanhoudt.",clientVersionNotSupported:"Deze versie van de AliasVault browserextensie wordt niet meer ondersteund door de server. Update je browserextensie naar de nieuwste versie.",serverVersionNotSupported:"De AliasVault server moet worden bijgewerkt naar een nieuwere versie om deze browserextensie te kunnen gebruiken. Neem contact op met support als je hulp nodig hebt.",unknownError:"Er is een onbekende fout opgetreden",failedToStoreVault:"Vault opslaan mislukt",vaultNotAvailable:"Vault niet beschikbaar",failedToGetVault:"Vault ophalen mislukt",vaultIsLocked:"Vault is vergrendeld",failedToGetCredentials:"Credentials ophalen mislukt",failedToCreateIdentity:"Identiteit aanmaken mislukt",failedToGetDefaultEmailDomain:"Standaard e-maildomein ophalen mislukt",failedToGetDefaultIdentitySettings:"Standaard identiteit instellingen ophalen mislukt",failedToGetPasswordSettings:"Wachtwoordinstellingen ophalen mislukt",failedToUploadVault:"Vault uploaden mislukt",noDerivedKeyAvailable:"Geen afgeleide sleutel beschikbaar voor versleuteling",failedToUploadVaultToServer:"Nieuwe vault uploaden naar server mislukt",noVaultOrDerivedKeyFound:"Geen vault of afgeleide sleutel gevonden"},apiErrors:{UNKNOWN_ERROR:"Er is een onbekende fout opgetreden. Probeer het opnieuw.",ACCOUNT_LOCKED:"Account tijdelijk vergrendeld vanwege te veel mislukte pogingen. Probeer het later opnieuw.",ACCOUNT_BLOCKED:"Je account is uitgeschakeld. Als je denkt dat dit een vergissing is, neem dan contact op met support.",USER_NOT_FOUND:"Gebruikersnaam of wachtwoord is onjuist. Probeer het opnieuw.",INVALID_AUTHENTICATOR_CODE:"Ongeldige authenticator code. Probeer het opnieuw.",INVALID_RECOVERY_CODE:"Ongeldige herstelcode. Probeer het opnieuw.",REFRESH_TOKEN_REQUIRED:"Refresh token is vereist.",USER_NOT_FOUND_IN_TOKEN:"Gebruiker niet gevonden in token.",USER_NOT_FOUND_IN_DATABASE:"Gebruiker niet gevonden in database.",INVALID_REFRESH_TOKEN:"Ongeldig refresh token.",REFRESH_TOKEN_REVOKED_SUCCESSFULLY:"Refresh token succesvol ingetrokken.",PUBLIC_REGISTRATION_DISABLED:"Registratie van nieuwe accounts is momenteel uitgeschakeld op deze server. Neem contact op met de beheerder.",USERNAME_REQUIRED:"Gebruikersnaam is vereist.",USERNAME_ALREADY_IN_USE:"Gebruikersnaam is al in gebruik.",USERNAME_AVAILABLE:"Gebruikersnaam is beschikbaar.",USERNAME_MISMATCH:"Gebruikersnaam komt niet overeen met de huidige gebruiker.",PASSWORD_MISMATCH:"Het opgegeven wachtwoord komt niet overeen met je huidige wachtwoord.",ACCOUNT_SUCCESSFULLY_DELETED:"Account succesvol verwijderd.",USERNAME_EMPTY_OR_WHITESPACE:"Gebruikersnaam mag niet leeg zijn of alleen uit spaties bestaan.",USERNAME_TOO_SHORT:"Gebruikersnaam te kort: moet minimaal 3 tekens lang zijn.",USERNAME_TOO_LONG:"Gebruikersnaam te lang: mag niet langer zijn dan 40 tekens.",USERNAME_INVALID_EMAIL:"Ongeldig e-mailadres.",USERNAME_INVALID_CHARACTERS:"Gebruikersnaam is ongeldig, mag alleen letters of cijfers bevatten.",VAULT_NOT_UP_TO_DATE:"Je vault is niet up-to-date. Synchroniseer je vault en probeer het opnieuw.",INTERNAL_SERVER_ERROR:"Interne serverfout.",VAULT_ERROR:"Je lokale vault is niet up-to-date. Synchroniseer je vault door de pagina te vernieuwen en probeer het opnieuw."}},Ew={or:"of",new:"Nieuw",cancel:"Annuleren",search:"Zoeken",vaultLocked:"AliasVault is vergrendeld.",creatingNewAlias:"Nieuwe alias aanmaken...",noMatchesFound:"Geen resultaten gevonden",searchVault:"Vault doorzoeken...",serviceName:"Servicenaam",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",enterServiceName:"Voer servicenaam in",enterEmailAddress:"Voer e-mailadres in",enterUsername:"Voer gebruikersnaam in",hideFor1Hour:"Verberg voor 1 uur (huidige site)",hidePermanently:"Permanent verbergen (huidige site)",createRandomAlias:"Willekeurige alias aanmaken",createUsernamePassword:"Gebruikersnaam/wachtwoord aanmaken",randomAlias:"Alias",usernamePassword:"Gebruikersnaam/wachtwoord",createAndSaveAlias:"Alias aanmaken",createAndSaveCredential:"Credential aanmaken",randomIdentityDescription:"Genereer een willekeurige identiteit met een willekeurig e-mailadres toegankelijk in AliasVault.",randomIdentityDescriptionDropdown:"Willekeurige identiteit met willekeurige e-mail",manualCredentialDescription:"Specificeer je eigen e-mailadres en/of gebruikersnaam.",manualCredentialDescriptionDropdown:"Handmatige gebruikersnaam en wachtwoord",failedToCreateIdentity:"Identiteit aanmaken mislukt. Probeer opnieuw.",enterEmailAndOrUsername:"Voer e-mail en/of gebruikersnaam in",autofillWithAliasVault:"Autofill met AliasVault",generateRandomPassword:"Willekeurig wachtwoord genereren (kopiëren naar klembord)",generateNewPassword:"Genereer nieuw wachtwoord",togglePasswordVisibility:"Schakel zichtbaarheid van wachtwoord in/uit",passwordCopiedToClipboard:"Wachtwoord gekopieerd naar klembord",enterEmailAndOrUsernameError:"Voer e-mail en/of gebruikersnaam in",openAliasVaultToUpgrade:"Open AliasVault om te upgraden",vaultUpgradeRequired:"Update is vereist.",dismissPopup:"Pop-up sluiten"},bw={title:"Credentials",addCredential:"Credential toevoegen",editCredential:"Credential bewerken",deleteCredential:"Credential verwijderen",credentialDetails:"Credential details",serviceName:"Naam",serviceNamePlaceholder:"bijv. Gmail, Facebook, Bank",website:"Website",websitePlaceholder:"https://voorbeeld.nl",username:"Gebruikersnaam",usernamePlaceholder:"Voer gebruikersnaam in",password:"Wachtwoord",passwordPlaceholder:"Voer wachtwoord in",generatePassword:"Wachtwoord genereren",copyPassword:"Wachtwoord kopiëren",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",notes:"Notities",notesPlaceholder:"Aanvullende notities...",totp:"Tweestapsverificatie",totpCode:"TOTP-code",copyTotp:"Kopiëren",totpSecret:"TOTP secret",totpSecretPlaceholder:"Voer TOTP secret in",noCredentials:"Geen credentials gevonden",noCredentialsDescription:"Voeg je eerste credentials toe om te beginnen",searchCredentials:"Zoek credentials...",searchPlaceholder:"Credentials zoeken...",welcomeTitle:"Welkom bij AliasVault!",welcomeDescription:"Om de AliasVault browser extensie te gebruiken: navigeer naar een website en gebruik de AliasVault autofill popup om nieuwe credentials aan te maken.",lastUsed:"Laatst gebruikt",createdAt:"Aangemaakt",updatedAt:"Laatst bijgewerkt",autofill:"Autofill",fillForm:"Formulier invullen",copyUsername:"Gebruikersnaam kopiëren",openWebsite:"Website openen",favorite:"Favoriet",unfavorite:"Uit favorieten verwijderen",deleteConfirm:"Weet je zeker dat je deze credential wilt verwijderen?",deleteSuccess:"Credential succesvol verwijderd",saveSuccess:"Credential succesvol opgeslagen",copySuccess:"Gekopieerd naar klembord",tags:"Labels",addTag:"Label toevoegen",removeTag:"Label verwijderen",folder:"Map",selectFolder:"Map selecteren",createFolder:"Map aanmaken",saveCredential:"Credential opslaan",deleteCredentialTitle:"Credential verwijderen",deleteCredentialConfirm:"Weet je zeker dat je deze credential wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.",randomAlias:"Alias",manual:"Handmatig",service:"Naam",serviceUrl:"URL",loginCredentials:"Inloggegevens",generateRandomUsername:"Gebruikersnaam genereren",generateRandomPassword:"Wachtwoord genereren",changePasswordComplexity:"Wijzig wachtwoord complexiteit",passwordLength:"Wachtwoordlengte",includeLowercase:"Inclusief kleine letters",includeUppercase:"Inclusief hoofdletters",includeNumbers:"Inclusief cijfers",includeSpecialChars:"Inclusief speciale karakters",avoidAmbiguousChars:"Onduidelijke tekens vermijden (o, 0, etc.)",generateNewPreview:"Genereer nieuw voorbeeld",generateRandomAlias:"Alias genereren",alias:"Alias",firstName:"Voornaam",lastName:"Achternaam",nickName:"Bijnaam",gender:"Geslacht",birthDate:"Geboortedatum",birthDatePlaceholder:"YYYY-MM-DD",metadata:"Metadata",errors:{invalidUrl:"Voer een geldige URL in",saveError:"Credential opslaan mislukt",loadError:"Credential laden mislukt",deleteError:"Credential verwijderen mislukt",copyError:"Kopiëren naar klembord mislukt"},validation:{required:"Dit veld is verplicht",serviceNameRequired:"Servicenaam is verplicht",invalidUrl:"Ongeldig URL-formaat",invalidEmail:"Ongeldig e-mailformaat",invalidDateFormat:"Datum moet in YYYY-MM-DD formaat zijn"}},vw={title:"E-mails",deleteEmailTitle:"E-mail verwijderen",deleteEmailConfirm:"Weet je zeker dat je deze e-mail definitief wilt verwijderen?",from:"Van",to:"Naar",date:"Datum",emailContent:"E-mailinhoud",attachments:"Bijlagen",emailNotFound:"E-mail niet gevonden",noEmails:"Geen e-mails gevonden",noEmailsDescription:"Je hebt nog geen e-mails ontvangen op je privé e-mailadressen. Wanneer je een nieuwe e-mail ontvangt, zal deze hier verschijnen.",dateFormat:{justNow:"zojuist",minutesAgo_single:"{{count}} min geleden",minutesAgo_plural:"{{count}} min. geleden",hoursAgo_single:"{{count}} uur geleden",hoursAgo_plural:"{{count}} uur geleden",yesterday:"gisteren"},errors:{emailLoadError:"Er is een fout opgetreden bij het laden van e-mails. Probeer het later opnieuw.",emailUnexpectedError:"Er is een onverwachte fout opgetreden bij het laden van e-mails. Probeer het later opnieuw."},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Het huidige gekozen e-mailadres is al in gebruik. Wijzig het e-mailadres door deze credential te bewerken.",CLAIM_DOES_NOT_EXIST:"Er is een fout opgetreden bij het laden van e-mails. Probeer de credential te bewerken en op te slaan om de database te synchroniseren, en probeer het opnieuw."}},xw={title:"Instellingen",serverUrl:"Server URL",language:"Taal",autofillEnabled:"Autofill",version:"Versie",openInNewWindow:"Openen in nieuw venster",openWebApp:"Web-app openen",loggedIn:"Ingelogd",logout:"Uitloggen",globalSettings:"Globale Instellingen",autofillPopup:"Autofill popup",activeOnAllSites:"Actief voor alle sites (tenzij hieronder uitgeschakeld)",disabledOnAllSites:"Uitgeschakeld op alle sites",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",rightClickContextMenu:"Rechtermuisknop menu",siteSpecificSettings:"Site-specifieke Instellingen",autofillPopupOn:"Autofill popup op: ",enabledForThisSite:"Ingeschakeld voor deze site",disabledForThisSite:"Uitgeschakeld voor deze site",temporarilyDisabledUntil:"Tijdelijk uitgeschakeld tot ",resetAllSiteSettings:"Alle site-specifieke instellingen resetten",appearance:"Uiterlijk",theme:"Thema",useDefault:"Standaard gebruiken",light:"Licht",dark:"Donker",keyboardShortcuts:"Snelkoppelingen",configureKeyboardShortcuts:"Snelkoppelingen configureren",configure:"Configureren",versionPrefix:"Versie ",validation:{apiUrlRequired:"API URL is vereist",apiUrlInvalid:"Voer een geldige API URL in",clientUrlRequired:"Client URL is vereist",clientUrlInvalid:"Voer een geldige client URL in"}},Cw={title:"Vault upgraden",subtitle:"AliasVault is vernieuwd en je vault moet worden bijgewerkt. Dit kan enkele seconden duren.",versionInformation:"Versie-informatie",yourVault:"Jouw vault:",newVersion:"Nieuwe versie:",upgrade:"Vault upgraden",upgrading:"Aan het upgraden...",logout:"Uitloggen",whatsNew:"Wat is er nieuw",whatsNewDescription:"Een upgrade is vereist vanwege de volgende wijzigingen:",noDescriptionAvailable:"Voor deze versie is geen beschrijving beschikbaar.",okay:"Ok",status:{preparingUpgrade:"Upgrade voorbereiden...",vaultAlreadyUpToDate:"De vault is al bijgewerkt",startingDatabaseTransaction:"Starten van database transactie...",applyingDatabaseMigrations:"Databasemigratie toepassen...",applyingMigration:"Toepassen van migratie {{current}} van {{total}}...",committingChanges:"Wijzigingen doorvoeren..."},alerts:{error:"Fout",unableToGetVersionInfo:"Kan versie-informatie niet ophalen. Probeer het opnieuw.",selfHostedServer:"Self-hosted server",selfHostedWarning:"Als je een self-hosted server gebruikt, zorg er dan voor dat je ook je eigen self-hosted instantie bijwerkt, omdat anders het inloggen via de web client niet meer zal werken.",cancel:"Annuleren",continueUpgrade:"Verdergaan",upgradeFailed:"Upgrade mislukt",failedToApplyMigration:"Kon migratie niet toepassen ({{current}} van {{total}})",unknownErrorDuringUpgrade:"Er is een onbekende fout opgetreden tijdens de upgrade. Probeer het opnieuw."}},ww={auth:mw,menu:pw,common:yw,content:Ew,credentials:bw,emails:vw,settings:xw,upgrade:Cw},Iw={en:{translation:gw},nl:{translation:ww}},Kl=[{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"nl",name:"Dutch",nativeName:"Nederlands",flag:"🇳🇱"}],yy="en",Rm=Kl.map(n=>n.code);function Bw(n){return Kl.find(r=>r.code===n)}const Ey=({variant:n="dropdown",size:r="md"})=>{const{i18n:a}=Bt(),[s,o]=M.useState(!1),u=M.useRef(null),c=Bw(a.language)||Kl[0];M.useEffect(()=>{const m=A=>{u.current&&!u.current.contains(A.target)&&o(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]);const d=async m=>{await a.changeLanguage(m),await Xe.setItem("local:language",m),o(!1),a.emit("languageChanged",m)};return n==="buttons"?p.jsx("div",{className:"flex space-x-2",children:Kl.map(m=>p.jsxs("button",{onClick:()=>d(m.code),className:`flex items-center space-x-1 px-2 py-1 text-xs rounded transition-colors ${a.language===m.code?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-500"}`,title:m.nativeName,children:[p.jsx("span",{className:"text-sm",children:m.flag}),p.jsx("span",{children:m.code.toUpperCase()})]},m.code))}):p.jsxs("div",{className:"relative",ref:u,children:[p.jsxs("button",{onClick:()=>o(!s),className:`w-full flex items-center justify-between px-3 py-1.5 rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors ${r==="sm"?"text-sm":"text-base"}`,children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("span",{className:"text-lg",children:c.flag}),p.jsx("span",{children:c.nativeName})]}),p.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&p.jsx("div",{className:"absolute top-full left-0 mt-1 w-full bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg z-50",children:Kl.map(m=>p.jsxs("button",{onClick:()=>d(m.code),className:`w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors first:rounded-t-lg last:rounded-b-lg ${r==="sm"?"text-sm":"text-base"}`,children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("span",{className:"text-lg",children:m.flag}),p.jsx("span",{className:"text-gray-700 dark:text-gray-200",children:m.nativeName})]}),a.language===m.code&&p.jsx("svg",{className:"w-4 h-4 text-primary-500",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},m.code))})]})};class cr{constructor(){}static isServerVersionSupported(r){return this.versionGreaterThanOrEqualTo(r,this.MIN_SERVER_VERSION)}static versionGreaterThanOrEqualTo(r,a){const[s,o]=r.split("-"),[u,c]=a.split("-"),d=s.split(".").map(Number),m=u.split(".").map(Number);for(let A=0;A<Math.max(d.length,m.length);A++){const b=d[A]??0,v=m[A]??0;if(b>v)return!0;if(b<v)return!1}return!o&&c?!0:o&&!c?!1:!o&&!c?!0:o>=c}}Br(cr,"VERSION","0.21.2"),Br(cr,"MIN_SERVER_VERSION","0.12.0-dev"),Br(cr,"CLIENT_NAME","edge"),Br(cr,"DEFAULT_CLIENT_URL","https://app.aliasvault.net"),Br(cr,"DEFAULT_API_URL","https://app.aliasvault.net/api");const Uf=[{label:"Aliasvault.net",value:cr.DEFAULT_API_URL},{label:"Self-hosted",value:"custom"}],Sw=n=>Gu().shape({apiUrl:Yr().required(n("validation.apiUrlRequired")).test("is-valid-api-url",n("settings.validation.apiUrlInvalid"),r=>{if(!r)return!0;try{const a=new URL(r);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}}),clientUrl:Yr().required(n("validation.clientUrlRequired")).test("is-valid-client-url",n("settings.validation.clientUrlInvalid"),r=>{if(!r)return!0;try{const a=new URL(r);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}})}),Nw=()=>{const{t:n}=Bt(),[r,a]=M.useState(""),[s,o]=M.useState(""),[u,c]=M.useState(""),[d,m]=M.useState(!0),[A,b]=M.useState({}),{setIsInitialLoading:v}=yn(),B=Sw(n);M.useEffect(()=>{(async()=>{const O=await Xe.getItem("local:apiUrl"),_=await Xe.getItem("local:clientUrl"),q=await Xe.getItem(Ou)!==!1,V=await Xe.getItem(Fu);m(V?!1:q);const ae=Uf.find(ge=>ge.value===O);ae?a(ae.value):O?(a("custom"),o(O),c(_??"")):a(Uf[0].value),v(!1)})()},[v]);const T=async N=>{const O=N.target.value;a(O),O!=="custom"&&(await Xe.setItem("local:apiUrl",""),await Xe.setItem("local:clientUrl",""),o(""),c(""),b({}))},Q=async N=>{const O=N.target.value;o(O);try{await B.validateAt("apiUrl",{apiUrl:O}),b(_=>({..._,apiUrl:void 0})),await Xe.setItem("local:apiUrl",O)}catch(_){_ instanceof Hr&&(b(q=>({...q,apiUrl:_.message})),await Xe.setItem("local:apiUrl",cr.DEFAULT_API_URL),await Xe.setItem("local:clientUrl",cr.DEFAULT_CLIENT_URL))}},k=async N=>{const O=N.target.value;c(O);try{await B.validateAt("clientUrl",{clientUrl:O}),b(_=>({..._,clientUrl:void 0})),await Xe.setItem("local:clientUrl",O)}catch(_){_ instanceof Hr&&b(q=>({...q,clientUrl:_.message}))}},R=async()=>{const N=!d;await Xe.setItem(Ou,N),N&&(await Xe.setItem(Tu,[]),await Xe.setItem(Fu,0)),m(N)};return p.jsxs("div",{className:"p-4",children:[p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("common.language")}),p.jsx(Ey,{variant:"dropdown",size:"sm"})]})}),p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"api-connection",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:n("settings.serverUrl")}),p.jsx("select",{value:r,onChange:T,className:"w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white",children:Uf.map(N=>p.jsx("option",{value:N.value,children:N.label},N.value))})]}),r==="custom"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"custom-client-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:"Custom client URL"}),p.jsx("input",{id:"custom-client-url",type:"text",value:u,onChange:k,placeholder:"https://my-aliasvault-instance.com",className:`w-full bg-gray-50 border ${A.clientUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),A.clientUrl&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A.clientUrl})]}),p.jsxs("div",{className:"mb-6",children:[p.jsx("label",{htmlFor:"custom-api-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:"Custom API URL"}),p.jsx("input",{id:"custom-api-url",type:"text",value:s,onChange:Q,placeholder:"https://my-aliasvault-instance.com/api",className:`w-full bg-gray-50 border ${A.apiUrl?"border-red-500":"border-gray-300"} text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white`}),A.apiUrl&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A.apiUrl})]})]}),p.jsx("div",{className:"mb-6",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.autofillEnabled")}),p.jsx("button",{onClick:R,className:`px-4 py-2 rounded-md transition-colors ${d?"bg-green-200 text-green-800 hover:bg-green-300 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50":"bg-red-200 text-red-800 hover:bg-red-300 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50"}`,children:d?n("common.enabled","Enabled"):n("common.disabled","Disabled")})]})}),p.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[n("settings.version"),": ",cr.VERSION]})]})};var so=n=>n.type==="checkbox",Ki=n=>n instanceof Date,Pr=n=>n==null;const by=n=>typeof n=="object";var sr=n=>!Pr(n)&&!Array.isArray(n)&&by(n)&&!Ki(n),Tw=n=>sr(n)&&n.target?so(n.target)?n.target.checked:n.target.value:n,Qw=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,Dw=(n,r)=>n.has(Qw(r)),Rw=n=>{const r=n.constructor&&n.constructor.prototype;return sr(r)&&r.hasOwnProperty("isPrototypeOf")},IA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function jr(n){let r;const a=Array.isArray(n),s=typeof FileList<"u"?n instanceof FileList:!1;if(n instanceof Date)r=new Date(n);else if(n instanceof Set)r=new Set(n);else if(!(IA&&(n instanceof Blob||s))&&(a||sr(n)))if(r=a?[]:{},!a&&!Rw(n))r=n;else for(const o in n)n.hasOwnProperty(o)&&(r[o]=jr(n[o]));else return n;return r}var tc=n=>Array.isArray(n)?n.filter(Boolean):[],ur=n=>n===void 0,Pe=(n,r,a)=>{if(!r||!sr(n))return a;const s=tc(r.split(/[,[\].]+?/)).reduce((o,u)=>Pr(o)?o:o[u],n);return ur(s)||s===n?ur(n[r])?a:n[r]:s},sa=n=>typeof n=="boolean",BA=n=>/^\w*$/.test(n),vy=n=>tc(n.replace(/["|']|\]/g,"").split(/\.|\[/)),kt=(n,r,a)=>{let s=-1;const o=BA(r)?[r]:vy(r),u=o.length,c=u-1;for(;++s<u;){const d=o[s];let m=a;if(s!==c){const A=n[d];m=sr(A)||Array.isArray(A)?A:isNaN(+o[s+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;n[d]=m,n=n[d]}};const km={BLUR:"blur",FOCUS_OUT:"focusout"},Hn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Da={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};pn.createContext(null);var kw=(n,r,a,s=!0)=>{const o={defaultValues:r._defaultValues};for(const u in n)Object.defineProperty(o,u,{get:()=>{const c=u;return r._proxyFormState[c]!==Hn.all&&(r._proxyFormState[c]=!s||Hn.all),n[c]}});return o};const Lw=typeof window<"u"?M.useLayoutEffect:M.useEffect;var la=n=>typeof n=="string",Uw=(n,r,a,s,o)=>la(n)?(s&&r.watch.add(n),Pe(a,n,o)):Array.isArray(n)?n.map(u=>(s&&r.watch.add(u),Pe(a,u))):(s&&(r.watchAll=!0),a),xy=(n,r,a,s,o)=>r?{...a[n],types:{...a[n]&&a[n].types?a[n].types:{},[s]:o||!0}}:{},Jl=n=>Array.isArray(n)?n:[n],Lm=()=>{let n=[];return{get observers(){return n},next:o=>{for(const u of n)u.next&&u.next(o)},subscribe:o=>(n.push(o),{unsubscribe:()=>{n=n.filter(u=>u!==o)}}),unsubscribe:()=>{n=[]}}},lA=n=>Pr(n)||!by(n);function Ei(n,r){if(lA(n)||lA(r))return n===r;if(Ki(n)&&Ki(r))return n.getTime()===r.getTime();const a=Object.keys(n),s=Object.keys(r);if(a.length!==s.length)return!1;for(const o of a){const u=n[o];if(!s.includes(o))return!1;if(o!=="ref"){const c=r[o];if(Ki(u)&&Ki(c)||sr(u)&&sr(c)||Array.isArray(u)&&Array.isArray(c)?!Ei(u,c):u!==c)return!1}}return!0}var nn=n=>sr(n)&&!Object.keys(n).length,SA=n=>n.type==="file",Gn=n=>typeof n=="function",Vu=n=>{if(!IA)return!1;const r=n?n.ownerDocument:0;return n instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Cy=n=>n.type==="select-multiple",NA=n=>n.type==="radio",Mw=n=>NA(n)||so(n),Mf=n=>Vu(n)&&n.isConnected;function _w(n,r){const a=r.slice(0,-1).length;let s=0;for(;s<a;)n=ur(n)?s++:n[r[s++]];return n}function Ow(n){for(const r in n)if(n.hasOwnProperty(r)&&!ur(n[r]))return!1;return!0}function mr(n,r){const a=Array.isArray(r)?r:BA(r)?[r]:vy(r),s=a.length===1?n:_w(n,a),o=a.length-1,u=a[o];return s&&delete s[u],o!==0&&(sr(s)&&nn(s)||Array.isArray(s)&&Ow(s))&&mr(n,a.slice(0,-1)),n}var wy=n=>{for(const r in n)if(Gn(n[r]))return!0;return!1};function qu(n,r={}){const a=Array.isArray(n);if(sr(n)||a)for(const s in n)Array.isArray(n[s])||sr(n[s])&&!wy(n[s])?(r[s]=Array.isArray(n[s])?[]:{},qu(n[s],r[s])):Pr(n[s])||(r[s]=!0);return r}function Iy(n,r,a){const s=Array.isArray(n);if(sr(n)||s)for(const o in n)Array.isArray(n[o])||sr(n[o])&&!wy(n[o])?ur(r)||lA(a[o])?a[o]=Array.isArray(n[o])?qu(n[o],[]):{...qu(n[o])}:Iy(n[o],Pr(r)?{}:r[o],a[o]):a[o]=!Ei(n[o],r[o]);return a}var Vl=(n,r)=>Iy(n,r,qu(r));const Um={value:!1,isValid:!1},Mm={value:!0,isValid:!0};var By=n=>{if(Array.isArray(n)){if(n.length>1){const r=n.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:r,isValid:!!r.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!ur(n[0].attributes.value)?ur(n[0].value)||n[0].value===""?Mm:{value:n[0].value,isValid:!0}:Mm:Um}return Um},Sy=(n,{valueAsNumber:r,valueAsDate:a,setValueAs:s})=>ur(n)?n:r?n===""?NaN:n&&+n:a&&la(n)?new Date(n):s?s(n):n;const _m={isValid:!1,value:null};var Ny=n=>Array.isArray(n)?n.reduce((r,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:r,_m):_m;function Om(n){const r=n.ref;return SA(r)?r.files:NA(r)?Ny(n.refs).value:Cy(r)?[...r.selectedOptions].map(({value:a})=>a):so(r)?By(n.refs).value:Sy(ur(r.value)?n.ref.value:r.value,n)}var Fw=(n,r,a,s)=>{const o={};for(const u of n){const c=Pe(r,u);c&&kt(o,u,c._f)}return{criteriaMode:a,names:[...n],fields:o,shouldUseNativeValidation:s}},zu=n=>n instanceof RegExp,ql=n=>ur(n)?n:zu(n)?n.source:sr(n)?zu(n.value)?n.value.source:n.value:n,Fm=n=>({isOnSubmit:!n||n===Hn.onSubmit,isOnBlur:n===Hn.onBlur,isOnChange:n===Hn.onChange,isOnAll:n===Hn.all,isOnTouch:n===Hn.onTouched});const jm="AsyncFunction";var jw=n=>!!n&&!!n.validate&&!!(Gn(n.validate)&&n.validate.constructor.name===jm||sr(n.validate)&&Object.values(n.validate).find(r=>r.constructor.name===jm)),Hw=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate),Hm=(n,r,a)=>!a&&(r.watchAll||r.watch.has(n)||[...r.watch].some(s=>n.startsWith(s)&&/^\.\w+/.test(n.slice(s.length))));const Xl=(n,r,a,s)=>{for(const o of a||Object.keys(n)){const u=Pe(n,o);if(u){const{_f:c,...d}=u;if(c){if(c.refs&&c.refs[0]&&r(c.refs[0],o)&&!s)return!0;if(c.ref&&r(c.ref,c.name)&&!s)return!0;if(Xl(d,r))break}else if(sr(d)&&Xl(d,r))break}}};function Gm(n,r,a){const s=Pe(n,a);if(s||BA(a))return{error:s,name:a};const o=a.split(".");for(;o.length;){const u=o.join("."),c=Pe(r,u),d=Pe(n,u);if(c&&!Array.isArray(c)&&a!==u)return{name:a};if(d&&d.type)return{name:u,error:d};if(d&&d.root&&d.root.type)return{name:`${u}.root`,error:d.root};o.pop()}return{name:a}}var Gw=(n,r,a,s)=>{a(n);const{name:o,...u}=n;return nn(u)||Object.keys(u).length>=Object.keys(r).length||Object.keys(u).find(c=>r[c]===(!s||Hn.all))},Vw=(n,r,a)=>!n||!r||n===r||Jl(n).some(s=>s&&(a?s===r:s.startsWith(r)||r.startsWith(s))),qw=(n,r,a,s,o)=>o.isOnAll?!1:!a&&o.isOnTouch?!(r||n):(a?s.isOnBlur:o.isOnBlur)?!n:(a?s.isOnChange:o.isOnChange)?n:!0,zw=(n,r)=>!tc(Pe(n,r)).length&&mr(n,r),Yw=(n,r,a)=>{const s=Jl(Pe(n,a));return kt(s,"root",r[a]),kt(n,a,s),n},Ru=n=>la(n);function Vm(n,r,a="validate"){if(Ru(n)||Array.isArray(n)&&n.every(Ru)||sa(n)&&!n)return{type:a,message:Ru(n)?n:"",ref:r}}var _s=n=>sr(n)&&!zu(n)?n:{value:n,message:""},qm=async(n,r,a,s,o,u)=>{const{ref:c,refs:d,required:m,maxLength:A,minLength:b,min:v,max:B,pattern:T,validate:Q,name:k,valueAsNumber:R,mount:N}=n._f,O=Pe(a,k);if(!N||r.has(k))return{};const _=d?d[0]:c,q=me=>{o&&_.reportValidity&&(_.setCustomValidity(sa(me)?"":me||""),_.reportValidity())},V={},ae=NA(c),ge=so(c),te=ae||ge,J=(R||SA(c))&&ur(c.value)&&ur(O)||Vu(c)&&c.value===""||O===""||Array.isArray(O)&&!O.length,P=xy.bind(null,k,s,V),$=(me,he,Be,pe=Da.maxLength,K=Da.minLength)=>{const ie=me?he:Be;V[k]={type:me?pe:K,message:ie,ref:c,...P(me?pe:K,ie)}};if(u?!Array.isArray(O)||!O.length:m&&(!te&&(J||Pr(O))||sa(O)&&!O||ge&&!By(d).isValid||ae&&!Ny(d).isValid)){const{value:me,message:he}=Ru(m)?{value:!!m,message:m}:_s(m);if(me&&(V[k]={type:Da.required,message:he,ref:_,...P(Da.required,he)},!s))return q(he),V}if(!J&&(!Pr(v)||!Pr(B))){let me,he;const Be=_s(B),pe=_s(v);if(!Pr(O)&&!isNaN(O)){const K=c.valueAsNumber||O&&+O;Pr(Be.value)||(me=K>Be.value),Pr(pe.value)||(he=K<pe.value)}else{const K=c.valueAsDate||new Date(O),ie=G=>new Date(new Date().toDateString()+" "+G),Ne=c.type=="time",_e=c.type=="week";la(Be.value)&&O&&(me=Ne?ie(O)>ie(Be.value):_e?O>Be.value:K>new Date(Be.value)),la(pe.value)&&O&&(he=Ne?ie(O)<ie(pe.value):_e?O<pe.value:K<new Date(pe.value))}if((me||he)&&($(!!me,Be.message,pe.message,Da.max,Da.min),!s))return q(V[k].message),V}if((A||b)&&!J&&(la(O)||u&&Array.isArray(O))){const me=_s(A),he=_s(b),Be=!Pr(me.value)&&O.length>+me.value,pe=!Pr(he.value)&&O.length<+he.value;if((Be||pe)&&($(Be,me.message,he.message),!s))return q(V[k].message),V}if(T&&!J&&la(O)){const{value:me,message:he}=_s(T);if(zu(me)&&!O.match(me)&&(V[k]={type:Da.pattern,message:he,ref:c,...P(Da.pattern,he)},!s))return q(he),V}if(Q){if(Gn(Q)){const me=await Q(O,a),he=Vm(me,_);if(he&&(V[k]={...he,...P(Da.validate,he.message)},!s))return q(he.message),V}else if(sr(Q)){let me={};for(const he in Q){if(!nn(me)&&!s)break;const Be=Vm(await Q[he](O,a),_,he);Be&&(me={...Be,...P(he,Be.message)},q(Be.message),s&&(V[k]=me))}if(!nn(me)&&(V[k]={ref:_,...me},!s))return V}}return q(!0),V};const Pw={mode:Hn.onSubmit,reValidateMode:Hn.onChange,shouldFocusError:!0};function Kw(n={}){let r={...Pw,...n},a={submitCount:0,isDirty:!1,isReady:!1,isLoading:Gn(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1};const s={};let o=sr(r.defaultValues)||sr(r.values)?jr(r.defaultValues||r.values)||{}:{},u=r.shouldUnregister?{}:jr(o),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},m,A=0;const b={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...b};const B={array:Lm(),state:Lm()},T=r.criteriaMode===Hn.all,Q=j=>X=>{clearTimeout(A),A=setTimeout(j,X)},k=async j=>{if(!r.disabled&&(b.isValid||v.isValid||j)){const X=r.resolver?nn((await ge()).errors):await J(s,!0);X!==a.isValid&&B.state.next({isValid:X})}},R=(j,X)=>{!r.disabled&&(b.isValidating||b.validatingFields||v.isValidating||v.validatingFields)&&((j||Array.from(d.mount)).forEach(le=>{le&&(X?kt(a.validatingFields,le,X):mr(a.validatingFields,le))}),B.state.next({validatingFields:a.validatingFields,isValidating:!nn(a.validatingFields)}))},N=(j,X=[],le,Te,Re=!0,xe=!0)=>{if(Te&&le&&!r.disabled){if(c.action=!0,xe&&Array.isArray(Pe(s,j))){const Ve=le(Pe(s,j),Te.argA,Te.argB);Re&&kt(s,j,Ve)}if(xe&&Array.isArray(Pe(a.errors,j))){const Ve=le(Pe(a.errors,j),Te.argA,Te.argB);Re&&kt(a.errors,j,Ve),zw(a.errors,j)}if((b.touchedFields||v.touchedFields)&&xe&&Array.isArray(Pe(a.touchedFields,j))){const Ve=le(Pe(a.touchedFields,j),Te.argA,Te.argB);Re&&kt(a.touchedFields,j,Ve)}(b.dirtyFields||v.dirtyFields)&&(a.dirtyFields=Vl(o,u)),B.state.next({name:j,isDirty:$(j,X),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else kt(u,j,X)},O=(j,X)=>{kt(a.errors,j,X),B.state.next({errors:a.errors})},_=j=>{a.errors=j,B.state.next({errors:a.errors,isValid:!1})},q=(j,X,le,Te)=>{const Re=Pe(s,j);if(Re){const xe=Pe(u,j,ur(le)?Pe(o,j):le);ur(xe)||Te&&Te.defaultChecked||X?kt(u,j,X?xe:Om(Re._f)):Be(j,xe),c.mount&&k()}},V=(j,X,le,Te,Re)=>{let xe=!1,Ve=!1;const S={name:j};if(!r.disabled){if(!le||Te){(b.isDirty||v.isDirty)&&(Ve=a.isDirty,a.isDirty=S.isDirty=$(),xe=Ve!==S.isDirty);const E=Ei(Pe(o,j),X);Ve=!!Pe(a.dirtyFields,j),E?mr(a.dirtyFields,j):kt(a.dirtyFields,j,!0),S.dirtyFields=a.dirtyFields,xe=xe||(b.dirtyFields||v.dirtyFields)&&Ve!==!E}if(le){const E=Pe(a.touchedFields,j);E||(kt(a.touchedFields,j,le),S.touchedFields=a.touchedFields,xe=xe||(b.touchedFields||v.touchedFields)&&E!==le)}xe&&Re&&B.state.next(S)}return xe?S:{}},ae=(j,X,le,Te)=>{const Re=Pe(a.errors,j),xe=(b.isValid||v.isValid)&&sa(X)&&a.isValid!==X;if(r.delayError&&le?(m=Q(()=>O(j,le)),m(r.delayError)):(clearTimeout(A),m=null,le?kt(a.errors,j,le):mr(a.errors,j)),(le?!Ei(Re,le):Re)||!nn(Te)||xe){const Ve={...Te,...xe&&sa(X)?{isValid:X}:{},errors:a.errors,name:j};a={...a,...Ve},B.state.next(Ve)}},ge=async j=>{R(j,!0);const X=await r.resolver(u,r.context,Fw(j||d.mount,s,r.criteriaMode,r.shouldUseNativeValidation));return R(j),X},te=async j=>{const{errors:X}=await ge(j);if(j)for(const le of j){const Te=Pe(X,le);Te?kt(a.errors,le,Te):mr(a.errors,le)}else a.errors=X;return X},J=async(j,X,le={valid:!0})=>{for(const Te in j){const Re=j[Te];if(Re){const{_f:xe,...Ve}=Re;if(xe){const S=d.array.has(xe.name),E=Re._f&&jw(Re._f);E&&b.validatingFields&&R([Te],!0);const x=await qm(Re,d.disabled,u,T,r.shouldUseNativeValidation&&!X,S);if(E&&b.validatingFields&&R([Te]),x[xe.name]&&(le.valid=!1,X))break;!X&&(Pe(x,xe.name)?S?Yw(a.errors,x,xe.name):kt(a.errors,xe.name,x[xe.name]):mr(a.errors,xe.name))}!nn(Ve)&&await J(Ve,X,le)}}return le.valid},P=()=>{for(const j of d.unMount){const X=Pe(s,j);X&&(X._f.refs?X._f.refs.every(le=>!Mf(le)):!Mf(X._f.ref))&&yt(j)}d.unMount=new Set},$=(j,X)=>!r.disabled&&(j&&X&&kt(u,j,X),!Ei(G(),o)),me=(j,X,le)=>Uw(j,d,{...c.mount?u:ur(X)?o:la(j)?{[j]:X}:X},le,X),he=j=>tc(Pe(c.mount?u:o,j,r.shouldUnregister?Pe(o,j,[]):[])),Be=(j,X,le={})=>{const Te=Pe(s,j);let Re=X;if(Te){const xe=Te._f;xe&&(!xe.disabled&&kt(u,j,Sy(X,xe)),Re=Vu(xe.ref)&&Pr(X)?"":X,Cy(xe.ref)?[...xe.ref.options].forEach(Ve=>Ve.selected=Re.includes(Ve.value)):xe.refs?so(xe.ref)?xe.refs.forEach(Ve=>{(!Ve.defaultChecked||!Ve.disabled)&&(Array.isArray(Re)?Ve.checked=!!Re.find(S=>S===Ve.value):Ve.checked=Re===Ve.value||!!Re)}):xe.refs.forEach(Ve=>Ve.checked=Ve.value===Re):SA(xe.ref)?xe.ref.value="":(xe.ref.value=Re,xe.ref.type||B.state.next({name:j,values:jr(u)})))}(le.shouldDirty||le.shouldTouch)&&V(j,Re,le.shouldTouch,le.shouldDirty,!0),le.shouldValidate&&_e(j)},pe=(j,X,le)=>{for(const Te in X){if(!X.hasOwnProperty(Te))return;const Re=X[Te],xe=j+"."+Te,Ve=Pe(s,xe);(d.array.has(j)||sr(Re)||Ve&&!Ve._f)&&!Ki(Re)?pe(xe,Re,le):Be(xe,Re,le)}},K=(j,X,le={})=>{const Te=Pe(s,j),Re=d.array.has(j),xe=jr(X);kt(u,j,xe),Re?(B.array.next({name:j,values:jr(u)}),(b.isDirty||b.dirtyFields||v.isDirty||v.dirtyFields)&&le.shouldDirty&&B.state.next({name:j,dirtyFields:Vl(o,u),isDirty:$(j,xe)})):Te&&!Te._f&&!Pr(xe)?pe(j,xe,le):Be(j,xe,le),Hm(j,d)&&B.state.next({...a}),B.state.next({name:c.mount?j:void 0,values:jr(u)})},ie=async j=>{c.mount=!0;const X=j.target;let le=X.name,Te=!0;const Re=Pe(s,le),xe=E=>{Te=Number.isNaN(E)||Ki(E)&&isNaN(E.getTime())||Ei(E,Pe(u,le,E))},Ve=Fm(r.mode),S=Fm(r.reValidateMode);if(Re){let E,x;const H=X.type?Om(Re._f):Tw(j),W=j.type===km.BLUR||j.type===km.FOCUS_OUT,fe=!Hw(Re._f)&&!r.resolver&&!Pe(a.errors,le)&&!Re._f.deps||qw(W,Pe(a.touchedFields,le),a.isSubmitted,S,Ve),be=Hm(le,d,W);kt(u,le,H),W?(Re._f.onBlur&&Re._f.onBlur(j),m&&m(0)):Re._f.onChange&&Re._f.onChange(j);const Le=V(le,H,W),gt=!nn(Le)||be;if(!W&&B.state.next({name:le,type:j.type,values:jr(u)}),fe)return(b.isValid||v.isValid)&&(r.mode==="onBlur"?W&&k():W||k()),gt&&B.state.next({name:le,...be?{}:Le});if(!W&&be&&B.state.next({...a}),r.resolver){const{errors:ft}=await ge([le]);if(xe(H),Te){const bt=Gm(a.errors,s,le),ot=Gm(ft,s,bt.name||le);E=ot.error,le=ot.name,x=nn(ft)}}else R([le],!0),E=(await qm(Re,d.disabled,u,T,r.shouldUseNativeValidation))[le],R([le]),xe(H),Te&&(E?x=!1:(b.isValid||v.isValid)&&(x=await J(s,!0)));Te&&(Re._f.deps&&_e(Re._f.deps),ae(le,x,E,Le))}},Ne=(j,X)=>{if(Pe(a.errors,X)&&j.focus)return j.focus(),1},_e=async(j,X={})=>{let le,Te;const Re=Jl(j);if(r.resolver){const xe=await te(ur(j)?j:Re);le=nn(xe),Te=j?!Re.some(Ve=>Pe(xe,Ve)):le}else j?(Te=(await Promise.all(Re.map(async xe=>{const Ve=Pe(s,xe);return await J(Ve&&Ve._f?{[xe]:Ve}:Ve)}))).every(Boolean),!(!Te&&!a.isValid)&&k()):Te=le=await J(s);return B.state.next({...!la(j)||(b.isValid||v.isValid)&&le!==a.isValid?{}:{name:j},...r.resolver||!j?{isValid:le}:{},errors:a.errors}),X.shouldFocus&&!Te&&Xl(s,Ne,j?Re:d.mount),Te},G=j=>{const X={...c.mount?u:o};return ur(j)?X:la(j)?Pe(X,j):j.map(le=>Pe(X,le))},ne=(j,X)=>({invalid:!!Pe((X||a).errors,j),isDirty:!!Pe((X||a).dirtyFields,j),error:Pe((X||a).errors,j),isValidating:!!Pe(a.validatingFields,j),isTouched:!!Pe((X||a).touchedFields,j)}),Ee=j=>{j&&Jl(j).forEach(X=>mr(a.errors,X)),B.state.next({errors:j?a.errors:{}})},ke=(j,X,le)=>{const Te=(Pe(s,j,{_f:{}})._f||{}).ref,Re=Pe(a.errors,j)||{},{ref:xe,message:Ve,type:S,...E}=Re;kt(a.errors,j,{...E,...X,ref:Te}),B.state.next({name:j,errors:a.errors,isValid:!1}),le&&le.shouldFocus&&Te&&Te.focus&&Te.focus()},He=(j,X)=>Gn(j)?B.state.subscribe({next:le=>j(me(void 0,X),le)}):me(j,X,!0),Ke=j=>B.state.subscribe({next:X=>{Vw(j.name,X.name,j.exact)&&Gw(X,j.formState||b,Fe,j.reRenderRoot)&&j.callback({values:{...u},...a,...X})}}).unsubscribe,Ge=j=>(c.mount=!0,v={...v,...j.formState},Ke({...j,formState:v})),yt=(j,X={})=>{for(const le of j?Jl(j):d.mount)d.mount.delete(le),d.array.delete(le),X.keepValue||(mr(s,le),mr(u,le)),!X.keepError&&mr(a.errors,le),!X.keepDirty&&mr(a.dirtyFields,le),!X.keepTouched&&mr(a.touchedFields,le),!X.keepIsValidating&&mr(a.validatingFields,le),!r.shouldUnregister&&!X.keepDefaultValue&&mr(o,le);B.state.next({values:jr(u)}),B.state.next({...a,...X.keepDirty?{isDirty:$()}:{}}),!X.keepIsValid&&k()},We=({disabled:j,name:X})=>{(sa(j)&&c.mount||j||d.disabled.has(X))&&(j?d.disabled.add(X):d.disabled.delete(X))},Et=(j,X={})=>{let le=Pe(s,j);const Te=sa(X.disabled)||sa(r.disabled);return kt(s,j,{...le||{},_f:{...le&&le._f?le._f:{ref:{name:j}},name:j,mount:!0,...X}}),d.mount.add(j),le?We({disabled:sa(X.disabled)?X.disabled:r.disabled,name:j}):q(j,!0,X.value),{...Te?{disabled:X.disabled||r.disabled}:{},...r.progressive?{required:!!X.required,min:ql(X.min),max:ql(X.max),minLength:ql(X.minLength),maxLength:ql(X.maxLength),pattern:ql(X.pattern)}:{},name:j,onChange:ie,onBlur:ie,ref:Re=>{if(Re){Et(j,X),le=Pe(s,j);const xe=ur(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,Ve=Mw(xe),S=le._f.refs||[];if(Ve?S.find(E=>E===xe):xe===le._f.ref)return;kt(s,j,{_f:{...le._f,...Ve?{refs:[...S.filter(Mf),xe,...Array.isArray(Pe(o,j))?[{}]:[]],ref:{type:xe.type,name:j}}:{ref:xe}}}),q(j,!1,void 0,xe)}else le=Pe(s,j,{}),le._f&&(le._f.mount=!1),(r.shouldUnregister||X.shouldUnregister)&&!(Dw(d.array,j)&&c.action)&&d.unMount.add(j)}}},Kt=()=>r.shouldFocusError&&Xl(s,Ne,d.mount),Nr=j=>{sa(j)&&(B.state.next({disabled:j}),Xl(s,(X,le)=>{const Te=Pe(s,le);Te&&(X.disabled=Te._f.disabled||j,Array.isArray(Te._f.refs)&&Te._f.refs.forEach(Re=>{Re.disabled=Te._f.disabled||j}))},0,!1))},Lt=(j,X)=>async le=>{let Te;le&&(le.preventDefault&&le.preventDefault(),le.persist&&le.persist());let Re=jr(u);if(B.state.next({isSubmitting:!0}),r.resolver){const{errors:xe,values:Ve}=await ge();a.errors=xe,Re=Ve}else await J(s);if(d.disabled.size)for(const xe of d.disabled)kt(Re,xe,void 0);if(mr(a.errors,"root"),nn(a.errors)){B.state.next({errors:{}});try{await j(Re,le)}catch(xe){Te=xe}}else X&&await X({...a.errors},le),Kt(),setTimeout(Kt);if(B.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nn(a.errors)&&!Te,submitCount:a.submitCount+1,errors:a.errors}),Te)throw Te},Ht=(j,X={})=>{Pe(s,j)&&(ur(X.defaultValue)?K(j,jr(Pe(o,j))):(K(j,X.defaultValue),kt(o,j,jr(X.defaultValue))),X.keepTouched||mr(a.touchedFields,j),X.keepDirty||(mr(a.dirtyFields,j),a.isDirty=X.defaultValue?$(j,jr(Pe(o,j))):$()),X.keepError||(mr(a.errors,j),b.isValid&&k()),B.state.next({...a}))},jt=(j,X={})=>{const le=j?jr(j):o,Te=jr(le),Re=nn(j),xe=Re?o:Te;if(X.keepDefaultValues||(o=le),!X.keepValues){if(X.keepDirtyValues){const Ve=new Set([...d.mount,...Object.keys(Vl(o,u))]);for(const S of Array.from(Ve))Pe(a.dirtyFields,S)?kt(xe,S,Pe(u,S)):K(S,Pe(xe,S))}else{if(IA&&ur(j))for(const Ve of d.mount){const S=Pe(s,Ve);if(S&&S._f){const E=Array.isArray(S._f.refs)?S._f.refs[0]:S._f.ref;if(Vu(E)){const x=E.closest("form");if(x){x.reset();break}}}}for(const Ve of d.mount)K(Ve,Pe(xe,Ve))}u=jr(xe),B.array.next({values:{...xe}}),B.state.next({values:{...xe}})}d={mount:X.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!b.isValid||!!X.keepIsValid||!!X.keepDirtyValues,c.watch=!!r.shouldUnregister,B.state.next({submitCount:X.keepSubmitCount?a.submitCount:0,isDirty:Re?!1:X.keepDirty?a.isDirty:!!(X.keepDefaultValues&&!Ei(j,o)),isSubmitted:X.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:Re?{}:X.keepDirtyValues?X.keepDefaultValues&&u?Vl(o,u):a.dirtyFields:X.keepDefaultValues&&j?Vl(o,j):X.keepDirty?a.dirtyFields:{},touchedFields:X.keepTouched?a.touchedFields:{},errors:X.keepErrors?a.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1})},br=(j,X)=>jt(Gn(j)?j(u):j,X),Qe=(j,X={})=>{const le=Pe(s,j),Te=le&&le._f;if(Te){const Re=Te.refs?Te.refs[0]:Te.ref;Re.focus&&(Re.focus(),X.shouldSelect&&Gn(Re.select)&&Re.select())}},Fe=j=>{a={...a,...j}},lt={control:{register:Et,unregister:yt,getFieldState:ne,handleSubmit:Lt,setError:ke,_subscribe:Ke,_runSchema:ge,_focusError:Kt,_getWatch:me,_getDirty:$,_setValid:k,_setFieldArray:N,_setDisabledField:We,_setErrors:_,_getFieldArray:he,_reset:jt,_resetDefaultValues:()=>Gn(r.defaultValues)&&r.defaultValues().then(j=>{br(j,r.resetOptions),B.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Nr,_subjects:B,_proxyFormState:b,get _fields(){return s},get _formValues(){return u},get _state(){return c},set _state(j){c=j},get _defaultValues(){return o},get _names(){return d},set _names(j){d=j},get _formState(){return a},get _options(){return r},set _options(j){r={...r,...j}}},subscribe:Ge,trigger:_e,register:Et,handleSubmit:Lt,watch:He,setValue:K,getValues:G,reset:br,resetField:Ht,clearErrors:Ee,unregister:yt,setError:ke,setFocus:Qe,getFieldState:ne};return{...lt,formControl:lt}}function Jw(n={}){const r=pn.useRef(void 0),a=pn.useRef(void 0),[s,o]=pn.useState({isDirty:!1,isValidating:!1,isLoading:Gn(n.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1,isReady:!1,defaultValues:Gn(n.defaultValues)?void 0:n.defaultValues});r.current||(r.current={...n.formControl?n.formControl:Kw(n),formState:s},n.formControl&&n.defaultValues&&!Gn(n.defaultValues)&&n.formControl.reset(n.defaultValues,n.resetOptions));const u=r.current.control;return u._options=n,Lw(()=>{const c=u._subscribe({formState:u._proxyFormState,callback:()=>o({...u._formState}),reRenderRoot:!0});return o(d=>({...d,isReady:!0})),u._formState.isReady=!0,c},[u]),pn.useEffect(()=>u._disableForm(n.disabled),[u,n.disabled]),pn.useEffect(()=>{n.mode&&(u._options.mode=n.mode),n.reValidateMode&&(u._options.reValidateMode=n.reValidateMode)},[u,n.mode,n.reValidateMode]),pn.useEffect(()=>{n.errors&&(u._setErrors(n.errors),u._focusError())},[u,n.errors]),pn.useEffect(()=>{n.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,n.shouldUnregister]),pn.useEffect(()=>{if(u._proxyFormState.isDirty){const c=u._getDirty();c!==s.isDirty&&u._subjects.state.next({isDirty:c})}},[u,s.isDirty]),pn.useEffect(()=>{n.values&&!Ei(n.values,a.current)?(u._reset(n.values,u._options.resetOptions),a.current=n.values,o(c=>({...c}))):u._resetDefaultValues()},[u,n.values]),pn.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),r.current.formState=kw(s,u),r.current}const zm=(n,r,a)=>{if(n&&"reportValidity"in n){const s=Pe(a,r);n.setCustomValidity(s&&s.message||""),n.reportValidity()}},Ty=(n,r)=>{for(const a in r.fields){const s=r.fields[a];s&&s.ref&&"reportValidity"in s.ref?zm(s.ref,a,n):s&&s.refs&&s.refs.forEach(o=>zm(o,a,n))}},Xw=(n,r)=>{r.shouldUseNativeValidation&&Ty(n,r);const a={};for(const s in n){const o=Pe(r.fields,s),u=Object.assign(n[s]||{},{ref:o&&o.ref});if($w(r.names||Object.keys(n),s)){const c=Object.assign({},Pe(a,s));kt(c,"root",u),kt(a,s,c)}else kt(a,s,u)}return a},$w=(n,r)=>{const a=Ym(r);return n.some(s=>Ym(s).match(`^${a}\\.\\d+`))};function Ym(n){return n.replace(/\]|\[/g,"")}function Ww(n,r,a){return a===void 0&&(a={}),function(s,o,u){try{return Promise.resolve(function(c,d){try{var m=(r!=null&&r.context,Promise.resolve(n[a.mode==="sync"?"validateSync":"validate"](s,Object.assign({abortEarly:!1},r,{context:o}))).then(function(A){return u.shouldUseNativeValidation&&Ty({},u),{values:a.raw?Object.assign({},s):A,errors:{}}}))}catch(A){return d(A)}return m&&m.then?m.then(void 0,d):m}(0,function(c){if(!c.inner)throw c;return{values:{},errors:Xw((d=c,m=!u.shouldUseNativeValidation&&u.criteriaMode==="all",(d.inner||[]).reduce(function(A,b){if(A[b.path]||(A[b.path]={message:b.message,type:b.type}),m){var v=A[b.path].types,B=v&&v[b.type];A[b.path]=xy(b.path,m,A,b.type,B?[].concat(B,b.message):b.message)}return A},{})),u)};var d,m}))}catch(c){return Promise.reject(c)}}}const Zw=({attachments:n,onAttachmentsChange:r})=>{const{t:a}=Bt(),[s,o]=M.useState(""),u=async m=>{const A=m.target.files;if(!(!A||A.length===0)){o("Uploading...");try{const b=[...n];for(const v of Array.from(A)){const B=await v.arrayBuffer(),T=new Uint8Array(B),Q={Id:crypto.randomUUID(),Filename:v.name,Blob:T,CredentialId:"",CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString(),IsDeleted:!1};b.push(Q)}r(b),o("Files uploaded successfully."),setTimeout(()=>o(""),3e3)}catch(b){console.error("Error uploading files:",b),o("Error uploading files."),setTimeout(()=>o(""),3e3)}m.target.value=""}},c=m=>{try{const A=[...n],b=A.findIndex(v=>v.Id===m.Id);b!==-1&&A.splice(b,1),r(A),o("Attachment deleted successfully."),setTimeout(()=>o(""),3e3)}catch(A){console.error("Error deleting attachment:",A),o("Error deleting attachment."),setTimeout(()=>o(""),3e3)}},d=n.filter(m=>!m.IsDeleted);return p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:a("common.attachments")}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("input",{type:"file",multiple:!0,onChange:u,className:"block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400"}),s&&p.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:s})]}),d.length>0&&p.jsxs("div",{children:[p.jsx("h4",{className:"mb-2 text-md font-medium text-gray-900 dark:text-white",children:"Current attachments:"}),p.jsx("div",{className:"space-y-2",children:d.map(m=>p.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded border border-gray-200 dark:border-gray-600",children:[p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.Filename}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(m.CreatedAt).toLocaleDateString()})]}),p.jsx("button",{type:"button",onClick:()=>c(m),className:"text-red-500 hover:text-red-700 focus:outline-none","aria-label":`Delete ${m.Filename}`,children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]},m.Id))})]})]})]})},e1=({name:n})=>{switch(n){case"visibility":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"refresh":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M23 4v6h-6"}),p.jsx("path",{d:"M1 20v-6h6"}),p.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]});case"settings":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});default:return null}},aa=M.forwardRef(({id:n,label:r,value:a,onChange:s,type:o="text",placeholder:u,required:c=!1,multiline:d=!1,rows:m=1,error:A,buttons:b=[],showPassword:v,onShowPasswordChange:B},T)=>{const{t:Q}=Bt(),[k,R]=pn.useState(!1),N=v!==void 0?v:k,O=V=>{v!==void 0?B==null||B(V):R(V)},_=`mt-1 block w-full rounded-md ${A?"border-red-500":"border-gray-300 dark:border-gray-600"} text-gray-900 sm:text-sm rounded-lg shadow-sm border focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 py-2 px-3`,q=o==="password"?[...b,{icon:N?"visibility-off":"visibility",onClick:()=>O(!N),title:Q(N?"common.hidePassword":"common.showPassword")}]:b;return p.jsxs("div",{children:[p.jsxs("label",{htmlFor:n,className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:[r,c&&p.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),p.jsxs("div",{className:"relative",children:[d?p.jsx("textarea",{id:n,value:a,onChange:V=>s(V.target.value),rows:m,placeholder:u,className:_}):p.jsx("input",{ref:T,type:o==="password"&&!N?"password":"text",id:n,value:a,onChange:V=>s(V.target.value),placeholder:u,className:_}),q.length>0&&p.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:q.map((V,ae)=>p.jsx("button",{type:"button",onClick:V.onClick,title:V.title,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(e1,{name:V.icon})})},ae))})]}),A&&p.jsx("p",{className:"mt-1 text-sm text-red-500",children:A})]})});aa.displayName="FormInput";var Kr=(n=>(n.EXPAND="expand",n.EDIT="edit",n.DELETE="delete",n.SETTINGS="settings",n.RELOAD="reload",n.EXTERNAL_LINK="external_link",n.SAVE="save",n.PLUS="plus",n.TAB="tab",n))(Kr||{});const t1=({type:n,className:r="w-5 h-5"})=>({expand:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})}),edit:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),delete:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),settings:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),reload:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),external_link:p.jsxs("svg",{className:r,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),p.jsx("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),save:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V7l-4-4z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 3v5h10"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 12a2 2 0 100 4 2 2 0 000-4z"})]}),plus:p.jsx("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),tab:p.jsxs("svg",{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"})]})})[n]||null,an=({onClick:n,title:r,iconType:a,variant:s="default"})=>{const o={default:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",primary:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 hover:bg-primary-100 dark:hover:bg-primary-900/20",danger:"text-red-500 hover:text-red-600 hover:bg-red-100 dark:hover:bg-red-900/20"};return p.jsx("button",{onClick:n,className:`p-2 rounded-lg ${o[s]}`,title:r,children:p.jsx(t1,{type:a})})},Yu=({isOpen:n,onClose:r,onConfirm:a,title:s,message:o,confirmText:u="",cancelText:c="",variant:d="default"})=>{const{t:m}=Bt();if(!n)return null;const A=d==="danger"?"bg-red-600 hover:bg-red-700 focus:ring-red-500":"bg-primary-600 hover:bg-primary-700 focus:ring-primary-500";return p.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 transition-opacity",onClick:r}),p.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:p.jsxs("div",{className:"relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl transition-all w-full max-w-lg",children:[p.jsxs("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:r,children:[p.jsx("span",{className:"sr-only",children:m("common.close")}),p.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]}),p.jsxs("div",{className:"sm:flex sm:items-start",children:[d==="danger"&&p.jsx("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 dark:bg-red-900 sm:mx-0 sm:h-10 sm:w-10",children:p.jsx("svg",{className:"h-6 w-6 text-red-600 dark:text-red-200",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),p.jsxs("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[p.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:s}),p.jsx("div",{className:"mt-2",children:p.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:o})})]})]}),p.jsxs("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[u&&p.jsx("button",{type:"button",className:`inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 sm:ml-3 sm:w-auto ${A}`,onClick:a,children:u}),c&&p.jsx("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white dark:bg-gray-700 px-3 py-2 text-sm font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 sm:mt-0 sm:w-auto",onClick:r,children:c})]})]})})]})};var r1=class{constructor(n){this.lowercaseChars="abcdefghijklmnopqrstuvwxyz",this.uppercaseChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.numberChars="0123456789",this.specialChars="!@#$%^&*()_+-=[]{}|;:,.<>?",this.ambiguousChars="Il1O0o",this.length=18,this.useLowercase=!0,this.useUppercase=!0,this.useNumbers=!0,this.useSpecial=!0,this.useNonAmbiguous=!1,n&&this.applySettings(n)}applySettings(n){return this.length=n.Length,this.useLowercase=n.UseLowercase,this.useUppercase=n.UseUppercase,this.useNumbers=n.UseNumbers,this.useSpecial=n.UseSpecialChars,this.useNonAmbiguous=n.UseNonAmbiguousChars,this}setLength(n){return this.length=n,this}useLowercaseLetters(n){return this.useLowercase=n,this}useUppercaseLetters(n){return this.useUppercase=n,this}useNumericCharacters(n){return this.useNumbers=n,this}useSpecialCharacters(n){return this.useSpecial=n,this}useNonAmbiguousCharacters(n){return this.useNonAmbiguous=n,this}getUnbiasedRandomIndex(n){const r=Math.floor(4294967296/n)*n;for(;;){const a=new Uint32Array(1);crypto.getRandomValues(a);const s=a[0];if(s<r)return s%n}}generateRandomPassword(){const n=this.buildCharacterSet();let r=this.generateInitialPassword(n);return r=this.ensureRequirements(r),r}buildCharacterSet(){let n="";return this.useLowercase&&(n+=this.lowercaseChars),this.useUppercase&&(n+=this.uppercaseChars),this.useNumbers&&(n+=this.numberChars),this.useSpecial&&(n+=this.specialChars),n.length===0&&(n=this.lowercaseChars),this.useNonAmbiguous&&(n=this.removeAmbiguousCharacters(n)),n}removeAmbiguousCharacters(n){for(const r of this.ambiguousChars)n=n.replace(r,"");return n}generateInitialPassword(n){let r="";for(let a=0;a<this.length;a++)r+=n[this.getUnbiasedRandomIndex(n.length)];return r}ensureRequirements(n){return this.useLowercase&&!/[a-z]/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.lowercaseChars,!0))),this.useUppercase&&!/[A-Z]/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.uppercaseChars,!0))),this.useNumbers&&!/\d/.exec(n)&&(n=this.addCharacterFromSet(n,this.getSafeCharacterSet(this.numberChars,!1))),this.useSpecial&&!/[!@#$%^&*()_+\-=[\]{}|;:,.<>?]/.exec(n)&&(n=this.addCharacterFromSet(n,this.specialChars)),n}getSafeCharacterSet(n,r){if(!this.useNonAmbiguous)return n;let a=n;for(const s of this.ambiguousChars){if(!r&&!/\d/.test(s))continue;let o=s;r&&(n===this.lowercaseChars?o=s.toLowerCase():o=s.toUpperCase()),a=a.replace(o,"")}return a}addCharacterFromSet(n,r){const a=this.getUnbiasedRandomIndex(this.length),s=r[this.getUnbiasedRandomIndex(r.length)];return n.substring(0,a)+s+n.substring(a+1)}},Pu=n=>new r1(n);const n1=({isOpen:n,onClose:r,onSave:a,onSettingsChange:s,initialSettings:o})=>{const{t:u}=Bt(),[c,d]=M.useState(o),[m,A]=M.useState(""),b=M.useCallback(k=>{try{const N=Pu(k).generateRandomPassword();A(N)}catch(R){console.error("Error generating preview password:",R),A("")}},[]);M.useEffect(()=>{n&&(d({...o}),b({...o}))},[n,o,b]);const v=M.useCallback((k,R)=>{const N={...c,[k]:R};d(N),b(N),s==null||s(N)},[c,b,s]),B=M.useCallback(()=>{b(c)},[c,b]),T=M.useCallback(()=>{a(m),r()},[m,a,r]),Q=M.useCallback(()=>{r()},[r]);return n?p.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-60 transition-opacity",onClick:Q}),p.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:p.jsxs("div",{className:"relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl transition-all w-full max-w-lg",children:[p.jsx("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:Q,children:p.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),p.jsx("div",{className:"sm:flex sm:items-start",children:p.jsxs("div",{className:"w-full mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[p.jsx("h3",{className:"text-lg font-medium leading-6 text-gray-900 dark:text-white mb-4",children:u("credentials.changePasswordComplexity")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"mt-4",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("input",{type:"text",value:m,readOnly:!0,className:"flex-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white font-mono"}),p.jsx("button",{type:"button",onClick:B,className:"px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:u("credentials.generateNewPreview"),children:p.jsx("svg",{className:"w-4 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("button",{type:"button",onClick:()=>v("UseLowercase",!c.UseLowercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseLowercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeLowercase"),children:p.jsx("span",{className:"font-mono text-base",children:"a-z"})}),p.jsx("button",{type:"button",onClick:()=>v("UseUppercase",!c.UseUppercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseUppercase?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeUppercase"),children:p.jsx("span",{className:"font-mono text-base",children:"A-Z"})}),p.jsx("button",{type:"button",onClick:()=>v("UseNumbers",!c.UseNumbers),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseNumbers?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeNumbers"),children:p.jsx("span",{className:"font-mono text-base",children:"0-9"})}),p.jsx("button",{type:"button",onClick:()=>v("UseSpecialChars",!c.UseSpecialChars),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${c.UseSpecialChars?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"}`,title:u("credentials.includeSpecialChars"),children:p.jsx("span",{className:"font-mono text-base",children:"!@#"})})]}),p.jsxs("div",{className:"flex items-center",children:[p.jsx("input",{id:"use-non-ambiguous",type:"checkbox",checked:c.UseNonAmbiguousChars,onChange:k=>v("UseNonAmbiguousChars",k.target.checked),className:"h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded dark:bg-gray-700 dark:border-gray-600"}),p.jsx("label",{htmlFor:"use-non-ambiguous",className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:u("credentials.avoidAmbiguousChars")})]})]})]}),p.jsx("div",{className:"mt-5 sm:mt-6 sm:flex sm:flex-row-reverse",children:p.jsxs("button",{type:"button",className:"inline-flex w-full justify-center items-center gap-1 rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500 sm:ml-3 sm:w-auto",onClick:T,children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z"})}),u("common.use")]})})]})})]})})]}):null},a1=({id:n,label:r,value:a,onChange:s,placeholder:o,error:u,showPassword:c,onShowPasswordChange:d,initialSettings:m})=>{const{t:A}=Bt(),[b,v]=M.useState(!1),[B,T]=M.useState(!1),[Q,k]=M.useState(m),R=c!==void 0?c:b,N=M.useCallback(J=>{c!==void 0?d==null||d(J):v(J)},[c,d]);M.useEffect(()=>{k({...m})},[]);const O=M.useCallback(J=>{try{const $=Pu(J).generateRandomPassword();s($),N(!0)}catch(P){console.error("Error generating password:",P)}},[s,N]),_=M.useCallback(J=>{const P=parseInt(J.target.value,10),$={...Q,Length:P};k($),O($)},[Q,O]),q=M.useCallback(()=>{O(Q)},[O,Q]),V=M.useCallback(J=>{s(J),N(!0)},[s,N]),ae=M.useCallback(J=>{k(J)},[]),ge=M.useCallback(()=>{N(!R)},[R,N]),te=M.useCallback(()=>{T(!0)},[]);return p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{htmlFor:n,className:"block text-sm font-medium text-gray-900 dark:text-white",children:r}),p.jsxs("div",{className:"flex",children:[p.jsx("div",{className:"relative flex-grow",children:p.jsx("input",{type:R?"text":"password",id:n,value:a,onChange:J=>s(J.target.value),placeholder:o,className:"outline-0 shadow-sm border border-gray-300 bg-gray-50 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),p.jsxs("div",{className:"flex",children:[p.jsx("button",{type:"button",onClick:ge,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:A(R?"common.hidePassword":"common.showPassword"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:R?p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}):p.jsxs(p.Fragment,{children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})}),p.jsx("button",{type:"button",onClick:q,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:A("credentials.generateRandomPassword"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),p.jsxs("div",{className:"pt-2",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("label",{htmlFor:`${n}-length`,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:A("credentials.passwordLength")}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:Q.Length}),p.jsx("button",{type:"button",onClick:te,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",title:A("credentials.changePasswordComplexity"),children:p.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]})]}),p.jsx("input",{type:"range",id:`${n}-length`,min:"8",max:"64",value:Q.Length,onChange:_,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),u&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u}),p.jsx(n1,{isOpen:B,onClose:()=>T(!1),onSave:V,onSettingsChange:ae,initialSettings:Q})]})},i1=({id:n,label:r,value:a,onChange:s,placeholder:o,error:u,onRegenerate:c})=>{const{t:d}=Bt(),m=M.useCallback(b=>{s(b.target.value)},[s]),A=M.useCallback(()=>{c()},[c]);return p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{htmlFor:n,className:"block text-sm font-medium text-gray-900 dark:text-white",children:r}),p.jsxs("div",{className:"flex",children:[p.jsx("div",{className:"relative flex-grow",children:p.jsx("input",{type:"text",id:n,value:a,onChange:m,placeholder:o,className:"outline-0 shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-l-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white"})}),p.jsx("div",{className:"flex",children:p.jsx("button",{type:"button",onClick:A,className:"px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800",title:d("credentials.generateRandomUsername"),children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})})]}),u&&p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u})]})};class s1{constructor(r){this.authContextLogout=r}async getBaseUrl(){return(await this.getApiUrl()).replace(/\/$/,"")+"/v1/"}async isSelfHosted(){return await this.getApiUrl()!==cr.DEFAULT_API_URL}async authFetch(r,a={},s=!0,o=!0){const u=new Headers(a.headers??{}),c=await this.getAccessToken();c&&u.set("Authorization",`Bearer ${c}`);const d={...a,headers:u};try{const m=await this.rawFetch(r,d);if(m.status===401){const A=await this.refreshAccessToken();if(A){u.set("Authorization",`Bearer ${A}`);const b=await this.rawFetch(r,{...d,headers:u});if(!b.ok)throw new Error("Request failed after token refresh");return s?b.json():b}else throw this.authContextLogout(null),new Error("Session expired")}if(!m.ok&&o)throw new Error(`HTTP error! status: ${m.status}`);return s?m.json():m}catch(m){throw console.error("API request failed:",m),m}}async rawFetch(r,a={}){const o=await this.getBaseUrl()+r,u=new Headers(a.headers??{});u.set("X-AliasVault-Client",`${cr.CLIENT_NAME}-${cr.VERSION}`);const c={...a,headers:u};try{return await fetch(o,c)}catch(d){throw console.error("API request failed:",d),d}}async refreshAccessToken(){const r=await this.getRefreshToken();if(!r)return null;try{const a=await this.rawFetch("Auth/refresh",{method:"POST",headers:{"Content-Type":"application/json","X-Ignore-Failure":"true"},body:JSON.stringify({token:await this.getAccessToken(),refreshToken:r})});if(!a.ok)throw new Error("Failed to refresh token");const s=await a.json();return this.updateTokens(s.token,s.refreshToken),s.token}catch{return this.authContextLogout("Your session has expired. Please login again."),null}}async get(r){return this.authFetch(r,{method:"GET"})}async downloadBlob(r){try{const s=await(await this.authFetch(r,{method:"GET",headers:{Accept:"application/octet-stream"}},!1)).arrayBuffer();return new Uint8Array(s)}catch(a){throw console.error("Error downloading blob:",a),a}}async post(r,a,s=!0){return this.authFetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},s)}async put(r,a){return this.authFetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}async delete(r){return this.authFetch(r,{method:"DELETE"},!1)}async logout(r=null){try{const a=await this.getRefreshToken();a&&await this.post("Auth/revoke",{token:await this.getAccessToken(),refreshToken:a},!1)}catch(a){console.error("WebApi logout error:",a)}this.authContextLogout(r)}async getStatus(){try{return await this.get("Auth/status")}catch{return{clientVersionSupported:!0,serverVersion:"0.0.0",vaultRevision:0}}}validateStatusResponse(r){return r.serverVersion==="0.0.0"?"errors.serverNotAvailable":r.clientVersionSupported?cr.isServerVersionSupported(r.serverVersion)?null:"errors.serverVersionNotSupported":"errors.clientVersionNotSupported"}validateVaultResponse(r,a){var s;return r.status===1?a("errors.VaultMergeRequired"):r.status===2?a("errors.VaultOutdated"):(s=r.vault)!=null&&s.blob?null:a("errors.NoVaultFound")}async getAccessToken(){return await Xe.getItem("local:accessToken")??null}async getRefreshToken(){return await Xe.getItem("local:refreshToken")??null}async updateTokens(r,a){await Xe.setItem("local:accessToken",r),await Xe.setItem("local:refreshToken",a)}async getApiUrl(){const r=await Xe.getItem("local:apiUrl");return!r||r.length===0?cr.DEFAULT_API_URL:r}}const Qy=M.createContext(null),l1=({children:n})=>{const{logout:r}=Yn(),[a,s]=M.useState(null);return M.useEffect(()=>{const o=new s1(u=>{u?r(u):r()});s(o)},[r]),a?p.jsx(Qy.Provider,{value:a,children:n}):null},da=()=>{const n=M.useContext(Qy);if(!n)throw new Error("useWebApi must be used within a WebApiProvider");return n},_f=async(n,r,a=!0)=>{if(!a)return n();const s=Date.now(),o=await n(),u=Date.now()-s;return u<r&&await new Promise(c=>setTimeout(c,r-u)),o},rc=()=>{const{t:n}=Bt(),r=Yn(),a=Lr(),s=da();return{syncVault:M.useCallback(async(u={})=>{const{initialSync:c=!1,onSuccess:d,onError:m,onStatus:A,_onOffline:b,onUpgradeRequired:v}=u,B=c;try{const{isLoggedIn:T}=await r.initializeAuth();if(!T)return!1;A==null||A(n("common.checkingVaultUpdates"));const Q=await _f(()=>s.getStatus(),300,B);Q.serverVersion;const k=s.validateStatusResponse(Q);if(k)return m==null||m(n("common.errors."+k)),!1;const R=await a.getVaultMetadata(),N=(R==null?void 0:R.vaultRevisionNumber)??0;if(Q.vaultRevision>N){A==null||A(n("common.syncingUpdatedVault"));const O=await _f(()=>s.get("Vault"),1e3,B),_=s.validateVaultResponse(O,n);if(_)return(_.includes("authentication")||_.includes("unauthorized"))&&(await s.logout(_),m==null||m(_)),!1;try{const q=await Dn("GET_DERIVED_KEY",{},"background");return await(await a.initializeDatabase(O,q)).hasPendingMigrations()?(v==null||v(),!1):(d==null||d(!0),!0)}catch(q){if(q instanceof Error&&q.message.includes("This browser extension is outdated"))return await s.logout(q.message),m==null||m(q.message),!1;throw new Error("Vault could not be decrypted, if the problem persists please logout and login again.")}}return await a.hasPendingMigrations()?(v==null||v(),!1):(await _f(()=>Promise.resolve(d==null?void 0:d(!1)),300,B),!1)}catch(T){const Q=T instanceof Error?T.message:"Unknown error during vault sync";return console.error("Vault sync error:",T),Q.includes("This browser extension is outdated")?(await s.logout(Q),m==null||m(Q),!1):(m==null||m(Q),!1)}},[r,a,s,n])}};function Dy(){const{t:n}=Bt(),[r,a]=M.useState(!1),[s,o]=M.useState(n("common.syncingVault")),u=Lr(),{syncVault:c}=rc(),d=M.useCallback(async(A,b)=>{var v,B;o(n("common.savingChangesToVault")),await A(),o(n("common.uploadingVaultToServer"));try{const T=u.sqliteClient.exportToBase64(),Q=await Dn("GET_DERIVED_KEY",{},"background"),R={vaultBlob:await Yt.symmetricEncrypt(T,Q)},N=await Dn("UPLOAD_VAULT",R,"background");if(N.status===0&&N.newRevisionNumber)await u.setCurrentVaultRevisionNumber(N.newRevisionNumber),(v=b.onSuccess)==null||v.call(b);else throw N.status===1?new Error("Vault merge required. Please login via the web app to merge the multiple pending updates to your vault."):N.status===2?new Error("Your vault is outdated. Please login on the AliasVault website and follow the steps."):new Error("Failed to upload vault to server. Please try again by re-opening the app.")}catch(T){if(T instanceof Error&&(T.message.includes("network")||T.message.includes("timeout"))){(B=b.onError)==null||B.call(b,new Error("Network error"));return}throw T}},[u,n]);return{executeVaultMutation:M.useCallback(async(A,b={})=>{var v;try{if(a(!0),o(n("common.checkingVaultUpdates")),b.skipSyncCheck){o(n("common.executingOperation")),await d(A,b);return}await c({onStatus:B=>o(B),onSuccess:async B=>{await d(A,b)},onError:B=>{var T;(T=b.onError)==null||T.call(b,new Error(B))}})}catch(B){console.error("Error during vault mutation:",B),(v=b.onError)==null||v.call(b,B instanceof Error?B:new Error("Unknown error"))}finally{a(!1),o("")}},[c,d,n]),isLoading:r,syncStatus:s}}var Ry=(n=>(n.Male="Male",n.Female="Female",n.Other="Other",n))(Ry||{}),TA=class Ra{constructor(){this.symbols=[".","-"]}generateUsername(r){let a=this.generateEmailPrefix(r);return a=a.replace(/[^a-zA-Z0-9]/g,""),a.length<Ra.MIN_LENGTH?a+=this.generateRandomString(Ra.MIN_LENGTH-a.length):a.length>Ra.MAX_LENGTH&&(a=a.substring(0,Ra.MAX_LENGTH)),a}generateEmailPrefix(r){const a=[];switch(typeof r.birthDate=="string"&&(r.birthDate=new Date(r.birthDate)),this.getSecureRandom(4)){case 0:a.push(r.firstName.substring(0,1).toLowerCase()+r.lastName.toLowerCase());break;case 1:a.push((r.firstName+r.lastName).toLowerCase());break;case 2:a.push(r.firstName.toLowerCase()+r.lastName.substring(0,1).toLowerCase());break;case 3:a.push(r.firstName.substring(0,Math.min(3,r.firstName.length)).toLowerCase()+r.lastName.toLowerCase());break}switch(this.getSecureRandom(2)){case 0:a.push(r.birthDate.getFullYear().toString());break;case 1:a.push(r.birthDate.getFullYear().toString().substring(2));break}let s=a.join(this.getRandomSymbol());if(this.getSecureRandom(2)===0){const o=this.getSecureRandom(s.length);s=s.slice(0,o)+this.getRandomSymbol()+s.slice(o)}return s=this.sanitizeEmailPrefix(s),s.length<Ra.MIN_LENGTH?s+=this.generateRandomString(Ra.MIN_LENGTH-s.length):s.length>Ra.MAX_LENGTH&&(s=s.substring(0,Ra.MAX_LENGTH)),s}sanitizeEmailPrefix(r){let a=r.replace(/[^a-zA-Z0-9._-]/g,"");return a=a.replace(/[-_.]{2,}/g,s=>s[0]),a=a.replace(/^[-._]+/,""),a=a.replace(/[-._]*$/,""),a}getRandomSymbol(){return this.getSecureRandom(3)===0?this.symbols[this.getSecureRandom(this.symbols.length)]:""}generateRandomString(r){const a="abcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:r},()=>a.charAt(this.getSecureRandom(a.length))).join("")}getSecureRandom(r){const a=new Uint32Array(1);return crypto.getRandomValues(a),a[0]%r}};TA.MIN_LENGTH=6;TA.MAX_LENGTH=20;var ky=TA,Ly=class{constructor(){this.firstNamesMale=[],this.firstNamesFemale=[],this.lastNames=[],this.random=Math.random,this.firstNamesMale=this.getFirstNamesMaleJson(),this.firstNamesFemale=this.getFirstNamesFemaleJson(),this.lastNames=this.getLastNamesJson()}generateRandomDateOfBirth(){const n=new Date,r=21,a=65,s=new Date(n.getFullYear()-a,n.getMonth(),n.getDate()),o=new Date(n.getFullYear()-r,n.getMonth(),n.getDate()),u=s.getTime()+this.random()*(o.getTime()-s.getTime());return new Date(u)}generateRandomIdentity(n){const r={firstName:"",lastName:"",gender:"Male",birthDate:new Date,emailPrefix:"",nickName:""};let a;if(n==="random"||n===void 0?a=this.random()<.5?"Male":"Female":n==="male"?a="Male":n==="female"?a="Female":a="Male",r.gender=a,a==="Male")r.firstName=this.firstNamesMale[Math.floor(this.random()*this.firstNamesMale.length)];else if(a==="Female")r.firstName=this.firstNamesFemale[Math.floor(this.random()*this.firstNamesFemale.length)];else{const o=this.random()<.5;r.firstName=o?this.firstNamesMale[Math.floor(this.random()*this.firstNamesMale.length)]:this.firstNamesFemale[Math.floor(this.random()*this.firstNamesFemale.length)]}r.lastName=this.lastNames[Math.floor(this.random()*this.lastNames.length)],r.birthDate=this.generateRandomDateOfBirth();const s=new ky;return r.emailPrefix=s.generateEmailPrefix(r),r.nickName=s.generateUsername(r),r}},o1=["Aaron","Adam","Adrian","Aidan","Aiden","Alan","Albert","Alex","Alexander","Alfred","Amir","Andrew","Anthony","Antonio","Archer","Arthur","Asher","Austin","Axel","Barry","Beau","Beckett","Benjamin","Bennett","Bernard","Blake","Braden","Bradley","Brady","Brandon","Braxton","Brayden","Brendan","Brett","Brian","Bruce","Bryan","Bryce","Bryson","Caden","Caleb","Calvin","Camden","Cameron","Carlos","Carson","Carter","Casey","Cecil","Charles","Chase","Chester","Christian","Christopher","Clarence","Claude","Clifford","Clyde","Cody","Cole","Colin","Collin","Colton","Connor","Cooper","Corey","Craig","Curtis","Dakota","Dale","Dalton","Damian","Dan","Daniel","Darrell","Daryl","David","Dawson","Dean","Declan","Dennis","Derek","Devin","Dominic","Dominick","Don","Douglas","Dustin","Dylan","Earl","Easton","Edgar","Edmund","Edward","Edwin","Eli","Elias","Elijah","Elliot","Elliott","Emilio","Emmett","Eric","Ethan","Eugene","Evan","Everett","Felix","Ferdinand","Floyd","Forrest","Francis","Franklin","Frederick","Gabriel","Gael","Garrett","Gary","Gavin","George","Gerald","Gilbert","Glen","Gordon","Graham","Grant","Grayson","Gregory","Greyson","Harold","Harrison","Harvey","Hayden","Henry","Herman","Howard","Hudson","Hugh","Hugo","Hunter","Ian","Irving","Isaac","Isaiah","Ivan","Jace","Jack","Jackson","Jacob","Jaden","James","Jared","Jason","Jasper","Jayden","Jeffrey","Jeremiah","Jeremy","Jerome","Jesse","Jesus","Joel","John","Jonathan","Jordan","Jorge","Jose","Joseph","Joshua","Josiah","Juan","Justin","Kai","Kayden","Keith","Kenneth","Kevin","Kingston","Knox","Kyle","Landon","Lawrence","Leo","Leon","Leonard","Leonardo","Leslie","Levi","Liam","Lincoln","Lloyd","Logan","Luca","Lucas","Luis","Luke","Maddox","Malachi","Malcolm","Marcus","Mark","Martin","Marvin","Mason","Mateo","Matthew","Maurice","Max","Maxwell","Micah","Michael","Miguel","Miles","Milton","Mitchell","Morris","Nathan","Nathaniel","Neil","Nelson","Nicholas","Noah","Nolan","Norman","Oliver","Oscar","Owen","Parker","Patrick","Paul","Perry","Peter","Philip","Phillip","Preston","Ralph","Randy","Ray","Raymond","Rhett","Richard","Riley","Robert","Roderick","Rodney","Roger","Roland","Roman","Ronald","Ross","Roy","Russell","Ryan","Ryder","Ryker","Samuel","Sawyer","Scott","Sean","Sebastian","Seth","Shane","Shawn","Silas","Simon","Spencer","Stanley","Stephen","Steven","Stuart","Tanner","Terrence","Theodore","Thomas","Timothy","Travis","Trevor","Tristan","Tyler","Vernon","Victor","Vincent","Wade","Wallace","Walter","Warren","Wayne","Wendell","Wesley","Weston","William","Winston","Wyatt","Xavier","Zachariah","Zachary","Zane"],u1=["Aaliyah","Abigail","Ada","Adalyn","Adalynn","Addison","Adeline","Adriana","Alexa","Alexandra","Alice","Alina","Allison","Alyssa","Amara","Amaya","Amelia","Anastasia","Andrea","Anna","Annabelle","Aria","Ariana","Arianna","Arielle","Arya","Ashley","Aspen","Athena","Aubree","Aubrey","Audrey","Aurora","Autumn","Ava","Avery","Ayla","Bailey","Beatrice","Bella","Bianca","Blair","Brianna","Brielle","Brooklyn","Brynn","Calliope","Camila","Camille","Carmen","Caroline","Cassidy","Catalina","Cecilia","Celeste","Charlie","Charlotte","Chloe","Claire","Clara","Cora","Coraline","Dahlia","Daisy","Dakota","Daphne","Dawn","Delilah","Diana","Eden","Eleanor","Elena","Eliana","Elise","Eliza","Elizabeth","Ella","Ellie","Eloise","Ember","Emerson","Emersyn","Emery","Emilia","Emily","Emma","Esme","Esther","Eva","Evangeline","Evelyn","Everly","Faith","Fiona","Flora","Florence","Francesca","Freya","Gabriella","Gemma","Genesis","Georgia","Gianna","Giselle","Grace","Gwendolyn","Hadley","Hailey","Hannah","Harlow","Harmony","Harper","Haven","Hazel","Heidi","Helena","Holly","Hope","Imogen","India","Indie","Iris","Isabel","Isabella","Isabelle","Isla","Ivy","Jade","Jasmine","Jessie","Jocelyn","Josephine","Josie","Julia","Juliana","Juliet","June","Juniper","Kaia","Katherine","Kayla","Kaylee","Keira","Kennedy","Khloe","Kinsley","Kylie","Lara","Laura","Laurel","Layla","Leah","Leilani","Lena","Liliana","Lillian","Lily","Lola","Lorelei","Lucia","Lucy","Luna","Lydia","Lyla","Mabel","Mackenzie","Madeline","Madelyn","Madison","Maeve","Magnolia","Maisie","Malia","Margaret","Margot","Maria","Marina","Marlowe","Mary","Matilda","Maya","Melanie","Melody","Mia","Mira","Miranda","Morgan","Nadia","Naomi","Natalia","Natalie","Nell","Nevaeh","Nina","Noelle","Nora","Norah","Nova","Octavia","Odette","Olive","Olivia","Opal","Ophelia","Paisley","Pearl","Penelope","Peyton","Phoebe","Phoenix","Piper","Poppy","Primrose","Quinn","Raelynn","Ramona","Raven","Reagan","Reese","Riley","River","Robin","Rosalie","Rose","Rosemary","Rowan","Ruby","Ruth","Rylee","Ryleigh","Sabrina","Sadie","Sage","Salem","Samantha","Sarah","Sasha","Savannah","Scarlett","Selena","Serena","Serenity","Sienna","Sierra","Simone","Skye","Skylar","Sloane","Sofia","Sophia","Sophie","Stella","Summer","Sylvia","Sylvie","Talia","Taylor","Tessa","Thea","Thora","Valentina","Valeria","Vera","Victoria","Violet","Vivian","Vivienne","Willa","Willow","Winnie","Winter","Wren","Ximena","Yara","Zara","Zoe","Zoey"],c1=["Abbott","Adams","Aguilar","Alexander","Allen","Alvarez","Anderson","Atkins","Bailey","Baker","Baldwin","Ballard","Barber","Barker","Barnes","Barrett","Bauer","Baxter","Beard","Bell","Bennett","Benson","Black","Blackwood","Blake","Blanchard","Booth","Bowman","Bradley","Briggs","Brooks","Brown","Bryant","Buckley","Burke","Burns","Butler","Byrd","Cain","Campbell","Cannon","Carlson","Carter","Castillo","Castro","Chandler","Chapman","Chavez","Chen","Clark","Clarke","Cobb","Cole","Coleman","Collier","Collins","Conrad","Cook","Cooke","Cooper","Cox","Craig","Crawford","Cross","Cruz","Cunningham","Dalton","Daniel","Davenport","Davis","Dawson","Dempsey","Dennis","Diaz","Dickerson","Dillon","Dixon","Doyle","Duran","Dyer","Edwards","Ellis","Erickson","Evans","Ewing","Farley","Farr","Farrell","Fernandez","Ferris","Fisher","Fitzgerald","Fleming","Fletcher","Flores","Foley","Ford","Foster","Fowler","Frazier","Freeman","Frost","Fuller","Gallagher","Garcia","Gardner","Garner","Garrett","Gates","Gibbs","Gibson","Gill","Glover","Goldberg","Gomez","Gonzales","Gonzalez","Goodman","Goodwin","Gordon","Graham","Graves","Gray","Green","Griffin","Griffith","Gross","Gutierrez","Guzman","Hale","Hall","Hamilton","Hancock","Harmon","Harris","Harrison","Hawkins","Hayes","Hayward","Henderson","Hendricks","Henry","Hensley","Hernandez","Herrera","Hicks","Hill","Hodges","Holland","Holmes","Holt","Hoover","Howard","Hudson","Huffman","Hughes","Humphrey","Hunter","Hutchinson","Isaac","Jackson","Jacobson","James","Jarvis","Jenkins","Jimenez","Johnson","Jones","Jordan","Keller","Kelly","Kennedy","Kent","Kerr","Kim","King","Kirby","Knowles","Koch","Landry","Lang","Lawson","Lee","Levy","Lewis","Livingston","Logan","Long","Lopez","Lowery","Lowry","Lucas","Luna","Malone","Manning","Marsh","Marshall","Martin","Martinez","Mason","May","McBride","McCoy","McDonald","McKinney","Mccarthy","Mcguire","Mckay","Mckenzie","Meadows","Medina","Mendez","Mendoza","Middleton","Miller","Miranda","Mitchell","Moody","Moore","Morales","Moreno","Morgan","Morris","Morse","Murphy","Murray","Myers","Nash","Neal","Nelson","Nguyen","Nichols","Nielsen","Nixon","Norton","Olson","Orr","Ortiz","Owens","Palmer","Parker","Parsons","Patel","Patterson","Payne","Pearce","Pearson","Perez","Perry","Peterson","Phillips","Pickett","Pollard","Porter","Potter","Powell","Pratt","Preston","Price","Ramirez","Ramos","Randall","Ray","Reed","Reyes","Reynolds","Richardson","Riddle","Riley","Rivera","Roach","Robbins","Roberts","Robinson","Rodriguez","Rogers","Romero","Ross","Rowe","Ruiz","Russell","Salinas","Sanchez","Sanders","Santana","Savage","Sawyer","Schmidt","Schultz","Scott","Sellers","Shannon","Sharp","Shaw","Shepherd","Shields","Short","Silva","Simmons","Simpson","Skinner","Sloan","Smith","Snyder","Sparks","Spears","Stanley","Stark","Steele","Stephenson","Stevens","Stewart","Stokes","Sullivan","Sutton","Swanson","Tanner","Tate","Taylor","Thomas","Thompson","Thornton","Torres","Tran","Travis","Tucker","Turner","Tyler","Underwood","Vargas","Vasquez","Vincent","Wagner","Walker","Wallace","Walters","Walton","Ward","Washington","Watkins","Watson","Weaver","Webb","Weeks","Welch","Wells","West","Whitaker","White","Wilcox","Wilkinson","Williams","Willis","Wilson","Winters","Wise","Wolfe","Wood","Woods","Woodward","Wright","Wyatt","Yates","York","Young","Zamora","Zimmerman"],d1=class extends Ly{getFirstNamesMaleJson(){return o1}getFirstNamesFemaleJson(){return u1}getLastNamesJson(){return c1}},f1=["Daan","Luuk","Sem","Finn","Milan","Levi","Noah","Lucas","Jesse","Thijs","Jayden","Bram","Lars","Ruben","Thomas","Tim","Sam","Liam","Julian","Mees","Ties","Sven","Max","Gijs","David","Stijn","Jasper","Niels","Jens","Timo","Cas","Joep","Roan","Tom","Tygo","Teun","Siem","Mats","Thijmen","Rens","Niek","Tobias","Dex","Hugo","Robin","Nick","Floris","Pepijn","Boaz","Olivier","Luca","Jurre","Jelle","Guus","Koen","Bart","Olaf","Wessel","Daniël","Job","Sander","Tijmen","Kai","Quinten","Owen","Morris","Fedde","Joris","Jesper","Mick","Ryan","Milo","Stan","Benjamin","Melle","Jip","Dylan","Brent","Mick","Dean","Otis","Abel","Luc","Sepp","Vince","Rayan","Noud","Hidde","Fabian","Jort","Damian","Boris","Sil","Moos","Aiden","Sep","Mika","Mijs","Mika","Felix","Merlijn","Alexander","Aron","Arthur","Axel","Bas","Bastiaan","Berend","Björn","Casper","Cees","Chris","Christian","Christiaan","Colin","Cornelis","Dani","Dennis","Dirk","Dominic","Eduard","Eelco","Erik","Erwin","Ezra","Faas","Filip","Florian","Frank","Frederik","Freek","Gerard","Gerrit","Giel","Gijs","Glenn","Govert","Harm","Harold","Hendrik","Henrik","Huub","Ian","Ivo","Jacob","Jake","Jan","Jarno","Jason","Jeffrey","Jeremy","Jim","Jimmy","Johan","Johannes","Jonas","Jonathan","Jos","Joshua","Justin","Kay","Kevin","Kjeld","Klaas","Lennard","Lennart","Leon","Lex","Liam","Loek","Lorenzo","Louis","Lowie","Maarten","Magnus","Maikel","Marc","Marcel","Marco","Martijn","Mathias","Matthijs","Maurits","Menno","Michiel","Nathan","Nico","Oscar","Pascal","Patrick","Paul","Peter","Philip","Pieter","Pim","Quincy","Remco","Rick","Rik","Robert","Rogier","Rowan","Ruud","Simon","Stefan","Steven","Thom","Victor","Vincent","Willem","Wouter","Yannick"],A1=["Emma","Sophie","Julia","Mila","Tess","Sara","Anna","Noor","Lotte","Liv","Eva","Nora","Zoë","Evi","Yara","Saar","Nina","Fenna","Lieke","Fleur","Isa","Roos","Lynn","Sofie","Sarah","Milou","Olivia","Maud","Lisa","Vera","Luna","Lina","Noa","Feline","Loïs","Lena","Floor","Charlotte","Esmee","Julie","Iris","Lara","Amber","Hailey","Mia","Lize","Isabelle","Cato","Fenne","Sanne","Norah","Sophia","Ella","Nova","Elin","Femke","Lizzy","Linde","Lauren","Rosalie","Lana","Emily","Elise","Esmée","Anne","Isabelle","Demi","Hannah","Liva","Suze","Fay","Isabel","Benthe","Evi","Amy","Jasmijn","Niene","Sterre","Fenna","Fiene","Liz","Ise","Mara","Nienke","Indy","Romy","Lola","Puck","Nora","Merel","Bente","Eline","Lily","Leah","Naomi","Mirthe","Valerie","Noor","Liva","Jade","Juul","Lise","Myrthe","Veerle","Aafke","Alicia","Amira","Aniek","Annabel","Annelies","Anouk","Astrid","Babette","Bianca","Britt","Carlijn","Chantal","Claire","Dagmar","Danique","Daphne","Denise","Dominique","Doris","Eefje","Elena","Eline","Elisa","Elisabeth","Ellen","Esther","Eveline","Fabienne","Felice","Fleur","Frederique","Gwen","Hanna","Heleen","Helena","Ilona","Imke","Inge","Irene","Iris","Janna","Janneke","Jasmine","Jennifer","Jessica","Joelle","Judith","Julia","Karin","Karlijn","Kim","Kirsten","Kyra","Laura","Lena","Lianne","Liesbeth","Linda","Lisanne","Lisette","Louise","Maartje","Manon","Margot","Marieke","Marijke","Marlies","Marloes","Marthe","Melissa","Michelle","Nadine","Natalie","Nicole","Nina","Noortje","Paulien","Petra","Rachel","Renee","Robin","Rosa","Roxanne","Sabine","Sandra","Saskia","Silke","Simone","Suzanne","Sylvie","Tamara","Tanja","Tara","Thea","Thirza","Tina","Tineke","Ursula","Victoria","Wendy","Wilma","Xandra","Yasmin","Yvette","Yvonne","Zara"],h1=["de Jong","Jansen","de Vries","van den Berg","van Dijk","Bakker","Janssen","Visser","Smit","Meijer","de Boer","Mulder","de Groot","Bos","Vos","Peters","Hendriks","van Leeuwen","Dekker","Brouwer","de Wit","Dijkstra","Smits","de Graaf","van der Meer","van der Linden","Kok","Jacobs","de Haan","Vermeulen","van den Heuvel","van der Veen","van den Broek","de Bruijn","de Bruin","van der Heijden","Schouten","van Beek","Willems","van Vliet","van de Ven","Hoekstra","Maas","Verhoeven","Koster","van Dam","van der Wal","Prins","Blom","Huisman","Peeters","Kuipers","van Veen","van Dongen","Veenstra","Kramer","van den Bosch","van der Meulen","Mol","Zwart","van der Laan","Martens","van de Pol","Postma","Tromp","Borst","Boon","van Doorn","Jonker","van der Velden","Willemsen","van Wijk","Groen","Gerritsen","Bosch","van Loon","van der Ploeg","de Ruiter","Molenaar","Boer","Klein","de Koning","van de Kamp","van der Horst","Verbeek","Vink","Goossens","Scholten","Hartman","van Dalen","van Elst","Brink","Boekel","van de Berg","Berends","van der Hoek","Kuiper","Kooijman","de Lange","van der Sluis","van Gelder","Martens","van Asselt","Timmermans","van Vliet","van Rijn","van Schaik","Bosman","Wolters","van Hout","Hermans","van Rooij","de Vos","van Donselaar","Evers","van den Brink","Verkerk","Groeneveld","van Duijn","Schuurman","Hoogendoorn","van Zanten","Koopman","Cornelissen","van Driel","Teunissen","Versteeg","van Deursen","Schipper","van Kempen","Bouwman","van der Valk","Nijhuis","van der Werf","van den Akker","Verhoef","Wessels","van der Poel","Driessen","van Oosten","Lambrechts","van der Vlist","Hoogeveen","van Gils","Rietveld","Barendrecht","van der Spek","Stam","van der Linde","Boersma","van Dijk","Schepers","van der Kolk","Roelofs","van der Velden","van den Burg","Westra","van der Steen","Pronk","van der Veer","Rozendaal","van den Bos","Konings","van der Wiel","Noordam","van der Laan","Schut","van der Vlugt","Witteveen","van der Zwan","Boogaard","van der Waal","Stolk","van der Windt","Rutten","van der Zanden","Spaans","van der Zwaan","Roos","van der Zijl","Schoenmaker","van Diepen","Romeijn","van Doesburg","Schippers","van Eck","Rijken","van Egmond","Schrama","van Eijk","Ruijter","van Engelen","Sanders","van Es","Schenk","van Essen","van Gaal","van Geenen","van Gent","van Gestel","van Gool","van Grinsven","van Gurp","van Haaften","van Haren","van Hattem","van Hees"],g1=class extends Ly{getFirstNamesMaleJson(){return f1}getFirstNamesFemaleJson(){return A1}getLastNamesJson(){return h1}},$l=class{static normalizeBirthDateForDisplay(n){return!n||n.startsWith("0001-01-01")?"":n.split(/[T ]/)[0]}static normalizeBirthDateForDb(n){if(!n||n.trim()==="")return"0001-01-01T00:00:00.000Z";const r=n.trim().replace(" ","T"),a=r.match(/^(\d{4})-(\d{2})-(\d{2})[T ]?(\d{2}):?(\d{2}):?(\d{2})?$/);if(a){const[o,u,c,d,m="00",A="00",b="00"]=a;return`${u}-${c}-${d}T${m}:${A}:${b}.000Z`}const s=new Date(r);return isNaN(s.getTime())?"0001-01-01T00:00:00.000Z":s.toISOString()}static isValidBirthDate(n){if(!n||n.trim()===""||n.startsWith("0001-01-01"))return!1;const r=new Date(n);return isNaN(r.getTime())?!1:r.getFullYear()>1&&r.getFullYear()<9999}},m1=n=>{switch(n){case"en":return new d1;case"nl":return new g1}throw new Error(`Unsupported language: ${n}`)},p1=()=>new ky;const Pm=()=>{var ke,He,Ke,Ge,yt,We,Et,Kt,Nr,Lt,Ht,jt,br,Qe,Fe,nt,lt;const{t:n}=Bt(),{id:r}=pA(),a=kr(),s=Lr(),o=r!==void 0&&r.length>0,u=M.useMemo(()=>Gu().shape({Id:Yr(),ServiceName:Yr().required(n("credentials.validation.serviceNameRequired")),ServiceUrl:Yr().url(n("credentials.validation.invalidUrl")).nullable().optional(),Alias:Gu().shape({FirstName:Yr().nullable().optional(),LastName:Yr().nullable().optional(),NickName:Yr().nullable().optional(),BirthDate:Yr().nullable().optional().test("is-valid-date-format",n("credentials.validation.invalidDateFormat"),j=>j?/^\d{4}-\d{2}-\d{2}$/.test(j):!0),Gender:Yr().nullable().optional(),Email:Yr().email(n("credentials.validation.invalidEmail")).nullable().optional()}),Username:Yr().nullable().optional(),Password:Yr().nullable().optional(),Notes:Yr().nullable().optional()}),[n]),{executeVaultMutation:c,isLoading:d,syncStatus:m}=Dy(),[A,b]=M.useState("random"),{setHeaderButtons:v}=ca(),{setIsInitialLoading:B}=yn(),[T,Q]=M.useState(!0),[k,R]=M.useState(!o),[N,O]=M.useState(!1),[_,q]=M.useState([]),[V,ae]=M.useState([]),ge=da(),te=M.useRef(null),{handleSubmit:J,setValue:P,watch:$,formState:{errors:me}}=Jw({resolver:Ww(u),defaultValues:{Id:"",Username:"",Password:"",ServiceName:"",ServiceUrl:"",Notes:"",Alias:{FirstName:"",LastName:"",NickName:"",BirthDate:"",Gender:void 0,Email:""}}}),he=M.useCallback(async()=>{if(T)return;const j=$(),X={credentialId:r||null,mode:A,formValues:{...j,Logo:null}};await Dn("PERSIST_FORM_VALUES",JSON.stringify(X),"background")},[$,r,A,T]);M.useEffect(()=>{T||he()},[A,he,T]),M.useEffect(()=>{const j=$(()=>{he()});return()=>j.unsubscribe()},[$,he]);const Be=M.useCallback(async()=>{const j=await Dn("GET_PERSISTED_FORM_VALUES",null,"background");try{let X=null;try{j&&(X=JSON.parse(j))}catch(Re){console.error("Error parsing persisted data:",Re)}if(X==null){Q(!1);return}const Te=(X==null?void 0:X.credentialId)==r;X&&Te?(b(X.mode),Object.entries(X.formValues).forEach(([Re,xe])=>{P(Re,xe)})):console.error("Persisted values do not match current page")}catch(X){console.error("Error loading persisted data:",X)}Q(!1)},[P,r,b,Q]),pe=M.useCallback(async()=>{await Dn("CLEAR_PERSISTED_FORM_VALUES",null,"background")},[]);M.useEffect(()=>()=>{pe()},[pe]),M.useEffect(()=>{if(s!=null&&s.sqliteClient){if(!r){setTimeout(()=>{var j;(j=te.current)==null||j.focus()},100),B(!1),Be().then(()=>{if(!$("Password")){const j=s.sqliteClient.getPasswordSettings(),le=Pu(j).generateRandomPassword();P("Password",le)}});return}try{const j=s.sqliteClient.getCredentialById(r);if(j){j.Alias.BirthDate=$l.normalizeBirthDateForDisplay(j.Alias.BirthDate),Object.entries(j).forEach(([le,Te])=>{P(le,Te)});const X=s.sqliteClient.getAttachmentsForCredential(r);q(X),ae(X.map(le=>le.Id)),b("manual"),B(!1),Be()}else console.error("Credential not found"),a("/credentials")}catch(j){console.error("Error loading credential:",j),B(!1)}}},[s.sqliteClient,r,a,B,P,Be,$]);const K=M.useCallback(async()=>{r&&c(async()=>{s.sqliteClient.deleteCredentialById(r)},{onSuccess:()=>{pe(),a("/credentials")}})},[r,c,s.sqliteClient,a,pe]),ie=M.useCallback(async()=>{const j=s.sqliteClient.getDefaultIdentityLanguage(),X=m1(j),le=s.sqliteClient.getPasswordSettings(),Te=Pu(le);return{identityGenerator:X,passwordGenerator:Te}},[s.sqliteClient]),Ne=M.useCallback(async()=>{const{identityGenerator:j,passwordGenerator:X}=await ie(),le=s.sqliteClient.getDefaultIdentityGender(),Te=j.generateRandomIdentity(le),Re=X.generateRandomPassword(),xe=await s.getVaultMetadata(),Ve=(xe==null?void 0:xe.privateEmailDomains)??[],S=(xe==null?void 0:xe.publicEmailDomains)??[],E=s.sqliteClient.getDefaultEmailDomain(Ve,S),x=E?`${Te.emailPrefix}@${E}`:Te.emailPrefix;P("Alias.Email",x),P("Alias.FirstName",Te.firstName),P("Alias.LastName",Te.lastName),P("Alias.NickName",Te.nickName),P("Alias.Gender",Te.gender),P("Alias.BirthDate",$l.normalizeBirthDateForDisplay(Te.birthDate.toISOString())),o&&$("Username")||P("Username",Te.nickName),o&&$("Password")||P("Password",Re)},[o,$,P,ie,s]),_e=M.useCallback(()=>{Ne()},[Ne]),G=M.useCallback(async()=>{try{const j=p1();let X=Ry.Other;try{X=$("Alias.Gender")}catch{}const le={firstName:$("Alias.FirstName")??"",lastName:$("Alias.LastName")??"",nickName:$("Alias.NickName")??"",gender:X,birthDate:new Date($("Alias.BirthDate")??""),emailPrefix:$("Alias.Email")??""},Te=j.generateUsername(le);P("Username",Te)}catch(j){console.error("Error generating random username:",j)}},[P,$]),ne=M.useMemo(()=>{var j;return(j=s.sqliteClient)==null?void 0:j.getPasswordSettings()},[s.sqliteClient]),Ee=M.useCallback(async j=>{let X=j.Alias.BirthDate;if(X&&(X=$l.normalizeBirthDateForDb(X)),!o&&A==="random"&&(await Ne(),j.Username=$("Username"),j.Password=$("Password"),j.Alias.FirstName=$("Alias.FirstName"),j.Alias.LastName=$("Alias.LastName"),j.Alias.NickName=$("Alias.NickName"),j.Alias.BirthDate=X,j.Alias.Gender=$("Alias.Gender"),j.Alias.Email=$("Alias.Email")),j.ServiceUrl){Q(!0);try{const le=new Promise((xe,Ve)=>setTimeout(()=>Ve(new Error("Favicon extraction timed out")),5e3)),Te=ge.get("Favicon/Extract?url="+j.ServiceUrl),Re=await Promise.race([Te,le]);if(Re!=null&&Re.image){const xe=Uint8Array.from(Xi.Buffer.from(Re.image,"base64"));j.Logo=xe}}catch{}}c(async()=>{if(Q(!1),o)await s.sqliteClient.updateCredentialById(j,V,_);else{const le=await s.sqliteClient.createCredential(j,_);j.Id=le.toString()}},{onSuccess:()=>{pe(),o?a(-1):a(`/credentials/${j.Id}`,{replace:!0})}})},[o,s.sqliteClient,c,a,A,$,Ne,ge,pe,V,_]);return M.useEffect(()=>{const j=p.jsxs("div",{className:"flex items-center gap-2",children:[o&&p.jsx(an,{onClick:()=>O(!0),title:n("credentials.deleteCredential"),iconType:Kr.DELETE,variant:"danger"}),p.jsx(an,{onClick:J(Ee),title:n("credentials.saveCredential"),iconType:Kr.SAVE})]});return v(j),()=>{}},[v,J,Ee,o,n]),M.useEffect(()=>()=>v(null),[v]),o&&!$("ServiceName")?p.jsx("div",{children:n("common.loading")}):p.jsxs("form",{onSubmit:J(Ee),children:[p.jsx("button",{type:"submit",style:{display:"none"}}),(T||d)&&p.jsxs("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:[p.jsx(Ps,{}),p.jsx("div",{className:"text-sm text-gray-500 mt-2",children:m})]}),p.jsx(Yu,{isOpen:N,onClose:()=>O(!1),onConfirm:()=>{O(!1),K()},title:n("credentials.deleteCredentialTitle"),message:n("credentials.deleteCredentialConfirm"),confirmText:n("common.delete"),cancelText:n("common.cancel"),variant:"danger"}),!o&&p.jsxs("div",{className:"flex space-x-2 mb-4",children:[p.jsxs("button",{type:"button",onClick:()=>b("random"),className:`flex-1 py-2 px-4 rounded flex items-center justify-center gap-2 ${A==="random"?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:[p.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("circle",{cx:"8",cy:"8",r:"1"}),p.jsx("circle",{cx:"16",cy:"8",r:"1"}),p.jsx("circle",{cx:"12",cy:"12",r:"1"}),p.jsx("circle",{cx:"8",cy:"16",r:"1"}),p.jsx("circle",{cx:"16",cy:"16",r:"1"})]}),n("credentials.randomAlias")]}),p.jsxs("button",{type:"button",onClick:()=>b("manual"),className:`flex-1 py-2 px-4 rounded flex items-center justify-center gap-2 ${A==="manual"?"bg-primary-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:[p.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"12",cy:"7",r:"4"}),p.jsx("path",{d:"M5.5 20a6.5 6.5 0 0 1 13 0"})]}),n("credentials.manual")]})]}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.service")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx(aa,{id:"serviceName",label:n("credentials.serviceName"),ref:te,value:$("ServiceName")??"",onChange:j=>P("ServiceName",j),required:!0,error:(ke=me.ServiceName)==null?void 0:ke.message}),p.jsx(aa,{id:"serviceUrl",label:n("credentials.serviceUrl"),value:$("ServiceUrl")??"",onChange:j=>P("ServiceUrl",j),error:(He=me.ServiceUrl)==null?void 0:He.message})]})]}),(A==="manual"||o)&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.loginCredentials")}),p.jsxs("div",{className:"space-y-4",children:[p.jsx(aa,{id:"email",label:n("common.email"),value:$("Alias.Email")??"",onChange:j=>P("Alias.Email",j),error:(Ge=(Ke=me.Alias)==null?void 0:Ke.Email)==null?void 0:Ge.message}),p.jsx(i1,{id:"username",label:n("common.username"),value:$("Username")??"",onChange:j=>P("Username",j),error:(yt=me.Username)==null?void 0:yt.message,onRegenerate:G}),ne&&p.jsx(a1,{id:"password",label:n("common.password"),value:$("Password")??"",onChange:j=>P("Password",j),error:(We=me.Password)==null?void 0:We.message,showPassword:k,onShowPasswordChange:R,initialSettings:ne})]})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.alias")}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("button",{type:"button",onClick:_e,className:"w-full bg-primary-500 text-white py-2 px-4 rounded hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 flex items-center justify-center gap-2",children:[p.jsxs("svg",{className:"w-5 h-5 inline-block",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),p.jsx("circle",{cx:"8",cy:"8",r:"1"}),p.jsx("circle",{cx:"16",cy:"8",r:"1"}),p.jsx("circle",{cx:"12",cy:"12",r:"1"}),p.jsx("circle",{cx:"8",cy:"16",r:"1"}),p.jsx("circle",{cx:"16",cy:"16",r:"1"})]}),p.jsx("span",{children:n("credentials.generateRandomAlias")})]}),p.jsx(aa,{id:"firstName",label:n("credentials.firstName"),value:$("Alias.FirstName")??"",onChange:j=>P("Alias.FirstName",j),error:(Kt=(Et=me.Alias)==null?void 0:Et.FirstName)==null?void 0:Kt.message}),p.jsx(aa,{id:"lastName",label:n("credentials.lastName"),value:$("Alias.LastName")??"",onChange:j=>P("Alias.LastName",j),error:(Lt=(Nr=me.Alias)==null?void 0:Nr.LastName)==null?void 0:Lt.message}),p.jsx(aa,{id:"nickName",label:n("credentials.nickName"),value:$("Alias.NickName")??"",onChange:j=>P("Alias.NickName",j),error:(jt=(Ht=me.Alias)==null?void 0:Ht.NickName)==null?void 0:jt.message}),p.jsx(aa,{id:"gender",label:n("credentials.gender"),value:$("Alias.Gender")??"",onChange:j=>P("Alias.Gender",j),error:(Qe=(br=me.Alias)==null?void 0:br.Gender)==null?void 0:Qe.message}),p.jsx(aa,{id:"birthDate",label:n("credentials.birthDate"),placeholder:n("credentials.birthDatePlaceholder"),value:$("Alias.BirthDate")??"",onChange:j=>P("Alias.BirthDate",j),error:(nt=(Fe=me.Alias)==null?void 0:Fe.BirthDate)==null?void 0:nt.message})]})]}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("credentials.metadata")}),p.jsx("div",{className:"space-y-4",children:p.jsx(aa,{id:"notes",label:n("credentials.notes"),value:$("Notes")??"",onChange:j=>P("Notes",j),multiline:!0,rows:4,error:(lt=me.Notes)==null?void 0:lt.message})})]}),p.jsx(Zw,{attachments:_,onAttachmentsChange:q,originalAttachmentIds:V})]})]})]})};class y1{constructor(){Br(this,"currentCopiedId","");Br(this,"onCopyCallbacks",[])}setCopied(r){this.currentCopiedId=r,this.notifySubscribers()}getCopiedId(){return this.currentCopiedId}subscribe(r){return this.onCopyCallbacks.push(r),()=>{this.onCopyCallbacks=this.onCopyCallbacks.filter(a=>a!==r)}}notifySubscribers(){this.onCopyCallbacks.forEach(r=>r(this.currentCopiedId))}}const vu=new y1,Of=({name:n})=>{switch(n){case"visibility":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"copy":return p.jsxs(p.Fragment,{children:[p.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),p.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]});case"check":return p.jsx(p.Fragment,{children:p.jsx("polyline",{points:"20 6 9 17 4 12"})});default:return null}},bi=({id:n,label:r,value:a,type:s="text"})=>{const{t:o}=Bt(),[u,c]=M.useState(!1),[d,m]=M.useState(!1);M.useEffect(()=>{const b=vu.subscribe(v=>{m(v===n)});return()=>{b()}},[n]);const A=async()=>{try{await navigator.clipboard.writeText(a),vu.setCopied(n),setTimeout(()=>{vu.getCopiedId()===n&&vu.setCopied("")},2e3)}catch(b){console.error("Failed to copy text:",b)}};return p.jsxs("div",{children:[p.jsx("label",{htmlFor:n,className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:r}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:s==="password"&&!u?"password":"text",id:n,readOnly:!0,value:a,onClick:A,className:`w-full px-3 py-2.5 bg-white border ${d?"border-green-500 border-2":"border-gray-300"} text-gray-900 sm:text-sm rounded-lg shadow-sm focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:placeholder-gray-400`}),p.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[d?p.jsx("button",{type:"button",className:"p-1 text-green-500 dark:text-green-400 transition-colors duration-200",title:o("common.copied"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(Of,{name:"check"})})}):p.jsx("button",{type:"button",onClick:A,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:o("common.copyToClipboard"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(Of,{name:"copy"})})}),s==="password"&&p.jsx("button",{type:"button",onClick:()=>c(!u),className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:o(u?"common.hidePassword":"common.showPassword"),children:p.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx(Of,{name:u?"visibility-off":"visibility"})})})]})]})]})},E1=({credential:n})=>{var c,d,m,A,b,v,B,T,Q,k,R,N,O;const{t:r}=Bt(),a=!!((d=(c=n.Alias)==null?void 0:c.FirstName)!=null&&d.trim()),s=!!((A=(m=n.Alias)==null?void 0:m.LastName)!=null&&A.trim()),o=!!((v=(b=n.Alias)==null?void 0:b.NickName)!=null&&v.trim()),u=$l.isValidBirthDate((B=n.Alias)==null?void 0:B.BirthDate);return!a&&!s&&!o&&!u?null:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.alias")}),(a||s)&&p.jsx(bi,{id:"fullName",label:r("common.fullName"),value:[(T=n.Alias)==null?void 0:T.FirstName,(Q=n.Alias)==null?void 0:Q.LastName].filter(Boolean).join(" ")}),a&&p.jsx(bi,{id:"firstName",label:r("common.firstName"),value:((k=n.Alias)==null?void 0:k.FirstName)??""}),s&&p.jsx(bi,{id:"lastName",label:r("common.lastName"),value:((R=n.Alias)==null?void 0:R.LastName)??""}),u&&p.jsx(bi,{id:"birthDate",label:r("common.birthDate"),value:$l.normalizeBirthDateForDisplay((N=n.Alias)==null?void 0:N.BirthDate)}),o&&p.jsx(bi,{id:"nickName",label:r("common.nickname"),value:((O=n.Alias)==null?void 0:O.NickName)??""})]})},b1=({credentialId:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState(!0),c=Lr(),d=m=>{try{const A=m.Blob instanceof Uint8Array?m.Blob:new Uint8Array(m.Blob),b=new Blob([A]),v=URL.createObjectURL(b),B=document.createElement("a");B.href=v,B.download=m.Filename,document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(v)}catch(A){console.error("Error downloading attachment:",A)}};return M.useEffect(()=>{(async()=>{if(c!=null&&c.sqliteClient)try{const A=c.sqliteClient.getAttachmentsForCredential(n);s(A)}catch(A){console.error("Error loading attachments:",A)}finally{u(!1)}})()},[n,c==null?void 0:c.sqliteClient]),o?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:r("common.attachments")}),r("common.loadingAttachments")]}):a.length===0?null:p.jsx("div",{className:"mb-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r("common.attachments")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(m=>p.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>d(m),"aria-label":`Download ${m.Filename}`,children:p.jsxs("div",{className:"flex justify-between items-center gap-2",children:[p.jsx("div",{className:"flex items-center flex-1",children:p.jsxs("div",{className:"flex flex-col",children:[p.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.Filename}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(m.CreatedAt).toLocaleDateString()})]})}),p.jsx("div",{className:"flex items-center",children:p.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5m0 0l5-5m-5 5V4"})})})]})},m.Id))})]})})},v1=({email:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState([]),[c,d]=M.useState(!0),[m,A]=M.useState(0),[b,v]=M.useState(!1),[B,T]=M.useState(null),[Q,k]=M.useState(!1),[R,N]=M.useState(2),O=da(),_=Lr(),q=3,V=R<a.length,ae=(P,$)=>{const me=P.slice(0,$);u(me)},ge=()=>{const P=Math.min(R+q,a.length);N(P),ae(a,P)},te=async P=>(await Xe.getItem("session:publicEmailDomains")??[]).some(me=>P.toLowerCase().endsWith(me)),J=async P=>(await Xe.getItem("session:privateEmailDomains")??[]).some(me=>P.toLowerCase().endsWith(me));return M.useEffect(()=>{const P=async()=>{var me;try{T(null);const he=await te(n),Be=await J(n),pe=he||Be;if(v(he),k(pe),!pe)return;if(he){const K=n.split("@")[0],ie=await fetch(`https://api.spamok.com/v2/EmailBox/${K}`,{headers:{"X-Asdasd-Platform-Id":"av-chrome","X-Asdasd-Platform-Version":cr.VERSION}});if(!ie.ok){T(r("emails.errors.emailLoadError"));return}const Ne=await ie.json(),_e=((me=Ne==null?void 0:Ne.mails)==null?void 0:me.toSorted((G,ne)=>new Date(ne.dateSystem).getTime()-new Date(G.dateSystem).getTime()))??[];c&&_e.length>0&&A(_e[0].id),s(G=>JSON.stringify(G.map(Ee=>Ee.id))!==JSON.stringify(_e.map(Ee=>Ee.id))?(ae(_e,R),_e):G)}else if(Be)try{const K=await O.authFetch(`EmailBox/${n}`,{method:"GET"},!0,!1);try{const Ne=K.mails.toSorted((_e,G)=>new Date(G.dateSystem).getTime()-new Date(_e.dateSystem).getTime());if(Ne){const _e=await Yt.decryptEmailList(Ne,_.sqliteClient.getAllEncryptionKeys());c&&_e.length>0&&A(_e[0].id),s(G=>JSON.stringify(G.map(Ee=>Ee.id))!==JSON.stringify(_e.map(Ee=>Ee.id))?(ae(_e,R),_e):G)}}catch{const ie=K;T(r("emails.apiErrors."+(ie==null?void 0:ie.code)));return}}catch{T(r("emails.errors.emailLoadError"));return}}catch(he){console.error("Error loading emails:",he),T(r("emails.errors.emailUnexpectedError"))}d(!1)};P();const $=setInterval(P,2e3);return()=>clearInterval($)},[n,c,O,_,r,R]),Q?B?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("div",{className:"flex items-center gap-2 mb-2",children:p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")})}),p.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded",children:p.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:B})})]}):c?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),r("common.loadingEmails")]}):a.length===0?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),r("emails.noEmails")]}):p.jsxs("div",{className:"space-y-2 mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.recentEmails")}),p.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),o.map(P=>b?p.jsxs("a",{href:`https://spamok.com/${n.split("@")[0]}/${P.id}`,target:"_blank",rel:"noopener noreferrer",className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${P.id>m?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[p.jsx("div",{className:"truncate flex-1",children:p.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[P.subject.substring(0,30),P.subject.length>30?"...":""]})}),p.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(P.dateSystem).toLocaleDateString()})]},P.id):p.jsxs(ec,{to:`/emails/${P.id}`,className:`flex justify-between items-center p-2 ps-3 pe-3 rounded cursor-pointer bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${P.id>m?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[p.jsx("span",{className:"truncate flex-1",children:p.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[P.subject.substring(0,30),P.subject.length>30?"...":""]})}),p.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(P.dateSystem).toLocaleDateString()})]},P.id)),V&&p.jsxs("button",{onClick:ge,className:"w-full mt-2 py-1 px-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md transition-colors duration-200 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-100 flex items-center justify-center gap-1",children:[p.jsx("span",{children:r("common.loadMore")}),p.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}):null},x1=({email:n})=>{const r=Lr();return(async s=>{var m;const o=(m=s.split("@")[1])==null?void 0:m.toLowerCase();if(!o)return!1;const u=await r.getVaultMetadata(),c=(u==null?void 0:u.publicEmailDomains)??[],d=(u==null?void 0:u.privateEmailDomains)??[];return[...c,...d].some(A=>o===A||o.endsWith(`.${A}`))})(n)?p.jsx(p.Fragment,{children:p.jsx(v1,{email:n})}):null},C1=({credential:n})=>p.jsx("div",{className:"flex items-center justify-between",children:p.jsxs("div",{className:"flex items-center",children:[p.jsx("img",{src:_u.imgSrcFromBytes(n.Logo),alt:n.ServiceName,className:"w-12 h-12 rounded-lg mr-4"}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:n.ServiceName}),n.ServiceUrl&&p.jsx("a",{href:n.ServiceUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 break-all",children:n.ServiceUrl})]})]})}),w1=({credential:n})=>{var u,c,d,m;const{t:r}=Bt(),a=(c=(u=n.Alias)==null?void 0:u.Email)==null?void 0:c.trim(),s=(d=n.Username)==null?void 0:d.trim(),o=(m=n.Password)==null?void 0:m.trim();return!a&&!s&&!o?null:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.loginCredentials")}),a&&p.jsx(bi,{id:"email",label:r("common.email"),value:a}),s&&p.jsx(bi,{id:"username",label:r("common.username"),value:s}),o&&p.jsx(bi,{id:"password",label:r("common.password"),value:o,type:"password"})]})},I1=n=>{const r=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g;return n.replace(r,a=>`<a href="${a.startsWith("http")?a:`http://${a}`}" target="_blank" rel="noopener noreferrer" class="text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300">${a}</a>`)},B1=({notes:n})=>{const{t:r}=Bt();if(!n)return null;const a=I1(n);return p.jsxs("div",{children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("common.notes")}),p.jsx("div",{className:"p-4 bg-gray-50 rounded-lg dark:bg-gray-700",children:p.jsx("p",{className:"text-gray-900 dark:text-gray-100 whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:a}})})]})};//! otpauth 9.4.0 | (c) Héctor Molinero Fernández | MIT | https://github.com/hectorm/otpauth
//! noble-hashes 1.7.1 | (c) Paul Miller | MIT | https://github.com/paulmillr/noble-hashes
const S1=n=>{const r=new ArrayBuffer(8),a=new Uint8Array(r);let s=n;for(let o=7;o>=0&&s!==0;o--)a[o]=s&255,s-=a[o],s/=256;return a};function Ku(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function N1(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function nc(n,...r){if(!N1(n))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(n.length))throw new Error("Uint8Array expected of length "+r+", got length="+n.length)}function T1(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ku(n.outputLen),Ku(n.blockLen)}function Vs(n,r=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(r&&n.finished)throw new Error("Hash#digest() has already been called")}function Uy(n,r){nc(n);const a=r.outputLen;if(n.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q1(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function Ff(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function na(n,r){return n<<32-r|n>>>r}function jf(n,r){return n<<r|n>>>32-r>>>0}const Km=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function D1(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}function Jm(n){for(let r=0;r<n.length;r++)n[r]=D1(n[r])}function R1(n){if(typeof n!="string")throw new Error("utf8ToBytes expected string, got "+typeof n);return new Uint8Array(new TextEncoder().encode(n))}function ac(n){return typeof n=="string"&&(n=R1(n)),nc(n),n}class QA{clone(){return this._cloneInto()}}function Ks(n){const r=s=>n().update(ac(s)).digest(),a=n();return r.outputLen=a.outputLen,r.blockLen=a.blockLen,r.create=()=>n(),r}class My extends QA{update(r){return Vs(this),this.iHash.update(r),this}digestInto(r){Vs(this),nc(r,this.outputLen),this.finished=!0,this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){const r=new Uint8Array(this.oHash.outputLen);return this.digestInto(r),r}_cloneInto(r){r||(r=Object.create(Object.getPrototypeOf(this),{}));const{oHash:a,iHash:s,finished:o,destroyed:u,blockLen:c,outputLen:d}=this;return r=r,r.finished=o,r.destroyed=u,r.blockLen=c,r.outputLen=d,r.oHash=a._cloneInto(r.oHash),r.iHash=s._cloneInto(r.iHash),r}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(r,a){super(),this.finished=!1,this.destroyed=!1,T1(r);const s=ac(a);if(this.iHash=r.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,u=new Uint8Array(o);u.set(s.length>o?r.create().update(s).digest():s);for(let c=0;c<u.length;c++)u[c]^=54;this.iHash.update(u),this.oHash=r.create();for(let c=0;c<u.length;c++)u[c]^=106;this.oHash.update(u),u.fill(0)}}const oA=(n,r,a)=>new My(n,r).update(a).digest();oA.create=(n,r)=>new My(n,r);function k1(n,r,a,s){if(typeof n.setBigUint64=="function")return n.setBigUint64(r,a,s);const o=BigInt(32),u=BigInt(4294967295),c=Number(a>>o&u),d=Number(a&u),m=s?4:0,A=s?0:4;n.setUint32(r+m,c,s),n.setUint32(r+A,d,s)}function _y(n,r,a){return n&r^~n&a}function Oy(n,r,a){return n&r^n&a^r&a}class DA extends QA{update(r){Vs(this);const{view:a,buffer:s,blockLen:o}=this;r=ac(r);const u=r.length;for(let c=0;c<u;){const d=Math.min(o-this.pos,u-c);if(d===o){const m=Ff(r);for(;o<=u-c;c+=o)this.process(m,c);continue}s.set(r.subarray(c,c+d),this.pos),this.pos+=d,c+=d,this.pos===o&&(this.process(a,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(r){Vs(this),Uy(r,this),this.finished=!0;const{buffer:a,view:s,blockLen:o,isLE:u}=this;let{pos:c}=this;a[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(s,0),c=0);for(let v=c;v<o;v++)a[v]=0;k1(s,o-8,BigInt(this.length*8),u),this.process(s,0);const d=Ff(r),m=this.outputLen;if(m%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const A=m/4,b=this.get();if(A>b.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<A;v++)d.setUint32(4*v,b[v],u)}digest(){const{buffer:r,outputLen:a}=this;this.digestInto(r);const s=r.slice(0,a);return this.destroy(),s}_cloneInto(r){r||(r=new this.constructor),r.set(...this.get());const{blockLen:a,buffer:s,length:o,finished:u,destroyed:c,pos:d}=this;return r.length=o,r.pos=d,r.finished=u,r.destroyed=c,o%a&&r.buffer.set(s),r}constructor(r,a,s,o){super(),this.blockLen=r,this.outputLen=a,this.padOffset=s,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(r),this.view=Ff(this.buffer)}}const zl=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Ai=new Uint32Array(80);class L1 extends DA{get(){const{A:r,B:a,C:s,D:o,E:u}=this;return[r,a,s,o,u]}set(r,a,s,o,u){this.A=r|0,this.B=a|0,this.C=s|0,this.D=o|0,this.E=u|0}process(r,a){for(let m=0;m<16;m++,a+=4)Ai[m]=r.getUint32(a,!1);for(let m=16;m<80;m++)Ai[m]=jf(Ai[m-3]^Ai[m-8]^Ai[m-14]^Ai[m-16],1);let{A:s,B:o,C:u,D:c,E:d}=this;for(let m=0;m<80;m++){let A,b;m<20?(A=_y(o,u,c),b=1518500249):m<40?(A=o^u^c,b=1859775393):m<60?(A=Oy(o,u,c),b=2400959708):(A=o^u^c,b=3395469782);const v=jf(s,5)+A+d+b+Ai[m]|0;d=c,c=u,u=jf(o,30),o=s,s=v}s=s+this.A|0,o=o+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,this.set(s,o,u,c,d)}roundClean(){Ai.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,20,8,!1),this.A=zl[0]|0,this.B=zl[1]|0,this.C=zl[2]|0,this.D=zl[3]|0,this.E=zl[4]|0}}const U1=Ks(()=>new L1),M1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gi=new Uint32Array(64);class Fy extends DA{get(){const{A:r,B:a,C:s,D:o,E:u,F:c,G:d,H:m}=this;return[r,a,s,o,u,c,d,m]}set(r,a,s,o,u,c,d,m){this.A=r|0,this.B=a|0,this.C=s|0,this.D=o|0,this.E=u|0,this.F=c|0,this.G=d|0,this.H=m|0}process(r,a){for(let v=0;v<16;v++,a+=4)gi[v]=r.getUint32(a,!1);for(let v=16;v<64;v++){const B=gi[v-15],T=gi[v-2],Q=na(B,7)^na(B,18)^B>>>3,k=na(T,17)^na(T,19)^T>>>10;gi[v]=k+gi[v-7]+Q+gi[v-16]|0}let{A:s,B:o,C:u,D:c,E:d,F:m,G:A,H:b}=this;for(let v=0;v<64;v++){const B=na(d,6)^na(d,11)^na(d,25),T=b+B+_y(d,m,A)+M1[v]+gi[v]|0,k=(na(s,2)^na(s,13)^na(s,22))+Oy(s,o,u)|0;b=A,A=m,m=d,d=c+T|0,c=u,u=o,o=s,s=T+k|0}s=s+this.A|0,o=o+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,A=A+this.G|0,b=b+this.H|0,this.set(s,o,u,c,d,m,A,b)}roundClean(){gi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,32,8,!1),this.A=hi[0]|0,this.B=hi[1]|0,this.C=hi[2]|0,this.D=hi[3]|0,this.E=hi[4]|0,this.F=hi[5]|0,this.G=hi[6]|0,this.H=hi[7]|0}}class _1 extends Fy{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const O1=Ks(()=>new Fy),F1=Ks(()=>new _1),xu=BigInt(2**32-1),uA=BigInt(32);function jy(n,r=!1){return r?{h:Number(n&xu),l:Number(n>>uA&xu)}:{h:Number(n>>uA&xu)|0,l:Number(n&xu)|0}}function Hy(n,r=!1){let a=new Uint32Array(n.length),s=new Uint32Array(n.length);for(let o=0;o<n.length;o++){const{h:u,l:c}=jy(n[o],r);[a[o],s[o]]=[u,c]}return[a,s]}const j1=(n,r)=>BigInt(n>>>0)<<uA|BigInt(r>>>0),H1=(n,r,a)=>n>>>a,G1=(n,r,a)=>n<<32-a|r>>>a,V1=(n,r,a)=>n>>>a|r<<32-a,q1=(n,r,a)=>n<<32-a|r>>>a,z1=(n,r,a)=>n<<64-a|r>>>a-32,Y1=(n,r,a)=>n>>>a-32|r<<64-a,P1=(n,r)=>r,K1=(n,r)=>n,Gy=(n,r,a)=>n<<a|r>>>32-a,Vy=(n,r,a)=>r<<a|n>>>32-a,qy=(n,r,a)=>r<<a-32|n>>>64-a,zy=(n,r,a)=>n<<a-32|r>>>64-a;function J1(n,r,a,s){const o=(r>>>0)+(s>>>0);return{h:n+a+(o/2**32|0)|0,l:o|0}}const X1=(n,r,a)=>(n>>>0)+(r>>>0)+(a>>>0),$1=(n,r,a,s)=>r+a+s+(n/2**32|0)|0,W1=(n,r,a,s)=>(n>>>0)+(r>>>0)+(a>>>0)+(s>>>0),Z1=(n,r,a,s,o)=>r+a+s+o+(n/2**32|0)|0,eI=(n,r,a,s,o)=>(n>>>0)+(r>>>0)+(a>>>0)+(s>>>0)+(o>>>0),tI=(n,r,a,s,o,u)=>r+a+s+o+u+(n/2**32|0)|0,dt={fromBig:jy,split:Hy,toBig:j1,shrSH:H1,shrSL:G1,rotrSH:V1,rotrSL:q1,rotrBH:z1,rotrBL:Y1,rotr32H:P1,rotr32L:K1,rotlSH:Gy,rotlSL:Vy,rotlBH:qy,rotlBL:zy,add:J1,add3L:X1,add3H:$1,add4L:W1,add4H:Z1,add5H:tI,add5L:eI},[rI,nI]=dt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),mi=new Uint32Array(80),pi=new Uint32Array(80);class Yy extends DA{get(){const{Ah:r,Al:a,Bh:s,Bl:o,Ch:u,Cl:c,Dh:d,Dl:m,Eh:A,El:b,Fh:v,Fl:B,Gh:T,Gl:Q,Hh:k,Hl:R}=this;return[r,a,s,o,u,c,d,m,A,b,v,B,T,Q,k,R]}set(r,a,s,o,u,c,d,m,A,b,v,B,T,Q,k,R){this.Ah=r|0,this.Al=a|0,this.Bh=s|0,this.Bl=o|0,this.Ch=u|0,this.Cl=c|0,this.Dh=d|0,this.Dl=m|0,this.Eh=A|0,this.El=b|0,this.Fh=v|0,this.Fl=B|0,this.Gh=T|0,this.Gl=Q|0,this.Hh=k|0,this.Hl=R|0}process(r,a){for(let _=0;_<16;_++,a+=4)mi[_]=r.getUint32(a),pi[_]=r.getUint32(a+=4);for(let _=16;_<80;_++){const q=mi[_-15]|0,V=pi[_-15]|0,ae=dt.rotrSH(q,V,1)^dt.rotrSH(q,V,8)^dt.shrSH(q,V,7),ge=dt.rotrSL(q,V,1)^dt.rotrSL(q,V,8)^dt.shrSL(q,V,7),te=mi[_-2]|0,J=pi[_-2]|0,P=dt.rotrSH(te,J,19)^dt.rotrBH(te,J,61)^dt.shrSH(te,J,6),$=dt.rotrSL(te,J,19)^dt.rotrBL(te,J,61)^dt.shrSL(te,J,6),me=dt.add4L(ge,$,pi[_-7],pi[_-16]),he=dt.add4H(me,ae,P,mi[_-7],mi[_-16]);mi[_]=he|0,pi[_]=me|0}let{Ah:s,Al:o,Bh:u,Bl:c,Ch:d,Cl:m,Dh:A,Dl:b,Eh:v,El:B,Fh:T,Fl:Q,Gh:k,Gl:R,Hh:N,Hl:O}=this;for(let _=0;_<80;_++){const q=dt.rotrSH(v,B,14)^dt.rotrSH(v,B,18)^dt.rotrBH(v,B,41),V=dt.rotrSL(v,B,14)^dt.rotrSL(v,B,18)^dt.rotrBL(v,B,41),ae=v&T^~v&k,ge=B&Q^~B&R,te=dt.add5L(O,V,ge,nI[_],pi[_]),J=dt.add5H(te,N,q,ae,rI[_],mi[_]),P=te|0,$=dt.rotrSH(s,o,28)^dt.rotrBH(s,o,34)^dt.rotrBH(s,o,39),me=dt.rotrSL(s,o,28)^dt.rotrBL(s,o,34)^dt.rotrBL(s,o,39),he=s&u^s&d^u&d,Be=o&c^o&m^c&m;N=k|0,O=R|0,k=T|0,R=Q|0,T=v|0,Q=B|0,{h:v,l:B}=dt.add(A|0,b|0,J|0,P|0),A=d|0,b=m|0,d=u|0,m=c|0,u=s|0,c=o|0;const pe=dt.add3L(P,me,Be);s=dt.add3H(pe,J,$,he),o=pe|0}({h:s,l:o}=dt.add(this.Ah|0,this.Al|0,s|0,o|0)),{h:u,l:c}=dt.add(this.Bh|0,this.Bl|0,u|0,c|0),{h:d,l:m}=dt.add(this.Ch|0,this.Cl|0,d|0,m|0),{h:A,l:b}=dt.add(this.Dh|0,this.Dl|0,A|0,b|0),{h:v,l:B}=dt.add(this.Eh|0,this.El|0,v|0,B|0),{h:T,l:Q}=dt.add(this.Fh|0,this.Fl|0,T|0,Q|0),{h:k,l:R}=dt.add(this.Gh|0,this.Gl|0,k|0,R|0),{h:N,l:O}=dt.add(this.Hh|0,this.Hl|0,N|0,O|0),this.set(s,o,u,c,d,m,A,b,v,B,T,Q,k,R,N,O)}roundClean(){mi.fill(0),pi.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}}class aI extends Yy{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const iI=Ks(()=>new Yy),sI=Ks(()=>new aI),Py=[],Ky=[],Jy=[],lI=BigInt(0),Yl=BigInt(1),oI=BigInt(2),uI=BigInt(7),cI=BigInt(256),dI=BigInt(113);for(let n=0,r=Yl,a=1,s=0;n<24;n++){[a,s]=[s,(2*a+3*s)%5],Py.push(2*(5*s+a)),Ky.push((n+1)*(n+2)/2%64);let o=lI;for(let u=0;u<7;u++)r=(r<<Yl^(r>>uI)*dI)%cI,r&oI&&(o^=Yl<<(Yl<<BigInt(u))-Yl);Jy.push(o)}const[fI,AI]=Hy(Jy,!0),Xm=(n,r,a)=>a>32?qy(n,r,a):Gy(n,r,a),$m=(n,r,a)=>a>32?zy(n,r,a):Vy(n,r,a);function hI(n,r=24){const a=new Uint32Array(10);for(let s=24-r;s<24;s++){for(let c=0;c<10;c++)a[c]=n[c]^n[c+10]^n[c+20]^n[c+30]^n[c+40];for(let c=0;c<10;c+=2){const d=(c+8)%10,m=(c+2)%10,A=a[m],b=a[m+1],v=Xm(A,b,1)^a[d],B=$m(A,b,1)^a[d+1];for(let T=0;T<50;T+=10)n[c+T]^=v,n[c+T+1]^=B}let o=n[2],u=n[3];for(let c=0;c<24;c++){const d=Ky[c],m=Xm(o,u,d),A=$m(o,u,d),b=Py[c];o=n[b],u=n[b+1],n[b]=m,n[b+1]=A}for(let c=0;c<50;c+=10){for(let d=0;d<10;d++)a[d]=n[c+d];for(let d=0;d<10;d++)n[c+d]^=~a[(d+2)%10]&a[(d+4)%10]}n[0]^=fI[s],n[1]^=AI[s]}a.fill(0)}class RA extends QA{keccak(){Km||Jm(this.state32),hI(this.state32,this.rounds),Km||Jm(this.state32),this.posOut=0,this.pos=0}update(r){Vs(this);const{blockLen:a,state:s}=this;r=ac(r);const o=r.length;for(let u=0;u<o;){const c=Math.min(a-this.pos,o-u);for(let d=0;d<c;d++)s[this.pos++]^=r[u++];this.pos===a&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:r,suffix:a,pos:s,blockLen:o}=this;r[s]^=a,(a&128)!==0&&s===o-1&&this.keccak(),r[o-1]^=128,this.keccak()}writeInto(r){Vs(this,!1),nc(r),this.finish();const a=this.state,{blockLen:s}=this;for(let o=0,u=r.length;o<u;){this.posOut>=s&&this.keccak();const c=Math.min(s-this.posOut,u-o);r.set(a.subarray(this.posOut,this.posOut+c),o),this.posOut+=c,o+=c}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(r)}xof(r){return Ku(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(Uy(r,this),this.finished)throw new Error("digest() was already called");return this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(r){const{blockLen:a,suffix:s,outputLen:o,rounds:u,enableXOF:c}=this;return r||(r=new RA(a,s,o,c,u)),r.state32.set(this.state32),r.pos=this.pos,r.posOut=this.posOut,r.finished=this.finished,r.rounds=u,r.suffix=s,r.outputLen=o,r.enableXOF=c,r.destroyed=this.destroyed,r}constructor(r,a,s,o=!1,u=24){if(super(),this.blockLen=r,this.suffix=a,this.outputLen=s,this.enableXOF=o,this.rounds=u,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ku(s),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Q1(this.state)}}const ic=(n,r,a)=>Ks(()=>new RA(r,n,a)),gI=ic(6,144,224/8),mI=ic(6,136,256/8),pI=ic(6,104,384/8),yI=ic(6,72,512/8),qs=(()=>{if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<"u")return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global})(),Wm={SHA1:U1,SHA224:F1,SHA256:O1,SHA384:sI,SHA512:iI,"SHA3-224":gI,"SHA3-256":mI,"SHA3-384":pI,"SHA3-512":yI},kA=n=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(n):return"SHA1";case/^SHA(?:2?-)?224$/i.test(n):return"SHA224";case/^SHA(?:2?-)?256$/i.test(n):return"SHA256";case/^SHA(?:2?-)?384$/i.test(n):return"SHA384";case/^SHA(?:2?-)?512$/i.test(n):return"SHA512";case/^SHA3-224$/i.test(n):return"SHA3-224";case/^SHA3-256$/i.test(n):return"SHA3-256";case/^SHA3-384$/i.test(n):return"SHA3-384";case/^SHA3-512$/i.test(n):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${n}`)}},EI=(n,r,a)=>{if(oA){const s=Wm[n]??Wm[kA(n)];return oA(s,r,a)}else throw new Error("Missing HMAC function")},cA="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bI=n=>{n=n.replace(/ /g,"");let r=n.length;for(;n[r-1]==="=";)--r;n=(r<n.length?n.substring(0,r):n).toUpperCase();const a=new ArrayBuffer(n.length*5/8|0),s=new Uint8Array(a);let o=0,u=0,c=0;for(let d=0;d<n.length;d++){const m=cA.indexOf(n[d]);if(m===-1)throw new TypeError(`Invalid character found: ${n[d]}`);u=u<<5|m,o+=5,o>=8&&(o-=8,s[c++]=u>>>o)}return s},vI=n=>{let r=0,a=0,s="";for(let o=0;o<n.length;o++)for(a=a<<8|n[o],r+=8;r>=5;)s+=cA[a>>>r-5&31],r-=5;return r>0&&(s+=cA[a<<5-r&31]),s},xI=n=>{n=n.replace(/ /g,"");const r=new ArrayBuffer(n.length/2),a=new Uint8Array(r);for(let s=0;s<n.length;s+=2)a[s/2]=parseInt(n.substring(s,s+2),16);return a},CI=n=>{let r="";for(let a=0;a<n.length;a++){const s=n[a].toString(16);s.length===1&&(r+="0"),r+=s}return r.toUpperCase()},wI=n=>{const r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s)&255;return a},II=n=>{let r="";for(let a=0;a<n.length;a++)r+=String.fromCharCode(n[a]);return r},Zm=qs.TextEncoder?new qs.TextEncoder:null,ep=qs.TextDecoder?new qs.TextDecoder:null,BI=n=>{if(!Zm)throw new Error("Encoding API not available");return Zm.encode(n)},SI=n=>{if(!ep)throw new Error("Encoding API not available");return ep.decode(n)},NI=n=>{var r;if((r=qs.crypto)!=null&&r.getRandomValues)return qs.crypto.getRandomValues(new Uint8Array(n));throw new Error("Cryptography API not available")};class ka{static fromLatin1(r){return new ka({buffer:wI(r).buffer})}static fromUTF8(r){return new ka({buffer:BI(r).buffer})}static fromBase32(r){return new ka({buffer:bI(r).buffer})}static fromHex(r){return new ka({buffer:xI(r).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:II(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:SI(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:vI(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:CI(this.bytes)}),this.hex}constructor({buffer:r,size:a=20}={}){this.bytes=typeof r>"u"?NI(a):new Uint8Array(r),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}const TI=(n,r)=>{{if(n.length!==r.length)throw new TypeError("Input strings must have the same length");let a=-1,s=0;for(;++a<n.length;)s|=n.charCodeAt(a)^r.charCodeAt(a);return s===0}};class Sr{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:r,algorithm:a=Sr.defaults.algorithm,digits:s=Sr.defaults.digits,counter:o=Sr.defaults.counter}){const u=EI(a,r.bytes,S1(o)),c=u[u.byteLength-1]&15;return(((u[c]&127)<<24|(u[c+1]&255)<<16|(u[c+2]&255)<<8|u[c+3]&255)%10**s).toString().padStart(s,"0")}generate({counter:r=this.counter++}={}){return Sr.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:r})}static validate({token:r,secret:a,algorithm:s,digits:o=Sr.defaults.digits,counter:u=Sr.defaults.counter,window:c=Sr.defaults.window}){if(r.length!==o)return null;let d=null;const m=A=>{const b=Sr.generate({secret:a,algorithm:s,digits:o,counter:A});TI(r,b)&&(d=A-u)};m(u);for(let A=1;A<=c&&d===null&&(m(u-A),!(d!==null||(m(u+A),d!==null)));++A);return d}validate({token:r,counter:a=this.counter,window:s}){return Sr.validate({token:r,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:a,window:s})}toString(){const r=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${r(this.issuer)}:${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?`}secret=${r(this.secret.base32)}&algorithm=${r(this.algorithm)}&digits=${r(this.digits)}&counter=${r(this.counter)}`}constructor({issuer:r=Sr.defaults.issuer,label:a=Sr.defaults.label,issuerInLabel:s=Sr.defaults.issuerInLabel,secret:o=new ka,algorithm:u=Sr.defaults.algorithm,digits:c=Sr.defaults.digits,counter:d=Sr.defaults.counter}={}){this.issuer=r,this.label=a,this.issuerInLabel=s,this.secret=typeof o=="string"?ka.fromBase32(o):o,this.algorithm=kA(u),this.digits=c,this.counter=d}}class pr{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:r=pr.defaults.period,timestamp:a=Date.now()}={}){return Math.floor(a/1e3/r)}counter({timestamp:r=Date.now()}={}){return pr.counter({period:this.period,timestamp:r})}static remaining({period:r=pr.defaults.period,timestamp:a=Date.now()}={}){return r*1e3-a%(r*1e3)}remaining({timestamp:r=Date.now()}={}){return pr.remaining({period:this.period,timestamp:r})}static generate({secret:r,algorithm:a,digits:s,period:o=pr.defaults.period,timestamp:u=Date.now()}){return Sr.generate({secret:r,algorithm:a,digits:s,counter:pr.counter({period:o,timestamp:u})})}generate({timestamp:r=Date.now()}={}){return pr.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:r})}static validate({token:r,secret:a,algorithm:s,digits:o,period:u=pr.defaults.period,timestamp:c=Date.now(),window:d}){return Sr.validate({token:r,secret:a,algorithm:s,digits:o,counter:pr.counter({period:u,timestamp:c}),window:d})}validate({token:r,timestamp:a,window:s}){return pr.validate({token:r,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:a,window:s})}toString(){const r=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${r(this.issuer)}:${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?issuer=${r(this.issuer)}&`:`${r(this.label)}?`}secret=${r(this.secret.base32)}&algorithm=${r(this.algorithm)}&digits=${r(this.digits)}&period=${r(this.period)}`}constructor({issuer:r=pr.defaults.issuer,label:a=pr.defaults.label,issuerInLabel:s=pr.defaults.issuerInLabel,secret:o=new ka,algorithm:u=pr.defaults.algorithm,digits:c=pr.defaults.digits,period:d=pr.defaults.period}={}){this.issuer=r,this.label=a,this.issuerInLabel=s,this.secret=typeof o=="string"?ka.fromBase32(o):o,this.algorithm=kA(u),this.digits=c,this.period=d}}const QI=({credentialId:n})=>{const{t:r}=Bt(),[a,s]=M.useState([]),[o,u]=M.useState(!0),[c,d]=M.useState({}),[m,A]=M.useState(null),b=Lr(),v=(k=30)=>{const R=new pr({secret:"dummy",algorithm:"SHA1",digits:6,period:k});return R.period-Math.floor(Date.now()/1e3)%R.period},B=()=>{const k=v();return Math.floor((30-k)/30*100)},T=k=>{try{return new pr({secret:k,algorithm:"SHA1",digits:6,period:30}).generate()}catch(R){return console.error("Error generating TOTP code:",R),"Error"}},Q=async(k,R)=>{try{await navigator.clipboard.writeText(k),A(R),setTimeout(()=>{A(null)},2e3)}catch(N){console.error("Failed to copy:",N)}};return M.useEffect(()=>{(async()=>{if(b!=null&&b.sqliteClient)try{const R=b.sqliteClient.getTotpCodesForCredential(n);s(R)}catch(R){console.error("Error loading TOTP codes:",R)}finally{u(!1)}})()},[n,b==null?void 0:b.sqliteClient]),M.useEffect(()=>{const k=O=>{const _={};return a.forEach(q=>{const V=T(q.SecretKey);V!=="Error"?_[q.Id]=V:_[q.Id]=O[q.Id]??"Error"}),_},R={};a.forEach(O=>{R[O.Id]=T(O.SecretKey)}),d(R);const N=setInterval(()=>{d(k)},1e3);return()=>{clearInterval(N)}},[a]),o?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:r("common.twoFactorAuthentication")}),r("common.loadingTotpCodes")]}):a.length===0?null:p.jsx("div",{className:"mb-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:r("common.twoFactorAuthentication")}),p.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(k=>p.jsx("button",{className:"w-full text-left p-2 ps-3 pe-3 rounded bg-white dark:bg-gray-800 shadow hover:shadow-md transition-all border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",onClick:()=>Q(c[k.Id],k.Id),"aria-label":`Copy ${k.Name} code`,children:p.jsxs("div",{className:"flex justify-between items-center gap-2",children:[p.jsx("div",{className:"flex items-center flex-1",children:p.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:k.Name})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"flex flex-col items-end",children:[p.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:c[k.Id]}),p.jsx("div",{className:"text-xs",children:m===k.Id?p.jsx("span",{className:"text-green-600 dark:text-green-400",children:r("common.copied")}):p.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[v(),"s"]})})]}),p.jsx("div",{className:"w-1 h-6 bg-gray-200 rounded-full dark:bg-gray-600",children:p.jsx("div",{className:"bg-blue-600 rounded-full transition-all",style:{height:`${B()}%`,width:"100%"}})})]})]})},k.Id))})]})})};class yr{static isPopup(){return new URLSearchParams(window.location.search).get("expanded")==="true"?!0:window.innerWidth>390}static openInNewPopup(r){const o=window.screen.width/2-400,u=window.screen.height/2-1e3/2,d=`popup.html?expanded=true#${r||window.location.hash.replace("#","")}`;window.open(d,"AliasVaultPopup",`width=800,height=1000,left=${o},top=${u},popup=true`),window.close()}}const DI=()=>{var b;const{t:n}=Bt(),{id:r}=pA(),a=kr(),s=Lr(),[o,u]=M.useState(null),{setIsInitialLoading:c}=yn(),{setHeaderButtons:d}=ca(),m=M.useCallback(()=>{yr.openInNewPopup(`/credentials/${r}`)},[r]),A=M.useCallback(()=>{a(`/credentials/${r}/edit`)},[r,a]);return M.useEffect(()=>{if(yr.isPopup()&&(window.history.replaceState({},"","popup.html#/credentials"),window.history.pushState({},"",`popup.html#/credentials/${r}`)),!(!(s!=null&&s.sqliteClient)||!r))try{const v=s.sqliteClient.getCredentialById(r);v?(u(v),c(!1)):(console.error("Credential not found"),a("/credentials"))}catch(v){console.error("Error loading credential:",v)}},[s.sqliteClient,r,a,c]),M.useEffect(()=>{const v=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:m,title:n("common.openInNewWindow"),iconType:Kr.EXPAND}),p.jsx(an,{onClick:A,title:n("credentials.editCredential"),iconType:Kr.EDIT})]});return d(v),()=>{}},[d,A,m,n]),M.useEffect(()=>()=>d(null),[d]),o?p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{className:"flex justify-between items-center",children:p.jsx(C1,{credential:o})}),((b=o.Alias)==null?void 0:b.Email)&&p.jsx(x1,{email:o.Alias.Email}),p.jsx(QI,{credentialId:o.Id}),p.jsx(w1,{credential:o}),p.jsx(E1,{credential:o}),p.jsx(B1,{notes:o.Notes}),p.jsx(b1,{credentialId:o.Id})]}):p.jsx("div",{children:n("common.loading")})},RI=({credential:n})=>{const r=kr(),a=o=>{var c;let u="";return o.Username&&(u=o.Username),(c=o.Alias)!=null&&c.Email&&(u=o.Alias.Email),u.length>33?u.slice(0,30)+"...":u},s=o=>{let u="Untitled";return o.ServiceName&&(u=o.ServiceName),u.length>33?u.slice(0,30)+"...":u};return p.jsx("li",{children:p.jsxs("button",{onClick:()=>r(`/credentials/${n.Id}`),className:"w-full p-2 border dark:border-gray-600 rounded flex items-center bg-white dark:bg-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[p.jsx("img",{src:_u.imgSrcFromBytes(n.Logo),alt:n.ServiceName,className:"w-8 h-8 mr-2 flex-shrink-0",onError:o=>{const u=o.target;u.src="/assets/images/service-placeholder.webp"}}),p.jsxs("div",{className:"text-left",children:[p.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s(n)}),p.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a(n)})]})]})})},dA=({onClick:n})=>p.jsxs("div",{className:"px-2 items-center",children:[p.jsxs("div",{className:"relative inline-flex items-center",children:[p.jsx("button",{onClick:n,className:"absolute p-2 hover:bg-gray-200 rounded-2xl",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})})}),p.jsxs("svg",{"aria-hidden":"true",className:"inline w-8 h-8 text-gray-200 dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),p.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})]}),p.jsx("span",{className:"sr-only",children:"Loading..."})]}),sc=(n=!1,r=300)=>{const[a,s]=M.useState(n),o=M.useRef(null),u=M.useRef(null),c=M.useCallback(d=>{if(d)s(!0),u.current=Date.now();else{const m=u.current?Date.now()-u.current:0,A=Math.max(0,r-m);A===0?s(!1):(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s(!1)},A))}},[r]);return M.useEffect(()=>{n&&(s(!0),u.current=Date.now())},[n,s]),M.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),[a,c]},kI=()=>{const{t:n}=Bt(),r=Lr(),a=da(),s=kr(),{syncVault:o}=rc(),{setHeaderButtons:u}=ca(),[c,d]=M.useState([]),[m,A]=M.useState(""),{setIsInitialLoading:b}=yn(),[v,B]=sc(!0,100),T=M.useCallback(()=>{s("/credentials/add")},[s]),Q=M.useCallback(async()=>{if(r!=null&&r.sqliteClient)try{await o({onSuccess:async N=>{},_onOffline:()=>{},onError:async N=>{console.error("Error syncing vault:",N),await a.logout("Error while syncing vault, please re-authenticate."),s("/logout")}})}catch(N){console.error("Error refreshing credentials:",N),await a.logout("Error while syncing vault, please re-authenticate."),s("/logout")}},[r,a,o,s]),k=M.useCallback(async()=>{B(!0),await Q(),B(!1)},[Q,B]);M.useEffect(()=>{const N=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:"Open in new window",iconType:Kr.EXPAND}),p.jsx(an,{onClick:T,title:"Add new credential",iconType:Kr.PLUS})]});return u(N),()=>u(null)},[u,T]),M.useEffect(()=>{(async()=>{var O;if(r!=null&&r.sqliteClient){B(!0);const _=((O=r.sqliteClient)==null?void 0:O.getAllCredentials())??[];d(_),B(!1),b(!1)}})()},[r==null?void 0:r.sqliteClient,B,b]);const R=c.filter(N=>{var q,V,ae,ge,te,J;const O=m.toLowerCase();return[(q=N.ServiceName)==null?void 0:q.toLowerCase(),(V=N.Username)==null?void 0:V.toLowerCase(),(ge=(ae=N.Alias)==null?void 0:ae.Email)==null?void 0:ge.toLowerCase(),(te=N.ServiceUrl)==null?void 0:te.toLowerCase(),(J=N.Notes)==null?void 0:J.toLowerCase()].some(P=>P==null?void 0:P.includes(O))});return v?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("credentials.title")}),p.jsx(dA,{onClick:k})]}),c.length>0?p.jsx("input",{type:"text",placeholder:n("credentials.searchPlaceholder"),value:m,onChange:N=>A(N.target.value),autoFocus:!0,className:"w-full p-2 mb-4 border dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-blue-500 focus:border-blue-500"}):p.jsx(p.Fragment,{}),c.length===0?p.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[p.jsx("p",{className:"text-sm",children:n("credentials.welcomeTitle")}),p.jsx("p",{className:"text-sm",children:n("credentials.welcomeDescription")})]}):p.jsx("ul",{className:"space-y-2",children:R.map(N=>p.jsx(RI,{credential:N},N.Id))})]})};class LI{convertAnchorTagsToOpenInNewTab(r){try{const s=new DOMParser().parseFromString(r,"text/html"),o=s.querySelectorAll("a[href]");return o.length>0&&o.forEach(u=>{if((!u.hasAttribute("target")||u.getAttribute("target")!=="_blank")&&u.setAttribute("target","_blank"),!u.hasAttribute("rel"))u.setAttribute("rel","noopener noreferrer");else{const c=u.getAttribute("rel")??"",d=new Set(c.split(" ").filter(m=>m.trim()!==""));d.add("noopener"),d.add("noreferrer"),u.setAttribute("rel",Array.from(d).join(" "))}}),s.documentElement.outerHTML}catch(a){return console.error(`Error in convertAnchorTagsToOpenInNewTab: ${a instanceof Error?a.message:String(a)}`),r}}normalizeUsername(r){return r.toLowerCase().trim()}}const Hs=new LI,UI=()=>{const{t:n}=Bt(),{id:r}=pA(),a=kr(),s=Lr(),o=da(),[u,c]=M.useState(null),[d,m]=M.useState(null),[A,b]=sc(!0,150),[v,B]=M.useState(!1),{setIsInitialLoading:T}=yn(),{setHeaderButtons:Q}=ca(),[k,R]=M.useState(!1);M.useEffect(()=>{yr.isPopup()&&(window.history.replaceState({},"","popup.html#/emails"),window.history.pushState({},"",`popup.html#/emails/${r}`)),(async()=>{try{if(b(!0),c(null),!(s!=null&&s.sqliteClient)||!r)return;const V=await o.get(`Email/${r}`),ae=s.sqliteClient.getAllEncryptionKeys(),ge=await Yt.decryptEmail(V,ae);m(ge)}catch(V){c(V instanceof Error?V.message:"An error occurred")}finally{b(!1),T(!1)}})()},[r,s==null?void 0:s.sqliteClient,o,b,T]);const N=M.useCallback(async()=>{try{await o.delete(`Email/${r}`),yr.isPopup()?window.close():a("/emails")}catch(q){c(q instanceof Error?q.message:"Failed to delete email")}},[r,o,a]),O=M.useCallback(()=>{yr.openInNewPopup(`/emails/${r}`)},[r]),_=async q=>{try{const V=await o.downloadBlob(`Email/${r}/attachments/${q.id}`);if(!(s!=null&&s.sqliteClient)||!d){c("Database context or email not available");return}const ae=s.sqliteClient.getAllEncryptionKeys(),ge=await Yt.decryptAttachment(V,d,ae);if(!ge){c("Failed to decrypt attachment");return}const te=new Blob([new Uint8Array(ge)],{type:q.mimeType??"application/octet-stream"}),J=window.URL.createObjectURL(te),P=document.createElement("a");P.href=J,P.download=q.filename,document.body.appendChild(P),P.click(),window.URL.revokeObjectURL(J),document.body.removeChild(P)}catch(V){console.error("handleDownloadAttachment error",V),c(V instanceof Error?V.message:"Failed to download attachment")}};return M.useEffect(()=>{if(!k){const q=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(an,{onClick:O,title:n("common.openInNewWindow"),iconType:Kr.EXPAND}),p.jsx(an,{onClick:()=>B(!0),title:n("emails.deleteEmail"),iconType:Kr.DELETE,variant:"danger"})]});Q(q),R(!0)}return()=>{}},[Q,k,O,n]),M.useEffect(()=>()=>Q(null),[Q]),A?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):u?p.jsxs("div",{className:"text-red-500",children:[n("common.error")," ",u]}):d?p.jsxs("div",{className:"max-w-4xl mx-auto",children:[p.jsx(Yu,{isOpen:v,onClose:()=>B(!1),onConfirm:()=>{B(!1),N()},title:n("emails.deleteEmailTitle"),message:n("emails.deleteEmailConfirm"),confirmText:n("common.delete"),cancelText:n("common.cancel"),variant:"danger"}),p.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-md",children:[p.jsxs("div",{className:"p-6 border-b border-gray-200 dark:border-gray-700",children:[p.jsx("div",{className:"flex justify-between items-start mb-4",children:p.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:d.subject})}),p.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400",children:[p.jsxs("p",{children:[n("emails.from")," ",d.fromDisplay," (",d.fromLocal,"@",d.fromDomain,")"]}),p.jsxs("p",{children:[n("emails.to")," ",d.toLocal,"@",d.toDomain]}),p.jsxs("p",{children:[n("emails.date")," ",new Date(d.dateSystem).toLocaleString()]})]})]}),p.jsx("div",{className:"bg-white",children:d.messageHtml?p.jsx("iframe",{srcDoc:Hs.convertAnchorTagsToOpenInNewTab(d.messageHtml),className:"w-full min-h-[500px] border-0",title:n("emails.emailContent")}):p.jsx("pre",{className:"whitespace-pre-wrap text-gray-800 p-3",children:d.messagePlain})}),d.attachments&&d.attachments.length>0&&p.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-gray-700",children:[p.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:n("emails.attachments")}),p.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:d.attachments.map(q=>p.jsxs("button",{onClick:()=>_(q),className:"flex items-center space-x-2 text-sm text-gray-600 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 text-left",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})}),p.jsxs("span",{children:[q.filename," (",Math.ceil(q.filesize/1024)," KB)"]})]},q.id))})]})]})]}):p.jsx("div",{className:"text-gray-500",children:n("emails.emailNotFound")})},MI=()=>{const{t:n}=Bt(),r=Lr(),a=da(),{setHeaderButtons:s}=ca(),[o,u]=M.useState(null),[c,d]=M.useState([]),{setIsInitialLoading:m}=yn(),[A,b]=sc(!0,100),v=M.useCallback(async()=>{try{if(b(!0),u(null),!(r!=null&&r.sqliteClient))return;const T=r.sqliteClient.getAllEmailAddresses();try{const Q=await a.post("EmailBox/bulk",{addresses:T,page:1,pageSize:50}),k=r.sqliteClient.getAllEncryptionKeys(),R=await Yt.decryptEmailList(Q.mails,k);d(R)}catch(Q){throw console.error(Q),new Error(n("emails.errors.emailLoadError"))}}catch(T){u(T instanceof Error?T.message:n("common.errors.unknownError"))}finally{b(!1),m(!1)}},[r==null?void 0:r.sqliteClient,a,b,m,n]);M.useEffect(()=>{v()},[v]),M.useEffect(()=>{const T=yr.isPopup()?null:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND});return s(T),()=>{s(null)}},[s,n]);const B=T=>{const Q=new Date,k=new Date(T),R=Math.floor((Q.getTime()-k.getTime())/1e3);if(R<60)return n("emails.dateFormat.justNow");if(R<3600){const N=Math.floor(R/60);return N===1?n("emails.dateFormat.minutesAgo_single",{count:N}):n("emails.dateFormat.minutesAgo_plural",{count:N})}else if(R<86400){const N=Math.floor(R/3600);return N===1?n("emails.dateFormat.hoursAgo_single",{count:N}):n("emails.dateFormat.hoursAgo_plural",{count:N})}else return R<172800?n("emails.dateFormat.yesterday"):k.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit"})};return A?p.jsx("div",{className:"flex justify-center items-center p-8",children:p.jsx(Ps,{})}):o?p.jsxs("div",{className:"text-red-500",children:[n("common.error"),": ",o]}):c.length===0?p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("emails.title")}),p.jsx(dA,{onClick:v})]}),p.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:p.jsx("p",{className:"text-sm",children:n("emails.noEmailsDescription")})})]}):p.jsxs("div",{children:[p.jsxs("div",{className:"flex justify-between items-center mb-4",children:[p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("emails.title")}),p.jsx(dA,{onClick:v})]}),p.jsx("div",{className:"space-y-2",children:c.map(T=>p.jsxs(ec,{to:`/emails/${T.id}`,className:"block p-4 bg-white dark:bg-gray-800 rounded-lg shadow hover:shadow-md transition-shadow border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700",children:[p.jsxs("div",{className:"flex justify-between items-start mb-2",children:[p.jsx("div",{className:"text-sm text-gray-900 dark:text-white mb-1 font-bold",children:T.subject}),p.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:B(T.dateSystem)})]}),p.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 line-clamp-2",children:T.messagePreview})]},T.id))})]})},_I=()=>{const{isFullyInitialized:n}=BC();return n?p.jsx(zv,{to:"/reinitialize",replace:!0}):null},Wl=({onClick:n,children:r,type:a="button",variant:s="primary"})=>{const o={primary:"bg-primary-500 hover:bg-primary-600",secondary:"bg-gray-500 hover:bg-gray-600"};return p.jsx("button",{className:`${o[s]} text-white font-medium rounded-lg px-4 py-2 text-sm w-full`,onClick:n,type:a,children:r})},Xy=()=>{const[n,r]=M.useState(cr.DEFAULT_API_URL);return{apiUrl:n,setApiUrl:r,loadApiUrl:async()=>{const o=await Xe.getItem("local:apiUrl");o&&o.length>0?r(o):r(cr.DEFAULT_API_URL)},getDisplayUrl:()=>{const o=n.replace("https://","").replace("http://","").replace(":443","").replace("/api","");return o==="app.aliasvault.net"?"aliasvault.net":o}}},OI=()=>{const{loadApiUrl:n,getDisplayUrl:r}=Xy(),a=kr(),{t:s}=Bt();M.useEffect(()=>{n()},[n]);const o=()=>{a("/auth-settings")};return p.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mb-4",children:["(",s("auth.connectingTo")," ",p.jsx("button",{onClick:o,type:"button",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500 underline",children:r()}),")"]})};var yi={},Hf={},Gf,tp;function $y(){return tp||(tp=1,Gf=function(r){if(typeof r!="object"||r===null||typeof r.byteLength!="number")throw new TypeError("Expected input to be an ArrayBuffer");for(var a=new Uint8Array(r),s="",o,u=0;u<a.length;u++)o=a[u].toString(16),s+=o.length===1?"0"+o:o;return s}),Gf}var Vf,rp;function FI(){return rp||(rp=1,Vf=function(r){for(var a=[],s=r.length,o=0;o<s;o++){var u=r.charCodeAt(o);if(u>=55296&&u<=56319&&s>o+1){var c=r.charCodeAt(o+1);c>=56320&&c<=57343&&(u=(u-55296)*1024+c-56320+65536,o+=1)}if(u<128){a.push(u);continue}if(u<2048){a.push(u>>6|192),a.push(u&63|128);continue}if(u<55296||u>=57344&&u<65536){a.push(u>>12|224),a.push(u>>6&63|128),a.push(u&63|128);continue}if(u>=65536&&u<=1114111){a.push(u>>18|240),a.push(u>>12&63|128),a.push(u>>6&63|128),a.push(u&63|128);continue}a.push(239,191,189)}return new Uint8Array(a).buffer}),Vf}var qf,np;function jI(){return np||(np=1,qf=function(r){if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r.length%2!==0)throw new RangeError("Expected string to be an even number of characters");for(var a=new Uint8Array(r.length/2),s=0;s<r.length;s+=2)a[s/2]=parseInt(r.substring(s,s+2),16);return a.buffer}),qf}var zf,ap;function HI(){if(ap)return zf;ap=1;const n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(s,o,u){let c,d,m,A,b,v,B,T,Q,k,R,N,O,_=0,q=u.length;for(;q>=64;){for(c=o[0],d=o[1],m=o[2],A=o[3],b=o[4],v=o[5],B=o[6],T=o[7],k=0;k<16;k++)R=_+k*4,s[k]=(u[R]&255)<<24|(u[R+1]&255)<<16|(u[R+2]&255)<<8|u[R+3]&255;for(k=16;k<64;k++)Q=s[k-2],N=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,Q=s[k-15],O=(Q>>>7|Q<<25)^(Q>>>18|Q<<14)^Q>>>3,s[k]=(N+s[k-7]|0)+(O+s[k-16]|0);for(k=0;k<64;k++)N=(((b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&v^~b&B)|0)+(T+(n[k]+s[k]|0)|0)|0,O=((c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10))+(c&d^c&m^d&m)|0,T=B,B=v,v=b,b=A+N|0,A=m,m=d,d=c,c=N+O|0;o[0]+=c,o[1]+=d,o[2]+=m,o[3]+=A,o[4]+=b,o[5]+=v,o[6]+=B,o[7]+=T,_+=64,q-=64}}function a(s){const o=s.length,u=o%64,c=o%64<56?64:128,d=new Uint8Array(c),m=o/536870912|0,A=o<<3;return d.set(s.subarray(o-u)),d[u]=128,d[c-8]=m>>>24&255,d[c-7]=m>>>16&255,d[c-6]=m>>>8&255,d[c-5]=m>>>0&255,d[c-4]=A>>>24&255,d[c-3]=A>>>16&255,d[c-2]=A>>>8&255,d[c-1]=A>>>0&255,d}return zf=function(o){const u=new Int32Array(8),c=new Int32Array(64);u[0]=1779033703,u[1]=3144134277,u[2]=1013904242,u[3]=2773480762,u[4]=1359893119,u[5]=2600822924,u[6]=528734635,u[7]=1541459225;const d=new Uint8Array(o),m=a(d);r(c,u,d),r(c,u,m);const A=new Uint8Array(32);for(let b=0;b<8;b++)A[b*4+0]=u[b]>>>24&255,A[b*4+1]=u[b]>>>16&255,A[b*4+2]=u[b]>>>8&255,A[b*4+3]=u[b]>>>0&255;return A.buffer},zf}var Yf,ip;function GI(){return ip||(ip=1,Yf=function(n,r,a){if(n==null||r==null)return n;var s=String(n),o=typeof r=="number"?r:parseInt(r,10);if(isNaN(o)||!isFinite(o))return s;var u=s.length;if(u>=o)return s;var c=a==null?"":String(a);c===""&&(c=" ");for(var d=o-u;c.length<d;)c+=c;var m=c.length>d?c.substr(0,d):c;return m+s}),Yf}var Pf,sp;function VI(){if(sp)return Pf;sp=1;const n=$y();return Pf=function(a){const s=new Uint8Array(a);if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(s);else if(typeof msCrypto=="object"&&typeof msCrypto.getRandomValues=="function")msCrypto.getRandomValues(s);else throw new Error("No secure random number generator available");return n(s.buffer)},Pf}var ku={exports:{}},qI=ku.exports,lp;function zI(){return lp||(lp=1,function(n,r){(function(){var a,s=0xdeadbeefcafe,o=(s&16777215)==15715070;function u(I,D,F){I!=null&&(typeof I=="number"?this.fromNumber(I,D,F):D==null&&typeof I!="string"?this.fromString(I,256):this.fromString(I,D))}function c(){return new u(null)}function d(I,D,F,ee,we,Ie){for(;--Ie>=0;){var Ue=D*this[I++]+F[ee]+we;we=Math.floor(Ue/67108864),F[ee++]=Ue&67108863}return we}function m(I,D,F,ee,we,Ie){for(var Ue=D&32767,je=D>>15;--Ie>=0;){var vt=this[I]&32767,Oe=this[I++]>>15,Ar=je*vt+Oe*Ue;vt=Ue*vt+((Ar&32767)<<15)+F[ee]+(we&1073741823),we=(vt>>>30)+(Ar>>>15)+je*Oe+(we>>>30),F[ee++]=vt&1073741823}return we}function A(I,D,F,ee,we,Ie){for(var Ue=D&16383,je=D>>14;--Ie>=0;){var vt=this[I]&16383,Oe=this[I++]>>14,Ar=je*vt+Oe*Ue;vt=Ue*vt+((Ar&16383)<<14)+F[ee]+we,we=(vt>>28)+(Ar>>14)+je*Oe,F[ee++]=vt&268435455}return we}var b=typeof navigator<"u";b&&o&&navigator.appName=="Microsoft Internet Explorer"?(u.prototype.am=m,a=30):b&&o&&navigator.appName!="Netscape"?(u.prototype.am=d,a=26):(u.prototype.am=A,a=28),u.prototype.DB=a,u.prototype.DM=(1<<a)-1,u.prototype.DV=1<<a;var v=52;u.prototype.FV=Math.pow(2,v),u.prototype.F1=v-a,u.prototype.F2=2*a-v;var B="0123456789abcdefghijklmnopqrstuvwxyz",T=new Array,Q,k;for(Q=48,k=0;k<=9;++k)T[Q++]=k;for(Q=97,k=10;k<36;++k)T[Q++]=k;for(Q=65,k=10;k<36;++k)T[Q++]=k;function R(I){return B.charAt(I)}function N(I,D){var F=T[I.charCodeAt(D)];return F??-1}function O(I){for(var D=this.t-1;D>=0;--D)I[D]=this[D];I.t=this.t,I.s=this.s}function _(I){this.t=1,this.s=I<0?-1:0,I>0?this[0]=I:I<-1?this[0]=I+this.DV:this.t=0}function q(I){var D=c();return D.fromInt(I),D}function V(I,D){var F;if(D==16)F=4;else if(D==8)F=3;else if(D==256)F=8;else if(D==2)F=1;else if(D==32)F=5;else if(D==4)F=2;else{this.fromRadix(I,D);return}this.t=0,this.s=0;for(var ee=I.length,we=!1,Ie=0;--ee>=0;){var Ue=F==8?I[ee]&255:N(I,ee);if(Ue<0){I.charAt(ee)=="-"&&(we=!0);continue}we=!1,Ie==0?this[this.t++]=Ue:Ie+F>this.DB?(this[this.t-1]|=(Ue&(1<<this.DB-Ie)-1)<<Ie,this[this.t++]=Ue>>this.DB-Ie):this[this.t-1]|=Ue<<Ie,Ie+=F,Ie>=this.DB&&(Ie-=this.DB)}F==8&&(I[0]&128)!=0&&(this.s=-1,Ie>0&&(this[this.t-1]|=(1<<this.DB-Ie)-1<<Ie)),this.clamp(),we&&u.ZERO.subTo(this,this)}function ae(){for(var I=this.s&this.DM;this.t>0&&this[this.t-1]==I;)--this.t}function ge(I){if(this.s<0)return"-"+this.negate().toString(I);var D;if(I==16)D=4;else if(I==8)D=3;else if(I==2)D=1;else if(I==32)D=5;else if(I==4)D=2;else return this.toRadix(I);var F=(1<<D)-1,ee,we=!1,Ie="",Ue=this.t,je=this.DB-Ue*this.DB%D;if(Ue-- >0)for(je<this.DB&&(ee=this[Ue]>>je)>0&&(we=!0,Ie=R(ee));Ue>=0;)je<D?(ee=(this[Ue]&(1<<je)-1)<<D-je,ee|=this[--Ue]>>(je+=this.DB-D)):(ee=this[Ue]>>(je-=D)&F,je<=0&&(je+=this.DB,--Ue)),ee>0&&(we=!0),we&&(Ie+=R(ee));return we?Ie:"0"}function te(){var I=c();return u.ZERO.subTo(this,I),I}function J(){return this.s<0?this.negate():this}function P(I){var D=this.s-I.s;if(D!=0)return D;var F=this.t;if(D=F-I.t,D!=0)return this.s<0?-D:D;for(;--F>=0;)if((D=this[F]-I[F])!=0)return D;return 0}function $(I){var D=1,F;return(F=I>>>16)!=0&&(I=F,D+=16),(F=I>>8)!=0&&(I=F,D+=8),(F=I>>4)!=0&&(I=F,D+=4),(F=I>>2)!=0&&(I=F,D+=2),(F=I>>1)!=0&&(I=F,D+=1),D}function me(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM)}function he(I,D){var F;for(F=this.t-1;F>=0;--F)D[F+I]=this[F];for(F=I-1;F>=0;--F)D[F]=0;D.t=this.t+I,D.s=this.s}function Be(I,D){for(var F=I;F<this.t;++F)D[F-I]=this[F];D.t=Math.max(this.t-I,0),D.s=this.s}function pe(I,D){var F=I%this.DB,ee=this.DB-F,we=(1<<ee)-1,Ie=Math.floor(I/this.DB),Ue=this.s<<F&this.DM,je;for(je=this.t-1;je>=0;--je)D[je+Ie+1]=this[je]>>ee|Ue,Ue=(this[je]&we)<<F;for(je=Ie-1;je>=0;--je)D[je]=0;D[Ie]=Ue,D.t=this.t+Ie+1,D.s=this.s,D.clamp()}function K(I,D){D.s=this.s;var F=Math.floor(I/this.DB);if(F>=this.t){D.t=0;return}var ee=I%this.DB,we=this.DB-ee,Ie=(1<<ee)-1;D[0]=this[F]>>ee;for(var Ue=F+1;Ue<this.t;++Ue)D[Ue-F-1]|=(this[Ue]&Ie)<<we,D[Ue-F]=this[Ue]>>ee;ee>0&&(D[this.t-F-1]|=(this.s&Ie)<<we),D.t=this.t-F,D.clamp()}function ie(I,D){for(var F=0,ee=0,we=Math.min(I.t,this.t);F<we;)ee+=this[F]-I[F],D[F++]=ee&this.DM,ee>>=this.DB;if(I.t<this.t){for(ee-=I.s;F<this.t;)ee+=this[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=this.s}else{for(ee+=this.s;F<I.t;)ee-=I[F],D[F++]=ee&this.DM,ee>>=this.DB;ee-=I.s}D.s=ee<0?-1:0,ee<-1?D[F++]=this.DV+ee:ee>0&&(D[F++]=ee),D.t=F,D.clamp()}function Ne(I,D){var F=this.abs(),ee=I.abs(),we=F.t;for(D.t=we+ee.t;--we>=0;)D[we]=0;for(we=0;we<ee.t;++we)D[we+F.t]=F.am(0,ee[we],D,we,0,F.t);D.s=0,D.clamp(),this.s!=I.s&&u.ZERO.subTo(D,D)}function _e(I){for(var D=this.abs(),F=I.t=2*D.t;--F>=0;)I[F]=0;for(F=0;F<D.t-1;++F){var ee=D.am(F,D[F],I,2*F,0,1);(I[F+D.t]+=D.am(F+1,2*D[F],I,2*F+1,ee,D.t-F-1))>=D.DV&&(I[F+D.t]-=D.DV,I[F+D.t+1]=1)}I.t>0&&(I[I.t-1]+=D.am(F,D[F],I,2*F,0,1)),I.s=0,I.clamp()}function G(I,D,F){var ee=I.abs();if(!(ee.t<=0)){var we=this.abs();if(we.t<ee.t){D!=null&&D.fromInt(0),F!=null&&this.copyTo(F);return}F==null&&(F=c());var Ie=c(),Ue=this.s,je=I.s,vt=this.DB-$(ee[ee.t-1]);vt>0?(ee.lShiftTo(vt,Ie),we.lShiftTo(vt,F)):(ee.copyTo(Ie),we.copyTo(F));var Oe=Ie.t,Ar=Ie[Oe-1];if(Ar!=0){var Wt=Ar*(1<<this.F1)+(Oe>1?Ie[Oe-2]>>this.F2:0),Vr=this.FV/Wt,ln=(1<<this.F1)/Wt,Ut=1<<this.F2,Vt=F.t,Mr=Vt-Oe,nr=D??c();for(Ie.dlShiftTo(Mr,nr),F.compareTo(nr)>=0&&(F[F.t++]=1,F.subTo(nr,F)),u.ONE.dlShiftTo(Oe,nr),nr.subTo(Ie,Ie);Ie.t<Oe;)Ie[Ie.t++]=0;for(;--Mr>=0;){var h=F[--Vt]==Ar?this.DM:Math.floor(F[Vt]*Vr+(F[Vt-1]+Ut)*ln);if((F[Vt]+=Ie.am(0,h,F,Mr,0,Oe))<h)for(Ie.dlShiftTo(Mr,nr),F.subTo(nr,F);F[Vt]<--h;)F.subTo(nr,F)}D!=null&&(F.drShiftTo(Oe,D),Ue!=je&&u.ZERO.subTo(D,D)),F.t=Oe,F.clamp(),vt>0&&F.rShiftTo(vt,F),Ue<0&&u.ZERO.subTo(F,F)}}}function ne(I){var D=c();return this.abs().divRemTo(I,null,D),this.s<0&&D.compareTo(u.ZERO)>0&&I.subTo(D,D),D}function Ee(I){this.m=I}function ke(I){return I.s<0||I.compareTo(this.m)>=0?I.mod(this.m):I}function He(I){return I}function Ke(I){I.divRemTo(this.m,null,I)}function Ge(I,D,F){I.multiplyTo(D,F),this.reduce(F)}function yt(I,D){I.squareTo(D),this.reduce(D)}Ee.prototype.convert=ke,Ee.prototype.revert=He,Ee.prototype.reduce=Ke,Ee.prototype.mulTo=Ge,Ee.prototype.sqrTo=yt;function We(){if(this.t<1)return 0;var I=this[0];if((I&1)==0)return 0;var D=I&3;return D=D*(2-(I&15)*D)&15,D=D*(2-(I&255)*D)&255,D=D*(2-((I&65535)*D&65535))&65535,D=D*(2-I*D%this.DV)%this.DV,D>0?this.DV-D:-D}function Et(I){this.m=I,this.mp=I.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<I.DB-15)-1,this.mt2=2*I.t}function Kt(I){var D=c();return I.abs().dlShiftTo(this.m.t,D),D.divRemTo(this.m,null,D),I.s<0&&D.compareTo(u.ZERO)>0&&this.m.subTo(D,D),D}function Nr(I){var D=c();return I.copyTo(D),this.reduce(D),D}function Lt(I){for(;I.t<=this.mt2;)I[I.t++]=0;for(var D=0;D<this.m.t;++D){var F=I[D]&32767,ee=F*this.mpl+((F*this.mph+(I[D]>>15)*this.mpl&this.um)<<15)&I.DM;for(F=D+this.m.t,I[F]+=this.m.am(0,ee,I,D,0,this.m.t);I[F]>=I.DV;)I[F]-=I.DV,I[++F]++}I.clamp(),I.drShiftTo(this.m.t,I),I.compareTo(this.m)>=0&&I.subTo(this.m,I)}function Ht(I,D){I.squareTo(D),this.reduce(D)}function jt(I,D,F){I.multiplyTo(D,F),this.reduce(F)}Et.prototype.convert=Kt,Et.prototype.revert=Nr,Et.prototype.reduce=Lt,Et.prototype.mulTo=jt,Et.prototype.sqrTo=Ht;function br(){return(this.t>0?this[0]&1:this.s)==0}function Qe(I,D){if(I>4294967295||I<1)return u.ONE;var F=c(),ee=c(),we=D.convert(this),Ie=$(I)-1;for(we.copyTo(F);--Ie>=0;)if(D.sqrTo(F,ee),(I&1<<Ie)>0)D.mulTo(ee,we,F);else{var Ue=F;F=ee,ee=Ue}return D.revert(F)}function Fe(I,D){var F;return I<256||D.isEven()?F=new Ee(D):F=new Et(D),this.exp(I,F)}u.prototype.copyTo=O,u.prototype.fromInt=_,u.prototype.fromString=V,u.prototype.clamp=ae,u.prototype.dlShiftTo=he,u.prototype.drShiftTo=Be,u.prototype.lShiftTo=pe,u.prototype.rShiftTo=K,u.prototype.subTo=ie,u.prototype.multiplyTo=Ne,u.prototype.squareTo=_e,u.prototype.divRemTo=G,u.prototype.invDigit=We,u.prototype.isEven=br,u.prototype.exp=Qe,u.prototype.toString=ge,u.prototype.negate=te,u.prototype.abs=J,u.prototype.compareTo=P,u.prototype.bitLength=me,u.prototype.mod=ne,u.prototype.modPowInt=Fe,u.ZERO=q(0),u.ONE=q(1);function nt(){var I=c();return this.copyTo(I),I}function lt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function j(){return this.t==0?this.s:this[0]<<24>>24}function X(){return this.t==0?this.s:this[0]<<16>>16}function le(I){return Math.floor(Math.LN2*this.DB/Math.log(I))}function Te(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Re(I){if(I==null&&(I=10),this.signum()==0||I<2||I>36)return"0";var D=this.chunkSize(I),F=Math.pow(I,D),ee=q(F),we=c(),Ie=c(),Ue="";for(this.divRemTo(ee,we,Ie);we.signum()>0;)Ue=(F+Ie.intValue()).toString(I).substr(1)+Ue,we.divRemTo(ee,we,Ie);return Ie.intValue().toString(I)+Ue}function xe(I,D){this.fromInt(0),D==null&&(D=10);for(var F=this.chunkSize(D),ee=Math.pow(D,F),we=!1,Ie=0,Ue=0,je=0;je<I.length;++je){var vt=N(I,je);if(vt<0){I.charAt(je)=="-"&&this.signum()==0&&(we=!0);continue}Ue=D*Ue+vt,++Ie>=F&&(this.dMultiply(ee),this.dAddOffset(Ue,0),Ie=0,Ue=0)}Ie>0&&(this.dMultiply(Math.pow(D,Ie)),this.dAddOffset(Ue,0)),we&&u.ZERO.subTo(this,this)}function Ve(I,D,F){if(typeof D=="number")if(I<2)this.fromInt(1);else for(this.fromNumber(I,F),this.testBit(I-1)||this.bitwiseTo(u.ONE.shiftLeft(I-1),Le,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(D);)this.dAddOffset(2,0),this.bitLength()>I&&this.subTo(u.ONE.shiftLeft(I-1),this);else{var ee=new Array,we=I&7;ee.length=(I>>3)+1,D.nextBytes(ee),we>0?ee[0]&=(1<<we)-1:ee[0]=0,this.fromString(ee,256)}}function S(){var I=this.t,D=new Array;D[0]=this.s;var F=this.DB-I*this.DB%8,ee,we=0;if(I-- >0)for(F<this.DB&&(ee=this[I]>>F)!=(this.s&this.DM)>>F&&(D[we++]=ee|this.s<<this.DB-F);I>=0;)F<8?(ee=(this[I]&(1<<F)-1)<<8-F,ee|=this[--I]>>(F+=this.DB-8)):(ee=this[I]>>(F-=8)&255,F<=0&&(F+=this.DB,--I)),(ee&128)!=0&&(ee|=-256),we==0&&(this.s&128)!=(ee&128)&&++we,(we>0||ee!=this.s)&&(D[we++]=ee);return D}function E(I){return this.compareTo(I)==0}function x(I){return this.compareTo(I)<0?this:I}function H(I){return this.compareTo(I)>0?this:I}function W(I,D,F){var ee,we,Ie=Math.min(I.t,this.t);for(ee=0;ee<Ie;++ee)F[ee]=D(this[ee],I[ee]);if(I.t<this.t){for(we=I.s&this.DM,ee=Ie;ee<this.t;++ee)F[ee]=D(this[ee],we);F.t=this.t}else{for(we=this.s&this.DM,ee=Ie;ee<I.t;++ee)F[ee]=D(we,I[ee]);F.t=I.t}F.s=D(this.s,I.s),F.clamp()}function fe(I,D){return I&D}function be(I){var D=c();return this.bitwiseTo(I,fe,D),D}function Le(I,D){return I|D}function gt(I){var D=c();return this.bitwiseTo(I,Le,D),D}function ft(I,D){return I^D}function bt(I){var D=c();return this.bitwiseTo(I,ft,D),D}function ot(I,D){return I&~D}function es(I){var D=c();return this.bitwiseTo(I,ot,D),D}function sn(){for(var I=c(),D=0;D<this.t;++D)I[D]=this.DM&~this[D];return I.t=this.t,I.s=~this.s,I}function Ma(I){var D=c();return I<0?this.rShiftTo(-I,D):this.lShiftTo(I,D),D}function Pn(I){var D=c();return I<0?this.lShiftTo(-I,D):this.rShiftTo(I,D),D}function ts(I){if(I==0)return-1;var D=0;return(I&65535)==0&&(I>>=16,D+=16),(I&255)==0&&(I>>=8,D+=8),(I&15)==0&&(I>>=4,D+=4),(I&3)==0&&(I>>=2,D+=2),(I&1)==0&&++D,D}function Me(){for(var I=0;I<this.t;++I)if(this[I]!=0)return I*this.DB+ts(this[I]);return this.s<0?this.t*this.DB:-1}function rs(I){for(var D=0;I!=0;)I&=I-1,++D;return D}function Ci(){for(var I=0,D=this.s&this.DM,F=0;F<this.t;++F)I+=rs(this[F]^D);return I}function vr(I){var D=Math.floor(I/this.DB);return D>=this.t?this.s!=0:(this[D]&1<<I%this.DB)!=0}function _a(I,D){var F=u.ONE.shiftLeft(I);return this.bitwiseTo(F,D,F),F}function wi(I){return this.changeBit(I,Le)}function Jr(I){return this.changeBit(I,ot)}function _t(I){return this.changeBit(I,ft)}function dr(I,D){for(var F=0,ee=0,we=Math.min(I.t,this.t);F<we;)ee+=this[F]+I[F],D[F++]=ee&this.DM,ee>>=this.DB;if(I.t<this.t){for(ee+=I.s;F<this.t;)ee+=this[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=this.s}else{for(ee+=this.s;F<I.t;)ee+=I[F],D[F++]=ee&this.DM,ee>>=this.DB;ee+=I.s}D.s=ee<0?-1:0,ee>0?D[F++]=ee:ee<-1&&(D[F++]=this.DV+ee),D.t=F,D.clamp()}function Jt(I){var D=c();return this.addTo(I,D),D}function Oa(I){var D=c();return this.subTo(I,D),D}function Kn(I){var D=c();return this.multiplyTo(I,D),D}function ns(){var I=c();return this.squareTo(I),I}function Ii(I){var D=c();return this.divRemTo(I,D,null),D}function En(I){var D=c();return this.divRemTo(I,null,D),D}function tr(I){var D=c(),F=c();return this.divRemTo(I,D,F),new Array(D,F)}function kn(I){this[this.t]=this.am(0,I-1,this,0,0,this.t),++this.t,this.clamp()}function Jn(I,D){if(I!=0){for(;this.t<=D;)this[this.t++]=0;for(this[D]+=I;this[D]>=this.DV;)this[D]-=this.DV,++D>=this.t&&(this[this.t++]=0),++this[D]}}function Gr(){}function Ln(I){return I}function Gt(I,D,F){I.multiplyTo(D,F)}function Bi(I,D){I.squareTo(D)}Gr.prototype.convert=Ln,Gr.prototype.revert=Ln,Gr.prototype.mulTo=Gt,Gr.prototype.sqrTo=Bi;function fa(I){return this.exp(I,new Gr)}function Un(I,D,F){var ee=Math.min(this.t+I.t,D);for(F.s=0,F.t=ee;ee>0;)F[--ee]=0;var we;for(we=F.t-this.t;ee<we;++ee)F[ee+this.t]=this.am(0,I[ee],F,ee,0,this.t);for(we=Math.min(I.t,D);ee<we;++ee)this.am(0,I[ee],F,ee,0,D-ee);F.clamp()}function fr(I,D,F){--D;var ee=F.t=this.t+I.t-D;for(F.s=0;--ee>=0;)F[ee]=0;for(ee=Math.max(D-this.t,0);ee<I.t;++ee)F[this.t+ee-D]=this.am(D-ee,I[ee],F,0,0,this.t+ee-D);F.clamp(),F.drShiftTo(1,F)}function Xr(I){this.r2=c(),this.q3=c(),u.ONE.dlShiftTo(2*I.t,this.r2),this.mu=this.r2.divide(I),this.m=I}function Fa(I){if(I.s<0||I.t>2*this.m.t)return I.mod(this.m);if(I.compareTo(this.m)<0)return I;var D=c();return I.copyTo(D),this.reduce(D),D}function Si(I){return I}function as(I){for(I.drShiftTo(this.m.t-1,this.r2),I.t>this.m.t+1&&(I.t=this.m.t+1,I.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);I.compareTo(this.r2)<0;)I.dAddOffset(1,this.m.t+1);for(I.subTo(this.r2,I);I.compareTo(this.m)>=0;)I.subTo(this.m,I)}function bn(I,D){I.squareTo(D),this.reduce(D)}function Aa(I,D,F){I.multiplyTo(D,F),this.reduce(F)}Xr.prototype.convert=Fa,Xr.prototype.revert=Si,Xr.prototype.reduce=as,Xr.prototype.mulTo=Aa,Xr.prototype.sqrTo=bn;function Ur(I,D){var F=I.bitLength(),ee,we=q(1),Ie;if(F<=0)return we;F<18?ee=1:F<48?ee=3:F<144?ee=4:F<768?ee=5:ee=6,F<8?Ie=new Ee(D):D.isEven()?Ie=new Xr(D):Ie=new Et(D);var Ue=new Array,je=3,vt=ee-1,Oe=(1<<ee)-1;if(Ue[1]=Ie.convert(this),ee>1){var Ar=c();for(Ie.sqrTo(Ue[1],Ar);je<=Oe;)Ue[je]=c(),Ie.mulTo(Ar,Ue[je-2],Ue[je]),je+=2}var Wt=I.t-1,Vr,ln=!0,Ut=c(),Vt;for(F=$(I[Wt])-1;Wt>=0;){for(F>=vt?Vr=I[Wt]>>F-vt&Oe:(Vr=(I[Wt]&(1<<F+1)-1)<<vt-F,Wt>0&&(Vr|=I[Wt-1]>>this.DB+F-vt)),je=ee;(Vr&1)==0;)Vr>>=1,--je;if((F-=je)<0&&(F+=this.DB,--Wt),ln)Ue[Vr].copyTo(we),ln=!1;else{for(;je>1;)Ie.sqrTo(we,Ut),Ie.sqrTo(Ut,we),je-=2;je>0?Ie.sqrTo(we,Ut):(Vt=we,we=Ut,Ut=Vt),Ie.mulTo(Ut,Ue[Vr],we)}for(;Wt>=0&&(I[Wt]&1<<F)==0;)Ie.sqrTo(we,Ut),Vt=we,we=Ut,Ut=Vt,--F<0&&(F=this.DB-1,--Wt)}return Ie.revert(we)}function ja(I){var D=this.s<0?this.negate():this.clone(),F=I.s<0?I.negate():I.clone();if(D.compareTo(F)<0){var ee=D;D=F,F=ee}var we=D.getLowestSetBit(),Ie=F.getLowestSetBit();if(Ie<0)return D;for(we<Ie&&(Ie=we),Ie>0&&(D.rShiftTo(Ie,D),F.rShiftTo(Ie,F));D.signum()>0;)(we=D.getLowestSetBit())>0&&D.rShiftTo(we,D),(we=F.getLowestSetBit())>0&&F.rShiftTo(we,F),D.compareTo(F)>=0?(D.subTo(F,D),D.rShiftTo(1,D)):(F.subTo(D,F),F.rShiftTo(1,F));return Ie>0&&F.lShiftTo(Ie,F),F}function Mn(I){if(I<=0)return 0;var D=this.DV%I,F=this.s<0?I-1:0;if(this.t>0)if(D==0)F=this[0]%I;else for(var ee=this.t-1;ee>=0;--ee)F=(D*F+this[ee])%I;return F}function vn(I){var D=I.isEven();if(this.isEven()&&D||I.signum()==0)return u.ZERO;for(var F=I.clone(),ee=this.clone(),we=q(1),Ie=q(0),Ue=q(0),je=q(1);F.signum()!=0;){for(;F.isEven();)F.rShiftTo(1,F),D?((!we.isEven()||!Ie.isEven())&&(we.addTo(this,we),Ie.subTo(I,Ie)),we.rShiftTo(1,we)):Ie.isEven()||Ie.subTo(I,Ie),Ie.rShiftTo(1,Ie);for(;ee.isEven();)ee.rShiftTo(1,ee),D?((!Ue.isEven()||!je.isEven())&&(Ue.addTo(this,Ue),je.subTo(I,je)),Ue.rShiftTo(1,Ue)):je.isEven()||je.subTo(I,je),je.rShiftTo(1,je);F.compareTo(ee)>=0?(F.subTo(ee,F),D&&we.subTo(Ue,we),Ie.subTo(je,Ie)):(ee.subTo(F,ee),D&&Ue.subTo(we,Ue),je.subTo(Ie,je))}if(ee.compareTo(u.ONE)!=0)return u.ZERO;if(je.compareTo(I)>=0)return je.subtract(I);if(je.signum()<0)je.addTo(I,je);else return je;return je.signum()<0?je.add(I):je}var $t=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ha=(1<<26)/$t[$t.length-1];function is(I){var D,F=this.abs();if(F.t==1&&F[0]<=$t[$t.length-1]){for(D=0;D<$t.length;++D)if(F[0]==$t[D])return!0;return!1}if(F.isEven())return!1;for(D=1;D<$t.length;){for(var ee=$t[D],we=D+1;we<$t.length&&ee<Ha;)ee*=$t[we++];for(ee=F.modInt(ee);D<we;)if(ee%$t[D++]==0)return!1}return F.millerRabin(I)}function ss(I){var D=this.subtract(u.ONE),F=D.getLowestSetBit();if(F<=0)return!1;var ee=D.shiftRight(F);I=I+1>>1,I>$t.length&&(I=$t.length);for(var we=c(),Ie=0;Ie<I;++Ie){we.fromInt($t[Math.floor(Math.random()*$t.length)]);var Ue=we.modPow(ee,this);if(Ue.compareTo(u.ONE)!=0&&Ue.compareTo(D)!=0){for(var je=1;je++<F&&Ue.compareTo(D)!=0;)if(Ue=Ue.modPowInt(2,this),Ue.compareTo(u.ONE)==0)return!1;if(Ue.compareTo(D)!=0)return!1}}return!0}u.prototype.chunkSize=le,u.prototype.toRadix=Re,u.prototype.fromRadix=xe,u.prototype.fromNumber=Ve,u.prototype.bitwiseTo=W,u.prototype.changeBit=_a,u.prototype.addTo=dr,u.prototype.dMultiply=kn,u.prototype.dAddOffset=Jn,u.prototype.multiplyLowerTo=Un,u.prototype.multiplyUpperTo=fr,u.prototype.modInt=Mn,u.prototype.millerRabin=ss,u.prototype.clone=nt,u.prototype.intValue=lt,u.prototype.byteValue=j,u.prototype.shortValue=X,u.prototype.signum=Te,u.prototype.toByteArray=S,u.prototype.equals=E,u.prototype.min=x,u.prototype.max=H,u.prototype.and=be,u.prototype.or=gt,u.prototype.xor=bt,u.prototype.andNot=es,u.prototype.not=sn,u.prototype.shiftLeft=Ma,u.prototype.shiftRight=Pn,u.prototype.getLowestSetBit=Me,u.prototype.bitCount=Ci,u.prototype.testBit=vr,u.prototype.setBit=wi,u.prototype.clearBit=Jr,u.prototype.flipBit=_t,u.prototype.add=Jt,u.prototype.subtract=Oa,u.prototype.multiply=Kn,u.prototype.divide=Ii,u.prototype.remainder=En,u.prototype.divideAndRemainder=tr,u.prototype.modPow=Ur,u.prototype.modInverse=vn,u.prototype.pow=fa,u.prototype.gcd=ja,u.prototype.isProbablePrime=is,u.prototype.square=ns,u.prototype.Barrett=Xr;var Ot,ut,Tt;function _n(I){ut[Tt++]^=I&255,ut[Tt++]^=I>>8&255,ut[Tt++]^=I>>16&255,ut[Tt++]^=I>>24&255,Tt>=ga&&(Tt-=ga)}function Xn(){_n(new Date().getTime())}if(ut==null){ut=new Array,Tt=0;var rr;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var Ga=new Uint8Array(32);for(window.crypto.getRandomValues(Ga),rr=0;rr<32;++rr)ut[Tt++]=Ga[rr]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Tr=window.crypto.random(32);for(rr=0;rr<Tr.length;++rr)ut[Tt++]=Tr.charCodeAt(rr)&255}}for(;Tt<ga;)rr=Math.floor(65536*Math.random()),ut[Tt++]=rr>>>8,ut[Tt++]=rr&255;Tt=0,Xn()}function Ni(){if(Ot==null){for(Xn(),Ot=Cn(),Ot.init(ut),Tt=0;Tt<ut.length;++Tt)ut[Tt]=0;Tt=0}return Ot.next()}function $n(I){var D;for(D=0;D<I.length;++D)I[D]=Ni()}function ha(){}ha.prototype.nextBytes=$n;function xn(){this.i=0,this.j=0,this.S=new Array}function Va(I){var D,F,ee;for(D=0;D<256;++D)this.S[D]=D;for(F=0,D=0;D<256;++D)F=F+this.S[D]+I[D%I.length]&255,ee=this.S[D],this.S[D]=this.S[F],this.S[F]=ee;this.i=0,this.j=0}function Ti(){var I;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,I=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=I,this.S[I+this.S[this.i]&255]}xn.prototype.init=Va,xn.prototype.next=Ti;function Cn(){return new xn}var ga=256;n.exports={default:u,BigInteger:u,SecureRandom:ha}}).call(qI)}(ku)),ku.exports}var Kf,op;function LA(){if(op)return Kf;op=1;const n=GI(),r=VI(),{BigInteger:a}=zI(),s=Symbol("big-integer"),o=Symbol("hex-length");class u{constructor(d,m){this[s]=d,this[o]=m}add(d){return new u(this[s].add(d[s]),null)}equals(d){return this[s].equals(d[s])}multiply(d){return new u(this[s].multiply(d[s]),null)}modPow(d,m){return new u(this[s].modPow(d[s],m[s]),m[o])}mod(d){return new u(this[s].mod(d[s]),d[o])}subtract(d){return new u(this[s].subtract(d[s]),this[o])}xor(d){return new u(this[s].xor(d[s]),this[o])}pad(d){if(d<this[o])throw new Error("Cannot pad to a shorter length");return new u(this[s],d)}inspect(){const d=this[s].toString(16);return`<SRPInteger ${d.slice(0,16)}${d.length>16?"...":""}>`}toHex(){if(this[o]===null)throw new Error("This SRPInteger has no specified length");return n(this[s].toString(16),this[o],"0")}}return u.fromHex=function(c){return new u(new a(c,16),c.length)},u.randomInteger=function(c){return u.fromHex(r(c))},u.ZERO=new u(new a("0"),null),Kf=u,Kf}var Jf,up;function YI(){if(up)return Jf;up=1;const n=$y(),r=FI(),a=jI(),s=HI(),o=LA();function u(c){const d=c.reduce((A,b)=>A+b.byteLength,0),m=new Uint8Array(d);return c.reduce((A,b)=>(m.set(new Uint8Array(b),A),A+b.byteLength),0),m.buffer}return Jf=function(...d){const m=u(d.map(A=>{if(A instanceof o)return a(A.toHex());if(typeof A=="string")return r(A);throw new TypeError("Expected string or SRPInteger")}));return o.fromHex(n(s(m)))},Jf}var cp;function PI(){return cp||(cp=1,function(n){const r=YI(),a=LA(),s={largeSafePrime:`
    AC6BDB41 324A9A9B F166DE5E 1389582F AF72B665 1987EE07 FC319294
    3DB56050 A37329CB B4A099ED 8193E075 7767A13D D52312AB 4B03310D
    CD7F48A9 DA04FD50 E8083969 EDB767B0 CF609517 9A163AB3 661A05FB
    D5FAAAE8 2918A996 2F0B93B8 55F97993 EC975EEA A80D740A DBF4FF74
    7359D041 D5C33EA7 1D281E44 6B14773B CA97B43A 23FB8016 76BD207A
    436C6481 F1D2B907 8717461A 5B9D32E6 88F87748 544523B5 24B0D57D
    5EA77A27 75D2ECFA 032CFBDB F52FB378 61602790 04E57AE6 AF874E73
    03CE5329 9CCC041C 7BC308D8 2A5698F3 A8D0C382 71AE35F8 E9DBFBB6
    94B5C803 D89F7AE4 35DE236D 525F5475 9B65E372 FCD68EF2 0FA7111F
    9E4AFF73
  `,generatorModulo:"02",hashOutputBytes:256/8,paddedLength:512};function o(u){return u.pad(s.paddedLength)}n.N=a.fromHex(s.largeSafePrime.replace(/\s+/g,"")),n.g=a.fromHex(s.generatorModulo.replace(/\s+/g,"")),n.k=r(n.N,o(n.g)),n.H=r,n.PAD=o,n.hashOutputBytes=s.hashOutputBytes}(Hf)),Hf}var dp;function KI(){if(dp)return yi;dp=1;const n=PI(),r=LA();return yi.generateSalt=function(){return r.randomInteger(n.hashOutputBytes).toHex()},yi.derivePrivateKey=function(a,s,o){const{H:u}=n,c=r.fromHex(a),d=String(s),m=String(o);return u(c,u(`${d}:${m}`)).toHex()},yi.deriveVerifier=function(a){const{N:s,g:o}=n,u=r.fromHex(a);return o.modPow(u,s).toHex()},yi.generateEphemeral=function(){const{N:a,g:s}=n,o=r.randomInteger(n.hashOutputBytes),u=s.modPow(o,a);return{secret:o.toHex(),public:u.toHex()}},yi.deriveSession=function(a,s,o,u,c){const{N:d,g:m,k:A,H:b,PAD:v}=n,B=r.fromHex(a),T=r.fromHex(s),Q=r.fromHex(o),k=String(u),R=r.fromHex(c),N=m.modPow(B,d);if(T.mod(d).equals(r.ZERO))throw new Error("The server sent an invalid public ephemeral");const O=b(v(N),v(T)),_=T.subtract(A.multiply(m.modPow(R,d))).modPow(B.add(O.multiply(R)),d),q=b(_),V=b(b(d).xor(b(m)),b(k),Q,N,T,q);return{key:q.toHex(),proof:V.toHex()}},yi.verifySession=function(a,s,o){const{H:u}=n,c=r.fromHex(a),d=r.fromHex(s.proof),m=r.fromHex(s.key),A=u(c,d,m);if(!r.fromHex(o).equals(A))throw new Error("Server provided session proof is invalid")},yi}var JI=KI();const Os=xi(JI);class Zl extends Error{constructor(r){super(r),this.name="ApiAuthError"}}class Wy{constructor(r){Br(this,"webApiService");this.webApiService=r}async initiateLogin(r){const a={username:r.toLowerCase().trim()},s=await this.webApiService.rawFetch("Auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.status===400){const u=await s.json();throw new Zl(u.title)}return await s.json()}async validateLogin(r,a,s,o){const u=Os.generateEphemeral(),c=Os.derivePrivateKey(o.salt,r,a),d=Os.deriveSession(u.secret,o.serverEphemeral,o.salt,r,c),m={username:r.toLowerCase().trim(),rememberMe:s,clientPublicEphemeral:u.public,clientSessionProof:d.proof},A=await this.webApiService.rawFetch("Auth/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(A.status===400){const v=await A.json();throw new Zl(v.title)}return await A.json()}async validateLogin2Fa(r,a,s,o,u){const c=Os.generateEphemeral(),d=Os.derivePrivateKey(o.salt,r,a),m=Os.deriveSession(c.secret,o.serverEphemeral,o.salt,r,d),A={username:r.toLowerCase().trim(),rememberMe:s,clientPublicEphemeral:c.public,clientSessionProof:m.proof,code2Fa:u},b=await this.webApiService.rawFetch("Auth/validate-2fa",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(b.status===400){const B=await b.json();throw new Zl(B.title)}return await b.json()}}const XI=()=>{const{t:n}=Bt(),r=kr(),a=Yn(),s=Lr(),{setHeaderButtons:o}=ca(),[u,c]=M.useState({username:"",password:""}),{showLoading:d,hideLoading:m,setIsInitialLoading:A}=yn(),[b,v]=M.useState(!0),[B,T]=M.useState(null),[Q,k]=M.useState(null),[R,N]=M.useState(null),[O,_]=M.useState(!1),[q,V]=M.useState(""),[ae,ge]=M.useState(null),[te,J]=M.useState(null),P=da(),$=new Wy(P);M.useEffect(()=>{(async()=>{const K=await Xe.getItem("local:clientUrl");let ie=cr.DEFAULT_CLIENT_URL;K&&K.length>0&&(ie=K),ge(ie),A(!1)})()},[A]),M.useEffect(()=>{const pe=yr.isPopup()?null:p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:"Open in new window",iconType:Kr.EXPAND})});return o(pe),()=>{o(null)}},[o]);const me=async pe=>{pe.preventDefault(),J(null);try{d(),a.clearGlobalMessage();const K=await $.initiateLogin(Hs.normalizeUsername(u.username)),ie=await Yt.deriveKeyFromPassword(u.password,K.salt,K.encryptionType,K.encryptionSettings),Ne=Xi.Buffer.from(ie).toString("hex").toUpperCase(),_e=Xi.Buffer.from(ie).toString("base64"),G=await $.validateLogin(Hs.normalizeUsername(u.username),Ne,b,K);if(G.requiresTwoFactor){T(K),k(Ne),N(_e),_(!0),m();return}if(!G.token)throw new Error(n("auth.errors.noToken"));const ne=await P.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${G.token.token}`}}),Ee=P.validateVaultResponse(ne,n);if(Ee){J(Ee),m();return}await a.setAuthTokens(Hs.normalizeUsername(u.username),G.token.token,G.token.refreshToken);const ke=await s.initializeDatabase(ne,_e);await a.login();try{if(await ke.hasPendingMigrations()){r("/upgrade",{replace:!0}),m();return}}catch(He){await a.logout(),J(He instanceof Error?He.message:n("auth.errors.migrationError")),m();return}r("/reinitialize",{replace:!0}),m()}catch(K){K instanceof Zl?J(n("common.apiErrors."+K.message)):J(n("auth.errors.serverError")),m()}},he=async pe=>{pe.preventDefault(),J(null);try{if(d(),!Q||!R||!B)throw new Error(n("auth.errors.loginDataMissing"));const K=q.trim();if(!/^\d{6}$/.test(K))throw new Error(n("auth.errors.invalidCode"));const ie=await $.validateLogin2Fa(Hs.normalizeUsername(u.username),Q,b,B,parseInt(q));if(!ie.token)throw new Error(n("auth.errors.noToken"));const Ne=await P.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${ie.token.token}`}}),_e=P.validateVaultResponse(Ne,n);if(_e){J(_e),m();return}await a.setAuthTokens(Hs.normalizeUsername(u.username),ie.token.token,ie.token.refreshToken);const G=await s.initializeDatabase(Ne,R);await a.login();try{if(await G.hasPendingMigrations()){r("/upgrade",{replace:!0}),m();return}}catch(ne){await a.logout(),J(ne instanceof Error?ne.message:n("auth.errors.migrationError")),m();return}r("/reinitialize",{replace:!0}),_(!1),V(""),k(null),N(null),T(null),m()}catch(K){console.error("2FA error:",K),K instanceof Zl?J(n("common.apiErrors."+K.message)):J(n("auth.errors.serverError")),m()}},Be=pe=>{const{name:K,value:ie}=pe.target;c(Ne=>({...Ne,[K]:ie}))};return O?p.jsx("div",{children:p.jsxs("form",{onSubmit:he,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[te&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:te}),p.jsxs("div",{className:"mb-6",children:[p.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:n("auth.twoFactorTitle")}),p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"twoFactorCode",children:n("auth.authCode")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline",id:"twoFactorCode",type:"text",value:q,onChange:pe=>V(pe.target.value),placeholder:n("auth.authCodePlaceholder"),required:!0})]}),p.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[p.jsx(Wl,{type:"submit",children:n("auth.verify")}),p.jsx(Wl,{type:"button",onClick:()=>{c({username:"",password:""}),_(!1),V(""),k(null),N(null),T(null),J(null)},variant:"secondary",children:n("auth.cancel")})]}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 text-center",children:n("auth.twoFactorNote")})]})}):p.jsxs("div",{children:[p.jsxs("form",{onSubmit:me,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[te&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:te}),p.jsx("h2",{className:"text-xl font-bold dark:text-gray-200",children:n("auth.loginTitle")}),p.jsx(OI,{}),p.jsxs("div",{className:"mb-4",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"username",children:n("auth.username")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline",id:"username",type:"text",name:"username",placeholder:n("auth.usernamePlaceholder"),value:u.username,onChange:Be,required:!0})]}),p.jsxs("div",{className:"mb-4",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"password",children:n("auth.password")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline",id:"password",type:"password",name:"password",placeholder:n("auth.passwordPlaceholder"),value:u.password,onChange:Be,required:!0})]}),p.jsx("div",{className:"mb-6",children:p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"checkbox",checked:b,onChange:pe=>v(pe.target.checked),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-200",children:n("auth.rememberMe")})]})}),p.jsx("div",{className:"flex w-full",children:p.jsx(Wl,{type:"submit",children:n("auth.loginButton")})})]}),p.jsxs("div",{className:"text-center text-sm text-gray-600 dark:text-gray-400",children:[n("auth.noAccount")," ",p.jsx("a",{href:ae??"",target:"_blank",rel:"noopener noreferrer",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500",children:n("auth.createVault")})]})]})},$I=()=>{const n=Yn(),r=da(),a=kr();return M.useEffect(()=>{(async()=>{await r.logout(),a("/login")})()},[n,a,r]),null},fp="session:lastVisitedPage",Ap="session:lastVisitedTime",hp="session:navigationHistory",WI=120*1e3,ZI=()=>{const n=kr(),{setIsInitialLoading:r}=yn(),{syncVault:a}=rc(),s=M.useRef(!1),{isInitialized:o,isLoggedIn:u}=Yn(),{dbInitialized:c,dbAvailable:d}=Lr(),m=o&&c,A=m&&(!u||!d),b=M.useCallback(async()=>{const[v,B,T]=await Promise.all([Xe.getItem(fp),Xe.getItem(Ap),Xe.getItem(hp)]);if(v&&B&&Date.now()-B<=WI){if(T!=null&&T.length){n("/credentials",{replace:!0});for(const k of T)n(k.pathname+k.search+k.hash);return}n("/credentials",{replace:!0}),n(v,{replace:!0});return}await Promise.all([Xe.removeItem(fp),Xe.removeItem(Ap),Xe.removeItem(hp),Dn("CLEAR_PERSISTED_FORM_VALUES",null,"background")]),n("/credentials",{replace:!0})},[n]);return M.useEffect(()=>{const B=new URLSearchParams(window.location.search).get("mode")==="inline_unlock";if(m){const T=!s.current;A?(r(!1),u?d||n("/unlock",{replace:!0}):n("/login",{replace:!0})):T?(s.current=!0,a({initialSync:!1,onSuccess:async()=>{B?(r(!1),n("/unlock-success",{replace:!0})):await b()},onError:Q=>{console.error("Vault sync error during initialization:",Q),b().then(()=>{r(!1)})},onUpgradeRequired:()=>{n("/upgrade",{replace:!0}),r(!1)}})):(r(!1),b())}},[m,A,u,d,n,r,a,b]),null};var kp,Lp;const e2=(Lp=(kp=globalThis.browser)==null?void 0:kp.runtime)!=null&&Lp.id?globalThis.browser:globalThis.chrome,t2=e2,gp="local:theme",Zy=M.createContext(void 0),r2=({children:n})=>{const[r,a]=M.useState("system"),[s,o]=M.useState(!1);M.useEffect(()=>{(async()=>{const b=await c();a(b)})()},[]);const u=M.useCallback(A=>{a(A),d(A)},[]),c=async()=>await Xe.getItem(gp)||"system",d=async A=>{await Xe.setItem(gp,A)};M.useEffect(()=>{const A=()=>{if(r==="system"){const b=window.matchMedia("(prefers-color-scheme: dark)").matches;o(b),document.documentElement.classList.toggle("dark",b)}else{const b=r==="dark";o(b),document.documentElement.classList.toggle("dark",b)}};if(A(),r==="system"){const b=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>A();return b.addEventListener("change",v),()=>b.removeEventListener("change",v)}},[r]);const m=M.useMemo(()=>({theme:r,setTheme:u,isDarkMode:s}),[r,s,u]);return p.jsx(Zy.Provider,{value:m,children:n})},n2=()=>{const n=M.useContext(Zy);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},a2=()=>{var q,V;const{t:n}=Bt(),{theme:r,setTheme:a}=n2(),s=Yn(),{setHeaderButtons:o}=ca(),{setIsInitialLoading:u}=yn(),{loadApiUrl:c,getDisplayUrl:d}=Xy(),m=kr(),[A,b]=M.useState({disabledUrls:[],temporaryDisabledUrls:{},currentUrl:"",isEnabled:!0,isGloballyEnabled:!0,isContextMenuEnabled:!0}),v=async()=>{const ae={active:!0,currentWindow:!0},[ge]=await t2.tabs.query(ae);return ge},B=async()=>{const ae=await Xe.getItem("local:clientUrl");let ge=cr.DEFAULT_CLIENT_URL;ae&&ae.length>0&&(ge=ae),window.open(ge,"_blank")};M.useEffect(()=>{const ae=p.jsxs("div",{className:"flex items-center gap-2",children:[!yr.isPopup()&&p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("settings.openInNewWindow"),iconType:Kr.EXPAND})}),p.jsx(an,{onClick:B,title:n("settings.openWebApp"),iconType:Kr.EXTERNAL_LINK})]});return o(ae),()=>o(null)},[o,n]);const T=M.useCallback(async()=>{const ae=await v(),ge=new URL(ae.url??"").hostname,te=await Xe.getItem(Tu)??[],J=await Xe.getItem(yu)??{},P=await Xe.getItem(Ou)!==!1,$=await Xe.getItem(Cm)!==!1,me=Date.now(),he=Object.fromEntries(Object.entries(J).filter(([Be,pe])=>pe>me));Object.keys(he).length!==Object.keys(J).length&&await Xe.setItem(yu,he),await c(),b({disabledUrls:te,temporaryDisabledUrls:he,currentUrl:ge,isEnabled:!te.includes(ge)&&!(ge in he),isGloballyEnabled:P,isContextMenuEnabled:$}),u(!1)},[u,c]);M.useEffect(()=>{T()},[T]);const Q=async()=>{const{currentUrl:ae,disabledUrls:ge,temporaryDisabledUrls:te,isEnabled:J}=A;let P=[...ge],$={...te};J?(P.includes(ae)||P.push(ae),delete $[ae]):(P=P.filter(me=>me!==ae),delete $[ae]),await Xe.setItem(Tu,P),await Xe.setItem(yu,$),b(me=>({...me,disabledUrls:P,temporaryDisabledUrls:$,isEnabled:!J}))},k=async()=>{await Xe.setItem(Tu,[]),await Xe.setItem(yu,{}),b(ae=>({...ae,disabledUrls:[],temporaryDisabledUrls:{},isEnabled:!0}))},R=async()=>{const ae=!A.isGloballyEnabled;await Xe.setItem(Ou,ae),b(ge=>({...ge,isGloballyEnabled:ae}))},N=async()=>{const ae=!A.isContextMenuEnabled;await Xe.setItem(Cm,ae),await Dn("TOGGLE_CONTEXT_MENU",{enabled:ae},"background"),b(ge=>({...ge,isContextMenuEnabled:ae}))},O=async ae=>{a(ae),b(ge=>({...ge,theme:ae}))},_=async()=>{m("/logout",{replace:!0})};return p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"flex justify-between items-center mb-4",children:p.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:n("settings.title")})}),p.jsx("section",{children:p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsx("div",{className:"p-4",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center space-x-3",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((V=(q=s.username)==null?void 0:q[0])==null?void 0:V.toUpperCase())||"?"})})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:s.username}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("settings.loggedIn")})]})]}),p.jsx("button",{onClick:_,className:"px-4 py-2 text-sm font-medium text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:n("settings.logout")})]})})})}),p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.globalSettings")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.autofillPopup")}),p.jsx("p",{className:`text-sm mt-1 ${A.isGloballyEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isGloballyEnabled?n("settings.activeOnAllSites"):n("settings.disabledOnAllSites")})]}),p.jsx("button",{onClick:R,className:`px-4 py-2 rounded-md transition-colors ${A.isGloballyEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isGloballyEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n("settings.rightClickContextMenu")}),p.jsx("p",{className:`text-sm mt-1 ${A.isContextMenuEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isContextMenuEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsx("button",{onClick:N,className:`px-4 py-2 rounded-md transition-colors ${A.isContextMenuEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isContextMenuEnabled?n("settings.enabled"):n("settings.disabled")})]})]})})]}),A.isGloballyEnabled&&p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.siteSpecificSettings")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:[n("settings.autofillPopupOn"),A.currentUrl]}),p.jsx("p",{className:`text-sm mt-1 ${A.isEnabled?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:A.isEnabled?n("settings.enabledForThisSite"):n("settings.disabledForThisSite")}),!A.isEnabled&&A.temporaryDisabledUrls[A.currentUrl]&&p.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:[n("settings.temporarilyDisabledUntil"),new Date(A.temporaryDisabledUrls[A.currentUrl]).toLocaleTimeString()]})]}),A.isGloballyEnabled&&p.jsx("button",{onClick:Q,className:`px-4 py-2 ml-1 rounded-md transition-colors ${A.isEnabled?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:A.isEnabled?n("settings.enabled"):n("settings.disabled")})]}),p.jsx("div",{className:"mt-4",children:p.jsx("button",{onClick:k,className:"w-full px-4 py-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 rounded-md text-gray-700 dark:text-gray-300 transition-colors text-sm",children:n("settings.resetAllSiteSettings")})})]})})]}),p.jsxs("section",{children:[p.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:n("settings.appearance")}),p.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:p.jsxs("div",{className:"p-4",children:[p.jsx("div",{className:"mb-4",children:p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white mb-3",children:n("settings.language")}),p.jsx(Ey,{variant:"dropdown",size:"sm"})]})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:n("settings.theme")}),p.jsxs("div",{className:"flex flex-col space-y-2",children:[p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"system",checked:r==="system",onChange:()=>O("system"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.useDefault")})]}),p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"light",checked:r==="light",onChange:()=>O("light"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.light")})]}),p.jsxs("label",{className:"flex items-center",children:[p.jsx("input",{type:"radio",name:"theme",value:"dark",checked:r==="dark",onChange:()=>O("dark"),className:"mr-2"}),p.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:n("settings.dark")})]})]})]})]})})]}),!1,p.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[n("settings.versionPrefix"),cr.VERSION," (",d(),")"]})]})},i2=()=>{var R,N;const{t:n}=Bt(),r=Yn(),a=Lr(),s=kr(),{setHeaderButtons:o}=ca(),u=da(),c=new Wy(u),[d,m]=M.useState(""),[A,b]=M.useState(null),{showLoading:v,hideLoading:B,setIsInitialLoading:T}=yn();M.useEffect(()=>{(async()=>{const _=await u.getStatus(),q=u.validateStatusResponse(_);q!==null&&(await u.logout(n("common.apiErrors."+q)),s("/logout")),T(!1)})()},[u,r,T,s,n]),M.useEffect(()=>{const O=yr.isPopup()?null:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND});return o(O),()=>{o(null)}},[o,n]);const Q=async O=>{O.preventDefault(),b(null),v();try{const _=await c.initiateLogin(r.username),q=await Yt.deriveKeyFromPassword(d,_.salt,_.encryptionType,_.encryptionSettings),V=await u.get("Vault"),ae=u.validateVaultResponse(V,n);if(ae){b(n("common.apiErrors."+ae)),B();return}const ge=Xi.Buffer.from(q).toString("base64");await a.initializeDatabase(V,ge),await Xe.setItem(Fu,0),s("/reinitialize",{replace:!0})}catch(_){b(n("auth.errors.wrongPassword")),console.error("Unlock error:",_)}finally{B()}},k=()=>{s("/logout",{replace:!0})};return p.jsx("div",{children:p.jsxs("form",{onSubmit:Q,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[p.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((N=(R=r.username)==null?void 0:R[0])==null?void 0:N.toUpperCase())||"?"})})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.username}),p.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("auth.loggedIn")})]})]}),p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:n("auth.unlockTitle")}),A&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:A}),p.jsxs("div",{className:"mb-2",children:[p.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"password",children:n("auth.masterPassword")}),p.jsx("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline",id:"password",type:"password",value:d,onChange:O=>m(O.target.value),placeholder:n("auth.passwordPlaceholder"),required:!0})]}),p.jsx(Wl,{type:"submit",children:n("auth.unlockVault")}),p.jsxs("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-200 mt-6",children:[n("auth.switchAccounts")," ",p.jsx("button",{onClick:k,className:"text-primary-700 hover:underline dark:text-primary-500",children:n("auth.logout")})]})]})})},s2=()=>{const n=kr(),{t:r}=Bt(),a=()=>{const s=new URL(window.location.href);s.searchParams.delete("mode"),window.history.replaceState({},"",s),n("/credentials")};return p.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[p.jsx("div",{className:"mb-4 text-green-600 dark:text-green-400",children:p.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),p.jsx("h2",{className:"text-xl font-semibold mb-4 text-gray-900 dark:text-white",children:r("auth.unlockSuccessTitle")}),p.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-400",children:r("auth.unlockSuccessDescription")}),p.jsxs("div",{className:"space-y-3 w-full",children:[p.jsx("button",{onClick:()=>window.close(),className:"w-full px-4 py-2 text-white bg-primary-600 rounded hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:r("auth.closePopup")}),p.jsx("button",{onClick:a,className:"w-full px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",children:r("auth.browseVault")})]})]})},l2=()=>{var Be;const{t:n}=Bt(),{username:r}=Yn(),a=Lr(),{sqliteClient:s}=a,{setHeaderButtons:o}=ca(),[u,c]=M.useState(!1),[d,m]=M.useState(null),[A,b]=M.useState(null),[v,B]=M.useState(null),[T,Q]=M.useState(!1),[k,R]=M.useState(!1),{setIsInitialLoading:N}=yn(),O=da(),{executeVaultMutation:_,isLoading:q,syncStatus:V}=Dy(),{syncVault:ae}=rc(),ge=kr();M.useEffect(()=>{const pe=yr.isPopup()?null:p.jsx(p.Fragment,{children:p.jsx(an,{onClick:()=>yr.openInNewPopup(),title:n("common.openInNewWindow"),iconType:Kr.EXPAND})});return o(pe),()=>{o(null)}},[o,n]);const te=M.useCallback(async()=>{try{if(s){const pe=s.getDatabaseVersion(),K=await s.getLatestDatabaseVersion();m(pe),b(K)}N(!1)}catch(pe){console.error("Failed to load version information:",pe),B(n("upgrade.alerts.unableToGetVersionInfo"))}},[s,N,n]);M.useEffect(()=>{te()},[te]);const J=async()=>{if(!s||!d||!A){B(n("upgrade.alerts.unableToGetVersionInfo"));return}if(await O.isSelfHosted()){Q(!0);return}await P()},P=async()=>{if(!s||!d||!A){B(n("upgrade.alerts.unableToGetVersionInfo"));return}c(!0),B(null);try{const K=new aA().getUpgradeVaultSql(d.revision,A.revision);if(!K.success)throw new Error(K.error??n("upgrade.alerts.upgradeFailed"));if(K.sqlCommands.length===0){await $();return}await _(async()=>{s.beginTransaction();for(let ie=0;ie<K.sqlCommands.length;ie++){const Ne=K.sqlCommands[ie];try{s.executeRaw(Ne)}catch(_e){throw console.error(`Error executing SQL command ${ie+1}:`,Ne,_e),s.rollbackTransaction(),new Error(n("upgrade.alerts.failedToApplyMigration",{current:ie+1,total:K.sqlCommands.length}))}}s.commitTransaction()},{skipSyncCheck:!0,onSuccess:()=>{$()},onError:ie=>{console.error("Upgrade failed:",ie),B(ie.message)}}),console.debug("executeVaultMutation done?")}catch(pe){console.error("Upgrade failed:",pe),B(pe instanceof Error?pe.message:n("upgrade.alerts.unknownErrorDuringUpgrade"))}finally{c(!1)}},$=async()=>{try{await ae({onSuccess:()=>{ge("/credentials")},onError:pe=>{console.error("Sync error after upgrade:",pe),ge("/credentials")}})}catch(pe){console.error("Error during post-upgrade sync:",pe),ge("/credentials")}},me=async()=>{ge("/logout")},he=()=>{R(!0)};return p.jsxs("div",{children:[(u||q)&&p.jsxs("div",{className:"fixed inset-0 flex flex-col justify-center items-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-50",children:[p.jsx(Ps,{}),p.jsx("div",{className:"text-sm text-gray-500 mt-2",children:V||n("upgrade.upgrading")})]}),p.jsx(Yu,{isOpen:T,onClose:()=>Q(!1),onConfirm:()=>{Q(!1),P()},title:n("upgrade.alerts.selfHostedServer"),message:n("upgrade.alerts.selfHostedWarning"),confirmText:n("upgrade.alerts.continueUpgrade"),cancelText:n("upgrade.alerts.cancel")}),p.jsx(Yu,{isOpen:k,onClose:()=>R(!1),onConfirm:()=>R(!1),title:n("upgrade.whatsNew"),message:`${n("upgrade.whatsNewDescription")}

${(A==null?void 0:A.description)??n("upgrade.noDescriptionAvailable")}`}),p.jsxs("form",{className:"w-full px-2 pt-2 pb-2 mb-4",children:[v&&p.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:v}),p.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:p.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((Be=r==null?void 0:r[0])==null?void 0:Be.toUpperCase())||"?"})})}),p.jsx("div",{children:p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r})})]}),p.jsx("h2",{className:"text-xl font-bold dark:text-gray-200 mb-4",children:n("upgrade.title")}),p.jsxs("div",{className:"mb-6",children:[p.jsx("p",{className:"text-gray-700 dark:text-gray-200 text-sm mb-4",children:n("upgrade.subtitle")}),p.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded p-4 mb-4",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:n("upgrade.versionInformation")}),p.jsx("button",{type:"button",onClick:he,className:"bg-gray-200 dark:bg-gray-600 text-gray-800 dark:text-gray-200 rounded-full w-6 h-6 flex items-center justify-center text-sm font-bold hover:bg-gray-300 dark:hover:bg-gray-500",title:n("upgrade.whatsNew"),children:"?"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("upgrade.yourVault")}),p.jsx("span",{className:"text-sm font-bold text-orange-600 dark:text-orange-400",children:(d==null?void 0:d.releaseVersion)??"..."})]}),p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("upgrade.newVersion")}),p.jsx("span",{className:"text-sm font-bold text-green-600 dark:text-green-400",children:(A==null?void 0:A.releaseVersion)??"..."})]})]})]})]}),p.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[p.jsx(Wl,{type:"button",onClick:J,children:u||q?V||n("upgrade.upgrading"):n("upgrade.upgrade")}),p.jsx("button",{type:"button",onClick:me,className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium py-2",disabled:u||q,children:n("upgrade.logout")})]})]})]})},o2=()=>{const{t:n}=Bt(),r=Yn(),{isInitialLoading:a}=yn(),[s,o]=sc(!0,150),[u,c]=M.useState(null),{headerButtons:d}=ca(),m=pn.useMemo(()=>[{path:"/",element:p.jsx(_I,{}),showBackButton:!1},{path:"/reinitialize",element:p.jsx(ZI,{}),showBackButton:!1},{path:"/login",element:p.jsx(XI,{}),showBackButton:!1},{path:"/unlock",element:p.jsx(i2,{}),showBackButton:!1},{path:"/unlock-success",element:p.jsx(s2,{}),showBackButton:!1},{path:"/upgrade",element:p.jsx(l2,{}),showBackButton:!1},{path:"/auth-settings",element:p.jsx(Nw,{}),showBackButton:!0,title:n("settings.title")},{path:"/credentials",element:p.jsx(kI,{}),showBackButton:!1},{path:"/credentials/add",element:p.jsx(Pm,{}),showBackButton:!0,title:n("credentials.addCredential")},{path:"/credentials/:id",element:p.jsx(DI,{}),showBackButton:!0,title:n("credentials.credentialDetails")},{path:"/credentials/:id/edit",element:p.jsx(Pm,{}),showBackButton:!0,title:n("credentials.editCredential")},{path:"/emails",element:p.jsx(MI,{}),showBackButton:!1},{path:"/emails/:id",element:p.jsx(UI,{}),showBackButton:!0,title:n("emails.title")},{path:"/settings",element:p.jsx(a2,{}),showBackButton:!1},{path:"/logout",element:p.jsx($I,{}),showBackButton:!1}],[n]);return M.useEffect(()=>{a||o(!1)},[a,o]),M.useEffect(()=>{r.globalMessage?c(r.globalMessage):c(null)},[r,r.globalMessage]),p.jsx(px,{children:p.jsx(IC,{children:p.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[s&&p.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50 flex items-center justify-center",children:p.jsx(Ps,{})}),p.jsx(yC,{routes:m,rightButtons:d}),p.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"calc(100% - 120px)"},children:p.jsxs("div",{className:"p-4 mb-16",children:[u&&p.jsx("p",{className:"text-red-500 mb-4",children:u}),p.jsx(Pv,{children:m.map(A=>p.jsx(Pp,{path:A.path,element:A.element},A.path))})]})}),p.jsx(Sx,{})]})})})},it=n=>typeof n=="string",Pl=()=>{let n,r;const a=new Promise((s,o)=>{n=s,r=o});return a.resolve=n,a.reject=r,a},mp=n=>n==null?"":""+n,u2=(n,r,a)=>{n.forEach(s=>{r[s]&&(a[s]=r[s])})},c2=/###/g,pp=n=>n&&n.indexOf("###")>-1?n.replace(c2,"."):n,yp=n=>!n||it(n),eo=(n,r,a)=>{const s=it(r)?r.split("."):r;let o=0;for(;o<s.length-1;){if(yp(n))return{};const u=pp(s[o]);!n[u]&&a&&(n[u]=new a),Object.prototype.hasOwnProperty.call(n,u)?n=n[u]:n={},++o}return yp(n)?{}:{obj:n,k:pp(s[o])}},Ep=(n,r,a)=>{const{obj:s,k:o}=eo(n,r,Object);if(s!==void 0||r.length===1){s[o]=a;return}let u=r[r.length-1],c=r.slice(0,r.length-1),d=eo(n,c,Object);for(;d.obj===void 0&&c.length;)u=`${c[c.length-1]}.${u}`,c=c.slice(0,c.length-1),d=eo(n,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${u}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${u}`]=a},d2=(n,r,a,s)=>{const{obj:o,k:u}=eo(n,r,Object);o[u]=o[u]||[],o[u].push(a)},Ju=(n,r)=>{const{obj:a,k:s}=eo(n,r);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},f2=(n,r,a)=>{const s=Ju(n,a);return s!==void 0?s:Ju(r,a)},eE=(n,r,a)=>{for(const s in r)s!=="__proto__"&&s!=="constructor"&&(s in n?it(n[s])||n[s]instanceof String||it(r[s])||r[s]instanceof String?a&&(n[s]=r[s]):eE(n[s],r[s],a):n[s]=r[s]);return n},Fs=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var A2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const h2=n=>it(n)?n.replace(/[&<>"'\/]/g,r=>A2[r]):n;class g2{constructor(r){this.capacity=r,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(r){const a=this.regExpMap.get(r);if(a!==void 0)return a;const s=new RegExp(r);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(r,s),this.regExpQueue.push(r),s}}const m2=[" ",",","?","!",";"],p2=new g2(20),y2=(n,r,a)=>{r=r||"",a=a||"";const s=m2.filter(c=>r.indexOf(c)<0&&a.indexOf(c)<0);if(s.length===0)return!0;const o=p2.getRegExp(`(${s.map(c=>c==="?"?"\\?":c).join("|")})`);let u=!o.test(n);if(!u){const c=n.indexOf(a);c>0&&!o.test(n.substring(0,c))&&(u=!0)}return u},fA=(n,r,a=".")=>{if(!n)return;if(n[r])return Object.prototype.hasOwnProperty.call(n,r)?n[r]:void 0;const s=r.split(a);let o=n;for(let u=0;u<s.length;){if(!o||typeof o!="object")return;let c,d="";for(let m=u;m<s.length;++m)if(m!==u&&(d+=a),d+=s[m],c=o[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&m<s.length-1)continue;u+=m-u+1;break}o=c}return o},ro=n=>n==null?void 0:n.replace("_","-"),E2={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,r){var a,s;(s=(a=console==null?void 0:console[n])==null?void 0:a.apply)==null||s.call(a,console,r)}};class Xu{constructor(r,a={}){this.init(r,a)}init(r,a={}){this.prefix=a.prefix||"i18next:",this.logger=r||E2,this.options=a,this.debug=a.debug}log(...r){return this.forward(r,"log","",!0)}warn(...r){return this.forward(r,"warn","",!0)}error(...r){return this.forward(r,"error","")}deprecate(...r){return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(r,a,s,o){return o&&!this.debug?null:(it(r[0])&&(r[0]=`${s}${this.prefix} ${r[0]}`),this.logger[a](r))}create(r){return new Xu(this.logger,{prefix:`${this.prefix}:${r}:`,...this.options})}clone(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new Xu(this.logger,r)}}var oa=new Xu;class lc{constructor(){this.observers={}}on(r,a){return r.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const o=this.observers[s].get(a)||0;this.observers[s].set(a,o+1)}),this}off(r,a){if(this.observers[r]){if(!a){delete this.observers[r];return}this.observers[r].delete(a)}}emit(r,...a){this.observers[r]&&Array.from(this.observers[r].entries()).forEach(([o,u])=>{for(let c=0;c<u;c++)o(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,u])=>{for(let c=0;c<u;c++)o.apply(o,[r,...a])})}}class bp extends lc{constructor(r,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=r||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}removeNamespaces(r){const a=this.options.ns.indexOf(r);a>-1&&this.options.ns.splice(a,1)}getResource(r,a,s,o={}){var A,b;const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;r.indexOf(".")>-1?d=r.split("."):(d=[r,a],s&&(Array.isArray(s)?d.push(...s):it(s)&&u?d.push(...s.split(u)):d.push(s)));const m=Ju(this.data,d);return!m&&!a&&!s&&r.indexOf(".")>-1&&(r=d[0],a=d[1],s=d.slice(2).join(".")),m||!c||!it(s)?m:fA((b=(A=this.data)==null?void 0:A[r])==null?void 0:b[a],s,u)}addResource(r,a,s,o,u={silent:!1}){const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=[r,a];s&&(d=d.concat(c?s.split(c):s)),r.indexOf(".")>-1&&(d=r.split("."),o=a,a=d[1]),this.addNamespaces(a),Ep(this.data,d,o),u.silent||this.emit("added",r,a,s,o)}addResources(r,a,s,o={silent:!1}){for(const u in s)(it(s[u])||Array.isArray(s[u]))&&this.addResource(r,a,u,s[u],{silent:!0});o.silent||this.emit("added",r,a,s)}addResourceBundle(r,a,s,o,u,c={silent:!1,skipCopy:!1}){let d=[r,a];r.indexOf(".")>-1&&(d=r.split("."),o=s,s=a,a=d[1]),this.addNamespaces(a);let m=Ju(this.data,d)||{};c.skipCopy||(s=JSON.parse(JSON.stringify(s))),o?eE(m,s,u):m={...m,...s},Ep(this.data,d,m),c.silent||this.emit("added",r,a,s)}removeResourceBundle(r,a){this.hasResourceBundle(r,a)&&delete this.data[r][a],this.removeNamespaces(a),this.emit("removed",r,a)}hasResourceBundle(r,a){return this.getResource(r,a)!==void 0}getResourceBundle(r,a){return a||(a=this.options.defaultNS),this.getResource(r,a)}getDataByLanguage(r){return this.data[r]}hasLanguageSomeTranslations(r){const a=this.getDataByLanguage(r);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}}var tE={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,r,a,s,o){return n.forEach(u=>{var c;r=((c=this.processors[u])==null?void 0:c.process(r,a,s,o))??r}),r}};const vp={},xp=n=>!it(n)&&typeof n!="boolean"&&typeof n!="number";class $u extends lc{constructor(r,a={}){super(),u2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=oa.create("translator")}changeLanguage(r){r&&(this.language=r)}exists(r,a={interpolation:{}}){const s={...a};if(r==null)return!1;const o=this.resolve(r,s);return(o==null?void 0:o.res)!==void 0}extractFromKey(r,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let u=a.ns||this.options.defaultNS||[];const c=s&&r.indexOf(s)>-1,d=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!y2(r,s,o);if(c&&!d){const m=r.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:r,namespaces:it(u)?[u]:u};const A=r.split(s);(s!==o||s===o&&this.options.ns.indexOf(A[0])>-1)&&(u=A.shift()),r=A.join(o)}return{key:r,namespaces:it(u)?[u]:u}}translate(r,a,s){let o=typeof a=="object"?{...a}:a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:d,namespaces:m}=this.extractFromKey(r[r.length-1],o),A=m[m.length-1];let b=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const v=o.lng||this.language,B=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return B?u?{res:`${A}${b}${d}`,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:A,usedParams:this.getUsedParamsDetails(o)}:`${A}${b}${d}`:u?{res:d,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:A,usedParams:this.getUsedParamsDetails(o)}:d;const T=this.resolve(r,o);let Q=T==null?void 0:T.res;const k=(T==null?void 0:T.usedKey)||d,R=(T==null?void 0:T.exactUsedKey)||d,N=["[object Number]","[object Function]","[object RegExp]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,q=o.count!==void 0&&!it(o.count),V=$u.hasDefaultValue(o),ae=q?this.pluralResolver.getSuffix(v,o.count,o):"",ge=o.ordinal&&q?this.pluralResolver.getSuffix(v,o.count,{ordinal:!1}):"",te=q&&!o.ordinal&&o.count===0,J=te&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ae}`]||o[`defaultValue${ge}`]||o.defaultValue;let P=Q;_&&!Q&&V&&(P=J);const $=xp(P),me=Object.prototype.toString.apply(P);if(_&&P&&$&&N.indexOf(me)<0&&!(it(O)&&Array.isArray(P))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const he=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,P,{...o,ns:m}):`key '${d} (${this.language})' returned an object instead of string.`;return u?(T.res=he,T.usedParams=this.getUsedParamsDetails(o),T):he}if(c){const he=Array.isArray(P),Be=he?[]:{},pe=he?R:k;for(const K in P)if(Object.prototype.hasOwnProperty.call(P,K)){const ie=`${pe}${c}${K}`;V&&!Q?Be[K]=this.translate(ie,{...o,defaultValue:xp(J)?J[K]:void 0,joinArrays:!1,ns:m}):Be[K]=this.translate(ie,{...o,joinArrays:!1,ns:m}),Be[K]===ie&&(Be[K]=P[K])}Q=Be}}else if(_&&it(O)&&Array.isArray(Q))Q=Q.join(O),Q&&(Q=this.extendTranslation(Q,r,o,s));else{let he=!1,Be=!1;!this.isValidLookup(Q)&&V&&(he=!0,Q=J),this.isValidLookup(Q)||(Be=!0,Q=d);const K=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Be?void 0:Q,ie=V&&J!==Q&&this.options.updateMissing;if(Be||he||ie){if(this.logger.log(ie?"updateKey":"missingKey",v,A,d,ie?J:Q),c){const ne=this.resolve(d,{...o,keySeparator:!1});ne&&ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Ne=[];const _e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_e&&_e[0])for(let ne=0;ne<_e.length;ne++)Ne.push(_e[ne]);else this.options.saveMissingTo==="all"?Ne=this.languageUtils.toResolveHierarchy(o.lng||this.language):Ne.push(o.lng||this.language);const G=(ne,Ee,ke)=>{var Ke;const He=V&&ke!==Q?ke:K;this.options.missingKeyHandler?this.options.missingKeyHandler(ne,A,Ee,He,ie,o):(Ke=this.backendConnector)!=null&&Ke.saveMissing&&this.backendConnector.saveMissing(ne,A,Ee,He,ie,o),this.emit("missingKey",ne,A,Ee,Q)};this.options.saveMissing&&(this.options.saveMissingPlurals&&q?Ne.forEach(ne=>{const Ee=this.pluralResolver.getSuffixes(ne,o);te&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ee.push(`${this.options.pluralSeparator}zero`),Ee.forEach(ke=>{G([ne],d+ke,o[`defaultValue${ke}`]||J)})}):G(Ne,d,J))}Q=this.extendTranslation(Q,r,o,T,s),Be&&Q===d&&this.options.appendNamespaceToMissingKey&&(Q=`${A}${b}${d}`),(Be||he)&&this.options.parseMissingKeyHandler&&(Q=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}${b}${d}`:d,he?Q:void 0,o))}return u?(T.res=Q,T.usedParams=this.getUsedParamsDetails(o),T):Q}extendTranslation(r,a,s,o,u){var m,A;if((m=this.i18nFormat)!=null&&m.parse)r=this.i18nFormat.parse(r,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const b=it(r)&&(((A=s==null?void 0:s.interpolation)==null?void 0:A.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(b){const T=r.match(this.interpolator.nestingRegexp);v=T&&T.length}let B=s.replace&&!it(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(B={...this.options.interpolation.defaultVariables,...B}),r=this.interpolator.interpolate(r,B,s.lng||this.language||o.usedLng,s),b){const T=r.match(this.interpolator.nestingRegexp),Q=T&&T.length;v<Q&&(s.nest=!1)}!s.lng&&o&&o.res&&(s.lng=this.language||o.usedLng),s.nest!==!1&&(r=this.interpolator.nest(r,(...T)=>(u==null?void 0:u[0])===T[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${T[0]} in key: ${a[0]}`),null):this.translate(...T,a),s)),s.interpolation&&this.interpolator.reset()}const c=s.postProcess||this.options.postProcess,d=it(c)?[c]:c;return r!=null&&(d!=null&&d.length)&&s.applyPostProcessor!==!1&&(r=tE.handle(d,r,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),r}resolve(r,a={}){let s,o,u,c,d;return it(r)&&(r=[r]),r.forEach(m=>{if(this.isValidLookup(s))return;const A=this.extractFromKey(m,a),b=A.key;o=b;let v=A.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const B=a.count!==void 0&&!it(a.count),T=B&&!a.ordinal&&a.count===0,Q=a.context!==void 0&&(it(a.context)||typeof a.context=="number")&&a.context!=="",k=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);v.forEach(R=>{var N,O;this.isValidLookup(s)||(d=R,!vp[`${k[0]}-${R}`]&&((N=this.utils)!=null&&N.hasLoadedNamespace)&&!((O=this.utils)!=null&&O.hasLoadedNamespace(d))&&(vp[`${k[0]}-${R}`]=!0,this.logger.warn(`key "${o}" for languages "${k.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(_=>{var ae;if(this.isValidLookup(s))return;c=_;const q=[b];if((ae=this.i18nFormat)!=null&&ae.addLookupKeys)this.i18nFormat.addLookupKeys(q,b,_,R,a);else{let ge;B&&(ge=this.pluralResolver.getSuffix(_,a.count,a));const te=`${this.options.pluralSeparator}zero`,J=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(B&&(q.push(b+ge),a.ordinal&&ge.indexOf(J)===0&&q.push(b+ge.replace(J,this.options.pluralSeparator)),T&&q.push(b+te)),Q){const P=`${b}${this.options.contextSeparator}${a.context}`;q.push(P),B&&(q.push(P+ge),a.ordinal&&ge.indexOf(J)===0&&q.push(P+ge.replace(J,this.options.pluralSeparator)),T&&q.push(P+te))}}let V;for(;V=q.pop();)this.isValidLookup(s)||(u=V,s=this.getResource(_,R,V,a))}))})}),{res:s,usedKey:o,exactUsedKey:u,usedLng:c,usedNS:d}}isValidLookup(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}getResource(r,a,s,o={}){var u;return(u=this.i18nFormat)!=null&&u.getResource?this.i18nFormat.getResource(r,a,s,o):this.resourceStore.getResource(r,a,s,o)}getUsedParamsDetails(r={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=r.replace&&!it(r.replace);let o=s?r.replace:r;if(s&&typeof r.count<"u"&&(o.count=r.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!s){o={...o};for(const u of a)delete o[u]}return o}static hasDefaultValue(r){const a="defaultValue";for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&a===s.substring(0,a.length)&&r[s]!==void 0)return!0;return!1}}class Cp{constructor(r){this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oa.create("languageUtils")}getScriptPartFromCode(r){if(r=ro(r),!r||r.indexOf("-")<0)return null;const a=r.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(r){if(r=ro(r),!r||r.indexOf("-")<0)return r;const a=r.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(r){if(it(r)&&r.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(r)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?r.toLowerCase():r)}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}isSupportedCode(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}getBestMatchFromCodes(r){if(!r)return null;let a;return r.forEach(s=>{if(a)return;const o=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&r.forEach(s=>{if(a)return;const o=this.getScriptPartFromCode(s);if(this.isSupportedCode(o))return a=o;const u=this.getLanguagePartFromCode(s);if(this.isSupportedCode(u))return a=u;a=this.options.supportedLngs.find(c=>{if(c===u)return c;if(!(c.indexOf("-")<0&&u.indexOf("-")<0)&&(c.indexOf("-")>0&&u.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===u||c.indexOf(u)===0&&u.length>1))return c})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(r,a){if(!r)return[];if(typeof r=="function"&&(r=r(a)),it(r)&&(r=[r]),Array.isArray(r))return r;if(!a)return r.default||[];let s=r[a];return s||(s=r[this.getScriptPartFromCode(a)]),s||(s=r[this.formatLanguageCode(a)]),s||(s=r[this.getLanguagePartFromCode(a)]),s||(s=r.default),s||[]}toResolveHierarchy(r,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],r),o=[],u=c=>{c&&(this.isSupportedCode(c)?o.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return it(r)&&(r.indexOf("-")>-1||r.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(r))):it(r)&&u(this.formatLanguageCode(r)),s.forEach(c=>{o.indexOf(c)<0&&u(this.formatLanguageCode(c))}),o}}const wp={zero:0,one:1,two:2,few:3,many:4,other:5},Ip={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class b2{constructor(r,a={}){this.languageUtils=r,this.options=a,this.logger=oa.create("pluralResolver"),this.pluralRulesCache={}}addRule(r,a){this.rules[r]=a}clearCache(){this.pluralRulesCache={}}getRule(r,a={}){const s=ro(r==="dev"?"en":r),o=a.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:s,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let c;try{c=new Intl.PluralRules(s,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ip;if(!r.match(/-|_/))return Ip;const m=this.languageUtils.getLanguagePartFromCode(r);c=this.getRule(m,a)}return this.pluralRulesCache[u]=c,c}needsPlural(r,a={}){let s=this.getRule(r,a);return s||(s=this.getRule("dev",a)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(r,a,s={}){return this.getSuffixes(r,s).map(o=>`${a}${o}`)}getSuffixes(r,a={}){let s=this.getRule(r,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((o,u)=>wp[o]-wp[u]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(r,a,s={}){const o=this.getRule(r,s);return o?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${r}`),this.getSuffix("dev",a,s))}}const Bp=(n,r,a,s=".",o=!0)=>{let u=f2(n,r,a);return!u&&o&&it(a)&&(u=fA(n,a,s),u===void 0&&(u=fA(r,a,s))),u},Xf=n=>n.replace(/\$/g,"$$$$");class v2{constructor(r={}){var a;this.logger=oa.create("interpolator"),this.options=r,this.format=((a=r==null?void 0:r.interpolation)==null?void 0:a.format)||(s=>s),this.init(r)}init(r={}){r.interpolation||(r.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:o,prefix:u,prefixEscaped:c,suffix:d,suffixEscaped:m,formatSeparator:A,unescapeSuffix:b,unescapePrefix:v,nestingPrefix:B,nestingPrefixEscaped:T,nestingSuffix:Q,nestingSuffixEscaped:k,nestingOptionsSeparator:R,maxReplaces:N,alwaysFormat:O}=r.interpolation;this.escape=a!==void 0?a:h2,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Fs(u):c||"{{",this.suffix=d?Fs(d):m||"}}",this.formatSeparator=A||",",this.unescapePrefix=b?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=B?Fs(B):T||Fs("$t("),this.nestingSuffix=Q?Fs(Q):k||Fs(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=N||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const r=(a,s)=>(a==null?void 0:a.source)===s?(a.lastIndex=0,a):new RegExp(s,"g");this.regexp=r(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=r(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=r(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(r,a,s,o){var T;let u,c,d;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},A=Q=>{if(Q.indexOf(this.formatSeparator)<0){const O=Bp(a,m,Q,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,s,{...o,...a,interpolationkey:Q}):O}const k=Q.split(this.formatSeparator),R=k.shift().trim(),N=k.join(this.formatSeparator).trim();return this.format(Bp(a,m,R,this.options.keySeparator,this.options.ignoreJSONStructure),N,s,{...o,...a,interpolationkey:R})};this.resetRegExp();const b=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((T=o==null?void 0:o.interpolation)==null?void 0:T.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:Q=>Xf(Q)},{regex:this.regexp,safeValue:Q=>this.escapeValue?Xf(this.escape(Q)):Xf(Q)}].forEach(Q=>{for(d=0;u=Q.regex.exec(r);){const k=u[1].trim();if(c=A(k),c===void 0)if(typeof b=="function"){const N=b(r,u,o);c=it(N)?N:""}else if(o&&Object.prototype.hasOwnProperty.call(o,k))c="";else if(v){c=u[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${r}`),c="";else!it(c)&&!this.useRawValueToEscape&&(c=mp(c));const R=Q.safeValue(c);if(r=r.replace(u[0],R),v?(Q.regex.lastIndex+=c.length,Q.regex.lastIndex-=u[0].length):Q.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),r}nest(r,a,s={}){let o,u,c;const d=(m,A)=>{const b=this.nestingOptionsSeparator;if(m.indexOf(b)<0)return m;const v=m.split(new RegExp(`${b}[ ]*{`));let B=`{${v[1]}`;m=v[0],B=this.interpolate(B,c);const T=B.match(/'/g),Q=B.match(/"/g);(((T==null?void 0:T.length)??0)%2===0&&!Q||Q.length%2!==0)&&(B=B.replace(/'/g,'"'));try{c=JSON.parse(B),A&&(c={...A,...c})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,k),`${m}${b}${B}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,m};for(;o=this.nestingRegexp.exec(r);){let m=[];c={...s},c=c.replace&&!it(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const A=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(A!==-1&&(m=o[1].slice(A).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),o[1]=o[1].slice(0,A)),u=a(d.call(this,o[1].trim(),c),c),u&&o[0]===r&&!it(u))return u;it(u)||(u=mp(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${r}`),u=""),m.length&&(u=m.reduce((b,v)=>this.format(b,v,s.lng,{...s,interpolationkey:o[1].trim()}),u.trim())),r=r.replace(o[0],u),this.regexp.lastIndex=0}return r}}const x2=n=>{let r=n.toLowerCase().trim();const a={};if(n.indexOf("(")>-1){const s=n.split("(");r=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);r==="currency"&&o.indexOf(":")<0?a.currency||(a.currency=o.trim()):r==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(c=>{if(c){const[d,...m]=c.split(":"),A=m.join(":").trim().replace(/^'+|'+$/g,""),b=d.trim();a[b]||(a[b]=A),A==="false"&&(a[b]=!1),A==="true"&&(a[b]=!0),isNaN(A)||(a[b]=parseInt(A,10))}})}return{formatName:r,formatOptions:a}},Sp=n=>{const r={};return(a,s,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u={...u,[o.interpolationkey]:void 0});const c=s+JSON.stringify(u);let d=r[c];return d||(d=n(ro(s),o),r[c]=d),d(a)}},C2=n=>(r,a,s)=>n(ro(a),s)(r);class w2{constructor(r={}){this.logger=oa.create("formatter"),this.options=r,this.init(r)}init(r,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?Sp:C2;this.formats={number:s((o,u)=>{const c=new Intl.NumberFormat(o,{...u});return d=>c.format(d)}),currency:s((o,u)=>{const c=new Intl.NumberFormat(o,{...u,style:"currency"});return d=>c.format(d)}),datetime:s((o,u)=>{const c=new Intl.DateTimeFormat(o,{...u});return d=>c.format(d)}),relativetime:s((o,u)=>{const c=new Intl.RelativeTimeFormat(o,{...u});return d=>c.format(d,u.range||"day")}),list:s((o,u)=>{const c=new Intl.ListFormat(o,{...u});return d=>c.format(d)})}}add(r,a){this.formats[r.toLowerCase().trim()]=a}addCached(r,a){this.formats[r.toLowerCase().trim()]=Sp(a)}format(r,a,s,o={}){const u=a.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(d=>d.indexOf(")")>-1)){const d=u.findIndex(m=>m.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,d)].join(this.formatSeparator)}return u.reduce((d,m)=>{var v;const{formatName:A,formatOptions:b}=x2(m);if(this.formats[A]){let B=d;try{const T=((v=o==null?void 0:o.formatParams)==null?void 0:v[o.interpolationkey])||{},Q=T.locale||T.lng||o.locale||o.lng||s;B=this.formats[A](d,Q,{...b,...o,...T})}catch(T){this.logger.warn(T)}return B}else this.logger.warn(`there was no format function for ${A}`);return d},r)}}const I2=(n,r)=>{n.pending[r]!==void 0&&(delete n.pending[r],n.pendingCount--)};class B2 extends lc{constructor(r,a,s,o={}){var u,c;super(),this.backend=r,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=o,this.logger=oa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(c=(u=this.backend)==null?void 0:u.init)==null||c.call(u,s,o.backend,o)}queueLoad(r,a,s,o){const u={},c={},d={},m={};return r.forEach(A=>{let b=!0;a.forEach(v=>{const B=`${A}|${v}`;!s.reload&&this.store.hasResourceBundle(A,v)?this.state[B]=2:this.state[B]<0||(this.state[B]===1?c[B]===void 0&&(c[B]=!0):(this.state[B]=1,b=!1,c[B]===void 0&&(c[B]=!0),u[B]===void 0&&(u[B]=!0),m[v]===void 0&&(m[v]=!0)))}),b||(d[A]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(m)}}loaded(r,a,s){const o=r.split("|"),u=o[0],c=o[1];a&&this.emit("failedLoading",u,c,a),!a&&s&&this.store.addResourceBundle(u,c,s,void 0,void 0,{skipCopy:!0}),this.state[r]=a?-1:2,a&&s&&(this.state[r]=0);const d={};this.queue.forEach(m=>{d2(m.loaded,[u],c),I2(m,r),a&&m.errors.push(a),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(A=>{d[A]||(d[A]={});const b=m.loaded[A];b.length&&b.forEach(v=>{d[A][v]===void 0&&(d[A][v]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(m=>!m.done)}read(r,a,s,o=0,u=this.retryTimeout,c){if(!r.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:a,fcName:s,tried:o,wait:u,callback:c});return}this.readingCalls++;const d=(A,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(A&&b&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,r,a,s,o+1,u*2,c)},u);return}c(A,b)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const A=m(r,a);A&&typeof A.then=="function"?A.then(b=>d(null,b)).catch(d):d(null,A)}catch(A){d(A)}return}return m(r,a,d)}prepareLoading(r,a,s={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();it(r)&&(r=this.languageUtils.toResolveHierarchy(r)),it(a)&&(a=[a]);const u=this.queueLoad(r,a,s,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(c=>{this.loadOne(c)})}load(r,a,s){this.prepareLoading(r,a,{},s)}reload(r,a,s){this.prepareLoading(r,a,{reload:!0},s)}loadOne(r,a=""){const s=r.split("|"),o=s[0],u=s[1];this.read(o,u,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${a}loading namespace ${u} for language ${o} failed`,c),!c&&d&&this.logger.log(`${a}loaded namespace ${u} for language ${o}`,d),this.loaded(r,c,d)})}saveMissing(r,a,s,o,u,c={},d=()=>{}){var m,A,b,v,B;if((A=(m=this.services)==null?void 0:m.utils)!=null&&A.hasLoadedNamespace&&!((v=(b=this.services)==null?void 0:b.utils)!=null&&v.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${s}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((B=this.backend)!=null&&B.create){const T={...c,isUpdate:u},Q=this.backend.create.bind(this.backend);if(Q.length<6)try{let k;Q.length===5?k=Q(r,a,s,o,T):k=Q(r,a,s,o),k&&typeof k.then=="function"?k.then(R=>d(null,R)).catch(d):d(null,k)}catch(k){d(k)}else Q(r,a,s,o,d,T)}!r||!r[0]||this.store.addResource(r[0],a,s,o)}}}const Np=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let r={};if(typeof n[1]=="object"&&(r=n[1]),it(n[1])&&(r.defaultValue=n[1]),it(n[2])&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const a=n[3]||n[2];Object.keys(a).forEach(s=>{r[s]=a[s]})}return r},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Tp=n=>{var r,a;return it(n.ns)&&(n.ns=[n.ns]),it(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),it(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),((a=(r=n.supportedLngs)==null?void 0:r.indexOf)==null?void 0:a.call(r,"cimode"))<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n},Cu=()=>{},S2=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(a=>{typeof n[a]=="function"&&(n[a]=n[a].bind(n))})};class no extends lc{constructor(r={},a){if(super(),this.options=Tp(r),this.services={},this.logger=oa,this.modules={external:[]},S2(this),a&&!this.isInitialized&&!r.isClone){if(!this.options.initAsync)return this.init(r,a),this;setTimeout(()=>{this.init(r,a)},0)}}init(r={},a){this.isInitializing=!0,typeof r=="function"&&(a=r,r={}),r.defaultNS==null&&r.ns&&(it(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const s=Np();this.options={...s,...this.options,...Tp(r)},this.options.interpolation={...s.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const o=A=>A?typeof A=="function"?new A:A:null;if(!this.options.isClone){this.modules.logger?oa.init(o(this.modules.logger),this.options):oa.init(null,this.options);let A;this.modules.formatter?A=this.modules.formatter:A=w2;const b=new Cp(this.options);this.store=new bp(this.options.resources,this.options);const v=this.services;v.logger=oa,v.resourceStore=this.store,v.languageUtils=b,v.pluralResolver=new b2(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),A&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(v.formatter=o(A),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new v2(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new B2(o(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(T,...Q)=>{this.emit(T,...Q)}),this.modules.languageDetector&&(v.languageDetector=o(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=o(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new $u(this.services,this.options),this.translator.on("*",(T,...Q)=>{this.emit(T,...Q)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Cu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const A=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);A.length>0&&A[0]!=="dev"&&(this.options.lng=A[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(A=>{this[A]=(...b)=>this.store[A](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(A=>{this[A]=(...b)=>(this.store[A](...b),this)});const d=Pl(),m=()=>{const A=(b,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(v),a(b,v)};if(this.languages&&!this.isInitialized)return A(null,this.t.bind(this));this.changeLanguage(this.options.lng,A)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),d}loadResources(r,a=Cu){var u,c;let s=a;const o=it(r)?r:this.language;if(typeof r=="function"&&(s=r),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const d=[],m=A=>{if(!A||A==="cimode")return;this.services.languageUtils.toResolveHierarchy(A).forEach(v=>{v!=="cimode"&&d.indexOf(v)<0&&d.push(v)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>m(b)),(c=(u=this.options.preload)==null?void 0:u.forEach)==null||c.call(u,A=>m(A)),this.services.backendConnector.load(d,this.options.ns,A=>{!A&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(A)})}else s(null)}reloadResources(r,a,s){const o=Pl();return typeof r=="function"&&(s=r,r=void 0),typeof a=="function"&&(s=a,a=void 0),r||(r=this.languages),a||(a=this.options.ns),s||(s=Cu),this.services.backendConnector.reload(r,a,u=>{o.resolve(),s(u)}),o}use(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&tE.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}setResolvedLanguage(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1)){for(let a=0;a<this.languages.length;a++){const s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(r)<0&&this.store.hasLanguageSomeTranslations(r)&&(this.resolvedLanguage=r,this.languages.unshift(r))}}changeLanguage(r,a){this.isLanguageChangingTo=r;const s=Pl();this.emit("languageChanging",r);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},u=(d,m)=>{m?this.isLanguageChangingTo===r&&(o(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...A)=>this.t(...A)),a&&a(d,(...A)=>this.t(...A))},c=d=>{var b,v;!r&&!d&&this.services.languageDetector&&(d=[]);const m=it(d)?d:d&&d[0],A=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(it(d)?[d]:d);A&&(this.language||o(A),this.translator.language||this.translator.changeLanguage(A),(v=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||v.call(b,A)),this.loadResources(A,B=>{u(B,A)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(r),s}getFixedT(r,a,s){const o=(u,c,...d)=>{let m;typeof c!="object"?m=this.options.overloadTranslationOptionHandler([u,c].concat(d)):m={...c},m.lng=m.lng||o.lng,m.lngs=m.lngs||o.lngs,m.ns=m.ns||o.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||o.keyPrefix);const A=this.options.keySeparator||".";let b;return m.keyPrefix&&Array.isArray(u)?b=u.map(v=>`${m.keyPrefix}${A}${v}`):b=m.keyPrefix?`${m.keyPrefix}${A}${u}`:u,this.t(b,m)};return it(r)?o.lng=r:o.lngs=r,o.ns=a,o.keyPrefix=s,o}t(...r){var a;return(a=this.translator)==null?void 0:a.translate(...r)}exists(...r){var a;return(a=this.translator)==null?void 0:a.exists(...r)}setDefaultNamespace(r){this.options.defaultNS=r}hasLoadedNamespace(r,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const c=(d,m)=>{const A=this.services.backendConnector.state[`${d}|${m}`];return A===-1||A===0||A===2};if(a.precheck){const d=a.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(s,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,r)&&(!o||c(u,r)))}loadNamespaces(r,a){const s=Pl();return this.options.ns?(it(r)&&(r=[r]),r.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{s.resolve(),a&&a(o)}),s):(a&&a(),Promise.resolve())}loadLanguages(r,a){const s=Pl();it(r)&&(r=[r]);const o=this.options.preload||[],u=r.filter(c=>o.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return u.length?(this.options.preload=o.concat(u),this.loadResources(c=>{s.resolve(),a&&a(c)}),s):(a&&a(),Promise.resolve())}dir(r){var o,u;if(r||(r=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!r)return"rtl";if(Intl.Locale){const c=new Intl.Locale(r);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((u=this.services)==null?void 0:u.languageUtils)||new Cp(Np());return r.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(r={},a){return new no(r,a)}cloneInstance(r={},a=Cu){const s=r.forkResourceStore;s&&delete r.forkResourceStore;const o={...this.options,...r,isClone:!0},u=new no(o);if((r.debug!==void 0||r.prefix!==void 0)&&(u.logger=u.logger.clone(r)),["store","services","language"].forEach(d=>{u[d]=this[d]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},s){const d=Object.keys(this.store.data).reduce((m,A)=>(m[A]={...this.store.data[A]},m[A]=Object.keys(m[A]).reduce((b,v)=>(b[v]={...m[A][v]},b),m[A]),m),{});u.store=new bp(d,o),u.services.resourceStore=u.store}return u.translator=new $u(u.services,o),u.translator.on("*",(d,...m)=>{u.emit(d,...m)}),u.init(o,a),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Er=no.createInstance();Er.createInstance=no.createInstance;Er.createInstance;Er.dir;Er.init;Er.loadResources;Er.reloadResources;Er.use;Er.changeLanguage;Er.getFixedT;Er.t;Er.exists;Er.setDefaultNamespace;Er.hasLoadedNamespace;Er.loadNamespaces;Er.loadLanguages;const N2=async()=>{const n=await Xe.getItem("local:language");if(n&&Rm.includes(n))return n;const r=navigator.language.split("-")[0];return Rm.includes(r)?r:yy},T2=async()=>{const n=await N2();await Er.use($b).init({resources:Iw,lng:n,fallbackLng:yy,debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1,bindI18n:"languageChanged loaded",bindI18nStore:""}})};T2().catch(n=>{console.error("Failed to initialize i18n:",n),Er.emit("initialized")});const Qp=()=>{Fb.createRoot(document.getElementById("root")).render(p.jsx(mC,{children:p.jsx(pC,{children:p.jsx(l1,{children:p.jsx(vC,{children:p.jsx(EC,{children:p.jsx(r2,{children:p.jsx(o2,{})})})})})})}))};Er.isInitialized?Qp():Er.on("initialized",Qp);
