var qv=Object.defineProperty;var Wv=(r,e,a)=>e in r?qv(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var Yv=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Fe=(r,e,a)=>Wv(r,typeof e!="symbol"?e+"":e,a);var GB=Yv((YB,vI)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();try{}catch(r){console.error("[wxt] Failed to initialize plugins",r)}function Ri(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Jv(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var a=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(a,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),a}var Af={exports:{}},dl={};/**
 * @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 R0;function Xv(){if(R0)return dl;R0=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(i,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var m in s)m!=="key"&&(c[m]=s[m])}else c=s;return s=c.ref,{$$typeof:r,type:i,key:d,ref:s!==void 0?s:null,props:c}}return dl.Fragment=e,dl.jsx=a,dl.jsxs=a,dl}var D0;function $v(){return D0||(D0=1,Af.exports=Xv()),Af.exports}var l=$v(),pf={exports:{}},ml={},yf={exports:{}},Ef={};/**
 * @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 B0;function Zv(){return B0||(B0=1,function(r){function e(X,ae){var pe=X.length;X.push(ae);e:for(;0<pe;){var Ae=pe-1>>>1,O=X[Ae];if(0<s(O,ae))X[Ae]=ae,X[pe]=O,pe=Ae;else break e}}function a(X){return X.length===0?null:X[0]}function i(X){if(X.length===0)return null;var ae=X[0],pe=X.pop();if(pe!==ae){X[0]=pe;e:for(var Ae=0,O=X.length,$=O>>>1;Ae<$;){var Z=2*(Ae+1)-1,ce=X[Z],be=Z+1,Le=X[be];if(0>s(ce,pe))be<O&&0>s(Le,ce)?(X[Ae]=Le,X[be]=pe,Ae=be):(X[Ae]=ce,X[Z]=pe,Ae=Z);else if(be<O&&0>s(Le,pe))X[Ae]=Le,X[be]=pe,Ae=be;else break e}}return ae}function s(X,ae){var pe=X.sortIndex-ae.sortIndex;return pe!==0?pe:X.id-ae.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();r.unstable_now=function(){return d.now()-m}}var g=[],f=[],E=1,p=null,C=3,I=!1,x=!1,T=!1,k=!1,R=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function j(X){for(var ae=a(f);ae!==null;){if(ae.callback===null)i(f);else if(ae.startTime<=X)i(f),ae.sortIndex=ae.expirationTime,e(g,ae);else break;ae=a(f)}}function _(X){if(T=!1,j(X),!x)if(a(g)!==null)x=!0,P||(P=!0,q());else{var ae=a(f);ae!==null&&de(_,ae.startTime-X)}}var P=!1,K=-1,H=5,Q=-1;function V(){return k?!0:!(r.unstable_now()-Q<H)}function G(){if(k=!1,P){var X=r.unstable_now();Q=X;var ae=!0;try{e:{x=!1,T&&(T=!1,B(K),K=-1),I=!0;var pe=C;try{t:{for(j(X),p=a(g);p!==null&&!(p.expirationTime>X&&V());){var Ae=p.callback;if(typeof Ae=="function"){p.callback=null,C=p.priorityLevel;var O=Ae(p.expirationTime<=X);if(X=r.unstable_now(),typeof O=="function"){p.callback=O,j(X),ae=!0;break t}p===a(g)&&i(g),j(X)}else i(g);p=a(g)}if(p!==null)ae=!0;else{var $=a(f);$!==null&&de(_,$.startTime-X),ae=!1}}break e}finally{p=null,C=pe,I=!1}ae=void 0}}finally{ae?q():P=!1}}}var q;if(typeof S=="function")q=function(){S(G)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ne=W.port2;W.port1.onmessage=G,q=function(){ne.postMessage(null)}}else q=function(){R(G,0)};function de(X,ae){K=R(function(){X(r.unstable_now())},ae)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(X){X.callback=null},r.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<X?Math.floor(1e3/X):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_next=function(X){switch(C){case 1:case 2:case 3:var ae=3;break;default:ae=C}var pe=C;C=ae;try{return X()}finally{C=pe}},r.unstable_requestPaint=function(){k=!0},r.unstable_runWithPriority=function(X,ae){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var pe=C;C=X;try{return ae()}finally{C=pe}},r.unstable_scheduleCallback=function(X,ae,pe){var Ae=r.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?Ae+pe:Ae):pe=Ae,X){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=pe+O,X={id:E++,callback:ae,priorityLevel:X,startTime:pe,expirationTime:O,sortIndex:-1},pe>Ae?(X.sortIndex=pe,e(f,X),a(g)===null&&X===a(f)&&(T?(B(K),K=-1):T=!0,de(_,pe-Ae))):(X.sortIndex=O,e(g,X),x||I||(x=!0,P||(P=!0,q()))),X},r.unstable_shouldYield=V,r.unstable_wrapCallback=function(X){var ae=C;return function(){var pe=C;C=ae;try{return X.apply(this,arguments)}finally{C=pe}}}}(Ef)),Ef}var U0;function ew(){return U0||(U0=1,yf.exports=Zv()),yf.exports}var bf={exports:{}},pt={};/**
 * @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 _0;function tw(){if(_0)return pt;_0=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),p=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=p&&O[p]||O["@@iterator"],typeof O=="function"?O:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function k(O,$,Z){this.props=O,this.context=$,this.refs=T,this.updater=Z||I}k.prototype.isReactComponent={},k.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,$,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=k.prototype;function B(O,$,Z){this.props=O,this.context=$,this.refs=T,this.updater=Z||I}var S=B.prototype=new R;S.constructor=B,x(S,k.prototype),S.isPureReactComponent=!0;var j=Array.isArray,_={H:null,A:null,T:null,S:null,V:null},P=Object.prototype.hasOwnProperty;function K(O,$,Z,ce,be,Le){return Z=Le.ref,{$$typeof:r,type:O,key:$,ref:Z!==void 0?Z:null,props:Le}}function H(O,$){return K(O.type,$,void 0,void 0,void 0,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===r}function V(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return $[Z]})}var G=/\/+/g;function q(O,$){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):$.toString(36)}function W(){}function ne(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(W,W):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function de(O,$,Z,ce,be){var Le=typeof O;(Le==="undefined"||Le==="boolean")&&(O=null);var ke=!1;if(O===null)ke=!0;else switch(Le){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(O.$$typeof){case r:case e:ke=!0;break;case E:return ke=O._init,de(ke(O._payload),$,Z,ce,be)}}if(ke)return be=be(O),ke=ce===""?"."+q(O,0):ce,j(be)?(Z="",ke!=null&&(Z=ke.replace(G,"$&/")+"/"),de(be,$,Z,"",function(Oe){return Oe})):be!=null&&(Q(be)&&(be=H(be,Z+(be.key==null||O&&O.key===be.key?"":(""+be.key).replace(G,"$&/")+"/")+ke)),$.push(be)),1;ke=0;var Se=ce===""?".":ce+":";if(j(O))for(var Te=0;Te<O.length;Te++)ce=O[Te],Le=Se+q(ce,Te),ke+=de(ce,$,Z,Le,be);else if(Te=C(O),typeof Te=="function")for(O=Te.call(O),Te=0;!(ce=O.next()).done;)ce=ce.value,Le=Se+q(ce,Te++),ke+=de(ce,$,Z,Le,be);else if(Le==="object"){if(typeof O.then=="function")return de(ne(O),$,Z,ce,be);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ke}function X(O,$,Z){if(O==null)return O;var ce=[],be=0;return de(O,ce,"","",function(Le){return $.call(Z,Le,be++)}),ce}function ae(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var pe=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function Ae(){}return pt.Children={map:X,forEach:function(O,$,Z){X(O,function(){$.apply(this,arguments)},Z)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},pt.Component=k,pt.Fragment=a,pt.Profiler=s,pt.PureComponent=B,pt.StrictMode=i,pt.Suspense=g,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,pt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return _.H.useMemoCache(O)}},pt.cache=function(O){return function(){return O.apply(null,arguments)}},pt.cloneElement=function(O,$,Z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ce=x({},O.props),be=O.key,Le=void 0;if($!=null)for(ke in $.ref!==void 0&&(Le=void 0),$.key!==void 0&&(be=""+$.key),$)!P.call($,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&$.ref===void 0||(ce[ke]=$[ke]);var ke=arguments.length-2;if(ke===1)ce.children=Z;else if(1<ke){for(var Se=Array(ke),Te=0;Te<ke;Te++)Se[Te]=arguments[Te+2];ce.children=Se}return K(O.type,be,void 0,void 0,Le,ce)},pt.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},pt.createElement=function(O,$,Z){var ce,be={},Le=null;if($!=null)for(ce in $.key!==void 0&&(Le=""+$.key),$)P.call($,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(be[ce]=$[ce]);var ke=arguments.length-2;if(ke===1)be.children=Z;else if(1<ke){for(var Se=Array(ke),Te=0;Te<ke;Te++)Se[Te]=arguments[Te+2];be.children=Se}if(O&&O.defaultProps)for(ce in ke=O.defaultProps,ke)be[ce]===void 0&&(be[ce]=ke[ce]);return K(O,Le,void 0,void 0,null,be)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(O){return{$$typeof:m,render:O}},pt.isValidElement=Q,pt.lazy=function(O){return{$$typeof:E,_payload:{_status:-1,_result:O},_init:ae}},pt.memo=function(O,$){return{$$typeof:f,type:O,compare:$===void 0?null:$}},pt.startTransition=function(O){var $=_.T,Z={};_.T=Z;try{var ce=O(),be=_.S;be!==null&&be(Z,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(Ae,pe)}catch(Le){pe(Le)}finally{_.T=$}},pt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},pt.use=function(O){return _.H.use(O)},pt.useActionState=function(O,$,Z){return _.H.useActionState(O,$,Z)},pt.useCallback=function(O,$){return _.H.useCallback(O,$)},pt.useContext=function(O){return _.H.useContext(O)},pt.useDebugValue=function(){},pt.useDeferredValue=function(O,$){return _.H.useDeferredValue(O,$)},pt.useEffect=function(O,$,Z){var ce=_.H;if(typeof Z=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ce.useEffect(O,$)},pt.useId=function(){return _.H.useId()},pt.useImperativeHandle=function(O,$,Z){return _.H.useImperativeHandle(O,$,Z)},pt.useInsertionEffect=function(O,$){return _.H.useInsertionEffect(O,$)},pt.useLayoutEffect=function(O,$){return _.H.useLayoutEffect(O,$)},pt.useMemo=function(O,$){return _.H.useMemo(O,$)},pt.useOptimistic=function(O,$){return _.H.useOptimistic(O,$)},pt.useReducer=function(O,$,Z){return _.H.useReducer(O,$,Z)},pt.useRef=function(O){return _.H.useRef(O)},pt.useState=function(O){return _.H.useState(O)},pt.useSyncExternalStore=function(O,$,Z){return _.H.useSyncExternalStore(O,$,Z)},pt.useTransition=function(){return _.H.useTransition()},pt.version="19.1.0",pt}var M0;function Qg(){return M0||(M0=1,bf.exports=tw()),bf.exports}var If={exports:{}},Va={};/**
 * @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 F0;function aw(){if(F0)return Va;F0=1;var r=Qg();function e(g){var f="https://react.dev/errors/"+g;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)f+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+g+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(e(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(g,f,E){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:g,containerInfo:f,implementation:E}}var d=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,f){if(g==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Va.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Va.createPortal=function(g,f){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return c(g,f,null,E)},Va.flushSync=function(g){var f=d.T,E=i.p;try{if(d.T=null,i.p=2,g)return g()}finally{d.T=f,i.p=E,i.d.f()}},Va.preconnect=function(g,f){typeof g=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(g,f))},Va.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Va.preinit=function(g,f){if(typeof g=="string"&&f&&typeof f.as=="string"){var E=f.as,p=m(E,f.crossOrigin),C=typeof f.integrity=="string"?f.integrity:void 0,I=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;E==="style"?i.d.S(g,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:C,fetchPriority:I}):E==="script"&&i.d.X(g,{crossOrigin:p,integrity:C,fetchPriority:I,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Va.preinitModule=function(g,f){if(typeof g=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var E=m(f.as,f.crossOrigin);i.d.M(g,{crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(g)},Va.preload=function(g,f){if(typeof g=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var E=f.as,p=m(E,f.crossOrigin);i.d.L(g,E,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Va.preloadModule=function(g,f){if(typeof g=="string")if(f){var E=m(f.as,f.crossOrigin);i.d.m(g,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(g)},Va.requestFormReset=function(g){i.d.r(g)},Va.unstable_batchedUpdates=function(g,f){return g(f)},Va.useFormState=function(g,f,E){return d.H.useFormState(g,f,E)},Va.useFormStatus=function(){return d.H.useHostTransitionStatus()},Va.version="19.1.0",Va}var O0;function nw(){if(O0)return If.exports;O0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),If.exports=aw(),If.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 j0;function rw(){if(j0)return ml;j0=1;var r=ew(),e=Qg(),a=nw();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,o=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(o=n.return),t=n.return;while(t)}return n.tag===3?o:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function m(t){if(c(t)!==t)throw Error(i(188))}function g(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(i(188));return n!==t?null:t}for(var o=t,u=n;;){var h=o.return;if(h===null)break;var y=h.alternate;if(y===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===y.child){for(y=h.child;y;){if(y===o)return m(h),t;if(y===u)return m(h),n;y=y.sibling}throw Error(i(188))}if(o.return!==u.return)o=h,u=y;else{for(var L=!1,M=h.child;M;){if(M===o){L=!0,o=h,u=y;break}if(M===u){L=!0,u=h,o=y;break}M=M.sibling}if(!L){for(M=y.child;M;){if(M===o){L=!0,o=y,u=h;break}if(M===u){L=!0,u=y,o=h;break}M=M.sibling}if(!L)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?t:n}function f(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=f(t),n!==null)return n;t=t.sibling}return null}var E=Object.assign,p=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),B=Symbol.for("react.consumer"),S=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=G&&t[G]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case k:return"Profiler";case T:return"StrictMode";case _:return"Suspense";case P:return"SuspenseList";case Q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case S:return(t.displayName||"Context")+".Provider";case B:return(t._context.displayName||"Context")+".Consumer";case j:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return n=t.displayName||null,n!==null?n:ne(t.type)||"Memo";case H:n=t._payload,t=t._init;try{return ne(t(n))}catch{}}return null}var de=Array.isArray,X=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},Ae=[],O=-1;function $(t){return{current:t}}function Z(t){0>O||(t.current=Ae[O],Ae[O]=null,O--)}function ce(t,n){O++,Ae[O]=t.current,t.current=n}var be=$(null),Le=$(null),ke=$(null),Se=$(null);function Te(t,n){switch(ce(ke,n),ce(Le,t),ce(be,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?i0(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=i0(n),t=s0(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Z(be),ce(be,t)}function Oe(){Z(be),Z(Le),Z(ke)}function Ne(t){t.memoizedState!==null&&ce(Se,t);var n=be.current,o=s0(n,t.type);n!==o&&(ce(Le,t),ce(be,o))}function je(t){Le.current===t&&(Z(be),Z(Le)),Se.current===t&&(Z(Se),sl._currentValue=pe)}var ht=Object.prototype.hasOwnProperty,Ye=r.unstable_scheduleCallback,rt=r.unstable_cancelCallback,la=r.unstable_shouldYield,ve=r.unstable_requestPaint,Re=r.unstable_now,$e=r.unstable_getCurrentPriorityLevel,qe=r.unstable_ImmediatePriority,dt=r.unstable_UserBlockingPriority,Je=r.unstable_NormalPriority,At=r.unstable_LowPriority,Ot=r.unstable_IdlePriority,Wt=r.log,Zt=r.unstable_setDisableYieldValue,ya=null,U=null;function v(t){if(typeof Wt=="function"&&Zt(t),U&&typeof U.setStrictMode=="function")try{U.setStrictMode(ya,t)}catch{}}var N=Math.clz32?Math.clz32:fe,z=Math.log,te=Math.LN2;function fe(t){return t>>>=0,t===0?32:31-(z(t)/te|0)|0}var ye=256,De=4194304;function Nt(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function xt(t,n,o){var u=t.pendingLanes;if(u===0)return 0;var h=0,y=t.suspendedLanes,L=t.pingedLanes;t=t.warmLanes;var M=u&134217727;return M!==0?(u=M&~y,u!==0?h=Nt(u):(L&=M,L!==0?h=Nt(L):o||(o=M&~t,o!==0&&(h=Nt(o))))):(M=u&~y,M!==0?h=Nt(M):L!==0?h=Nt(L):o||(o=u&~t,o!==0&&(h=Nt(o)))),h===0?0:n!==0&&n!==h&&(n&y)===0&&(y=h&-h,o=n&-n,y>=o||y===32&&(o&4194048)!==0)?n:h}function St(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function mt(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Vr(){var t=ye;return ye<<=1,(ye&4194048)===0&&(ye=256),t}function ca(){var t=De;return De<<=1,(De&62914560)===0&&(De=4194304),t}function Mn(t){for(var n=[],o=0;31>o;o++)n.push(t);return n}function Gn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function gs(t,n,o,u,h,y){var L=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var M=t.entanglements,Y=t.expirationTimes,ue=t.hiddenUpdates;for(o=L&~o;0<o;){var Ee=31-N(o),we=1<<Ee;M[Ee]=0,Y[Ee]=-1;var me=ue[Ee];if(me!==null)for(ue[Ee]=null,Ee=0;Ee<me.length;Ee++){var ge=me[Ee];ge!==null&&(ge.lane&=-536870913)}o&=~we}u!==0&&_e(t,u,0),y!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=y&~(L&~n))}function _e(t,n,o){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-N(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|o&4194090}function hs(t,n){var o=t.entangledLanes|=n;for(t=t.entanglements;o;){var u=31-N(o),h=1<<u;h&n|t[u]&n&&(t[u]|=n),o&=~h}}function Di(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xa(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function dr(){var t=ae.p;return t!==0?t:(t=window.event,t===void 0?32:N0(t.type))}function Kr(t,n){var o=ae.p;try{return ae.p=t,n()}finally{ae.p=o}}var qa=Math.random().toString(36).slice(2),Kt="__reactFiber$"+qa,Ea="__reactProps$"+qa,Gt="__reactContainer$"+qa,Gr="__reactEvents$"+qa,qn="__reactListeners$"+qa,As="__reactHandles$"+qa,ie="__reactResources$"+qa,Ue="__reactMarker$"+qa;function Be(t){delete t[Kt],delete t[Ea],delete t[Gr],delete t[qn],delete t[As]}function Ze(t){var n=t[Kt];if(n)return n;for(var o=t.parentNode;o;){if(n=o[Gt]||o[Kt]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(t=u0(t);t!==null;){if(o=t[Kt])return o;t=u0(t)}return n}t=o,o=t.parentNode}return null}function Tt(t){if(t=t[Kt]||t[Gt]){var n=t.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return t}return null}function yt(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function it(t){var n=t[ie];return n||(n=t[ie]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function st(t){t[Ue]=!0}var un=new Set,Ut={};function Wa(t,n){ra(t,n),ra(t+"Capture",n)}function ra(t,n){for(Ut[t]=n,t=0;t<n.length;t++)un.add(n[t])}var qr=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]*$"),mr={},Bi={};function Hl(t){return ht.call(Bi,t)?!0:ht.call(mr,t)?!1:qr.test(t)?Bi[t]=!0:(mr[t]=!0,!1)}function Wn(t,n,o){if(Hl(n))if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+o)}}function Ui(t,n,o){if(o===null)t.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+o)}}function $a(t,n,o,u){if(u===null)t.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(n,o,""+u)}}var ps,fr;function Yn(t){if(ps===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);ps=n&&n[1]||"",fr=-1<o.stack.indexOf(`
    at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ps+t+fr}var ys=!1;function Es(t,n){if(!t||ys)return"";ys=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ge){var me=ge}Reflect.construct(t,[],we)}else{try{we.call()}catch(ge){me=ge}t.call(we.prototype)}}else{try{throw Error()}catch(ge){me=ge}(we=t())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ge){if(ge&&me&&typeof ge.stack=="string")return[ge.stack,me.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),L=y[0],M=y[1];if(L&&M){var Y=L.split(`
`),ue=M.split(`
`);for(h=u=0;u<Y.length&&!Y[u].includes("DetermineComponentFrameRoot");)u++;for(;h<ue.length&&!ue[h].includes("DetermineComponentFrameRoot");)h++;if(u===Y.length||h===ue.length)for(u=Y.length-1,h=ue.length-1;1<=u&&0<=h&&Y[u]!==ue[h];)h--;for(;1<=u&&0<=h;u--,h--)if(Y[u]!==ue[h]){if(u!==1||h!==1)do if(u--,h--,0>h||Y[u]!==ue[h]){var Ee=`
`+Y[u].replace(" at new "," at ");return t.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",t.displayName)),Ee}while(1<=u&&0<=h);break}}}finally{ys=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?Yn(o):""}function Ql(t){switch(t.tag){case 26:case 27:case 5:return Yn(t.type);case 16:return Yn("Lazy");case 13:return Yn("Suspense");case 19:return Yn("SuspenseList");case 0:case 15:return Es(t.type,!1);case 11:return Es(t.type.render,!1);case 1:return Es(t.type,!0);case 31:return Yn("Activity");default:return""}}function zl(t){try{var n="";do n+=Ql(t),t=t.return;while(t);return n}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}function ua(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jt(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function gr(t){var n=jt(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),u=""+t[n];if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,y=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(L){u=""+L,y.call(this,L)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(L){u=""+L},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function hr(t){t._valueTracker||(t._valueTracker=gr(t))}function _i(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var o=n.getValue(),u="";return t&&(u=jt(t)?t.checked?"true":"false":t.value),t=u,t!==o?(n.setValue(t),!0):!1}function Ar(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ao=/[\n"\\]/g;function Za(t){return t.replace(Ao,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function po(t,n,o,u,h,y,L,M){t.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?t.type=L:t.removeAttribute("type"),n!=null?L==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ua(n)):t.value!==""+ua(n)&&(t.value=""+ua(n)):L!=="submit"&&L!=="reset"||t.removeAttribute("value"),n!=null?bs(t,L,ua(n)):o!=null?bs(t,L,ua(o)):u!=null&&t.removeAttribute("value"),h==null&&y!=null&&(t.defaultChecked=!!y),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+ua(M):t.removeAttribute("name")}function Wr(t,n,o,u,h,y,L,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),n!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||n!=null))return;o=o!=null?""+ua(o):"",n=n!=null?""+ua(n):o,M||n===t.value||(t.value=n),t.defaultValue=n}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=M?t.checked:!!u,t.defaultChecked=!!u,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(t.name=L)}function bs(t,n,o){n==="number"&&Ar(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function Yr(t,n,o,u){if(t=t.options,n){n={};for(var h=0;h<o.length;h++)n["$"+o[h]]=!0;for(o=0;o<t.length;o++)h=n.hasOwnProperty("$"+t[o].value),t[o].selected!==h&&(t[o].selected=h),h&&u&&(t[o].defaultSelected=!0)}else{for(o=""+ua(o),n=null,h=0;h<t.length;h++){if(t[h].value===o){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function Is(t,n,o){if(n!=null&&(n=""+ua(n),n!==t.value&&(t.value=n),o==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=o!=null?""+ua(o):""}function yo(t,n,o,u){if(n==null){if(u!=null){if(o!=null)throw Error(i(92));if(de(u)){if(1<u.length)throw Error(i(93));u=u[0]}o=u}o==null&&(o=""),n=o}o=ua(n),t.defaultValue=o,u=t.textContent,u===o&&u!==""&&u!==null&&(t.value=u)}function Jn(t,n){if(n){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=n;return}}t.textContent=n}var Eo=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 Vl(t,n,o){var u=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,o):typeof o!="number"||o===0||Eo.has(n)?n==="float"?t.cssFloat=o:t[n]=(""+o).trim():t[n]=o+"px"}function Mi(t,n,o){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in n)u=n[h],n.hasOwnProperty(h)&&o[h]!==u&&Vl(t,h,u)}else for(var y in n)n.hasOwnProperty(y)&&Vl(t,y,n[y])}function Jr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 pr=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"]]),bo=/^[\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 en(t){return bo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var vn=null;function yr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xr=null,Ve=null;function vs(t){var n=Tt(t);if(n&&(t=n.stateNode)){var o=t[Ea]||null;e:switch(t=n.stateNode,n.type){case"input":if(po(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Za(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var u=o[n];if(u!==t&&u.form===t.form){var h=u[Ea]||null;if(!h)throw Error(i(90));po(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<o.length;n++)u=o[n],u.form===t.form&&_i(u)}break e;case"textarea":Is(t,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Yr(t,!!o.multiple,n,!1)}}}var $r=!1;function Io(t,n,o){if($r)return t(n,o);$r=!0;try{var u=t(n);return u}finally{if($r=!1,(Xr!==null||Ve!==null)&&(Lc(),Xr&&(n=Xr,t=Ve,Ve=Xr=null,vs(n),t)))for(n=0;n<t.length;n++)vs(t[n])}}function Zr(t,n){var o=t.stateNode;if(o===null)return null;var u=o[Ea]||null;if(u===null)return null;o=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wn=!1;if(Ya)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){wn=!0}}),window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{wn=!1}var Cn=null,A=null,b=null;function D(){if(b)return b;var t,n=A,o=n.length,u,h="value"in Cn?Cn.value:Cn.textContent,y=h.length;for(t=0;t<o&&n[t]===h[t];t++);var L=o-t;for(u=1;u<=L&&n[o-u]===h[y-u];u++);return b=h.slice(t,1<u?1-u:void 0)}function F(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function J(){return!0}function oe(){return!1}function he(t){function n(o,u,h,y,L){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=y,this.target=L,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(o=t[M],this[M]=o?o(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?J:oe,this.isPropagationStopped=oe,this}return E(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=J)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=J)},persist:function(){},isPersistent:J}),n}var Pe={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gt=he(Pe),ct=E({},Pe,{view:0,detail:0}),Yt=he(ct),Ta,ws,Fi,Oi=E({},ct,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Co,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fi&&(Fi&&t.type==="mousemove"?(Ta=t.screenX-Fi.screenX,ws=t.screenY-Fi.screenY):ws=Ta=0,Fi=t),Ta)},movementY:function(t){return"movementY"in t?t.movementY:ws}}),Kl=he(Oi),Gl=E({},Oi,{dataTransfer:0}),nd=he(Gl),rd=E({},ct,{relatedTarget:0}),vo=he(rd),id=E({},Pe,{animationName:0,elapsedTime:0,pseudoElement:0}),sd=he(id),od=E({},Pe,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ld=he(od),cd=E({},Pe,{data:0}),wo=he(cd),ud={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dd={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"},md={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fd(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=md[t])?!!n[t]:!1}function Co(){return fd}var gd=E({},ct,{key:function(t){if(t.key){var n=ud[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=F(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?dd[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Co,charCode:function(t){return t.type==="keypress"?F(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?F(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),hd=he(gd),ql=E({},Oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wl=he(ql),Ad=E({},ct,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Co}),pd=he(Ad),yd=E({},Pe,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ed=he(yd),bd=E({},Oi,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Yl=he(bd),Id=E({},Pe,{newState:0,oldState:0}),vd=he(Id),wd=[9,13,27,32],ei=Ya&&"CompositionEvent"in window,ti=null;Ya&&"documentMode"in document&&(ti=document.documentMode);var Jl=Ya&&"TextEvent"in window&&!ti,No=Ya&&(!ei||ti&&8<ti&&11>=ti),se=" ",xe=!1;function He(t,n){switch(t){case"keyup":return wd.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tt=!1;function Dt(t,n){switch(t){case"compositionend":return Xe(n);case"keypress":return n.which!==32?null:(xe=!0,se);case"textInput":return t=n.data,t===se&&xe?null:t;default:return null}}function dn(t,n){if(tt)return t==="compositionend"||!ei&&He(t,n)?(t=D(),b=A=Cn=null,tt=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return No&&n.locale!=="ko"?null:n.data;default:return null}}var tn={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 Qa(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!tn[t.type]:n==="textarea"}function an(t,n,o,u){Xr?Ve?Ve.push(u):Ve=[u]:Xr=u,n=Mc(n,"onChange"),0<n.length&&(o=new gt("onChange","change",null,o,u),t.push({event:o,listeners:n}))}var Er=null,mn=null;function Cd(t){e0(t,0)}function Xl(t){var n=yt(t);if(_i(n))return t}function Ih(t,n){if(t==="change")return n}var vh=!1;if(Ya){var Nd;if(Ya){var xd="oninput"in document;if(!xd){var wh=document.createElement("div");wh.setAttribute("oninput","return;"),xd=typeof wh.oninput=="function"}Nd=xd}else Nd=!1;vh=Nd&&(!document.documentMode||9<document.documentMode)}function Ch(){Er&&(Er.detachEvent("onpropertychange",Nh),mn=Er=null)}function Nh(t){if(t.propertyName==="value"&&Xl(mn)){var n=[];an(n,mn,t,yr(t)),Io(Cd,n)}}function wI(t,n,o){t==="focusin"?(Ch(),Er=n,mn=o,Er.attachEvent("onpropertychange",Nh)):t==="focusout"&&Ch()}function CI(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Xl(mn)}function NI(t,n){if(t==="click")return Xl(n)}function xI(t,n){if(t==="input"||t==="change")return Xl(n)}function TI(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var fn=typeof Object.is=="function"?Object.is:TI;function xo(t,n){if(fn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var o=Object.keys(t),u=Object.keys(n);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!ht.call(n,h)||!fn(t[h],n[h]))return!1}return!0}function xh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Th(t,n){var o=xh(t);t=0;for(var u;o;){if(o.nodeType===3){if(u=t+o.textContent.length,t<=n&&u>=n)return{node:o,offset:n-t};t=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=xh(o)}}function Sh(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Sh(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function kh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ar(t.document);n instanceof t.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)t=n.contentWindow;else break;n=Ar(t.document)}return n}function Td(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var SI=Ya&&"documentMode"in document&&11>=document.documentMode,Cs=null,Sd=null,To=null,kd=!1;function Lh(t,n,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kd||Cs==null||Cs!==Ar(u)||(u=Cs,"selectionStart"in u&&Td(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),To&&xo(To,u)||(To=u,u=Mc(Sd,"onSelect"),0<u.length&&(n=new gt("onSelect","select",null,n,o),t.push({event:n,listeners:u}),n.target=Cs)))}function ji(t,n){var o={};return o[t.toLowerCase()]=n.toLowerCase(),o["Webkit"+t]="webkit"+n,o["Moz"+t]="moz"+n,o}var Ns={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionrun:ji("Transition","TransitionRun"),transitionstart:ji("Transition","TransitionStart"),transitioncancel:ji("Transition","TransitionCancel"),transitionend:ji("Transition","TransitionEnd")},Ld={},Rh={};Ya&&(Rh=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function Pi(t){if(Ld[t])return Ld[t];if(!Ns[t])return t;var n=Ns[t],o;for(o in n)if(n.hasOwnProperty(o)&&o in Rh)return Ld[t]=n[o];return t}var Dh=Pi("animationend"),Bh=Pi("animationiteration"),Uh=Pi("animationstart"),kI=Pi("transitionrun"),LI=Pi("transitionstart"),RI=Pi("transitioncancel"),_h=Pi("transitionend"),Mh=new Map,Rd="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(" ");Rd.push("scrollEnd");function On(t,n){Mh.set(t,n),Wa(n,[t])}var Fh=new WeakMap;function Nn(t,n){if(typeof t=="object"&&t!==null){var o=Fh.get(t);return o!==void 0?o:(n={value:t,source:n,stack:zl(n)},Fh.set(t,n),n)}return{value:t,source:n,stack:zl(n)}}var xn=[],xs=0,Dd=0;function $l(){for(var t=xs,n=Dd=xs=0;n<t;){var o=xn[n];xn[n++]=null;var u=xn[n];xn[n++]=null;var h=xn[n];xn[n++]=null;var y=xn[n];if(xn[n++]=null,u!==null&&h!==null){var L=u.pending;L===null?h.next=h:(h.next=L.next,L.next=h),u.pending=h}y!==0&&Oh(o,h,y)}}function Zl(t,n,o,u){xn[xs++]=t,xn[xs++]=n,xn[xs++]=o,xn[xs++]=u,Dd|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function Bd(t,n,o,u){return Zl(t,n,o,u),ec(t)}function Ts(t,n){return Zl(t,null,null,n),ec(t)}function Oh(t,n,o){t.lanes|=o;var u=t.alternate;u!==null&&(u.lanes|=o);for(var h=!1,y=t.return;y!==null;)y.childLanes|=o,u=y.alternate,u!==null&&(u.childLanes|=o),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(h=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,h&&n!==null&&(h=31-N(o),t=y.hiddenUpdates,u=t[h],u===null?t[h]=[n]:u.push(n),n.lane=o|536870912),y):null}function ec(t){if(50<$o)throw $o=0,jm=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ss={};function DI(t,n,o,u){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(t,n,o,u){return new DI(t,n,o,u)}function Ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function br(t,n){var o=t.alternate;return o===null?(o=gn(t.tag,n,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=n,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,n=t.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function jh(t,n){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,n=o.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function tc(t,n,o,u,h,y){var L=0;if(u=t,typeof t=="function")Ud(t)&&(L=1);else if(typeof t=="string")L=Uv(t,o,be.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Q:return t=gn(31,o,n,h),t.elementType=Q,t.lanes=y,t;case x:return Hi(o.children,h,y,n);case T:L=8,h|=24;break;case k:return t=gn(12,o,n,h|2),t.elementType=k,t.lanes=y,t;case _:return t=gn(13,o,n,h),t.elementType=_,t.lanes=y,t;case P:return t=gn(19,o,n,h),t.elementType=P,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:case S:L=10;break e;case B:L=9;break e;case j:L=11;break e;case K:L=14;break e;case H:L=16,u=null;break e}L=29,o=Error(i(130,t===null?"null":typeof t,"")),u=null}return n=gn(L,o,n,h),n.elementType=t,n.type=u,n.lanes=y,n}function Hi(t,n,o,u){return t=gn(7,t,u,n),t.lanes=o,t}function _d(t,n,o){return t=gn(6,t,null,n),t.lanes=o,t}function Md(t,n,o){return n=gn(4,t.children!==null?t.children:[],t.key,n),n.lanes=o,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var ks=[],Ls=0,ac=null,nc=0,Tn=[],Sn=0,Qi=null,Ir=1,vr="";function zi(t,n){ks[Ls++]=nc,ks[Ls++]=ac,ac=t,nc=n}function Ph(t,n,o){Tn[Sn++]=Ir,Tn[Sn++]=vr,Tn[Sn++]=Qi,Qi=t;var u=Ir;t=vr;var h=32-N(u)-1;u&=~(1<<h),o+=1;var y=32-N(n)+h;if(30<y){var L=h-h%5;y=(u&(1<<L)-1).toString(32),u>>=L,h-=L,Ir=1<<32-N(n)+h|o<<h|u,vr=y+t}else Ir=1<<y|o<<h|u,vr=t}function Fd(t){t.return!==null&&(zi(t,1),Ph(t,1,0))}function Od(t){for(;t===ac;)ac=ks[--Ls],ks[Ls]=null,nc=ks[--Ls],ks[Ls]=null;for(;t===Qi;)Qi=Tn[--Sn],Tn[Sn]=null,vr=Tn[--Sn],Tn[Sn]=null,Ir=Tn[--Sn],Tn[Sn]=null}var Ja=null,ia=null,Bt=!1,Vi=null,Xn=!1,jd=Error(i(519));function Ki(t){var n=Error(i(418,""));throw Lo(Nn(n,t)),jd}function Hh(t){var n=t.stateNode,o=t.type,u=t.memoizedProps;switch(n[Kt]=t,n[Ea]=u,o){case"dialog":Ct("cancel",n),Ct("close",n);break;case"iframe":case"object":case"embed":Ct("load",n);break;case"video":case"audio":for(o=0;o<el.length;o++)Ct(el[o],n);break;case"source":Ct("error",n);break;case"img":case"image":case"link":Ct("error",n),Ct("load",n);break;case"details":Ct("toggle",n);break;case"input":Ct("invalid",n),Wr(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),hr(n);break;case"select":Ct("invalid",n);break;case"textarea":Ct("invalid",n),yo(n,u.value,u.defaultValue,u.children),hr(n)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||u.suppressHydrationWarning===!0||r0(n.textContent,o)?(u.popover!=null&&(Ct("beforetoggle",n),Ct("toggle",n)),u.onScroll!=null&&Ct("scroll",n),u.onScrollEnd!=null&&Ct("scrollend",n),u.onClick!=null&&(n.onclick=Fc),n=!0):n=!1,n||Ki(t)}function Qh(t){for(Ja=t.return;Ja;)switch(Ja.tag){case 5:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:Ja=Ja.return}}function So(t){if(t!==Ja)return!1;if(!Bt)return Qh(t),Bt=!0,!1;var n=t.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||tf(t.type,t.memoizedProps)),o=!o),o&&ia&&Ki(t),Qh(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8)if(o=t.data,o==="/$"){if(n===0){ia=Pn(t.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++;t=t.nextSibling}ia=null}}else n===27?(n=ia,pi(t.type)?(t=sf,sf=null,ia=t):ia=n):ia=Ja?Pn(t.stateNode.nextSibling):null;return!0}function ko(){ia=Ja=null,Bt=!1}function zh(){var t=Vi;return t!==null&&(sn===null?sn=t:sn.push.apply(sn,t),Vi=null),t}function Lo(t){Vi===null?Vi=[t]:Vi.push(t)}var Pd=$(null),Gi=null,wr=null;function ai(t,n,o){ce(Pd,n._currentValue),n._currentValue=o}function Cr(t){t._currentValue=Pd.current,Z(Pd)}function Hd(t,n,o){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===o)break;t=t.return}}function Qd(t,n,o,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var y=h.dependencies;if(y!==null){var L=h.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=h;for(var Y=0;Y<n.length;Y++)if(M.context===n[Y]){y.lanes|=o,M=y.alternate,M!==null&&(M.lanes|=o),Hd(y.return,o,t),u||(L=null);break e}y=M.next}}else if(h.tag===18){if(L=h.return,L===null)throw Error(i(341));L.lanes|=o,y=L.alternate,y!==null&&(y.lanes|=o),Hd(L,o,t),L=null}else L=h.child;if(L!==null)L.return=h;else for(L=h;L!==null;){if(L===t){L=null;break}if(h=L.sibling,h!==null){h.return=L.return,L=h;break}L=L.return}h=L}}function Ro(t,n,o,u){t=null;for(var h=n,y=!1;h!==null;){if(!y){if((h.flags&524288)!==0)y=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var L=h.alternate;if(L===null)throw Error(i(387));if(L=L.memoizedProps,L!==null){var M=h.type;fn(h.pendingProps.value,L.value)||(t!==null?t.push(M):t=[M])}}else if(h===Se.current){if(L=h.alternate,L===null)throw Error(i(387));L.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(sl):t=[sl])}h=h.return}t!==null&&Qd(n,t,o,u),n.flags|=262144}function rc(t){for(t=t.firstContext;t!==null;){if(!fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qi(t){Gi=t,wr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function za(t){return Vh(Gi,t)}function ic(t,n){return Gi===null&&qi(t),Vh(t,n)}function Vh(t,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},wr===null){if(t===null)throw Error(i(308));wr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else wr=wr.next=n;return o}var BI=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(o,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(o){return o()})}},UI=r.unstable_scheduleCallback,_I=r.unstable_NormalPriority,ba={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zd(){return{controller:new BI,data:new Map,refCount:0}}function Do(t){t.refCount--,t.refCount===0&&UI(_I,function(){t.controller.abort()})}var Bo=null,Vd=0,Rs=0,Ds=null;function MI(t,n){if(Bo===null){var o=Bo=[];Vd=0,Rs=Gm(),Ds={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Vd++,n.then(Kh,Kh),n}function Kh(){if(--Vd===0&&Bo!==null){Ds!==null&&(Ds.status="fulfilled");var t=Bo;Bo=null,Rs=0,Ds=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function FI(t,n){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var h=0;h<o.length;h++)(0,o[h])(n)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var Gh=X.S;X.S=function(t,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&MI(t,n),Gh!==null&&Gh(t,n)};var Wi=$(null);function Kd(){var t=Wi.current;return t!==null?t:qt.pooledCache}function sc(t,n){n===null?ce(Wi,Wi.current):ce(Wi,n.pool)}function qh(){var t=Kd();return t===null?null:{parent:ba._currentValue,pool:t}}var Uo=Error(i(460)),Wh=Error(i(474)),oc=Error(i(542)),Gd={then:function(){}};function Yh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function lc(){}function Jh(t,n,o){switch(o=t[o],o===void 0?t.push(n):o!==n&&(n.then(lc,lc),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,$h(t),t;default:if(typeof n.status=="string")n.then(lc,lc);else{if(t=qt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=u}},function(u){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,$h(t),t}throw _o=n,Uo}}var _o=null;function Xh(){if(_o===null)throw Error(i(459));var t=_o;return _o=null,t}function $h(t){if(t===Uo||t===oc)throw Error(i(483))}var ni=!1;function qd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ri(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ii(t,n,o){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(_t&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,n=ec(t),Oh(t,null,o),n}return Zl(t,u,n,o),ec(t)}function Mo(t,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,hs(t,o)}}function Yd(t,n){var o=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var L={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?h=y=L:y=y.next=L,o=o.next}while(o!==null);y===null?h=y=n:y=y.next=n}else h=y=n;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=n:t.next=n,o.lastBaseUpdate=n}var Jd=!1;function Fo(){if(Jd){var t=Ds;if(t!==null)throw t}}function Oo(t,n,o,u){Jd=!1;var h=t.updateQueue;ni=!1;var y=h.firstBaseUpdate,L=h.lastBaseUpdate,M=h.shared.pending;if(M!==null){h.shared.pending=null;var Y=M,ue=Y.next;Y.next=null,L===null?y=ue:L.next=ue,L=Y;var Ee=t.alternate;Ee!==null&&(Ee=Ee.updateQueue,M=Ee.lastBaseUpdate,M!==L&&(M===null?Ee.firstBaseUpdate=ue:M.next=ue,Ee.lastBaseUpdate=Y))}if(y!==null){var we=h.baseState;L=0,Ee=ue=Y=null,M=y;do{var me=M.lane&-536870913,ge=me!==M.lane;if(ge?(kt&me)===me:(u&me)===me){me!==0&&me===Rs&&(Jd=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ot=t,et=M;me=n;var Qt=o;switch(et.tag){case 1:if(ot=et.payload,typeof ot=="function"){we=ot.call(Qt,we,me);break e}we=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=et.payload,me=typeof ot=="function"?ot.call(Qt,we,me):ot,me==null)break e;we=E({},we,me);break e;case 2:ni=!0}}me=M.callback,me!==null&&(t.flags|=64,ge&&(t.flags|=8192),ge=h.callbacks,ge===null?h.callbacks=[me]:ge.push(me))}else ge={lane:me,tag:M.tag,payload:M.payload,callback:M.callback,next:null},Ee===null?(ue=Ee=ge,Y=we):Ee=Ee.next=ge,L|=me;if(M=M.next,M===null){if(M=h.shared.pending,M===null)break;ge=M,M=ge.next,ge.next=null,h.lastBaseUpdate=ge,h.shared.pending=null}}while(!0);Ee===null&&(Y=we),h.baseState=Y,h.firstBaseUpdate=ue,h.lastBaseUpdate=Ee,y===null&&(h.shared.lanes=0),fi|=L,t.lanes=L,t.memoizedState=we}}function Zh(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function eA(t,n){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)Zh(o[t],n)}var Bs=$(null),cc=$(0);function tA(t,n){t=Rr,ce(cc,t),ce(Bs,n),Rr=t|n.baseLanes}function Xd(){ce(cc,Rr),ce(Bs,Bs.current)}function $d(){Rr=cc.current,Z(Bs),Z(cc)}var si=0,It=null,Pt=null,fa=null,uc=!1,Us=!1,Yi=!1,dc=0,jo=0,_s=null,OI=0;function da(){throw Error(i(321))}function Zd(t,n){if(n===null)return!1;for(var o=0;o<n.length&&o<t.length;o++)if(!fn(t[o],n[o]))return!1;return!0}function em(t,n,o,u,h,y){return si=y,It=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,X.H=t===null||t.memoizedState===null?OA:jA,Yi=!1,y=o(u,h),Yi=!1,Us&&(y=nA(n,o,u,h)),aA(t),y}function aA(t){X.H=pc;var n=Pt!==null&&Pt.next!==null;if(si=0,fa=Pt=It=null,uc=!1,jo=0,_s=null,n)throw Error(i(300));t===null||Sa||(t=t.dependencies,t!==null&&rc(t)&&(Sa=!0))}function nA(t,n,o,u){It=t;var h=0;do{if(Us&&(_s=null),jo=0,Us=!1,25<=h)throw Error(i(301));if(h+=1,fa=Pt=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}X.H=KI,y=n(o,u)}while(Us);return y}function jI(){var t=X.H,n=t.useState()[0];return n=typeof n.then=="function"?Po(n):n,t=t.useState()[0],(Pt!==null?Pt.memoizedState:null)!==t&&(It.flags|=1024),n}function tm(){var t=dc!==0;return dc=0,t}function am(t,n,o){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~o}function nm(t){if(uc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}uc=!1}si=0,fa=Pt=It=null,Us=!1,jo=dc=0,_s=null}function nn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fa===null?It.memoizedState=fa=t:fa=fa.next=t,fa}function ga(){if(Pt===null){var t=It.alternate;t=t!==null?t.memoizedState:null}else t=Pt.next;var n=fa===null?It.memoizedState:fa.next;if(n!==null)fa=n,Pt=t;else{if(t===null)throw It.alternate===null?Error(i(467)):Error(i(310));Pt=t,t={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},fa===null?It.memoizedState=fa=t:fa=fa.next=t}return fa}function rm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(t){var n=jo;return jo+=1,_s===null&&(_s=[]),t=Jh(_s,t,n),n=It,(fa===null?n.memoizedState:fa.next)===null&&(n=n.alternate,X.H=n===null||n.memoizedState===null?OA:jA),t}function mc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Po(t);if(t.$$typeof===S)return za(t)}throw Error(i(438,String(t)))}function im(t){var n=null,o=It.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var u=It.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=rm(),It.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(t),u=0;u<t;u++)o[u]=V;return n.index++,o}function Nr(t,n){return typeof n=="function"?n(t):n}function fc(t){var n=ga();return sm(n,Pt,t)}function sm(t,n,o){var u=t.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=o;var h=t.baseQueue,y=u.pending;if(y!==null){if(h!==null){var L=h.next;h.next=y.next,y.next=L}n.baseQueue=h=y,u.pending=null}if(y=t.baseState,h===null)t.memoizedState=y;else{n=h.next;var M=L=null,Y=null,ue=n,Ee=!1;do{var we=ue.lane&-536870913;if(we!==ue.lane?(kt&we)===we:(si&we)===we){var me=ue.revertLane;if(me===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),we===Rs&&(Ee=!0);else if((si&me)===me){ue=ue.next,me===Rs&&(Ee=!0);continue}else we={lane:0,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(M=Y=we,L=y):Y=Y.next=we,It.lanes|=me,fi|=me;we=ue.action,Yi&&o(y,we),y=ue.hasEagerState?ue.eagerState:o(y,we)}else me={lane:we,revertLane:ue.revertLane,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(M=Y=me,L=y):Y=Y.next=me,It.lanes|=we,fi|=we;ue=ue.next}while(ue!==null&&ue!==n);if(Y===null?L=y:Y.next=M,!fn(y,t.memoizedState)&&(Sa=!0,Ee&&(o=Ds,o!==null)))throw o;t.memoizedState=y,t.baseState=L,t.baseQueue=Y,u.lastRenderedState=y}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function om(t){var n=ga(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=t;var u=o.dispatch,h=o.pending,y=n.memoizedState;if(h!==null){o.pending=null;var L=h=h.next;do y=t(y,L.action),L=L.next;while(L!==h);fn(y,n.memoizedState)||(Sa=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),o.lastRenderedState=y}return[y,u]}function rA(t,n,o){var u=It,h=ga(),y=Bt;if(y){if(o===void 0)throw Error(i(407));o=o()}else o=n();var L=!fn((Pt||h).memoizedState,o);L&&(h.memoizedState=o,Sa=!0),h=h.queue;var M=oA.bind(null,u,h,t);if(Ho(2048,8,M,[t]),h.getSnapshot!==n||L||fa!==null&&fa.memoizedState.tag&1){if(u.flags|=2048,Ms(9,gc(),sA.bind(null,u,h,o,n),null),qt===null)throw Error(i(349));y||(si&124)!==0||iA(u,n,o)}return o}function iA(t,n,o){t.flags|=16384,t={getSnapshot:n,value:o},n=It.updateQueue,n===null?(n=rm(),It.updateQueue=n,n.stores=[t]):(o=n.stores,o===null?n.stores=[t]:o.push(t))}function sA(t,n,o,u){n.value=o,n.getSnapshot=u,lA(n)&&cA(t)}function oA(t,n,o){return o(function(){lA(n)&&cA(t)})}function lA(t){var n=t.getSnapshot;t=t.value;try{var o=n();return!fn(t,o)}catch{return!0}}function cA(t){var n=Ts(t,2);n!==null&&En(n,t,2)}function lm(t){var n=nn();if(typeof t=="function"){var o=t;if(t=o(),Yi){v(!0);try{o()}finally{v(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:t},n}function uA(t,n,o,u){return t.baseState=o,sm(t,Pt,typeof u=="function"?u:Nr)}function PI(t,n,o,u,h){if(Ac(t))throw Error(i(485));if(t=n.action,t!==null){var y={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){y.listeners.push(L)}};X.T!==null?o(!0):y.isTransition=!1,u(y),o=n.pending,o===null?(y.next=n.pending=y,dA(n,y)):(y.next=o.next,n.pending=o.next=y)}}function dA(t,n){var o=n.action,u=n.payload,h=t.state;if(n.isTransition){var y=X.T,L={};X.T=L;try{var M=o(h,u),Y=X.S;Y!==null&&Y(L,M),mA(t,n,M)}catch(ue){cm(t,n,ue)}finally{X.T=y}}else try{y=o(h,u),mA(t,n,y)}catch(ue){cm(t,n,ue)}}function mA(t,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){fA(t,n,u)},function(u){return cm(t,n,u)}):fA(t,n,o)}function fA(t,n,o){n.status="fulfilled",n.value=o,gA(n),t.state=o,n=t.pending,n!==null&&(o=n.next,o===n?t.pending=null:(o=o.next,n.next=o,dA(t,o)))}function cm(t,n,o){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=o,gA(n),n=n.next;while(n!==u)}t.action=null}function gA(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function hA(t,n){return n}function AA(t,n){if(Bt){var o=qt.formState;if(o!==null){e:{var u=It;if(Bt){if(ia){t:{for(var h=ia,y=Xn;h.nodeType!==8;){if(!y){h=null;break t}if(h=Pn(h.nextSibling),h===null){h=null;break t}}y=h.data,h=y==="F!"||y==="F"?h:null}if(h){ia=Pn(h.nextSibling),u=h.data==="F!";break e}}Ki(u)}u=!1}u&&(n=o[0])}}return o=nn(),o.memoizedState=o.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hA,lastRenderedState:n},o.queue=u,o=_A.bind(null,It,u),u.dispatch=o,u=lm(!1),y=gm.bind(null,It,!1,u.queue),u=nn(),h={state:n,dispatch:null,action:t,pending:null},u.queue=h,o=PI.bind(null,It,h,y,o),h.dispatch=o,u.memoizedState=t,[n,o,!1]}function pA(t){var n=ga();return yA(n,Pt,t)}function yA(t,n,o){if(n=sm(t,n,hA)[0],t=fc(Nr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Po(n)}catch(L){throw L===Uo?oc:L}else u=n;n=ga();var h=n.queue,y=h.dispatch;return o!==n.memoizedState&&(It.flags|=2048,Ms(9,gc(),HI.bind(null,h,o),null)),[u,y,t]}function HI(t,n){t.action=n}function EA(t){var n=ga(),o=Pt;if(o!==null)return yA(n,o,t);ga(),n=n.memoizedState,o=ga();var u=o.queue.dispatch;return o.memoizedState=t,[n,u,!1]}function Ms(t,n,o,u){return t={tag:t,create:o,deps:u,inst:n,next:null},n=It.updateQueue,n===null&&(n=rm(),It.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=t.next=t:(u=o.next,o.next=t,t.next=u,n.lastEffect=t),t}function gc(){return{destroy:void 0,resource:void 0}}function bA(){return ga().memoizedState}function hc(t,n,o,u){var h=nn();u=u===void 0?null:u,It.flags|=t,h.memoizedState=Ms(1|n,gc(),o,u)}function Ho(t,n,o,u){var h=ga();u=u===void 0?null:u;var y=h.memoizedState.inst;Pt!==null&&u!==null&&Zd(u,Pt.memoizedState.deps)?h.memoizedState=Ms(n,y,o,u):(It.flags|=t,h.memoizedState=Ms(1|n,y,o,u))}function IA(t,n){hc(8390656,8,t,n)}function vA(t,n){Ho(2048,8,t,n)}function wA(t,n){return Ho(4,2,t,n)}function CA(t,n){return Ho(4,4,t,n)}function NA(t,n){if(typeof n=="function"){t=t();var o=n(t);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function xA(t,n,o){o=o!=null?o.concat([t]):null,Ho(4,4,NA.bind(null,n,t),o)}function um(){}function TA(t,n){var o=ga();n=n===void 0?null:n;var u=o.memoizedState;return n!==null&&Zd(n,u[1])?u[0]:(o.memoizedState=[t,n],t)}function SA(t,n){var o=ga();n=n===void 0?null:n;var u=o.memoizedState;if(n!==null&&Zd(n,u[1]))return u[0];if(u=t(),Yi){v(!0);try{t()}finally{v(!1)}}return o.memoizedState=[u,n],u}function dm(t,n,o){return o===void 0||(si&1073741824)!==0?t.memoizedState=n:(t.memoizedState=o,t=Rp(),It.lanes|=t,fi|=t,o)}function kA(t,n,o,u){return fn(o,n)?o:Bs.current!==null?(t=dm(t,o,u),fn(t,n)||(Sa=!0),t):(si&42)===0?(Sa=!0,t.memoizedState=o):(t=Rp(),It.lanes|=t,fi|=t,n)}function LA(t,n,o,u,h){var y=ae.p;ae.p=y!==0&&8>y?y:8;var L=X.T,M={};X.T=M,gm(t,!1,n,o);try{var Y=h(),ue=X.S;if(ue!==null&&ue(M,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var Ee=FI(Y,u);Qo(t,n,Ee,yn(t))}else Qo(t,n,u,yn(t))}catch(we){Qo(t,n,{then:function(){},status:"rejected",reason:we},yn())}finally{ae.p=y,X.T=L}}function QI(){}function mm(t,n,o,u){if(t.tag!==5)throw Error(i(476));var h=RA(t).queue;LA(t,h,n,pe,o===null?QI:function(){return DA(t),o(u)})}function RA(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:pe},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:o},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function DA(t){var n=RA(t).next.queue;Qo(t,n,{},yn())}function fm(){return za(sl)}function BA(){return ga().memoizedState}function UA(){return ga().memoizedState}function zI(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var o=yn();t=ri(o);var u=ii(n,t,o);u!==null&&(En(u,n,o),Mo(u,n,o)),n={cache:zd()},t.payload=n;return}n=n.return}}function VI(t,n,o){var u=yn();o={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Ac(t)?MA(n,o):(o=Bd(t,n,o,u),o!==null&&(En(o,t,u),FA(o,n,u)))}function _A(t,n,o){var u=yn();Qo(t,n,o,u)}function Qo(t,n,o,u){var h={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ac(t))MA(n,h);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null))try{var L=n.lastRenderedState,M=y(L,o);if(h.hasEagerState=!0,h.eagerState=M,fn(M,L))return Zl(t,n,h,0),qt===null&&$l(),!1}catch{}finally{}if(o=Bd(t,n,h,u),o!==null)return En(o,t,u),FA(o,n,u),!0}return!1}function gm(t,n,o,u){if(u={lane:2,revertLane:Gm(),action:u,hasEagerState:!1,eagerState:null,next:null},Ac(t)){if(n)throw Error(i(479))}else n=Bd(t,o,u,2),n!==null&&En(n,t,2)}function Ac(t){var n=t.alternate;return t===It||n!==null&&n===It}function MA(t,n){Us=uc=!0;var o=t.pending;o===null?n.next=n:(n.next=o.next,o.next=n),t.pending=n}function FA(t,n,o){if((o&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,o|=u,n.lanes=o,hs(t,o)}}var pc={readContext:za,use:mc,useCallback:da,useContext:da,useEffect:da,useImperativeHandle:da,useLayoutEffect:da,useInsertionEffect:da,useMemo:da,useReducer:da,useRef:da,useState:da,useDebugValue:da,useDeferredValue:da,useTransition:da,useSyncExternalStore:da,useId:da,useHostTransitionStatus:da,useFormState:da,useActionState:da,useOptimistic:da,useMemoCache:da,useCacheRefresh:da},OA={readContext:za,use:mc,useCallback:function(t,n){return nn().memoizedState=[t,n===void 0?null:n],t},useContext:za,useEffect:IA,useImperativeHandle:function(t,n,o){o=o!=null?o.concat([t]):null,hc(4194308,4,NA.bind(null,n,t),o)},useLayoutEffect:function(t,n){return hc(4194308,4,t,n)},useInsertionEffect:function(t,n){hc(4,2,t,n)},useMemo:function(t,n){var o=nn();n=n===void 0?null:n;var u=t();if(Yi){v(!0);try{t()}finally{v(!1)}}return o.memoizedState=[u,n],u},useReducer:function(t,n,o){var u=nn();if(o!==void 0){var h=o(n);if(Yi){v(!0);try{o(n)}finally{v(!1)}}}else h=n;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=VI.bind(null,It,t),[u.memoizedState,t]},useRef:function(t){var n=nn();return t={current:t},n.memoizedState=t},useState:function(t){t=lm(t);var n=t.queue,o=_A.bind(null,It,n);return n.dispatch=o,[t.memoizedState,o]},useDebugValue:um,useDeferredValue:function(t,n){var o=nn();return dm(o,t,n)},useTransition:function(){var t=lm(!1);return t=LA.bind(null,It,t.queue,!0,!1),nn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,o){var u=It,h=nn();if(Bt){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),qt===null)throw Error(i(349));(kt&124)!==0||iA(u,n,o)}h.memoizedState=o;var y={value:o,getSnapshot:n};return h.queue=y,IA(oA.bind(null,u,y,t),[t]),u.flags|=2048,Ms(9,gc(),sA.bind(null,u,y,o,n),null),o},useId:function(){var t=nn(),n=qt.identifierPrefix;if(Bt){var o=vr,u=Ir;o=(u&~(1<<32-N(u)-1)).toString(32)+o,n="«"+n+"R"+o,o=dc++,0<o&&(n+="H"+o.toString(32)),n+="»"}else o=OI++,n="«"+n+"r"+o.toString(32)+"»";return t.memoizedState=n},useHostTransitionStatus:fm,useFormState:AA,useActionState:AA,useOptimistic:function(t){var n=nn();n.memoizedState=n.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=gm.bind(null,It,!0,o),o.dispatch=n,[t,n]},useMemoCache:im,useCacheRefresh:function(){return nn().memoizedState=zI.bind(null,It)}},jA={readContext:za,use:mc,useCallback:TA,useContext:za,useEffect:vA,useImperativeHandle:xA,useInsertionEffect:wA,useLayoutEffect:CA,useMemo:SA,useReducer:fc,useRef:bA,useState:function(){return fc(Nr)},useDebugValue:um,useDeferredValue:function(t,n){var o=ga();return kA(o,Pt.memoizedState,t,n)},useTransition:function(){var t=fc(Nr)[0],n=ga().memoizedState;return[typeof t=="boolean"?t:Po(t),n]},useSyncExternalStore:rA,useId:BA,useHostTransitionStatus:fm,useFormState:pA,useActionState:pA,useOptimistic:function(t,n){var o=ga();return uA(o,Pt,t,n)},useMemoCache:im,useCacheRefresh:UA},KI={readContext:za,use:mc,useCallback:TA,useContext:za,useEffect:vA,useImperativeHandle:xA,useInsertionEffect:wA,useLayoutEffect:CA,useMemo:SA,useReducer:om,useRef:bA,useState:function(){return om(Nr)},useDebugValue:um,useDeferredValue:function(t,n){var o=ga();return Pt===null?dm(o,t,n):kA(o,Pt.memoizedState,t,n)},useTransition:function(){var t=om(Nr)[0],n=ga().memoizedState;return[typeof t=="boolean"?t:Po(t),n]},useSyncExternalStore:rA,useId:BA,useHostTransitionStatus:fm,useFormState:EA,useActionState:EA,useOptimistic:function(t,n){var o=ga();return Pt!==null?uA(o,Pt,t,n):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:im,useCacheRefresh:UA},Fs=null,zo=0;function yc(t){var n=zo;return zo+=1,Fs===null&&(Fs=[]),Jh(Fs,t,n)}function Vo(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Ec(t,n){throw n.$$typeof===p?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function PA(t){var n=t._init;return n(t._payload)}function HA(t){function n(re,ee){if(t){var le=re.deletions;le===null?(re.deletions=[ee],re.flags|=16):le.push(ee)}}function o(re,ee){if(!t)return null;for(;ee!==null;)n(re,ee),ee=ee.sibling;return null}function u(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function h(re,ee){return re=br(re,ee),re.index=0,re.sibling=null,re}function y(re,ee,le){return re.index=le,t?(le=re.alternate,le!==null?(le=le.index,le<ee?(re.flags|=67108866,ee):le):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function L(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function M(re,ee,le,Ie){return ee===null||ee.tag!==6?(ee=_d(le,re.mode,Ie),ee.return=re,ee):(ee=h(ee,le),ee.return=re,ee)}function Y(re,ee,le,Ie){var Qe=le.type;return Qe===x?Ee(re,ee,le.props.children,Ie,le.key):ee!==null&&(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&PA(Qe)===ee.type)?(ee=h(ee,le.props),Vo(ee,le),ee.return=re,ee):(ee=tc(le.type,le.key,le.props,null,re.mode,Ie),Vo(ee,le),ee.return=re,ee)}function ue(re,ee,le,Ie){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==le.containerInfo||ee.stateNode.implementation!==le.implementation?(ee=Md(le,re.mode,Ie),ee.return=re,ee):(ee=h(ee,le.children||[]),ee.return=re,ee)}function Ee(re,ee,le,Ie,Qe){return ee===null||ee.tag!==7?(ee=Hi(le,re.mode,Ie,Qe),ee.return=re,ee):(ee=h(ee,le),ee.return=re,ee)}function we(re,ee,le){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=_d(""+ee,re.mode,le),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case C:return le=tc(ee.type,ee.key,ee.props,null,re.mode,le),Vo(le,ee),le.return=re,le;case I:return ee=Md(ee,re.mode,le),ee.return=re,ee;case H:var Ie=ee._init;return ee=Ie(ee._payload),we(re,ee,le)}if(de(ee)||q(ee))return ee=Hi(ee,re.mode,le,null),ee.return=re,ee;if(typeof ee.then=="function")return we(re,yc(ee),le);if(ee.$$typeof===S)return we(re,ic(re,ee),le);Ec(re,ee)}return null}function me(re,ee,le,Ie){var Qe=ee!==null?ee.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Qe!==null?null:M(re,ee,""+le,Ie);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Qe?Y(re,ee,le,Ie):null;case I:return le.key===Qe?ue(re,ee,le,Ie):null;case H:return Qe=le._init,le=Qe(le._payload),me(re,ee,le,Ie)}if(de(le)||q(le))return Qe!==null?null:Ee(re,ee,le,Ie,null);if(typeof le.then=="function")return me(re,ee,yc(le),Ie);if(le.$$typeof===S)return me(re,ee,ic(re,le),Ie);Ec(re,le)}return null}function ge(re,ee,le,Ie,Qe){if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number"||typeof Ie=="bigint")return re=re.get(le)||null,M(ee,re,""+Ie,Qe);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case C:return re=re.get(Ie.key===null?le:Ie.key)||null,Y(ee,re,Ie,Qe);case I:return re=re.get(Ie.key===null?le:Ie.key)||null,ue(ee,re,Ie,Qe);case H:var vt=Ie._init;return Ie=vt(Ie._payload),ge(re,ee,le,Ie,Qe)}if(de(Ie)||q(Ie))return re=re.get(le)||null,Ee(ee,re,Ie,Qe,null);if(typeof Ie.then=="function")return ge(re,ee,le,yc(Ie),Qe);if(Ie.$$typeof===S)return ge(re,ee,le,ic(ee,Ie),Qe);Ec(ee,Ie)}return null}function ot(re,ee,le,Ie){for(var Qe=null,vt=null,We=ee,at=ee=0,La=null;We!==null&&at<le.length;at++){We.index>at?(La=We,We=null):La=We.sibling;var Rt=me(re,We,le[at],Ie);if(Rt===null){We===null&&(We=La);break}t&&We&&Rt.alternate===null&&n(re,We),ee=y(Rt,ee,at),vt===null?Qe=Rt:vt.sibling=Rt,vt=Rt,We=La}if(at===le.length)return o(re,We),Bt&&zi(re,at),Qe;if(We===null){for(;at<le.length;at++)We=we(re,le[at],Ie),We!==null&&(ee=y(We,ee,at),vt===null?Qe=We:vt.sibling=We,vt=We);return Bt&&zi(re,at),Qe}for(We=u(We);at<le.length;at++)La=ge(We,re,at,le[at],Ie),La!==null&&(t&&La.alternate!==null&&We.delete(La.key===null?at:La.key),ee=y(La,ee,at),vt===null?Qe=La:vt.sibling=La,vt=La);return t&&We.forEach(function(vi){return n(re,vi)}),Bt&&zi(re,at),Qe}function et(re,ee,le,Ie){if(le==null)throw Error(i(151));for(var Qe=null,vt=null,We=ee,at=ee=0,La=null,Rt=le.next();We!==null&&!Rt.done;at++,Rt=le.next()){We.index>at?(La=We,We=null):La=We.sibling;var vi=me(re,We,Rt.value,Ie);if(vi===null){We===null&&(We=La);break}t&&We&&vi.alternate===null&&n(re,We),ee=y(vi,ee,at),vt===null?Qe=vi:vt.sibling=vi,vt=vi,We=La}if(Rt.done)return o(re,We),Bt&&zi(re,at),Qe;if(We===null){for(;!Rt.done;at++,Rt=le.next())Rt=we(re,Rt.value,Ie),Rt!==null&&(ee=y(Rt,ee,at),vt===null?Qe=Rt:vt.sibling=Rt,vt=Rt);return Bt&&zi(re,at),Qe}for(We=u(We);!Rt.done;at++,Rt=le.next())Rt=ge(We,re,at,Rt.value,Ie),Rt!==null&&(t&&Rt.alternate!==null&&We.delete(Rt.key===null?at:Rt.key),ee=y(Rt,ee,at),vt===null?Qe=Rt:vt.sibling=Rt,vt=Rt);return t&&We.forEach(function(Gv){return n(re,Gv)}),Bt&&zi(re,at),Qe}function Qt(re,ee,le,Ie){if(typeof le=="object"&&le!==null&&le.type===x&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Qe=le.key;ee!==null;){if(ee.key===Qe){if(Qe=le.type,Qe===x){if(ee.tag===7){o(re,ee.sibling),Ie=h(ee,le.props.children),Ie.return=re,re=Ie;break e}}else if(ee.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&PA(Qe)===ee.type){o(re,ee.sibling),Ie=h(ee,le.props),Vo(Ie,le),Ie.return=re,re=Ie;break e}o(re,ee);break}else n(re,ee);ee=ee.sibling}le.type===x?(Ie=Hi(le.props.children,re.mode,Ie,le.key),Ie.return=re,re=Ie):(Ie=tc(le.type,le.key,le.props,null,re.mode,Ie),Vo(Ie,le),Ie.return=re,re=Ie)}return L(re);case I:e:{for(Qe=le.key;ee!==null;){if(ee.key===Qe)if(ee.tag===4&&ee.stateNode.containerInfo===le.containerInfo&&ee.stateNode.implementation===le.implementation){o(re,ee.sibling),Ie=h(ee,le.children||[]),Ie.return=re,re=Ie;break e}else{o(re,ee);break}else n(re,ee);ee=ee.sibling}Ie=Md(le,re.mode,Ie),Ie.return=re,re=Ie}return L(re);case H:return Qe=le._init,le=Qe(le._payload),Qt(re,ee,le,Ie)}if(de(le))return ot(re,ee,le,Ie);if(q(le)){if(Qe=q(le),typeof Qe!="function")throw Error(i(150));return le=Qe.call(le),et(re,ee,le,Ie)}if(typeof le.then=="function")return Qt(re,ee,yc(le),Ie);if(le.$$typeof===S)return Qt(re,ee,ic(re,le),Ie);Ec(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ee!==null&&ee.tag===6?(o(re,ee.sibling),Ie=h(ee,le),Ie.return=re,re=Ie):(o(re,ee),Ie=_d(le,re.mode,Ie),Ie.return=re,re=Ie),L(re)):o(re,ee)}return function(re,ee,le,Ie){try{zo=0;var Qe=Qt(re,ee,le,Ie);return Fs=null,Qe}catch(We){if(We===Uo||We===oc)throw We;var vt=gn(29,We,null,re.mode);return vt.lanes=Ie,vt.return=re,vt}finally{}}}var Os=HA(!0),QA=HA(!1),kn=$(null),$n=null;function oi(t){var n=t.alternate;ce(Ia,Ia.current&1),ce(kn,t),$n===null&&(n===null||Bs.current!==null||n.memoizedState!==null)&&($n=t)}function zA(t){if(t.tag===22){if(ce(Ia,Ia.current),ce(kn,t),$n===null){var n=t.alternate;n!==null&&n.memoizedState!==null&&($n=t)}}else li()}function li(){ce(Ia,Ia.current),ce(kn,kn.current)}function xr(t){Z(kn),$n===t&&($n=null),Z(Ia)}var Ia=$(0);function bc(t){for(var n=t;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||rf(o)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function hm(t,n,o,u){n=t.memoizedState,o=o(u,n),o=o==null?n:E({},n,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var Am={enqueueSetState:function(t,n,o){t=t._reactInternals;var u=yn(),h=ri(u);h.payload=n,o!=null&&(h.callback=o),n=ii(t,h,u),n!==null&&(En(n,t,u),Mo(n,t,u))},enqueueReplaceState:function(t,n,o){t=t._reactInternals;var u=yn(),h=ri(u);h.tag=1,h.payload=n,o!=null&&(h.callback=o),n=ii(t,h,u),n!==null&&(En(n,t,u),Mo(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var o=yn(),u=ri(o);u.tag=2,n!=null&&(u.callback=n),n=ii(t,u,o),n!==null&&(En(n,t,o),Mo(n,t,o))}};function VA(t,n,o,u,h,y,L){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,y,L):n.prototype&&n.prototype.isPureReactComponent?!xo(o,u)||!xo(h,y):!0}function KA(t,n,o,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,u),n.state!==t&&Am.enqueueReplaceState(n,n.state,null)}function Ji(t,n){var o=n;if("ref"in n){o={};for(var u in n)u!=="ref"&&(o[u]=n[u])}if(t=t.defaultProps){o===n&&(o=E({},o));for(var h in t)o[h]===void 0&&(o[h]=t[h])}return o}var Ic=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function GA(t){Ic(t)}function qA(t){console.error(t)}function WA(t){Ic(t)}function vc(t,n){try{var o=t.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function YA(t,n,o){try{var u=t.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function pm(t,n,o){return o=ri(o),o.tag=3,o.payload={element:null},o.callback=function(){vc(t,n)},o}function JA(t){return t=ri(t),t.tag=3,t}function XA(t,n,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var y=u.value;t.payload=function(){return h(y)},t.callback=function(){YA(n,o,u)}}var L=o.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(t.callback=function(){YA(n,o,u),typeof h!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})})}function GI(t,n,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=o.alternate,n!==null&&Ro(n,o,h,!0),o=kn.current,o!==null){switch(o.tag){case 13:return $n===null?Hm():o.alternate===null&&sa===0&&(sa=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===Gd?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([u]):n.add(u),zm(t,u,h)),!1;case 22:return o.flags|=65536,u===Gd?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([u]):o.add(u)),zm(t,u,h)),!1}throw Error(i(435,o.tag))}return zm(t,u,h),Hm(),!1}if(Bt)return n=kn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,u!==jd&&(t=Error(i(422),{cause:u}),Lo(Nn(t,o)))):(u!==jd&&(n=Error(i(423),{cause:u}),Lo(Nn(n,o))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=Nn(u,o),h=pm(t.stateNode,u,h),Yd(t,h),sa!==4&&(sa=2)),!1;var y=Error(i(520),{cause:u});if(y=Nn(y,o),Xo===null?Xo=[y]:Xo.push(y),sa!==4&&(sa=2),n===null)return!0;u=Nn(u,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,t=h&-h,o.lanes|=t,t=pm(o.stateNode,u,t),Yd(o,t),!1;case 1:if(n=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(gi===null||!gi.has(y))))return o.flags|=65536,h&=-h,o.lanes|=h,h=JA(h),XA(h,t,o,u),Yd(o,h),!1}o=o.return}while(o!==null);return!1}var $A=Error(i(461)),Sa=!1;function Ba(t,n,o,u){n.child=t===null?QA(n,null,o,u):Os(n,t.child,o,u)}function ZA(t,n,o,u,h){o=o.render;var y=n.ref;if("ref"in u){var L={};for(var M in u)M!=="ref"&&(L[M]=u[M])}else L=u;return qi(n),u=em(t,n,o,L,y,h),M=tm(),t!==null&&!Sa?(am(t,n,h),Tr(t,n,h)):(Bt&&M&&Fd(n),n.flags|=1,Ba(t,n,u,h),n.child)}function ep(t,n,o,u,h){if(t===null){var y=o.type;return typeof y=="function"&&!Ud(y)&&y.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=y,tp(t,n,y,u,h)):(t=tc(o.type,null,u,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(y=t.child,!Nm(t,h)){var L=y.memoizedProps;if(o=o.compare,o=o!==null?o:xo,o(L,u)&&t.ref===n.ref)return Tr(t,n,h)}return n.flags|=1,t=br(y,u),t.ref=n.ref,t.return=n,n.child=t}function tp(t,n,o,u,h){if(t!==null){var y=t.memoizedProps;if(xo(y,u)&&t.ref===n.ref)if(Sa=!1,n.pendingProps=u=y,Nm(t,h))(t.flags&131072)!==0&&(Sa=!0);else return n.lanes=t.lanes,Tr(t,n,h)}return ym(t,n,o,u,h)}function ap(t,n,o){var u=n.pendingProps,h=u.children,y=t!==null?t.memoizedState:null;if(u.mode==="hidden"){if((n.flags&128)!==0){if(u=y!==null?y.baseLanes|o:o,t!==null){for(h=n.child=t.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;n.childLanes=y&~u}else n.childLanes=0,n.child=null;return np(t,n,u,o)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&sc(n,y!==null?y.cachePool:null),y!==null?tA(n,y):Xd(),zA(n);else return n.lanes=n.childLanes=536870912,np(t,n,y!==null?y.baseLanes|o:o,o)}else y!==null?(sc(n,y.cachePool),tA(n,y),li(),n.memoizedState=null):(t!==null&&sc(n,null),Xd(),li());return Ba(t,n,h,o),n.child}function np(t,n,o,u){var h=Kd();return h=h===null?null:{parent:ba._currentValue,pool:h},n.memoizedState={baseLanes:o,cachePool:h},t!==null&&sc(n,null),Xd(),zA(n),t!==null&&Ro(t,n,u,!0),null}function wc(t,n){var o=n.ref;if(o===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(t===null||t.ref!==o)&&(n.flags|=4194816)}}function ym(t,n,o,u,h){return qi(n),o=em(t,n,o,u,void 0,h),u=tm(),t!==null&&!Sa?(am(t,n,h),Tr(t,n,h)):(Bt&&u&&Fd(n),n.flags|=1,Ba(t,n,o,h),n.child)}function rp(t,n,o,u,h,y){return qi(n),n.updateQueue=null,o=nA(n,u,o,h),aA(t),u=tm(),t!==null&&!Sa?(am(t,n,y),Tr(t,n,y)):(Bt&&u&&Fd(n),n.flags|=1,Ba(t,n,o,y),n.child)}function ip(t,n,o,u,h){if(qi(n),n.stateNode===null){var y=Ss,L=o.contextType;typeof L=="object"&&L!==null&&(y=za(L)),y=new o(u,y),n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Am,n.stateNode=y,y._reactInternals=n,y=n.stateNode,y.props=u,y.state=n.memoizedState,y.refs={},qd(n),L=o.contextType,y.context=typeof L=="object"&&L!==null?za(L):Ss,y.state=n.memoizedState,L=o.getDerivedStateFromProps,typeof L=="function"&&(hm(n,o,L,u),y.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(L=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),L!==y.state&&Am.enqueueReplaceState(y,y.state,null),Oo(n,u,y,h),Fo(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){y=n.stateNode;var M=n.memoizedProps,Y=Ji(o,M);y.props=Y;var ue=y.context,Ee=o.contextType;L=Ss,typeof Ee=="object"&&Ee!==null&&(L=za(Ee));var we=o.getDerivedStateFromProps;Ee=typeof we=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=n.pendingProps!==M,Ee||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||ue!==L)&&KA(n,y,u,L),ni=!1;var me=n.memoizedState;y.state=me,Oo(n,u,y,h),Fo(),ue=n.memoizedState,M||me!==ue||ni?(typeof we=="function"&&(hm(n,o,we,u),ue=n.memoizedState),(Y=ni||VA(n,o,Y,u,me,ue,L))?(Ee||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=ue),y.props=u,y.state=ue,y.context=L,u=Y):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{y=n.stateNode,Wd(t,n),L=n.memoizedProps,Ee=Ji(o,L),y.props=Ee,we=n.pendingProps,me=y.context,ue=o.contextType,Y=Ss,typeof ue=="object"&&ue!==null&&(Y=za(ue)),M=o.getDerivedStateFromProps,(ue=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(L!==we||me!==Y)&&KA(n,y,u,Y),ni=!1,me=n.memoizedState,y.state=me,Oo(n,u,y,h),Fo();var ge=n.memoizedState;L!==we||me!==ge||ni||t!==null&&t.dependencies!==null&&rc(t.dependencies)?(typeof M=="function"&&(hm(n,o,M,u),ge=n.memoizedState),(Ee=ni||VA(n,o,Ee,u,me,ge,Y)||t!==null&&t.dependencies!==null&&rc(t.dependencies))?(ue||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,ge,Y),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,ge,Y)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||L===t.memoizedProps&&me===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&me===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=ge),y.props=u,y.state=ge,y.context=Y,u=Ee):(typeof y.componentDidUpdate!="function"||L===t.memoizedProps&&me===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&me===t.memoizedState||(n.flags|=1024),u=!1)}return y=u,wc(t,n),u=(n.flags&128)!==0,y||u?(y=n.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:y.render(),n.flags|=1,t!==null&&u?(n.child=Os(n,t.child,null,h),n.child=Os(n,null,o,h)):Ba(t,n,o,h),n.memoizedState=y.state,t=n.child):t=Tr(t,n,h),t}function sp(t,n,o,u){return ko(),n.flags|=256,Ba(t,n,o,u),n.child}var Em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bm(t){return{baseLanes:t,cachePool:qh()}}function Im(t,n,o){return t=t!==null?t.childLanes&~o:0,n&&(t|=Ln),t}function op(t,n,o){var u=n.pendingProps,h=!1,y=(n.flags&128)!==0,L;if((L=y)||(L=t!==null&&t.memoizedState===null?!1:(Ia.current&2)!==0),L&&(h=!0,n.flags&=-129),L=(n.flags&32)!==0,n.flags&=-33,t===null){if(Bt){if(h?oi(n):li(),Bt){var M=ia,Y;if(Y=M){e:{for(Y=M,M=Xn;Y.nodeType!==8;){if(!M){M=null;break e}if(Y=Pn(Y.nextSibling),Y===null){M=null;break e}}M=Y}M!==null?(n.memoizedState={dehydrated:M,treeContext:Qi!==null?{id:Ir,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},Y=gn(18,null,null,0),Y.stateNode=M,Y.return=n,n.child=Y,Ja=n,ia=null,Y=!0):Y=!1}Y||Ki(n)}if(M=n.memoizedState,M!==null&&(M=M.dehydrated,M!==null))return rf(M)?n.lanes=32:n.lanes=536870912,null;xr(n)}return M=u.children,u=u.fallback,h?(li(),h=n.mode,M=Cc({mode:"hidden",children:M},h),u=Hi(u,h,o,null),M.return=n,u.return=n,M.sibling=u,n.child=M,h=n.child,h.memoizedState=bm(o),h.childLanes=Im(t,L,o),n.memoizedState=Em,u):(oi(n),vm(n,M))}if(Y=t.memoizedState,Y!==null&&(M=Y.dehydrated,M!==null)){if(y)n.flags&256?(oi(n),n.flags&=-257,n=wm(t,n,o)):n.memoizedState!==null?(li(),n.child=t.child,n.flags|=128,n=null):(li(),h=u.fallback,M=n.mode,u=Cc({mode:"visible",children:u.children},M),h=Hi(h,M,o,null),h.flags|=2,u.return=n,h.return=n,u.sibling=h,n.child=u,Os(n,t.child,null,o),u=n.child,u.memoizedState=bm(o),u.childLanes=Im(t,L,o),n.memoizedState=Em,n=h);else if(oi(n),rf(M)){if(L=M.nextSibling&&M.nextSibling.dataset,L)var ue=L.dgst;L=ue,u=Error(i(419)),u.stack="",u.digest=L,Lo({value:u,source:null,stack:null}),n=wm(t,n,o)}else if(Sa||Ro(t,n,o,!1),L=(o&t.childLanes)!==0,Sa||L){if(L=qt,L!==null&&(u=o&-o,u=(u&42)!==0?1:Di(u),u=(u&(L.suspendedLanes|o))!==0?0:u,u!==0&&u!==Y.retryLane))throw Y.retryLane=u,Ts(t,u),En(L,t,u),$A;M.data==="$?"||Hm(),n=wm(t,n,o)}else M.data==="$?"?(n.flags|=192,n.child=t.child,n=null):(t=Y.treeContext,ia=Pn(M.nextSibling),Ja=n,Bt=!0,Vi=null,Xn=!1,t!==null&&(Tn[Sn++]=Ir,Tn[Sn++]=vr,Tn[Sn++]=Qi,Ir=t.id,vr=t.overflow,Qi=n),n=vm(n,u.children),n.flags|=4096);return n}return h?(li(),h=u.fallback,M=n.mode,Y=t.child,ue=Y.sibling,u=br(Y,{mode:"hidden",children:u.children}),u.subtreeFlags=Y.subtreeFlags&65011712,ue!==null?h=br(ue,h):(h=Hi(h,M,o,null),h.flags|=2),h.return=n,u.return=n,u.sibling=h,n.child=u,u=h,h=n.child,M=t.child.memoizedState,M===null?M=bm(o):(Y=M.cachePool,Y!==null?(ue=ba._currentValue,Y=Y.parent!==ue?{parent:ue,pool:ue}:Y):Y=qh(),M={baseLanes:M.baseLanes|o,cachePool:Y}),h.memoizedState=M,h.childLanes=Im(t,L,o),n.memoizedState=Em,u):(oi(n),o=t.child,t=o.sibling,o=br(o,{mode:"visible",children:u.children}),o.return=n,o.sibling=null,t!==null&&(L=n.deletions,L===null?(n.deletions=[t],n.flags|=16):L.push(t)),n.child=o,n.memoizedState=null,o)}function vm(t,n){return n=Cc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Cc(t,n){return t=gn(22,t,null,n),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function wm(t,n,o){return Os(n,t.child,null,o),t=vm(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function lp(t,n,o){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),Hd(t.return,n,o)}function Cm(t,n,o,u,h){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=u,y.tail=o,y.tailMode=h)}function cp(t,n,o){var u=n.pendingProps,h=u.revealOrder,y=u.tail;if(Ba(t,n,u.children,o),u=Ia.current,(u&2)!==0)u=u&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&lp(t,o,n);else if(t.tag===19)lp(t,o,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}u&=1}switch(ce(Ia,u),h){case"forwards":for(o=n.child,h=null;o!==null;)t=o.alternate,t!==null&&bc(t)===null&&(h=o),o=o.sibling;o=h,o===null?(h=n.child,n.child=null):(h=o.sibling,o.sibling=null),Cm(n,!1,h,o,y);break;case"backwards":for(o=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&bc(t)===null){n.child=h;break}t=h.sibling,h.sibling=o,o=h,h=t}Cm(n,!0,o,null,y);break;case"together":Cm(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Tr(t,n,o){if(t!==null&&(n.dependencies=t.dependencies),fi|=n.lanes,(o&n.childLanes)===0)if(t!==null){if(Ro(t,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,o=br(t,t.pendingProps),n.child=o,o.return=n;t.sibling!==null;)t=t.sibling,o=o.sibling=br(t,t.pendingProps),o.return=n;o.sibling=null}return n.child}function Nm(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&rc(t)))}function qI(t,n,o){switch(n.tag){case 3:Te(n,n.stateNode.containerInfo),ai(n,ba,t.memoizedState.cache),ko();break;case 27:case 5:Ne(n);break;case 4:Te(n,n.stateNode.containerInfo);break;case 10:ai(n,n.type,n.memoizedProps.value);break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(oi(n),n.flags|=128,null):(o&n.child.childLanes)!==0?op(t,n,o):(oi(n),t=Tr(t,n,o),t!==null?t.sibling:null);oi(n);break;case 19:var h=(t.flags&128)!==0;if(u=(o&n.childLanes)!==0,u||(Ro(t,n,o,!1),u=(o&n.childLanes)!==0),h){if(u)return cp(t,n,o);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ce(Ia,Ia.current),u)break;return null;case 22:case 23:return n.lanes=0,ap(t,n,o);case 24:ai(n,ba,t.memoizedState.cache)}return Tr(t,n,o)}function up(t,n,o){if(t!==null)if(t.memoizedProps!==n.pendingProps)Sa=!0;else{if(!Nm(t,o)&&(n.flags&128)===0)return Sa=!1,qI(t,n,o);Sa=(t.flags&131072)!==0}else Sa=!1,Bt&&(n.flags&1048576)!==0&&Ph(n,nc,n.index);switch(n.lanes=0,n.tag){case 16:e:{t=n.pendingProps;var u=n.elementType,h=u._init;if(u=h(u._payload),n.type=u,typeof u=="function")Ud(u)?(t=Ji(u,t),n.tag=1,n=ip(null,n,u,t,o)):(n.tag=0,n=ym(null,n,u,t,o));else{if(u!=null){if(h=u.$$typeof,h===j){n.tag=11,n=ZA(null,n,u,t,o);break e}else if(h===K){n.tag=14,n=ep(null,n,u,t,o);break e}}throw n=ne(u)||u,Error(i(306,n,""))}}return n;case 0:return ym(t,n,n.type,n.pendingProps,o);case 1:return u=n.type,h=Ji(u,n.pendingProps),ip(t,n,u,h,o);case 3:e:{if(Te(n,n.stateNode.containerInfo),t===null)throw Error(i(387));u=n.pendingProps;var y=n.memoizedState;h=y.element,Wd(t,n),Oo(n,u,null,o);var L=n.memoizedState;if(u=L.cache,ai(n,ba,u),u!==y.cache&&Qd(n,[ba],o,!0),Fo(),u=L.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:L.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=sp(t,n,u,o);break e}else if(u!==h){h=Nn(Error(i(424)),n),Lo(h),n=sp(t,n,u,o);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ia=Pn(t.firstChild),Ja=n,Bt=!0,Vi=null,Xn=!0,o=QA(n,null,u,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ko(),u===h){n=Tr(t,n,o);break e}Ba(t,n,u,o)}n=n.child}return n;case 26:return wc(t,n),t===null?(o=g0(n.type,null,n.pendingProps,null))?n.memoizedState=o:Bt||(o=n.type,t=n.pendingProps,u=Oc(ke.current).createElement(o),u[Kt]=n,u[Ea]=t,_a(u,o,t),st(u),n.stateNode=u):n.memoizedState=g0(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ne(n),t===null&&Bt&&(u=n.stateNode=d0(n.type,n.pendingProps,ke.current),Ja=n,Xn=!0,h=ia,pi(n.type)?(sf=h,ia=Pn(u.firstChild)):ia=h),Ba(t,n,n.pendingProps.children,o),wc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Bt&&((h=u=ia)&&(u=Iv(u,n.type,n.pendingProps,Xn),u!==null?(n.stateNode=u,Ja=n,ia=Pn(u.firstChild),Xn=!1,h=!0):h=!1),h||Ki(n)),Ne(n),h=n.type,y=n.pendingProps,L=t!==null?t.memoizedProps:null,u=y.children,tf(h,y)?u=null:L!==null&&tf(h,L)&&(n.flags|=32),n.memoizedState!==null&&(h=em(t,n,jI,null,null,o),sl._currentValue=h),wc(t,n),Ba(t,n,u,o),n.child;case 6:return t===null&&Bt&&((t=o=ia)&&(o=vv(o,n.pendingProps,Xn),o!==null?(n.stateNode=o,Ja=n,ia=null,t=!0):t=!1),t||Ki(n)),null;case 13:return op(t,n,o);case 4:return Te(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Os(n,null,u,o):Ba(t,n,u,o),n.child;case 11:return ZA(t,n,n.type,n.pendingProps,o);case 7:return Ba(t,n,n.pendingProps,o),n.child;case 8:return Ba(t,n,n.pendingProps.children,o),n.child;case 12:return Ba(t,n,n.pendingProps.children,o),n.child;case 10:return u=n.pendingProps,ai(n,n.type,u.value),Ba(t,n,u.children,o),n.child;case 9:return h=n.type._context,u=n.pendingProps.children,qi(n),h=za(h),u=u(h),n.flags|=1,Ba(t,n,u,o),n.child;case 14:return ep(t,n,n.type,n.pendingProps,o);case 15:return tp(t,n,n.type,n.pendingProps,o);case 19:return cp(t,n,o);case 31:return u=n.pendingProps,o=n.mode,u={mode:u.mode,children:u.children},t===null?(o=Cc(u,o),o.ref=n.ref,n.child=o,o.return=n,n=o):(o=br(t.child,u),o.ref=n.ref,n.child=o,o.return=n,n=o),n;case 22:return ap(t,n,o);case 24:return qi(n),u=za(ba),t===null?(h=Kd(),h===null&&(h=qt,y=zd(),h.pooledCache=y,y.refCount++,y!==null&&(h.pooledCacheLanes|=o),h=y),n.memoizedState={parent:u,cache:h},qd(n),ai(n,ba,h)):((t.lanes&o)!==0&&(Wd(t,n),Oo(n,null,null,o),Fo()),h=t.memoizedState,y=n.memoizedState,h.parent!==u?(h={parent:u,cache:u},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),ai(n,ba,u)):(u=y.cache,ai(n,ba,u),u!==h.cache&&Qd(n,[ba],o,!0))),Ba(t,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Sr(t){t.flags|=4}function dp(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!E0(n)){if(n=kn.current,n!==null&&((kt&4194048)===kt?$n!==null:(kt&62914560)!==kt&&(kt&536870912)===0||n!==$n))throw _o=Gd,Wh;t.flags|=8192}}function Nc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?ca():536870912,t.lanes|=n,Qs|=n)}function Ko(t,n){if(!Bt)switch(t.tailMode){case"hidden":n=t.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function ea(t){var n=t.alternate!==null&&t.alternate.child===t.child,o=0,u=0;if(n)for(var h=t.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=o,n}function WI(t,n,o){var u=n.pendingProps;switch(Od(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ea(n),null;case 1:return ea(n),null;case 3:return o=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),Cr(ba),Oe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(So(n)?Sr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,zh())),ea(n),null;case 26:return o=n.memoizedState,t===null?(Sr(n),o!==null?(ea(n),dp(n,o)):(ea(n),n.flags&=-16777217)):o?o!==t.memoizedState?(Sr(n),ea(n),dp(n,o)):(ea(n),n.flags&=-16777217):(t.memoizedProps!==u&&Sr(n),ea(n),n.flags&=-16777217),null;case 27:je(n),o=ke.current;var h=n.type;if(t!==null&&n.stateNode!=null)t.memoizedProps!==u&&Sr(n);else{if(!u){if(n.stateNode===null)throw Error(i(166));return ea(n),null}t=be.current,So(n)?Hh(n):(t=d0(h,u,o),n.stateNode=t,Sr(n))}return ea(n),null;case 5:if(je(n),o=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&Sr(n);else{if(!u){if(n.stateNode===null)throw Error(i(166));return ea(n),null}if(t=be.current,So(n))Hh(n);else{switch(h=Oc(ke.current),t){case 1:t=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:t=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":t=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":t=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof u.is=="string"?h.createElement("select",{is:u.is}):h.createElement("select"),u.multiple?t.multiple=!0:u.size&&(t.size=u.size);break;default:t=typeof u.is=="string"?h.createElement(o,{is:u.is}):h.createElement(o)}}t[Kt]=n,t[Ea]=u;e:for(h=n.child;h!==null;){if(h.tag===5||h.tag===6)t.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===n)break e;for(;h.sibling===null;){if(h.return===null||h.return===n)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}n.stateNode=t;e:switch(_a(t,o,u),o){case"button":case"input":case"select":case"textarea":t=!!u.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Sr(n)}}return ea(n),n.flags&=-16777217,null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&Sr(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(i(166));if(t=ke.current,So(n)){if(t=n.stateNode,o=n.memoizedProps,u=null,h=Ja,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[Kt]=n,t=!!(t.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||r0(t.nodeValue,o)),t||Ki(n)}else t=Oc(t).createTextNode(u),t[Kt]=n,n.stateNode=t}return ea(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=So(n),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(i(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Kt]=n}else ko(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ea(n),h=!1}else h=zh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(xr(n),n):(xr(n),null)}if(xr(n),(n.flags&128)!==0)return n.lanes=o,n;if(o=u!==null,t=t!==null&&t.memoizedState!==null,o){u=n.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool);var y=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==h&&(u.flags|=2048)}return o!==t&&o&&(n.child.flags|=8192),Nc(n,n.updateQueue),ea(n),null;case 4:return Oe(),t===null&&Jm(n.stateNode.containerInfo),ea(n),null;case 10:return Cr(n.type),ea(n),null;case 19:if(Z(Ia),h=n.memoizedState,h===null)return ea(n),null;if(u=(n.flags&128)!==0,y=h.rendering,y===null)if(u)Ko(h,!1);else{if(sa!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(y=bc(t),y!==null){for(n.flags|=128,Ko(h,!1),t=y.updateQueue,n.updateQueue=t,Nc(n,t),n.subtreeFlags=0,t=o,o=n.child;o!==null;)jh(o,t),o=o.sibling;return ce(Ia,Ia.current&1|2),n.child}t=t.sibling}h.tail!==null&&Re()>Sc&&(n.flags|=128,u=!0,Ko(h,!1),n.lanes=4194304)}else{if(!u)if(t=bc(y),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,Nc(n,t),Ko(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!Bt)return ea(n),null}else 2*Re()-h.renderingStartTime>Sc&&o!==536870912&&(n.flags|=128,u=!0,Ko(h,!1),n.lanes=4194304);h.isBackwards?(y.sibling=n.child,n.child=y):(t=h.last,t!==null?t.sibling=y:n.child=y,h.last=y)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=Re(),n.sibling=null,t=Ia.current,ce(Ia,u?t&1|2:t&1),n):(ea(n),null);case 22:case 23:return xr(n),$d(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(o&536870912)!==0&&(n.flags&128)===0&&(ea(n),n.subtreeFlags&6&&(n.flags|=8192)):ea(n),o=n.updateQueue,o!==null&&Nc(n,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==o&&(n.flags|=2048),t!==null&&Z(Wi),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Cr(ba),ea(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function YI(t,n){switch(Od(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Cr(ba),Oe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return je(n),null;case 13:if(xr(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ko()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Z(Ia),null;case 4:return Oe(),null;case 10:return Cr(n.type),null;case 22:case 23:return xr(n),$d(),t!==null&&Z(Wi),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Cr(ba),null;case 25:return null;default:return null}}function mp(t,n){switch(Od(n),n.tag){case 3:Cr(ba),Oe();break;case 26:case 27:case 5:je(n);break;case 4:Oe();break;case 13:xr(n);break;case 19:Z(Ia);break;case 10:Cr(n.type);break;case 22:case 23:xr(n),$d(),t!==null&&Z(Wi);break;case 24:Cr(ba)}}function Go(t,n){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&t)===t){u=void 0;var y=o.create,L=o.inst;u=y(),L.destroy=u}o=o.next}while(o!==h)}}catch(M){zt(n,n.return,M)}}function ci(t,n,o){try{var u=n.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&t)===t){var L=u.inst,M=L.destroy;if(M!==void 0){L.destroy=void 0,h=n;var Y=o,ue=M;try{ue()}catch(Ee){zt(h,Y,Ee)}}}u=u.next}while(u!==y)}}catch(Ee){zt(n,n.return,Ee)}}function fp(t){var n=t.updateQueue;if(n!==null){var o=t.stateNode;try{eA(n,o)}catch(u){zt(t,t.return,u)}}}function gp(t,n,o){o.props=Ji(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(u){zt(t,n,u)}}function qo(t,n){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof o=="function"?t.refCleanup=o(u):o.current=u}}catch(h){zt(t,n,h)}}function Zn(t,n){var o=t.ref,u=t.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){zt(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){zt(t,n,h)}else o.current=null}function hp(t){var n=t.type,o=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){zt(t,t.return,h)}}function xm(t,n,o){try{var u=t.stateNode;Av(u,t.type,o,n),u[Ea]=n}catch(h){zt(t,t.return,h)}}function Ap(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&pi(t.type)||t.tag===4}function Tm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ap(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&pi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Sm(t,n,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(t),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Fc));else if(u!==4&&(u===27&&pi(t.type)&&(o=t.stateNode,n=null),t=t.child,t!==null))for(Sm(t,n,o),t=t.sibling;t!==null;)Sm(t,n,o),t=t.sibling}function xc(t,n,o){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?o.insertBefore(t,n):o.appendChild(t);else if(u!==4&&(u===27&&pi(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(xc(t,n,o),t=t.sibling;t!==null;)xc(t,n,o),t=t.sibling}function pp(t){var n=t.stateNode,o=t.memoizedProps;try{for(var u=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);_a(n,u,o),n[Kt]=t,n[Ea]=o}catch(y){zt(t,t.return,y)}}var kr=!1,ma=!1,km=!1,yp=typeof WeakSet=="function"?WeakSet:Set,ka=null;function JI(t,n){if(t=t.containerInfo,Zm=Vc,t=kh(t),Td(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var L=0,M=-1,Y=-1,ue=0,Ee=0,we=t,me=null;t:for(;;){for(var ge;we!==o||h!==0&&we.nodeType!==3||(M=L+h),we!==y||u!==0&&we.nodeType!==3||(Y=L+u),we.nodeType===3&&(L+=we.nodeValue.length),(ge=we.firstChild)!==null;)me=we,we=ge;for(;;){if(we===t)break t;if(me===o&&++ue===h&&(M=L),me===y&&++Ee===u&&(Y=L),(ge=we.nextSibling)!==null)break;we=me,me=we.parentNode}we=ge}o=M===-1||Y===-1?null:{start:M,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(ef={focusedElem:t,selectionRange:o},Vc=!1,ka=n;ka!==null;)if(n=ka,t=n.child,(n.subtreeFlags&1024)!==0&&t!==null)t.return=n,ka=t;else for(;ka!==null;){switch(n=ka,y=n.alternate,t=n.flags,n.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,o=n,h=y.memoizedProps,y=y.memoizedState,u=o.stateNode;try{var ot=Ji(o.type,h,o.elementType===o.type);t=u.getSnapshotBeforeUpdate(ot,y),u.__reactInternalSnapshotBeforeUpdate=t}catch(et){zt(o,o.return,et)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,o=t.nodeType,o===9)nf(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,ka=t;break}ka=n.return}}function Ep(t,n,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:ui(t,o),u&4&&Go(5,o);break;case 1:if(ui(t,o),u&4)if(t=o.stateNode,n===null)try{t.componentDidMount()}catch(L){zt(o,o.return,L)}else{var h=Ji(o.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(L){zt(o,o.return,L)}}u&64&&fp(o),u&512&&qo(o,o.return);break;case 3:if(ui(t,o),u&64&&(t=o.updateQueue,t!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{eA(t,n)}catch(L){zt(o,o.return,L)}}break;case 27:n===null&&u&4&&pp(o);case 26:case 5:ui(t,o),n===null&&u&4&&hp(o),u&512&&qo(o,o.return);break;case 12:ui(t,o);break;case 13:ui(t,o),u&4&&vp(t,o),u&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=iv.bind(null,o),wv(t,o))));break;case 22:if(u=o.memoizedState!==null||kr,!u){n=n!==null&&n.memoizedState!==null||ma,h=kr;var y=ma;kr=u,(ma=n)&&!y?di(t,o,(o.subtreeFlags&8772)!==0):ui(t,o),kr=h,ma=y}break;case 30:break;default:ui(t,o)}}function bp(t){var n=t.alternate;n!==null&&(t.alternate=null,bp(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Be(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Jt=null,rn=!1;function Lr(t,n,o){for(o=o.child;o!==null;)Ip(t,n,o),o=o.sibling}function Ip(t,n,o){if(U&&typeof U.onCommitFiberUnmount=="function")try{U.onCommitFiberUnmount(ya,o)}catch{}switch(o.tag){case 26:ma||Zn(o,n),Lr(t,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ma||Zn(o,n);var u=Jt,h=rn;pi(o.type)&&(Jt=o.stateNode,rn=!1),Lr(t,n,o),al(o.stateNode),Jt=u,rn=h;break;case 5:ma||Zn(o,n);case 6:if(u=Jt,h=rn,Jt=null,Lr(t,n,o),Jt=u,rn=h,Jt!==null)if(rn)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(o.stateNode)}catch(y){zt(o,n,y)}else try{Jt.removeChild(o.stateNode)}catch(y){zt(o,n,y)}break;case 18:Jt!==null&&(rn?(t=Jt,c0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),ul(t)):c0(Jt,o.stateNode));break;case 4:u=Jt,h=rn,Jt=o.stateNode.containerInfo,rn=!0,Lr(t,n,o),Jt=u,rn=h;break;case 0:case 11:case 14:case 15:ma||ci(2,o,n),ma||ci(4,o,n),Lr(t,n,o);break;case 1:ma||(Zn(o,n),u=o.stateNode,typeof u.componentWillUnmount=="function"&&gp(o,n,u)),Lr(t,n,o);break;case 21:Lr(t,n,o);break;case 22:ma=(u=ma)||o.memoizedState!==null,Lr(t,n,o),ma=u;break;default:Lr(t,n,o)}}function vp(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ul(t)}catch(o){zt(n,n.return,o)}}function XI(t){switch(t.tag){case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new yp),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new yp),n;default:throw Error(i(435,t.tag))}}function Lm(t,n){var o=XI(t);n.forEach(function(u){var h=sv.bind(null,t,u);o.has(u)||(o.add(u),u.then(h,h))})}function hn(t,n){var o=n.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],y=t,L=n,M=L;e:for(;M!==null;){switch(M.tag){case 27:if(pi(M.type)){Jt=M.stateNode,rn=!1;break e}break;case 5:Jt=M.stateNode,rn=!1;break e;case 3:case 4:Jt=M.stateNode.containerInfo,rn=!0;break e}M=M.return}if(Jt===null)throw Error(i(160));Ip(y,L,h),Jt=null,rn=!1,y=h.alternate,y!==null&&(y.return=null),h.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)wp(n,t),n=n.sibling}var jn=null;function wp(t,n){var o=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:hn(n,t),An(t),u&4&&(ci(3,t,t.return),Go(3,t),ci(5,t,t.return));break;case 1:hn(n,t),An(t),u&512&&(ma||o===null||Zn(o,o.return)),u&64&&kr&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=jn;if(hn(n,t),An(t),u&512&&(ma||o===null||Zn(o,o.return)),u&4){var y=o!==null?o.memoizedState:null;if(u=t.memoizedState,o===null)if(u===null)if(t.stateNode===null){e:{u=t.type,o=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":y=h.getElementsByTagName("title")[0],(!y||y[Ue]||y[Kt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=h.createElement(u),h.head.insertBefore(y,h.querySelector("head > title"))),_a(y,u,o),y[Kt]=t,st(y),u=y;break e;case"link":var L=p0("link","href",h).get(u+(o.href||""));if(L){for(var M=0;M<L.length;M++)if(y=L[M],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){L.splice(M,1);break t}}y=h.createElement(u),_a(y,u,o),h.head.appendChild(y);break;case"meta":if(L=p0("meta","content",h).get(u+(o.content||""))){for(M=0;M<L.length;M++)if(y=L[M],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){L.splice(M,1);break t}}y=h.createElement(u),_a(y,u,o),h.head.appendChild(y);break;default:throw Error(i(468,u))}y[Kt]=t,st(y),u=y}t.stateNode=u}else y0(h,t.type,t.stateNode);else t.stateNode=A0(h,u,t.memoizedProps);else y!==u?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,u===null?y0(h,t.type,t.stateNode):A0(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&xm(t,t.memoizedProps,o.memoizedProps)}break;case 27:hn(n,t),An(t),u&512&&(ma||o===null||Zn(o,o.return)),o!==null&&u&4&&xm(t,t.memoizedProps,o.memoizedProps);break;case 5:if(hn(n,t),An(t),u&512&&(ma||o===null||Zn(o,o.return)),t.flags&32){h=t.stateNode;try{Jn(h,"")}catch(ge){zt(t,t.return,ge)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,xm(t,h,o!==null?o.memoizedProps:h)),u&1024&&(km=!0);break;case 6:if(hn(n,t),An(t),u&4){if(t.stateNode===null)throw Error(i(162));u=t.memoizedProps,o=t.stateNode;try{o.nodeValue=u}catch(ge){zt(t,t.return,ge)}}break;case 3:if(Hc=null,h=jn,jn=jc(n.containerInfo),hn(n,t),jn=h,An(t),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ul(n.containerInfo)}catch(ge){zt(t,t.return,ge)}km&&(km=!1,Cp(t));break;case 4:u=jn,jn=jc(t.stateNode.containerInfo),hn(n,t),An(t),jn=u;break;case 12:hn(n,t),An(t);break;case 13:hn(n,t),An(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Mm=Re()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Lm(t,u)));break;case 22:h=t.memoizedState!==null;var Y=o!==null&&o.memoizedState!==null,ue=kr,Ee=ma;if(kr=ue||h,ma=Ee||Y,hn(n,t),ma=Ee,kr=ue,An(t),u&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(o===null||Y||kr||ma||Xi(t)),o=null,n=t;;){if(n.tag===5||n.tag===26){if(o===null){Y=o=n;try{if(y=Y.stateNode,h)L=y.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{M=Y.stateNode;var we=Y.memoizedProps.style,me=we!=null&&we.hasOwnProperty("display")?we.display:null;M.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch(ge){zt(Y,Y.return,ge)}}}else if(n.tag===6){if(o===null){Y=n;try{Y.stateNode.nodeValue=h?"":Y.memoizedProps}catch(ge){zt(Y,Y.return,ge)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=t.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Lm(t,o))));break;case 19:hn(n,t),An(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,Lm(t,u)));break;case 30:break;case 21:break;default:hn(n,t),An(t)}}function An(t){var n=t.flags;if(n&2){try{for(var o,u=t.return;u!==null;){if(Ap(u)){o=u;break}u=u.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var h=o.stateNode,y=Tm(t);xc(t,y,h);break;case 5:var L=o.stateNode;o.flags&32&&(Jn(L,""),o.flags&=-33);var M=Tm(t);xc(t,M,L);break;case 3:case 4:var Y=o.stateNode.containerInfo,ue=Tm(t);Sm(t,ue,Y);break;default:throw Error(i(161))}}catch(Ee){zt(t,t.return,Ee)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Cp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Cp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function ui(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Ep(t,n.alternate,n),n=n.sibling}function Xi(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ci(4,n,n.return),Xi(n);break;case 1:Zn(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&gp(n,n.return,o),Xi(n);break;case 27:al(n.stateNode);case 26:case 5:Zn(n,n.return),Xi(n);break;case 22:n.memoizedState===null&&Xi(n);break;case 30:Xi(n);break;default:Xi(n)}t=t.sibling}}function di(t,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,h=t,y=n,L=y.flags;switch(y.tag){case 0:case 11:case 15:di(h,y,o),Go(4,y);break;case 1:if(di(h,y,o),u=y,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ue){zt(u,u.return,ue)}if(u=y,h=u.updateQueue,h!==null){var M=u.stateNode;try{var Y=h.shared.hiddenCallbacks;if(Y!==null)for(h.shared.hiddenCallbacks=null,h=0;h<Y.length;h++)Zh(Y[h],M)}catch(ue){zt(u,u.return,ue)}}o&&L&64&&fp(y),qo(y,y.return);break;case 27:pp(y);case 26:case 5:di(h,y,o),o&&u===null&&L&4&&hp(y),qo(y,y.return);break;case 12:di(h,y,o);break;case 13:di(h,y,o),o&&L&4&&vp(h,y);break;case 22:y.memoizedState===null&&di(h,y,o),qo(y,y.return);break;case 30:break;default:di(h,y,o)}n=n.sibling}}function Rm(t,n){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Do(o))}function Dm(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Do(t))}function er(t,n,o,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Np(t,n,o,u),n=n.sibling}function Np(t,n,o,u){var h=n.flags;switch(n.tag){case 0:case 11:case 15:er(t,n,o,u),h&2048&&Go(9,n);break;case 1:er(t,n,o,u);break;case 3:er(t,n,o,u),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Do(t)));break;case 12:if(h&2048){er(t,n,o,u),t=n.stateNode;try{var y=n.memoizedProps,L=y.id,M=y.onPostCommit;typeof M=="function"&&M(L,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Y){zt(n,n.return,Y)}}else er(t,n,o,u);break;case 13:er(t,n,o,u);break;case 23:break;case 22:y=n.stateNode,L=n.alternate,n.memoizedState!==null?y._visibility&2?er(t,n,o,u):Wo(t,n):y._visibility&2?er(t,n,o,u):(y._visibility|=2,js(t,n,o,u,(n.subtreeFlags&10256)!==0)),h&2048&&Rm(L,n);break;case 24:er(t,n,o,u),h&2048&&Dm(n.alternate,n);break;default:er(t,n,o,u)}}function js(t,n,o,u,h){for(h=h&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;){var y=t,L=n,M=o,Y=u,ue=L.flags;switch(L.tag){case 0:case 11:case 15:js(y,L,M,Y,h),Go(8,L);break;case 23:break;case 22:var Ee=L.stateNode;L.memoizedState!==null?Ee._visibility&2?js(y,L,M,Y,h):Wo(y,L):(Ee._visibility|=2,js(y,L,M,Y,h)),h&&ue&2048&&Rm(L.alternate,L);break;case 24:js(y,L,M,Y,h),h&&ue&2048&&Dm(L.alternate,L);break;default:js(y,L,M,Y,h)}n=n.sibling}}function Wo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=t,u=n,h=u.flags;switch(u.tag){case 22:Wo(o,u),h&2048&&Rm(u.alternate,u);break;case 24:Wo(o,u),h&2048&&Dm(u.alternate,u);break;default:Wo(o,u)}n=n.sibling}}var Yo=8192;function Ps(t){if(t.subtreeFlags&Yo)for(t=t.child;t!==null;)xp(t),t=t.sibling}function xp(t){switch(t.tag){case 26:Ps(t),t.flags&Yo&&t.memoizedState!==null&&Mv(jn,t.memoizedState,t.memoizedProps);break;case 5:Ps(t);break;case 3:case 4:var n=jn;jn=jc(t.stateNode.containerInfo),Ps(t),jn=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=Yo,Yo=16777216,Ps(t),Yo=n):Ps(t));break;default:Ps(t)}}function Tp(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Jo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];ka=u,kp(u,t)}Tp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sp(t),t=t.sibling}function Sp(t){switch(t.tag){case 0:case 11:case 15:Jo(t),t.flags&2048&&ci(9,t,t.return);break;case 3:Jo(t);break;case 12:Jo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Tc(t)):Jo(t);break;default:Jo(t)}}function Tc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var u=n[o];ka=u,kp(u,t)}Tp(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ci(8,n,n.return),Tc(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,Tc(n));break;default:Tc(n)}t=t.sibling}}function kp(t,n){for(;ka!==null;){var o=ka;switch(o.tag){case 0:case 11:case 15:ci(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Do(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,ka=u;else e:for(o=t;ka!==null;){u=ka;var h=u.sibling,y=u.return;if(bp(u),u===o){ka=null;break e}if(h!==null){h.return=y,ka=h;break e}ka=y}}}var $I={getCacheForType:function(t){var n=za(ba),o=n.data.get(t);return o===void 0&&(o=t(),n.data.set(t,o)),o}},ZI=typeof WeakMap=="function"?WeakMap:Map,_t=0,qt=null,wt=null,kt=0,Mt=0,pn=null,mi=!1,Hs=!1,Bm=!1,Rr=0,sa=0,fi=0,$i=0,Um=0,Ln=0,Qs=0,Xo=null,sn=null,_m=!1,Mm=0,Sc=1/0,kc=null,gi=null,Ua=0,hi=null,zs=null,Vs=0,Fm=0,Om=null,Lp=null,$o=0,jm=null;function yn(){if((_t&2)!==0&&kt!==0)return kt&-kt;if(X.T!==null){var t=Rs;return t!==0?t:Gm()}return dr()}function Rp(){Ln===0&&(Ln=(kt&536870912)===0||Bt?Vr():536870912);var t=kn.current;return t!==null&&(t.flags|=32),Ln}function En(t,n,o){(t===qt&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)&&(Ks(t,0),Ai(t,kt,Ln,!1)),Gn(t,o),((_t&2)===0||t!==qt)&&(t===qt&&((_t&2)===0&&($i|=o),sa===4&&Ai(t,kt,Ln,!1)),tr(t))}function Dp(t,n,o){if((_t&6)!==0)throw Error(i(327));var u=!o&&(n&124)===0&&(n&t.expiredLanes)===0||St(t,n),h=u?av(t,n):Qm(t,n,!0),y=u;do{if(h===0){Hs&&!u&&Ai(t,n,0,!1);break}else{if(o=t.current.alternate,y&&!ev(o)){h=Qm(t,n,!1),y=!1;continue}if(h===2){if(y=n,t.errorRecoveryDisabledLanes&y)var L=0;else L=t.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){n=L;e:{var M=t;h=Xo;var Y=M.current.memoizedState.isDehydrated;if(Y&&(Ks(M,L).flags|=256),L=Qm(M,L,!1),L!==2){if(Bm&&!Y){M.errorRecoveryDisabledLanes|=y,$i|=y,h=4;break e}y=sn,sn=h,y!==null&&(sn===null?sn=y:sn.push.apply(sn,y))}h=L}if(y=!1,h!==2)continue}}if(h===1){Ks(t,0),Ai(t,n,0,!0);break}e:{switch(u=t,y=h,y){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Ai(u,n,Ln,!mi);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(h=Mm+300-Re(),10<h)){if(Ai(u,n,Ln,!mi),xt(u,0,!0)!==0)break e;u.timeoutHandle=o0(Bp.bind(null,u,o,sn,kc,_m,n,Ln,$i,Qs,mi,y,2,-0,0),h);break e}Bp(u,o,sn,kc,_m,n,Ln,$i,Qs,mi,y,0,-0,0)}}break}while(!0);tr(t)}function Bp(t,n,o,u,h,y,L,M,Y,ue,Ee,we,me,ge){if(t.timeoutHandle=-1,we=n.subtreeFlags,(we&8192||(we&16785408)===16785408)&&(il={stylesheets:null,count:0,unsuspend:_v},xp(n),we=Fv(),we!==null)){t.cancelPendingCommit=we(Pp.bind(null,t,n,y,o,u,h,L,M,Y,Ee,1,me,ge)),Ai(t,y,L,!ue);return}Pp(t,n,y,o,u,h,L,M,Y)}function ev(t){for(var n=t;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],y=h.getSnapshot;h=h.value;try{if(!fn(y(),h))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ai(t,n,o,u){n&=~Um,n&=~$i,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var h=n;0<h;){var y=31-N(h),L=1<<y;u[y]=-1,h&=~L}o!==0&&_e(t,o,n)}function Lc(){return(_t&6)===0?(Zo(0),!1):!0}function Pm(){if(wt!==null){if(Mt===0)var t=wt.return;else t=wt,wr=Gi=null,nm(t),Fs=null,zo=0,t=wt;for(;t!==null;)mp(t.alternate,t),t=t.return;wt=null}}function Ks(t,n){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,yv(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Pm(),qt=t,wt=o=br(t.current,null),kt=n,Mt=0,pn=null,mi=!1,Hs=St(t,n),Bm=!1,Qs=Ln=Um=$i=fi=sa=0,sn=Xo=null,_m=!1,(n&8)!==0&&(n|=n&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=n;0<u;){var h=31-N(u),y=1<<h;n|=t[h],u&=~y}return Rr=n,$l(),o}function Up(t,n){It=null,X.H=pc,n===Uo||n===oc?(n=Xh(),Mt=3):n===Wh?(n=Xh(),Mt=4):Mt=n===$A?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,pn=n,wt===null&&(sa=1,vc(t,Nn(n,t.current)))}function _p(){var t=X.H;return X.H=pc,t===null?pc:t}function Mp(){var t=X.A;return X.A=$I,t}function Hm(){sa=4,mi||(kt&4194048)!==kt&&kn.current!==null||(Hs=!0),(fi&134217727)===0&&($i&134217727)===0||qt===null||Ai(qt,kt,Ln,!1)}function Qm(t,n,o){var u=_t;_t|=2;var h=_p(),y=Mp();(qt!==t||kt!==n)&&(kc=null,Ks(t,n)),n=!1;var L=sa;e:do try{if(Mt!==0&&wt!==null){var M=wt,Y=pn;switch(Mt){case 8:Pm(),L=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(n=!0);var ue=Mt;if(Mt=0,pn=null,Gs(t,M,Y,ue),o&&Hs){L=0;break e}break;default:ue=Mt,Mt=0,pn=null,Gs(t,M,Y,ue)}}tv(),L=sa;break}catch(Ee){Up(t,Ee)}while(!0);return n&&t.shellSuspendCounter++,wr=Gi=null,_t=u,X.H=h,X.A=y,wt===null&&(qt=null,kt=0,$l()),L}function tv(){for(;wt!==null;)Fp(wt)}function av(t,n){var o=_t;_t|=2;var u=_p(),h=Mp();qt!==t||kt!==n?(kc=null,Sc=Re()+500,Ks(t,n)):Hs=St(t,n);e:do try{if(Mt!==0&&wt!==null){n=wt;var y=pn;t:switch(Mt){case 1:Mt=0,pn=null,Gs(t,n,y,1);break;case 2:case 9:if(Yh(y)){Mt=0,pn=null,Op(n);break}n=function(){Mt!==2&&Mt!==9||qt!==t||(Mt=7),tr(t)},y.then(n,n);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:Yh(y)?(Mt=0,pn=null,Op(n)):(Mt=0,pn=null,Gs(t,n,y,7));break;case 5:var L=null;switch(wt.tag){case 26:L=wt.memoizedState;case 5:case 27:var M=wt;if(!L||E0(L)){Mt=0,pn=null;var Y=M.sibling;if(Y!==null)wt=Y;else{var ue=M.return;ue!==null?(wt=ue,Rc(ue)):wt=null}break t}}Mt=0,pn=null,Gs(t,n,y,5);break;case 6:Mt=0,pn=null,Gs(t,n,y,6);break;case 8:Pm(),sa=6;break e;default:throw Error(i(462))}}nv();break}catch(Ee){Up(t,Ee)}while(!0);return wr=Gi=null,X.H=u,X.A=h,_t=o,wt!==null?0:(qt=null,kt=0,$l(),sa)}function nv(){for(;wt!==null&&!la();)Fp(wt)}function Fp(t){var n=up(t.alternate,t,Rr);t.memoizedProps=t.pendingProps,n===null?Rc(t):wt=n}function Op(t){var n=t,o=n.alternate;switch(n.tag){case 15:case 0:n=rp(o,n,n.pendingProps,n.type,void 0,kt);break;case 11:n=rp(o,n,n.pendingProps,n.type.render,n.ref,kt);break;case 5:nm(n);default:mp(o,n),n=wt=jh(n,Rr),n=up(o,n,Rr)}t.memoizedProps=t.pendingProps,n===null?Rc(t):wt=n}function Gs(t,n,o,u){wr=Gi=null,nm(n),Fs=null,zo=0;var h=n.return;try{if(GI(t,h,n,o,kt)){sa=1,vc(t,Nn(o,t.current)),wt=null;return}}catch(y){if(h!==null)throw wt=h,y;sa=1,vc(t,Nn(o,t.current)),wt=null;return}n.flags&32768?(Bt||u===1?t=!0:Hs||(kt&536870912)!==0?t=!1:(mi=t=!0,(u===2||u===9||u===3||u===6)&&(u=kn.current,u!==null&&u.tag===13&&(u.flags|=16384))),jp(n,t)):Rc(n)}function Rc(t){var n=t;do{if((n.flags&32768)!==0){jp(n,mi);return}t=n.return;var o=WI(n.alternate,n,Rr);if(o!==null){wt=o;return}if(n=n.sibling,n!==null){wt=n;return}wt=n=t}while(n!==null);sa===0&&(sa=5)}function jp(t,n){do{var o=YI(t.alternate,t);if(o!==null){o.flags&=32767,wt=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(t=t.sibling,t!==null)){wt=t;return}wt=t=o}while(t!==null);sa=6,wt=null}function Pp(t,n,o,u,h,y,L,M,Y){t.cancelPendingCommit=null;do Dc();while(Ua!==0);if((_t&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(y=n.lanes|n.childLanes,y|=Dd,gs(t,o,y,L,M,Y),t===qt&&(wt=qt=null,kt=0),zs=n,hi=t,Vs=o,Fm=y,Om=h,Lp=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ov(Je,function(){return Kp(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=X.T,X.T=null,h=ae.p,ae.p=2,L=_t,_t|=4;try{JI(t,n,o)}finally{_t=L,ae.p=h,X.T=u}}Ua=1,Hp(),Qp(),zp()}}function Hp(){if(Ua===1){Ua=0;var t=hi,n=zs,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=X.T,X.T=null;var u=ae.p;ae.p=2;var h=_t;_t|=4;try{wp(n,t);var y=ef,L=kh(t.containerInfo),M=y.focusedElem,Y=y.selectionRange;if(L!==M&&M&&M.ownerDocument&&Sh(M.ownerDocument.documentElement,M)){if(Y!==null&&Td(M)){var ue=Y.start,Ee=Y.end;if(Ee===void 0&&(Ee=ue),"selectionStart"in M)M.selectionStart=ue,M.selectionEnd=Math.min(Ee,M.value.length);else{var we=M.ownerDocument||document,me=we&&we.defaultView||window;if(me.getSelection){var ge=me.getSelection(),ot=M.textContent.length,et=Math.min(Y.start,ot),Qt=Y.end===void 0?et:Math.min(Y.end,ot);!ge.extend&&et>Qt&&(L=Qt,Qt=et,et=L);var re=Th(M,et),ee=Th(M,Qt);if(re&&ee&&(ge.rangeCount!==1||ge.anchorNode!==re.node||ge.anchorOffset!==re.offset||ge.focusNode!==ee.node||ge.focusOffset!==ee.offset)){var le=we.createRange();le.setStart(re.node,re.offset),ge.removeAllRanges(),et>Qt?(ge.addRange(le),ge.extend(ee.node,ee.offset)):(le.setEnd(ee.node,ee.offset),ge.addRange(le))}}}}for(we=[],ge=M;ge=ge.parentNode;)ge.nodeType===1&&we.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<we.length;M++){var Ie=we[M];Ie.element.scrollLeft=Ie.left,Ie.element.scrollTop=Ie.top}}Vc=!!Zm,ef=Zm=null}finally{_t=h,ae.p=u,X.T=o}}t.current=n,Ua=2}}function Qp(){if(Ua===2){Ua=0;var t=hi,n=zs,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=X.T,X.T=null;var u=ae.p;ae.p=2;var h=_t;_t|=4;try{Ep(t,n.alternate,n)}finally{_t=h,ae.p=u,X.T=o}}Ua=3}}function zp(){if(Ua===4||Ua===3){Ua=0,ve();var t=hi,n=zs,o=Vs,u=Lp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ua=5:(Ua=0,zs=hi=null,Vp(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(gi=null),xa(o),n=n.stateNode,U&&typeof U.onCommitFiberRoot=="function")try{U.onCommitFiberRoot(ya,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=X.T,h=ae.p,ae.p=2,X.T=null;try{for(var y=t.onRecoverableError,L=0;L<u.length;L++){var M=u[L];y(M.value,{componentStack:M.stack})}}finally{X.T=n,ae.p=h}}(Vs&3)!==0&&Dc(),tr(t),h=t.pendingLanes,(o&4194090)!==0&&(h&42)!==0?t===jm?$o++:($o=0,jm=t):$o=0,Zo(0)}}function Vp(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Do(n)))}function Dc(t){return Hp(),Qp(),zp(),Kp()}function Kp(){if(Ua!==5)return!1;var t=hi,n=Fm;Fm=0;var o=xa(Vs),u=X.T,h=ae.p;try{ae.p=32>o?32:o,X.T=null,o=Om,Om=null;var y=hi,L=Vs;if(Ua=0,zs=hi=null,Vs=0,(_t&6)!==0)throw Error(i(331));var M=_t;if(_t|=4,Sp(y.current),Np(y,y.current,L,o),_t=M,Zo(0,!1),U&&typeof U.onPostCommitFiberRoot=="function")try{U.onPostCommitFiberRoot(ya,y)}catch{}return!0}finally{ae.p=h,X.T=u,Vp(t,n)}}function Gp(t,n,o){n=Nn(o,n),n=pm(t.stateNode,n,2),t=ii(t,n,2),t!==null&&(Gn(t,2),tr(t))}function zt(t,n,o){if(t.tag===3)Gp(t,t,o);else for(;n!==null;){if(n.tag===3){Gp(n,t,o);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(gi===null||!gi.has(u))){t=Nn(o,t),o=JA(2),u=ii(n,o,2),u!==null&&(XA(o,u,n,t),Gn(u,2),tr(u));break}}n=n.return}}function zm(t,n,o){var u=t.pingCache;if(u===null){u=t.pingCache=new ZI;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(o)||(Bm=!0,h.add(o),t=rv.bind(null,t,n,o),n.then(t,t))}function rv(t,n,o){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,qt===t&&(kt&o)===o&&(sa===4||sa===3&&(kt&62914560)===kt&&300>Re()-Mm?(_t&2)===0&&Ks(t,0):Um|=o,Qs===kt&&(Qs=0)),tr(t)}function qp(t,n){n===0&&(n=ca()),t=Ts(t,n),t!==null&&(Gn(t,n),tr(t))}function iv(t){var n=t.memoizedState,o=0;n!==null&&(o=n.retryLane),qp(t,o)}function sv(t,n){var o=0;switch(t.tag){case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(n),qp(t,o)}function ov(t,n){return Ye(t,n)}var Bc=null,qs=null,Vm=!1,Uc=!1,Km=!1,Zi=0;function tr(t){t!==qs&&t.next===null&&(qs===null?Bc=qs=t:qs=qs.next=t),Uc=!0,Vm||(Vm=!0,cv())}function Zo(t,n){if(!Km&&Uc){Km=!0;do for(var o=!1,u=Bc;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var y=0;else{var L=u.suspendedLanes,M=u.pingedLanes;y=(1<<31-N(42|t)+1)-1,y&=h&~(L&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,Xp(u,y))}else y=kt,y=xt(u,u===qt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||St(u,y)||(o=!0,Xp(u,y));u=u.next}while(o);Km=!1}}function lv(){Wp()}function Wp(){Uc=Vm=!1;var t=0;Zi!==0&&(pv()&&(t=Zi),Zi=0);for(var n=Re(),o=null,u=Bc;u!==null;){var h=u.next,y=Yp(u,n);y===0?(u.next=null,o===null?Bc=h:o.next=h,h===null&&(qs=o)):(o=u,(t!==0||(y&3)!==0)&&(Uc=!0)),u=h}Zo(t)}function Yp(t,n){for(var o=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var L=31-N(y),M=1<<L,Y=h[L];Y===-1?((M&o)===0||(M&u)!==0)&&(h[L]=mt(M,n)):Y<=n&&(t.expiredLanes|=M),y&=~M}if(n=qt,o=kt,o=xt(t,t===n?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,o===0||t===n&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&rt(u),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||St(t,o)){if(n=o&-o,n===t.callbackPriority)return n;switch(u!==null&&rt(u),xa(o)){case 2:case 8:o=dt;break;case 32:o=Je;break;case 268435456:o=Ot;break;default:o=Je}return u=Jp.bind(null,t),o=Ye(o,u),t.callbackPriority=n,t.callbackNode=o,n}return u!==null&&u!==null&&rt(u),t.callbackPriority=2,t.callbackNode=null,2}function Jp(t,n){if(Ua!==0&&Ua!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Dc()&&t.callbackNode!==o)return null;var u=kt;return u=xt(t,t===qt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(Dp(t,u,n),Yp(t,Re()),t.callbackNode!=null&&t.callbackNode===o?Jp.bind(null,t):null)}function Xp(t,n){if(Dc())return null;Dp(t,n,!0)}function cv(){Ev(function(){(_t&6)!==0?Ye(qe,lv):Wp()})}function Gm(){return Zi===0&&(Zi=Vr()),Zi}function $p(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:en(""+t)}function Zp(t,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,t.id&&o.setAttribute("form",t.id),n.parentNode.insertBefore(o,n),t=new FormData(t),o.parentNode.removeChild(o),t}function uv(t,n,o,u,h){if(n==="submit"&&o&&o.stateNode===h){var y=$p((h[Ea]||null).action),L=u.submitter;L&&(n=(n=L[Ea]||null)?$p(n.formAction):L.getAttribute("formAction"),n!==null&&(y=n,L=null));var M=new gt("action","action",null,u,h);t.push({event:M,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Zi!==0){var Y=L?Zp(h,L):new FormData(h);mm(o,{pending:!0,data:Y,method:h.method,action:y},null,Y)}}else typeof y=="function"&&(M.preventDefault(),Y=L?Zp(h,L):new FormData(h),mm(o,{pending:!0,data:Y,method:h.method,action:y},y,Y))},currentTarget:h}]})}}for(var qm=0;qm<Rd.length;qm++){var Wm=Rd[qm],dv=Wm.toLowerCase(),mv=Wm[0].toUpperCase()+Wm.slice(1);On(dv,"on"+mv)}On(Dh,"onAnimationEnd"),On(Bh,"onAnimationIteration"),On(Uh,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(kI,"onTransitionRun"),On(LI,"onTransitionStart"),On(RI,"onTransitionCancel"),On(_h,"onTransitionEnd"),ra("onMouseEnter",["mouseout","mouseover"]),ra("onMouseLeave",["mouseout","mouseover"]),ra("onPointerEnter",["pointerout","pointerover"]),ra("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="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(" "),fv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function e0(t,n){n=(n&4)!==0;for(var o=0;o<t.length;o++){var u=t[o],h=u.event;u=u.listeners;e:{var y=void 0;if(n)for(var L=u.length-1;0<=L;L--){var M=u[L],Y=M.instance,ue=M.currentTarget;if(M=M.listener,Y!==y&&h.isPropagationStopped())break e;y=M,h.currentTarget=ue;try{y(h)}catch(Ee){Ic(Ee)}h.currentTarget=null,y=Y}else for(L=0;L<u.length;L++){if(M=u[L],Y=M.instance,ue=M.currentTarget,M=M.listener,Y!==y&&h.isPropagationStopped())break e;y=M,h.currentTarget=ue;try{y(h)}catch(Ee){Ic(Ee)}h.currentTarget=null,y=Y}}}}function Ct(t,n){var o=n[Gr];o===void 0&&(o=n[Gr]=new Set);var u=t+"__bubble";o.has(u)||(t0(n,t,2,!1),o.add(u))}function Ym(t,n,o){var u=0;n&&(u|=4),t0(o,t,u,n)}var _c="_reactListening"+Math.random().toString(36).slice(2);function Jm(t){if(!t[_c]){t[_c]=!0,un.forEach(function(o){o!=="selectionchange"&&(fv.has(o)||Ym(o,!1,t),Ym(o,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[_c]||(n[_c]=!0,Ym("selectionchange",!1,n))}}function t0(t,n,o,u){switch(N0(n)){case 2:var h=Pv;break;case 8:h=Hv;break;default:h=df}o=h.bind(null,n,o,t),h=void 0,!wn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(n,o,{capture:!0,passive:h}):t.addEventListener(n,o,!0):h!==void 0?t.addEventListener(n,o,{passive:h}):t.addEventListener(n,o,!1)}function Xm(t,n,o,u,h){var y=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var L=u.tag;if(L===3||L===4){var M=u.stateNode.containerInfo;if(M===h)break;if(L===4)for(L=u.return;L!==null;){var Y=L.tag;if((Y===3||Y===4)&&L.stateNode.containerInfo===h)return;L=L.return}for(;M!==null;){if(L=Ze(M),L===null)return;if(Y=L.tag,Y===5||Y===6||Y===26||Y===27){u=y=L;continue e}M=M.parentNode}}u=u.return}Io(function(){var ue=y,Ee=yr(o),we=[];e:{var me=Mh.get(t);if(me!==void 0){var ge=gt,ot=t;switch(t){case"keypress":if(F(o)===0)break e;case"keydown":case"keyup":ge=hd;break;case"focusin":ot="focus",ge=vo;break;case"focusout":ot="blur",ge=vo;break;case"beforeblur":case"afterblur":ge=vo;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Kl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=nd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=pd;break;case Dh:case Bh:case Uh:ge=sd;break;case _h:ge=Ed;break;case"scroll":case"scrollend":ge=Yt;break;case"wheel":ge=Yl;break;case"copy":case"cut":case"paste":ge=ld;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Wl;break;case"toggle":case"beforetoggle":ge=vd}var et=(n&4)!==0,Qt=!et&&(t==="scroll"||t==="scrollend"),re=et?me!==null?me+"Capture":null:me;et=[];for(var ee=ue,le;ee!==null;){var Ie=ee;if(le=Ie.stateNode,Ie=Ie.tag,Ie!==5&&Ie!==26&&Ie!==27||le===null||re===null||(Ie=Zr(ee,re),Ie!=null&&et.push(tl(ee,Ie,le))),Qt)break;ee=ee.return}0<et.length&&(me=new ge(me,ot,null,o,Ee),we.push({event:me,listeners:et}))}}if((n&7)===0){e:{if(me=t==="mouseover"||t==="pointerover",ge=t==="mouseout"||t==="pointerout",me&&o!==vn&&(ot=o.relatedTarget||o.fromElement)&&(Ze(ot)||ot[Gt]))break e;if((ge||me)&&(me=Ee.window===Ee?Ee:(me=Ee.ownerDocument)?me.defaultView||me.parentWindow:window,ge?(ot=o.relatedTarget||o.toElement,ge=ue,ot=ot?Ze(ot):null,ot!==null&&(Qt=c(ot),et=ot.tag,ot!==Qt||et!==5&&et!==27&&et!==6)&&(ot=null)):(ge=null,ot=ue),ge!==ot)){if(et=Kl,Ie="onMouseLeave",re="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(et=Wl,Ie="onPointerLeave",re="onPointerEnter",ee="pointer"),Qt=ge==null?me:yt(ge),le=ot==null?me:yt(ot),me=new et(Ie,ee+"leave",ge,o,Ee),me.target=Qt,me.relatedTarget=le,Ie=null,Ze(Ee)===ue&&(et=new et(re,ee+"enter",ot,o,Ee),et.target=le,et.relatedTarget=Qt,Ie=et),Qt=Ie,ge&&ot)t:{for(et=ge,re=ot,ee=0,le=et;le;le=Ws(le))ee++;for(le=0,Ie=re;Ie;Ie=Ws(Ie))le++;for(;0<ee-le;)et=Ws(et),ee--;for(;0<le-ee;)re=Ws(re),le--;for(;ee--;){if(et===re||re!==null&&et===re.alternate)break t;et=Ws(et),re=Ws(re)}et=null}else et=null;ge!==null&&a0(we,me,ge,et,!1),ot!==null&&Qt!==null&&a0(we,Qt,ot,et,!0)}}e:{if(me=ue?yt(ue):window,ge=me.nodeName&&me.nodeName.toLowerCase(),ge==="select"||ge==="input"&&me.type==="file")var Qe=Ih;else if(Qa(me))if(vh)Qe=xI;else{Qe=CI;var vt=wI}else ge=me.nodeName,!ge||ge.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?ue&&Jr(ue.elementType)&&(Qe=Ih):Qe=NI;if(Qe&&(Qe=Qe(t,ue))){an(we,Qe,o,Ee);break e}vt&&vt(t,me,ue),t==="focusout"&&ue&&me.type==="number"&&ue.memoizedProps.value!=null&&bs(me,"number",me.value)}switch(vt=ue?yt(ue):window,t){case"focusin":(Qa(vt)||vt.contentEditable==="true")&&(Cs=vt,Sd=ue,To=null);break;case"focusout":To=Sd=Cs=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,Lh(we,o,Ee);break;case"selectionchange":if(SI)break;case"keydown":case"keyup":Lh(we,o,Ee)}var We;if(ei)e:{switch(t){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else tt?He(t,o)&&(at="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(at="onCompositionStart");at&&(No&&o.locale!=="ko"&&(tt||at!=="onCompositionStart"?at==="onCompositionEnd"&&tt&&(We=D()):(Cn=Ee,A="value"in Cn?Cn.value:Cn.textContent,tt=!0)),vt=Mc(ue,at),0<vt.length&&(at=new wo(at,t,null,o,Ee),we.push({event:at,listeners:vt}),We?at.data=We:(We=Xe(o),We!==null&&(at.data=We)))),(We=Jl?Dt(t,o):dn(t,o))&&(at=Mc(ue,"onBeforeInput"),0<at.length&&(vt=new wo("onBeforeInput","beforeinput",null,o,Ee),we.push({event:vt,listeners:at}),vt.data=We)),uv(we,t,ue,o,Ee)}e0(we,n)})}function tl(t,n,o){return{instance:t,listener:n,currentTarget:o}}function Mc(t,n){for(var o=n+"Capture",u=[];t!==null;){var h=t,y=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||y===null||(h=Zr(t,o),h!=null&&u.unshift(tl(t,h,y)),h=Zr(t,n),h!=null&&u.push(tl(t,h,y))),t.tag===3)return u;t=t.return}return[]}function Ws(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function a0(t,n,o,u,h){for(var y=n._reactName,L=[];o!==null&&o!==u;){var M=o,Y=M.alternate,ue=M.stateNode;if(M=M.tag,Y!==null&&Y===u)break;M!==5&&M!==26&&M!==27||ue===null||(Y=ue,h?(ue=Zr(o,y),ue!=null&&L.unshift(tl(o,ue,Y))):h||(ue=Zr(o,y),ue!=null&&L.push(tl(o,ue,Y)))),o=o.return}L.length!==0&&t.push({event:n,listeners:L})}var gv=/\r\n?/g,hv=/\u0000|\uFFFD/g;function n0(t){return(typeof t=="string"?t:""+t).replace(gv,`
`).replace(hv,"")}function r0(t,n){return n=n0(n),n0(t)===n}function Fc(){}function Ht(t,n,o,u,h,y){switch(o){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||Jn(t,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&Jn(t,""+u);break;case"className":Ui(t,"class",u);break;case"tabIndex":Ui(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ui(t,o,u);break;case"style":Mi(t,u,y);break;case"data":if(n!=="object"){Ui(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||o!=="href")){t.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=en(""+u),t.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(o,"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 y=="function"&&(o==="formAction"?(n!=="input"&&Ht(t,n,"name",h.name,h,null),Ht(t,n,"formEncType",h.formEncType,h,null),Ht(t,n,"formMethod",h.formMethod,h,null),Ht(t,n,"formTarget",h.formTarget,h,null)):(Ht(t,n,"encType",h.encType,h,null),Ht(t,n,"method",h.method,h,null),Ht(t,n,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(o);break}u=en(""+u),t.setAttribute(o,u);break;case"onClick":u!=null&&(t.onclick=Fc);break;case"onScroll":u!=null&&Ct("scroll",t);break;case"onScrollEnd":u!=null&&Ct("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}o=en(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""+u):t.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":u===!0?t.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(o,u):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(o,u):t.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(o):t.setAttribute(o,u);break;case"popover":Ct("beforetoggle",t),Ct("toggle",t),Wn(t,"popover",u);break;case"xlinkActuate":$a(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":$a(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":$a(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":$a(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":$a(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":$a(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":$a(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":$a(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":$a(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Wn(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=pr.get(o)||o,Wn(t,o,u))}}function $m(t,n,o,u,h,y){switch(o){case"style":Mi(t,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(i(60));t.innerHTML=o}}break;case"children":typeof u=="string"?Jn(t,u):(typeof u=="number"||typeof u=="bigint")&&Jn(t,""+u);break;case"onScroll":u!=null&&Ct("scroll",t);break;case"onScrollEnd":u!=null&&Ct("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Fc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ut.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),n=o.slice(2,h?o.length-7:void 0),y=t[Ea]||null,y=y!=null?y[o]:null,typeof y=="function"&&t.removeEventListener(n,y,h),typeof u=="function")){typeof y!="function"&&y!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(n,u,h);break e}o in t?t[o]=u:u===!0?t.setAttribute(o,""):Wn(t,o,u)}}}function _a(t,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ct("error",t),Ct("load",t);var u=!1,h=!1,y;for(y in o)if(o.hasOwnProperty(y)){var L=o[y];if(L!=null)switch(y){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ht(t,n,y,L,o,null)}}h&&Ht(t,n,"srcSet",o.srcSet,o,null),u&&Ht(t,n,"src",o.src,o,null);return;case"input":Ct("invalid",t);var M=y=L=h=null,Y=null,ue=null;for(u in o)if(o.hasOwnProperty(u)){var Ee=o[u];if(Ee!=null)switch(u){case"name":h=Ee;break;case"type":L=Ee;break;case"checked":Y=Ee;break;case"defaultChecked":ue=Ee;break;case"value":y=Ee;break;case"defaultValue":M=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(i(137,n));break;default:Ht(t,n,u,Ee,o,null)}}Wr(t,y,M,Y,ue,L,h,!1),hr(t);return;case"select":Ct("invalid",t),u=L=y=null;for(h in o)if(o.hasOwnProperty(h)&&(M=o[h],M!=null))switch(h){case"value":y=M;break;case"defaultValue":L=M;break;case"multiple":u=M;default:Ht(t,n,h,M,o,null)}n=y,o=L,t.multiple=!!u,n!=null?Yr(t,!!u,n,!1):o!=null&&Yr(t,!!u,o,!0);return;case"textarea":Ct("invalid",t),y=h=u=null;for(L in o)if(o.hasOwnProperty(L)&&(M=o[L],M!=null))switch(L){case"value":u=M;break;case"defaultValue":h=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(i(91));break;default:Ht(t,n,L,M,o,null)}yo(t,u,h,y),hr(t);return;case"option":for(Y in o)if(o.hasOwnProperty(Y)&&(u=o[Y],u!=null))switch(Y){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ht(t,n,Y,u,o,null)}return;case"dialog":Ct("beforetoggle",t),Ct("toggle",t),Ct("cancel",t),Ct("close",t);break;case"iframe":case"object":Ct("load",t);break;case"video":case"audio":for(u=0;u<el.length;u++)Ct(el[u],t);break;case"image":Ct("error",t),Ct("load",t);break;case"details":Ct("toggle",t);break;case"embed":case"source":case"link":Ct("error",t),Ct("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in o)if(o.hasOwnProperty(ue)&&(u=o[ue],u!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ht(t,n,ue,u,o,null)}return;default:if(Jr(n)){for(Ee in o)o.hasOwnProperty(Ee)&&(u=o[Ee],u!==void 0&&$m(t,n,Ee,u,o,void 0));return}}for(M in o)o.hasOwnProperty(M)&&(u=o[M],u!=null&&Ht(t,n,M,u,o,null))}function Av(t,n,o,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,y=null,L=null,M=null,Y=null,ue=null,Ee=null;for(ge in o){var we=o[ge];if(o.hasOwnProperty(ge)&&we!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":Y=we;default:u.hasOwnProperty(ge)||Ht(t,n,ge,null,u,we)}}for(var me in u){var ge=u[me];if(we=o[me],u.hasOwnProperty(me)&&(ge!=null||we!=null))switch(me){case"type":y=ge;break;case"name":h=ge;break;case"checked":ue=ge;break;case"defaultChecked":Ee=ge;break;case"value":L=ge;break;case"defaultValue":M=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,n));break;default:ge!==we&&Ht(t,n,me,ge,u,we)}}po(t,L,M,Y,ue,Ee,y,h);return;case"select":ge=L=M=me=null;for(y in o)if(Y=o[y],o.hasOwnProperty(y)&&Y!=null)switch(y){case"value":break;case"multiple":ge=Y;default:u.hasOwnProperty(y)||Ht(t,n,y,null,u,Y)}for(h in u)if(y=u[h],Y=o[h],u.hasOwnProperty(h)&&(y!=null||Y!=null))switch(h){case"value":me=y;break;case"defaultValue":M=y;break;case"multiple":L=y;default:y!==Y&&Ht(t,n,h,y,u,Y)}n=M,o=L,u=ge,me!=null?Yr(t,!!o,me,!1):!!u!=!!o&&(n!=null?Yr(t,!!o,n,!0):Yr(t,!!o,o?[]:"",!1));return;case"textarea":ge=me=null;for(M in o)if(h=o[M],o.hasOwnProperty(M)&&h!=null&&!u.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Ht(t,n,M,null,u,h)}for(L in u)if(h=u[L],y=o[L],u.hasOwnProperty(L)&&(h!=null||y!=null))switch(L){case"value":me=h;break;case"defaultValue":ge=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==y&&Ht(t,n,L,h,u,y)}Is(t,me,ge);return;case"option":for(var ot in o)if(me=o[ot],o.hasOwnProperty(ot)&&me!=null&&!u.hasOwnProperty(ot))switch(ot){case"selected":t.selected=!1;break;default:Ht(t,n,ot,null,u,me)}for(Y in u)if(me=u[Y],ge=o[Y],u.hasOwnProperty(Y)&&me!==ge&&(me!=null||ge!=null))switch(Y){case"selected":t.selected=me&&typeof me!="function"&&typeof me!="symbol";break;default:Ht(t,n,Y,me,u,ge)}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 et in o)me=o[et],o.hasOwnProperty(et)&&me!=null&&!u.hasOwnProperty(et)&&Ht(t,n,et,null,u,me);for(ue in u)if(me=u[ue],ge=o[ue],u.hasOwnProperty(ue)&&me!==ge&&(me!=null||ge!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,n));break;default:Ht(t,n,ue,me,u,ge)}return;default:if(Jr(n)){for(var Qt in o)me=o[Qt],o.hasOwnProperty(Qt)&&me!==void 0&&!u.hasOwnProperty(Qt)&&$m(t,n,Qt,void 0,u,me);for(Ee in u)me=u[Ee],ge=o[Ee],!u.hasOwnProperty(Ee)||me===ge||me===void 0&&ge===void 0||$m(t,n,Ee,me,u,ge);return}}for(var re in o)me=o[re],o.hasOwnProperty(re)&&me!=null&&!u.hasOwnProperty(re)&&Ht(t,n,re,null,u,me);for(we in u)me=u[we],ge=o[we],!u.hasOwnProperty(we)||me===ge||me==null&&ge==null||Ht(t,n,we,me,u,ge)}var Zm=null,ef=null;function Oc(t){return t.nodeType===9?t:t.ownerDocument}function i0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function s0(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function tf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var af=null;function pv(){var t=window.event;return t&&t.type==="popstate"?t===af?!1:(af=t,!0):(af=null,!1)}var o0=typeof setTimeout=="function"?setTimeout:void 0,yv=typeof clearTimeout=="function"?clearTimeout:void 0,l0=typeof Promise=="function"?Promise:void 0,Ev=typeof queueMicrotask=="function"?queueMicrotask:typeof l0<"u"?function(t){return l0.resolve(null).then(t).catch(bv)}:o0;function bv(t){setTimeout(function(){throw t})}function pi(t){return t==="head"}function c0(t,n){var o=n,u=0,h=0;do{var y=o.nextSibling;if(t.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<u&&8>u){o=u;var L=t.ownerDocument;if(o&1&&al(L.documentElement),o&2&&al(L.body),o&4)for(o=L.head,al(o),L=o.firstChild;L;){var M=L.nextSibling,Y=L.nodeName;L[Ue]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&L.rel.toLowerCase()==="stylesheet"||o.removeChild(L),L=M}}if(h===0){t.removeChild(y),ul(n);return}h--}else o==="$"||o==="$?"||o==="$!"?h++:u=o.charCodeAt(0)-48;else u=0;o=y}while(o);ul(n)}function nf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":nf(o),Be(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function Iv(t,n,o,u){for(;t.nodeType===1;){var h=o;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Ue])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var y=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Pn(t.nextSibling),t===null)break}return null}function vv(t,n,o){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=Pn(t.nextSibling),t===null))return null;return t}function rf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function wv(t,n){var o=t.ownerDocument;if(t.data!=="$?"||o.readyState==="complete")n();else{var u=function(){n(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function Pn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="F!"||n==="F")break;if(n==="/$")return null}}return t}var sf=null;function u0(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return t;n--}else o==="/$"&&n++}t=t.previousSibling}return null}function d0(t,n,o){switch(n=Oc(o),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function al(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Be(t)}var Rn=new Map,m0=new Set;function jc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Dr=ae.d;ae.d={f:Cv,r:Nv,D:xv,C:Tv,L:Sv,m:kv,X:Rv,S:Lv,M:Dv};function Cv(){var t=Dr.f(),n=Lc();return t||n}function Nv(t){var n=Tt(t);n!==null&&n.tag===5&&n.type==="form"?DA(n):Dr.r(t)}var Ys=typeof document>"u"?null:document;function f0(t,n,o){var u=Ys;if(u&&typeof n=="string"&&n){var h=Za(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),m0.has(h)||(m0.add(h),t={rel:t,crossOrigin:o,href:n},u.querySelector(h)===null&&(n=u.createElement("link"),_a(n,"link",t),st(n),u.head.appendChild(n)))}}function xv(t){Dr.D(t),f0("dns-prefetch",t,null)}function Tv(t,n){Dr.C(t,n),f0("preconnect",t,n)}function Sv(t,n,o){Dr.L(t,n,o);var u=Ys;if(u&&t&&n){var h='link[rel="preload"][as="'+Za(n)+'"]';n==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Za(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Za(o.imageSizes)+'"]')):h+='[href="'+Za(t)+'"]';var y=h;switch(n){case"style":y=Js(t);break;case"script":y=Xs(t)}Rn.has(y)||(t=E({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:t,as:n},o),Rn.set(y,t),u.querySelector(h)!==null||n==="style"&&u.querySelector(nl(y))||n==="script"&&u.querySelector(rl(y))||(n=u.createElement("link"),_a(n,"link",t),st(n),u.head.appendChild(n)))}}function kv(t,n){Dr.m(t,n);var o=Ys;if(o&&t){var u=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Za(u)+'"][href="'+Za(t)+'"]',y=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Xs(t)}if(!Rn.has(y)&&(t=E({rel:"modulepreload",href:t},n),Rn.set(y,t),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(rl(y)))return}u=o.createElement("link"),_a(u,"link",t),st(u),o.head.appendChild(u)}}}function Lv(t,n,o){Dr.S(t,n,o);var u=Ys;if(u&&t){var h=it(u).hoistableStyles,y=Js(t);n=n||"default";var L=h.get(y);if(!L){var M={loading:0,preload:null};if(L=u.querySelector(nl(y)))M.loading=5;else{t=E({rel:"stylesheet",href:t,"data-precedence":n},o),(o=Rn.get(y))&&of(t,o);var Y=L=u.createElement("link");st(Y),_a(Y,"link",t),Y._p=new Promise(function(ue,Ee){Y.onload=ue,Y.onerror=Ee}),Y.addEventListener("load",function(){M.loading|=1}),Y.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Pc(L,n,u)}L={type:"stylesheet",instance:L,count:1,state:M},h.set(y,L)}}}function Rv(t,n){Dr.X(t,n);var o=Ys;if(o&&t){var u=it(o).hoistableScripts,h=Xs(t),y=u.get(h);y||(y=o.querySelector(rl(h)),y||(t=E({src:t,async:!0},n),(n=Rn.get(h))&&lf(t,n),y=o.createElement("script"),st(y),_a(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(h,y))}}function Dv(t,n){Dr.M(t,n);var o=Ys;if(o&&t){var u=it(o).hoistableScripts,h=Xs(t),y=u.get(h);y||(y=o.querySelector(rl(h)),y||(t=E({src:t,async:!0,type:"module"},n),(n=Rn.get(h))&&lf(t,n),y=o.createElement("script"),st(y),_a(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(h,y))}}function g0(t,n,o,u){var h=(h=ke.current)?jc(h):null;if(!h)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=Js(o.href),o=it(h).hoistableStyles,u=o.get(n),u||(u={type:"style",instance:null,count:0,state:null},o.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Js(o.href);var y=it(h).hoistableStyles,L=y.get(t);if(L||(h=h.ownerDocument||h,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,L),(y=h.querySelector(nl(t)))&&!y._p&&(L.instance=y,L.state.loading=5),Rn.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Rn.set(t,o),y||Bv(h,t,o,L.state))),n&&u===null)throw Error(i(528,""));return L}if(n&&u!==null)throw Error(i(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Xs(o),o=it(h).hoistableScripts,u=o.get(n),u||(u={type:"script",instance:null,count:0,state:null},o.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Js(t){return'href="'+Za(t)+'"'}function nl(t){return'link[rel="stylesheet"]['+t+"]"}function h0(t){return E({},t,{"data-precedence":t.precedence,precedence:null})}function Bv(t,n,o,u){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=t.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),_a(n,"link",o),st(n),t.head.appendChild(n))}function Xs(t){return'[src="'+Za(t)+'"]'}function rl(t){return"script[async]"+t}function A0(t,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+Za(o.href)+'"]');if(u)return n.instance=u,st(u),u;var h=E({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),st(u),_a(u,"style",h),Pc(u,o.precedence,t),n.instance=u;case"stylesheet":h=Js(o.href);var y=t.querySelector(nl(h));if(y)return n.state.loading|=4,n.instance=y,st(y),y;u=h0(o),(h=Rn.get(h))&&of(u,h),y=(t.ownerDocument||t).createElement("link"),st(y);var L=y;return L._p=new Promise(function(M,Y){L.onload=M,L.onerror=Y}),_a(y,"link",u),n.state.loading|=4,Pc(y,o.precedence,t),n.instance=y;case"script":return y=Xs(o.src),(h=t.querySelector(rl(y)))?(n.instance=h,st(h),h):(u=o,(h=Rn.get(y))&&(u=E({},o),lf(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),st(h),_a(h,"link",u),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,Pc(u,o.precedence,t));return n.instance}function Pc(t,n,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,y=h,L=0;L<u.length;L++){var M=u[L];if(M.dataset.precedence===n)y=M;else if(y!==h)break}y?y.parentNode.insertBefore(t,y.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(t,n.firstChild))}function of(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function lf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Hc=null;function p0(t,n,o){if(Hc===null){var u=new Map,h=Hc=new Map;h.set(o,u)}else h=Hc,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(t))return u;for(u.set(t,null),o=o.getElementsByTagName(t),h=0;h<o.length;h++){var y=o[h];if(!(y[Ue]||y[Kt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var L=y.getAttribute(n)||"";L=t+L;var M=u.get(L);M?M.push(y):u.set(L,[y])}}return u}function y0(t,n,o){t=t.ownerDocument||t,t.head.insertBefore(o,n==="title"?t.querySelector("head > title"):null)}function Uv(t,n,o){if(o===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function E0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var il=null;function _v(){}function Mv(t,n,o){if(il===null)throw Error(i(475));var u=il;if(n.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var h=Js(o.href),y=t.querySelector(nl(h));if(y){t=y._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(u.count++,u=Qc.bind(u),t.then(u,u)),n.state.loading|=4,n.instance=y,st(y);return}y=t.ownerDocument||t,o=h0(o),(h=Rn.get(h))&&of(o,h),y=y.createElement("link"),st(y);var L=y;L._p=new Promise(function(M,Y){L.onload=M,L.onerror=Y}),_a(y,"link",o),n.instance=y}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(u.count++,n=Qc.bind(u),t.addEventListener("load",n),t.addEventListener("error",n))}}function Fv(){if(il===null)throw Error(i(475));var t=il;return t.stylesheets&&t.count===0&&cf(t,t.stylesheets),0<t.count?function(n){var o=setTimeout(function(){if(t.stylesheets&&cf(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(o)}}:null}function Qc(){if(this.count--,this.count===0){if(this.stylesheets)cf(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var zc=null;function cf(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,zc=new Map,n.forEach(Ov,t),zc=null,Qc.call(t))}function Ov(t,n){if(!(n.state.loading&4)){var o=zc.get(t);if(o)var u=o.get(null);else{o=new Map,zc.set(t,o);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<h.length;y++){var L=h[y];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(o.set(L.dataset.precedence,L),u=L)}u&&o.set(null,u)}h=n.instance,L=h.getAttribute("data-precedence"),y=o.get(L)||u,y===u&&o.set(null,h),o.set(L,h),this.count++,u=Qc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),y?y.parentNode.insertBefore(h,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var sl={$$typeof:S,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function jv(t,n,o,u,h,y,L,M){this.tag=1,this.containerInfo=t,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=Mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mn(0),this.hiddenUpdates=Mn(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=y,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function b0(t,n,o,u,h,y,L,M,Y,ue,Ee,we){return t=new jv(t,n,o,L,M,Y,ue,we),n=1,y===!0&&(n|=24),y=gn(3,null,null,n),t.current=y,y.stateNode=t,n=zd(),n.refCount++,t.pooledCache=n,n.refCount++,y.memoizedState={element:u,isDehydrated:o,cache:n},qd(y),t}function I0(t){return t?(t=Ss,t):Ss}function v0(t,n,o,u,h,y){h=I0(h),u.context===null?u.context=h:u.pendingContext=h,u=ri(n),u.payload={element:o},y=y===void 0?null:y,y!==null&&(u.callback=y),o=ii(t,u,n),o!==null&&(En(o,t,n),Mo(o,t,n))}function w0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<n?o:n}}function uf(t,n){w0(t,n),(t=t.alternate)&&w0(t,n)}function C0(t){if(t.tag===13){var n=Ts(t,67108864);n!==null&&En(n,t,67108864),uf(t,67108864)}}var Vc=!0;function Pv(t,n,o,u){var h=X.T;X.T=null;var y=ae.p;try{ae.p=2,df(t,n,o,u)}finally{ae.p=y,X.T=h}}function Hv(t,n,o,u){var h=X.T;X.T=null;var y=ae.p;try{ae.p=8,df(t,n,o,u)}finally{ae.p=y,X.T=h}}function df(t,n,o,u){if(Vc){var h=mf(u);if(h===null)Xm(t,n,u,Kc,o),x0(t,u);else if(zv(h,t,n,o,u))u.stopPropagation();else if(x0(t,u),n&4&&-1<Qv.indexOf(t)){for(;h!==null;){var y=Tt(h);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var L=Nt(y.pendingLanes);if(L!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;L;){var Y=1<<31-N(L);M.entanglements[1]|=Y,L&=~Y}tr(y),(_t&6)===0&&(Sc=Re()+500,Zo(0))}}break;case 13:M=Ts(y,2),M!==null&&En(M,y,2),Lc(),uf(y,2)}if(y=mf(u),y===null&&Xm(t,n,u,Kc,o),y===h)break;h=y}h!==null&&u.stopPropagation()}else Xm(t,n,u,null,o)}}function mf(t){return t=yr(t),ff(t)}var Kc=null;function ff(t){if(Kc=null,t=Ze(t),t!==null){var n=c(t);if(n===null)t=null;else{var o=n.tag;if(o===13){if(t=d(n),t!==null)return t;t=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Kc=t,null}function N0(t){switch(t){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($e()){case qe:return 2;case dt:return 8;case Je:case At:return 32;case Ot:return 268435456;default:return 32}default:return 32}}var gf=!1,yi=null,Ei=null,bi=null,ol=new Map,ll=new Map,Ii=[],Qv="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 x0(t,n){switch(t){case"focusin":case"focusout":yi=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":bi=null;break;case"pointerover":case"pointerout":ol.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(n.pointerId)}}function cl(t,n,o,u,h,y){return t===null||t.nativeEvent!==y?(t={blockedOn:n,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[h]},n!==null&&(n=Tt(n),n!==null&&C0(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function zv(t,n,o,u,h){switch(n){case"focusin":return yi=cl(yi,t,n,o,u,h),!0;case"dragenter":return Ei=cl(Ei,t,n,o,u,h),!0;case"mouseover":return bi=cl(bi,t,n,o,u,h),!0;case"pointerover":var y=h.pointerId;return ol.set(y,cl(ol.get(y)||null,t,n,o,u,h)),!0;case"gotpointercapture":return y=h.pointerId,ll.set(y,cl(ll.get(y)||null,t,n,o,u,h)),!0}return!1}function T0(t){var n=Ze(t.target);if(n!==null){var o=c(n);if(o!==null){if(n=o.tag,n===13){if(n=d(o),n!==null){t.blockedOn=n,Kr(t.priority,function(){if(o.tag===13){var u=yn();u=Di(u);var h=Ts(o,u);h!==null&&En(h,o,u),uf(o,u)}});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var o=mf(t.nativeEvent);if(o===null){o=t.nativeEvent;var u=new o.constructor(o.type,o);vn=u,o.target.dispatchEvent(u),vn=null}else return n=Tt(o),n!==null&&C0(n),t.blockedOn=o,!1;n.shift()}return!0}function S0(t,n,o){Gc(t)&&o.delete(n)}function Vv(){gf=!1,yi!==null&&Gc(yi)&&(yi=null),Ei!==null&&Gc(Ei)&&(Ei=null),bi!==null&&Gc(bi)&&(bi=null),ol.forEach(S0),ll.forEach(S0)}function qc(t,n){t.blockedOn===n&&(t.blockedOn=null,gf||(gf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Vv)))}var Wc=null;function k0(t){Wc!==t&&(Wc=t,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Wc===t&&(Wc=null);for(var n=0;n<t.length;n+=3){var o=t[n],u=t[n+1],h=t[n+2];if(typeof u!="function"){if(ff(u||o)===null)continue;break}var y=Tt(o);y!==null&&(t.splice(n,3),n-=3,mm(y,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function ul(t){function n(Y){return qc(Y,t)}yi!==null&&qc(yi,t),Ei!==null&&qc(Ei,t),bi!==null&&qc(bi,t),ol.forEach(n),ll.forEach(n);for(var o=0;o<Ii.length;o++){var u=Ii[o];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Ii.length&&(o=Ii[0],o.blockedOn===null);)T0(o),o.blockedOn===null&&Ii.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],y=o[u+1],L=h[Ea]||null;if(typeof y=="function")L||k0(o);else if(L){var M=null;if(y&&y.hasAttribute("formAction")){if(h=y,L=y[Ea]||null)M=L.formAction;else if(ff(h)!==null)continue}else M=L.action;typeof M=="function"?o[u+1]=M:(o.splice(u,3),u-=3),k0(o)}}}function hf(t){this._internalRoot=t}Yc.prototype.render=hf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var o=n.current,u=yn();v0(o,u,t,n,null,null)},Yc.prototype.unmount=hf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;v0(t.current,2,null,t,null,null),Lc(),n[Gt]=null}};function Yc(t){this._internalRoot=t}Yc.prototype.unstable_scheduleHydration=function(t){if(t){var n=dr();t={blockedOn:null,target:t,priority:n};for(var o=0;o<Ii.length&&n!==0&&n<Ii[o].priority;o++);Ii.splice(o,0,t),o===0&&T0(t)}};var L0=e.version;if(L0!=="19.1.0")throw Error(i(527,L0,"19.1.0"));ae.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=g(n),t=t!==null?f(t):null,t=t===null?null:t.stateNode,t};var Kv={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jc.isDisabled&&Jc.supportsFiber)try{ya=Jc.inject(Kv),U=Jc}catch{}}return ml.createRoot=function(t,n){if(!s(t))throw Error(i(299));var o=!1,u="",h=GA,y=qA,L=WA,M=null;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(L=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(M=n.unstable_transitionCallbacks)),n=b0(t,1,!1,null,null,o,u,h,y,L,M,null),t[Gt]=n.current,Jm(t),new hf(n)},ml.hydrateRoot=function(t,n,o){if(!s(t))throw Error(i(299));var u=!1,h="",y=GA,L=qA,M=WA,Y=null,ue=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(L=o.onCaughtError),o.onRecoverableError!==void 0&&(M=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(Y=o.unstable_transitionCallbacks),o.formState!==void 0&&(ue=o.formState)),n=b0(t,1,!0,n,o??null,u,h,y,L,M,Y,ue),n.context=I0(null),o=n.current,u=yn(),u=Di(u),h=ri(u),h.callback=null,ii(o,h,u),o=u,n.current.lanes=o,Gn(n,o),tr(n),t[Gt]=n.current,Jm(t),new Yc(n)},ml.version="19.1.0",ml}var P0;function iw(){if(P0)return pf.exports;P0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),pf.exports=rw(),pf.exports}var sw=iw();const ow=Ri(sw);var w=Qg();const zg=Ri(w),lw=(r,e,a,i)=>{var c,d,m,g;const s=[a,{code:e,...i||{}}];if((d=(c=r==null?void 0:r.services)==null?void 0:c.logger)!=null&&d.forward)return r.services.logger.forward(s,"warn","react-i18next::",!0);ss(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(m=r==null?void 0:r.services)==null?void 0:m.logger)!=null&&g.warn?r.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},H0={},pg=(r,e,a,i)=>{ss(a)&&H0[a]||(ss(a)&&(H0[a]=new Date),lw(r,e,a,i))},GE=(r,e)=>()=>{if(r.isInitialized)e();else{const a=()=>{setTimeout(()=>{r.off("initialized",a)},0),e()};r.on("initialized",a)}},yg=(r,e,a)=>{r.loadNamespaces(e,GE(r,a))},Q0=(r,e,a,i)=>{if(ss(a)&&(a=[a]),r.options.preload&&r.options.preload.indexOf(e)>-1)return yg(r,a,i);a.forEach(s=>{r.options.ns.indexOf(s)<0&&r.options.ns.push(s)}),r.loadLanguages(e,GE(r,i))},cw=(r,e,a={})=>!e.languages||!e.languages.length?(pg(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:a.lng,precheck:(i,s)=>{var c;if(((c=a.bindI18n)==null?void 0:c.indexOf("languageChanging"))>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,r))return!1}}),ss=r=>typeof r=="string",uw=r=>typeof r=="object"&&r!==null,dw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mw={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},fw=r=>mw[r],gw=r=>r.replace(dw,fw);let Eg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:gw};const hw=(r={})=>{Eg={...Eg,...r}},Aw=()=>Eg;let qE;const pw=r=>{qE=r},yw=()=>qE,Ew={type:"3rdParty",init(r){hw(r.options.react),pw(r)}},bw=w.createContext();class Iw{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const vw=(r,e)=>{const a=w.useRef();return w.useEffect(()=>{a.current=r},[r,e]),a.current},WE=(r,e,a,i)=>r.getFixedT(e,a,i),ww=(r,e,a,i)=>w.useCallback(WE(r,e,a,i),[r,e,a,i]),Ge=(r,e={})=>{var j,_,P,K;const{i18n:a}=e,{i18n:i,defaultNS:s}=w.useContext(bw)||{},c=a||i||yw();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new Iw),!c){pg(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const H=(V,G)=>ss(G)?G:uw(G)&&ss(G.defaultValue)?G.defaultValue:Array.isArray(V)?V[V.length-1]:V,Q=[H,{},!1];return Q.t=H,Q.i18n={},Q.ready=!1,Q}(j=c.options.react)!=null&&j.wait&&pg(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...Aw(),...c.options.react,...e},{useSuspense:m,keyPrefix:g}=d;let f=s||((_=c.options)==null?void 0:_.defaultNS);f=ss(f)?[f]:f||["translation"],(K=(P=c.reportNamespaces).addUsedNamespaces)==null||K.call(P,f);const E=(c.isInitialized||c.initializedStoreOnce)&&f.every(H=>cw(H,c,d)),p=ww(c,e.lng||null,d.nsMode==="fallback"?f:f[0],g),C=()=>p,I=()=>WE(c,e.lng||null,d.nsMode==="fallback"?f:f[0],g),[x,T]=w.useState(C);let k=f.join();e.lng&&(k=`${e.lng}${k}`);const R=vw(k),B=w.useRef(!0);w.useEffect(()=>{const{bindI18n:H,bindI18nStore:Q}=d;B.current=!0,!E&&!m&&(e.lng?Q0(c,e.lng,f,()=>{B.current&&T(I)}):yg(c,f,()=>{B.current&&T(I)})),E&&R&&R!==k&&B.current&&T(I);const V=()=>{B.current&&T(I)};return H&&(c==null||c.on(H,V)),Q&&(c==null||c.store.on(Q,V)),()=>{B.current=!1,c&&(H==null||H.split(" ").forEach(G=>c.off(G,V))),Q&&c&&Q.split(" ").forEach(G=>c.store.off(G,V))}},[c,k]),w.useEffect(()=>{B.current&&E&&T(C)},[c,g,E]);const S=[x,c,E];if(S.t=x,S.i18n=c,S.ready=E,E||!E&&!m)return S;throw new Promise(H=>{e.lng?Q0(c,e.lng,f,()=>H()):yg(c,f,()=>H())})};/**
 * react-router v7.12.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var z0="popstate";function Cw(r={}){function e(s,c){let{pathname:d="/",search:m="",hash:g=""}=us(s.location.hash.substring(1));return!d.startsWith("/")&&!d.startsWith(".")&&(d="/"+d),bg("",{pathname:d,search:m,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function a(s,c){let d=s.document.querySelector("base"),m="";if(d&&d.getAttribute("href")){let g=s.location.href,f=g.indexOf("#");m=f===-1?g:g.slice(0,f)}return m+"#"+(typeof c=="string"?c:Dl(c))}function i(s,c){ln(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`)}return xw(e,a,i,r)}function $t(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function ln(r,e){if(!r){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Nw(){return Math.random().toString(36).substring(2,10)}function V0(r,e){return{usr:r.state,key:r.key,idx:e}}function bg(r,e,a=null,i){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof e=="string"?us(e):e,state:a,key:e&&e.key||i||Nw()}}function Dl({pathname:r="/",search:e="",hash:a=""}){return e&&e!=="?"&&(r+=e.charAt(0)==="?"?e:"?"+e),a&&a!=="#"&&(r+=a.charAt(0)==="#"?a:"#"+a),r}function us(r){let e={};if(r){let a=r.indexOf("#");a>=0&&(e.hash=r.substring(a),r=r.substring(0,a));let i=r.indexOf("?");i>=0&&(e.search=r.substring(i),r=r.substring(0,i)),r&&(e.pathname=r)}return e}function xw(r,e,a,i={}){let{window:s=document.defaultView,v5Compat:c=!1}=i,d=s.history,m="POP",g=null,f=E();f==null&&(f=0,d.replaceState({...d.state,idx:f},""));function E(){return(d.state||{idx:null}).idx}function p(){m="POP";let k=E(),R=k==null?null:k-f;f=k,g&&g({action:m,location:T.location,delta:R})}function C(k,R){m="PUSH";let B=bg(T.location,k,R);a&&a(B,k),f=E()+1;let S=V0(B,f),j=T.createHref(B);try{d.pushState(S,"",j)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;s.location.assign(j)}c&&g&&g({action:m,location:T.location,delta:1})}function I(k,R){m="REPLACE";let B=bg(T.location,k,R);a&&a(B,k),f=E();let S=V0(B,f),j=T.createHref(B);d.replaceState(S,"",j),c&&g&&g({action:m,location:T.location,delta:0})}function x(k){return Tw(k)}let T={get action(){return m},get location(){return r(s,d)},listen(k){if(g)throw new Error("A history only accepts one active listener");return s.addEventListener(z0,p),g=k,()=>{s.removeEventListener(z0,p),g=null}},createHref(k){return e(s,k)},createURL:x,encodeLocation(k){let R=x(k);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:C,replace:I,go(k){return d.go(k)}};return T}function Tw(r,e=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),$t(a,"No window.location.(origin|href) available to create URL");let i=typeof r=="string"?r:Dl(r);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=a+i),new URL(i,a)}function YE(r,e,a="/"){return Sw(r,e,a,!1)}function Sw(r,e,a,i){let s=typeof e=="string"?us(e):e,c=Qr(s.pathname||"/",a);if(c==null)return null;let d=JE(r);kw(d);let m=null;for(let g=0;m==null&&g<d.length;++g){let f=Pw(c);m=Ow(d[g],f,i)}return m}function JE(r,e=[],a=[],i="",s=!1){let c=(d,m,g=s,f)=>{let E={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(E.relativePath.startsWith("/")){if(!E.relativePath.startsWith(i)&&g)return;$t(E.relativePath.startsWith(i),`Absolute route path "${E.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),E.relativePath=E.relativePath.slice(i.length)}let p=Pr([i,E.relativePath]),C=a.concat(E);d.children&&d.children.length>0&&($t(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),JE(d.children,e,C,p,g)),!(d.path==null&&!d.index)&&e.push({path:p,score:Mw(p,d.index),routesMeta:C})};return r.forEach((d,m)=>{var g;if(d.path===""||!((g=d.path)!=null&&g.includes("?")))c(d,m);else for(let f of XE(d.path))c(d,m,!0,f)}),e}function XE(r){let e=r.split("/");if(e.length===0)return[];let[a,...i]=e,s=a.endsWith("?"),c=a.replace(/\?$/,"");if(i.length===0)return s?[c,""]:[c];let d=XE(i.join("/")),m=[];return m.push(...d.map(g=>g===""?c:[c,g].join("/"))),s&&m.push(...d),m.map(g=>r.startsWith("/")&&g===""?"/":g)}function kw(r){r.sort((e,a)=>e.score!==a.score?a.score-e.score:Fw(e.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var Lw=/^:[\w-]+$/,Rw=3,Dw=2,Bw=1,Uw=10,_w=-2,K0=r=>r==="*";function Mw(r,e){let a=r.split("/"),i=a.length;return a.some(K0)&&(i+=_w),e&&(i+=Dw),a.filter(s=>!K0(s)).reduce((s,c)=>s+(Lw.test(c)?Rw:c===""?Bw:Uw),i)}function Fw(r,e){return r.length===e.length&&r.slice(0,-1).every((i,s)=>i===e[s])?r[r.length-1]-e[e.length-1]:0}function Ow(r,e,a=!1){let{routesMeta:i}=r,s={},c="/",d=[];for(let m=0;m<i.length;++m){let g=i[m],f=m===i.length-1,E=c==="/"?e:e.slice(c.length)||"/",p=Su({path:g.relativePath,caseSensitive:g.caseSensitive,end:f},E),C=g.route;if(!p&&f&&a&&!i[i.length-1].route.index&&(p=Su({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},E)),!p)return null;Object.assign(s,p.params),d.push({params:s,pathname:Pr([c,p.pathname]),pathnameBase:Vw(Pr([c,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(c=Pr([c,p.pathnameBase]))}return d}function Su(r,e){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[a,i]=jw(r.path,r.caseSensitive,r.end),s=e.match(a);if(!s)return null;let c=s[0],d=c.replace(/(.)\/+$/,"$1"),m=s.slice(1);return{params:i.reduce((f,{paramName:E,isOptional:p},C)=>{if(E==="*"){let x=m[C]||"";d=c.slice(0,c.length-x.length).replace(/(.)\/+$/,"$1")}const I=m[C];return p&&!I?f[E]=void 0:f[E]=(I||"").replace(/%2F/g,"/"),f},{}),pathname:c,pathnameBase:d,pattern:r}}function jw(r,e=!1,a=!0){ln(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let i=[],s="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,g)=>(i.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(i.push({paramName:"*"}),s+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":r!==""&&r!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),i]}function Pw(r){try{return r.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ln(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),r}}function Qr(r,e){if(e==="/")return r;if(!r.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,i=r.charAt(a);return i&&i!=="/"?null:r.slice(a)||"/"}var $E=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hw=r=>$E.test(r);function Qw(r,e="/"){let{pathname:a,search:i="",hash:s=""}=typeof r=="string"?us(r):r,c;if(a)if(Hw(a))c=a;else{if(a.includes("//")){let d=a;a=a.replace(/\/\/+/g,"/"),ln(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${a}`)}a.startsWith("/")?c=G0(a.substring(1),"/"):c=G0(a,e)}else c=e;return{pathname:c,search:Kw(i),hash:Gw(s)}}function G0(r,e){let a=e.replace(/\/+$/,"").split("/");return r.split("/").forEach(s=>{s===".."?a.length>1&&a.pop():s!=="."&&a.push(s)}),a.length>1?a.join("/"):"/"}function vf(r,e,a,i){return`Cannot include a '${r}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  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 zw(r){return r.filter((e,a)=>a===0||e.route.path&&e.route.path.length>0)}function Vg(r){let e=zw(r);return e.map((a,i)=>i===e.length-1?a.pathname:a.pathnameBase)}function Kg(r,e,a,i=!1){let s;typeof r=="string"?s=us(r):(s={...r},$t(!s.pathname||!s.pathname.includes("?"),vf("?","pathname","search",s)),$t(!s.pathname||!s.pathname.includes("#"),vf("#","pathname","hash",s)),$t(!s.search||!s.search.includes("#"),vf("#","search","hash",s)));let c=r===""||s.pathname==="",d=c?"/":s.pathname,m;if(d==null)m=a;else{let p=e.length-1;if(!i&&d.startsWith("..")){let C=d.split("/");for(;C[0]==="..";)C.shift(),p-=1;s.pathname=C.join("/")}m=p>=0?e[p]:"/"}let g=Qw(s,m),f=d&&d!=="/"&&d.endsWith("/"),E=(c||d===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(f||E)&&(g.pathname+="/"),g}var Pr=r=>r.join("/").replace(/\/\/+/g,"/"),Vw=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Kw=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Gw=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,qw=class{constructor(r,e,a,i=!1){this.status=r,this.statusText=e||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Ww(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Yw(r){return r.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ZE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eb(r,e){let a=r;if(typeof a!="string"||!$E.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let i=a,s=!1;if(ZE)try{let c=new URL(window.location.href),d=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=Qr(d.pathname,e);d.origin===c.origin&&m!=null?a=m+d.search+d.hash:s=!0}catch{ln(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:s,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tb=["POST","PUT","PATCH","DELETE"];new Set(tb);var Jw=["GET",...tb];new Set(Jw);var mo=w.createContext(null);mo.displayName="DataRouter";var Vu=w.createContext(null);Vu.displayName="DataRouterState";var Xw=w.createContext(!1),ab=w.createContext({isTransitioning:!1});ab.displayName="ViewTransition";var $w=w.createContext(new Map);$w.displayName="Fetchers";var Zw=w.createContext(null);Zw.displayName="Await";var In=w.createContext(null);In.displayName="Navigation";var Ml=w.createContext(null);Ml.displayName="Location";var Qn=w.createContext({outlet:null,matches:[],isDataRoute:!1});Qn.displayName="Route";var Gg=w.createContext(null);Gg.displayName="RouteError";var nb="REACT_ROUTER_ERROR",eC="REDIRECT",tC="ROUTE_ERROR_RESPONSE";function aC(r){if(r.startsWith(`${nb}:${eC}:{`))try{let e=JSON.parse(r.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function nC(r){if(r.startsWith(`${nb}:${tC}:{`))try{let e=JSON.parse(r.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new qw(e.status,e.statusText,e.data)}catch{}}function rC(r,{relative:e}={}){$t(fo(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=w.useContext(In),{hash:s,pathname:c,search:d}=Fl(r,{relative:e}),m=c;return a!=="/"&&(m=c==="/"?a:Pr([a,c])),i.createHref({pathname:m,search:d,hash:s})}function fo(){return w.useContext(Ml)!=null}function Ha(){return $t(fo(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Ml).location}var rb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ib(r){w.useContext(In).static||w.useLayoutEffect(r)}function pa(){let{isDataRoute:r}=w.useContext(Qn);return r?pC():iC()}function iC(){$t(fo(),"useNavigate() may be used only in the context of a <Router> component.");let r=w.useContext(mo),{basename:e,navigator:a}=w.useContext(In),{matches:i}=w.useContext(Qn),{pathname:s}=Ha(),c=JSON.stringify(Vg(i)),d=w.useRef(!1);return ib(()=>{d.current=!0}),w.useCallback((g,f={})=>{if(ln(d.current,rb),!d.current)return;if(typeof g=="number"){a.go(g);return}let E=Kg(g,JSON.parse(c),s,f.relative==="path");r==null&&e!=="/"&&(E.pathname=E.pathname==="/"?e:Pr([e,E.pathname])),(f.replace?a.replace:a.push)(E,f.state,f)},[e,a,c,s,r])}w.createContext(null);function Ku(){let{matches:r}=w.useContext(Qn),e=r[r.length-1];return e?e.params:{}}function Fl(r,{relative:e}={}){let{matches:a}=w.useContext(Qn),{pathname:i}=Ha(),s=JSON.stringify(Vg(a));return w.useMemo(()=>Kg(r,JSON.parse(s),i,e==="path"),[r,s,i,e])}function sC(r,e){return sb(r,e)}function sb(r,e,a,i,s){var B;$t(fo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=w.useContext(In),{matches:d}=w.useContext(Qn),m=d[d.length-1],g=m?m.params:{},f=m?m.pathname:"/",E=m?m.pathnameBase:"/",p=m&&m.route;{let S=p&&p.path||"";lb(f,!p||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let C=Ha(),I;if(e){let S=typeof e=="string"?us(e):e;$t(E==="/"||((B=S.pathname)==null?void 0:B.startsWith(E)),`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 "${E}" but pathname "${S.pathname}" was given in the \`location\` prop.`),I=S}else I=C;let x=I.pathname||"/",T=x;if(E!=="/"){let S=E.replace(/^\//,"").split("/");T="/"+x.replace(/^\//,"").split("/").slice(S.length).join("/")}let k=YE(r,{pathname:T});ln(p||k!=null,`No routes matched location "${I.pathname}${I.search}${I.hash}" `),ln(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${I.pathname}${I.search}${I.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 R=dC(k&&k.map(S=>Object.assign({},S,{params:Object.assign({},g,S.params),pathname:Pr([E,c.encodeLocation?c.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?E:Pr([E,c.encodeLocation?c.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),d,a,i,s);return e&&R?w.createElement(Ml.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...I},navigationType:"POP"}},R):R}function oC(){let r=AC(),e=Ww(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),a=r instanceof Error?r.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},c={padding:"2px 4px",backgroundColor:i},d=null;return console.error("Error handled by React Router default ErrorBoundary:",r),d=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:c},"ErrorBoundary")," or"," ",w.createElement("code",{style:c},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),a?w.createElement("pre",{style:s},a):null,d)}var lC=w.createElement(oC,null),ob=class extends w.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,e){return e.location!==r.location||e.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:e.error,location:e.location,revalidation:r.revalidation||e.revalidation}}componentDidCatch(r,e){this.props.onError?this.props.onError(r,e):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const a=nC(r.digest);a&&(r=a)}let e=r!==void 0?w.createElement(Qn.Provider,{value:this.props.routeContext},w.createElement(Gg.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?w.createElement(cC,{error:r},e):e}};ob.contextType=Xw;var wf=new WeakMap;function cC({children:r,error:e}){let{basename:a}=w.useContext(In);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=aC(e.digest);if(i){let s=wf.get(e);if(s)throw s;let c=eb(i.location,a);if(ZE&&!wf.get(e))if(c.isExternal||i.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:i.replace}));throw wf.set(e,d),d}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return r}function uC({routeContext:r,match:e,children:a}){let i=w.useContext(mo);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),w.createElement(Qn.Provider,{value:r},a)}function dC(r,e=[],a=null,i=null,s=null){if(r==null){if(!a)return null;if(a.errors)r=a.matches;else if(e.length===0&&!a.initialized&&a.matches.length>0)r=a.matches;else return null}let c=r,d=a==null?void 0:a.errors;if(d!=null){let E=c.findIndex(p=>p.route.id&&(d==null?void 0:d[p.route.id])!==void 0);$t(E>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,E+1))}let m=!1,g=-1;if(a)for(let E=0;E<c.length;E++){let p=c[E];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=E),p.route.id){let{loaderData:C,errors:I}=a,x=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!I||I[p.route.id]===void 0);if(p.route.lazy||x){m=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}let f=a&&i?(E,p)=>{var C,I;i(E,{location:a.location,params:((I=(C=a.matches)==null?void 0:C[0])==null?void 0:I.params)??{},unstable_pattern:Yw(a.matches),errorInfo:p})}:void 0;return c.reduceRight((E,p,C)=>{let I,x=!1,T=null,k=null;a&&(I=d&&p.route.id?d[p.route.id]:void 0,T=p.route.errorElement||lC,m&&(g<0&&C===0?(lb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,k=null):g===C&&(x=!0,k=p.route.hydrateFallbackElement||null)));let R=e.concat(c.slice(0,C+1)),B=()=>{let S;return I?S=T:x?S=k:p.route.Component?S=w.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=E,w.createElement(uC,{match:p,routeContext:{outlet:E,matches:R,isDataRoute:a!=null},children:S})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?w.createElement(ob,{location:a.location,revalidation:a.revalidation,component:T,error:I,children:B(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:f}):B()},null)}function qg(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function mC(r){let e=w.useContext(mo);return $t(e,qg(r)),e}function fC(r){let e=w.useContext(Vu);return $t(e,qg(r)),e}function gC(r){let e=w.useContext(Qn);return $t(e,qg(r)),e}function Wg(r){let e=gC(r),a=e.matches[e.matches.length-1];return $t(a.route.id,`${r} can only be used on routes that contain a unique "id"`),a.route.id}function hC(){return Wg("useRouteId")}function AC(){var i;let r=w.useContext(Gg),e=fC("useRouteError"),a=Wg("useRouteError");return r!==void 0?r:(i=e.errors)==null?void 0:i[a]}function pC(){let{router:r}=mC("useNavigate"),e=Wg("useNavigate"),a=w.useRef(!1);return ib(()=>{a.current=!0}),w.useCallback(async(s,c={})=>{ln(a.current,rb),a.current&&(typeof s=="number"?await r.navigate(s):await r.navigate(s,{fromRouteId:e,...c}))},[r,e])}var q0={};function lb(r,e,a){!e&&!q0[r]&&(q0[r]=!0,ln(!1,a))}w.memo(yC);function yC({routes:r,future:e,state:a,onError:i}){return sb(r,void 0,a,i,e)}function EC({to:r,replace:e,state:a,relative:i}){$t(fo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=w.useContext(In);ln(!s,"<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:c}=w.useContext(Qn),{pathname:d}=Ha(),m=pa(),g=Kg(r,Vg(c),d,i==="path"),f=JSON.stringify(g);return w.useEffect(()=>{m(JSON.parse(f),{replace:e,state:a,relative:i})},[m,f,i,e,a]),null}function Yg(r){$t(!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 bC({basename:r="/",children:e=null,location:a,navigationType:i="POP",navigator:s,static:c=!1,unstable_useTransitions:d}){$t(!fo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=r.replace(/^\/*/,"/"),g=w.useMemo(()=>({basename:m,navigator:s,static:c,unstable_useTransitions:d,future:{}}),[m,s,c,d]);typeof a=="string"&&(a=us(a));let{pathname:f="/",search:E="",hash:p="",state:C=null,key:I="default"}=a,x=w.useMemo(()=>{let T=Qr(f,m);return T==null?null:{location:{pathname:T,search:E,hash:p,state:C,key:I},navigationType:i}},[m,f,E,p,C,I,i]);return ln(x!=null,`<Router basename="${m}"> is not able to match the URL "${f}${E}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:w.createElement(In.Provider,{value:g},w.createElement(Ml.Provider,{children:e,value:x}))}function cb({children:r,location:e}){return sC(Ig(r),e)}function Ig(r,e=[]){let a=[];return w.Children.forEach(r,(i,s)=>{if(!w.isValidElement(i))return;let c=[...e,s];if(i.type===w.Fragment){a.push.apply(a,Ig(i.props.children,c));return}$t(i.type===Yg,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!i.props.index||!i.props.children,"An index route cannot have child routes.");let d={id:i.props.id||c.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=Ig(i.props.children,c)),a.push(d)}),a}var Au="get",pu="application/x-www-form-urlencoded";function Gu(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function IC(r){return Gu(r)&&r.tagName.toLowerCase()==="button"}function vC(r){return Gu(r)&&r.tagName.toLowerCase()==="form"}function wC(r){return Gu(r)&&r.tagName.toLowerCase()==="input"}function CC(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function NC(r,e){return r.button===0&&(!e||e==="_self")&&!CC(r)}function vg(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((e,a)=>{let i=r[a];return e.concat(Array.isArray(i)?i.map(s=>[a,s]):[[a,i]])},[]))}function xC(r,e){let a=vg(r);return e&&e.forEach((i,s)=>{a.has(s)||e.getAll(s).forEach(c=>{a.append(s,c)})}),a}var Xc=null;function TC(){if(Xc===null)try{new FormData(document.createElement("form"),0),Xc=!1}catch{Xc=!0}return Xc}var SC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cf(r){return r!=null&&!SC.has(r)?(ln(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pu}"`),null):r}function kC(r,e){let a,i,s,c,d;if(vC(r)){let m=r.getAttribute("action");i=m?Qr(m,e):null,a=r.getAttribute("method")||Au,s=Cf(r.getAttribute("enctype"))||pu,c=new FormData(r)}else if(IC(r)||wC(r)&&(r.type==="submit"||r.type==="image")){let m=r.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=r.getAttribute("formaction")||m.getAttribute("action");if(i=g?Qr(g,e):null,a=r.getAttribute("formmethod")||m.getAttribute("method")||Au,s=Cf(r.getAttribute("formenctype"))||Cf(m.getAttribute("enctype"))||pu,c=new FormData(m,r),!TC()){let{name:f,type:E,value:p}=r;if(E==="image"){let C=f?`${f}.`:"";c.append(`${C}x`,"0"),c.append(`${C}y`,"0")}else f&&c.append(f,p)}}else{if(Gu(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Au,i=null,s=pu,d=r}return c&&s==="text/plain"&&(d=c,c=void 0),{action:i,method:a.toLowerCase(),encType:s,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jg(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function LC(r,e,a,i){let s=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return a?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${i}`:s.pathname=`${s.pathname}.${i}`:s.pathname==="/"?s.pathname=`_root.${i}`:e&&Qr(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function RC(r,e){if(r.id in e)return e[r.id];try{let a=await import(r.module);return e[r.id]=a,a}catch(a){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function DC(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function BC(r,e,a){let i=await Promise.all(r.map(async s=>{let c=e.routes[s.route.id];if(c){let d=await RC(c,a);return d.links?d.links():[]}return[]}));return FC(i.flat(1).filter(DC).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function W0(r,e,a,i,s,c){let d=(g,f)=>a[f]?g.route.id!==a[f].route.id:!0,m=(g,f)=>{var E;return a[f].pathname!==g.pathname||((E=a[f].route.path)==null?void 0:E.endsWith("*"))&&a[f].params["*"]!==g.params["*"]};return c==="assets"?e.filter((g,f)=>d(g,f)||m(g,f)):c==="data"?e.filter((g,f)=>{var p;let E=i.routes[g.route.id];if(!E||!E.hasLoader)return!1;if(d(g,f)||m(g,f))return!0;if(g.route.shouldRevalidate){let C=g.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(r,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function UC(r,e,{includeHydrateFallback:a}={}){return _C(r.map(i=>{let s=e.routes[i.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),a&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function _C(r){return[...new Set(r)]}function MC(r){let e={},a=Object.keys(r).sort();for(let i of a)e[i]=r[i];return e}function FC(r,e){let a=new Set;return new Set(e),r.reduce((i,s)=>{let c=JSON.stringify(MC(s));return a.has(c)||(a.add(c),i.push({key:c,link:s})),i},[])}function ub(){let r=w.useContext(mo);return Jg(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function OC(){let r=w.useContext(Vu);return Jg(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Xg=w.createContext(void 0);Xg.displayName="FrameworkContext";function db(){let r=w.useContext(Xg);return Jg(r,"You must render this element inside a <HydratedRouter> element"),r}function jC(r,e){let a=w.useContext(Xg),[i,s]=w.useState(!1),[c,d]=w.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:f,onMouseLeave:E,onTouchStart:p}=e,C=w.useRef(null);w.useEffect(()=>{if(r==="render"&&d(!0),r==="viewport"){let T=R=>{R.forEach(B=>{d(B.isIntersecting)})},k=new IntersectionObserver(T,{threshold:.5});return C.current&&k.observe(C.current),()=>{k.disconnect()}}},[r]),w.useEffect(()=>{if(i){let T=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(T)}}},[i]);let I=()=>{s(!0)},x=()=>{s(!1),d(!1)};return a?r!=="intent"?[c,C,{}]:[c,C,{onFocus:fl(m,I),onBlur:fl(g,x),onMouseEnter:fl(f,I),onMouseLeave:fl(E,x),onTouchStart:fl(p,I)}]:[!1,C,{}]}function fl(r,e){return a=>{r&&r(a),a.defaultPrevented||e(a)}}function PC({page:r,...e}){let{router:a}=ub(),i=w.useMemo(()=>YE(a.routes,r,a.basename),[a.routes,r,a.basename]);return i?w.createElement(QC,{page:r,matches:i,...e}):null}function HC(r){let{manifest:e,routeModules:a}=db(),[i,s]=w.useState([]);return w.useEffect(()=>{let c=!1;return BC(r,e,a).then(d=>{c||s(d)}),()=>{c=!0}},[r,e,a]),i}function QC({page:r,matches:e,...a}){let i=Ha(),{future:s,manifest:c,routeModules:d}=db(),{basename:m}=ub(),{loaderData:g,matches:f}=OC(),E=w.useMemo(()=>W0(r,e,f,c,i,"data"),[r,e,f,c,i]),p=w.useMemo(()=>W0(r,e,f,c,i,"assets"),[r,e,f,c,i]),C=w.useMemo(()=>{if(r===i.pathname+i.search+i.hash)return[];let T=new Set,k=!1;if(e.forEach(B=>{var j;let S=c.routes[B.route.id];!S||!S.hasLoader||(!E.some(_=>_.route.id===B.route.id)&&B.route.id in g&&((j=d[B.route.id])!=null&&j.shouldRevalidate)||S.hasClientLoader?k=!0:T.add(B.route.id))}),T.size===0)return[];let R=LC(r,m,s.unstable_trailingSlashAwareDataRequests,"data");return k&&T.size>0&&R.searchParams.set("_routes",e.filter(B=>T.has(B.route.id)).map(B=>B.route.id).join(",")),[R.pathname+R.search]},[m,s.unstable_trailingSlashAwareDataRequests,g,i,c,E,e,r,d]),I=w.useMemo(()=>UC(p,c),[p,c]),x=HC(p);return w.createElement(w.Fragment,null,C.map(T=>w.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...a})),I.map(T=>w.createElement("link",{key:T,rel:"modulepreload",href:T,...a})),x.map(({key:T,link:k})=>w.createElement("link",{key:T,nonce:a.nonce,...k})))}function zC(...r){return e=>{r.forEach(a=>{typeof a=="function"?a(e):a!=null&&(a.current=e)})}}var VC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{VC&&(window.__reactRouterVersion="7.12.0")}catch{}function KC({basename:r,children:e,unstable_useTransitions:a,window:i}){let s=w.useRef();s.current==null&&(s.current=Cw({window:i,v5Compat:!0}));let c=s.current,[d,m]=w.useState({action:c.action,location:c.location}),g=w.useCallback(f=>{a===!1?m(f):w.startTransition(()=>m(f))},[a]);return w.useLayoutEffect(()=>c.listen(g),[c,g]),w.createElement(bC,{basename:r,children:e,location:d.location,navigationType:d.action,navigator:c,unstable_useTransitions:a})}var mb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qu=w.forwardRef(function({onClick:e,discover:a="render",prefetch:i="none",relative:s,reloadDocument:c,replace:d,state:m,target:g,to:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C,...I},x){let{basename:T,unstable_useTransitions:k}=w.useContext(In),R=typeof f=="string"&&mb.test(f),B=eb(f,T);f=B.to;let S=rC(f,{relative:s}),[j,_,P]=jC(i,I),K=YC(f,{replace:d,state:m,target:g,preventScrollReset:E,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:C,unstable_useTransitions:k});function H(V){e&&e(V),V.defaultPrevented||K(V)}let Q=w.createElement("a",{...I,...P,href:B.absoluteURL||S,onClick:B.isExternal||c?e:H,ref:zC(x,_),target:g,"data-discover":!R&&a==="render"?"true":void 0});return j&&!R?w.createElement(w.Fragment,null,Q,w.createElement(PC,{page:S})):Q});qu.displayName="Link";var GC=w.forwardRef(function({"aria-current":e="page",caseSensitive:a=!1,className:i="",end:s=!1,style:c,to:d,viewTransition:m,children:g,...f},E){let p=Fl(d,{relative:f.relative}),C=Ha(),I=w.useContext(Vu),{navigator:x,basename:T}=w.useContext(In),k=I!=null&&eN(p)&&m===!0,R=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,B=C.pathname,S=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;a||(B=B.toLowerCase(),S=S?S.toLowerCase():null,R=R.toLowerCase()),S&&T&&(S=Qr(S,T)||S);const j=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let _=B===R||!s&&B.startsWith(R)&&B.charAt(j)==="/",P=S!=null&&(S===R||!s&&S.startsWith(R)&&S.charAt(R.length)==="/"),K={isActive:_,isPending:P,isTransitioning:k},H=_?e:void 0,Q;typeof i=="function"?Q=i(K):Q=[i,_?"active":null,P?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let V=typeof c=="function"?c(K):c;return w.createElement(qu,{...f,"aria-current":H,className:Q,ref:E,style:V,to:d,viewTransition:m},typeof g=="function"?g(K):g)});GC.displayName="NavLink";var qC=w.forwardRef(({discover:r="render",fetcherKey:e,navigate:a,reloadDocument:i,replace:s,state:c,method:d=Au,action:m,onSubmit:g,relative:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C,...I},x)=>{let{unstable_useTransitions:T}=w.useContext(In),k=$C(),R=ZC(m,{relative:f}),B=d.toLowerCase()==="get"?"get":"post",S=typeof m=="string"&&mb.test(m),j=_=>{if(g&&g(_),_.defaultPrevented)return;_.preventDefault();let P=_.nativeEvent.submitter,K=(P==null?void 0:P.getAttribute("formmethod"))||d,H=()=>k(P||_.currentTarget,{fetcherKey:e,method:K,navigate:a,replace:s,state:c,relative:f,preventScrollReset:E,viewTransition:p,unstable_defaultShouldRevalidate:C});T&&a!==!1?w.startTransition(()=>H()):H()};return w.createElement("form",{ref:x,method:B,action:R,onSubmit:i?g:j,...I,"data-discover":!S&&r==="render"?"true":void 0})});qC.displayName="Form";function WC(r){return`${r} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function fb(r){let e=w.useContext(mo);return $t(e,WC(r)),e}function YC(r,{target:e,replace:a,state:i,preventScrollReset:s,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let f=pa(),E=Ha(),p=Fl(r,{relative:c});return w.useCallback(C=>{if(NC(C,e)){C.preventDefault();let I=a!==void 0?a:Dl(E)===Dl(p),x=()=>f(r,{replace:I,state:i,preventScrollReset:s,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:m});g?w.startTransition(()=>x()):x()}},[E,f,p,a,i,e,r,s,c,d,m,g])}function gb(r){ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=w.useRef(vg(r)),a=w.useRef(!1),i=Ha(),s=w.useMemo(()=>xC(i.search,a.current?null:e.current),[i.search]),c=pa(),d=w.useCallback((m,g)=>{const f=vg(typeof m=="function"?m(new URLSearchParams(s)):m);a.current=!0,c("?"+f,g)},[c,s]);return[s,d]}var JC=0,XC=()=>`__${String(++JC)}__`;function $C(){let{router:r}=fb("useSubmit"),{basename:e}=w.useContext(In),a=hC(),i=r.fetch,s=r.navigate;return w.useCallback(async(c,d={})=>{let{action:m,method:g,encType:f,formData:E,body:p}=kC(c,e);if(d.navigate===!1){let C=d.fetcherKey||XC();await i(C,a,d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:E,body:p,formMethod:d.method||g,formEncType:d.encType||f,flushSync:d.flushSync})}else await s(d.action||m,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:E,body:p,formMethod:d.method||g,formEncType:d.encType||f,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[i,s,e,a])}function ZC(r,{relative:e}={}){let{basename:a}=w.useContext(In),i=w.useContext(Qn);$t(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),c={...Fl(r||".",{relative:e})},d=Ha();if(r==null){c.search=d.search;let m=new URLSearchParams(c.search),g=m.getAll("index");if(g.some(E=>E==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let E=m.toString();c.search=E?`?${E}`:""}}return(!r||r===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Pr([a,c.pathname])),Dl(c)}function eN(r,{relative:e}={}){let a=w.useContext(ab);$t(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=fb("useViewTransitionState"),s=Fl(r,{relative:e});if(!a.isTransitioning)return!1;let c=Qr(a.currentLocation.pathname,i)||a.currentLocation.pathname,d=Qr(a.nextLocation.pathname,i)||a.nextLocation.pathname;return Su(s.pathname,d)!=null||Su(s.pathname,c)!=null}var $c={exports:{}},Y0;function tN(){if(Y0)return $c.exports;Y0=1;const r=a=>typeof crypto<"u"&&typeof crypto.getRandomValues=="function"?()=>{const i=crypto.getRandomValues(new Uint8Array(1))[0];return(i>=a?i%a:i).toString(a)}:()=>Math.floor(Math.random()*a).toString(a),e=(a=7,i=!1)=>Array.from({length:a},r(i?16:36)).join("");return $c.exports=e,$c.exports.default=e,$c.exports}var aN=tN();const ku=Ri(aN);var nN=()=>`uid::${ku(7)}`,rN=(r,e=["endpointName","fingerprint"])=>typeof r=="object"&&r!==null&&e.every(a=>a in r),iN=r=>{if(!rN(r))throw new TypeError("Invalid connection args");return JSON.stringify(r)},sN=()=>{let r=[];return{add:(...e)=>{r=[...r,...e]},remove:e=>{r=typeof e=="string"?r.filter(a=>a.message.transactionId!==e):r.filter(a=>!e.includes(a))},entries:()=>r}},Nf=class{static toBackground(r,e){return r.postMessage(e)}static toExtensionContext(r,e){return r.postMessage(e)}},yu={exports:{}},oN=yu.exports,J0;function lN(){return J0||(J0=1,function(r,e){(function(a,i){i(r)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:oN,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 i="The message port closed before a response was received.",s="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)",c=d=>{const m={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(m).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class g extends WeakMap{constructor(Q,V=void 0){super(V),this.createItem=Q}get(Q){return this.has(Q)||this.set(Q,this.createItem(Q)),super.get(Q)}}const f=H=>H&&typeof H=="object"&&typeof H.then=="function",E=(H,Q)=>(...V)=>{d.runtime.lastError?H.reject(new Error(d.runtime.lastError.message)):Q.singleCallbackArg||V.length<=1&&Q.singleCallbackArg!==!1?H.resolve(V[0]):H.resolve(V)},p=H=>H==1?"argument":"arguments",C=(H,Q)=>function(G,...q){if(q.length<Q.minArgs)throw new Error(`Expected at least ${Q.minArgs} ${p(Q.minArgs)} for ${H}(), got ${q.length}`);if(q.length>Q.maxArgs)throw new Error(`Expected at most ${Q.maxArgs} ${p(Q.maxArgs)} for ${H}(), got ${q.length}`);return new Promise((W,ne)=>{if(Q.fallbackToNoCallback)try{G[H](...q,E({resolve:W,reject:ne},Q))}catch(de){console.warn(`${H} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,de),G[H](...q),Q.fallbackToNoCallback=!1,Q.noCallback=!0,W()}else Q.noCallback?(G[H](...q),W()):G[H](...q,E({resolve:W,reject:ne},Q))})},I=(H,Q,V)=>new Proxy(Q,{apply(G,q,W){return V.call(q,H,...W)}});let x=Function.call.bind(Object.prototype.hasOwnProperty);const T=(H,Q={},V={})=>{let G=Object.create(null),q={has(ne,de){return de in H||de in G},get(ne,de,X){if(de in G)return G[de];if(!(de in H))return;let ae=H[de];if(typeof ae=="function")if(typeof Q[de]=="function")ae=I(H,H[de],Q[de]);else if(x(V,de)){let pe=C(de,V[de]);ae=I(H,H[de],pe)}else ae=ae.bind(H);else if(typeof ae=="object"&&ae!==null&&(x(Q,de)||x(V,de)))ae=T(ae,Q[de],V[de]);else if(x(V,"*"))ae=T(ae,Q[de],V["*"]);else return Object.defineProperty(G,de,{configurable:!0,enumerable:!0,get(){return H[de]},set(pe){H[de]=pe}}),ae;return G[de]=ae,ae},set(ne,de,X,ae){return de in G?G[de]=X:H[de]=X,!0},defineProperty(ne,de,X){return Reflect.defineProperty(G,de,X)},deleteProperty(ne,de){return Reflect.deleteProperty(G,de)}},W=Object.create(H);return new Proxy(W,q)},k=H=>({addListener(Q,V,...G){Q.addListener(H.get(V),...G)},hasListener(Q,V){return Q.hasListener(H.get(V))},removeListener(Q,V){Q.removeListener(H.get(V))}}),R=new g(H=>typeof H!="function"?H:function(V){const G=T(V,{},{getContent:{minArgs:0,maxArgs:0}});H(G)});let B=!1;const S=new g(H=>typeof H!="function"?H:function(V,G,q){let W=!1,ne,de=new Promise(Ae=>{ne=function(O){B||(console.warn(s,new Error().stack),B=!0),W=!0,Ae(O)}}),X;try{X=H(V,G,ne)}catch(Ae){X=Promise.reject(Ae)}const ae=X!==!0&&f(X);if(X!==!0&&!ae&&!W)return!1;const pe=Ae=>{Ae.then(O=>{q(O)},O=>{let $;O&&(O instanceof Error||typeof O.message=="string")?$=O.message:$="An unexpected error occurred",q({__mozWebExtensionPolyfillReject__:!0,message:$})}).catch(O=>{console.error("Failed to send onMessage rejected reply",O)})};return pe(ae?X:de),!0}),j=({reject:H,resolve:Q},V)=>{d.runtime.lastError?d.runtime.lastError.message===i?Q():H(new Error(d.runtime.lastError.message)):V&&V.__mozWebExtensionPolyfillReject__?H(new Error(V.message)):Q(V)},_=(H,Q,V,...G)=>{if(G.length<Q.minArgs)throw new Error(`Expected at least ${Q.minArgs} ${p(Q.minArgs)} for ${H}(), got ${G.length}`);if(G.length>Q.maxArgs)throw new Error(`Expected at most ${Q.maxArgs} ${p(Q.maxArgs)} for ${H}(), got ${G.length}`);return new Promise((q,W)=>{const ne=j.bind(null,{resolve:q,reject:W});G.push(ne),V.sendMessage(...G)})},P={devtools:{network:{onRequestFinished:k(R)}},runtime:{onMessage:k(S),onMessageExternal:k(S),sendMessage:_.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:_.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},K={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return m.privacy={network:{"*":K},services:{"*":K},websites:{"*":K}},T(d,P,m)};a.exports=c(chrome)}else a.exports=globalThis.browser})}(yu)),yu.exports}var cN=lN();const uN=Ri(cN);var dN=(r="")=>{const e=nN();let a,i=[];const s=sN(),c=new Set,d=new Set,m=(f,E)=>{switch(f.status){case"undeliverable":i.some(p=>p.message.messageID===f.message.messageID)||(i=[...i,{message:f.message,resolvedDestination:f.resolvedDestination}]);return;case"deliverable":i=i.reduce((p,C)=>C.resolvedDestination===f.deliverableTo?(Nf.toBackground(E,{type:"deliver",message:C.message}),p):[...p,C],[]);return;case"delivered":f.receipt.message.messageType==="message"&&s.add(f.receipt);return;case"incoming":f.message.messageType==="reply"&&s.remove(f.message.messageID),c.forEach(p=>p(f.message,E));return;case"terminated":{const p=s.entries().filter(C=>f.fingerprint===C.to);s.remove(p),p.forEach(({message:C})=>d.forEach(I=>I(C)))}}},g=()=>{a=uN.runtime.connect({name:iN({endpointName:r,fingerprint:e})}),a.onMessage.addListener(m),a.onDisconnect.addListener(g),Nf.toBackground(a,{type:"sync",pendingResponses:s.entries(),pendingDeliveries:[...new Set(i.map(({resolvedDestination:f})=>f))]})};return g(),{onFailure(f){d.add(f)},onMessage(f){c.add(f)},postMessage(f){Nf.toBackground(a,{type:"deliver",message:f})}}},mN=Object.defineProperty,fN=Object.defineProperties,gN=Object.getOwnPropertyDescriptors,X0=Object.getOwnPropertySymbols,hN=Object.prototype.hasOwnProperty,AN=Object.prototype.propertyIsEnumerable,$0=(r,e,a)=>e in r?mN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,hb=(r,e)=>{for(var a in e||(e={}))hN.call(e,a)&&$0(r,a,e[a]);if(X0)for(var a of X0(e))AN.call(e,a)&&$0(r,a,e[a]);return r},Ab=(r,e)=>fN(r,gN(e)),pN=/^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/,pb=r=>{const[,e,a,i]=r.match(pN)||[];return{context:e,tabId:+a,frameId:i?+i:void 0}};const yN=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],wg=Symbol(".toJSON was called"),EN=r=>{r[wg]=!0;const e=r.toJSON();return delete r[wg],e},yb=({from:r,seen:e,to_:a,forceEnumerable:i,maxDepth:s,depth:c})=>{const d=a||(Array.isArray(r)?[]:{});if(e.push(r),c>=s)return d;if(typeof r.toJSON=="function"&&r[wg]!==!0)return EN(r);for(const[m,g]of Object.entries(r)){if(typeof Buffer=="function"&&Buffer.isBuffer(g)){d[m]="[object Buffer]";continue}if(g!==null&&typeof g=="object"&&typeof g.pipe=="function"){d[m]="[object Stream]";continue}if(typeof g!="function"){if(!g||typeof g!="object"){d[m]=g;continue}if(!e.includes(r[m])){c++,d[m]=yb({from:r[m],seen:[...e],forceEnumerable:i,maxDepth:s,depth:c});continue}d[m]="[Circular]"}}for(const{property:m,enumerable:g}of yN)typeof r[m]=="string"&&Object.defineProperty(d,m,{value:r[m],enumerable:!0,configurable:!0,writable:!0});return d};function bN(r,e={}){const{maxDepth:a=Number.POSITIVE_INFINITY}=e;return typeof r=="object"&&r!==null?yb({from:r,seen:[],forceEnumerable:!0,maxDepth:a,depth:0}):typeof r=="function"?`[Function: ${r.name||"anonymous"}]`:r}let Eb=()=>({events:{},emit(r,...e){(this.events[r]||[]).forEach(a=>a(...e))},on(r,e){return(this.events[r]=this.events[r]||[]).push(e),()=>this.events[r]=(this.events[r]||[]).filter(a=>a!==e)}});var IN=(r,e,a)=>{const i=ku(),s=new Map,c=new Map,d=m=>{if(m.destination.context===r&&!m.destination.frameId&&!m.destination.tabId){const{transactionId:g,messageID:f,messageType:E}=m,p=()=>{const I=s.get(g);if(I){const{err:x,data:T}=m;if(x){const k=x,R=self[k.name],B=new(typeof R=="function"?R:Error)(k.message);for(const S in k)B[S]=k[S];I.reject(B)}else I.resolve(T);s.delete(g)}},C=async()=>{let I,x,T=!1;try{const k=c.get(f);if(typeof k=="function")I=await k({sender:m.origin,id:f,data:m.data,timestamp:m.timestamp});else throw T=!0,new Error(`[webext-bridge] No handler registered in '${r}' to accept messages with id '${f}'`)}catch(k){x=k}finally{if(x&&(m.err=bN(x)),d(Ab(hb({},m),{messageType:"reply",data:I,origin:{context:r,tabId:null},destination:m.origin,hops:[]})),x&&!T)throw I}};switch(E){case"reply":return p();case"message":return C()}}return m.hops.push(`${r}::${i}`),e(m)};return{handleMessage:d,endTransaction:m=>{const g=s.get(m);g==null||g.reject("Transaction was ended before it could complete"),s.delete(m)},sendMessage:(m,g,f="background")=>{const E=typeof f=="string"?pb(f):f,p="Bridge#sendMessage ->";if(!E.context)throw new TypeError(`${p} Destination must be any one of known destinations`);return new Promise((C,I)=>{const x={messageID:m,data:g,destination:E,messageType:"message",transactionId:ku(),origin:{context:r,tabId:null},hops:[],timestamp:Date.now()};s.set(x.transactionId,{resolve:C,reject:I});try{d(x)}catch(T){s.delete(x.transactionId),I(T)}})},onMessage:(m,g)=>(c.set(m,g),()=>c.delete(m))}},ao=class{constructor(r,e){this.endpointRuntime=r,this.streamInfo=e,this.emitter=Eb(),this.isClosed=!1,this.handleStreamClose=()=>{this.isClosed||(this.isClosed=!0,this.emitter.emit("closed",!0),this.emitter.events={})},ao.initDone||(r.onMessage("__crx_bridge_stream_transfer__",a=>{const{streamId:i,streamTransfer:s,action:c}=a.data,d=ao.openStreams.get(i);d&&!d.isClosed&&(c==="transfer"&&d.emitter.emit("message",s),c==="close"&&(ao.openStreams.delete(i),d.handleStreamClose()))}),ao.initDone=!0),ao.openStreams.set(this.streamInfo.streamId,this)}get info(){return this.streamInfo}send(r){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:r,action:"transfer"},this.streamInfo.endpoint)}close(r){r&&this.send(r),this.handleStreamClose(),this.endpointRuntime.sendMessage("__crx_bridge_stream_transfer__",{streamId:this.streamInfo.streamId,streamTransfer:null,action:"close"},this.streamInfo.endpoint)}onMessage(r){return this.getDisposable("message",r)}onClose(r){return this.getDisposable("closed",r)}getDisposable(r,e){const a=this.emitter.on(r,e);return Object.assign(a,{dispose:a,close:a})}},Lu=ao;Lu.initDone=!1;Lu.openStreams=new Map;var vN=r=>{const e=new Map,a=new Map,i=Eb();r.onMessage("__crx_bridge_stream_open__",d=>new Promise(m=>{const{sender:g,data:f}=d,{channel:E}=f;let p=!1,C=()=>{};const I=()=>{const x=a.get(E);typeof x=="function"?(x(new Lu(r,Ab(hb({},f),{endpoint:g}))),p&&C(),m(!0)):p||(p=!0,C=i.on("did-change-stream-callbacks",I))};I()}));async function s(d,m){if(e.has(d))throw new Error("webext-bridge: A Stream is already open at this channel");const g=typeof m=="string"?pb(m):m,f={streamId:ku(),channel:d,endpoint:g},E=new Lu(r,f);return E.onClose(()=>e.delete(d)),await r.sendMessage("__crx_bridge_stream_open__",f,g),e.set(d,E),E}function c(d,m){if(a.has(d))throw new Error("webext-bridge: This channel has already been claimed. Stream allows only one-on-one communication");a.set(d,m),i.emit("did-change-stream-callbacks")}return{openStream:s,onOpenStreamChannel:c}},bb=dN("popup"),$g=IN("popup",r=>bb.postMessage(r));bb.onMessage($g.handleMessage);var{sendMessage:lt,onMessage:xf}=$g;vN($g);const wN=()=>{const[r,e]=w.useState(!1),a=w.useRef(null),i=w.useRef(0),s=(c,d)=>{setTimeout(()=>{if(a.current){const m=c/d*100;a.current.style.transition="none",a.current.style.width=`${m}%`,a.current.offsetHeight,requestAnimationFrame(()=>{a.current&&(a.current.style.transition=`width ${c}s linear`,a.current.style.width="0%")})}},10)};return w.useEffect(()=>{lt("GET_CLIPBOARD_COUNTDOWN_STATE",{},"background").then(g=>{const f=g;f&&f.remaining>0&&(i.current=f.id,e(!0),s(f.remaining,f.total))}).catch(()=>{});const c=xf("CLIPBOARD_COUNTDOWN",({data:g})=>{const{remaining:f,total:E,id:p}=g;e(f>0),p!==i.current&&f>0&&(i.current=p,s(f,E))}),d=xf("CLIPBOARD_CLEARED",()=>{e(!1),i.current=0,a.current&&(a.current.style.transition="none",a.current.style.width="0%")}),m=xf("CLIPBOARD_COUNTDOWN_CANCELLED",()=>{e(!1),i.current=0,a.current&&(a.current.style.transition="none",a.current.style.width="0%")});return()=>{c(),d(),m()}},[]),r?l.jsx("div",{className:"fixed top-0 left-0 right-0 z-[60] h-1 bg-gray-200 dark:bg-gray-700",children:l.jsx("div",{ref:a,className:"h-full bg-orange-500",style:{width:"100%",transition:"none"}})}):null},CN=()=>{const{t:r}=Ge(),e=pa(),a=Ha(),[i,s]=w.useState("items");w.useEffect(()=>{const E=a.pathname.substring(1),C=["items","emails","settings"].find(I=>E===I||E.startsWith(`${I}/`));C&&s(C)},[a]);const c=E=>{s(E),E==="items"?e(`/${E}`,{state:{resetFilters:!0}}):e(`/${E}`)};return["/","/login","/auth-settings","/unlock","/unlock-success","/upgrade"].includes(a.pathname)||new URLSearchParams(window.location.search).get("mode")==="inline_unlock"?null:l.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:l.jsxs("div",{className:"flex justify-around items-center h-14",children:[l.jsxs("button",{onClick:()=>c("items"),id:"nav-vault",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="items"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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"})}),l.jsx("span",{className:"text-sm mt-1",children:r("menu.vault")})]}),l.jsxs("button",{onClick:()=>c("emails"),id:"nav-emails",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="emails"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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"})}),l.jsx("span",{className:"text-sm mt-1",children:r("menu.emails")})]}),l.jsxs("button",{onClick:()=>c("settings"),id:"nav-settings",className:`flex flex-col items-center justify-center w-1/3 h-full ${i==="settings"?"text-primary-600 dark:text-primary-500":"text-gray-500 dark:text-gray-400"}`,children:[l.jsxs("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.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"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),l.jsx("span",{className:"text-sm mt-1",children:r("common.settings")})]})]})})},Ib=({className:r="",width:e=200,height:a=50,showText:i=!0,color:s="currentColor"})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",version:"1.1",viewBox:"0 0 2000 500",width:e,height:a,className:r,children:[l.jsx("path",{d:"m459.87 294.95c0.016205 5.4005 0.03241 10.801-0.35022 16.873-1.111 6.3392-1.1941 12.173-2.6351 17.649-10.922 41.508-36.731 69.481-77.351 83.408-7.2157 2.4739-14.972 3.3702-22.479 4.995-23.629 0.042205-47.257 0.11453-70.886 0.12027-46.762 0.011322-93.523-0.01416-140.95-0.43411-8.59-2.0024-16.766-2.8352-24.398-5.3326-21.595-7.0666-39.523-19.656-53.708-37.552-10.227-12.903-17.579-27.17-21.28-43.221-1.475-6.3967-2.4711-12.904-3.6852-19.361-0.051849-5.747-0.1037-11.494 0.26915-17.886 4.159-42.973 27.68-71.638 63.562-92.153 0-0.70761-0.001961-1.6988 3.12e-4 -2.69 0.022484-9.8293-1.3071-19.894 0.35664-29.438 3.2391-18.579 11.08-35.272 23.763-49.773 12.098-13.832 26.457-23.989 43.609-30.029 7.813-2.7512 16.14-4.0417 24.234-5.9948 7.392-0.025734 14.784-0.05146 22.835 0.32253 4.1959 0.95392 7.7946 1.2538 11.258 2.1053 17.16 4.2192 32.287 12.176 45.469 24.104 2.2558 2.0411 4.372 6.6241 9.621 3.868 16.839-8.8419 34.718-11.597 53.603-8.594 16.791 2.6699 31.602 9.4308 44.236 20.636 11.531 10.227 19.84 22.841 25.393 37.236 6.3436 16.445 10.389 33.163 6.0798 49.389 7.9587 8.9321 15.807 16.704 22.421 25.414 9.162 12.065 15.33 25.746 18.144 40.776 0.97046 5.1848 1.9111 10.375 2.8654 15.563m-71.597 71.012c5.5615-5.2284 12.002-9.7986 16.508-15.817 10.474-13.992 14.333-29.916 11.288-47.446-2.2496-12.95-8.1973-24.076-17.243-33.063-12.746-12.663-28.865-18.614-46.786-18.569-69.912 0.17712-139.82 0.56831-209.74 0.96176-15.922 0.089599-29.168 7.4209-39.685 18.296-14.45 14.944-20.408 33.343-16.655 54.368 2.2763 12.754 8.2167 23.748 17.158 32.66 13.299 13.255 30.097 18.653 48.728 18.651 59.321-0.005188 118.64 0.042358 177.96-0.046601 9.5912-0.014374 19.181-0.86588 28.773-0.88855 10.649-0.025146 19.978-3.825 29.687-9.1074z",fill:"#EEC170"}),l.jsx("path",{d:"m162.77 293c15.654 4.3883 20.627 22.967 10.304 34.98-5.3104 6.1795-14.817 8.3208-24.278 5.0472-7.0723-2.4471-12.332-10.362-12.876-17.933-1.0451-14.542 11.089-23.176 21.705-23.046 1.5794 0.019287 3.1517 0.61566 5.1461 0.95184z",fill:"#EEC170"}),l.jsx("path",{d:"m227.18 293.64c7.8499 2.3973 11.938 8.2143 13.524 15.077 1.8591 8.0439-0.44817 15.706-7.1588 21.121-6.7633 5.4572-14.417 6.8794-22.578 3.1483-8.2972-3.7933-12.836-10.849-12.736-19.438 0.1687-14.497 14.13-25.368 28.948-19.908z",fill:"#EEC170"}),l.jsx("path",{d:"m261.57 319.07c-2.495-14.418 4.6853-22.603 14.596-26.108 9.8945-3.4995 23.181 3.4303 26.267 13.779 4.6504 15.591-7.1651 29.064-21.665 28.161-8.5254-0.53088-17.202-6.5094-19.198-15.831z",fill:"#EEC170"}),l.jsx("path",{d:"m336.91 333.41c-9.0175-4.2491-15.337-14.349-13.829-21.682 3.0825-14.989 13.341-20.304 23.018-19.585 10.653 0.79141 17.93 7.407 19.765 17.547 1.9588 10.824-4.1171 19.939-13.494 23.703-5.272 2.1162-10.091 1.5086-15.46 0.017883z",fill:"#EEC170"}),i&&l.jsx("text",{x:"550",y:"355",fontFamily:"Arial, Helvetica, sans-serif",fontWeight:"700",fontSize:"290",letterSpacing:"-7",fill:s,children:"AliasVault"})]});var Z0=Object.prototype.hasOwnProperty;function Cg(r,e){var a,i;if(r===e)return!0;if(r&&e&&(a=r.constructor)===e.constructor){if(a===Date)return r.getTime()===e.getTime();if(a===RegExp)return r.toString()===e.toString();if(a===Array){if((i=r.length)===e.length)for(;i--&&Cg(r[i],e[i]););return i===-1}if(!a||typeof r=="object"){i=0;for(a in r)if(Z0.call(r,a)&&++i&&!Z0.call(e,a)||!(a in e)||!Cg(r[a],e[a]))return!1;return Object.keys(e).length===i}}return r!==r&&e!==e}const NN=new Error("request for lock canceled");var xN=function(r,e,a,i){function s(c){return c instanceof a?c:new a(function(d){d(c)})}return new(a||(a=Promise))(function(c,d){function m(E){try{f(i.next(E))}catch(p){d(p)}}function g(E){try{f(i.throw(E))}catch(p){d(p)}}function f(E){E.done?c(E.value):s(E.value).then(m,g)}f((i=i.apply(r,e||[])).next())})};class TN{constructor(e,a=NN){this._value=e,this._cancelError=a,this._queue=[],this._weightedWaiters=[]}acquire(e=1,a=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((i,s)=>{const c={resolve:i,reject:s,weight:e,priority:a},d=vb(this._queue,m=>a<=m.priority);d===-1&&e<=this._value?this._dispatchItem(c):this._queue.splice(d+1,0,c)})}runExclusive(e){return xN(this,arguments,void 0,function*(a,i=1,s=0){const[c,d]=yield this.acquire(i,s);try{return yield a(c)}finally{d()}})}waitForUnlock(e=1,a=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,a)?Promise.resolve():new Promise(i=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),SN(this._weightedWaiters[e-1],{resolve:i,priority:a})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.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(e){const a=this._value;this._value-=e.weight,e.resolve([a,this._newReleaser(e.weight)])}_newReleaser(e){let a=!1;return()=>{a||(a=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const a=this._weightedWaiters[e-1];a&&(a.forEach(i=>i.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let a=this._value;a>0;a--){const i=this._weightedWaiters[a-1];if(!i)continue;const s=i.findIndex(c=>c.priority<=e);(s===-1?i:i.splice(0,s)).forEach(c=>c.resolve())}}}_couldLockImmediately(e,a){return(this._queue.length===0||this._queue[0].priority<a)&&e<=this._value}}function SN(r,e){const a=vb(r,i=>e.priority<=i.priority);r.splice(a+1,0,e)}function vb(r,e){for(let a=r.length-1;a>=0;a--)if(e(r[a]))return a;return-1}var kN=function(r,e,a,i){function s(c){return c instanceof a?c:new a(function(d){d(c)})}return new(a||(a=Promise))(function(c,d){function m(E){try{f(i.next(E))}catch(p){d(p)}}function g(E){try{f(i.throw(E))}catch(p){d(p)}}function f(E){E.done?c(E.value):s(E.value).then(m,g)}f((i=i.apply(r,e||[])).next())})};class LN{constructor(e){this._semaphore=new TN(1,e)}acquire(){return kN(this,arguments,void 0,function*(e=0){const[,a]=yield this._semaphore.acquire(1,e);return a})}runExclusive(e,a=0){return this._semaphore.runExclusive(()=>e(),1,a)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}var QE,zE;const Eu=((zE=(QE=globalThis.browser)==null?void 0:QE.runtime)==null?void 0:zE.id)==null?globalThis.chrome:globalThis.browser,Ce=RN();function RN(){const r={local:Zc("local"),session:Zc("session"),sync:Zc("sync"),managed:Zc("managed")},e=T=>{const k=r[T];if(k==null){const R=Object.keys(r).join(", ");throw Error(`Invalid area "${T}". Options: ${R}`)}return k},a=T=>{const k=T.indexOf(":"),R=T.substring(0,k),B=T.substring(k+1);if(B==null)throw Error(`Storage key should be in the form of "area:key", but received "${T}"`);return{driverArea:R,driverKey:B,driver:e(R)}},i=T=>T+"$",s=(T,k)=>{const R={...T};return Object.entries(k).forEach(([B,S])=>{S==null?delete R[B]:R[B]=S}),R},c=(T,k)=>T??k??null,d=T=>typeof T=="object"&&!Array.isArray(T)?T:{},m=async(T,k,R)=>{const B=await T.getItem(k);return c(B,(R==null?void 0:R.fallback)??(R==null?void 0:R.defaultValue))},g=async(T,k)=>{const R=i(k),B=await T.getItem(R);return d(B)},f=async(T,k,R)=>{await T.setItem(k,R??null)},E=async(T,k,R)=>{const B=i(k),S=d(await T.getItem(B));await T.setItem(B,s(S,R))},p=async(T,k,R)=>{if(await T.removeItem(k),R!=null&&R.removeMeta){const B=i(k);await T.removeItem(B)}},C=async(T,k,R)=>{const B=i(k);if(R==null)await T.removeItem(B);else{const S=d(await T.getItem(B));[R].flat().forEach(j=>delete S[j]),await T.setItem(B,S)}},I=(T,k,R)=>T.watch(k,R);return{getItem:async(T,k)=>{const{driver:R,driverKey:B}=a(T);return await m(R,B,k)},getItems:async T=>{const k=new Map,R=new Map,B=[];T.forEach(j=>{let _,P;typeof j=="string"?_=j:"getValue"in j?(_=j.key,P={fallback:j.fallback}):(_=j.key,P=j.options),B.push(_);const{driverArea:K,driverKey:H}=a(_),Q=k.get(K)??[];k.set(K,Q.concat(H)),R.set(_,P)});const S=new Map;return await Promise.all(Array.from(k.entries()).map(async([j,_])=>{(await r[j].getItems(_)).forEach(K=>{const H=`${j}:${K.key}`,Q=R.get(H),V=c(K.value,(Q==null?void 0:Q.fallback)??(Q==null?void 0:Q.defaultValue));S.set(H,V)})})),B.map(j=>({key:j,value:S.get(j)}))},getMeta:async T=>{const{driver:k,driverKey:R}=a(T);return await g(k,R)},getMetas:async T=>{const k=T.map(S=>{const j=typeof S=="string"?S:S.key,{driverArea:_,driverKey:P}=a(j);return{key:j,driverArea:_,driverKey:P,driverMetaKey:i(P)}}),R=k.reduce((S,j)=>{var _;return S[_=j.driverArea]??(S[_]=[]),S[j.driverArea].push(j),S},{}),B={};return await Promise.all(Object.entries(R).map(async([S,j])=>{const _=await Eu.storage[S].get(j.map(P=>P.driverMetaKey));j.forEach(P=>{B[P.key]=_[P.driverMetaKey]??{}})})),k.map(S=>({key:S.key,meta:B[S.key]}))},setItem:async(T,k)=>{const{driver:R,driverKey:B}=a(T);await f(R,B,k)},setItems:async T=>{const k={};T.forEach(R=>{const{driverArea:B,driverKey:S}=a("key"in R?R.key:R.item.key);k[B]??(k[B]=[]),k[B].push({key:S,value:R.value})}),await Promise.all(Object.entries(k).map(async([R,B])=>{await e(R).setItems(B)}))},setMeta:async(T,k)=>{const{driver:R,driverKey:B}=a(T);await E(R,B,k)},setMetas:async T=>{const k={};T.forEach(R=>{const{driverArea:B,driverKey:S}=a("key"in R?R.key:R.item.key);k[B]??(k[B]=[]),k[B].push({key:S,properties:R.meta})}),await Promise.all(Object.entries(k).map(async([R,B])=>{const S=e(R),j=B.map(({key:H})=>i(H));console.log(R,j);const _=await S.getItems(j),P=Object.fromEntries(_.map(({key:H,value:Q})=>[H,d(Q)])),K=B.map(({key:H,properties:Q})=>{const V=i(H);return{key:V,value:s(P[V]??{},Q)}});await S.setItems(K)}))},removeItem:async(T,k)=>{const{driver:R,driverKey:B}=a(T);await p(R,B,k)},removeItems:async T=>{const k={};T.forEach(R=>{let B,S;typeof R=="string"?B=R:"getValue"in R?B=R.key:"item"in R?(B=R.item.key,S=R.options):(B=R.key,S=R.options);const{driverArea:j,driverKey:_}=a(B);k[j]??(k[j]=[]),k[j].push(_),S!=null&&S.removeMeta&&k[j].push(i(_))}),await Promise.all(Object.entries(k).map(async([R,B])=>{await e(R).removeItems(B)}))},clear:async T=>{await e(T).clear()},removeMeta:async(T,k)=>{const{driver:R,driverKey:B}=a(T);await C(R,B,k)},snapshot:async(T,k)=>{var S;const B=await e(T).snapshot();return(S=k==null?void 0:k.excludeKeys)==null||S.forEach(j=>{delete B[j],delete B[i(j)]}),B},restoreSnapshot:async(T,k)=>{await e(T).restoreSnapshot(k)},watch:(T,k)=>{const{driver:R,driverKey:B}=a(T);return I(R,B,k)},unwatch(){Object.values(r).forEach(T=>{T.unwatch()})},defineItem:(T,k)=>{const{driver:R,driverKey:B}=a(T),{version:S=1,migrations:j={}}=k??{};if(S<1)throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");const _=async()=>{var X;const V=i(B),[{value:G},{value:q}]=await R.getItems([B,V]);if(G==null)return;const W=(q==null?void 0:q.v)??1;if(W>S)throw Error(`Version downgrade detected (v${W} -> v${S}) for "${T}"`);if(W===S)return;console.debug(`[@wxt-dev/storage] Running storage migration for ${T}: v${W} -> v${S}`);const ne=Array.from({length:S-W},(ae,pe)=>W+pe+1);let de=G;for(const ae of ne)try{de=await((X=j==null?void 0:j[ae])==null?void 0:X.call(j,de))??de}catch(pe){throw new DN(T,ae,{cause:pe})}await R.setItems([{key:B,value:de},{key:V,value:{...q,v:S}}]),console.debug(`[@wxt-dev/storage] Storage migration completed for ${T} v${S}`,{migratedValue:de})},P=(k==null?void 0:k.migrations)==null?Promise.resolve():_().catch(V=>{console.error(`[@wxt-dev/storage] Migration failed for ${T}`,V)}),K=new LN,H=()=>(k==null?void 0:k.fallback)??(k==null?void 0:k.defaultValue)??null,Q=()=>K.runExclusive(async()=>{const V=await R.getItem(B);if(V!=null||(k==null?void 0:k.init)==null)return V;const G=await k.init();return await R.setItem(B,G),G});return P.then(Q),{key:T,get defaultValue(){return H()},get fallback(){return H()},getValue:async()=>(await P,k!=null&&k.init?await Q():await m(R,B,k)),getMeta:async()=>(await P,await g(R,B)),setValue:async V=>(await P,await f(R,B,V)),setMeta:async V=>(await P,await E(R,B,V)),removeValue:async V=>(await P,await p(R,B,V)),removeMeta:async V=>(await P,await C(R,B,V)),watch:V=>I(R,B,(G,q)=>V(G??H(),q??H())),migrate:_}}}}function Zc(r){const e=()=>{if(Eu.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(Eu.storage==null)throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");const i=Eu.storage[r];if(i==null)throw Error(`"browser.storage.${r}" is undefined`);return i},a=new Set;return{getItem:async i=>(await e().get(i))[i],getItems:async i=>{const s=await e().get(i);return i.map(c=>({key:c,value:s[c]??null}))},setItem:async(i,s)=>{s==null?await e().remove(i):await e().set({[i]:s})},setItems:async i=>{const s=i.reduce((c,{key:d,value:m})=>(c[d]=m,c),{});await e().set(s)},removeItem:async i=>{await e().remove(i)},removeItems:async i=>{await e().remove(i)},clear:async()=>{await e().clear()},snapshot:async()=>await e().get(),restoreSnapshot:async i=>{await e().set(i)},watch(i,s){const c=d=>{const m=d[i];m!=null&&(Cg(m.newValue,m.oldValue)||s(m.newValue??null,m.oldValue??null))};return e().onChanged.addListener(c),a.add(c),()=>{e().onChanged.removeListener(c),a.delete(c)}},unwatch(){a.forEach(i=>{e().onChanged.removeListener(i)}),a.clear()}}}class DN extends Error{constructor(e,a,i){super(`v${a} migration failed for "${e}"`,i),this.key=e,this.version=a}}var Tf={exports:{}};const BN={},UN=Object.freeze(Object.defineProperty({__proto__:null,default:BN},Symbol.toStringTag,{value:"Module"})),ey=Jv(UN);var ty;function _N(){return ty||(ty=1,function(r,e){var a=void 0,i=function(s){return a||(a=new Promise(function(c,d){var m=typeof s<"u"?s:{},g=m.onAbort;m.onAbort=function(A){d(new Error(A)),g&&g(A)},m.postRun=m.postRun||[],m.postRun.push(function(){c(m)}),r=void 0;var f;f||(f=typeof m<"u"?m:{});var E=typeof window=="object",p=typeof WorkerGlobalScope<"u",C=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";f.onRuntimeInitialized=function(){function A(se,xe){switch(typeof xe){case"boolean":wd(se,xe?1:0);break;case"number":bd(se,xe);break;case"string":Id(se,xe,-1,-1);break;case"object":if(xe===null)Yl(se);else if(xe.length!=null){var He=Jr(xe,Mi);vd(se,He,xe.length,-1),$r(He)}else ei(se,"Wrong API use : tried to return a value of an unknown type ("+xe+").",-1);break;default:Yl(se)}}function b(se,xe){for(var He=[],Xe=0;Xe<se;Xe+=1){var tt=ht(xe+4*Xe,"i32"),Dt=Wl(tt);if(Dt===1||Dt===2)tt=Ed(tt);else if(Dt===3)tt=pd(tt);else if(Dt===4){Dt=tt,tt=Ad(Dt),Dt=yd(Dt);for(var dn=new Uint8Array(tt),tn=0;tn<tt;tn+=1)dn[tn]=V[Dt+tn];tt=dn}else tt=null;He.push(tt)}return He}function D(se,xe){this.Qa=se,this.db=xe,this.Oa=1,this.lb=[]}function F(se,xe){if(this.db=xe,xe=ya(se)+1,this.eb=vs(xe),this.eb===null)throw Error("Unable to allocate memory for the SQL string");U(se,G,this.eb,xe),this.kb=this.eb,this.Za=this.pb=null}function J(se){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),se!=null){var xe=this.filename,He="/",Xe=xe;if(He&&(He=typeof He=="string"?He:dr(He),Xe=xe?qe(He+"/"+xe):He),xe=Nt(!0,!0),Xe=Wa(Xe,xe),se){if(typeof se=="string"){He=Array(se.length);for(var tt=0,Dt=se.length;tt<Dt;++tt)He[tt]=se.charCodeAt(tt);se=He}$a(Xe,xe|146),He=fr(Xe,577),Ql(He,se,0,se.length,0),Yn(He),$a(Xe,xe)}}this.handleError(Pe(this.filename,oe)),this.db=ht(oe,"i32"),Jl(this.db),this.fb={},this.Sa={}}var oe=wn(4),he=f.cwrap,Pe=he("sqlite3_open","number",["string","number"]),gt=he("sqlite3_close_v2","number",["number"]),ct=he("sqlite3_exec","number",["number","string","number","number","number"]),Yt=he("sqlite3_changes","number",["number"]),Ta=he("sqlite3_prepare_v2","number",["number","string","number","number","number"]),ws=he("sqlite3_sql","string",["number"]),Fi=he("sqlite3_normalized_sql","string",["number"]),Oi=he("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Kl=he("sqlite3_bind_text","number",["number","number","number","number","number"]),Gl=he("sqlite3_bind_blob","number",["number","number","number","number","number"]),nd=he("sqlite3_bind_double","number",["number","number","number"]),rd=he("sqlite3_bind_int","number",["number","number","number"]),vo=he("sqlite3_bind_parameter_index","number",["number","string"]),id=he("sqlite3_step","number",["number"]),sd=he("sqlite3_errmsg","string",["number"]),od=he("sqlite3_column_count","number",["number"]),ld=he("sqlite3_data_count","number",["number"]),cd=he("sqlite3_column_double","number",["number","number"]),wo=he("sqlite3_column_text","string",["number","number"]),ud=he("sqlite3_column_blob","number",["number","number"]),dd=he("sqlite3_column_bytes","number",["number","number"]),md=he("sqlite3_column_type","number",["number","number"]),fd=he("sqlite3_column_name","string",["number","number"]),Co=he("sqlite3_reset","number",["number"]),gd=he("sqlite3_clear_bindings","number",["number"]),hd=he("sqlite3_finalize","number",["number"]),ql=he("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Wl=he("sqlite3_value_type","number",["number"]),Ad=he("sqlite3_value_bytes","number",["number"]),pd=he("sqlite3_value_text","string",["number"]),yd=he("sqlite3_value_blob","number",["number"]),Ed=he("sqlite3_value_double","number",["number"]),bd=he("sqlite3_result_double","",["number","number"]),Yl=he("sqlite3_result_null","",["number"]),Id=he("sqlite3_result_text","",["number","string","number","number"]),vd=he("sqlite3_result_blob","",["number","number","number","number"]),wd=he("sqlite3_result_int","",["number","number"]),ei=he("sqlite3_result_error","",["number","string","number"]),ti=he("sqlite3_aggregate_context","number",["number","number"]),Jl=he("RegisterExtensionFunctions","number",["number"]),No=he("sqlite3_update_hook","number",["number","number","number"]);D.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},D.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var se=id(this.Qa);switch(se){case 100:return!0;case 101:return!1;default:throw this.db.handleError(se)}},D.prototype.wb=function(se){return se==null&&(se=this.Oa,this.Oa+=1),cd(this.Qa,se)},D.prototype.Gb=function(se){if(se==null&&(se=this.Oa,this.Oa+=1),se=wo(this.Qa,se),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(se)},D.prototype.Hb=function(se){return se==null&&(se=this.Oa,this.Oa+=1),wo(this.Qa,se)},D.prototype.getBlob=function(se){se==null&&(se=this.Oa,this.Oa+=1);var xe=dd(this.Qa,se);se=ud(this.Qa,se);for(var He=new Uint8Array(xe),Xe=0;Xe<xe;Xe+=1)He[Xe]=V[se+Xe];return He},D.prototype.get=function(se,xe){xe=xe||{},se!=null&&this.bind(se)&&this.step(),se=[];for(var He=ld(this.Qa),Xe=0;Xe<He;Xe+=1)switch(md(this.Qa,Xe)){case 1:var tt=xe.useBigInt?this.Gb(Xe):this.wb(Xe);se.push(tt);break;case 2:se.push(this.wb(Xe));break;case 3:se.push(this.Hb(Xe));break;case 4:se.push(this.getBlob(Xe));break;default:se.push(null)}return se},D.prototype.getColumnNames=function(){for(var se=[],xe=od(this.Qa),He=0;He<xe;He+=1)se.push(fd(this.Qa,He));return se},D.prototype.getAsObject=function(se,xe){se=this.get(se,xe),xe=this.getColumnNames();for(var He={},Xe=0;Xe<xe.length;Xe+=1)He[xe[Xe]]=se[Xe];return He},D.prototype.getSQL=function(){return ws(this.Qa)},D.prototype.getNormalizedSQL=function(){return Fi(this.Qa)},D.prototype.run=function(se){return se!=null&&this.bind(se),this.step(),this.reset()},D.prototype.sb=function(se,xe){xe==null&&(xe=this.Oa,this.Oa+=1),se=v(se);var He=Jr(se,Mi);this.lb.push(He),this.db.handleError(Kl(this.Qa,xe,He,se.length-1,0))},D.prototype.Bb=function(se,xe){xe==null&&(xe=this.Oa,this.Oa+=1);var He=Jr(se,Mi);this.lb.push(He),this.db.handleError(Gl(this.Qa,xe,He,se.length,0))},D.prototype.rb=function(se,xe){xe==null&&(xe=this.Oa,this.Oa+=1),this.db.handleError((se===(se|0)?rd:nd)(this.Qa,xe,se))},D.prototype.Eb=function(se){se==null&&(se=this.Oa,this.Oa+=1),Gl(this.Qa,se,0,0,0)},D.prototype.tb=function(se,xe){switch(xe==null&&(xe=this.Oa,this.Oa+=1),typeof se){case"string":this.sb(se,xe);return;case"number":this.rb(se,xe);return;case"bigint":this.sb(se.toString(),xe);return;case"boolean":this.rb(se+0,xe);return;case"object":if(se===null){this.Eb(xe);return}if(se.length!=null){this.Bb(se,xe);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+se+")."},D.prototype.Db=function(se){var xe=this;return Object.keys(se).forEach(function(He){var Xe=vo(xe.Qa,He);Xe!==0&&xe.tb(se[He],Xe)}),!0},D.prototype.Cb=function(se){for(var xe=0;xe<se.length;xe+=1)this.tb(se[xe],xe+1);return!0},D.prototype.reset=function(){return this.freemem(),gd(this.Qa)===0&&Co(this.Qa)===0},D.prototype.freemem=function(){for(var se;(se=this.lb.pop())!==void 0;)$r(se)},D.prototype.free=function(){this.freemem();var se=hd(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,se},F.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=Fn(),xe=wn(4);rt(oe),rt(xe);try{this.db.handleError(Oi(this.db.db,this.kb,-1,oe,xe)),this.kb=ht(xe,"i32");var He=ht(oe,"i32");return He===0?(this.mb(),{done:!0}):(this.Za=new D(He,this.db),this.db.fb[He]=this.Za,{value:this.Za,done:!1})}catch(Xe){throw this.pb=Re(this.kb),this.mb(),Xe}finally{Ya(se)}},F.prototype.mb=function(){$r(this.eb),this.eb=null},F.prototype.getRemainingSQL=function(){return this.pb!==null?this.pb:Re(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(F.prototype[Symbol.iterator]=function(){return this}),J.prototype.run=function(se,xe){if(!this.db)throw"Database closed";if(xe){se=this.prepare(se,xe);try{se.step()}finally{se.free()}}else this.handleError(ct(this.db,se,0,0,oe));return this},J.prototype.exec=function(se,xe,He){if(!this.db)throw"Database closed";var Xe=Fn(),tt=null;try{var Dt=Eo(se),dn=wn(4);for(se=[];ht(Dt,"i8")!==0;){rt(oe),rt(dn),this.handleError(Oi(this.db,Dt,-1,oe,dn));var tn=ht(oe,"i32");if(Dt=ht(dn,"i32"),tn!==0){var Qa=null;for(tt=new D(tn,this),xe!=null&&tt.bind(xe);tt.step();)Qa===null&&(Qa={columns:tt.getColumnNames(),values:[]},se.push(Qa)),Qa.values.push(tt.get(null,He));tt.free()}}return se}catch(an){throw tt&&tt.free(),an}finally{Ya(Xe)}},J.prototype.each=function(se,xe,He,Xe,tt){typeof xe=="function"&&(Xe=He,He=xe,xe=void 0),se=this.prepare(se,xe);try{for(;se.step();)He(se.getAsObject(null,tt))}finally{se.free()}if(typeof Xe=="function")return Xe()},J.prototype.prepare=function(se,xe){if(rt(oe),this.handleError(Ta(this.db,se,-1,oe,0)),se=ht(oe,"i32"),se===0)throw"Nothing to prepare";var He=new D(se,this);return xe!=null&&He.bind(xe),this.fb[se]=He},J.prototype.iterateStatements=function(se){return new F(se,this)},J.prototype.export=function(){Object.values(this.fb).forEach(function(xe){xe.free()}),Object.values(this.Sa).forEach(vn),this.Sa={},this.handleError(gt(this.db));var se=zl(this.filename);return this.handleError(Pe(this.filename,oe)),this.db=ht(oe,"i32"),Jl(this.db),se},J.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(se){se.free()}),Object.values(this.Sa).forEach(vn),this.Sa={},this.Ya&&(vn(this.Ya),this.Ya=void 0),this.handleError(gt(this.db)),Hl("/"+this.filename),this.db=null)},J.prototype.handleError=function(se){if(se===0)return null;throw se=sd(this.db),Error(se)},J.prototype.getRowsModified=function(){return Yt(this.db)},J.prototype.create_function=function(se,xe){Object.prototype.hasOwnProperty.call(this.Sa,se)&&(vn(this.Sa[se]),delete this.Sa[se]);var He=yr(function(Xe,tt,Dt){tt=b(tt,Dt);try{var dn=xe.apply(null,tt)}catch(tn){ei(Xe,tn,-1);return}A(Xe,dn)},"viii");return this.Sa[se]=He,this.handleError(ql(this.db,se,xe.length,1,0,He,0,0,0)),this},J.prototype.create_aggregate=function(se,xe){var He=xe.init||function(){return null},Xe=xe.finalize||function(Qa){return Qa},tt=xe.step;if(!tt)throw"An aggregate function must have a step function in "+se;var Dt={};Object.hasOwnProperty.call(this.Sa,se)&&(vn(this.Sa[se]),delete this.Sa[se]),xe=se+"__finalize",Object.hasOwnProperty.call(this.Sa,xe)&&(vn(this.Sa[xe]),delete this.Sa[xe]);var dn=yr(function(Qa,an,Er){var mn=ti(Qa,1);Object.hasOwnProperty.call(Dt,mn)||(Dt[mn]=He()),an=b(an,Er),an=[Dt[mn]].concat(an);try{Dt[mn]=tt.apply(null,an)}catch(Cd){delete Dt[mn],ei(Qa,Cd,-1)}},"viii"),tn=yr(function(Qa){var an=ti(Qa,1);try{var Er=Xe(Dt[an])}catch(mn){delete Dt[an],ei(Qa,mn,-1);return}A(Qa,Er),delete Dt[an]},"vi");return this.Sa[se]=dn,this.Sa[xe]=tn,this.handleError(ql(this.db,se,tt.length-1,1,0,0,dn,tn,0)),this},J.prototype.updateHook=function(se){this.Ya&&(No(this.db,0,0),vn(this.Ya),this.Ya=void 0),se&&(this.Ya=yr(function(xe,He,Xe,tt,Dt){switch(He){case 18:xe="insert";break;case 23:xe="update";break;case 9:xe="delete";break;default:throw"unknown operationCode in updateHook callback: "+He}if(Xe=Xe?ve(G,Xe):"",tt=tt?ve(G,tt):"",Dt>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";se(xe,Xe,tt,Number(Dt))},"viiiij"),No(this.db,this.Ya,0))},f.Database=J};var I={...f},x="./this.program",T=(A,b)=>{throw b},k="",R,B;if(C){var S=ey;k=__dirname+"/",B=A=>(A=pe(A)?new URL(A):A,S.readFileSync(A)),R=async A=>(A=pe(A)?new URL(A):A,S.readFileSync(A,void 0)),!f.thisProgram&&1<process.argv.length&&(x=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),r.exports=f,T=(A,b)=>{throw process.exitCode=A,b}}else(E||p)&&(p?k=self.location.href:typeof document<"u"&&document.currentScript&&(k=document.currentScript.src),k=k.startsWith("blob:")?"":k.slice(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1),p&&(B=A=>{var b=new XMLHttpRequest;return b.open("GET",A,!1),b.responseType="arraybuffer",b.send(null),new Uint8Array(b.response)}),R=async A=>{if(pe(A))return new Promise((D,F)=>{var J=new XMLHttpRequest;J.open("GET",A,!0),J.responseType="arraybuffer",J.onload=()=>{J.status==200||J.status==0&&J.response?D(J.response):F(J.status)},J.onerror=F,J.send(null)});var b=await fetch(A,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url)});var j=f.print||console.log.bind(console),_=f.printErr||console.error.bind(console);Object.assign(f,I),I=null,f.thisProgram&&(x=f.thisProgram);var P=f.wasmBinary,K,H=!1,Q,V,G,q,W,ne,de,X,ae,pe=A=>A.startsWith("file://");function Ae(){var A=K.buffer;f.HEAP8=V=new Int8Array(A),f.HEAP16=q=new Int16Array(A),f.HEAPU8=G=new Uint8Array(A),f.HEAPU16=new Uint16Array(A),f.HEAP32=W=new Int32Array(A),f.HEAPU32=ne=new Uint32Array(A),f.HEAPF32=de=new Float32Array(A),f.HEAPF64=ae=new Float64Array(A),f.HEAP64=X=new BigInt64Array(A),f.HEAPU64=new BigUint64Array(A)}var O=0,$=null;function Z(A){var b;throw(b=f.onAbort)==null||b.call(f,A),A="Aborted("+A+")",_(A),H=!0,new WebAssembly.RuntimeError(A+". Build with -sASSERTIONS for more info.")}var ce;async function be(A){if(!P)try{var b=await R(A);return new Uint8Array(b)}catch{}if(A==ce&&P)A=new Uint8Array(P);else if(B)A=B(A);else throw"both async and sync fetching of the wasm failed";return A}async function Le(A,b){try{var D=await be(A);return await WebAssembly.instantiate(D,b)}catch(F){_(`failed to asynchronously prepare wasm: ${F}`),Z(F)}}async function ke(A){var b=ce;if(!P&&typeof WebAssembly.instantiateStreaming=="function"&&!pe(b)&&!C)try{var D=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(D,A)}catch(F){_(`wasm streaming compile failed: ${F}`),_("falling back to ArrayBuffer instantiation")}return Le(b,A)}class Se{constructor(b){Fe(this,"name","ExitStatus");this.message=`Program terminated with exit(${b})`,this.status=b}}var Te=A=>{for(;0<A.length;)A.shift()(f)},Oe=[],Ne=[],je=()=>{var A=f.preRun.shift();Ne.unshift(A)};function ht(A,b="i8"){switch(b.endsWith("*")&&(b="*"),b){case"i1":return V[A];case"i8":return V[A];case"i16":return q[A>>1];case"i32":return W[A>>2];case"i64":return X[A>>3];case"float":return de[A>>2];case"double":return ae[A>>3];case"*":return ne[A>>2];default:Z(`invalid type for getValue: ${b}`)}}var Ye=f.noExitRuntime||!0;function rt(A){var b="i32";switch(b.endsWith("*")&&(b="*"),b){case"i1":V[A]=0;break;case"i8":V[A]=0;break;case"i16":q[A>>1]=0;break;case"i32":W[A>>2]=0;break;case"i64":X[A>>3]=BigInt(0);break;case"float":de[A>>2]=0;break;case"double":ae[A>>3]=0;break;case"*":ne[A>>2]=0;break;default:Z(`invalid type for setValue: ${b}`)}}var la=typeof TextDecoder<"u"?new TextDecoder:void 0,ve=(A,b=0,D=NaN)=>{var F=b+D;for(D=b;A[D]&&!(D>=F);)++D;if(16<D-b&&A.buffer&&la)return la.decode(A.subarray(b,D));for(F="";b<D;){var J=A[b++];if(J&128){var oe=A[b++]&63;if((J&224)==192)F+=String.fromCharCode((J&31)<<6|oe);else{var he=A[b++]&63;J=(J&240)==224?(J&15)<<12|oe<<6|he:(J&7)<<18|oe<<12|he<<6|A[b++]&63,65536>J?F+=String.fromCharCode(J):(J-=65536,F+=String.fromCharCode(55296|J>>10,56320|J&1023))}}else F+=String.fromCharCode(J)}return F},Re=(A,b)=>A?ve(G,A,b):"",$e=(A,b)=>{for(var D=0,F=A.length-1;0<=F;F--){var J=A[F];J==="."?A.splice(F,1):J===".."?(A.splice(F,1),D++):D&&(A.splice(F,1),D--)}if(b)for(;D;D--)A.unshift("..");return A},qe=A=>{var b=A.charAt(0)==="/",D=A.slice(-1)==="/";return(A=$e(A.split("/").filter(F=>!!F),!b).join("/"))||b||(A="."),A&&D&&(A+="/"),(b?"/":"")+A},dt=A=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(A).slice(1);return A=b[0],b=b[1],!A&&!b?".":(b&&(b=b.slice(0,-1)),A+b)},Je=A=>A&&A.match(/([^\/]+|\/)\/*$/)[1],At=()=>{if(C){var A=ey;return b=>A.randomFillSync(b)}return b=>crypto.getRandomValues(b)},Ot=A=>{(Ot=At())(A)},Wt=(...A)=>{for(var b="",D=!1,F=A.length-1;-1<=F&&!D;F--){if(D=0<=F?A[F]:"/",typeof D!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!D)return"";b=D+"/"+b,D=D.charAt(0)==="/"}return b=$e(b.split("/").filter(J=>!!J),!D).join("/"),(D?"/":"")+b||"."},Zt=[],ya=A=>{for(var b=0,D=0;D<A.length;++D){var F=A.charCodeAt(D);127>=F?b++:2047>=F?b+=2:55296<=F&&57343>=F?(b+=4,++D):b+=3}return b},U=(A,b,D,F)=>{if(!(0<F))return 0;var J=D;F=D+F-1;for(var oe=0;oe<A.length;++oe){var he=A.charCodeAt(oe);if(55296<=he&&57343>=he){var Pe=A.charCodeAt(++oe);he=65536+((he&1023)<<10)|Pe&1023}if(127>=he){if(D>=F)break;b[D++]=he}else{if(2047>=he){if(D+1>=F)break;b[D++]=192|he>>6}else{if(65535>=he){if(D+2>=F)break;b[D++]=224|he>>12}else{if(D+3>=F)break;b[D++]=240|he>>18,b[D++]=128|he>>12&63}b[D++]=128|he>>6&63}b[D++]=128|he&63}}return b[D]=0,D-J},v=(A,b)=>{var D=Array(ya(A)+1);return A=U(A,D,0,D.length),b&&(D.length=A),D},N=[];function z(A,b){N[A]={input:[],output:[],cb:b},st(A,te)}var te={open(A){var b=N[A.node.rdev];if(!b)throw new _e(43);A.tty=b,A.seekable=!1},close(A){A.tty.cb.fsync(A.tty)},fsync(A){A.tty.cb.fsync(A.tty)},read(A,b,D,F){if(!A.tty||!A.tty.cb.xb)throw new _e(60);for(var J=0,oe=0;oe<F;oe++){try{var he=A.tty.cb.xb(A.tty)}catch{throw new _e(29)}if(he===void 0&&J===0)throw new _e(6);if(he==null)break;J++,b[D+oe]=he}return J&&(A.node.atime=Date.now()),J},write(A,b,D,F){if(!A.tty||!A.tty.cb.qb)throw new _e(60);try{for(var J=0;J<F;J++)A.tty.cb.qb(A.tty,b[D+J])}catch{throw new _e(29)}return F&&(A.node.mtime=A.node.ctime=Date.now()),J}},fe={xb(){e:{if(!Zt.length){var A=null;if(C){var b=Buffer.alloc(256),D=0,F=process.stdin.fd;try{D=S.readSync(F,b,0,256)}catch(J){if(J.toString().includes("EOF"))D=0;else throw J}0<D&&(A=b.slice(0,D).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(A=window.prompt("Input: "),A!==null&&(A+=`
`));if(!A){A=null;break e}Zt=v(A,!0)}A=Zt.shift()}return A},qb(A,b){b===null||b===10?(j(ve(A.output)),A.output=[]):b!=0&&A.output.push(b)},fsync(A){var b;0<((b=A.output)==null?void 0:b.length)&&(j(ve(A.output)),A.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]}},ye={qb(A,b){b===null||b===10?(_(ve(A.output)),A.output=[]):b!=0&&A.output.push(b)},fsync(A){var b;0<((b=A.output)==null?void 0:b.length)&&(_(ve(A.output)),A.output=[])}},De={Wa:null,Xa(){return De.createNode(null,"/",16895,0)},createNode(A,b,D,F){if((D&61440)===24576||(D&61440)===4096)throw new _e(63);return De.Wa||(De.Wa={dir:{node:{Ta:De.La.Ta,Ua:De.La.Ua,lookup:De.La.lookup,hb:De.La.hb,rename:De.La.rename,unlink:De.La.unlink,rmdir:De.La.rmdir,readdir:De.La.readdir,symlink:De.La.symlink},stream:{Va:De.Ma.Va}},file:{node:{Ta:De.La.Ta,Ua:De.La.Ua},stream:{Va:De.Ma.Va,read:De.Ma.read,write:De.Ma.write,ib:De.Ma.ib,jb:De.Ma.jb}},link:{node:{Ta:De.La.Ta,Ua:De.La.Ua,readlink:De.La.readlink},stream:{}},ub:{node:{Ta:De.La.Ta,Ua:De.La.Ua},stream:it}}),D=Ea(A,b,D,F),Gt(D.mode)?(D.La=De.Wa.dir.node,D.Ma=De.Wa.dir.stream,D.Na={}):(D.mode&61440)===32768?(D.La=De.Wa.file.node,D.Ma=De.Wa.file.stream,D.Ra=0,D.Na=null):(D.mode&61440)===40960?(D.La=De.Wa.link.node,D.Ma=De.Wa.link.stream):(D.mode&61440)===8192&&(D.La=De.Wa.ub.node,D.Ma=De.Wa.ub.stream),D.atime=D.mtime=D.ctime=Date.now(),A&&(A.Na[b]=D,A.atime=A.mtime=A.ctime=D.atime),D},Sb(A){return A.Na?A.Na.subarray?A.Na.subarray(0,A.Ra):new Uint8Array(A.Na):new Uint8Array(0)},La:{Ta(A){var b={};return b.dev=(A.mode&61440)===8192?A.id:1,b.ino=A.id,b.mode=A.mode,b.nlink=1,b.uid=0,b.gid=0,b.rdev=A.rdev,Gt(A.mode)?b.size=4096:(A.mode&61440)===32768?b.size=A.Ra:(A.mode&61440)===40960?b.size=A.link.length:b.size=0,b.atime=new Date(A.atime),b.mtime=new Date(A.mtime),b.ctime=new Date(A.ctime),b.blksize=4096,b.blocks=Math.ceil(b.size/b.blksize),b},Ua(A,b){for(var D of["mode","atime","mtime","ctime"])b[D]!=null&&(A[D]=b[D]);b.size!==void 0&&(b=b.size,A.Ra!=b&&(b==0?(A.Na=null,A.Ra=0):(D=A.Na,A.Na=new Uint8Array(b),D&&A.Na.set(D.subarray(0,Math.min(b,A.Ra))),A.Ra=b)))},lookup(){throw De.vb},hb(A,b,D,F){return De.createNode(A,b,D,F)},rename(A,b,D){try{var F=Kt(b,D)}catch{}if(F){if(Gt(A.mode))for(var J in F.Na)throw new _e(55);qa(F)}delete A.parent.Na[A.name],b.Na[D]=A,A.name=D,b.ctime=b.mtime=A.parent.ctime=A.parent.mtime=Date.now()},unlink(A,b){delete A.Na[b],A.ctime=A.mtime=Date.now()},rmdir(A,b){var D=Kt(A,b),F;for(F in D.Na)throw new _e(55);delete A.Na[b],A.ctime=A.mtime=Date.now()},readdir(A){return[".","..",...Object.keys(A.Na)]},symlink(A,b,D){return A=De.createNode(A,b,41471,0),A.link=D,A},readlink(A){if((A.mode&61440)!==40960)throw new _e(28);return A.link}},Ma:{read(A,b,D,F,J){var oe=A.node.Na;if(J>=A.node.Ra)return 0;if(A=Math.min(A.node.Ra-J,F),8<A&&oe.subarray)b.set(oe.subarray(J,J+A),D);else for(F=0;F<A;F++)b[D+F]=oe[J+F];return A},write(A,b,D,F,J,oe){if(b.buffer===V.buffer&&(oe=!1),!F)return 0;if(A=A.node,A.mtime=A.ctime=Date.now(),b.subarray&&(!A.Na||A.Na.subarray)){if(oe)return A.Na=b.subarray(D,D+F),A.Ra=F;if(A.Ra===0&&J===0)return A.Na=b.slice(D,D+F),A.Ra=F;if(J+F<=A.Ra)return A.Na.set(b.subarray(D,D+F),J),F}oe=J+F;var he=A.Na?A.Na.length:0;if(he>=oe||(oe=Math.max(oe,he*(1048576>he?2:1.125)>>>0),he!=0&&(oe=Math.max(oe,256)),he=A.Na,A.Na=new Uint8Array(oe),0<A.Ra&&A.Na.set(he.subarray(0,A.Ra),0)),A.Na.subarray&&b.subarray)A.Na.set(b.subarray(D,D+F),J);else for(oe=0;oe<F;oe++)A.Na[J+oe]=b[D+oe];return A.Ra=Math.max(A.Ra,J+F),F},Va(A,b,D){if(D===1?b+=A.position:D===2&&(A.node.mode&61440)===32768&&(b+=A.node.Ra),0>b)throw new _e(28);return b},ib(A,b,D,F,J){if((A.node.mode&61440)!==32768)throw new _e(43);if(A=A.node.Na,J&2||!A||A.buffer!==V.buffer){J=!0,F=65536*Math.ceil(b/65536);var oe=Io(65536,F);if(oe&&G.fill(0,oe,oe+F),F=oe,!F)throw new _e(48);A&&((0<D||D+b<A.length)&&(A.subarray?A=A.subarray(D,D+b):A=Array.prototype.slice.call(A,D,D+b)),V.set(A,F))}else J=!1,F=A.byteOffset;return{Kb:F,Ab:J}},jb(A,b,D,F){return De.Ma.write(A,b,0,F,D,!1),0}}},Nt=(A,b)=>{var D=0;return A&&(D|=365),b&&(D|=146),D},xt=null,St={},mt=[],Vr=1,ca=null,Mn=!1,Gn=!0,gs={},_e=class{constructor(A){Fe(this,"name","ErrnoError");this.Pa=A}},hs=class{constructor(){Fe(this,"gb",{});Fe(this,"node",null)}get flags(){return this.gb.flags}set flags(A){this.gb.flags=A}get position(){return this.gb.position}set position(A){this.gb.position=A}},Di=class{constructor(A,b,D,F){Fe(this,"La",{});Fe(this,"Ma",{});Fe(this,"ab",null);A||(A=this),this.parent=A,this.Xa=A.Xa,this.id=Vr++,this.name=b,this.mode=D,this.rdev=F,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(A){A?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(A){A?this.mode|=146:this.mode&=-147}};function xa(A,b={}){if(!A)throw new _e(44);b.nb??(b.nb=!0),A.charAt(0)==="/"||(A="//"+A);var D=0;e:for(;40>D;D++){A=A.split("/").filter(Pe=>!!Pe);for(var F=xt,J="/",oe=0;oe<A.length;oe++){var he=oe===A.length-1;if(he&&b.parent)break;if(A[oe]!==".")if(A[oe]==="..")J=dt(J),F=F.parent;else{J=qe(J+"/"+A[oe]);try{F=Kt(F,A[oe])}catch(Pe){if((Pe==null?void 0:Pe.Pa)===44&&he&&b.Jb)return{path:J};throw Pe}if(!F.ab||he&&!b.nb||(F=F.ab.root),(F.mode&61440)===40960&&(!he||b.$a)){if(!F.La.readlink)throw new _e(52);F=F.La.readlink(F),F.charAt(0)==="/"||(F=dt(J)+"/"+F),A=F+"/"+A.slice(oe+1).join("/");continue e}}}return{path:J,node:F}}throw new _e(32)}function dr(A){for(var b;;){if(A===A.parent)return A=A.Xa.zb,b?A[A.length-1]!=="/"?`${A}/${b}`:A+b:A;b=b?`${A.name}/${b}`:A.name,A=A.parent}}function Kr(A,b){for(var D=0,F=0;F<b.length;F++)D=(D<<5)-D+b.charCodeAt(F)|0;return(A+D>>>0)%ca.length}function qa(A){var b=Kr(A.parent.id,A.name);if(ca[b]===A)ca[b]=A.bb;else for(b=ca[b];b;){if(b.bb===A){b.bb=A.bb;break}b=b.bb}}function Kt(A,b){var D=Gt(A.mode)?(D=qn(A,"x"))?D:A.La.lookup?0:2:54;if(D)throw new _e(D);for(D=ca[Kr(A.id,b)];D;D=D.bb){var F=D.name;if(D.parent.id===A.id&&F===b)return D}return A.La.lookup(A,b)}function Ea(A,b,D,F){return A=new Di(A,b,D,F),b=Kr(A.parent.id,A.name),A.bb=ca[b],ca[b]=A}function Gt(A){return(A&61440)===16384}function Gr(A){var b=["r","w","rw"][A&3];return A&512&&(b+="w"),b}function qn(A,b){if(Gn)return 0;if(!b.includes("r")||A.mode&292){if(b.includes("w")&&!(A.mode&146)||b.includes("x")&&!(A.mode&73))return 2}else return 2;return 0}function As(A,b){if(!Gt(A.mode))return 54;try{return Kt(A,b),20}catch{}return qn(A,"wx")}function ie(A,b,D){try{var F=Kt(A,b)}catch(J){return J.Pa}if(A=qn(A,"wx"))return A;if(D){if(!Gt(F.mode))return 54;if(F===F.parent||dr(F)==="/")return 10}else if(Gt(F.mode))return 31;return 0}function Ue(A){if(!A)throw new _e(63);return A}function Be(A){if(A=mt[A],!A)throw new _e(8);return A}function Ze(A,b=-1){if(A=Object.assign(new hs,A),b==-1)e:{for(b=0;4096>=b;b++)if(!mt[b])break e;throw new _e(33)}return A.fd=b,mt[b]=A}function Tt(A,b=-1){var D,F;return A=Ze(A,b),(F=(D=A.Ma)==null?void 0:D.Rb)==null||F.call(D,A),A}function yt(A,b,D){var F=A==null?void 0:A.Ma.Ua;A=F?A:b,F??(F=b.La.Ua),Ue(F),F(A,D)}var it={open(A){var b,D;A.Ma=St[A.node.rdev].Ma,(D=(b=A.Ma).open)==null||D.call(b,A)},Va(){throw new _e(70)}};function st(A,b){St[A]={Ma:b}}function un(A,b){var D=b==="/";if(D&&xt)throw new _e(10);if(!D&&b){var F=xa(b,{nb:!1});if(b=F.path,F=F.node,F.ab)throw new _e(10);if(!Gt(F.mode))throw new _e(54)}b={type:A,Wb:{},zb:b,Ib:[]},A=A.Xa(b),A.Xa=b,b.root=A,D?xt=A:F&&(F.ab=b,F.Xa&&F.Xa.Ib.push(b))}function Ut(A,b,D){var F=xa(A,{parent:!0}).node;if(A=Je(A),!A)throw new _e(28);if(A==="."||A==="..")throw new _e(20);var J=As(F,A);if(J)throw new _e(J);if(!F.La.hb)throw new _e(63);return F.La.hb(F,A,b,D)}function Wa(A,b=438){return Ut(A,b&4095|32768,0)}function ra(A,b=511){return Ut(A,b&1023|16384,0)}function qr(A,b,D){typeof D>"u"&&(D=b,b=438),Ut(A,b|8192,D)}function mr(A,b){if(!Wt(A))throw new _e(44);var D=xa(b,{parent:!0}).node;if(!D)throw new _e(44);b=Je(b);var F=As(D,b);if(F)throw new _e(F);if(!D.La.symlink)throw new _e(63);D.La.symlink(D,b,A)}function Bi(A){var b=xa(A,{parent:!0}).node;A=Je(A);var D=Kt(b,A),F=ie(b,A,!0);if(F)throw new _e(F);if(!b.La.rmdir)throw new _e(63);if(D.ab)throw new _e(10);b.La.rmdir(b,A),qa(D)}function Hl(A){var b=xa(A,{parent:!0}).node;if(!b)throw new _e(44);A=Je(A);var D=Kt(b,A),F=ie(b,A,!1);if(F)throw new _e(F);if(!b.La.unlink)throw new _e(63);if(D.ab)throw new _e(10);b.La.unlink(b,A),qa(D)}function Wn(A,b){return A=xa(A,{$a:!b}).node,Ue(A.La.Ta)(A)}function Ui(A,b,D,F){yt(A,b,{mode:D&4095|b.mode&-4096,ctime:Date.now(),Fb:F})}function $a(A,b){A=typeof A=="string"?xa(A,{$a:!0}).node:A,Ui(null,A,b)}function ps(A,b,D){if(Gt(b.mode))throw new _e(31);if((b.mode&61440)!==32768)throw new _e(28);var F=qn(b,"w");if(F)throw new _e(F);yt(A,b,{size:D,timestamp:Date.now()})}function fr(A,b,D=438){if(A==="")throw new _e(44);if(typeof b=="string"){var F={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if(typeof F>"u")throw Error(`Unknown file open mode: ${b}`);b=F}if(D=b&64?D&4095|32768:0,typeof A=="object")F=A;else{var J=A.endsWith("/");A=xa(A,{$a:!(b&131072),Jb:!0}),F=A.node,A=A.path}var oe=!1;if(b&64)if(F){if(b&128)throw new _e(20)}else{if(J)throw new _e(31);F=Ut(A,D|511,0),oe=!0}if(!F)throw new _e(44);if((F.mode&61440)===8192&&(b&=-513),b&65536&&!Gt(F.mode))throw new _e(54);if(!oe&&(J=F?(F.mode&61440)===40960?32:Gt(F.mode)&&(Gr(b)!=="r"||b&576)?31:qn(F,Gr(b)):44))throw new _e(J);return b&512&&!oe&&(J=F,J=typeof J=="string"?xa(J,{$a:!0}).node:J,ps(null,J,0)),b&=-131713,J=Ze({node:F,path:dr(F),flags:b,seekable:!0,position:0,Ma:F.Ma,Lb:[],error:!1}),J.Ma.open&&J.Ma.open(J),oe&&$a(F,D&511),!f.logReadFiles||b&1||A in gs||(gs[A]=1),J}function Yn(A){if(A.fd===null)throw new _e(8);A.ob&&(A.ob=null);try{A.Ma.close&&A.Ma.close(A)}catch(b){throw b}finally{mt[A.fd]=null}A.fd=null}function ys(A,b,D){if(A.fd===null)throw new _e(8);if(!A.seekable||!A.Ma.Va)throw new _e(70);if(D!=0&&D!=1&&D!=2)throw new _e(28);A.position=A.Ma.Va(A,b,D),A.Lb=[]}function Es(A,b,D,F,J){if(0>F||0>J)throw new _e(28);if(A.fd===null)throw new _e(8);if((A.flags&2097155)===1)throw new _e(8);if(Gt(A.node.mode))throw new _e(31);if(!A.Ma.read)throw new _e(28);var oe=typeof J<"u";if(!oe)J=A.position;else if(!A.seekable)throw new _e(70);return b=A.Ma.read(A,b,D,F,J),oe||(A.position+=b),b}function Ql(A,b,D,F,J){if(0>F||0>J)throw new _e(28);if(A.fd===null)throw new _e(8);if((A.flags&2097155)===0)throw new _e(8);if(Gt(A.node.mode))throw new _e(31);if(!A.Ma.write)throw new _e(28);A.seekable&&A.flags&1024&&ys(A,0,2);var oe=typeof J<"u";if(!oe)J=A.position;else if(!A.seekable)throw new _e(70);return b=A.Ma.write(A,b,D,F,J,void 0),oe||(A.position+=b),b}function zl(A){var b,D=fr(A,D||0);A=Wn(A).size;var F=new Uint8Array(A);return Es(D,F,0,A,0),b=F,Yn(D),b}function ua(A,b,D){A=qe("/dev/"+A);var F=Nt(!!b,!!D);ua.yb??(ua.yb=64);var J=ua.yb++<<8|0;st(J,{open(oe){oe.seekable=!1},close(){var oe;(oe=D==null?void 0:D.buffer)!=null&&oe.length&&D(10)},read(oe,he,Pe,gt){for(var ct=0,Yt=0;Yt<gt;Yt++){try{var Ta=b()}catch{throw new _e(29)}if(Ta===void 0&&ct===0)throw new _e(6);if(Ta==null)break;ct++,he[Pe+Yt]=Ta}return ct&&(oe.node.atime=Date.now()),ct},write(oe,he,Pe,gt){for(var ct=0;ct<gt;ct++)try{D(he[Pe+ct])}catch{throw new _e(29)}return gt&&(oe.node.mtime=oe.node.ctime=Date.now()),ct}}),qr(A,F,J)}var jt={};function gr(A,b,D){if(b.charAt(0)==="/")return b;if(A=A===-100?"/":Be(A).path,b.length==0){if(!D)throw new _e(44);return A}return A+"/"+b}function hr(A,b){W[A>>2]=b.dev,W[A+4>>2]=b.mode,ne[A+8>>2]=b.nlink,W[A+12>>2]=b.uid,W[A+16>>2]=b.gid,W[A+20>>2]=b.rdev,X[A+24>>3]=BigInt(b.size),W[A+32>>2]=4096,W[A+36>>2]=b.blocks;var D=b.atime.getTime(),F=b.mtime.getTime(),J=b.ctime.getTime();return X[A+40>>3]=BigInt(Math.floor(D/1e3)),ne[A+48>>2]=D%1e3*1e6,X[A+56>>3]=BigInt(Math.floor(F/1e3)),ne[A+64>>2]=F%1e3*1e6,X[A+72>>3]=BigInt(Math.floor(J/1e3)),ne[A+80>>2]=J%1e3*1e6,X[A+88>>3]=BigInt(b.ino),0}var _i=void 0,Ar=()=>{var A=W[+_i>>2];return _i+=4,A},Ao=0,Za=[0,31,60,91,121,152,182,213,244,274,305,335],po=[0,31,59,90,120,151,181,212,243,273,304,334],Wr={},bs=A=>{var b;Q=A,Ye||0<Ao||((b=f.onExit)==null||b.call(f,A),H=!0),T(A,new Se(A))},Yr=A=>{if(!H)try{if(A(),!(Ye||0<Ao))try{Q=A=Q,bs(A)}catch(b){b instanceof Se||b=="unwind"||T(1,b)}}catch(b){b instanceof Se||b=="unwind"||T(1,b)}},Is={},yo=()=>{if(!Jn){var A={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",_:x||"./this.program"},b;for(b in Is)Is[b]===void 0?delete A[b]:A[b]=Is[b];var D=[];for(b in A)D.push(`${b}=${A[b]}`);Jn=D}return Jn},Jn,Eo=A=>{var b=ya(A)+1,D=wn(b);return U(A,G,D,b),D},Vl=(A,b,D,F)=>{var J={string:ct=>{var Yt=0;return ct!=null&&ct!==0&&(Yt=Eo(ct)),Yt},array:ct=>{var Yt=wn(ct.length);return V.set(ct,Yt),Yt}};A=f["_"+A];var oe=[],he=0;if(F)for(var Pe=0;Pe<F.length;Pe++){var gt=J[D[Pe]];gt?(he===0&&(he=Fn()),oe[Pe]=gt(F[Pe])):oe[Pe]=F[Pe]}return D=A(...oe),D=function(ct){return he!==0&&Ya(he),b==="string"?ct?ve(G,ct):"":b==="boolean"?!!ct:ct}(D)},Mi=0,Jr=(A,b)=>(b=b==1?wn(A.length):vs(A.length),A.subarray||A.slice||(A=new Uint8Array(A)),G.set(A,b),b),pr,bo=[],en,vn=A=>{pr.delete(en.get(A)),en.set(A,null),bo.push(A)},yr=(A,b)=>{if(!pr){pr=new WeakMap;var D=en.length;if(pr)for(var F=0;F<0+D;F++){var J=en.get(F);J&&pr.set(J,F)}}if(D=pr.get(A)||0)return D;if(bo.length)D=bo.pop();else{try{en.grow(1)}catch(gt){throw gt instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":gt}D=en.length-1}try{en.set(D,A)}catch(gt){if(!(gt instanceof TypeError))throw gt;if(typeof WebAssembly.Function=="function"){var oe=WebAssembly.Function;F={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},J={parameters:[],results:b[0]=="v"?[]:[F[b[0]]]};for(var he=1;he<b.length;++he)J.parameters.push(F[b[he]]);b=new oe(J,A)}else{F=[1],J=b.slice(0,1),b=b.slice(1),he={i:127,p:127,j:126,f:125,d:124,e:111},F.push(96);var Pe=b.length;128>Pe?F.push(Pe):F.push(Pe%128|128,Pe>>7);for(oe of b)F.push(he[oe]);J=="v"?F.push(0):F.push(1,he[J]),b=[0,97,115,109,1,0,0,0,1],oe=F.length,128>oe?b.push(oe):b.push(oe%128|128,oe>>7),b.push(...F),b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),b=new WebAssembly.Module(new Uint8Array(b)),b=new WebAssembly.Instance(b,{e:{f:A}}).exports.f}en.set(D,b)}return pr.set(A,D),D};ca=Array(4096),un(De,"/"),ra("/tmp"),ra("/home"),ra("/home/web_user"),function(){ra("/dev"),st(259,{read:()=>0,write:(F,J,oe,he)=>he,Va:()=>0}),qr("/dev/null",259),z(1280,fe),z(1536,ye),qr("/dev/tty",1280),qr("/dev/tty1",1536);var A=new Uint8Array(1024),b=0,D=()=>(b===0&&(Ot(A),b=A.byteLength),A[--b]);ua("random",D),ua("urandom",D),ra("/dev/shm"),ra("/dev/shm/tmp")}(),function(){ra("/proc");var A=ra("/proc/self");ra("/proc/self/fd"),un({Xa(){var b=Ea(A,"fd",16895,73);return b.Ma={Va:De.Ma.Va},b.La={lookup(D,F){D=+F;var J=Be(D);return D={parent:null,Xa:{zb:"fake"},La:{readlink:()=>J.path},id:D+1},D.parent=D},readdir(){return Array.from(mt.entries()).filter(([,D])=>D).map(([D])=>D.toString())}},b}},"/proc/self/fd")}(),De.vb=new _e(44),De.vb.stack="<generic error, no stack>";var Xr={a:(A,b,D,F)=>Z(`Assertion failed: ${A?ve(G,A):""}, at: `+[b?b?ve(G,b):"":"unknown filename",D,F?F?ve(G,F):"":"unknown function"]),i:function(A,b){try{return A=A?ve(G,A):"",$a(A,b),0}catch(D){if(typeof jt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},L:function(A,b,D){try{if(b=b?ve(G,b):"",b=gr(A,b),D&-8)return-28;var F=xa(b,{$a:!0}).node;return F?(A="",D&4&&(A+="r"),D&2&&(A+="w"),D&1&&(A+="x"),A&&qn(F,A)?-2:0):-44}catch(J){if(typeof jt>"u"||J.name!=="ErrnoError")throw J;return-J.Pa}},j:function(A,b){try{var D=Be(A);return Ui(D,D.node,b,!1),0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},h:function(A){try{var b=Be(A);return yt(b,b.node,{timestamp:Date.now(),Fb:!1}),0}catch(D){if(typeof jt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},b:function(A,b,D){_i=D;try{var F=Be(A);switch(b){case 0:var J=Ar();if(0>J)break;for(;mt[J];)J++;return Tt(F,J).fd;case 1:case 2:return 0;case 3:return F.flags;case 4:return J=Ar(),F.flags|=J,0;case 12:return J=Ar(),q[J+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(oe){if(typeof jt>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},g:function(A,b){try{var D=Be(A),F=D.node,J=D.Ma.Ta;A=J?D:F,J??(J=F.La.Ta),Ue(J);var oe=J(A);return hr(b,oe)}catch(he){if(typeof jt>"u"||he.name!=="ErrnoError")throw he;return-he.Pa}},H:function(A,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var D=Be(A);if(0>b||(D.flags&2097155)===0)throw new _e(28);return ps(D,D.node,b),0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},G:function(A,b){try{if(b===0)return-28;var D=ya("/")+1;return b<D?-68:(U("/",G,A,b),D)}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},K:function(A,b){try{return A=A?ve(G,A):"",hr(b,Wn(A,!0))}catch(D){if(typeof jt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},C:function(A,b,D){try{return b=b?ve(G,b):"",b=gr(A,b),ra(b,D),0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},J:function(A,b,D,F){try{b=b?ve(G,b):"";var J=F&256;return b=gr(A,b,F&4096),hr(D,J?Wn(b,!0):Wn(b))}catch(oe){if(typeof jt>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},x:function(A,b,D,F){_i=F;try{b=b?ve(G,b):"",b=gr(A,b);var J=F?Ar():0;return fr(b,D,J).fd}catch(oe){if(typeof jt>"u"||oe.name!=="ErrnoError")throw oe;return-oe.Pa}},v:function(A,b,D,F){try{if(b=b?ve(G,b):"",b=gr(A,b),0>=F)return-28;var J=xa(b).node;if(!J)throw new _e(44);if(!J.La.readlink)throw new _e(28);var oe=J.La.readlink(J),he=Math.min(F,ya(oe)),Pe=V[D+he];return U(oe,G,D,F+1),V[D+he]=Pe,he}catch(gt){if(typeof jt>"u"||gt.name!=="ErrnoError")throw gt;return-gt.Pa}},u:function(A){try{return A=A?ve(G,A):"",Bi(A),0}catch(b){if(typeof jt>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},f:function(A,b){try{return A=A?ve(G,A):"",hr(b,Wn(A))}catch(D){if(typeof jt>"u"||D.name!=="ErrnoError")throw D;return-D.Pa}},r:function(A,b,D){try{return b=b?ve(G,b):"",b=gr(A,b),D===0?Hl(b):D===512?Bi(b):Z("Invalid flags passed to unlinkat"),0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return-F.Pa}},q:function(A,b,D){try{b=b?ve(G,b):"",b=gr(A,b,!0);var F=Date.now(),J,oe;if(D){var he=ne[D>>2]+4294967296*W[D+4>>2],Pe=W[D+8>>2];Pe==1073741823?J=F:Pe==1073741822?J=null:J=1e3*he+Pe/1e6,D+=16,he=ne[D>>2]+4294967296*W[D+4>>2],Pe=W[D+8>>2],Pe==1073741823?oe=F:Pe==1073741822?oe=null:oe=1e3*he+Pe/1e6}else oe=J=F;if((oe??J)!==null){A=J;var gt=xa(b,{$a:!0}).node;Ue(gt.La.Ua)(gt,{atime:A,mtime:oe})}return 0}catch(ct){if(typeof jt>"u"||ct.name!=="ErrnoError")throw ct;return-ct.Pa}},m:()=>Z(""),l:()=>{Ye=!1,Ao=0},A:function(A,b){A=-9007199254740992>A||9007199254740992<A?NaN:Number(A),A=new Date(1e3*A),W[b>>2]=A.getSeconds(),W[b+4>>2]=A.getMinutes(),W[b+8>>2]=A.getHours(),W[b+12>>2]=A.getDate(),W[b+16>>2]=A.getMonth(),W[b+20>>2]=A.getFullYear()-1900,W[b+24>>2]=A.getDay();var D=A.getFullYear();W[b+28>>2]=(D%4!==0||D%100===0&&D%400!==0?po:Za)[A.getMonth()]+A.getDate()-1|0,W[b+36>>2]=-(60*A.getTimezoneOffset()),D=new Date(A.getFullYear(),6,1).getTimezoneOffset();var F=new Date(A.getFullYear(),0,1).getTimezoneOffset();W[b+32>>2]=(D!=F&&A.getTimezoneOffset()==Math.min(F,D))|0},y:function(A,b,D,F,J,oe,he){J=-9007199254740992>J||9007199254740992<J?NaN:Number(J);try{if(isNaN(J))return 61;var Pe=Be(F);if((b&2)!==0&&(D&2)===0&&(Pe.flags&2097155)!==2)throw new _e(2);if((Pe.flags&2097155)===1)throw new _e(2);if(!Pe.Ma.ib)throw new _e(43);if(!A)throw new _e(28);var gt=Pe.Ma.ib(Pe,A,J,b,D),ct=gt.Kb;return W[oe>>2]=gt.Ab,ne[he>>2]=ct,0}catch(Yt){if(typeof jt>"u"||Yt.name!=="ErrnoError")throw Yt;return-Yt.Pa}},z:function(A,b,D,F,J,oe){oe=-9007199254740992>oe||9007199254740992<oe?NaN:Number(oe);try{var he=Be(J);if(D&2){if(D=oe,(he.node.mode&61440)!==32768)throw new _e(43);if(!(F&2)){var Pe=G.slice(A,A+b);he.Ma.jb&&he.Ma.jb(he,Pe,D,b,F)}}}catch(gt){if(typeof jt>"u"||gt.name!=="ErrnoError")throw gt;return-gt.Pa}},n:(A,b)=>{if(Wr[A]&&(clearTimeout(Wr[A].id),delete Wr[A]),!b)return 0;var D=setTimeout(()=>{delete Wr[A],Yr(()=>Zr(A,performance.now()))},b);return Wr[A]={id:D,Xb:b},0},B:(A,b,D,F)=>{var J=new Date().getFullYear(),oe=new Date(J,0,1).getTimezoneOffset();J=new Date(J,6,1).getTimezoneOffset(),ne[A>>2]=60*Math.max(oe,J),W[b>>2]=+(oe!=J),b=he=>{var Pe=Math.abs(he);return`UTC${0<=he?"-":"+"}${String(Math.floor(Pe/60)).padStart(2,"0")}${String(Pe%60).padStart(2,"0")}`},A=b(oe),b=b(J),J<oe?(U(A,G,D,17),U(b,G,F,17)):(U(A,G,F,17),U(b,G,D,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:A=>{var b=G.length;if(A>>>=0,2147483648<A)return!1;for(var D=1;4>=D;D*=2){var F=b*(1+.2/D);F=Math.min(F,A+100663296);e:{F=(Math.min(2147483648,65536*Math.ceil(Math.max(A,F)/65536))-K.buffer.byteLength+65535)/65536|0;try{K.grow(F),Ae();var J=1;break e}catch{}J=void 0}if(J)return!0}return!1},E:(A,b)=>{var D=0;return yo().forEach((F,J)=>{var oe=b+D;for(J=ne[A+4*J>>2]=oe,oe=0;oe<F.length;++oe)V[J++]=F.charCodeAt(oe);V[J]=0,D+=F.length+1}),0},F:(A,b)=>{var D=yo();ne[A>>2]=D.length;var F=0;return D.forEach(J=>F+=J.length+1),ne[b>>2]=F,0},e:function(A){try{var b=Be(A);return Yn(b),0}catch(D){if(typeof jt>"u"||D.name!=="ErrnoError")throw D;return D.Pa}},p:function(A,b){try{var D=Be(A);return V[b]=D.tty?2:Gt(D.mode)?3:(D.mode&61440)===40960?7:4,q[b+2>>1]=0,X[b+8>>3]=BigInt(0),X[b+16>>3]=BigInt(0),0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return F.Pa}},w:function(A,b,D,F){try{e:{var J=Be(A);A=b;for(var oe,he=b=0;he<D;he++){var Pe=ne[A>>2],gt=ne[A+4>>2];A+=8;var ct=Es(J,V,Pe,gt,oe);if(0>ct){var Yt=-1;break e}if(b+=ct,ct<gt)break;typeof oe<"u"&&(oe+=ct)}Yt=b}return ne[F>>2]=Yt,0}catch(Ta){if(typeof jt>"u"||Ta.name!=="ErrnoError")throw Ta;return Ta.Pa}},D:function(A,b,D,F){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var J=Be(A);return ys(J,b,D),X[F>>3]=BigInt(J.position),J.ob&&b===0&&D===0&&(J.ob=null),0}catch(oe){if(typeof jt>"u"||oe.name!=="ErrnoError")throw oe;return oe.Pa}},I:function(A){var D;try{var b=Be(A);return(D=b.Ma)!=null&&D.fsync?b.Ma.fsync(b):0}catch(F){if(typeof jt>"u"||F.name!=="ErrnoError")throw F;return F.Pa}},t:function(A,b,D,F){try{e:{var J=Be(A);A=b;for(var oe,he=b=0;he<D;he++){var Pe=ne[A>>2],gt=ne[A+4>>2];A+=8;var ct=Ql(J,V,Pe,gt,oe);if(0>ct){var Yt=-1;break e}if(b+=ct,ct<gt)break;typeof oe<"u"&&(oe+=ct)}Yt=b}return ne[F>>2]=Yt,0}catch(Ta){if(typeof jt>"u"||Ta.name!=="ErrnoError")throw Ta;return Ta.Pa}},k:bs},Ve;(async function(){var D;function A(F){var J;return Ve=F.exports,K=Ve.M,Ae(),en=Ve.O,O--,(J=f.monitorRunDependencies)==null||J.call(f,O),O==0&&$&&(F=$,$=null,F()),Ve}O++,(D=f.monitorRunDependencies)==null||D.call(f,O);var b={a:Xr};return f.instantiateWasm?new Promise(F=>{f.instantiateWasm(b,(J,oe)=>{A(J),F(J.exports)})}):(ce??(ce=f.locateFile?f.locateFile("sql-wasm.wasm",k):k+"sql-wasm.wasm"),A((await ke(b)).instance))})(),f._sqlite3_free=A=>(f._sqlite3_free=Ve.P)(A),f._sqlite3_value_text=A=>(f._sqlite3_value_text=Ve.Q)(A),f._sqlite3_prepare_v2=(A,b,D,F,J)=>(f._sqlite3_prepare_v2=Ve.R)(A,b,D,F,J),f._sqlite3_step=A=>(f._sqlite3_step=Ve.S)(A),f._sqlite3_reset=A=>(f._sqlite3_reset=Ve.T)(A),f._sqlite3_exec=(A,b,D,F,J)=>(f._sqlite3_exec=Ve.U)(A,b,D,F,J),f._sqlite3_finalize=A=>(f._sqlite3_finalize=Ve.V)(A),f._sqlite3_column_name=(A,b)=>(f._sqlite3_column_name=Ve.W)(A,b),f._sqlite3_column_text=(A,b)=>(f._sqlite3_column_text=Ve.X)(A,b),f._sqlite3_column_type=(A,b)=>(f._sqlite3_column_type=Ve.Y)(A,b),f._sqlite3_errmsg=A=>(f._sqlite3_errmsg=Ve.Z)(A),f._sqlite3_clear_bindings=A=>(f._sqlite3_clear_bindings=Ve._)(A),f._sqlite3_value_blob=A=>(f._sqlite3_value_blob=Ve.$)(A),f._sqlite3_value_bytes=A=>(f._sqlite3_value_bytes=Ve.aa)(A),f._sqlite3_value_double=A=>(f._sqlite3_value_double=Ve.ba)(A),f._sqlite3_value_int=A=>(f._sqlite3_value_int=Ve.ca)(A),f._sqlite3_value_type=A=>(f._sqlite3_value_type=Ve.da)(A),f._sqlite3_result_blob=(A,b,D,F)=>(f._sqlite3_result_blob=Ve.ea)(A,b,D,F),f._sqlite3_result_double=(A,b)=>(f._sqlite3_result_double=Ve.fa)(A,b),f._sqlite3_result_error=(A,b,D)=>(f._sqlite3_result_error=Ve.ga)(A,b,D),f._sqlite3_result_int=(A,b)=>(f._sqlite3_result_int=Ve.ha)(A,b),f._sqlite3_result_int64=(A,b)=>(f._sqlite3_result_int64=Ve.ia)(A,b),f._sqlite3_result_null=A=>(f._sqlite3_result_null=Ve.ja)(A),f._sqlite3_result_text=(A,b,D,F)=>(f._sqlite3_result_text=Ve.ka)(A,b,D,F),f._sqlite3_aggregate_context=(A,b)=>(f._sqlite3_aggregate_context=Ve.la)(A,b),f._sqlite3_column_count=A=>(f._sqlite3_column_count=Ve.ma)(A),f._sqlite3_data_count=A=>(f._sqlite3_data_count=Ve.na)(A),f._sqlite3_column_blob=(A,b)=>(f._sqlite3_column_blob=Ve.oa)(A,b),f._sqlite3_column_bytes=(A,b)=>(f._sqlite3_column_bytes=Ve.pa)(A,b),f._sqlite3_column_double=(A,b)=>(f._sqlite3_column_double=Ve.qa)(A,b),f._sqlite3_bind_blob=(A,b,D,F,J)=>(f._sqlite3_bind_blob=Ve.ra)(A,b,D,F,J),f._sqlite3_bind_double=(A,b,D)=>(f._sqlite3_bind_double=Ve.sa)(A,b,D),f._sqlite3_bind_int=(A,b,D)=>(f._sqlite3_bind_int=Ve.ta)(A,b,D),f._sqlite3_bind_text=(A,b,D,F,J)=>(f._sqlite3_bind_text=Ve.ua)(A,b,D,F,J),f._sqlite3_bind_parameter_index=(A,b)=>(f._sqlite3_bind_parameter_index=Ve.va)(A,b),f._sqlite3_sql=A=>(f._sqlite3_sql=Ve.wa)(A),f._sqlite3_normalized_sql=A=>(f._sqlite3_normalized_sql=Ve.xa)(A),f._sqlite3_changes=A=>(f._sqlite3_changes=Ve.ya)(A),f._sqlite3_close_v2=A=>(f._sqlite3_close_v2=Ve.za)(A),f._sqlite3_create_function_v2=(A,b,D,F,J,oe,he,Pe,gt)=>(f._sqlite3_create_function_v2=Ve.Aa)(A,b,D,F,J,oe,he,Pe,gt),f._sqlite3_update_hook=(A,b,D)=>(f._sqlite3_update_hook=Ve.Ba)(A,b,D),f._sqlite3_open=(A,b)=>(f._sqlite3_open=Ve.Ca)(A,b);var vs=f._malloc=A=>(vs=f._malloc=Ve.Da)(A),$r=f._free=A=>($r=f._free=Ve.Ea)(A);f._RegisterExtensionFunctions=A=>(f._RegisterExtensionFunctions=Ve.Fa)(A);var Io=(A,b)=>(Io=Ve.Ga)(A,b),Zr=(A,b)=>(Zr=Ve.Ha)(A,b),Ya=A=>(Ya=Ve.Ia)(A),wn=A=>(wn=Ve.Ja)(A),Fn=()=>(Fn=Ve.Ka)();f.stackSave=()=>Fn(),f.stackRestore=A=>Ya(A),f.stackAlloc=A=>wn(A),f.cwrap=(A,b,D,F)=>{var J=!D||D.every(oe=>oe==="number"||oe==="boolean");return b!=="string"&&J&&!F?f["_"+A]:(...oe)=>Vl(A,b,D,oe)},f.addFunction=yr,f.removeFunction=vn,f.UTF8ToString=Re,f.ALLOC_NORMAL=Mi,f.allocate=Jr,f.allocateUTF8OnStack=Eo;function Cn(){function A(){var J;if(f.calledRun=!0,!H){if(!f.noFSInit&&!Mn){var b,D;Mn=!0,F??(F=f.stdin),b??(b=f.stdout),D??(D=f.stderr),F?ua("stdin",F):mr("/dev/tty","/dev/stdin"),b?ua("stdout",null,b):mr("/dev/tty","/dev/stdout"),D?ua("stderr",null,D):mr("/dev/tty1","/dev/stderr"),fr("/dev/stdin",0),fr("/dev/stdout",1),fr("/dev/stderr",1)}if(Ve.N(),Gn=!1,(J=f.onRuntimeInitialized)==null||J.call(f),f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;){var F=f.postRun.shift();Oe.unshift(F)}Te(Oe)}}if(0<O)$=Cn;else{if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)je();Te(Ne),0<O?$=Cn:f.setStatus?(f.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>f.setStatus(""),1),A()},1)):A()}}if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);0<f.preInit.length;)f.preInit.pop()();return Cn(),m}),a)};r.exports=i,r.exports.default=i}(Tf)),Tf.exports}var MN=_N();const Ng=Ri(MN);var ay=`
\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');


PRAGMA foreign_keys = OFF;

-- Clean up any existing temp tables first
DROP TABLE IF EXISTS "__EFMigrationsHistory_temp";
DROP TABLE IF EXISTS "Aliases_temp";
DROP TABLE IF EXISTS "Services_temp";
DROP TABLE IF EXISTS "EncryptionKeys_temp";
DROP TABLE IF EXISTS "Settings_temp";
DROP TABLE IF EXISTS "Credentials_temp";
DROP TABLE IF EXISTS "Attachments_temp";
DROP TABLE IF EXISTS "Passwords_temp";
DROP TABLE IF EXISTS "TotpCodes_temp";

-- Create backup tables for all data
CREATE TABLE "__EFMigrationsHistory_temp" AS SELECT * FROM "__EFMigrationsHistory";
CREATE TABLE "Aliases_temp" AS SELECT * FROM "Aliases";
CREATE TABLE "Services_temp" AS SELECT * FROM "Services";
CREATE TABLE "EncryptionKeys_temp" AS SELECT * FROM "EncryptionKeys";
CREATE TABLE "Settings_temp" AS SELECT * FROM "Settings";
CREATE TABLE "Credentials_temp" AS SELECT * FROM "Credentials";
CREATE TABLE "Attachments_temp" AS SELECT * FROM "Attachments";
CREATE TABLE "Passwords_temp" AS SELECT * FROM "Passwords";
CREATE TABLE "TotpCodes_temp" AS SELECT * FROM "TotpCodes";

-- Delete orphaned records that do not have a valid FK to the credential object
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Delete orphaned credentials that do not have valid FKs to alias or service objects
DELETE FROM "Credentials_temp" WHERE "AliasId" NOT IN (SELECT "Id" FROM "Aliases_temp");
DELETE FROM "Credentials_temp" WHERE "ServiceId" NOT IN (SELECT "Id" FROM "Services_temp");

-- After cleaning credentials, clean dependent tables again in case we removed credentials
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Drop all existing tables
DROP TABLE "TotpCodes";
DROP TABLE "Passwords";
DROP TABLE "Attachments";
DROP TABLE "Credentials";
DROP TABLE "Settings";
DROP TABLE "EncryptionKeys";
DROP TABLE "Services";
DROP TABLE "Aliases";
DROP TABLE "__EFMigrationsHistory";

-- Recreate tables with proper constraints (no dependencies first)
CREATE TABLE "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

CREATE TABLE "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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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

-- Tables with foreign keys
CREATE TABLE "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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    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 "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 DEFAULT 0,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

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 DEFAULT 0,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);


-- Restore data from temp tables
INSERT INTO "__EFMigrationsHistory" SELECT * FROM "__EFMigrationsHistory_temp";
INSERT INTO "Aliases" SELECT * FROM "Aliases_temp";
INSERT INTO "Services" SELECT * FROM "Services_temp";
INSERT INTO "EncryptionKeys" SELECT * FROM "EncryptionKeys_temp";
INSERT INTO "Settings" SELECT * FROM "Settings_temp";
INSERT INTO "Credentials" SELECT * FROM "Credentials_temp";
INSERT INTO "Attachments" SELECT * FROM "Attachments_temp";
INSERT INTO "Passwords" SELECT * FROM "Passwords_temp";
INSERT INTO "TotpCodes" SELECT * FROM "TotpCodes_temp";

-- =====================================================================================
-- Date Format Normalization Migration
-- =====================================================================================
-- This migration normalizes ALL date fields to the standard format: 'yyyy-MM-dd HH:mm:ss.fff'
-- Previously the different clients used different date formats which complicate date parsing.
-- From version 0.24.0 onwards, all new dates are stored in this standard format.

-- Update Aliases table (CreatedAt, UpdatedAt, BirthDate)
UPDATE "Aliases" SET "CreatedAt" =
    CASE
        -- Already in correct format (yyyy-MM-dd HH:mm:ss.fff) - no change
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"

        -- ISO 8601 with milliseconds (yyyy-MM-ddTHH:mm:ss.fffZ) -> Replace T with space, remove Z and everything after .fff
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)

        -- Without milliseconds (yyyy-MM-dd HH:mm:ss or yyyy-MM-ddTHH:mm:ssZ) -> Add .000
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'

        -- Fallback: if none match, keep as-is (edge case)
        ELSE "CreatedAt"
    END;

UPDATE "Aliases" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- BirthDate: Always set time to 00:00:00 (no milliseconds for birth dates)
UPDATE "Aliases" SET "BirthDate" =
    CASE
        -- If empty or already '0001-01-01 00:00:00', keep as-is
        WHEN "BirthDate" = '' OR "BirthDate" = '0001-01-01 00:00:00'
            THEN "BirthDate"

        -- If already in correct format (yyyy-MM-dd 00:00:00), keep as-is
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] 00:00:00'
            THEN "BirthDate"

        -- Extract date part and set time to 00:00:00
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*'
            THEN substr("BirthDate", 1, 10) || ' 00:00:00'

        -- Fallback
        ELSE "BirthDate"
    END;

-- Update Services table (CreatedAt, UpdatedAt)
UPDATE "Services" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Services" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update EncryptionKeys table (CreatedAt, UpdatedAt)
UPDATE "EncryptionKeys" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "EncryptionKeys" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Settings table (CreatedAt, UpdatedAt)
UPDATE "Settings" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Settings" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Credentials table (CreatedAt, UpdatedAt)
UPDATE "Credentials" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Credentials" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Attachments table (CreatedAt, UpdatedAt)
UPDATE "Attachments" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Attachments" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Passwords table (CreatedAt, UpdatedAt)
UPDATE "Passwords" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Passwords" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update TotpCodes table (CreatedAt, UpdatedAt)
UPDATE "TotpCodes" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "TotpCodes" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- =====================================================================================
-- End of Date Format Normalization Migration
-- =====================================================================================

-- Recreate indexes
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");
CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");
CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");
CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

-- Clean up temp tables
DROP TABLE "__EFMigrationsHistory_temp";
DROP TABLE "Aliases_temp";
DROP TABLE "Services_temp";
DROP TABLE "EncryptionKeys_temp";
DROP TABLE "Settings_temp";
DROP TABLE "Credentials_temp";
DROP TABLE "Attachments_temp";
DROP TABLE "Passwords_temp";
DROP TABLE "TotpCodes_temp";

PRAGMA foreign_keys = ON;


CREATE TABLE "Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UserHandle" BLOB NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "DisplayName" TEXT NOT NULL,
    "AdditionalData" BLOB NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Passkeys_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Passkeys_CredentialId" ON "Passkeys" ("CredentialId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251014122838_1.6.0-AddPasskeys', '9.0.4');

ALTER TABLE "TotpCodes" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_TotpCodes_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

ALTER TABLE "Passkeys" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Passkeys_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

ALTER TABLE "Attachments" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Attachments_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE TABLE "FieldDefinitions" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldDefinitions" PRIMARY KEY,
    "FieldType" TEXT NOT NULL,
    "Label" TEXT NOT NULL,
    "IsMultiValue" INTEGER NOT NULL,
    "IsHidden" INTEGER NOT NULL,
    "EnableHistory" INTEGER NOT NULL,
    "Weight" INTEGER NOT NULL,
    "ApplicableToTypes" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Folders" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Folders" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "ParentFolderId" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Folders_Folders_ParentFolderId" FOREIGN KEY ("ParentFolderId") REFERENCES "Folders" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Logos" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Logos" PRIMARY KEY,
    "Source" TEXT NOT NULL,
    "FileData" BLOB NULL,
    "MimeType" TEXT NULL,
    "FetchedAt" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Tags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Tags" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "Color" TEXT NULL,
    "DisplayOrder" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Items" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Items" PRIMARY KEY,
    "Name" TEXT NULL,
    "ItemType" TEXT NOT NULL,
    "LogoId" TEXT NULL,
    "DeletedAt" TEXT NULL,
    "FolderId" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Items_Folders_FolderId" FOREIGN KEY ("FolderId") REFERENCES "Folders" ("Id") ON DELETE SET NULL,
    CONSTRAINT "FK_Items_Logos_LogoId" FOREIGN KEY ("LogoId") REFERENCES "Logos" ("Id") ON DELETE SET NULL
);

CREATE TABLE "FieldHistories" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldHistories" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "ValueSnapshot" TEXT NOT NULL,
    "ChangedAt" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldHistories_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldHistories_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "FieldValues" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldValues" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "Value" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldValues_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldValues_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "ItemTags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_ItemTags" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "TagId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_ItemTags_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_ItemTags_Tags_TagId" FOREIGN KEY ("TagId") REFERENCES "Tags" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_FieldHistories_FieldDefinitionId" ON "FieldHistories" ("FieldDefinitionId");

CREATE INDEX "IX_FieldHistories_ItemId" ON "FieldHistories" ("ItemId");

CREATE INDEX "IX_FieldValues_FieldDefinitionId" ON "FieldValues" ("FieldDefinitionId");

CREATE INDEX "IX_FieldValues_FieldKey" ON "FieldValues" ("FieldKey");

CREATE INDEX "IX_FieldValues_ItemId" ON "FieldValues" ("ItemId");

CREATE INDEX "IX_FieldValues_ItemId_FieldDefinitionId_Weight" ON "FieldValues" ("ItemId", "FieldDefinitionId", "Weight");

CREATE INDEX "IX_FieldValues_ItemId_FieldKey" ON "FieldValues" ("ItemId", "FieldKey");

CREATE INDEX "IX_Folders_ParentFolderId" ON "Folders" ("ParentFolderId");

CREATE INDEX "IX_Items_FolderId" ON "Items" ("FolderId");

CREATE INDEX "IX_Items_LogoId" ON "Items" ("LogoId");

CREATE INDEX "IX_ItemTags_ItemId" ON "ItemTags" ("ItemId");

CREATE UNIQUE INDEX "IX_ItemTags_ItemId_TagId" ON "ItemTags" ("ItemId", "TagId");

CREATE INDEX "IX_ItemTags_TagId" ON "ItemTags" ("TagId");

CREATE UNIQUE INDEX "IX_Logos_Source" ON "Logos" ("Source");

CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");


                INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  c.Id,
                  s.Name AS Name,
                  CASE
                    WHEN a.Id IS NOT NULL AND (
                      (a.FirstName IS NOT NULL AND a.FirstName != '') OR
                      (a.LastName IS NOT NULL AND a.LastName != '') OR
                      (a.Gender IS NOT NULL AND a.Gender != '') OR
                      (a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
                    ) THEN 'Alias'
                    ELSE 'Login'
                  END AS ItemType,
                  NULL AS LogoId,
                  NULL AS FolderId,
                  c.CreatedAt,
                  c.UpdatedAt,
                  c.IsDeleted
                FROM Credentials c
                LEFT JOIN Services s ON s.Id = c.ServiceId
                LEFT JOIN Aliases a ON a.Id = c.AliasId;
            


                INSERT INTO Logos (Id, Source, FileData, MimeType, FetchedAt, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  -- Extract and normalize hostname: remove protocol, path, lowercase, and www. prefix
                  REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) AS Source,
                  s.Logo AS FileData,
                  'image/png' AS MimeType,
                  NULL AS FetchedAt,
                  MIN(s.CreatedAt) AS CreatedAt,
                  MAX(s.UpdatedAt) AS UpdatedAt,
                  0 AS IsDeleted
                FROM Services s
                WHERE s.Logo IS NOT NULL AND s.Url IS NOT NULL AND s.Url != ''
                GROUP BY REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  );
            


                UPDATE Items
                SET LogoId = (
                  SELECT l.Id FROM Logos l
                  INNER JOIN Services s ON REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) = l.Source
                  INNER JOIN Credentials c ON c.ServiceId = s.Id
                  WHERE c.Id = Items.Id
                  LIMIT 1
                )
                WHERE EXISTS (
                  SELECT 1 FROM Credentials c
                  INNER JOIN Services s ON s.Id = c.ServiceId
                  WHERE c.Id = Items.Id AND s.Logo IS NOT NULL
                );
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.url' AS FieldKey,
                  s.Url AS Value,
                  0 AS Weight,
                  s.UpdatedAt AS CreatedAt,
                  s.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Services s ON s.Id = c.ServiceId
                WHERE s.Url IS NOT NULL AND s.Url != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.username' AS FieldKey,
                  c.Username AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Username IS NOT NULL AND c.Username != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.notes' AS FieldKey,
                  c.Notes AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Notes IS NOT NULL AND c.Notes != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  p.CredentialId AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.password' AS FieldKey,
                  p.Value AS Value,
                  0 AS Weight,
                  p.UpdatedAt AS CreatedAt,
                  p.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Passwords p
                INNER JOIN (
                  SELECT CredentialId, MAX(UpdatedAt) AS MaxUpdated, MAX(Id) AS MaxId
                  FROM Passwords
                  WHERE IsDeleted = 0
                  GROUP BY CredentialId
                ) pm ON p.CredentialId = pm.CredentialId AND p.UpdatedAt = pm.MaxUpdated AND p.Id = pm.MaxId
                WHERE p.IsDeleted = 0;
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.email' AS FieldKey,
                  a.Email AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Email IS NOT NULL AND a.Email != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.first_name' AS FieldKey,
                  a.FirstName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.FirstName IS NOT NULL AND a.FirstName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.last_name' AS FieldKey,
                  a.LastName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.LastName IS NOT NULL AND a.LastName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.gender' AS FieldKey,
                  a.Gender AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Gender IS NOT NULL AND a.Gender != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.birthdate' AS FieldKey,
                  SUBSTR(a.BirthDate, 1, 10) AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%';
            

DROP TABLE "Passwords";

DROP TABLE "Credentials";

DROP TABLE "Aliases";

DROP TABLE "Services";

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

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

CREATE TABLE "ef_temp_Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "AdditionalData" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "DisplayName" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "PrivateKey" TEXT NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "UserHandle" BLOB NOT NULL,
    CONSTRAINT "FK_Passkeys_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Passkeys" ("Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle")
SELECT "Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle"
FROM "Passkeys";

CREATE TABLE "ef_temp_TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "CreatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_TotpCodes_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_TotpCodes" ("Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt")
SELECT "Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt"
FROM "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

DROP TABLE "Passkeys";

ALTER TABLE "ef_temp_Passkeys" RENAME TO "Passkeys";

DROP TABLE "TotpCodes";

ALTER TABLE "ef_temp_TotpCodes" RENAME TO "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE INDEX "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

CREATE INDEX "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '9.0.4');
`,ny={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;`,10:`\uFEFFBEGIN TRANSACTION;

PRAGMA foreign_keys = OFF;

-- Clean up any existing temp tables first
DROP TABLE IF EXISTS "__EFMigrationsHistory_temp";
DROP TABLE IF EXISTS "Aliases_temp";
DROP TABLE IF EXISTS "Services_temp";
DROP TABLE IF EXISTS "EncryptionKeys_temp";
DROP TABLE IF EXISTS "Settings_temp";
DROP TABLE IF EXISTS "Credentials_temp";
DROP TABLE IF EXISTS "Attachments_temp";
DROP TABLE IF EXISTS "Passwords_temp";
DROP TABLE IF EXISTS "TotpCodes_temp";

-- Create backup tables for all data
CREATE TABLE "__EFMigrationsHistory_temp" AS SELECT * FROM "__EFMigrationsHistory";
CREATE TABLE "Aliases_temp" AS SELECT * FROM "Aliases";
CREATE TABLE "Services_temp" AS SELECT * FROM "Services";
CREATE TABLE "EncryptionKeys_temp" AS SELECT * FROM "EncryptionKeys";
CREATE TABLE "Settings_temp" AS SELECT * FROM "Settings";
CREATE TABLE "Credentials_temp" AS SELECT * FROM "Credentials";
CREATE TABLE "Attachments_temp" AS SELECT * FROM "Attachments";
CREATE TABLE "Passwords_temp" AS SELECT * FROM "Passwords";
CREATE TABLE "TotpCodes_temp" AS SELECT * FROM "TotpCodes";

-- Delete orphaned records that do not have a valid FK to the credential object
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Delete orphaned credentials that do not have valid FKs to alias or service objects
DELETE FROM "Credentials_temp" WHERE "AliasId" NOT IN (SELECT "Id" FROM "Aliases_temp");
DELETE FROM "Credentials_temp" WHERE "ServiceId" NOT IN (SELECT "Id" FROM "Services_temp");

-- After cleaning credentials, clean dependent tables again in case we removed credentials
DELETE FROM "Attachments_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "Passwords_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");
DELETE FROM "TotpCodes_temp" WHERE "CredentialId" NOT IN (SELECT "Id" FROM "Credentials_temp");

-- Drop all existing tables
DROP TABLE "TotpCodes";
DROP TABLE "Passwords";
DROP TABLE "Attachments";
DROP TABLE "Credentials";
DROP TABLE "Settings";
DROP TABLE "EncryptionKeys";
DROP TABLE "Services";
DROP TABLE "Aliases";
DROP TABLE "__EFMigrationsHistory";

-- Recreate tables with proper constraints (no dependencies first)
CREATE TABLE "__EFMigrationsHistory" (
    "MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY,
    "ProductVersion" TEXT NOT NULL
);

CREATE TABLE "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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0
);

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

-- Tables with foreign keys
CREATE TABLE "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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    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 "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 DEFAULT 0,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_Attachments_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,
    "IsDeleted" INTEGER NOT NULL DEFAULT 0,
    CONSTRAINT "FK_Passwords_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

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 DEFAULT 0,
    CONSTRAINT "FK_TotpCodes_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);


-- Restore data from temp tables
INSERT INTO "__EFMigrationsHistory" SELECT * FROM "__EFMigrationsHistory_temp";
INSERT INTO "Aliases" SELECT * FROM "Aliases_temp";
INSERT INTO "Services" SELECT * FROM "Services_temp";
INSERT INTO "EncryptionKeys" SELECT * FROM "EncryptionKeys_temp";
INSERT INTO "Settings" SELECT * FROM "Settings_temp";
INSERT INTO "Credentials" SELECT * FROM "Credentials_temp";
INSERT INTO "Attachments" SELECT * FROM "Attachments_temp";
INSERT INTO "Passwords" SELECT * FROM "Passwords_temp";
INSERT INTO "TotpCodes" SELECT * FROM "TotpCodes_temp";

-- =====================================================================================
-- Date Format Normalization Migration
-- =====================================================================================
-- This migration normalizes ALL date fields to the standard format: 'yyyy-MM-dd HH:mm:ss.fff'
-- Previously the different clients used different date formats which complicate date parsing.
-- From version 0.24.0 onwards, all new dates are stored in this standard format.

-- Update Aliases table (CreatedAt, UpdatedAt, BirthDate)
UPDATE "Aliases" SET "CreatedAt" =
    CASE
        -- Already in correct format (yyyy-MM-dd HH:mm:ss.fff) - no change
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"

        -- ISO 8601 with milliseconds (yyyy-MM-ddTHH:mm:ss.fffZ) -> Replace T with space, remove Z and everything after .fff
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)

        -- Without milliseconds (yyyy-MM-dd HH:mm:ss or yyyy-MM-ddTHH:mm:ssZ) -> Add .000
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'

        -- Fallback: if none match, keep as-is (edge case)
        ELSE "CreatedAt"
    END;

UPDATE "Aliases" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- BirthDate: Always set time to 00:00:00 (no milliseconds for birth dates)
UPDATE "Aliases" SET "BirthDate" =
    CASE
        -- If empty or already '0001-01-01 00:00:00', keep as-is
        WHEN "BirthDate" = '' OR "BirthDate" = '0001-01-01 00:00:00'
            THEN "BirthDate"

        -- If already in correct format (yyyy-MM-dd 00:00:00), keep as-is
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] 00:00:00'
            THEN "BirthDate"

        -- Extract date part and set time to 00:00:00
        WHEN "BirthDate" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*'
            THEN substr("BirthDate", 1, 10) || ' 00:00:00'

        -- Fallback
        ELSE "BirthDate"
    END;

-- Update Services table (CreatedAt, UpdatedAt)
UPDATE "Services" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Services" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update EncryptionKeys table (CreatedAt, UpdatedAt)
UPDATE "EncryptionKeys" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "EncryptionKeys" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Settings table (CreatedAt, UpdatedAt)
UPDATE "Settings" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Settings" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Credentials table (CreatedAt, UpdatedAt)
UPDATE "Credentials" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Credentials" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Attachments table (CreatedAt, UpdatedAt)
UPDATE "Attachments" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Attachments" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update Passwords table (CreatedAt, UpdatedAt)
UPDATE "Passwords" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "Passwords" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- Update TotpCodes table (CreatedAt, UpdatedAt)
UPDATE "TotpCodes" SET "CreatedAt" =
    CASE
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "CreatedAt"
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr("CreatedAt", 12, 12)
        WHEN "CreatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("CreatedAt", 1, 10) || ' ' || substr(replace("CreatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "CreatedAt"
    END;

UPDATE "TotpCodes" SET "UpdatedAt" =
    CASE
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]'
            THEN "UpdatedAt"
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr("UpdatedAt", 12, 12)
        WHEN "UpdatedAt" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][T ][0-9][0-9]:[0-9][0-9]:[0-9][0-9]*'
            THEN substr("UpdatedAt", 1, 10) || ' ' || substr(replace("UpdatedAt", 'T', ' '), 12, 8) || '.000'
        ELSE "UpdatedAt"
    END;

-- =====================================================================================
-- End of Date Format Normalization Migration
-- =====================================================================================

-- Recreate indexes
CREATE INDEX "IX_Credentials_AliasId" ON "Credentials" ("AliasId");
CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");
CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");
CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");

-- Clean up temp tables
DROP TABLE "__EFMigrationsHistory_temp";
DROP TABLE "Aliases_temp";
DROP TABLE "Services_temp";
DROP TABLE "EncryptionKeys_temp";
DROP TABLE "Settings_temp";
DROP TABLE "Credentials_temp";
DROP TABLE "Attachments_temp";
DROP TABLE "Passwords_temp";
DROP TABLE "TotpCodes_temp";

PRAGMA foreign_keys = ON;


CREATE TABLE "Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UserHandle" BLOB NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "PrivateKey" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "DisplayName" TEXT NOT NULL,
    "AdditionalData" BLOB NULL,
    "CredentialId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Passkeys_Credentials_CredentialId" FOREIGN KEY ("CredentialId") REFERENCES "Credentials" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_Passkeys_CredentialId" ON "Passkeys" ("CredentialId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251014122838_1.6.0-AddPasskeys', '9.0.4');

COMMIT;`,11:`\uFEFFBEGIN TRANSACTION;
ALTER TABLE "TotpCodes" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_TotpCodes_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

ALTER TABLE "Passkeys" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Passkeys_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

ALTER TABLE "Attachments" RENAME COLUMN "CredentialId" TO "ItemId";

DROP INDEX IF EXISTS "IX_Attachments_CredentialId";

CREATE INDEX IF NOT EXISTS "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE TABLE "FieldDefinitions" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldDefinitions" PRIMARY KEY,
    "FieldType" TEXT NOT NULL,
    "Label" TEXT NOT NULL,
    "IsMultiValue" INTEGER NOT NULL,
    "IsHidden" INTEGER NOT NULL,
    "EnableHistory" INTEGER NOT NULL,
    "Weight" INTEGER NOT NULL,
    "ApplicableToTypes" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Folders" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Folders" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "ParentFolderId" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Folders_Folders_ParentFolderId" FOREIGN KEY ("ParentFolderId") REFERENCES "Folders" ("Id") ON DELETE CASCADE
);

CREATE TABLE "Logos" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Logos" PRIMARY KEY,
    "Source" TEXT NOT NULL,
    "FileData" BLOB NULL,
    "MimeType" TEXT NULL,
    "FetchedAt" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Tags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Tags" PRIMARY KEY,
    "Name" TEXT NOT NULL,
    "Color" TEXT NULL,
    "DisplayOrder" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL
);

CREATE TABLE "Items" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Items" PRIMARY KEY,
    "Name" TEXT NULL,
    "ItemType" TEXT NOT NULL,
    "LogoId" TEXT NULL,
    "DeletedAt" TEXT NULL,
    "FolderId" TEXT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_Items_Folders_FolderId" FOREIGN KEY ("FolderId") REFERENCES "Folders" ("Id") ON DELETE SET NULL,
    CONSTRAINT "FK_Items_Logos_LogoId" FOREIGN KEY ("LogoId") REFERENCES "Logos" ("Id") ON DELETE SET NULL
);

CREATE TABLE "FieldHistories" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldHistories" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "ValueSnapshot" TEXT NOT NULL,
    "ChangedAt" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldHistories_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldHistories_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "FieldValues" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_FieldValues" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "FieldDefinitionId" TEXT NULL,
    "FieldKey" TEXT NULL,
    "Value" TEXT NULL,
    "Weight" INTEGER NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_FieldValues_FieldDefinitions_FieldDefinitionId" FOREIGN KEY ("FieldDefinitionId") REFERENCES "FieldDefinitions" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_FieldValues_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

CREATE TABLE "ItemTags" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_ItemTags" PRIMARY KEY,
    "ItemId" TEXT NOT NULL,
    "TagId" TEXT NOT NULL,
    "CreatedAt" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    CONSTRAINT "FK_ItemTags_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE,
    CONSTRAINT "FK_ItemTags_Tags_TagId" FOREIGN KEY ("TagId") REFERENCES "Tags" ("Id") ON DELETE CASCADE
);

CREATE INDEX "IX_FieldHistories_FieldDefinitionId" ON "FieldHistories" ("FieldDefinitionId");

CREATE INDEX "IX_FieldHistories_ItemId" ON "FieldHistories" ("ItemId");

CREATE INDEX "IX_FieldValues_FieldDefinitionId" ON "FieldValues" ("FieldDefinitionId");

CREATE INDEX "IX_FieldValues_FieldKey" ON "FieldValues" ("FieldKey");

CREATE INDEX "IX_FieldValues_ItemId" ON "FieldValues" ("ItemId");

CREATE INDEX "IX_FieldValues_ItemId_FieldDefinitionId_Weight" ON "FieldValues" ("ItemId", "FieldDefinitionId", "Weight");

CREATE INDEX "IX_FieldValues_ItemId_FieldKey" ON "FieldValues" ("ItemId", "FieldKey");

CREATE INDEX "IX_Folders_ParentFolderId" ON "Folders" ("ParentFolderId");

CREATE INDEX "IX_Items_FolderId" ON "Items" ("FolderId");

CREATE INDEX "IX_Items_LogoId" ON "Items" ("LogoId");

CREATE INDEX "IX_ItemTags_ItemId" ON "ItemTags" ("ItemId");

CREATE UNIQUE INDEX "IX_ItemTags_ItemId_TagId" ON "ItemTags" ("ItemId", "TagId");

CREATE INDEX "IX_ItemTags_TagId" ON "ItemTags" ("TagId");

CREATE UNIQUE INDEX "IX_Logos_Source" ON "Logos" ("Source");

CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");


                INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  c.Id,
                  s.Name AS Name,
                  CASE
                    WHEN a.Id IS NOT NULL AND (
                      (a.FirstName IS NOT NULL AND a.FirstName != '') OR
                      (a.LastName IS NOT NULL AND a.LastName != '') OR
                      (a.Gender IS NOT NULL AND a.Gender != '') OR
                      (a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
                    ) THEN 'Alias'
                    ELSE 'Login'
                  END AS ItemType,
                  NULL AS LogoId,
                  NULL AS FolderId,
                  c.CreatedAt,
                  c.UpdatedAt,
                  c.IsDeleted
                FROM Credentials c
                LEFT JOIN Services s ON s.Id = c.ServiceId
                LEFT JOIN Aliases a ON a.Id = c.AliasId;
            


                INSERT INTO Logos (Id, Source, FileData, MimeType, FetchedAt, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  -- Extract and normalize hostname: remove protocol, path, lowercase, and www. prefix
                  REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) AS Source,
                  s.Logo AS FileData,
                  'image/png' AS MimeType,
                  NULL AS FetchedAt,
                  MIN(s.CreatedAt) AS CreatedAt,
                  MAX(s.UpdatedAt) AS UpdatedAt,
                  0 AS IsDeleted
                FROM Services s
                WHERE s.Logo IS NOT NULL AND s.Url IS NOT NULL AND s.Url != ''
                GROUP BY REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  );
            


                UPDATE Items
                SET LogoId = (
                  SELECT l.Id FROM Logos l
                  INNER JOIN Services s ON REPLACE(
                    LOWER(
                      SUBSTR(
                        CASE
                          WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                          WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                          ELSE s.Url
                        END,
                        1,
                        CASE
                          WHEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') > 0
                          THEN INSTR(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END, '/') - 1
                          ELSE LENGTH(
                            CASE
                              WHEN s.Url LIKE 'https://%' THEN SUBSTR(s.Url, 9)
                              WHEN s.Url LIKE 'http://%' THEN SUBSTR(s.Url, 8)
                              ELSE s.Url
                            END)
                        END
                      )
                    ),
                    'www.', ''
                  ) = l.Source
                  INNER JOIN Credentials c ON c.ServiceId = s.Id
                  WHERE c.Id = Items.Id
                  LIMIT 1
                )
                WHERE EXISTS (
                  SELECT 1 FROM Credentials c
                  INNER JOIN Services s ON s.Id = c.ServiceId
                  WHERE c.Id = Items.Id AND s.Logo IS NOT NULL
                );
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.url' AS FieldKey,
                  s.Url AS Value,
                  0 AS Weight,
                  s.UpdatedAt AS CreatedAt,
                  s.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Services s ON s.Id = c.ServiceId
                WHERE s.Url IS NOT NULL AND s.Url != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.username' AS FieldKey,
                  c.Username AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Username IS NOT NULL AND c.Username != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.notes' AS FieldKey,
                  c.Notes AS Value,
                  0 AS Weight,
                  c.UpdatedAt AS CreatedAt,
                  c.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                WHERE c.Notes IS NOT NULL AND c.Notes != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  p.CredentialId AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.password' AS FieldKey,
                  p.Value AS Value,
                  0 AS Weight,
                  p.UpdatedAt AS CreatedAt,
                  p.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Passwords p
                INNER JOIN (
                  SELECT CredentialId, MAX(UpdatedAt) AS MaxUpdated, MAX(Id) AS MaxId
                  FROM Passwords
                  WHERE IsDeleted = 0
                  GROUP BY CredentialId
                ) pm ON p.CredentialId = pm.CredentialId AND p.UpdatedAt = pm.MaxUpdated AND p.Id = pm.MaxId
                WHERE p.IsDeleted = 0;
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'login.email' AS FieldKey,
                  a.Email AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Email IS NOT NULL AND a.Email != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.first_name' AS FieldKey,
                  a.FirstName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.FirstName IS NOT NULL AND a.FirstName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.last_name' AS FieldKey,
                  a.LastName AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.LastName IS NOT NULL AND a.LastName != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.gender' AS FieldKey,
                  a.Gender AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.Gender IS NOT NULL AND a.Gender != '';
            


                INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
                SELECT
                  UPPER(SUBSTR(hex(randomblob(4)), 1, 8) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(2)), 1, 4) || '-' ||
                        SUBSTR(hex(randomblob(6)), 1, 12)) AS Id,
                  c.Id AS ItemId,
                  NULL AS FieldDefinitionId,
                  'alias.birthdate' AS FieldKey,
                  SUBSTR(a.BirthDate, 1, 10) AS Value,
                  0 AS Weight,
                  a.UpdatedAt AS CreatedAt,
                  a.UpdatedAt AS UpdatedAt,
                  0 AS IsDeleted
                FROM Credentials c
                INNER JOIN Aliases a ON a.Id = c.AliasId
                WHERE a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%';
            

DROP TABLE "Passwords";

DROP TABLE "Credentials";

DROP TABLE "Aliases";

DROP TABLE "Services";

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

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

CREATE TABLE "ef_temp_Passkeys" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_Passkeys" PRIMARY KEY,
    "AdditionalData" BLOB NULL,
    "CreatedAt" TEXT NOT NULL,
    "DisplayName" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "PrfKey" BLOB NULL,
    "PrivateKey" TEXT NOT NULL,
    "PublicKey" TEXT NOT NULL,
    "RpId" TEXT COLLATE NOCASE NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    "UserHandle" BLOB NOT NULL,
    CONSTRAINT "FK_Passkeys_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_Passkeys" ("Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle")
SELECT "Id", "AdditionalData", "CreatedAt", "DisplayName", "IsDeleted", "ItemId", "PrfKey", "PrivateKey", "PublicKey", "RpId", "UpdatedAt", "UserHandle"
FROM "Passkeys";

CREATE TABLE "ef_temp_TotpCodes" (
    "Id" TEXT NOT NULL CONSTRAINT "PK_TotpCodes" PRIMARY KEY,
    "CreatedAt" TEXT NOT NULL,
    "IsDeleted" INTEGER NOT NULL,
    "ItemId" TEXT NOT NULL,
    "Name" TEXT NOT NULL,
    "SecretKey" TEXT NOT NULL,
    "UpdatedAt" TEXT NOT NULL,
    CONSTRAINT "FK_TotpCodes_Items_ItemId" FOREIGN KEY ("ItemId") REFERENCES "Items" ("Id") ON DELETE CASCADE
);

INSERT INTO "ef_temp_TotpCodes" ("Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt")
SELECT "Id", "CreatedAt", "IsDeleted", "ItemId", "Name", "SecretKey", "UpdatedAt"
FROM "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 0;

BEGIN TRANSACTION;
DROP TABLE "Attachments";

ALTER TABLE "ef_temp_Attachments" RENAME TO "Attachments";

DROP TABLE "Passkeys";

ALTER TABLE "ef_temp_Passkeys" RENAME TO "Passkeys";

DROP TABLE "TotpCodes";

ALTER TABLE "ef_temp_TotpCodes" RENAME TO "TotpCodes";

COMMIT;

PRAGMA foreign_keys = 1;

BEGIN TRANSACTION;
CREATE INDEX "IX_Attachments_ItemId" ON "Attachments" ("ItemId");

CREATE INDEX "IX_Passkeys_ItemId" ON "Passkeys" ("ItemId");

CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");

CREATE INDEX "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");

COMMIT;

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '9.0.4');`},wa=[{revision:1,version:"1.0.0",description:"Initial Migration",releaseVersion:"0.1.0",compatibleUpToVersion:"0.0.0"},{revision:2,version:"1.0.1",description:"Empty Test Migration",releaseVersion:"0.2.0",compatibleUpToVersion:"0.1.0"},{revision:3,version:"1.0.2",description:"Change Email Column",releaseVersion:"0.3.0",compatibleUpToVersion:"0.2.0"},{revision:4,version:"1.1.0",description:"Add Pki Tables",releaseVersion:"0.4.0",compatibleUpToVersion:"0.3.0"},{revision:5,version:"1.2.0",description:"Add Settings Table",releaseVersion:"0.4.0",compatibleUpToVersion:"0.3.0"},{revision:6,version:"1.3.0",description:"Update Identity Structure",releaseVersion:"0.5.0",compatibleUpToVersion:"0.4.0"},{revision:7,version:"1.3.1",description:"Make Username Optional",releaseVersion:"0.5.0",compatibleUpToVersion:"0.4.0"},{revision:8,version:"1.4.0",description:"Add Sync Support",releaseVersion:"0.6.0",compatibleUpToVersion:"0.5.0"},{revision:9,version:"1.4.1",description:"Rename Attachments Plural",releaseVersion:"0.6.0",compatibleUpToVersion:"0.13.0"},{revision:10,version:"1.5.0",description:"Add 2FA Tokens to credentials",releaseVersion:"0.14.0",compatibleUpToVersion:"0.23.0"},{revision:11,version:"1.6.0",description:"Add Passkey support",releaseVersion:"0.24.0",compatibleUpToVersion:"0.25.0"},{revision:12,version:"1.7.0",description:"Update to Field-Based Data Model",releaseVersion:"0.26.0",compatibleUpToVersion:"0.26.0"}],xg=class{getCreateVaultSql(){try{return{success:!0,sqlCommands:[ay],version:wa[wa.length-1].version,migrationNumber:wa[wa.length-1].revision}}catch(r){return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:r instanceof Error?r.message:"Unknown error creating vault SQL"}}}getUpgradeVaultSql(r,e){try{const a=e??wa[wa.length-1].revision,i=wa.find(d=>d.revision===a);if(!i)return{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target migration number ${a} not found`};if(r>=a)return{success:!0,sqlCommands:[],version:i.version,migrationNumber:a};const s=wa.filter(d=>d.revision>r&&d.revision<=a),c=[];for(const d of s){const m=d.revision-1,g=ny[m];g&&c.push(g)}return{success:!0,sqlCommands:c,version:i.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(r){return this.getUpgradeVaultSql(r)}getUpgradeToVersionSql(r,e){const a=wa.find(i=>i.version===e);return a?this.getUpgradeVaultSql(r,a.revision):{success:!1,sqlCommands:[],version:"0.0.0",migrationNumber:0,error:`Target version ${e} 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(r,e,a){let i="0.0.0",s=0;r&&(e?i=e:(i="1.0.0",s=1),a&&(s=parseInt(a,10)));const c=wa[wa.length-1],d=s<c.revision,m=wa.filter(g=>g.revision>s);return{currentVersion:i,currentMigrationNumber:s,targetVersion:c.version,targetMigrationNumber:c.revision,needsUpgrade:d,availableUpgrades:m}}validateVaultStructure(r){const e=["Aliases","Services","Credentials","Passwords","Attachments","EncryptionKeys","Settings","TotpCodes"];return r.filter(i=>e.includes(i)).length>=5}getAllVersions(){return[...wa]}getLatestVersion(){return wa[wa.length-1]}getMigrationSql(r){return ny[r]}getCompleteSchemaSql(){return ay}};function ry(r){const a=/^(\d+)\.(\d+)\.(\d+)$/.exec(r);return a?{major:parseInt(a[1],10),minor:parseInt(a[2],10),patch:parseInt(a[3],10)}:null}function FN(r,e){const a=ry(r);if(!a)return{isCompatible:!1,databaseVersion:r,isKnownVersion:!1,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const i=wa.find(f=>f.version===r);if(i)return{isCompatible:!0,databaseVersion:r,clientVersion:i,isKnownVersion:!0,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const s=e?wa.find(f=>f.version===e)??iy():iy(),c=ry(s.version);if(!c)return{isCompatible:!1,databaseVersion:r,isKnownVersion:!1,isMajorVersionDifference:!1,isMinorVersionDifference:!1};const d=a.major!==c.major,m=!d&&(a.minor!==c.minor||a.patch!==c.patch);return{isCompatible:!d,databaseVersion:r,clientVersion:s,isKnownVersion:!1,isMajorVersionDifference:d,isMinorVersionDifference:m}}function iy(){return wa[wa.length-1]}function ON(r){const a=/_(\d+\.\d+\.\d+)-/.exec(r);return(a==null?void 0:a[1])??null}class cs extends Error{constructor(e){super(e),this.name="VaultVersionIncompatibleError",Object.setPrototypeOf(this,cs.prototype)}}const jN={loginTitle:"Bei AliasVault anmelden",username:"Benutzername oder E-Mail-Adresse",usernamePlaceholder:"Name / name@unternehmen.com",passwordPlaceholder:"Gib Dein Passwort ein",rememberMe:"Angemeldet bleiben",loginButton:"Anmelden",noAccount:"Noch kein Konto?",createVault:"Neuen Tresor erstellen",twoFactorTitle:"Bitte gib den Sicherheits-Code aus Deiner Authentifizierungs-App ein.",authCode:"Sicherheits-Code",authCodePlaceholder:"Gib den 6-stelligen Sicherheits-Code ein.",verify:"Bestätige",twoFactorNote:"Hinweis: Wenn Du keinen Zugriff auf Dein Authentifizierungsgerät hast, kannst Du Deine Zwei-Faktor-Authentifizierung (2FA) mit einem Wiederherstellungscode zurücksetzen, indem Du Dich über die Website anmeldest.",masterPassword:"Master-Passwort",unlockVault:"Entsperren",unlockWithPin:"Mit PIN entsperren",enterPinToUnlock:"Bitte gib Deine PIN zum Entsperren des Tresors ein",useMasterPassword:"Master-Passwort benutzen",unlockTitle:"Entsperre Deinen Tresor",logoutConfirm:"Bist Du sicher, dass Du Dich abmelden möchtest?",unlockSuccessTitle:"Ihr Tresor wurde erfolgreich entsperrt",unlockSuccessDescription:"Du kannst jetzt die Autofill-Funktion in Anmeldeformularen in Deinem Browser nutzen.",closePopup:"Popup schließen",browseVault:"Tresor durchsuchen",connectingTo:"Verbinde zu",switchAccounts:"Konto wechseln?",loginWithMobile:"Mit mobiler App anmelden",unlockWithMobile:"Mit mobiler App entsperren",scanQrCode:"Scanne diesen QR-Code mit Deiner AliasVault-App, um Dich anzumelden und Deinen Tresor zu entsperren.",errors:{invalidCode:"Bitte gib einen gültigen 6-stelligen Sicherheits-Code ein.",serverError:"Der AliasVault-Server konnte nicht erreicht werden. Bitte versuche es später noch einmal oder kontaktiere den Support, falls das Problem weiterhin besteht.",wrongPassword:"Falsches Passwort. Bitte versuche es erneut.",sessionExpired:"Deine Sitzung ist abgelaufen. Bitte melde Dich erneut an.",mobileLoginRequestExpired:"Zeitüberschreitung für mobile Anmeldeanforderungen. Bitte lade die Seite neu und versuche es erneut."}},PN={vault:"Vault",emails:"E-Mails"},HN={loading:"Laden...",notice:"Hinweis",error:"Fehler",cancel:"Abbrechen",confirm:"Bestätigen",back:"Zurück",next:"Weiter",use:"Benutzen",add:"Add",delete:"Löschen",undo:"Rückgängig machen",save:"Speichern",saving:"Saving...",create:"Erstellen",or:"Oder",close:"Schließen",logout:"Abmelden",copied:"Kopiert!",openInNewWindow:"In neuem Fenster öffnen",enabled:"Aktiviert",disabled:"Deaktiviert",showPassword:"Passwort anzeigen",hidePassword:"Passwort verbergen",showDetails:"Details anzeigen",hideDetails:"Details ausblenden",copyToClipboard:"In die Zwischenablage kopieren",loadingEmails:"E-Mails werden geladen...",loadingTotpCodes:"TOTP-Codes werden geladen...",attachments:"Anhänge",loadingAttachments:"Anhänge werden geladen...",settings:"Einstellungen",recentEmails:"Neueste E-Mails",credentials:"Zugangsdaten",customFields:"Custom Fields",twoFactorAuthentication:"Zwei-Faktor-Authentifizierung",alias:"Alias",notes:"Notizen",email:"E-Mail-Adresse",username:"Benutzername",password:"Passwort",generate:"Generate",serviceName:"Name des Dienstes",loggedIn:"Angemeldet",syncingVault:"Tresor wird synchronisiert",checkingVaultUpdates:"Prüfe auf Tresor-Updates",syncingUpdatedVault:"Aktualisierter Tresor wird synchronisiert",loadMore:"Mehr laden",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"Der AliasVault-Server konnte nicht erreicht werden. Bitte versuche es später noch einmal oder kontaktiere den Support, falls das Problem weiterhin besteht.",clientVersionNotSupported:"Diese Version der AliasVault-Browser-Erweiterung wird vom Server nicht mehr unterstützt. Bitte aktualisiere Deine Browser-Erweiterung auf die neueste Version.",browserExtensionOutdated:"Diese Browser-Erweiterung ist veraltet und kann nicht verwendet werden, um auf diesen Tresor zuzugreifen. Bitte aktualisiere die Browser-Erweiterung, um fortzufahren.",serverVersionNotSupported:"Der AliasVault-Server muss auf eine neuere Version aktualisiert werden, um diese Browser-Erweiterung nutzen zu können. Bitte kontaktiere den Support, falls Du Hilfe benötigst.",serverVersionTooOld:"Der AliasVault-Server muss auf eine neuere Version aktualisiert werden, um dieses Feature nutzen zu können. Bitte kontaktiere den Administrator des Servers, falls Du Hilfe benötigst.",unknownError:"Ein unbekannter Fehler ist aufgetreten",unknownErrorTryAgain:"Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.",vaultNotAvailable:"Tresor nicht verfügbar",vaultIsLocked:"Der Tresor ist gesperrt.",passwordChanged:"Dein Passwort hat sich seit Deiner letzten Anmeldung geändert. Bitte melden Dich aus Sicherheitsgründen erneut an.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.",ACCOUNT_LOCKED:"Das Konto wurde wegen zu vieler fehlgeschlagener Anmeldeversuche vorübergehend gesperrt. Bitte versuche es später erneut.",ACCOUNT_BLOCKED:"Dein Konto wurde deaktiviert. Wenn Du glaubst, dass dies ein Fehler ist, kontaktiere bitte den Support.",USER_NOT_FOUND:"Ungültiger Benutzername oder Passwort. Bitte versuche es erneut.",INVALID_AUTHENTICATOR_CODE:"Ungültiger Sicherheits-Code. Bitte versuche es erneut.",INVALID_RECOVERY_CODE:"Ungültiger Wiederherstellungscode. Bitte versuche es erneut.",REFRESH_TOKEN_REQUIRED:"Aktualisierungstoken ist erforderlich.",INVALID_REFRESH_TOKEN:"Ungültiger Aktualisierungstoken.",PUBLIC_REGISTRATION_DISABLED:"Die Registrierung eines neuen Kontos ist auf diesem Server derzeit deaktiviert. Bitte kontaktiere den Administrator.",USERNAME_REQUIRED:"Der Benutzername ist erforderlich.",USERNAME_ALREADY_IN_USE:"Benutzername ist bereits vergeben.",USERNAME_AVAILABLE:"Der Benutzername ist verfügbar.",USERNAME_MISMATCH:"Der Benutzername stimmt nicht mit dem aktuellen Benutzer überein.",PASSWORD_MISMATCH:"Das angegebene Passwort stimmt nicht mit Deinem aktuellen Passwort überein.",ACCOUNT_SUCCESSFULLY_DELETED:"Konto erfolgreich gelöscht.",USERNAME_EMPTY_OR_WHITESPACE:"Der Benutzername darf nicht leer sein.",USERNAME_TOO_SHORT:"Der Benutzername ist zu kurz. Er muss mindestens 3 Zeichen lang sein.",USERNAME_TOO_LONG:"Der Benutzername ist zu lang. Er darf höchstens 40 Zeichen lang sein.",USERNAME_INVALID_EMAIL:"Ungültige E-Mail-Adresse.",USERNAME_INVALID_CHARACTERS:"Der Benutzername ist ungültig. Er darf nur aus Buchstaben oder Ziffern bestehen.",VAULT_NOT_UP_TO_DATE:"Dein Tresor ist nicht aktuell. Bitte synchronisiere Deinen Tresor und versuche es erneut.",INTERNAL_SERVER_ERROR:"Internal server error.",VAULT_ERROR:"Der lokale Tresor ist nicht aktuell. Bitte synchronisiere Deinen Tresor, indem Du die Seite aktualisierst, und versuche es erneut."}},QN={or:"oder",new:"Neu",vaultLocked:"AliasVault ist gesperrt.",creatingNewAlias:"Neuen Alias erstellen...",noMatchesFound:"Keine Treffer gefunden",searchVault:"Tresor durchsuchen...",enterServiceName:"Name des Dienstes eingeben",enterEmailAddress:"E-Mail-Adresse eingeben",enterUsername:"Benutzername eingeben",hideFor1Hour:"Für 1 Stunde ausblenden (aktuelle Seite)",hidePermanently:"Dauerhaft ausblenden (aktuelle Seite)",createRandomAlias:"Zufälligen Alias generieren",createUsernamePassword:"Benutzername/Passwort erstellen",randomAlias:"Zufälliger Alias",usernamePassword:"Benutzername/Passwort",createAndSaveAlias:"Alias erstellen und speichern",createAndSaveCredential:"Zugang erstellen und speichern",randomIdentityDescription:"Generiere eine zufällige Identität mit einer zufälligen E-Mail-Adresse von AliasVault.",randomIdentityDescriptionDropdown:"Zufällige Identität mit zufälliger E-Mail-Adresse",manualCredentialDescription:"Gebe Deine eigene E-Mail-Adresse und Benutzernamen an.",manualCredentialDescriptionDropdown:"Manueller Benutzername und Passwort",failedToCreateIdentity:"Das Erstellen der Identität ist fehlgeschlagen. Bitte versuche es erneut.",enterEmailAndOrUsername:"E-Mail-Adresse und/oder Benutzername eingeben",autofillWithAliasVault:"Autofill mit AliasVault",generateRandomPassword:"Zufälliges Passwort erzeugen (wird in die Zwischenablage kopiert)",generateNewPassword:"Neues Passwort erzeugen",togglePasswordVisibility:"Passwort ein-/ausblenden",passwordCopiedToClipboard:"Passwort in die Zwischenablage kopiert",openAliasVaultToUpgrade:"Zum Aktualisieren AliasVault öffnen ",vaultUpgradeRequired:"Aktualisierung des Tresors erforderlich.",dismissPopup:"Popup schliessen"},zN={title:"Items",itemName:"Name",loginCredentials:"Zugangsdaten",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Ordner erstellen",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Ordner",welcomeTitle:"Welcome to AliasVault!",welcomeDescription:"Du möchtest die AliasVault-Browser-Erweiterung verwenden? Navigiere zu einer Website und verwende das AliasVault-Popup-Fenster um einen neuen Zugang zu erstellen.",noPasskeysFound:"Es wurden noch kein Passkey erstellt. Ein Passkey wird durch den Besuch einer Website erzeugt, die Passkeys als Authentifizierungsmethode anbietet.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Eintrag löschen",deleteItemConfirm:"Bist Du sicher, dass Du diesen Eintrag löschen möchtest?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Schlagwörter",changePasswordComplexity:"Komplexität des Passworts ändern",passwordLength:"Passwortlänge",includeLowercase:"Kleinbuchstaben (a-z)",includeUppercase:"Großbuchstaben (A-Z)",includeNumbers:"Ziffern (0-9)",includeSpecialChars:"Sonderzeichen (!@#$%^&*)",avoidAmbiguousChars:"Mehrdeutige Zeichen (1, l, I, 0, O, etc.) vermeiden",privateEmailTitle:"Private E-Mail-Adresse",privateEmailAliasVaultServer:"AliasVault-Server",privateEmailDescription:"Ende-zu-Ende verschlüsselt, vollständig privat.",publicEmailTitle:"Öffentliche Temp-E-Mail-Anbieter",publicEmailDescription:"Anonyme, aber beschränkte Privatsphäre. E-Mail-Inhalt ist für jeden lesbar, der die Adresse kennt.",validation:{required:"Dieses Feld ist ein Pflichtfeld"}},VN={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"E-Mail",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Anmelden"},alias:{title:"Alias"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},KN={"login.url":"Website URL","login.username":"Username","login.password":"Passwort","alias.first_name":"Vorname","alias.last_name":"Nachname","alias.gender":"Geschlecht","alias.birthdate":"Geburtsdatum","login.email":"E-Mail","notes.content":"Notizen","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},GN={addCode:"2FA-Code hinzufügen",instructions:"Gib den Secret-Key ein, der von der Website angezeigt wird, bei der Du die Zwei-Faktor-Authentifizierung hinzufügen möchtest.",nameOptional:"Name (optional)",secretKey:"Secret-Key",saveToViewCode:"Speichern, um den Code anzuzeigen",defaultName:"Authenticator",errors:{invalidSecretKey:"Ungültiges Format des Secret-Key"}},qN={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},WN={title:"E-Mails",deleteEmailTitle:"E-Mail löschen",deleteEmailConfirm:"Bist Du sicher, dass Du diese E-Mail unwiderruflich löschen möchtest?",from:"Von",to:"An",date:"Datum",emailContent:"Inhalt der E-Mail",emailNotFound:"E-Mail nicht gefunden",noEmails:"Keine E-Mails gefunden",noEmailsDescription:"Du hast bisher keine E-Mails an Deine privaten E-Mail-Adressen erhalten. Neue E-Mails werden hier angezeigt, sobald sie eintreffen.",offlineMessage:"Keine Verbindung. Bitte verbinde Dich mit dem Internet, um Deine E-Mails zu laden.",dateFormat:{justNow:"gerade eben",minutesAgo_single:"vor {{count}} Minute",minutesAgo_plural:"vor {{count}} Minuten",hoursAgo_single:"vor {{count}} Stunde",hoursAgo_plural:"vor {{count}} Stunden",yesterday:"gestern"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Die aktuell gewählte E-Mail-Adresse wird bereits verwendet. Bitte ändere die E-Mail-Adresse, indem Du diese Zugangsdaten bearbeitest.",CLAIM_DOES_NOT_EXIST:"Beim Laden der E-Mails ist ein Fehler aufgetreten. Bitte bearbeite und speichere den Eintrag, um die Datenbank zu synchronisieren, und versuche es dann erneut."}},YN={serverUrl:"URL des Servers",language:"Sprache",autofillEnabled:"Autofill aktivieren",version:"Version",openWebApp:"Web-App öffnen",lock:"Sperren",globalSettings:"Allgemeine Einstellungen",autofillPopup:"Autofill-Popup",activeOnAllSites:"Auf allen Seiten aktiv (sofern nicht unten deaktiviert)",disabledOnAllSites:"Auf allen Seiten deaktiviert",rightClickContextMenu:"Kontextmenü mit Rechtsklick",autofillMatching:"Autofill-Übereinstimmung",autofillMatchingMode:"Autofill-Übereinstimmungs-Modus",autofillMatchingModeDescription:"Legt fest, welche Zugangsdaten als Übereinstimmung angesehen werden und wird als Vorschlag im Autofill-Popup für eine bestimmte Website angezeigt.",autofillMatchingDefault:"URL + Subdomain + Wildcard-Name",autofillMatchingUrlSubdomain:"URL + Subdomain",autofillMatchingUrlExact:"Nur exakte URL-Domain",siteSpecificSettings:"Seitenspezifische Einstellungen",autofillPopupOn:"Autofill-Popup auf: ",enabledForThisSite:"Für diese Seite aktiviert",disabledForThisSite:"Für diese Seite deaktivieren",temporarilyDisabledUntil:"Vorübergehend deaktiviert bis ",resetAllSiteSettings:"Alle seitenspezifischen Einstellungen zurücksetzen",appearance:"Erscheinungsbild",theme:"Thema",useDefault:"Standard verwenden",light:"Hell",dark:"Dunkel",keyboardShortcuts:"Tastaturkürzel",configureKeyboardShortcuts:"Tastaturkürzel konfigurieren",configure:"Konfigurieren",clipboardClearTimeout:"Zwischenablage nach dem Kopieren automatisch löschen",clipboardClearTimeoutDescription:"Zwischenablage nach dem Kopieren sensibler Daten automatisch löschen",clipboardClearDisabled:"Niemals löschen",clipboardClear5Seconds:"Nach 5 Sekunden löschen",clipboardClear10Seconds:"Nach 10 Sekunden löschen",clipboardClear15Seconds:"Nach 15 Sekunden löschen",autoLockTimeout:"Sperr-Timeout",autoLockTimeoutDescription:"Tresor bei Inaktivität automatisch sperren",autoLockTimeoutHelp:"Der Tresor wird erst nach dem angegebenen Zeitraum der Inaktivität gesperrt (keine Nutzung von Autofill oder Öffnen des Erweiterungs-Popups). Der Tresor wird immer gesperrt, wenn der Browser geschlossen wird, unabhängig von dieser Einstellung.",autoLockNever:"Niemals",autoLock15Seconds:"15 Sekunden",autoLock1Minute:"1 Minute",autoLock5Minutes:"5 Minuten",autoLock15Minutes:"15 Minuten",autoLock30Minutes:"30 Minuten",autoLock1Hour:"1 Stunde",autoLock4Hours:"4 Stunden",autoLock8Hours:"8 Stunden",autoLock24Hours:"24 Stunden",versionPrefix:"Version ",autofillSettings:"Autofill-Einstellungen",clipboardSettings:"Zwischenablage-Einstellungen",contextMenuSettings:"Kontextmenü-Einstellungen",passkeySettings:"Passkey-Einstellungen",contextMenu:"Kontextmenü",contextMenuEnabled:"Kontextmenü ist aktiviert",contextMenuDisabled:"Kontextmenü ist deaktiviert",contextMenuDescription:"Rechtsklicke auf Eingabefelder, um auf AliasVault-Optionen zuzugreifen",selectLanguage:"Sprache auswählen",serverConfiguration:"Serverkonfiguration",serverConfigurationDescription:"AliasVault-Server-URL für selbstgehostete Instanzen konfigurieren",customApiUrl:"API-URL",customClientUrl:"Client-URL",apiUrlHint:"Die API-Endpunkt-URL (normalerweise Client-URL + /api)",clientUrlHint:"Die URL der Webschnittstelle Deiner selbst gehosteten Instanz",autofillSettingsDescription:"Aktiviere oder deaktiviere das Autofill-Popup auf Webseiten",autofillEnabledDescription:"Autofill-Vorschläge werden auf den Anmeldeformularen angezeigt",autofillDisabledDescription:"Autofill-Vorschläge sind global deaktiviert",languageSettings:"Sprache",validation:{apiUrlRequired:"API-URL ist erforderlich",apiUrlInvalid:"Bitte gib eine gültige API-URL ein",clientUrlRequired:"Client-URL ist erforderlich",clientUrlInvalid:"Bitte gib eine gültige Client-URL ein"},unlockMethod:{title:"Methode zum Entsperren des Tresors",introText:"Wähle, wie Du Deinen Tresor entsperren möchtest. Du kannst Dein Master-Passwort verwenden (immer verfügbar) oder einen PIN-Code für einen schnelleren Zugriff einrichten. Nach drei fehlgeschlagenen PIN-Versuchen musst Du Dein Master-Passwort verwenden.",password:"Master-Passwort",pin:"PIN-Code",pinDescription:"Tresor mit PIN entsperren",setupPin:"PIN-Code einrichten",enterNewPinDescription:"PIN-Code aus mindestens 6 Ziffern eingeben",confirmPin:"PIN bestätigen",confirmPinDescription:"Zur Bestätigung PIN erneut eingeben",invalidPinFormat:"Ungültiges PIN-Format",pinMismatch:"PINs stimmen nicht überein",incorrectPin:"Falsche PIN. {{attemptsRemaining}} verbleibende Versuche.",incorrectPinSingular:"Falsche PIN. Ein Versuch übrig.",enableSuccess:"PIN-Sperre erfolgreich aktiviert!",pinLocked:"Die PIN-Sperre wurde deaktiviert. Bitte nutze Dein Master-Passwort, um Deinen Tresor zu entsperren.",pinSecurityWarning:"Die PIN-Entsperre in der Browser-Erweiterung kann weniger sicher Dein Master-Passwort sein, da PINs typischerweise eine niedrigere Entropie haben und möglicherweise gebruteforced werden können, wenn Dein Gerät kompromittiert wird. Benutze es nur auf Geräten, denen Du vollkommen vertraust."}},JN={passkey:"Passkey",site:"Seite",helpText:"Passkeys werden auf der Webseite erzeugt. Sie können nicht manuell erstellt oder bearbeitet werden. Um diesen Passkey zu entfernen, kannst Du ihn von diesem Zugang löschen. Um einen Passkey zu ersetzen oder neu zu erstellen, rufe die entsprechende Webseite auf und folge den dortigen Anweisungen.",passkeyMarkedForDeletion:"Passkey zum Löschen vorgemerkt",passkeyWillBeDeleted:"Dieser Passkey wird gelöscht, wenn Du den Zugang speicherst.",useBrowserPasskey:"Browser-Passkey verwenden",bypass:{description:"Wie lange möchtest Du den Passkey-Anbieter des Browsers für {{origin}} verwenden?",thisTimeOnly:"Nur dieses Mal",alwaysForSite:"Für diese Seite immer"},authenticate:{title:"Mit Passkey anmelden",signInFor:"Mit Passkey anmelden für",selectPasskey:"Wähle einen Passkey zum Anmelden aus:",noPasskeysFound:"Kein Passkey für diese Seite gefunden"},create:{title:"Passkey erstellen",createFor:"Neuen Passkey erstellen für",titleLabel:"Titel",titlePlaceholder:"Gib einen Namen für diesen Passkey ein",createButton:"Passkey erstellen",selectPasskeyToReplace:"Wähle einen Passkey zum Ersetzen:",createNewPasskey:"Neuen Passkey erstellen",replacingPasskey:"Ersetzen des Passkeys: {{displayName}}",confirmReplace:"Ersetzen bestätigen",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey-Anbieter",passkeyProviderOn:"Passkey-Anbieter an "}},XN={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},$N={title:"Tresor aktualisieren",subtitle:"AliasVault wurde aktualisiert. Dadurch muss auch Dein Tresor aktualisiert werden. Dies sollte nur wenige Sekunden dauern.",versionInformation:"Versionsinformationen",yourVault:"Version Deines Tresors:",newVersion:"Neue verfügbare Version:",upgrade:"Tresor aktualisieren",upgrading:"Aktualisieren...",whatsNew:"Neu in dieser Version",whatsNewDescription:"Eine Aktualisierung ist erforderlich, um die folgenden Änderungen zu unterstützen:",noDescriptionAvailable:"Für diese Version ist keine Beschreibung vorhanden.",alerts:{unableToGetVersionInfo:"Versionsinformationen konnten nicht abgerufen werden. Bitte versuche es erneut.",selfHostedServer:"Selbstgehosteter Server",selfHostedWarning:"Nutzt Du einen selbst gehosteten Server, musst Du Deine Instanz ebenfalls updaten. Andernfalls kannst Du Dich im Web-Client nicht mehr anmelden.",continueUpgrade:"Aktualisierung fortsetzen",upgradeFailed:"Aktualisierung fehlgeschlagen",failedToApplyMigration:"Migration fehlgeschlagen ({{current}} von {{total}})"}},ZN={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},ex={auth:jN,menu:PN,common:HN,content:QN,items:zN,itemTypes:VN,fieldLabels:KN,totp:GN,attachmentUploader:qN,emails:WN,settings:YN,passkeys:JN,recentlyDeleted:XN,upgrade:$N,logout:ZN},tx={loginTitle:"Log in to AliasVault",username:"Username or email",usernamePlaceholder:"name / name@company.com",passwordPlaceholder:"Enter your password",rememberMe:"Remember me",loginButton:"Log in",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",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",unlockWithPin:"Unlock with PIN",enterPinToUnlock:"Enter your PIN to unlock your vault",useMasterPassword:"Use Master Password",unlockTitle:"Unlock Your Vault",logoutConfirm:"Are you sure you want to logout?",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?",loginWithMobile:"Log in using Mobile App",unlockWithMobile:"Unlock using Mobile App",scanQrCode:"Scan this QR code with your AliasVault mobile app to log in and unlock your vault.",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.",wrongPassword:"Incorrect password. Please try again.",sessionExpired:"Your session has expired. Please log in again.",mobileLoginRequestExpired:"Mobile login request timed out. Please reload the page and try again."}},ax={vault:"Vault",emails:"Emails"},nx={loading:"Loading...",notice:"Notice",error:"Error",cancel:"Cancel",confirm:"Confirm",back:"Back",next:"Next",use:"Use",add:"Add",delete:"Delete",undo:"Undo",save:"Save",saving:"Saving...",create:"Create",or:"Or",close:"Close",logout:"Logout",copied:"Copied!",openInNewWindow:"Open in new window",enabled:"Enabled",disabled:"Disabled",showPassword:"Show password",hidePassword:"Hide password",showDetails:"Show details",hideDetails:"Hide details",copyToClipboard:"Copy to clipboard",loadingEmails:"Loading emails...",loadingTotpCodes:"Loading TOTP codes...",attachments:"Attachments",loadingAttachments:"Loading attachments...",settings:"Settings",recentEmails:"Recent emails",credentials:"Credentials",customFields:"Custom Fields",twoFactorAuthentication:"Two-factor authentication",alias:"Alias",notes:"Notes",email:"Email",username:"Username",password:"Password",generate:"Generate",serviceName:"Service Name",loggedIn:"Logged in",syncingVault:"Syncing vault",checkingVaultUpdates:"Checking for vault updates",syncingUpdatedVault:"Syncing updated vault",loadMore:"Load more",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{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.",browserExtensionOutdated:"This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.",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.",serverVersionTooOld:"The AliasVault server needs to be updated to a newer version in order to use this feature. Please contact the server admin if you need help.",unknownError:"An unknown error occurred",unknownErrorTryAgain:"An unknown error occurred. Please try again.",vaultNotAvailable:"Vault not available",vaultIsLocked:"Vault is locked",passwordChanged:"Your password has changed since the last time you logged in. Please login again for security reasons.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},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.",INVALID_REFRESH_TOKEN:"Invalid refresh token.",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."}},rx={or:"or",new:"New",vaultLocked:"AliasVault is locked.",creatingNewAlias:"Creating new alias...",noMatchesFound:"No matches found",searchVault:"Search vault...",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",openAliasVaultToUpgrade:"Open AliasVault to upgrade",vaultUpgradeRequired:"Vault upgrade required.",dismissPopup:"Dismiss popup"},ix={title:"Items",itemName:"Name",loginCredentials:"Login Credentials",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Create Folder",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Folder",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.",noPasskeysFound:"No passkeys have been created yet. Passkeys are created by visiting a website that offers passkeys as an authentication method.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Tags",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.)",privateEmailTitle:"Private Email",privateEmailAliasVaultServer:"AliasVault server",privateEmailDescription:"E2E encrypted, fully private.",publicEmailTitle:"Public Temp Email Providers",publicEmailDescription:"Anonymous but limited privacy. Email content is readable by anyone that knows the address.",validation:{required:"This field is required"}},sx={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"Email",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},ox={"login.url":"Website URL","login.username":"Username","login.password":"Password","alias.first_name":"First Name","alias.last_name":"Last Name","alias.gender":"Gender","alias.birthdate":"Birthdate","login.email":"Email","notes.content":"Notes","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},lx={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"Name (optional)",secretKey:"Secret Key",saveToViewCode:"Save to view code",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},cx={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},ux={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",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.",offlineMessage:"You are offline. Please connect to the internet to load your emails.",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"},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."}},dx={serverUrl:"Server URL",language:"Language",autofillEnabled:"Enable Autofill",version:"Version",openWebApp:"Open web app",lock:"Lock",globalSettings:"Global Settings",autofillPopup:"Autofill popup",activeOnAllSites:"Active on all sites (unless disabled below)",disabledOnAllSites:"Disabled on all sites",rightClickContextMenu:"Right-click context menu",autofillMatching:"Autofill Matching",autofillMatchingMode:"Autofill matching mode",autofillMatchingModeDescription:"Determines which credentials are considered a match and shown as suggestions in the autofill popup for a given website.",autofillMatchingDefault:"URL + subdomain + name wildcard",autofillMatchingUrlSubdomain:"URL + subdomain",autofillMatchingUrlExact:"Exact URL domain only",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",clipboardClearTimeout:"Clear clipboard after copying",clipboardClearTimeoutDescription:"Automatically clear the clipboard after copying sensitive data",clipboardClearDisabled:"Never clear",clipboardClear5Seconds:"Clear after 5 seconds",clipboardClear10Seconds:"Clear after 10 seconds",clipboardClear15Seconds:"Clear after 15 seconds",autoLockTimeout:"Auto-lock Timeout",autoLockTimeoutDescription:"Automatically lock the vault after a period of inactivity",autoLockTimeoutHelp:"The vault will only lock after the specified period of inactivity (no autofill usage or extension popup opened). The vault will always lock when the browser is closed, regardless of this setting.",autoLockNever:"Never",autoLock15Seconds:"15 seconds",autoLock1Minute:"1 minute",autoLock5Minutes:"5 minutes",autoLock15Minutes:"15 minutes",autoLock30Minutes:"30 minutes",autoLock1Hour:"1 hour",autoLock4Hours:"4 hours",autoLock8Hours:"8 hours",autoLock24Hours:"24 hours",versionPrefix:"Version ",autofillSettings:"Autofill Settings",clipboardSettings:"Clipboard Settings",contextMenuSettings:"Context Menu Settings",passkeySettings:"Passkey Settings",contextMenu:"Context Menu",contextMenuEnabled:"Context menu is enabled",contextMenuDisabled:"Context menu is disabled",contextMenuDescription:"Right-click on input fields to access AliasVault options",selectLanguage:"Select Language",serverConfiguration:"Server Configuration",serverConfigurationDescription:"Configure the AliasVault server URL for self-hosted instances",customApiUrl:"API URL",customClientUrl:"Client URL",apiUrlHint:"The API endpoint URL (usually client URL + /api)",clientUrlHint:"The web interface URL of your self-hosted instance",autofillSettingsDescription:"Enable or disable the autofill popup on web pages",autofillEnabledDescription:"Autofill suggestions will appear on login forms",autofillDisabledDescription:"Autofill suggestions are disabled globally",languageSettings:"Language",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"},unlockMethod:{title:"Vault Unlock Method",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"Master Password",pin:"PIN Code",pinDescription:"Unlock vault with PIN code",setupPin:"Setup PIN Code",enterNewPinDescription:"Enter a PIN code consisting of minimum 6 digits",confirmPin:"Confirm PIN",confirmPinDescription:"Enter your PIN again to confirm",invalidPinFormat:"Invalid PIN format",pinMismatch:"PINs do not match",incorrectPin:"Incorrect PIN. {{attemptsRemaining}} attempts remaining.",incorrectPinSingular:"Incorrect PIN. 1 attempt remaining.",enableSuccess:"PIN unlock enabled successfully!",pinLocked:"PIN unlock has been disabled. Please use your master password to unlock your vault.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},mx={passkey:"Passkey",site:"Site",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Passkey marked for deletion",passkeyWillBeDeleted:"This passkey will be deleted when you save this credential.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"This time only",alwaysForSite:"Always for this site"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"Title",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"Confirm Replace",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},fx={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},gx={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 version:",newVersion:"New available version:",upgrade:"Upgrade Vault",upgrading:"Upgrading...",whatsNew:"What's New",whatsNewDescription:"An upgrade is required to support the following changes:",noDescriptionAvailable:"No description available for this version.",alerts:{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.",continueUpgrade:"Continue Upgrade",upgradeFailed:"Upgrade Failed",failedToApplyMigration:"Failed to apply migration ({{current}} of {{total}})"}},hx={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},Ax={auth:tx,menu:ax,common:nx,content:rx,items:ix,itemTypes:sx,fieldLabels:ox,totp:lx,attachmentUploader:cx,emails:ux,settings:dx,passkeys:mx,recentlyDeleted:fx,upgrade:gx,logout:hx},px={loginTitle:"Iniciar sesión en AliasVault",username:"Nombre de usuario o correo electrónico",usernamePlaceholder:"nombre / nombre@empresa.com",passwordPlaceholder:"Introduzca su contraseña",rememberMe:"Recordar mis datos",loginButton:"Iniciar sesión",noAccount:"¿Sin cuenta todavía?",createVault:"Crear nueva bóveda",twoFactorTitle:"Por favor, introduzca el código de autenticación de su aplicación de autenticación.",authCode:"Código de autenticación",authCodePlaceholder:"Introduzca código de 6 dígitos",verify:"Verificar",twoFactorNote:"Nota: si no tiene acceso a su dispositivo de autenticación, puede restablecer su 2FA con un código de recuperación iniciando sesión a través del sitio web.",masterPassword:"Contraseña Maestra",unlockVault:"Desbloquear",unlockWithPin:"Desbloquear con PIN",enterPinToUnlock:"Introduzca su PIN para desbloquear su bóveda",useMasterPassword:"Usar Contraseña Maestra",unlockTitle:"Desbloquear tu Bóveda",logoutConfirm:"¿Estás seguro de que quieres cerrar sesión?",unlockSuccessTitle:"Tu bóveda se ha desbloqueado correctamente",unlockSuccessDescription:"Ahora puede utilizar el autocompletado en los formularios de inicio de sesión en su navegador.",closePopup:"Cerrar esta ventana emergente",browseVault:"Navegar en el contenido de la bóveda",connectingTo:"Conectando con",switchAccounts:"¿Cambiar de cuenta?",loginWithMobile:"Iniciar sesión con la aplicación móvil",unlockWithMobile:"Desbloquear con la aplicación móvil",scanQrCode:"Escanea este código QR con tu aplicación móvil de AliasVault para iniciar sesión y desbloquear tu bóveda.",errors:{invalidCode:"Por favor, introduzca un código de autenticación de 6 dígitos válido.",serverError:"No se pudo llegar al servidor AliasVault. Por favor, inténtelo de nuevo más tarde o póngase en contacto con el soporte si el problema persiste.",wrongPassword:"Contraseña incorrecta. Por favor, inténtelo de nuevo.",sessionExpired:"Su sesión ha caducado. Por favor, inicie sesión de nuevo.",mobileLoginRequestExpired:"Se ha agotado el tiempo de inicio de sesión del móvil. Por favor, vuelva a cargar la página e inténtelo de nuevo."}},yx={vault:"Bóveda",emails:"Correos electrónicos"},Ex={loading:"Cargando...",notice:"Aviso",error:"Error",cancel:"Cancelar",confirm:"Confirmar",back:"Atrás",next:"Siguiente",use:"Usar",add:"Añadir",delete:"Borrar",undo:"Deshacer",save:"Guardar",saving:"Guardando...",create:"Crear",or:"O",close:"Cerrar",logout:"Cerrar sesión",copied:"¡Copiado!",openInNewWindow:"Abrir en una ventana nueva",enabled:"Habilitado",disabled:"Desactivado",showPassword:"Mostrar contraseña",hidePassword:"Ocultar contraseña",showDetails:"Mostrar detalles",hideDetails:"Ocultar detalles",copyToClipboard:"Copiar al portapapeles",loadingEmails:"Cargando email...",loadingTotpCodes:"Cargando códigos TOTP...",attachments:"Archivos adjuntos",loadingAttachments:"Cargando archivos adjuntos...",settings:"Configuración",recentEmails:"Correos recientes",credentials:"Credenciales",customFields:"Campos Personalizados",twoFactorAuthentication:"Autenticación de doble factor",alias:"Alias",notes:"Notas",email:"Email",username:"Nombre de usuario",password:"Contraseña",generate:"Generar",serviceName:"Nombre del servicio",loggedIn:"Sesión iniciada",syncingVault:"Sincronizando bóveda",checkingVaultUpdates:"Comprobando actualizaciones de bóveda",syncingUpdatedVault:"Sincronizando bóveda actualizada",loadMore:"Cargar más",offline:"Desconectado",offlineMode:"Funcionando en modo sin conexión",pendingSync:"Sincronizando...",mergingVaultChanges:"Combinando cambios en la bóveda...",uploadingVault:"Subiendo bóveda...",errors:{serverNotAvailable:"El servidor AliasVault no está disponible. Por favor, inténtelo de nuevo más tarde o póngase en contacto con el soporte técnico si el problema persiste.",clientVersionNotSupported:"Esta versión de la extensión del navegador AliasVault ya no es compatible con el servidor. Por favor, actualice la extensión de su navegador a la última versión.",browserExtensionOutdated:"Esta extensión del navegador está desactualizada y no se puede utilizar para acceder a esta bóveda. Por favor, actualice esta extensión del navegador para continuar.",serverVersionNotSupported:"El servidor AliasVault necesita ser actualizado a una versión más reciente para poder usar esta extensión del navegador. Póngase en contacto con el soporte si necesita ayuda.",serverVersionTooOld:"El servidor AliasVault necesita ser actualizado a una versión más reciente para poder utilizar esta característica. Por favor, contacte con el administrador del servidor si necesita ayuda.",unknownError:"Se produjo un error desconocido",unknownErrorTryAgain:"Se ha producido un error desconocido. Por favor, inténtelo de nuevo.",vaultNotAvailable:"Bóveda no disponible",vaultIsLocked:"La bóveda está bloqueada",passwordChanged:"Tu contraseña ha cambiado desde la última vez que iniciaste sesión. Por favor, inicia sesión de nuevo por razones de seguridad.",syncConflictMaxRetries:"No se pudo sincronizar la bóveda después de múltiples intentos. Inténtalo de nuevo más tarde.",mergeFailed:"Error al combinar cambios en la bóveda. Por favor, inténtalo de nuevo."},apiErrors:{UNKNOWN_ERROR:"Se ha producido un error desconocido. Por favor, inténtelo de nuevo.",ACCOUNT_LOCKED:"Cuenta bloqueada temporalmente debido a demasiados intentos fallidos. Por favor, inténtelo de nuevo.",ACCOUNT_BLOCKED:"Tu cuenta ha sido desactivada. Si crees que esto es un error, ponte en contacto con soporte.",USER_NOT_FOUND:"Nombre de usuario o contraseña no válidos. Por favor, inténtelo de nuevo.",INVALID_AUTHENTICATOR_CODE:"Código de autenticación inválido. Por favor, inténtelo de nuevo.",INVALID_RECOVERY_CODE:"Código de recuperación inválido. Por favor, inténtelo de nuevo.",REFRESH_TOKEN_REQUIRED:"Se requiere un token de actualización.",INVALID_REFRESH_TOKEN:"Token de actualización inválido.",PUBLIC_REGISTRATION_DISABLED:"El registro de nueva cuenta está actualmente deshabilitado en este servidor. Por favor, contacte con el administrador.",USERNAME_REQUIRED:"Se requiere un nombre de usuario.",USERNAME_ALREADY_IN_USE:"El nombre de usuario ya está en uso.",USERNAME_AVAILABLE:"El nombre de usuario está disponible.",USERNAME_MISMATCH:"El nombre de usuario no coincide con el usuario actual.",PASSWORD_MISMATCH:"La contraseña proporcionada no coincide con su contraseña actual.",ACCOUNT_SUCCESSFULLY_DELETED:"Cuenta eliminada con éxito.",USERNAME_EMPTY_OR_WHITESPACE:"El nombre de usuario no puede estar vacío o en blanco.",USERNAME_TOO_SHORT:"Nombre de usuario demasiado corto: debe tener al menos 3 caracteres.",USERNAME_TOO_LONG:"Nombre de usuario demasiado largo: no puede tener más de 40 caracteres.",USERNAME_INVALID_EMAIL:"Dirección de correo electrónico inválida.",USERNAME_INVALID_CHARACTERS:"El nombre de usuario inválido, solo puede contener letras o dígitos.",VAULT_NOT_UP_TO_DATE:"Su bóveda no está actualizada. Por favor, sincronice su bóveda e inténtelo de nuevo.",INTERNAL_SERVER_ERROR:"Error interno del servidor.",VAULT_ERROR:"La bóveda local no está actualizada. Por favor, sincronice su bóveda actualizando la página e inténtelo de nuevo."}},bx={or:"o",new:"Nuevo",vaultLocked:"AliasVault está bloqueado.",creatingNewAlias:"Creando nuevo alias...",noMatchesFound:"No se han encontrado resultados",searchVault:"Buscar bóveda...",enterServiceName:"Introduzca el nombre del servicio",enterEmailAddress:"Introduzca la dirección de correo electrónico",enterUsername:"Introduzca nombre de usuario",hideFor1Hour:"Ocultar durante 1 hora (sitio actual)",hidePermanently:"Ocultar permanentemente (sitio actual)",createRandomAlias:"Crear alias aleatorio",createUsernamePassword:"Crear nombre de usuario / contraseña",randomAlias:"Alias aleatorio",usernamePassword:"Nombre de usuario/Contraseña",createAndSaveAlias:"Crear y guardar alias",createAndSaveCredential:"Crear y guardar credencial",randomIdentityDescription:"Generar una identidad aleatoria con una dirección de correo electrónico aleatoria accesible en AliasVault.",randomIdentityDescriptionDropdown:"Identidad aleatoria con correo electrónico aleatorio",manualCredentialDescription:"Especifique su propia dirección de correo electrónico y nombre de usuario.",manualCredentialDescriptionDropdown:"Nombre de usuario y contraseña manual",failedToCreateIdentity:"Error al crear la identidad. Por favor, inténtalo de nuevo.",enterEmailAndOrUsername:"Introduzca email y/o nombre de usuario",autofillWithAliasVault:"AutoFill con AliasVault",generateRandomPassword:"Generar contraseña aleatoria (copiar al portapapeles)",generateNewPassword:"Generar nueva contraseña",togglePasswordVisibility:"Cambiar la visibilidad de la contraseña",passwordCopiedToClipboard:"Contraseña copiada al portapapeles",openAliasVaultToUpgrade:"Abrir AliasVault para actualizar",vaultUpgradeRequired:"Actualización de bóveda requerida.",dismissPopup:"Descartar aviso"},Ix={title:"Elementos",itemName:"Nombre",loginCredentials:"Credenciales de inicio de sesión",cardInformation:"Información de la tarjeta",addItem:"Añadir elemento",addNewItem:"Añadir nuevo elemento",saveItem:"Guardar elemento",itemDetails:"Detalles del elemento",editItem:"Editar elemento",untitled:"Untitled",newFolder:"Nueva carpeta",createFolder:"Create Folder",editFolder:"Editar carpeta",folderName:"Nombre de la carpeta",folderNameRequired:"El nombre de la carpeta es obligatorio",folder:"Folder",welcomeTitle:"¡Bienvenido a AliasVault!",welcomeDescription:"Para utilizar la extensión del navegador AliasVault: vaya a un sitio web y utilice la ventana de autocompletado de AliasVault para crear una nueva credencial.",noPasskeysFound:"No se han creado llaves de acceso todavía. Las llaves se crean visitando un sitio web que ofrece llaves de acceso como método de autenticación.",noAttachmentsFound:"No hay elementos con archivos adjuntos",noItemsOfTypeFound:"No se encontraron elementos {{type}}",noMatchingItems:"No hay elementos coincidentes",noMatchingItemsSearch:'No hay elementos que coincidan con "{{search}}"',noMatchingItemsWithFilter:'No hay elementos {{filter}} que coincidan con "{{search}}"',clearSearch:"Limpiar búsqueda",clearFilter:"Eliminar filtros",emptyFolderHint:"Esta carpeta está vacía. Para mover elementos a esta carpeta, edite el elemento y pulse el icono de la carpeta en el campo nombre.",allItemsInFolders:"Todos sus elementos están organizados en carpetas. Haga clic en una carpeta para ver sus credenciales o utilice la búsqueda para encontrar elementos específicos.",deleteFolder:"Borrar carpeta",deleteFolderKeepItems:"Eliminar solo la carpeta",deleteFolderKeepItemsDescription:"Los elementos se moverán de nuevo a la lista principal.",deleteFolderAndItems:"Eliminar carpeta y todos los elementos",deleteFolderAndItemsDescription:"{{count}} elemento(s) serán movidos a Borrados Recientemente.",filters:{all:"(Todos) Elementos",passkeys:"Llaves de acceso"},deleteItemTitle:"Eliminar elemento",deleteItemConfirm:"¿Está seguro de querer borrar este ítem?",viewHistory:"Ver historial",history:"Historial",noHistoryAvailable:"Sin historial disponible",tags:"Tags",changePasswordComplexity:"Cambiar complejidad de contraseña",passwordLength:"Longitud de la contraseña",includeLowercase:"Incluye letras minúsculas",includeUppercase:"Incluye letras mayúsculas",includeNumbers:"Incluye números",includeSpecialChars:"Incluye caracteres especiales",avoidAmbiguousChars:"Evita caracteres ambiguos (o, 0, etc.)",privateEmailTitle:"Correo electrónico privado",privateEmailAliasVaultServer:"Servidor AliasVault",privateEmailDescription:"E2E cifrado, totalmente privado.",publicEmailTitle:"Proveedores de Correo Temporal Públicos",publicEmailDescription:"Privacidad anónima pero limitada. Contenido de correo electrónico puede ser leído por cualquiera que conozca la dirección.",validation:{required:"Se requiere este campo"}},vx={selectType:"Añadir nuevo elemento",typeLabel:"Tipo de elemento",creating:"Creando",editing:"Editando",regenerateAlias:"Regenerar alias",addCustomField:"Añadir campo personalizado",fieldLabel:"Etiqueta del campo",enterFieldName:"Introduzca el nombre del campo",fieldType:"Tipo de campo",fieldTypes:{text:"Texto",hidden:"Oculto (texto enmascarado)",email:"Correo",url:"URL",phone:"Teléfono",number:"Número",date:"Date",textArea:"Área de texto"},login:{title:"Iniciar sesión"},alias:{title:"Alias"},creditCard:{title:"Tarjeta de crédito"},note:{title:"Nota segura"}},wx={"login.url":"URL de la web","login.username":"Nombre de usuario","login.password":"Contraseña","alias.first_name":"Nombre","alias.last_name":"Apellido","alias.gender":"Género","alias.birthdate":"Fecha de nacimiento","login.email":"Correo","notes.content":"Notas","card.cardholder_name":"Nombre titular","card.number":"Número de Tarjeta","card.expiry_month":"Mes de expiración","card.expiry_year":"Año de expiración","card.cvv":"CVV","card.pin":"PIN"},Cx={addCode:"Añadir código 2FA",instructions:"Introduzca la clave secreta mostrada por el sitio web donde desea añadir autenticación de dos factores.",nameOptional:"Nombre (Opcional)",secretKey:"Clave secreta",saveToViewCode:"Guardar para ver el código",defaultName:"Autentificador",errors:{invalidSecretKey:"Formato de clave secreta inválida."}},Nx={uploading:"Subiendo...",uploadSuccess:"Archivos subidos con éxito.",deleteSuccess:"Adjunto eliminado correctamente.",firefoxExpandRequired:"Para subir archivos, utilice la ventana ampliada.",openExpandedWindow:"Abrir ventana ampliada"},xx={title:"Correos electrónicos",deleteEmailTitle:"Eliminar correo",deleteEmailConfirm:"¿Está seguro que desea eliminar permanentemente este correo electrónico?",from:"De",to:"Para",date:"Fecha",emailContent:"Contenido del correo electrónico",emailNotFound:"Correo electrónico no encontrado",noEmails:"No se han encontrado correos electrónicos",noEmailsDescription:"No has recibido ningún correo electrónico en tus direcciones privadas todavía. Cuando recibas un nuevo correo electrónico, aparecerá aquí.",offlineMessage:"Está desconectado. Por favor, conéctese a Internet para cargar sus correos electrónicos.",dateFormat:{justNow:"ahora mismo",minutesAgo_single:"Hace {{count}} min",minutesAgo_plural:"Hace {{count}} min",hoursAgo_single:"Hace {{count}} h",hoursAgo_plural:"Hace {{count}} h",yesterday:"ayer"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"La dirección de correo electrónico elegida actualmente ya está en uso. Por favor, cambie la dirección de correo electrónico editando esta credencial.",CLAIM_DOES_NOT_EXIST:"Ocurrió un error mientras se trataba de cargar los correos electrónicos. Por favor, intente editar y guardar la entrada de credenciales para sincronizar la base de datos, y vuelva a intentarlo."}},Tx={serverUrl:"URL del servidor",language:"Idioma",autofillEnabled:"Activar autocompletado",version:"Versión",openWebApp:"Abrir la aplicación web",lock:"Bloquear",globalSettings:"Ajustes globales",autofillPopup:"Ventana de autorrellenado",activeOnAllSites:"Activo en todos los sitios (a menos que se deshabilite debajo)",disabledOnAllSites:"Deshabilitado en todos los sitios",rightClickContextMenu:"Menú contextual del clic derecho",autofillMatching:"Coincidencia de autocompletado",autofillMatchingMode:"Modo de coincidencia de autocompletado",autofillMatchingModeDescription:"Determina qué credenciales se consideran coincidentes y se muestran como sugerencias en el popup de autorrelleno de un sitio web determinado.",autofillMatchingDefault:"URL + subdominio + nombre wildcard",autofillMatchingUrlSubdomain:"URL + subdominio",autofillMatchingUrlExact:"Solo URL exacta",siteSpecificSettings:"Ajustes específicos del sitio",autofillPopupOn:"Ventana de autorrelleno ",enabledForThisSite:"Habilitado para este sitio",disabledForThisSite:"Deshabilitado para este sitio",temporarilyDisabledUntil:"Deshabilitado temporalmente hasta ",resetAllSiteSettings:"Reiniciar todos los ajustes específicos del sitio",appearance:"Apariencia",theme:"Tema",useDefault:"Uso por defecto",light:"Claro",dark:"Oscuro",keyboardShortcuts:"Atajos de teclado",configureKeyboardShortcuts:"Configurar atajos de teclado",configure:"Configurar",clipboardClearTimeout:"Limpiar portapapeles después de copiar",clipboardClearTimeoutDescription:"Limpiar automáticamente el portapapeles después de copiar datos sensibles",clipboardClearDisabled:"Nunca limpiar",clipboardClear5Seconds:"Limpiar después 5 segundos",clipboardClear10Seconds:"Limpiar después 10 segundos",clipboardClear15Seconds:"Limpiar después 15 segundos",autoLockTimeout:"Tiempo de bloqueo automático",autoLockTimeoutDescription:"Bloquear automáticamente la bóveda después de un período de inactividad",autoLockTimeoutHelp:"La bóveda sólo se bloqueará después del período especificado de inactividad (no se abrirá el uso de autocompletado o la ventana emergente). La bóveda siempre se bloqueará cuando el navegador esté cerrado, independientemente de esta configuración.",autoLockNever:"Nunca",autoLock15Seconds:"15 segundos",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minutos",autoLock15Minutes:"15 minutos",autoLock30Minutes:"30 minutos",autoLock1Hour:"1 hora",autoLock4Hours:"4 horas",autoLock8Hours:"8 horas",autoLock24Hours:"24 horas",versionPrefix:"Versión ",autofillSettings:"Ajustes de autocompletado",clipboardSettings:"Ajustes del portapapeles",contextMenuSettings:"Ajustes del menú contextual",passkeySettings:"Ajustes de llaves de acceso",contextMenu:"Menú Contextual",contextMenuEnabled:"El menú contextual está activado",contextMenuDisabled:"El menú contextual está desactivado",contextMenuDescription:"Haga clic derecho en los campos de entrada para acceder a las opciones de AliasVault",selectLanguage:"Seleccionar idioma",serverConfiguration:"Configuración del servidor",serverConfigurationDescription:"Configurar la URL del servidor AliasVault para instancias self-hosted",customApiUrl:"API URL",customClientUrl:"URL de Cliente",apiUrlHint:"La URL del endpoint de la API (generalmente URL del cliente + /api)",clientUrlHint:"La URL de la interfaz web de su instancia self-hosted",autofillSettingsDescription:"Activar o desactivar la ventana emergente de autorrelleno en páginas web",autofillEnabledDescription:"Las sugerencias de autorrelleno aparecerán en los formularios de inicio de sesión",autofillDisabledDescription:"Las sugerencias de autorrelleno están desactivadas globalmente",languageSettings:"Idioma",validation:{apiUrlRequired:"La URL de la API es necesaria",apiUrlInvalid:"Por favor, introduzca una URL de API válida",clientUrlRequired:"La URL de cliente es necesaria",clientUrlInvalid:"Por favor, introduzca una URL de cliente válida"},unlockMethod:{title:"Método de desbloqueo de la bóveda",introText:"Elija cómo desea desbloquear su bóveda. Puede utilizar su contraseña maestra (siempre disponible) o configurar un código PIN para un acceso más rápido. Después de 3 intentos fallidos de PIN, necesitarás usar tu contraseña maestra.",password:"Contraseña Maestra",pin:"Código PIN",pinDescription:"Desbloquear bóveda con código PIN",setupPin:"Configurar código PIN",enterNewPinDescription:"Introduzca un código PIN que contenga un mínimo de 6 dígitos",confirmPin:"Confirmar PIN",confirmPinDescription:"Introduzca su PIN de nuevo para confirmar",invalidPinFormat:"Formato PIN inválido",pinMismatch:"Los PINs no coinciden",incorrectPin:"PIN incorrecto, {{attemptsRemaining}} intentos restantes.",incorrectPinSingular:"PIN incorrecto. 1 intento restante.",enableSuccess:"¡PIN activado con éxito!",pinLocked:"El desbloqueo con PIN ha sido deshabilitado. Por favor, utiliza tu contraseña maestra para desbloquear tu bóveda.",pinSecurityWarning:"El PIN de desbloqueo en la extensión del navegador puede ser menos seguro que su contraseña maestra, ya que los PIN típicamente tienen menos entropía y se pueden obtener por fuerza bruta si su dispositivo está en peligro. Úselo sólo en dispositivos en los que confíe plenamente."}},Sx={passkey:"Llave de acceso",site:"Sitio",helpText:"Las llaves de acceso se crean en el sitio web cuando se le solicite. No pueden ser editadas manualmente. Para eliminar esta clave, puede eliminarla de esta credencial. Para reemplazar esta clave de acceso o crear una nueva, visite el sitio web y siga sus indicaciones.",passkeyMarkedForDeletion:"Llave de acceso marcada para eliminar",passkeyWillBeDeleted:"Esta llave de acceso se eliminará cuando guarde esta credencial.",useBrowserPasskey:"Usar llave de acceso del navegador",bypass:{description:"¿Cuánto tiempo quieres usar el proveedor de llaves de acceso del navegador para {{origin}}?",thisTimeOnly:"Solo esta vez",alwaysForSite:"Siempre para este sitio"},authenticate:{title:"Iniciar sesión con llave de acceso",signInFor:"Iniciar sesión con llave para",selectPasskey:"Seleccione una llave de acceso para iniciar sesión:",noPasskeysFound:"No se encontraron llaves de acceso para este sitio"},create:{title:"Crear llave de acceso",createFor:"Crear nueva llave de acceso para",titleLabel:"Título",titlePlaceholder:"Introduzca un nombre para esta llave de acceso",createButton:"Crear llave de acceso",selectPasskeyToReplace:"Seleccione una llave de acceso para reemplazar:",createNewPasskey:"Crear nueva llave de acceso",replacingPasskey:"Reemplazando llave de acceso: {{displayName}}",confirmReplace:"Confirmar reemplazo",selectExistingLogin:"Añadir al inicio de sesión existente:",selectExistingLoginDescription:"Adjuntar esta llave a una credencial de inicio de sesión existente para este sitio.",attachingToCredential:"Añadiendo llave a: {{serviceName}}",attachPasskey:"Añadir llave de acceso"},settings:{passkeyProvider:"Proveedor de llave de acceso",passkeyProviderOn:"Proveedor de llave de acceso en "}},kx={title:"Eliminados recientemente",noItems:"No hay elementos eliminados",noItemsDescription:"Los elementos que elimines aparecerán aquí durante 30 días antes de ser eliminados permanentemente.",description:"Estos elementos se eliminarán permanentemente después de 30 días. Puede restaurarlos o eliminarlos inmediatamente.",restore:"Restaurar",deletePermanently:"Eliminar permanentemente",emptyAll:"Vaciar todo",daysRemaining_one:"{{count}} día restante",daysRemaining_other:"{{count}} días restantes",expiringSoon:"Caduca pronto",confirmDeleteTitle:"¿Eliminar permanentemente?",confirmDeleteMessage:"Este elemento se eliminará permanentemente y no se puede recuperar.",confirmEmptyAllTitle:"¿Vaciar los recientemente eliminados?",confirmEmptyAllMessage:"Todos los elementos {{count}} se eliminarán permanentemente y no se podrán recuperar."},Lx={title:"Actualizar bóveda",subtitle:"AliasVault se ha actualizado y tu bóveda necesita ser actualizada. Esto solo debería tardar unos segundos.",versionInformation:"Información de versión",yourVault:"Tu versión de bóveda:",newVersion:"Nueva versión disponible:",upgrade:"Actualizar bóveda",upgrading:"Actualizando...",whatsNew:"Novedades",whatsNewDescription:"Se requiere una actualización para soportar los siguientes cambios:",noDescriptionAvailable:"Ninguna descripción disponible para esta versión.",alerts:{unableToGetVersionInfo:"No se pudo obtener información de la versión. Por favor, inténtalo de nuevo.",selfHostedServer:"Servidor autoalojado",selfHostedWarning:"Si está utilizando un servidor autoalojado, asegúrese de actualizar su instancia autoalojada, ya que de lo contrario iniciar sesión en el cliente web dejará de funcionar.",continueUpgrade:"Continuar actualización",upgradeFailed:"Actualización fallida",failedToApplyMigration:"Error al migrar de ({{current}} a {{total}})"}},Rx={unsyncedChangesTitle:"Cambios no sincronizados",unsyncedChangesWarning:"Tienes cambios no sincronizados que se perderán si te desconectas ahora. ¿Estás seguro de que quieres continuar?",logoutAnyway:"Cerrar sesión de todos modos"},Dx={auth:px,menu:yx,common:Ex,content:bx,items:Ix,itemTypes:vx,fieldLabels:wx,totp:Cx,attachmentUploader:Nx,emails:xx,settings:Tx,passkeys:Sx,recentlyDeleted:kx,upgrade:Lx,logout:Rx},Bx={loginTitle:"Kirjaudu sisään AliasVaultiin",username:"Käyttäjänimi tai sähköposti",usernamePlaceholder:"nimi / nimi@yritys.fi",passwordPlaceholder:"Syötä salasanasi",rememberMe:"Muista minut",loginButton:"Kirjaudu sisään",noAccount:"Eikö tiliä vielä ole?",createVault:"Luo uusi holvi",twoFactorTitle:"Syötä tunnistautumiskoodi tunnistautumissovelluksestasi.",authCode:"Tunnistautumiskoodi",authCodePlaceholder:"Syötä 6-numeroinen koodi",verify:"Vahvista",twoFactorNote:"Huomautus: jos sinulla ei ole pääsyä tunnistautumislaitteeseen, voit palauttaa 2FA:n palautuskoodilla kirjautumalla sisään sivuston kautta.",masterPassword:"Pääsalasana",unlockVault:"Avaa lukitus",unlockWithPin:"Avaa PIN-koodilla",enterPinToUnlock:"Syötä PIN-koodi avataksesi holvisi",useMasterPassword:"Käytä pääsalasanaa",unlockTitle:"Avaa holvisi lukitus",logoutConfirm:"Oletko varma, että haluat kirjautua ulos?",unlockSuccessTitle:"Holvisi lukitus on avattu",unlockSuccessDescription:"Voit nyt käyttää automaattista täyttöä sisäänkirjautumislomakkeissa selaimessasi.",closePopup:"Sulje tämä ponnahdusikkuna",browseVault:"Selaa holvin sisältöä",connectingTo:"Yhdistetään kohteeseen",switchAccounts:"Vaihdetaanko tiliä?",loginWithMobile:"Kirjaudu sisään mobiilisovelluksella",unlockWithMobile:"Avaa käyttämällä mobiilisovellusta",scanQrCode:"Skannaa tämä QR-koodi AliasVault-mobiilisovelluksellasi kirjautuaksesi sisään ja avataksesi holvisi.",errors:{invalidCode:"Syötä kelvollinen 6-numeroinen tunnistautumiskoodi.",serverError:"AliasVault-palvelimeen ei saatu yhteyttä. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.",wrongPassword:"Virheellinen salasana. Yritä uudelleen.",sessionExpired:"Istuntosi on vanhentunut. Kirjaudu sisään uudelleen.",mobileLoginRequestExpired:"Mobiilikirjautumispyyntö aikakatkaistiin. Lataa sivu uudelleen ja yritä uudelleen."}},Ux={vault:"Holvi",emails:"Sähköpostit"},_x={loading:"Ladataan...",notice:"Huomautus",error:"Virhe",cancel:"Peruuta",confirm:"Vahvista",back:"Takaisin",next:"Seuraava",use:"Käytä",add:"Lisää",delete:"Poista",undo:"Kumoa",save:"Tallenna",saving:"Saving...",create:"Luo",or:"Tai",close:"Sulje",logout:"Uloskirjautuminen",copied:"Kopioitu!",openInNewWindow:"Avaa uudessa ikkunassa",enabled:"Otettu käyttöön",disabled:"Pois käytöstä",showPassword:"Näytä salasana",hidePassword:"Piilota salasana",showDetails:"Näytä tiedot",hideDetails:"Piilota tiedot",copyToClipboard:"Kopioi leikepöydälle",loadingEmails:"Ladataan sähköposteja...",loadingTotpCodes:"Ladataan TOTP-koodeja...",attachments:"Liitteet",loadingAttachments:"Ladataan liitteitä...",settings:"Asetukset",recentEmails:"Viimeaikaiset sähköpostit",credentials:"Tunnistetiedot",customFields:"Räätälöidyt kentät",twoFactorAuthentication:"Kaksivaiheinen tunnistautuminen",alias:"Alias",notes:"Huomautukset",email:"Sähköposti",username:"Käyttäjänimi",password:"Salasana",generate:"Generate",serviceName:"Palvelun nimi",loggedIn:"Sisäänkirjautuneena",syncingVault:"Synkronoidaan holvia",checkingVaultUpdates:"Tarkistetaan holvin päivitysten varalta",syncingUpdatedVault:"Synkronoidaan päivitettyä holvia",loadMore:"Lataa lisää",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Yhdistetään holvin muutoksia...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"AliasVault-palvelin ei ole käytettävissä. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.",clientVersionNotSupported:"Palvelin ei enää tue tätä AliasVault-selainlaajennuksen versiota. Päivitä selaimen laajennus uusimpaan versioon.",browserExtensionOutdated:"Tämä selainlaajennus on vanhentunut, eikä sillä voi saada pääsyä tähän holviin. Päivitä tämä selainlaajennus jatkaaksesi.",serverVersionNotSupported:"AliasVault-palvelin on päivitettävä uudempaan versioon, jotta voit käyttää tätä selainlaajennusta. Ota yhteyttä tukeen, jos tarvitset apua.",serverVersionTooOld:"AliasVault-palvelin on päivitettävä uudempaan versioon, jotta se voi käyttää tätä ominaisuutta. Ota yhteyttä palvelimen ylläpitäjään jos tarvitset apua.",unknownError:"Tapahtui tuntematon virhe",unknownErrorTryAgain:"Tapahtui tuntematon virhe. Yritä uudelleen.",vaultNotAvailable:"Holvi ei käytettävissä",vaultIsLocked:"Holvi on lukittu",passwordChanged:"Salasanasi on muuttunut edellisen sisäänkirjautumisen jälkeen. Kirjaudu sisään uudelleen turvallisuussyistä.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Tapahtui tuntematon virhe. Yritä uudelleen.",ACCOUNT_LOCKED:"Tili tilapäisesti lukittu liian monen epäonnistuneen yrityksen vuoksi. Yritä myöhemmin uudelleen.",ACCOUNT_BLOCKED:"Tilisi on poistettu käytöstä. Jos uskot, että tämä on virhe, ota yhteyttä tukeen.",USER_NOT_FOUND:"Virheellinen käyttäjänimi tai salasana. Yritä uudelleen.",INVALID_AUTHENTICATOR_CODE:"Virheellinen tunnistautumiskoodi. Yritä uudelleen.",INVALID_RECOVERY_CODE:"Virheellinen palautuskoodi. Yritä uudelleen.",REFRESH_TOKEN_REQUIRED:"Virkistyspoletti vaaditaan.",INVALID_REFRESH_TOKEN:"Virheellinen virkistyspoletti.",PUBLIC_REGISTRATION_DISABLED:"Uuden tilin rekisteröinti on tällä hetkellä poistettu käytöstä tällä palvelimella. Ota yhteyttä järjestelmänvalvojaan.",USERNAME_REQUIRED:"Käyttäjänimi vaaditaan.",USERNAME_ALREADY_IN_USE:"Käyttäjänimi on jo käytössä.",USERNAME_AVAILABLE:"Käyttäjänimi on saatavilla.",USERNAME_MISMATCH:"Käyttäjänimi ei vastaa nykyistä käyttäjää.",PASSWORD_MISMATCH:"Annettu salasana ei vastaa nykyistä salasanaasi.",ACCOUNT_SUCCESSFULLY_DELETED:"Tili poistettu.",USERNAME_EMPTY_OR_WHITESPACE:"Käyttäjänimi ei voi olla tyhjä eikä siinä voi olla välilyöntejä.",USERNAME_TOO_SHORT:"Käyttäjänimi liian lyhyt: sen on oltava vähintään 3 merkkiä pitkä.",USERNAME_TOO_LONG:"Käyttäjänimi liian pitkä: ei saa olla yli 40 merkkiä pidempi.",USERNAME_INVALID_EMAIL:"Virheellinen sähköpostiosoite.",USERNAME_INVALID_CHARACTERS:"Käyttäjänimi on virheellinen, voi sisältää vain kirjaimia tai numeroita.",VAULT_NOT_UP_TO_DATE:"Holvisi ei ole ajan tasalla. Synkronoi holvisi ja yritä uudelleen.",INTERNAL_SERVER_ERROR:"Sisäinen palvelinvirhe.",VAULT_ERROR:"Paikallinen holvi ei ole ajan tasalla. Synkronoi holvisi virkistämällä sivu ja yritä uudelleen."}},Mx={or:"tai",new:"Uusi",vaultLocked:"AliasVault on lukittu.",creatingNewAlias:"Luodaan uutta aliasta...",noMatchesFound:"Osumia ei löytynyt",searchVault:"Etsi holvi...",enterServiceName:"Syötä palvelun nimi",enterEmailAddress:"Syötä sähköpostiosoite",enterUsername:"Syötä käyttäjänimi",hideFor1Hour:"Piilota tunnin ajan (nykyinen sivusto)",hidePermanently:"Piilota pysyvästi (nykyinen sivu)",createRandomAlias:"Luo sattumanvarainen alias",createUsernamePassword:"Luo käyttäjänimi/salasana",randomAlias:"Sattumanvarainen alias",usernamePassword:"Käyttäjänimi/Salasana",createAndSaveAlias:"Luo ja tallenna alias",createAndSaveCredential:"Luo ja tallenna tunnistetieto",randomIdentityDescription:"Luo satunnainen identiteetti, jolla on satunnainen sähköpostiosoite, johon on pääsy AliasVaultissa.",randomIdentityDescriptionDropdown:"Satunnainen identiteetti satunnaisen sähköpostiosoitteen kanssa",manualCredentialDescription:"Määritä oma sähköpostiosoitteesi ja käyttäjänimesi.",manualCredentialDescriptionDropdown:"Manuaalinen käyttäjänimi ja salasana",failedToCreateIdentity:"Identiteetin luominen epäonnistui. Yritä uudelleen.",enterEmailAndOrUsername:"Syötä sähköpostiosoite ja/tai käyttäjänimi",autofillWithAliasVault:"Automaattinen täyttö AliasVaultilla",generateRandomPassword:"Luo sattumanvarainen salasana (kopioi leikepöydälle)",generateNewPassword:"Luo uusi salasana",togglePasswordVisibility:"Salasanan näkyvyyden päälle/pois päältä kytkeminen",passwordCopiedToClipboard:"Salasana kopioitu leikepöydälle",openAliasVaultToUpgrade:"Avaa AliasVault päivittääksesi",vaultUpgradeRequired:"Holvin päivitys vaaditaan.",dismissPopup:"Hylkää ponnahdusikkuna"},Fx={title:"Tiedot",itemName:"Nimi",loginCredentials:"Sisäänkirjautumistunnistetiedot",cardInformation:"Korttitiedot",addItem:"Lisää tieto",addNewItem:"Lisää uusi tieto",saveItem:"Tallenna tieto",itemDetails:"Näytä yksityiskohdat",editItem:"Muokkaa tietoa",untitled:"Nimetön",newFolder:"New Folder",createFolder:"Luo kansio",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Kansio",welcomeTitle:"Tervetuloa AliasVaultiin!",welcomeDescription:"Käyttääksesi AliasVault-selainlaajennusta, siirry jollekin verkkosivustolle ja käytä AliasVaultin automaattisen täytön ponnahdusikkunaa luodaksesi uuden tunnistetiedon.",noPasskeysFound:"Todennusavaimia ei ole vielä luotu. Todennusavaimet on luotu vierailemalla verkkosivustolla, joka tarjoaa todennusavaimia todennusmenetelmänä.",noAttachmentsFound:"Liitteitä sisältäviä tietoja ei löytynyt",noItemsOfTypeFound:"No {{type}} tietoja ei löydy",noMatchingItems:"Vastaavia tietoja ei löytynyt",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(Kaikki) tiedot",passkeys:"Sala-avaimet"},deleteItemTitle:"Poista kohde",deleteItemConfirm:"Haluatko varmasti poistaa tämän kohteen?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Tunnisteet",changePasswordComplexity:"Muuta salasanan monimutkaisuutta",passwordLength:"Salasanan pituus",includeLowercase:"Sisällytä pienet kirjaimet",includeUppercase:"Sisällytä isot kirjaimet",includeNumbers:"Sisällytä numerot",includeSpecialChars:"Sisällytä erikoismerkit",avoidAmbiguousChars:"Vältä epäselviä merkkejä (o, 0, jne.)",privateEmailTitle:"Yksityinen sähköposti",privateEmailAliasVaultServer:"AliasVault-palvelin",privateEmailDescription:"Päästä päähän (E2E) salattu, täysin yksityinen.",publicEmailTitle:"Julkiset väliaikaisten sähköpostiosoitteiden tarjoajat (PTEP)",publicEmailDescription:"Anonyymi, mutta rajoitettu yksityisyys. Sähköpostin sisällön voi lukea kuka tahansa, joka tietää osoitteen.",validation:{required:"Tämä kenttä on pakollinen"}},Ox={selectType:"Add New Item",typeLabel:"Item Type",creating:"Luodaan",editing:"Muokaataan",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Kentän otsikko",enterFieldName:"Anna kentän nimi",fieldType:"Kentän tyyppi",fieldTypes:{text:"Teksti",hidden:"Hidden (masked text)",email:"Sähköposti",url:"URL",phone:"Puhelin",number:"Numero",date:"Päivämäärä",textArea:"Tekstialue"},login:{title:"Kirjaudu sisään"},alias:{title:"Alias"},creditCard:{title:"Luottokortti"},note:{title:"Secure Note"}},jx={"login.url":"Web-sivuston URL-osoite","login.username":"Käyttäjänimi","login.password":"Salasana","alias.first_name":"Etunimi","alias.last_name":"Sukunimi","alias.gender":"Sukupuoli","alias.birthdate":"Syntymäpäivä","login.email":"Sähköposti","notes.content":"Huomautukset","card.cardholder_name":"Kortinhaltijan nimi","card.number":"Kortin numero","card.expiry_month":"Vanhenemiskuukausi","card.expiry_year":"Vanhenemisvuosi","card.cvv":"CVV","card.pin":"PIN-koodi"},Px={addCode:"Lisää 2FA TOTP -koodi",instructions:"Syötä salainen avain, joka näkyy sivustossa, jossa haluat lisätä kaksivaiheisen tunnistautumisen",nameOptional:"Nimi (valinnainen)",secretKey:"Salainen avain",saveToViewCode:"Tallenna nähdäksesi koodin",defaultName:"Authenticator",errors:{invalidSecretKey:"Virheellinen salatun avaimen muoto."}},Hx={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},Qx={title:"Sähköpostit",deleteEmailTitle:"Poista sähköposti",deleteEmailConfirm:"Oletko varma, että haluat poistaa tämän sähköpostin pysyvästi?",from:"Lähettäjä",to:"Vastaanottaja",date:"Päivämäärä",emailContent:"Sähköpostin sisältö",emailNotFound:"Sähköpostia ei löytynyt",noEmails:"Sähköposteja ei löytynyt",noEmailsDescription:"Et ole vielä vastaanottanut sähköposteja yksityisissä sähköpostiosoitteissasi. Kun saat uuden sähköpostiviestin, se näkyy täällä.",offlineMessage:"Olet offline-tilassa. Ole hyvä ja yhdistä internetiin ladataksesi sähköpostiosoitteesi.",dateFormat:{justNow:"juuri nyt",minutesAgo_single:"{{count}} min sitten",minutesAgo_plural:"{{count}} minuuttia sitten",hoursAgo_single:"{{count}} tunti sitten",hoursAgo_plural:"{{count}} tuntia sitten",yesterday:"eilen"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Nykyinen valittu sähköpostiosoite on jo käytössä. Vaihda sähköpostiosoite muokkaamalla tätä tunnistetietoa.",CLAIM_DOES_NOT_EXIST:"Tapahtui virhe ladattaessa sähköposteja. Yritä muokata ja tallentaa tunnistetiedot synkronoidaksesi tietokannan, ja yritä sitten uudelleen."}},zx={serverUrl:"Palvelimen URL-osoite",language:"Kieli",autofillEnabled:"Ota automaattinen täyttö käyttöön",version:"Versio",openWebApp:"Avaa verkkosovellus",lock:"Lukitse",globalSettings:"Yleisesti pätevät asetukset",autofillPopup:"Automaattisen täytön ponnahdusikkuna",activeOnAllSites:"Aktiivisena kaikilla sivustoilla (ellei sitä ole poistettu käytöstä alla)",disabledOnAllSites:"Pois käytöstä kaikilla sivustoilla",rightClickContextMenu:"Oikea-napsauta kontekstivalikkoa",autofillMatching:"Automaattisen täytön täsmäytys",autofillMatchingMode:"Automaattisen täytön täsmäytystila",autofillMatchingModeDescription:"Määrittää, mitkä tunnistetiedot katsotaan osumiksi ja näytetään ehdotuksina tietyn verkkosivuston automaattisen täytön ponnahdusikkunassa.",autofillMatchingDefault:"URL + aliverkkotunnus + nimi jokerimerkki",autofillMatchingUrlSubdomain:"URL + aliverkkotunnus",autofillMatchingUrlExact:"Tarkka URL-verkkotunnus vain",siteSpecificSettings:"Sivustokohtaiset asetukset",autofillPopupOn:"Automaattisen täytön ponnahdusikkuna päällä: ",enabledForThisSite:"Otettu käyttöön tällä sivustolla",disabledForThisSite:"Poistettu käytöstä tällä sivustolla",temporarilyDisabledUntil:"Väliaikaisesti pois käytöstä, kunnes ",resetAllSiteSettings:"Nollaa kaikki sivustokohtaiset asetukset",appearance:"Ulkoasu",theme:"Teema",useDefault:"Käytä oletusta",light:"Vaalea",dark:"Tumma",keyboardShortcuts:"Näppäimistön pikanppäimet",configureKeyboardShortcuts:"Määritä näppäimistön pikanäppäimet",configure:"Määritä",clipboardClearTimeout:"Tyhjennä leikepöytä kopioimisen jälkeen",clipboardClearTimeoutDescription:"Tyhjennä leikepöytä automaattisesti arkaluonteisten tietojen kopioimisen jälkeen",clipboardClearDisabled:"Älä koskaan tyhjennä",clipboardClear5Seconds:"Tyhjennä 5 sekunnin jälkeen",clipboardClear10Seconds:"Tyhjennä 10 sekunnin jälkeen",clipboardClear15Seconds:"Tyhjennä 15 sekunnin jälkeen",autoLockTimeout:"Automaattisen lukituksen aikakatkaisu",autoLockTimeoutDescription:"Lukitse holvi automaattisesti käyttämättömyysjakson jälkeen",autoLockTimeoutHelp:"Holvi lukittuu vasta määritetyn käyttämättömyysjakson jälkeen (ei automaattista täyttöä tai laajennusten ponnahdusikkunoita ole avattu). Holvi lukittuu aina, kun selain suljetaan, tästä asetuksesta riippumatta.",autoLockNever:"Ei koskaan",autoLock15Seconds:"15 sekuntia",autoLock1Minute:"1 minuutti",autoLock5Minutes:"5 minuuttia",autoLock15Minutes:"15 minuuttia",autoLock30Minutes:"30 minuuttia",autoLock1Hour:"1 tunti",autoLock4Hours:"4 tuntia",autoLock8Hours:"8 tuntia",autoLock24Hours:"24 tuntia",versionPrefix:"Versio",autofillSettings:"Automaatisen täytön asetukset",clipboardSettings:"Leikepöydän asetukset",contextMenuSettings:"Kontekstivalikon asetukset",passkeySettings:"Todennusavainten asetukset",contextMenu:"Sisältövalikko",contextMenuEnabled:"Kontekstivalikko on otettu käyttöön",contextMenuDisabled:"Kontekstivalikko on poistettu käytöstä",contextMenuDescription:"Oikea-napsauta syöttökenttiä päästäksesi AliasVaultin vaihtoehtoihin",selectLanguage:"Valitse kieli",serverConfiguration:"Palvelimen asetukset",serverConfigurationDescription:"Määritä AliasVault-palvelimen URL-osoite itse isännöityille instanssille",customApiUrl:"API-URL-osoite",customClientUrl:"Asiakas-URL-osoite",apiUrlHint:"API päätepisteen URL (yleensä asiakkaan URL + /api)",clientUrlHint:"Web-käyttöliittymän URL-osoite itse isännöidyssä instanssissa",autofillSettingsDescription:"Ota käyttöön tai poista käytöstä automaattisen täytön ponnahdusikkuna verkkosivuilta",autofillEnabledDescription:"Automaattisen täytön ehdotukset näkyvät kirjautumislomakkeissa",autofillDisabledDescription:"Automaattitäyttöehdotukset on poistettu käytöstä kaikkialla",languageSettings:"Keili",validation:{apiUrlRequired:"API-URL-osoite vaaditaan",apiUrlInvalid:"Syötä kelvollinen API-URL-osoite",clientUrlRequired:"Asiakkaan URL-osoite vaaditaan",clientUrlInvalid:"Syötä kelvollinen asiakas-URL-osoite"},unlockMethod:{title:"Holvin lukituksen avausmenetelmä",introText:"Valitse, miten haluat avata holvisi. Voit käyttää pääsalasanaa (aina saatavilla) tai määrittää nopean 4-8 numeroisen PIN-koodin nopeampaa käyttöä varten. Kolmen epäonnistuneen PIN-yrityksen jälkeen sinun on käytettävä pääsalasanaa.",password:"Pääsalasana",pin:"PIN-koodi",pinDescription:"Avaa holvi PIN-koodilla",setupPin:"PIN-koodin määrittäminen",enterNewPinDescription:"Syötä PIN-koodi, jossa on vähintään 6 numeroa",confirmPin:"Vahvista PIN",confirmPinDescription:"Syötä PIN-koodi uudelleen vahvistaaksesi",invalidPinFormat:"Virheellinen PIN-muoto",pinMismatch:"PIN-koodit eivät täsmää",incorrectPin:"Väärä PIN-koodi. {{attemptsRemaining}} yritystä jäljellä.",incorrectPinSingular:"Virheellinen PIN-koodi. 1 yritys jäljellä.",enableSuccess:"PIN-lukituksen avaus käytössä onnistuneesti!",pinLocked:"PIN-lukituksen avaus on poistettu käytöstä. Ole hyvä ja käytä pääsalasanaa avataksesi holvisi.",pinSecurityWarning:"PIN-koodin lukituksen poisto selaimen laajennuksessa voi olla vähemmän turvallista kuin pääsalasana, koska PIN-koodit ovat tyypillisesti alempia entropia ja voi olla brute-pakko jos laite on vaarassa. Käytä sitä vain laitteissa, joihin täysin luotat."}},Vx={passkey:"Sala-avain",site:"Sivusto",helpText:"Todennusavaimet, Passkeys, luodaan sivustolle pyydettäessä. Niitä ei voi manuaalisesti muokata. Voit poistaa tämän salasanan, voit poistaa sen tästä käyttäjätunnuksesta. Voit korvata tämän salasanan tai luoda uuden, käy verkkosivuilla ja seuraa sen kehotuksia.",passkeyMarkedForDeletion:"Todennusavain merkitty poistettavaksi",passkeyWillBeDeleted:"Tämä todennusavain poistetaan, kun tallennat tämän käyttäjätiedon.",useBrowserPasskey:"Käytä selaimen sala-avainta",bypass:{description:"Kuinka kauan haluat käyttää selaimen todennusavaimen tarjoajaa {{origin}}?",thisTimeOnly:"Vain tällä kertaa",alwaysForSite:"Aina tällä sivustolla"},authenticate:{title:"Kirjaudu sisään todennusavaimella",signInFor:"Kirjaudu sisään todennusavaimella saadaksesi",selectPasskey:"Valitse todennusavain jolla kirjaudutaan",noPasskeysFound:"Tällä sivustolla ei löytynyt todennusavaimia"},create:{title:"Luo Passkey, todennusavain",createFor:"Luo uusi Passkey, todennusavain",titleLabel:"Otsikko",titlePlaceholder:"Anna nimi tälle todennusavaimelle",createButton:"Luo todennusavain, Passkey",selectPasskeyToReplace:"Valitse todennusavain, johon korvataan",createNewPasskey:"Luo uusi sala-avain",replacingPasskey:"Korvaava todennusavain: {{displayName}}",confirmReplace:"Vahvista korvaaminen",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Todennusavaimen toimittaja",passkeyProviderOn:"Todennusavaimen toimittaja käytössä "}},Kx={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},Gx={title:"Päivitä holvi",subtitle:"AliasVault on päivitetty ja holvisi on päivitettävä. Tämän pitäisi kestää vain muutama sekunti.",versionInformation:"Versiotiedot",yourVault:"Holvisi versio:",newVersion:"Uusi saatavilla oleva versio:",upgrade:"Päivitä holvi",upgrading:"Päivitetään...",whatsNew:"Mitä uutta?",whatsNewDescription:"Päivitys vaaditaan seuraavien muutosten tukemiseksi:",noDescriptionAvailable:"Tälle versiolle ei ole saatavilla kuvausta.",alerts:{unableToGetVersionInfo:"Versiotietojen hakeminen epäonnistui. Yritä uudelleen.",selfHostedServer:"Itseisännöity palvelin",selfHostedWarning:"Jos käytät itseisännöityä palvelinta, muista päivittää myös itseisännöity instanssisi, koska muuten verkkoasiakassovellukseen kirjautuminen lakkaa toimimasta.",continueUpgrade:"Jatka päivitystä",upgradeFailed:"Päivitys epäonnistui",failedToApplyMigration:"Siirron käyttöönotto epäonnistui ({{current}} / {{total}})"}},qx={unsyncedChangesTitle:"Synkronoimattomat muutokset",unsyncedChangesWarning:"Sinulla on synkronoimattomia muutoksia, jotka menetetään, jos kirjaudut ulos nyt. Oletko varma, että haluat jatkaa?",logoutAnyway:"Kirjaudu ulos joka tapauksessa"},Wx={auth:Bx,menu:Ux,common:_x,content:Mx,items:Fx,itemTypes:Ox,fieldLabels:jx,totp:Px,attachmentUploader:Hx,emails:Qx,settings:zx,passkeys:Vx,recentlyDeleted:Kx,upgrade:Gx,logout:qx},Yx={loginTitle:"Se connecter à AliasVault",username:"Nom d'utilisateur ou email",usernamePlaceholder:"nom / nom@entreprise.com",passwordPlaceholder:"Saisissez votre mot de passe",rememberMe:"Se souvenir de moi",loginButton:"Se connecter",noAccount:"Pas de compte ?",createVault:"Créer un nouveau coffre",twoFactorTitle:"Veuillez entrer le code d'authentification de votre application d'authentification.",authCode:"Code d'authentification",authCodePlaceholder:"Saisissez le code à 6 chiffres",verify:"Vérifier",twoFactorNote:"Remarque : si vous n'avez pas accès à votre appareil d'authentification, vous pouvez réinitialiser votre authentification à double facteur avec un code de récupération en vous connectant via le site web.",masterPassword:"Mot de passe principal",unlockVault:"Déverrouiller",unlockWithPin:"Déverrouiller avec un code PIN",enterPinToUnlock:"Entrez votre code PIN pour déverrouiller votre coffre",useMasterPassword:"Utiliser le mot de passe principal",unlockTitle:"Déverrouiller votre coffre",logoutConfirm:"Êtes-vous sûr de vouloir vous déconnecter ?",unlockSuccessTitle:"Votre coffre a été déverrouillé avec succès",unlockSuccessDescription:"Vous pouvez maintenant utiliser le remplissage automatique des formulaires de connexion dans votre navigateur.",closePopup:"Fermer cette popup",browseVault:"Parcourir le contenu du coffre",connectingTo:"Connexion à",switchAccounts:"Changer de compte ?",loginWithMobile:"Se connecter à l'aide de l'application mobile",unlockWithMobile:"Déverrouiller en utilisant l'application mobile",scanQrCode:"Scannez ce code QR avec votre application mobile AliasVault pour vous connecter et déverrouiller votre coffre.",errors:{invalidCode:"Veuillez entrer un code d'authentification valide à 6 chiffres.",serverError:"Impossible d'accéder au serveur AliasVault. Veuillez réessayer plus tard ou contacter le support si le problème persiste.",wrongPassword:"Mot de passe incorrect, veuillez réessayer.",sessionExpired:"Votre session a expiré. Veuillez vous reconnecter.",mobileLoginRequestExpired:"La demande de connexion de l'application mobile a expiré. Veuillez recharger la page et réessayer."}},Jx={vault:"Coffre-fort",emails:"Emails"},Xx={loading:"Chargement...",notice:"Notification",error:"Erreur",cancel:"Annuler",confirm:"Confirmer",back:"Retour",next:"Suivant",use:"Utiliser",add:"Ajouter",delete:"Supprimer",undo:"Annuler",save:"Sauvegarder",saving:"Sauvegarde...",create:"Créer",or:"Ou",close:"Fermer",logout:"Déconnexion",copied:"Copié !",openInNewWindow:"Ouvrir dans une nouvelle fenêtre",enabled:"Activé",disabled:"Désactivé",showPassword:"Afficher le mot de passe",hidePassword:"Cacher le mot de passe",showDetails:"Afficher les détails",hideDetails:"Masquer les détails",copyToClipboard:"Copier dans le presse-papiers",loadingEmails:"Chargement des emails...",loadingTotpCodes:"Chargement des codes TOTP...",attachments:"Pièces jointes",loadingAttachments:"Chargement des pièces jointes...",settings:"Réglages",recentEmails:"Emails récents",credentials:"Identifiants",customFields:"Champs Personnalisés",twoFactorAuthentication:"Authentification à double facteur",alias:"Alias",notes:"Notes",email:"Email",username:"Nom d'utilisateur",password:"Mot de passe",generate:"Générer",serviceName:"Nom du service",loggedIn:"Connecté(e)",syncingVault:"Synchronisation du coffre",checkingVaultUpdates:"Vérification des mises à jour du coffre",syncingUpdatedVault:"Synchronisation du coffre mis à jour",loadMore:"Voir plus",offline:"Hors ligne",offlineMode:"Fonctionnement en mode hors ligne",pendingSync:"Synchronisation...",mergingVaultChanges:"Fusion des modifications du coffre...",uploadingVault:"Envoi du coffre...",errors:{serverNotAvailable:"Le serveur d'AliasVault n'est pas disponible. Veuillez réessayer plus tard ou contacter le support si le problème persiste.",clientVersionNotSupported:"Cette version de l'extension de navigateur AliasVault n'est plus prise en charge par le serveur. Veuillez mettre à jour votre extension de navigateur à la dernière version.",browserExtensionOutdated:"Cette extension de navigateur est obsolète et ne peut pas être utilisée pour accéder à ce coffre-fort. Veuillez la mettre à jour pour continuer.",serverVersionNotSupported:"Le serveur d'AliasVault doit être mis à jour vers une version plus récente afin d'utiliser cette extension de navigateur. Veuillez contacter le support si vous avez besoin d'aide.",serverVersionTooOld:"Le serveur AliasVault doit être mis à jour vers une version plus récente pour pouvoir utiliser cette fonctionnalité. Veuillez contacter l'administrateur du serveur si vous avez besoin d'aide.",unknownError:"Une erreur inconnue s'est produite",unknownErrorTryAgain:"Une erreur inconnue s'est produite. Merci de réessayer.",vaultNotAvailable:"Coffre non disponible",vaultIsLocked:"Le coffre est verrouillé",passwordChanged:"Votre mot de passe a changé depuis la dernière fois que vous vous êtes connecté. Veuillez vous reconnecter pour des raisons de sécurité.",syncConflictMaxRetries:"Impossible de synchroniser le coffre après plusieurs tentatives. Veuillez réessayer plus tard.",mergeFailed:"Impossible de fusionner les modifications du coffre. Veuillez réessayer."},apiErrors:{UNKNOWN_ERROR:"Une erreur inconnue s'est produite. Merci de réessayer.",ACCOUNT_LOCKED:"Compte temporairement verrouillé en raison d'un trop grand nombre de tentatives infructueuses. Veuillez réessayer plus tard.",ACCOUNT_BLOCKED:"Votre compte a été désactivé. Si vous pensez que c'est une erreur, veuillez contacter le support.",USER_NOT_FOUND:"Nom d'utilisateur ou mot de passe invalide. Veuillez réessayer.",INVALID_AUTHENTICATOR_CODE:"Code d'authentification invalide. Veuillez réessayer.",INVALID_RECOVERY_CODE:"Code de récupération invalide. Veuillez réessayer.",REFRESH_TOKEN_REQUIRED:"Un jeton d'actualisation est requis.",INVALID_REFRESH_TOKEN:"Jeton d'actualisation invalide.",PUBLIC_REGISTRATION_DISABLED:"L'enregistrement d'un nouveau compte est actuellement désactivé sur ce serveur. Veuillez contacter l'administrateur.",USERNAME_REQUIRED:"Nom d’utilisateur requis.",USERNAME_ALREADY_IN_USE:"Nom d'utilisateur déjà utilisé.",USERNAME_AVAILABLE:"Ce nom d'utilisateur est disponible.",USERNAME_MISMATCH:"Le nom d'utilisateur ne correspond pas à l'utilisateur actuel.",PASSWORD_MISMATCH:"Le mot de passe indiqué ne correspond pas à votre mot de passe actuel.",ACCOUNT_SUCCESSFULLY_DELETED:"Compte supprimé avec succès.",USERNAME_EMPTY_OR_WHITESPACE:"Le nom d'utilisateur ne peut pas être vide ou contenir un espace.",USERNAME_TOO_SHORT:"Le nom d'utilisateur est trop court : il doit comporter au moins 3 caractères.",USERNAME_TOO_LONG:"Le nom d'utilisateur est trop long : il ne peut pas contenir plus de 40 caractères.",USERNAME_INVALID_EMAIL:"Adresse e-mail invalide.",USERNAME_INVALID_CHARACTERS:"Le nom d'utilisateur n'est pas valide, il ne peut contenir que des lettres ou des chiffres.",VAULT_NOT_UP_TO_DATE:"Votre coffre n'est pas à jour. Veuillez synchroniser votre coffre et réessayer.",INTERNAL_SERVER_ERROR:"Erreur interne du serveur.",VAULT_ERROR:"Le coffre local n'est pas à jour. Veuillez synchroniser votre coffre en rafraîchissant la page et réessayez."}},$x={or:"ou",new:"Nouveautés",vaultLocked:"AliasVault est verrouillé.",creatingNewAlias:"Création de nouveaux alias...",noMatchesFound:"Aucun résultat trouvé",searchVault:"Rechercher dans le coffre...",enterServiceName:"Entrez le nom du service",enterEmailAddress:"Entrer l'adresse email",enterUsername:"Entrez le nom d'utilisateur",hideFor1Hour:"Cacher pendant 1 heure (site actuel)",hidePermanently:"Masquer définitivement (site actuel)",createRandomAlias:"Créer un alias aléatoire",createUsernamePassword:"Créer un nom d'utilisateur/mot de passe",randomAlias:"Alias aléatoire",usernamePassword:"Nom d’utilisateur / mot de passe",createAndSaveAlias:"Créer et enregistrer l'alias",createAndSaveCredential:"Créer et enregistrer les identifiants",randomIdentityDescription:"Générer une identité aléatoire avec une adresse email aléatoire accessible dans AliasVault.",randomIdentityDescriptionDropdown:"Identité aléatoire avec email aléatoire",manualCredentialDescription:"Spécifiez votre propre adresse email et nom d'utilisateur.",manualCredentialDescriptionDropdown:"Identifiant et mot de passe manuels",failedToCreateIdentity:"Échec de la création de l'identité. Veuillez réessayer.",enterEmailAndOrUsername:"Entrez l'adresse email et/ou le nom d'utilisateur",autofillWithAliasVault:"Remplissage automatique avec AliasVault",generateRandomPassword:"Générer un mot de passe aléatoire (copier dans le presse-papier)",generateNewPassword:"Générer un nouveau mot de passe",togglePasswordVisibility:"Afficher ou masquer le mot de passe",passwordCopiedToClipboard:"Mot de passe copié dans le presse-papiers",openAliasVaultToUpgrade:"Ouvrez AliasVault pour améliorer",vaultUpgradeRequired:"Mise à niveau du coffre requise.",dismissPopup:"Fermer"},Zx={title:"Éléments",itemName:"Nom",loginCredentials:"Identifiants de connexion",cardInformation:"Informations de la carte",addItem:"Ajouter un élément",addNewItem:"Ajouter un nouvel élément",saveItem:"Enregistrer l'élément",itemDetails:"Détails de l’élément",editItem:"Editer l'élément",untitled:"Untitled",newFolder:"Nouveau dossier",createFolder:"Nouveau dossier",editFolder:"Éditer le dossier",folderName:"Nom du dossier",folderNameRequired:"Le nom du dossier est requis",folder:"Dossier",welcomeTitle:"Bienvenue dans AliasVault !",welcomeDescription:"Pour utiliser l'extension de navigateur AliasVault : accédez à un site web et utilisez la fenêtre de saisie automatique AliasVault pour créer un nouvel identifiant.",noPasskeysFound:"Aucune clé d'accès n'a encore été créée. Les clés d'accès sont créés en visitant un site Web qui propose des clés d'accès comme méthode d'authentification.",noAttachmentsFound:"Aucun élément avec pièces jointes trouvé",noItemsOfTypeFound:"Aucun élément {{type}} trouvé",noMatchingItems:"Aucun élément correspondant trouvé",noMatchingItemsSearch:'Aucun élément correspondant à "{{search}}"',noMatchingItemsWithFilter:'Aucun élément {{filter}} correspondant à "{{search}}"',clearSearch:"Effacer la recherche",clearFilter:"Effacer le filtre",emptyFolderHint:"Ce dossier est vide. Pour déplacer des éléments vers ce dossier, éditez l'élément et appuyez sur l'icône du dossier dans le champ nom.",allItemsInFolders:"Tous vos éléments sont organisés dans des dossiers. Appuyez sur un dossier ci-dessus pour voir vos identifiants, ou utilisez la recherche pour trouver des éléments spécifiques.",deleteFolder:"Supprimer le dossier",deleteFolderKeepItems:"Supprimer le dossier uniquement",deleteFolderKeepItemsDescription:"Les éléments seront déplacés dans la liste principale.",deleteFolderAndItems:"Supprimer le dossier et tous les éléments",deleteFolderAndItemsDescription:"{{count}} élément(s) vont être déplacés vers Récemment supprimés.",filters:{all:"(Tous) Éléments",passkeys:"Clés d'accès"},deleteItemTitle:"Supprimer l'élement",deleteItemConfirm:"Êtes-vous certain de vouloir supprimer cet élément?",viewHistory:"Voir l'historique",history:"Historique",noHistoryAvailable:"Pas d'historique disponible",tags:"Mots-clés",changePasswordComplexity:"Changer la complexité du mot de passe",passwordLength:"Longueur du mot de passe",includeLowercase:"Inclure les lettres minuscules",includeUppercase:"Inclure les lettres majuscules",includeNumbers:"Inclure des chiffres",includeSpecialChars:"Inclure des caractères spéciaux",avoidAmbiguousChars:"Éviter les caractères ambigus (o, 0, etc.)",privateEmailTitle:"E-mail privé",privateEmailAliasVaultServer:"Serveur AliasVault",privateEmailDescription:"E2E chiffré, entièrement privé.",publicEmailTitle:"Fournisseurs d'email public temporaires",publicEmailDescription:"Anonyme mais confidentiel limitée. Le contenu des e-mails est lisible par toute personne qui connaît l'adresse.",validation:{required:"Ce champ est requis"}},eT={selectType:"Ajouter un nouvel élément",typeLabel:"Type d'élément",creating:"Création",editing:"Édition",regenerateAlias:"Régénérer l'alias",addCustomField:"Ajouter un champ personnalisé",fieldLabel:"Intitulé du champ",enterFieldName:"Entrez le nom du champ",fieldType:"Type de champ",fieldTypes:{text:"Texte",hidden:"Caché (texte masqué)",email:"Email",url:"URL",phone:"Téléphone",number:"Numéro",date:"Date",textArea:"Zone de texte"},login:{title:"Se connecter"},alias:{title:"Alias"},creditCard:{title:"Carte de crédit"},note:{title:"Note sécurisée"}},tT={"login.url":"URL du site","login.username":"Username","login.password":"Mot de passe","alias.first_name":"Prénom","alias.last_name":"Nom","alias.gender":"Genre","alias.birthdate":"Date de naissance","login.email":"Email","notes.content":"Notes","card.cardholder_name":"Nom du titulaire de la carte","card.number":"Numéro de la carte","card.expiry_month":"Mois d'expiration","card.expiry_year":"Année d'expiration","card.cvv":"CVV","card.pin":"PIN"},aT={addCode:"Ajouter un code 2FA",instructions:"Entrez la clé secrète affichée par le site Web où vous souhaitez ajouter l'authentification à deux facteurs.",nameOptional:"Nom (facultatif)",secretKey:"Clé secrète",saveToViewCode:"Enregistrer pour afficher le code",defaultName:"Authentificateur",errors:{invalidSecretKey:"Format de clé secrète invalide."}},nT={uploading:"Envoi...",uploadSuccess:"Fichiers envoyés avec succès.",deleteSuccess:"Pièce jointe supprimée avec succès.",firefoxExpandRequired:"Pour envoyer des fichiers, utilisez la fenêtre étendue.",openExpandedWindow:"Ouvrir la fenêtre étendue"},rT={title:"Emails",deleteEmailTitle:"Supprimer l'email",deleteEmailConfirm:"Êtes-vous sûr de vouloir supprimer définitivement cet email ?",from:"De",to:"À",date:"Date",emailContent:"Contenu de l'email",emailNotFound:"Email introuvable",noEmails:"Aucun email trouvé",noEmailsDescription:"Vous n'avez pas encore reçu d'emails dans vos adresses email privées. Quand vous recevez un nouvel email, il apparaîtra ici.",offlineMessage:"Vous êtes déconnecté. Veuillez vous connecter à internet pour charger vos e-mails.",dateFormat:{justNow:"maintenant",minutesAgo_single:"Il y a {{count}} minute",minutesAgo_plural:"Il y a {{count}} minutes",hoursAgo_single:"Il y a {{count}} heure",hoursAgo_plural:"Il y a {{count}} heures",yesterday:"hier"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"L'adresse email actuelle est déjà utilisée. Veuillez modifier l'adresse email en modifiant cet identifiant.",CLAIM_DOES_NOT_EXIST:"Une erreur s'est produite en essayant de charger les emails. Veuillez essayer de modifier et enregistrer les informations d'identification pour synchroniser la base de données, puis réessayez."}},iT={serverUrl:"URL du serveur",language:"Langue",autofillEnabled:"Activer le remplissage automatique",version:"Version",openWebApp:"Ouvrir l’application web",lock:"Verrouiller",globalSettings:"Paramètres généraux",autofillPopup:"Remplissage automatique de la popup",activeOnAllSites:"Activé sur tous les sites (sauf si désactivé ci-dessous)",disabledOnAllSites:"Désactivé sur tous les sites",rightClickContextMenu:"Clic-droit sur le menu contextuel",autofillMatching:"Correspondance de remplissage automatique",autofillMatchingMode:"Remplir automatiquement le mode correspondant",autofillMatchingModeDescription:"Détermine quels identifiants sont considérés comme une correspondance et sont affichés comme des suggestions dans la fenêtre de saisie automatique pour un site web donné.",autofillMatchingDefault:"URL + sous-domaine + nom générique",autofillMatchingUrlSubdomain:"URL + sous-domaine",autofillMatchingUrlExact:"Domaine d'URL exact uniquement",siteSpecificSettings:"Paramètres spécifiques au site",autofillPopupOn:"Popup de saisie automatique sur:  ",enabledForThisSite:"Activé pour ce site",disabledForThisSite:"Désactivé pour ce site",temporarilyDisabledUntil:"Temporairement désactivé jusqu'au ",resetAllSiteSettings:"Réinitialiser tous les paramètres spécifiques au site",appearance:"Apparence",theme:"Thème",useDefault:"Utiliser par défaut",light:"Clair",dark:"Sombre",keyboardShortcuts:"Raccourcis clavier",configureKeyboardShortcuts:"Configurer les raccourcis clavier",configure:"Configurer",clipboardClearTimeout:"Effacer le presse-papiers après copie",clipboardClearTimeoutDescription:"Effacer automatiquement le presse-papiers après copie des données sensibles",clipboardClearDisabled:"Ne jamais effacer",clipboardClear5Seconds:"Effacer après 5 secondes",clipboardClear10Seconds:"Effacer après 10 secondes",clipboardClear15Seconds:"Effacer après 15 secondes",autoLockTimeout:"Délai de verrouillage automatique",autoLockTimeoutDescription:"Verrouiller automatiquement le coffre après une période d'inactivité",autoLockTimeoutHelp:"Le coffre ne se verrouille qu'après la période d'inactivité spécifiée (aucune fenêtre pop-up de saisie automatique ou d'extension). Le coffre sera toujours verrouillé lorsque le navigateur sera fermé, quel que soit ce paramètre.",autoLockNever:"Jamais",autoLock15Seconds:"15 secondes",autoLock1Minute:"1 minute",autoLock5Minutes:"5 minutes",autoLock15Minutes:"15 minutes",autoLock30Minutes:"30 minutes",autoLock1Hour:"1 heure",autoLock4Hours:"4 heures",autoLock8Hours:"8 heures",autoLock24Hours:"24 heures",versionPrefix:"Version ",autofillSettings:"Paramètres du remplissage automatique",clipboardSettings:"Paramètres du presse-papiers",contextMenuSettings:"Paramètres du menu contextuel",passkeySettings:"Paramètres de la clé d'accès",contextMenu:"Menu contextuel",contextMenuEnabled:"Le menu contextuel est activé",contextMenuDisabled:"Le menu contextuel est désactivé",contextMenuDescription:"Faites un clic droit sur les champs de saisie pour accéder aux options d'AliasVault",selectLanguage:"Sélectionner une langue",serverConfiguration:"Configuration du serveur",serverConfigurationDescription:"Configurer l'URL du serveur AliasVault pour les instances auto-hébergées",customApiUrl:"URL de l'API",customClientUrl:"URL du client",apiUrlHint:"L'URL du point de terminaison de l'API (généralement l'URL du client + /api)",clientUrlHint:"L'URL de l'interface web de votre instance auto-hébergée",autofillSettingsDescription:"Activer ou désactiver la popup de saisie automatique sur les pages web",autofillEnabledDescription:"Les suggestions de saisie automatique apparaîtront dans les formulaires de connexion",autofillDisabledDescription:"Les suggestions de saisie automatique sont désactivées globalement",languageSettings:"Langue",validation:{apiUrlRequired:"L'URL de l'API est requise",apiUrlInvalid:"Veuillez entrer une URL d'API valide",clientUrlRequired:"L'URL du client est requise",clientUrlInvalid:"Veuillez entrer une URL de client valide"},unlockMethod:{title:"Méthode de déverrouillage du coffre",introText:"Choisissez comment vous voulez déverrouiller votre coffre. Vous pouvez utiliser votre mot de passe principal (toujours disponible) ou configurer un code PIN pour un accès rapide. Après 3 tentatives de PIN échouées, vous devrez utiliser votre mot de passe maître.",password:"Mot de passe maître",pin:"Code PIN",pinDescription:"Déverrouiller le coffre avec le code PIN",setupPin:"Configurer le code PIN",enterNewPinDescription:"Entrez un code PIN composé d'au moins 6 chiffres",confirmPin:"Confirmer le code PIN",confirmPinDescription:"Saisissez à nouveau votre code PIN pour confirmer",invalidPinFormat:"Format de code PIN invalide",pinMismatch:"Les codes PIN ne correspondent pas",incorrectPin:"Code PIN incorrect, {{attemptsRemaining}} tentatives restantes.",incorrectPinSingular:"Code PIN incorrect. 1 tentative restante.",enableSuccess:"Déverrouillage par code PIN activé avec succès!",pinLocked:"Le déverrouillage par code PIN a été désactivé. Veuillez utiliser votre mot de passe maître pour déverrouiller votre coffre.",pinSecurityWarning:"Le déverrouillage par code PIN dans l'extension du navigateur peut être moins sécurisé que votre mot de passe principal, car les codes PIN ont généralement une entropie plus faible et peuvent être trouvés par brute force si votre appareil est compromis. Ne l'utilisez que sur les appareils de confiance totale."}},sT={passkey:"Clé d'accès",site:"Site",helpText:"Les clés d'accès sont créées sur le site Web lorsque vous y êtes invité. Elles ne peuvent pas être modifiées manuellement. Pour supprimer cette clé d'accès, vous pouvez la supprimer de cet identifiant. Pour remplacer cette clé d'accès ou en créer une nouvelle, visitez le site Web et suivez ses instructions.",passkeyMarkedForDeletion:"Clé d'accès marquée pour suppression",passkeyWillBeDeleted:"Cette clé d'accès sera supprimée lorsque vous enregistrerez cet identifiant.",useBrowserPasskey:"Utiliser la clé d'accès du navigateur",bypass:{description:"Combien de temps souhaitez-vous utiliser le fournisseur de clé d'accès du navigateur pour {{origin}}?",thisTimeOnly:"Cette fois seulement",alwaysForSite:"Toujours pour ce site"},authenticate:{title:"Se connecter avec une clé d’accès",signInFor:"Se connecter avec une clé d’accès pour",selectPasskey:"Sélectionnez une clé d'accès pour vous connecter:",noPasskeysFound:"Aucune clé d'accès trouvée pour ce site"},create:{title:"Créer une clé d'accès",createFor:"Créer une nouvelle clé d'accès pour",titleLabel:"Titre",titlePlaceholder:"Entrez un nom pour cette clé d'accès",createButton:"Créer clé d'accès",selectPasskeyToReplace:"Sélectionnez une clé d'accès à remplacer:",createNewPasskey:"Créer une nouvelle clé d'accès",replacingPasskey:"Remplacement de la clé d'accès : {{displayName}}",confirmReplace:"Confirmer le remplacement",selectExistingLogin:"Ajouter à l'identifiant existant :",selectExistingLoginDescription:"Joindre cette clé d'accès à un identifiant de connexion existant pour ce site.",attachingToCredential:"Ajout de la clé d'accès à : {{serviceName}}",attachPasskey:"Ajouter une clé d'accès"},settings:{passkeyProvider:"Fournisseur de clés d'accès",passkeyProviderOn:"Fournisseur de clé d'accès activé "}},oT={title:"Supprimé récemment",noItems:"Aucun élément supprimé",noItemsDescription:"Les éléments que vous supprimez apparaîtront ici pendant 30 jours avant d'être définitivement supprimés.",description:"Ces éléments seront définitivement supprimés après 30 jours. Vous pouvez les restaurer ou les supprimer immédiatement.",restore:"Restaurer",deletePermanently:"Supprimer définitivement",emptyAll:"Vider tout",daysRemaining_one:"{{count}} jour restant",daysRemaining_other:"{{count}} jours restants",expiringSoon:"Expirant bientôt",confirmDeleteTitle:"Supprimer définitivement?",confirmDeleteMessage:"Cet élément sera définitivement supprimé et ne pourra pas être récupéré.",confirmEmptyAllTitle:"Vider récemment supprimé ?",confirmEmptyAllMessage:"Tous les {{count}} éléments seront définitivement supprimés et ne pourront pas être récupérés."},lT={title:"Mettre à niveau le coffre",subtitle:"AliasVault a mis à jour et votre coffre doit être mis à niveau. Cela ne devrait prendre que quelques secondes.",versionInformation:"Informations de version",yourVault:"Votre version de coffre-fort :",newVersion:"Nouvelle version valable :",upgrade:"Mettre le coffre à niveau",upgrading:"Mise à niveau...",whatsNew:"Nouveautés",whatsNewDescription:"Une mise à niveau est nécessaire pour prendre en charge les modifications suivantes :",noDescriptionAvailable:"Aucune description disponible pour cette version.",alerts:{unableToGetVersionInfo:"Impossible d'obtenir les informations de version. Veuillez réessayer.",selfHostedServer:"Serveur auto-hébergé",selfHostedWarning:"Si vous utilisez un serveur auto-hébergé, assurez-vous également de mettre à jour votre instance auto-hébergée, sinon la connexion au client web cessera de fonctionner.",continueUpgrade:"Continuer la mise à jour",upgradeFailed:"Échec de la mise à niveau",failedToApplyMigration:"Impossible d'appliquer la migration ({{current}} sur {{total}})"}},cT={unsyncedChangesTitle:"Changements non synchronisés",unsyncedChangesWarning:"Vous avez des modifications non synchronisées qui seront perdues si vous vous déconnectez maintenant. Êtes-vous sûr de vouloir continuer ?",logoutAnyway:"Se déconnecter quand même"},uT={auth:Yx,menu:Jx,common:Xx,content:$x,items:Zx,itemTypes:eT,fieldLabels:tT,totp:aT,attachmentUploader:nT,emails:rT,settings:iT,passkeys:sT,recentlyDeleted:oT,upgrade:lT,logout:cT},dT={loginTitle:"כניסה ל־AliasVault",username:"שם משתמש או דוא״ל",usernamePlaceholder:"שם / name@company.com",passwordPlaceholder:"נא למלא את הסיסמה שלך",rememberMe:"לזכור אותי",loginButton:"כניסה",noAccount:"אין לך חשבון עדיין?",createVault:"יצירת כספת חדשה",twoFactorTitle:"נא למלא את קוד האימות מיישומון המאמת שלך.",authCode:"קוד אימות",authCodePlaceholder:"נא למלא קוד באורך 6 ספרות",verify:"אימות",twoFactorNote:"לתשומת ליבך: אם אין לך גישה להתקן המאמת (authenticator) שלך, אפשר לאפס אימות דו־שלבי עם קוד שחזור על ידי כניסה דרך האתר.",masterPassword:"סיסמת על",unlockVault:"שחרור נעילה",unlockWithPin:"שחרור נעילה עם קוד אישי",enterPinToUnlock:"נא למלא את הקוד האישי שלך כדי לשחרר את הכספת שלך",useMasterPassword:"להשתמש בסיסמה על",unlockTitle:"שחרור נעילת הכספת שלך",logoutConfirm:"לצאת?",unlockSuccessTitle:"נעילת הכספת שלך נפתחה בהצלחה",unlockSuccessDescription:"מעתה ניתן להשתמש בהשלמה אוטומטית בטופסי כניסה בדפדפן שלך.",closePopup:"סגירת החלונית הצצה הזאת",browseVault:"עיון בתוכן הכספת",connectingTo:"מתבצעת התחברות אל",switchAccounts:"להחליף חשבונות?",loginWithMobile:"Log in using Mobile App",unlockWithMobile:"Unlock using Mobile App",scanQrCode:"Scan this QR code with your AliasVault mobile app to log in and unlock your vault.",errors:{invalidCode:"נא למלא קוד אימות באורך 6 ספרות.",serverError:"לא ניתן ליצור קשר עם השרת של AliasVault. נא לנסות שוב מאוחר יותר או ליצור קשר עם התמיכה אם הבעיה נשנית.",wrongPassword:"סיסמה שגויה. נא לנסות שוב.",sessionExpired:"תוקף ההפעלה שלך פג. נא להיכנס מחדש.",mobileLoginRequestExpired:"Mobile login request timed out. Please reload the page and try again."}},mT={vault:"Vault",emails:"הודעות דוא״ל"},fT={loading:"בטעינה…",notice:"לתשומת ליבך",error:"שגיאה",cancel:"ביטול",confirm:"אישור",back:"חזרה",next:"הבא",use:"להשתמש",add:"Add",delete:"מחיקה",undo:"הסגה",save:"שמירה",saving:"Saving...",create:"יצירה",or:"או",close:"סגירה",logout:"יציאה",copied:"הועתק!",openInNewWindow:"פתיחה בחלון חדש",enabled:"פעיל",disabled:"כבוי",showPassword:"הצגת סיסמה",hidePassword:"הסתרת סיסמה",showDetails:"הצגת פרטים",hideDetails:"הסתרת פרטים",copyToClipboard:"העתקה ללוח הגזירים",loadingEmails:"הודעות הדוא״ל נטענות…",loadingTotpCodes:"הקודים החד־פעמיים הזמניים נטענים…",attachments:"צרופות",loadingAttachments:"הצרופות נטענות…",settings:"הגדרות",recentEmails:"הודעות דוא״ל אחרונות",credentials:"פרטי גישה",customFields:"Custom Fields",twoFactorAuthentication:"אימות דו־שלבי",alias:"כינוי",notes:"הערות",email:"דוא״ל",username:"שם משתמש",password:"סיסמה",generate:"Generate",serviceName:"שם השירות",loggedIn:"נכנסת",syncingVault:"הכספת מסתנכרת",checkingVaultUpdates:"מתבצעת בדיקה לשינויים בכספת",syncingUpdatedVault:"הכספת העדכנית מסתנכרת",loadMore:"לטעון עוד",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"שרת ה־AliasVault לא זמין. נא לנסות שוב מאוחר יותר או ליצור קשר עם התמיכה אם הבעיה נשנית.",clientVersionNotSupported:"הגרסה הזאת של הרחבת הדפדפן של AliasVault לא נתמכת עוד על ידי השרת. נא לעדכן את הרחבת הדפדפן שלך לגרסה העדכנית ביותר.",browserExtensionOutdated:"הרחבת הדפדפן הזאת לא עדכנית ואי אפשר להשתמש בה כדי לגשת לכספת הזאת. נא לעדכן את הרחבת הדפדפן הזאת כדי להמשיך.",serverVersionNotSupported:"יש לעדכן את שרת AliasVault לגרסה חדשה יותר כדי להשתמש בהרחבת הדפדפן הזאת. נא ליצור קשר עם התמיכה לקבלת עזרה.",serverVersionTooOld:"The AliasVault server needs to be updated to a newer version in order to use this feature. Please contact the server admin if you need help.",unknownError:"אירעה שגיאה לא ידועה",unknownErrorTryAgain:"אירעה שגיאה לא ידועה, נא לנסות שוב.",vaultNotAvailable:"הכספת לא זמינה",vaultIsLocked:"הכספת נעולה",passwordChanged:"הסיסמה שלך השתנתה מאז הפעם האחרונה שנכנסת למערכת. נא להיכנס שוב מטעמי אבטחת מידע.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"אירעה שגיאה לא ידועה, נא לנסות שוב.",ACCOUNT_LOCKED:"החשבון נעול זמנית עקב ריבוי ניסיונות כושלים. נא לנסות שוב מאוחר יותר.",ACCOUNT_BLOCKED:"החשבון שלך הושבת. אם לדעתך מדובר בטעות, נא ליצור קשר עם התמיכה.",USER_NOT_FOUND:"שם המשתמש או הסיסמה שגויים. נא לנסות שוב.",INVALID_AUTHENTICATOR_CODE:"קוד מאמת שגוי. נא לנסות שוב.",INVALID_RECOVERY_CODE:"קוד שחזור שגוי. נא לנסות שוב.",REFRESH_TOKEN_REQUIRED:"אסימון ריענון חובה.",INVALID_REFRESH_TOKEN:"אסימון ריענון שגוי.",PUBLIC_REGISTRATION_DISABLED:"רישום חשבון חדש מושבת כרגע בשרת הזה. נא ליצור קשר עם ההנהלה.",USERNAME_REQUIRED:"שם משתמש חובה.",USERNAME_ALREADY_IN_USE:"שם המשתמש כבר תפוס.",USERNAME_AVAILABLE:"שם המשתמש פנוי.",USERNAME_MISMATCH:"שם המשתמש לא מתאים למשתמש הנוכחי.",PASSWORD_MISMATCH:"הסיסמה שסופקה לא תואמת לסיסמה הנוכחית שלך.",ACCOUNT_SUCCESSFULLY_DELETED:"החשבון נמחק בהצלחה.",USERNAME_EMPTY_OR_WHITESPACE:"שם המשתמש לא יכול להיות ריק או מורכב מרווחים בלבד.",USERNAME_TOO_SHORT:"שם המשתמש קצר מדי: חייב להיות באורך 3 תווים לפחות.",USERNAME_TOO_LONG:"שם המשתמש ארוך מדי: לא יכול להיות ארוך מ־40 תווים.",USERNAME_INVALID_EMAIL:"כתובת דוא״ל שגויה.",USERNAME_INVALID_CHARACTERS:"שם המשתמש שגוי, יכול להכיל רק תווים או ספרות.",VAULT_NOT_UP_TO_DATE:"הכספת שלך אינה עדכנית. נא לסנכרן את הכספת שלך ולנסות שוב.",INTERNAL_SERVER_ERROR:"שגיאת שרת פנימית.",VAULT_ERROR:"הכספת המקומית אינה עדכנית. נא לסנכרן את הכספת שלך על ידי ריענון העמוד ולנסות שוב."}},gT={or:"או",new:"חדש",vaultLocked:"AliasVault נעול.",creatingNewAlias:"נוצר כינוי חדש...",noMatchesFound:"לא נמצאו תוצאות",searchVault:"חיפוש בכספת…",enterServiceName:"נא למלא את שם השירות",enterEmailAddress:"נא למלא כתובת דוא״ל",enterUsername:"נא למלא שם משתמש",hideFor1Hour:"הסתרה למשך שעה (האתר הנוכחי)",hidePermanently:"הסתרה לצמיתות (האתר הנוכחי)",createRandomAlias:"יצירת כינוי אקראי",createUsernamePassword:"יצירת שם משתמש/סיסמה",randomAlias:"כינוי אקראי",usernamePassword:"שם משתמש/סיסמה",createAndSaveAlias:"יצירה ושמירה של כינוי",createAndSaveCredential:"יצירה ושמירה של פרטי גישה",randomIdentityDescription:"יצירת זהות אקראית עם כתובת דוא״ל אקראית שנגישה דרך AliasVault.",randomIdentityDescriptionDropdown:"זהות אקראיות עם דוא״ל אקראי",manualCredentialDescription:"נא לציין כתובת דוא״ל ושם משתמש משלך.",manualCredentialDescriptionDropdown:"שם משתמש וסיסמה ידניים",failedToCreateIdentity:"יצירת הזהות נכשלה. נא לנסות שוב.",enterEmailAndOrUsername:"נא למלא דוא״ל ו/או שם משתמש",autofillWithAliasVault:"השלמה אוטומטית עם AliasVault",generateRandomPassword:"יצירת סיסמה אקראית (העתקה ללוח הגזירים)",generateNewPassword:"יצירת סיסמה חדשה",togglePasswordVisibility:"הצגת/הסתרת סיסמה",passwordCopiedToClipboard:"הסיסמה הועתקה ללוח הגזירים",openAliasVaultToUpgrade:"יש לפתוח את AliasVault כדי לשדרג",vaultUpgradeRequired:"יש לשדרג את הכספת.",dismissPopup:"התעלמות מחלונית"},hT={title:"Items",itemName:"שם",loginCredentials:"פרטי הגישה",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"יצירת תיקייה",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"תיקייה",welcomeTitle:"ברוך בואך ל־AliasVault!",welcomeDescription:"כדי להשתמש בהרחבת הדפדפן של AliasVault: יש לנווט לאתר ולהשתמש בחלונית ההשלמה האוטומטית של AliasVault כדי ליצור פרטי גישה חדשים.",noPasskeysFound:"No passkeys have been created yet. Passkeys are created by visiting a website that offers passkeys as an authentication method.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Passkeys"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"תגיות",changePasswordComplexity:"החלפת מורכבת הסיסמה",passwordLength:"אורך הסיסמה",includeLowercase:"לכלול אותיות קטנות",includeUppercase:"לכלול אותיות גדולות",includeNumbers:"לכלול מספרים",includeSpecialChars:"לכלול תווים מיוחדים",avoidAmbiguousChars:"עדיף להימנע מאותיות וספרות שדומים זה לזה (o,‏ 0 וכו׳)",privateEmailTitle:"כתובת דוא״ל פרטית",privateEmailAliasVaultServer:"שרת AliasVault",privateEmailDescription:"הצפנה מקצה לקצה, פרטיות מלאה.",publicEmailTitle:"ספקי תיבת דוא״ל זמנית ציבוריים",publicEmailDescription:"פרטיות אלמונית אך מוגבלת. תוכן הדוא״ל נגיש לכל מי שיודע את הכתובת.",validation:{required:"שדה חובה"}},AT={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"דוא״ל",url:"URL",phone:"Phone",number:"Number",date:"תאריך",textArea:"Text Area"},login:{title:"כניסה"},alias:{title:"כינוי"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},pT={"login.url":"Website URL","login.username":"שם משתמש","login.password":"סיסמה","alias.first_name":"שם פרטי","alias.last_name":"שם משפחה","alias.gender":"מגדר","alias.birthdate":"תאריך לידה","login.email":"דוא״ל","notes.content":"הערות","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},yT={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"שם (רשות)",secretKey:"מפתח סודי",saveToViewCode:"יש לשמור כדי לצפות בקוד",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},ET={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},bT={title:"הודעות דוא״ל",deleteEmailTitle:"מחיקת הודעת דוא״ל",deleteEmailConfirm:"למחוק את הודעת הדוא״ל הזאת לצמיתות?",from:"מאת",to:"אל",date:"תאריך",emailContent:"תוכן הודעת דוא״ל",emailNotFound:"הודעת הדוא״ל לא נמצאה",noEmails:"לא נמצאו הודעות דוא״ל",noEmailsDescription:"לא קיבלת הודעות דוא״ל כלשהן לכתובות הדוא״ל הפרטיות שלך עדיין. כשמגיעה הודעה חדשה היא תופיע כאן.",offlineMessage:"החיבור שלך מנותק. נא להתחבר לאינטרנט כדי לטעון את הודעות הדוא״ל שלך.",dateFormat:{justNow:"ממש הרגע",minutesAgo_single:"לפני דקה",minutesAgo_plural:"לפני {{count}} דקות",hoursAgo_single:"לפני שעה",hoursAgo_plural:"לפני {{count}} שעות",yesterday:"אתמול"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"כתובת הדוא״ל שנבחרה תפוסה. נא לשנות את כתובת הדוא״ל על ידי עריכת פרטי הגישה.",CLAIM_DOES_NOT_EXIST:"אירעה שגיאה בניסיון לטעון את הודעות הדוא״ל. נא לנסות לערוך ולשמור את רשומת פרטי הקשר כדי לסנכרן את מסד הנתונים ואז לנסות שוב."}},IT={serverUrl:"כתובת שרת",language:"שפה",autofillEnabled:"הפעלת השלמה אוטומטית",version:"גרסה",openWebApp:"פתיחת אתר",lock:"נעילה",globalSettings:"הגדרות מקיפות",autofillPopup:"חלונית השלמה אוטומטית",activeOnAllSites:"פעיל בכל האתרים (למעט אם נכבה להלן)",disabledOnAllSites:"כבוי בכל האתרים",rightClickContextMenu:"תפריט הקשר בלחיצה ימנית",autofillMatching:"התאמת השלמה אוטומטית",autofillMatchingMode:"מצב התאמת השלמה אוטומטית",autofillMatchingModeDescription:"הגדרה אילו פרטי גישה נחשבים תואמים ויופיעו כהצעות בחלונית ההשלמה האוטומטית לאתר מסוים.",autofillMatchingDefault:"כתובת + שם תת־תחום + תו כל על שם",autofillMatchingUrlSubdomain:"כתובת + שם תת־תחום",autofillMatchingUrlExact:"תחום כתובת מדויקת בלבד",siteSpecificSettings:"הגדרות תואמות אתר",autofillPopupOn:"חלונית השלמה אוטומטית ב־: ",enabledForThisSite:"פעיל לאתר הזה",disabledForThisSite:"כבוי לאתר הזה",temporarilyDisabledUntil:"כבוי זמנית עד ",resetAllSiteSettings:"איפוס כל ההגדרות הנקודתיות לאתרים",appearance:"מראה",theme:"ערכת עיצוב",useDefault:"להשתמש בברירת המחדל",light:"בהירה",dark:"כהה",keyboardShortcuts:"קיצורי מקלדת",configureKeyboardShortcuts:"הגדרת קיצורי מקלדת",configure:"הגדרה",clipboardClearTimeout:"לפנות את לוח הגזירים לאחר העתקה",clipboardClearTimeoutDescription:"לפנות את לוח הגזירים אוטומטית לאחר העתקת נתונים רגישים",clipboardClearDisabled:"אף פעם לא לפנות",clipboardClear5Seconds:"לפנות אחרי 5 שניות",clipboardClear10Seconds:"לפנות אחרי 10 שניות",clipboardClear15Seconds:"לפנות אחרי 15 שניות",autoLockTimeout:"תום המתנה לנעילה אוטומטית",autoLockTimeoutDescription:"לנעול את הכספת אוטומטית לאחר פרק זמן של חוסר פעילות",autoLockTimeoutHelp:"הכספת תינעל רק לאחר משך זמן של חוסר פעילות (אין שימוש בהשלמה אוטומטית או פתיחת חלונית הרחבה). הכספת תמיד תינעל עם סגירת הדפדפן, ללא תלות בהגדרה הזאת.",autoLockNever:"אף פעם",autoLock15Seconds:"15 שניות",autoLock1Minute:"דקה",autoLock5Minutes:"5 דקות",autoLock15Minutes:"15 דקות",autoLock30Minutes:"30 דקות",autoLock1Hour:"שעה",autoLock4Hours:"4 שעות",autoLock8Hours:"8 שעות",autoLock24Hours:"24 שעות",versionPrefix:"גרסה ",autofillSettings:"הגדרות השלמה אוטומטית",clipboardSettings:"הגדרות לוח הגזירים",contextMenuSettings:"הגדרות תפריט הקשר",passkeySettings:"Passkey Settings",contextMenu:"תפריט הקשר",contextMenuEnabled:"תפריט הקשר פעיל",contextMenuDisabled:"תפריט הקשר כבוי",contextMenuDescription:"ניתן ללחוץ על שדה עם הלחצן הימני כדי לגשת לאפשרויות AliasVault",selectLanguage:"בחירת שפה",serverConfiguration:"הגדרות שרת",serverConfigurationDescription:"הגדרת כתובת שרת AliasVault לעותקים באירוח עצמי",customApiUrl:"כתובת API",customClientUrl:"כתובת לקוח",apiUrlHint:"נקודת הקצה של ה־API (בדרך כלל כתובת לקוח + ‎/api)",clientUrlHint:"כתובת ממשק המשתמש הדפדפני של העותק באירוע העצמי שלך",autofillSettingsDescription:"הפעלת או כיבוי חלוניות השלמה אוטומטית בעמודי אתרים",autofillEnabledDescription:"הצעות השלמה אוטומטית בטופסי כניסה למערכות",autofillDisabledDescription:"הצעות השלמה אוטומטית כבויות באופן מקיף",languageSettings:"שפה",validation:{apiUrlRequired:"כתובת API חובה",apiUrlInvalid:"נא למלא כתובת API תקפה",clientUrlRequired:"כתובת לקוח חובה",clientUrlInvalid:"נא למלא כתובת לקוח תקפה"},unlockMethod:{title:"שיטת שחרור נעילת כספת",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"סיסמת על",pin:"קוד אישי",pinDescription:"שחרור כספת עם קוד אישי",setupPin:"הגדרת קוד גישה אישי",enterNewPinDescription:"נא למלא קוד אישי שמורכב מ־6 ספרות לפחות",confirmPin:"אישור קוד אישי",confirmPinDescription:"נא למלא את הקוד האישי שלך שוב לאישור",invalidPinFormat:"תבנית הקוד האישי שגויה",pinMismatch:"הקודים האישיים לא תואמים",incorrectPin:"קוד אישי שגוי. נותרו {{attemptsRemaining}} ניסיונות.",incorrectPinSingular:"קוד אישי שגוי. נותר עוד ניסיון.",enableSuccess:"שחרור קוד אישי הופעל בהצלחה!",pinLocked:"שחרור נעילה עם קוד אישי הושבתה. נא להשתמש בסיסמת העל שלך כדי לשחרר את הכספת שלך.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},vT={passkey:"Passkey",site:"אתר",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Passkey marked for deletion",passkeyWillBeDeleted:"This passkey will be deleted when you save this credential.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"בפעם הזאת בלבד",alwaysForSite:"תמיד לאתר הזה"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"כותרת",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"אישור החלפה",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},wT={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},CT={title:"שדרוג כספת",subtitle:"AliasVault התעדכן וצריך לשדרג את הכספת שלך. הפעולה הזאת אמורה לארוך מספר שניות.",versionInformation:"פרטי גרסה",yourVault:"גרסת הכספת שלך:",newVersion:"הגרסה החדשה הזמינה:",upgrade:"שדרוג כספת",upgrading:"משתדרגת…",whatsNew:"מה חדש",whatsNewDescription:"יש לשדרג כדי שתהיה תמיכה בשינויים הבאים:",noDescriptionAvailable:"אין תיאור זמין לגרסה הזאת.",alerts:{unableToGetVersionInfo:"לא ניתן לקבל את פרטי הגרסה. נא לנסות שוב מאוחר יותר.",selfHostedServer:"שרת באירוח עצמי",selfHostedWarning:"אם מדובר בשרת שמתארח עצמאית, נא לוודא שהעותק שמתארח אצלך גם כן מתעדכן כי אחרת הכניסה לאתר תפסיק לעבוד.",continueUpgrade:"להמשיך בשדרוג",upgradeFailed:"השדרוג נכשל",failedToApplyMigration:"החלת ההסבה נכשלה ({{current}} מתוך {{total}})"}},NT={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},xT={auth:dT,menu:mT,common:fT,content:gT,items:hT,itemTypes:AT,fieldLabels:pT,totp:yT,attachmentUploader:ET,emails:bT,settings:IT,passkeys:vT,recentlyDeleted:wT,upgrade:CT,logout:NT},TT={loginTitle:"Accedi ad AliasVaultriem",username:"Nome utente o mail",usernamePlaceholder:"nome / nome@azienda.com",passwordPlaceholder:"Inserisci la tua password",rememberMe:"Ricordati di me",loginButton:"Accedi",noAccount:"Non hai ancora un account?",createVault:"Crea una nuova cassaforte",twoFactorTitle:"Inserisci il codice di autenticazione dalla tua app di autenticazione.",authCode:"Codice di Autenticazione",authCodePlaceholder:"Inserisci il codice a 6 cifre",verify:"Verifica",twoFactorNote:"Nota: se non hai accesso al tuo dispositivo di autenticazione, puoi reimpostare il tuo 2FA con un codice di recupero accedendo tramite il sito web.",masterPassword:"Password principale",unlockVault:"Sblocca",unlockWithPin:"Sblocca con PIN",enterPinToUnlock:"Inserisci il PIN per sbloccare la cassaforte",useMasterPassword:"Usa La Password Principale",unlockTitle:"Sblocca la tua cassaforte",logoutConfirm:"Sei sicuro di volerti disconnettere?",unlockSuccessTitle:"La cassaforte è stata sbloccata con successo",unlockSuccessDescription:"Ora puoi usare l'auto-riempimento nei moduli di accesso nel tuo browser.",closePopup:"Chiudi questo popup",browseVault:"Sfoglia i contenuti della cassaforte",connectingTo:"Connessione a",switchAccounts:"Cambia account",loginWithMobile:"Accedi con l'App Mobile",unlockWithMobile:"Sblocca con l'App Mobile",scanQrCode:"Scansiona questo codice QR con l'app mobile di AliasVault per accedere e sbloccare la cassaforte.",errors:{invalidCode:"Inserisci un codice di autenticazione a 6 cifre valido.",serverError:"Impossibile connettersi al server di AliasVault. Riprova più tardi o contatta il supporto se il problema persiste.",wrongPassword:"Password non corretta. Riprova nuovamente.",sessionExpired:"La tua sessione è scaduta. Effettua di nuovo il login.",mobileLoginRequestExpired:"Richiesta di accesso mobile scaduta. Per favore ricarica la pagina e riprova."}},ST={vault:"Cassaforte",emails:"E-Mail"},kT={loading:"Caricamento in corso...",notice:"Avviso",error:"Errore",cancel:"Annulla",confirm:"Conferma",back:"Indietro",next:"Avanti",use:"Usa",add:"Aggiungi",delete:"Elimina",undo:"Annulla",save:"Salva",saving:"Salvataggio...",create:"Creare",or:"O",close:"Chiudi",logout:"Esci",copied:"Copiato!",openInNewWindow:"Apri in una nuova finestra",enabled:"Abilitato",disabled:"Disabilitato",showPassword:"Mostra password",hidePassword:"Nascondi password",showDetails:"Mostra dettagli",hideDetails:"Nascondi dettagli",copyToClipboard:"Copia negli appunti",loadingEmails:"Caricamento e-mail in corso...",loadingTotpCodes:"Caricamento codici TOTP in corso...",attachments:"Allegati",loadingAttachments:"Caricamento allegati in corso...",settings:"Impostazioni",recentEmails:"E-mail recenti",credentials:"Credenziali",customFields:"Campi Personalizzati",twoFactorAuthentication:"Autenticazione a due fattori",alias:"Alias",notes:"Note",email:"E-mail",username:"Nome utente",password:"Password",generate:"Genera",serviceName:"Nome Servizio",loggedIn:"Accesso effettuato",syncingVault:"Sincronizzazione cassaforte",checkingVaultUpdates:"Controllo aggiornamenti cassaforte",syncingUpdatedVault:"Sincronizzazione cassaforte aggiornata",loadMore:"Carica altro",offline:"Offline",offlineMode:"Funzionamento in modalità offline",pendingSync:"Sincronizzazione...",mergingVaultChanges:"Sincronizzzazione modifiche della cassaforte...",uploadingVault:"Caricamento cassaforte in corso...",errors:{serverNotAvailable:"Il server di AliasVault non è disponibile. Riprova più tardi o contatta il supporto se il problema persiste.",clientVersionNotSupported:"Questa versione dell'estensione del browser AliasVault non è più supportata dal server. Aggiorna l'estensione alla versione più recente.",browserExtensionOutdated:"Questa estensione del browser è obsoleta e non può essere utilizzata per accedere a questa cassaforte. Si prega di aggiornare questa estensione per continuare.",serverVersionNotSupported:"Il server di AliasVault necessita un aggiornamento a una versione più recente per poter usare questa estensione. Contatta il supporto se hai bisogno di assistenza.",serverVersionTooOld:"Il server AliasVault deve essere aggiornato a una versione più recente per poter utilizzare questa app mobile. Se hai bisogno di aiuto, contatta il supporto.",unknownError:"Si è verificato un errore sconosciuto",unknownErrorTryAgain:"Si è verificato un errore sconosciuto. Riprova.",vaultNotAvailable:"Cassaforte non disponibile",vaultIsLocked:"La cassaforte è bloccata",passwordChanged:"La tua password è cambiata dall'ultima volta che hai effettuato l'accesso. Effettua nuovamente l'accesso per motivi di sicurezza.",syncConflictMaxRetries:"Impossibile sincronizzare la cassaforte dopo più tentativi. Riprova più tardi.",mergeFailed:"Sincronizzazione della cassaforte non riuscita. Riprovare."},apiErrors:{UNKNOWN_ERROR:"Si è verificato un errore sconosciuto. Riprova.",ACCOUNT_LOCKED:"Account temporaneamente bloccato a causa di troppi tentativi falliti. Riprova più tardi.",ACCOUNT_BLOCKED:"Il tuo account è stato disabilitato. Se ritieni che sia un errore, contatta il supporto.",USER_NOT_FOUND:"Nome utente o password non validi. Riprova.",INVALID_AUTHENTICATOR_CODE:"Codice di autenticazione non valido. Riprova.",INVALID_RECOVERY_CODE:"Codice di recupero non valido. Riprova.",REFRESH_TOKEN_REQUIRED:"È necessario aggiornare il token.",INVALID_REFRESH_TOKEN:"Token di aggiornamento non valido",PUBLIC_REGISTRATION_DISABLED:"La registrazione di nuovi account è attualmente disabilitata su questo server. Contatta l'amministratore.",USERNAME_REQUIRED:"È richiesto il nome utente.",USERNAME_ALREADY_IN_USE:"Il nome utente è già in uso.",USERNAME_AVAILABLE:"Il nome utente è disponibile.",USERNAME_MISMATCH:"Il nome utente non corrisponde all'utente corrente.",PASSWORD_MISMATCH:"La password fornita non corrisponde alla password attuale.",ACCOUNT_SUCCESSFULLY_DELETED:"Account eliminato con successo.",USERNAME_EMPTY_OR_WHITESPACE:"Il nome utente non può essere vuoto o contenere spazi.",USERNAME_TOO_SHORT:"Nome utente troppo corto: deve contenere almeno 3 caratteri.",USERNAME_TOO_LONG:"Nome utente troppo lungo: non può superare i 40 caratteri.",USERNAME_INVALID_EMAIL:"Indirizzo email non valido.",USERNAME_INVALID_CHARACTERS:"Il nome utente non è valido, può contenere solo lettere o cifre.",VAULT_NOT_UP_TO_DATE:"La tua cassaforte non è aggiornata. Sincronizzala e riprova.",INTERNAL_SERVER_ERROR:"Errore interno del server.",VAULT_ERROR:"La cassaforte locale non è aggiornata. Sincronizzala ricaricando la pagina e riprova."}},LT={or:"o",new:"Nuovo",vaultLocked:"AliasVault è bloccato.",creatingNewAlias:"Creazione nuovo alias...",noMatchesFound:"Nessun risultato trovato",searchVault:"Cerca nella cassaforte...",enterServiceName:"Inserisci nome servizio",enterEmailAddress:"Inserisci indirizzo email",enterUsername:"Inserisci nome utente",hideFor1Hour:"Nascondi per 1 ora (sito corrente)",hidePermanently:"Nascondi permanentemente (sito corrente)",createRandomAlias:"Crea alias casuale",createUsernamePassword:"Crea nome utente/password",randomAlias:"Alias casuale",usernamePassword:"Nome utente/password",createAndSaveAlias:"Crea e salva alias",createAndSaveCredential:"Crea e salva credenziali",randomIdentityDescription:"Genera un'identità casuale con un indirizzo email casuale accessibile in AliasVault.",randomIdentityDescriptionDropdown:"Identità casuale con email casuale",manualCredentialDescription:"Specifica il tuo indirizzo email e nome utente.",manualCredentialDescriptionDropdown:"Nome utente e password manuali",failedToCreateIdentity:"Impossibile creare identità. Riprova.",enterEmailAndOrUsername:"Inserisci email e/o nome utente",autofillWithAliasVault:"Compilazione automatica con AliasVault",generateRandomPassword:"Genera password casuale (copia negli appunti)",generateNewPassword:"Genera nuova password",togglePasswordVisibility:"Mostra/Nascondi password",passwordCopiedToClipboard:"Password copiata negli appunti",openAliasVaultToUpgrade:"Apri AliasVault per aggiornare",vaultUpgradeRequired:"Aggiornamento della cassaforte richiesto.",dismissPopup:"Chiudi finestra"},RT={title:"Elementi",itemName:"Nome",loginCredentials:"Credenziali di accesso",cardInformation:"Informazioni sulla scheda",addItem:"Aggiungi Elemento",addNewItem:"Aggiungi nuovo elemento",saveItem:"Salva Elemento",itemDetails:"Dettagli Elemento",editItem:"Modifica Elemento",untitled:"Senza titolo",newFolder:"Nuova Cartella",createFolder:"Crea cartella",editFolder:"Modifica Cartella",folderName:"Nome Cartella",folderNameRequired:"Il nome della cartella è obbligatorio",folder:"Cartella",welcomeTitle:"Benvenuto in AliasVault!",welcomeDescription:"Per usare l'estensione browser AliasVault: naviga su un sito e usa la finestra di compilazione automatica per creare una nuova credenziale.",noPasskeysFound:"Non sono state ancora create passkey. Le passkey vengono create visitando un sito web che offre le passkey come metodo di autenticazione.",noAttachmentsFound:"Nessun elemento con allegati trovato",noItemsOfTypeFound:"Nessun elemento {{type}} trovato",noMatchingItems:"Nessun elemento corrispondente trovato",noMatchingItemsSearch:'Nessun elemento corrispondente "{{search}}"',noMatchingItemsWithFilter:'Nessun elemento {{filter}} corrispondente "{{search}}"',clearSearch:"Cancella ricerca",clearFilter:"Cancella filtro",emptyFolderHint:"Questa cartella è vuota. Per spostare gli elementi in questa cartella, modificare l'elemento e toccare l'icona della cartella nel campo nome.",allItemsInFolders:"Tutti gli elementi sono organizzati in cartelle. Fare clic su una cartella qui sopra per visualizzare le credenziali o utilizzare la ricerca per trovare elementi specifici.",deleteFolder:"Elimina Cartella",deleteFolderKeepItems:"Elimina solo la cartella",deleteFolderKeepItemsDescription:"Gli elementi verranno spostati nella lista principale.",deleteFolderAndItems:"Elimina cartella e tutti gli elementi",deleteFolderAndItemsDescription:"{{count}} oggetto(i) verrà spostato in Eliminato Recentemente.",filters:{all:"(Tutti) Elementi",passkeys:"Passkey"},deleteItemTitle:"Elimina elemento",deleteItemConfirm:"Sei sicuro di voler rimuovere questo elemento?",viewHistory:"Visualizza cronologia",history:"Cronologia",noHistoryAvailable:"Nessuna cronologia disponibile",tags:"Tags",changePasswordComplexity:"Modifica complessità password",passwordLength:"Lunghezza password",includeLowercase:"Includi lettere minuscole",includeUppercase:"Includi lettere maiuscole",includeNumbers:"Includi numeri",includeSpecialChars:"Includi caratteri speciali",avoidAmbiguousChars:"Evita caratteri ambigui (o, 0, ecc.)",privateEmailTitle:"Email Privata",privateEmailAliasVaultServer:"Server AliasVault",privateEmailDescription:"E2E crittografato, completamente privato.",publicEmailTitle:"Fornitori Pubblici di Email Temporanee",publicEmailDescription:"Anonimi ma con privacy ridotta. Accessibile a chiunque conosca l'indirizzo.",validation:{required:"Campo obbligatorio"}},DT={selectType:"Aggiungi Nuovo Elemento",typeLabel:"Tipo Elemento",creating:"Creazione in corso",editing:"Modifica",regenerateAlias:"Rigenera alias",addCustomField:"Aggiungere un campo personalizzato",fieldLabel:"Etichetta del campo",enterFieldName:"Inserisci il nome del campo",fieldType:"Tipo di campo",fieldTypes:{text:"Testo",hidden:"Nascosto (testo mascherato)",email:"Email",url:"URL",phone:"Telefono",number:"Numero",date:"Data",textArea:"Area di testo"},login:{title:"Accesso"},alias:{title:"Alias"},creditCard:{title:"Carta Di Credito"},note:{title:"Nota sicura"}},BT={"login.url":"URL del sito","login.username":"Nome Utente","login.password":"Password","alias.first_name":"Nome","alias.last_name":"Cognome","alias.gender":"Genere","alias.birthdate":"Data di nascita","login.email":"Email","notes.content":"Note","card.cardholder_name":"Nome del titolare della carta","card.number":"Numero della Carta","card.expiry_month":"Mese di Scadenza","card.expiry_year":"Anno di Scadenza","card.cvv":"CVV","card.pin":"PIN"},UT={addCode:"Aggiungi Codice 2FA",instructions:"Inserisci la chiave segreta mostrata dal sito in cui vuoi aggiungere un'autenticazione a due fattori.",nameOptional:"Nome (facoltativo)",secretKey:"Chiave segreta",saveToViewCode:"Salva per visualizzare il codice",defaultName:"Autenticazione",errors:{invalidSecretKey:"Formato chiave segreta non valido."}},_T={uploading:"Caricamento...",uploadSuccess:"File caricati correttamente",deleteSuccess:"Allegato eliminato con successo.",firefoxExpandRequired:"Per caricare i file, usa la finestra estesa.",openExpandedWindow:"Apri Finestra Estesa"},MT={title:"Email",deleteEmailTitle:"Elimina Email",deleteEmailConfirm:"Sei sicuro di voler eliminare definitivamente questa email?",from:"Da",to:"A",date:"Data",emailContent:"Contenuto email",emailNotFound:"Email non trovata",noEmails:"Nessuna email trovata",noEmailsDescription:"Non hai ancora ricevuto email ai tuoi indirizzi email privati. Quando ne riceverai una nuova, apparirà qui.",offlineMessage:"Sei offline. Collegati a internet per caricare le email.",dateFormat:{justNow:"proprio ora",minutesAgo_single:"{{count}} min fa",minutesAgo_plural:"{{count}} min fa",hoursAgo_single:"{{count}} ora fa",hoursAgo_plural:"{{count}} ore fa",yesterday:"ieri"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"L'indirizzo email attualmente scelto è già in uso. Cambia l'indirizzo modificando queste credenziali.",CLAIM_DOES_NOT_EXIST:"Si è verificato un errore durante il caricamento delle email. Prova a modificare e salvare le credenziali per sincronizzare il database, poi riprova."}},FT={serverUrl:"URL del server",language:"Lingua",autofillEnabled:"Abilita compilazione automatica",version:"Versione",openWebApp:"Apri app web",lock:"Blocca",globalSettings:"Impostazioni globali",autofillPopup:"Popup compilazione automatica",activeOnAllSites:"Attivo su tutti i siti (a meno che non sia disabilitato sotto)",disabledOnAllSites:"Disabilitato su tutti i siti",rightClickContextMenu:"Menu contestuale clic destro",autofillMatching:"Riconoscimento campi automatica.",autofillMatchingMode:"Modalità riconoscimento capi automatica",autofillMatchingModeDescription:"Determina quali credenziali vengono considerate corrispondenti e mostrate come suggerimenti nel popup di compilazione automatica per un determinato sito web.",autofillMatchingDefault:"URL + sottodominio + nome wildcard",autofillMatchingUrlSubdomain:"URL + sottodominio",autofillMatchingUrlExact:"Solo dominio URL esatto",siteSpecificSettings:"Impostazioni specifiche per sito",autofillPopupOn:"Finestra compilazione automatica su: ",enabledForThisSite:"Abilitato per questo sito",disabledForThisSite:"Disabilitato per questo sito",temporarilyDisabledUntil:"Disabilitato temporaneamente fino a ",resetAllSiteSettings:"Reimposta tutte le impostazioni specifiche per sito",appearance:"Aspetto",theme:"Tema",useDefault:"Usa predefinito",light:"Chiaro",dark:"Scuro",keyboardShortcuts:"Scorciatoie da tastiera",configureKeyboardShortcuts:"Configura scorciatoie da tastiera",configure:"Configura",clipboardClearTimeout:"Cancella appunti dopo la copia",clipboardClearTimeoutDescription:"Cancella automaticamente gli appunti dopo aver copiato i dati sensibili",clipboardClearDisabled:"Non pulire mai",clipboardClear5Seconds:"Cancella dopo 5 secondi",clipboardClear10Seconds:"Cancella dopo 10 secondi",clipboardClear15Seconds:"Cancella dopo 15 secondi",autoLockTimeout:"Timeout Blocco Automatico",autoLockTimeoutDescription:"Blocca automaticamente la cassaforte dopo un periodo di inattività",autoLockTimeoutHelp:"La cassaforte si bloccherà solo dopo il periodo specificato di inattività (nessun utilizzo di riempimento automatico o estensione popup aperto). La cassaforte si bloccherà sempre quando il browser è chiuso, indipendentemente da questa impostazione.",autoLockNever:"Mai",autoLock15Seconds:"15 secondi",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minuti",autoLock15Minutes:"15 minuti",autoLock30Minutes:"30 minuti",autoLock1Hour:"1 ora",autoLock4Hours:"4 ore",autoLock8Hours:"8 ore",autoLock24Hours:"24 ore",versionPrefix:"Versione ",autofillSettings:"Impostazioni di riempimento automatico",clipboardSettings:"Impostazioni appunti",contextMenuSettings:"Preferenze menu contestuale",passkeySettings:"Impostazioni Passkey",contextMenu:"Menu contestuale",contextMenuEnabled:"Il menu contestuale è attivato",contextMenuDisabled:"Il menu contestuale è disabilitato",contextMenuDescription:"Click destro sui campi di input per accedere alle opzioni di AliasVault",selectLanguage:"Seleziona la lingua",serverConfiguration:"Configurazione del server",serverConfigurationDescription:"Configurare l'URL del server AliasVault per le istanze self-hosted",customApiUrl:"API URL",customClientUrl:"Url Client",apiUrlHint:"L'URL endpoint API (di solito URL client + /api)",clientUrlHint:"L'URL dell'interfaccia web della tua istanza self-hosted",autofillSettingsDescription:"Abilita o disabilita il popup di riempimento automatico sulle pagine web",autofillEnabledDescription:"I suggerimenti di riempimento automatico appariranno nei moduli di accesso",autofillDisabledDescription:"I suggerimenti di riempimento automatico sono disabilitati",languageSettings:"Lingua",validation:{apiUrlRequired:"L'URL API è obbligatorio",apiUrlInvalid:"Inserisci un URL API valido",clientUrlRequired:"L'URL del client è obbligatorio",clientUrlInvalid:"Inserisci un URL del client valido"},unlockMethod:{title:"Metodo di sblocco cassaforte",introText:"Scegli come sbloccare la cassaforte. Puoi usare la tua password principale (sempre disponibile) o impostare un codice PIN per un accesso più veloce. Dopo 3 tentativi di PIN falliti, è necessario utilizzare la password principale.",password:"Password Principale",pin:"Codice PIN",pinDescription:"Sblocca la cassaforte con codice PIN",setupPin:"Imposta Codice Pin",enterNewPinDescription:"Inserisci un codice PIN composto da almeno 6 cifre",confirmPin:"Conferma PIN",confirmPinDescription:"Inserisci di nuovo il tuo PIN per confermare",invalidPinFormat:"Formato PIN non valido",pinMismatch:"I PIN non corrispondono",incorrectPin:"PIN errato. {{attemptsRemaining}} tentativi rimanenti.",incorrectPinSingular:"Pin non corretto. 1 tentativo rimanente.",enableSuccess:"Sblocco PIN abilitato con successo!",pinLocked:"Il PIN sblocco è stato disabilitato. Utilizza la tua password principale per sbloccare la cassaforte.",pinSecurityWarning:"Lo sblocco PIN nell'estensione del browser può essere meno sicuro della tua password principale, poichè i PIN hanno tipicamente entropia inferiore e possono essere brutalmente forzati se il dispositivo è compromesso. Usalo solo su dispositivi che ti fidi completamente."}},OT={passkey:"Passkey",site:"Sito",helpText:"Le chiavi di accesso vengono create sul sito web quando richiesto. Non possono essere modificate manualmente. Per rimuovere questa chiave di accesso, è possibile eliminarla da questa credenziale. Per sostituire questa passkey o crearne una nuova, visitare il sito web e seguire i relativi suggerimenti.",passkeyMarkedForDeletion:"Passkey contrassegnata per l'eliminazione",passkeyWillBeDeleted:"Questa passkey verrà eliminata quando si salva questa credenziale.",useBrowserPasskey:"Usa Browser Passkey",bypass:{description:"Per quanto tempo vorresti usare il provider di chiavi di accesso del browser per {{origin}}?",thisTimeOnly:"Solo questa volta",alwaysForSite:"Sempre per questo sito"},authenticate:{title:"Accedi con Passkey",signInFor:"Accedi con passkey per",selectPasskey:"Selezionare una passkey per accedere:",noPasskeysFound:"Nessuna passkey trovata per questo sito"},create:{title:"Crea Passkey",createFor:"Crea una nuova passkey per",titleLabel:"Titolo",titlePlaceholder:"Inserisci un nome per questa passkey",createButton:"Crea Passkey",selectPasskeyToReplace:"Selezionare una chiave di accesso da sostituire:",createNewPasskey:"Crea Nuova Passkey",replacingPasskey:"Sostituzione passkey: {{displayName}}",confirmReplace:"Conferma la sostituzione",selectExistingLogin:"Aggiungere al login esistente:",selectExistingLoginDescription:"Allega questa passkey a una credenziale di accesso esistente per questo sito.",attachingToCredential:"Aggiunta passkey a: {{serviceName}}",attachPasskey:"Aggiungi Passkey"},settings:{passkeyProvider:"Provider Passkey",passkeyProviderOn:"Passkey Provider attivo"}},jT={title:"Eliminato di Recente",noItems:"Nessun elemento eliminato",noItemsDescription:"Gli elementi cancellati appariranno qui per 30 giorni prima di essere rimossi definitivamente.",description:"Questi elementi verranno eliminati definitivamente dopo 30 giorni. È possibile ripristinarli o eliminarli immediatamente.",restore:"Ripristina",deletePermanently:"Elimina Definitivamente",emptyAll:"Svuota Tutto",daysRemaining_one:"{{count}} giorno rimanente",daysRemaining_other:"{{count}} giorni rimanenti",expiringSoon:"In scadenza a breve",confirmDeleteTitle:"Elimina definitivamente?",confirmDeleteMessage:"Questo elemento verrà eliminato definitivamente e non può essere recuperato.",confirmEmptyAllTitle:'Svuotare "Eliminati di recente"?',confirmEmptyAllMessage:"Questi {{count}} elementi verranno eliminati permanentemente e non potranno essere recuperati."},PT={title:"Aggiorna Cassaforte",subtitle:"AliasVault è stato aggiornato e la tua cassaforte deve essere aggiornata. Dovrebbe richiedere solo pochi secondi.",versionInformation:"Informazioni sulla versione",yourVault:"Versione della tua cassaforte:",newVersion:"Nuova versione disponibile:",upgrade:"Aggiorna cassaforte",upgrading:"Aggiornamento in corso...",whatsNew:"Novità",whatsNewDescription:"È richiesto un aggiornamento per supportare le seguenti modifiche:",noDescriptionAvailable:"Nessuna descrizione disponibile per questa versione.",alerts:{unableToGetVersionInfo:"Impossibile ottenere informazioni sulla versione. Riprova.",selfHostedServer:"Server Autospitato",selfHostedWarning:"Se usi un server autospitato, assicurati di aggiornare anche la tua istanza, altrimenti l'accesso al client web smetterà di funzionare.",continueUpgrade:"Continua aggiornamento",upgradeFailed:"Aggiornamento non riuscito",failedToApplyMigration:"Impossibile eseguire la migrazione ({{current}} di {{total}})"}},HT={unsyncedChangesTitle:"Modifiche non Sincronizzate",unsyncedChangesWarning:"Hai delle modifiche non sincronizzate che andranno perse se ti disconnetti ora. Sei sicuro di voler continuare?",logoutAnyway:"Esci comunque"},QT={auth:TT,menu:ST,common:kT,content:LT,items:RT,itemTypes:DT,fieldLabels:BT,totp:UT,attachmentUploader:_T,emails:MT,settings:FT,passkeys:OT,recentlyDeleted:jT,upgrade:PT,logout:HT},zT={loginTitle:"Inloggen bij AliasVault",username:"Gebruikersnaam of e-mail",usernamePlaceholder:"naam / naam@bedrijf.com",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",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:"Ontgrendelen",unlockWithPin:"Ontgrendelen met PIN",enterPinToUnlock:"Voer je pincode in om je vault te ontgrendelen",useMasterPassword:"Gebruik hoofdwachtwoord",unlockTitle:"Ontgrendel je vault",logoutConfirm:"Weet je zeker dat je wilt uitloggen?",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?",loginWithMobile:"Log in via de mobiele app",unlockWithMobile:"Ontgrendel met mobiele app",scanQrCode:"Scan deze QR-code met de AliasVault mobiele app om in te loggen en je kluis te ontgrendelen.",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.",wrongPassword:"Onjuist wachtwoord. Probeer het opnieuw.",sessionExpired:"Je sessie is verlopen. Log opnieuw in.",mobileLoginRequestExpired:"Time-out van de mobiele inlogaanvraag. Herlaad de pagina en probeer opnieuw."}},VT={vault:"Vault",emails:"E-mails"},KT={loading:"Laden...",notice:"Melding",error:"Fout",cancel:"Annuleren",confirm:"Bevestigen",back:"Terug",next:"Volgende",use:"Gebruik",add:"Toevoegen",delete:"Verwijderen",undo:"Ongedaan maken",save:"Opslaan",saving:"Opslaan...",create:"Aanmaken",or:"Of",close:"Sluiten",logout:"Uitloggen",copied:"Gekopieerd!",openInNewWindow:"Openen in nieuw venster",enabled:"Ingeschakeld",disabled:"Uitgeschakeld",showPassword:"Wachtwoord tonen",hidePassword:"Wachtwoord verbergen",showDetails:"Toon details",hideDetails:"Verberg details",copyToClipboard:"Naar klembord kopiëren",loadingEmails:"E-mails laden...",loadingTotpCodes:"TOTP-codes laden...",attachments:"Bijlagen",loadingAttachments:"Bijlagen laden...",settings:"Instellingen",recentEmails:"Recente e-mails",credentials:"Credentials",customFields:"Extra velden",twoFactorAuthentication:"Tweestapsverificatie",alias:"Alias",notes:"Notities",email:"E-mail",username:"Gebruikersnaam",password:"Wachtwoord",generate:"Genereren",serviceName:"Naam",loggedIn:"Ingelogd",syncingVault:"Vault synchroniseren",checkingVaultUpdates:"Controleren op vault updates",syncingUpdatedVault:"Bijgewerkte vault synchroniseren",loadMore:"Laad meer",offline:"Offline",offlineMode:"Offline modus",pendingSync:"Synchroniseren...",mergingVaultChanges:"Vault wijzigingen mergen...",uploadingVault:"Vault opslaan...",errors:{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.",browserExtensionOutdated:"Deze browserextensie is verouderd en kan niet worden gebruikt om toegang te krijgen tot deze vault. Update deze browserextensie om door te gaan.",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.",serverVersionTooOld:"De AliasVault server moet bijgewerkt worden naar een nieuwere versie om deze functie te kunnen gebruiken. Neem contact op met support als je hulp nodig hebt.",unknownError:"Er is een onbekende fout opgetreden",unknownErrorTryAgain:"Er is een onbekende fout opgetreden. Probeer het opnieuw.",vaultNotAvailable:"Vault niet beschikbaar",vaultIsLocked:"Vault is vergrendeld",passwordChanged:"Je wachtwoord is veranderd sinds de laatste keer dat je bent ingelogd. Log opnieuw in.",syncConflictMaxRetries:"Kan de vault niet synchroniseren na meerdere pogingen. Probeer het later opnieuw.",mergeFailed:"Samenvoegen vault wijzigingen mislukt. Probeer het opnieuw."},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.",INVALID_REFRESH_TOKEN:"Ongeldig refresh token.",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."}},GT={or:"of",new:"Nieuw",vaultLocked:"AliasVault is vergrendeld.",creatingNewAlias:"Nieuwe alias aanmaken...",noMatchesFound:"Geen resultaten gevonden",searchVault:"Vault doorzoeken...",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",openAliasVaultToUpgrade:"Open AliasVault om te upgraden",vaultUpgradeRequired:"Update is vereist.",dismissPopup:"Pop-up sluiten"},qT={title:"Items",itemName:"Naam",loginCredentials:"Inloggegevens",cardInformation:"Kaartgegevens",addItem:"Item toevoegen",addNewItem:"Nieuw item toevoegen",saveItem:"Item opslaan",itemDetails:"Item details",editItem:"Item bewerken",untitled:"Naamloos",newFolder:"Nieuwe map",createFolder:"Map aanmaken",editFolder:"Map bewerken",folderName:"Mapnaam",folderNameRequired:"Mapnaam is verplicht",folder:"Map",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.",noPasskeysFound:"Er zijn nog geen passkeys aangemaakt. Passkeys worden gemaakt door een website te bezoeken die passkeys als een authenticatiemethode biedt.",noAttachmentsFound:"Geen items gevonden met bijlagen",noItemsOfTypeFound:"Geen {{type}} items gevonden",noMatchingItems:"Geen items gevonden",noMatchingItemsSearch:'Geen items die overeenkomen met "{{search}}"',noMatchingItemsWithFilter:'Geen {{filter}} items die overeenkomen met "{{search}}"',clearSearch:"Wis zoekopdracht",clearFilter:"Wis filter",emptyFolderHint:"Deze map is leeg. Om items naar deze map te verplaatsen, wijzig het item en selecteer deze map.",allItemsInFolders:"Al je items zijn georganiseerd in mappen. Klik op een map hierboven om je gegevens te bekijken, of gebruik de zoekopdracht om specifieke items te vinden.",deleteFolder:"Map verwijderen",deleteFolderKeepItems:"Verwijder alleen map",deleteFolderKeepItemsDescription:"Items zullen terug worden verplaatst naar de hoofdlijst.",deleteFolderAndItems:"Verwijder map en alle items",deleteFolderAndItemsDescription:"{{count}} item(s) zullen worden verplaatst naar recent verwijderd.",filters:{all:"(Alle) Items",passkeys:"Passkeys"},deleteItemTitle:"Verwijder item",deleteItemConfirm:"Weet je zeker dat je dit item wilt verwijderen?",viewHistory:"Toon geschiedenis",history:"Geschiedenis",noHistoryAvailable:"Nog geen geschiedenis",tags:"Labels",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.)",privateEmailTitle:"Privé e-mail",privateEmailAliasVaultServer:"AliasVault server",privateEmailDescription:"E2E versleuteld, volledig privé.",publicEmailTitle:"Publieke tijdelijke e-mailproviders",publicEmailDescription:"Anoniem maar beperkte privacy. E-mail inhoud is leesbaar door iedereen die het adres kent.",validation:{required:"Dit veld is verplicht"}},WT={selectType:"Nieuw item toevoegen",typeLabel:"Itemtype",creating:"Aanmaken",editing:"Bewerken",regenerateAlias:"Alias opnieuw genereren",addCustomField:"Voeg eigen veld toe",fieldLabel:"Veldlabel",enterFieldName:"Voer de veldnaam in",fieldType:"Veldtype",fieldTypes:{text:"Tekst",hidden:"Verborgen (gemaskeerde tekst)",email:"E-mail",url:"URL",phone:"Telefoon",number:"Nummer",date:"Datum",textArea:"Tekstvak"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Creditcard"},note:{title:"Veilige notitie"}},YT={"login.url":"Website URL","login.username":"Gebruikersnaam","login.password":"Wachtwoord","alias.first_name":"Voornaam","alias.last_name":"Achternaam","alias.gender":"Geslacht","alias.birthdate":"Geboortedatum","login.email":"E-mail","notes.content":"Notities","card.cardholder_name":"Naam kaarthouder","card.number":"Kaartnummer","card.expiry_month":"Vervalmaand","card.expiry_year":"Vervaljaar","card.cvv":"CVV","card.pin":"Pincode"},JT={addCode:"2FA-code toevoegen",instructions:"Voer de secret key in die door de website wordt weergegeven waar je tweestapsverificatie wilt toevoegen.",nameOptional:"Naam (optioneel)",secretKey:"Secret key",saveToViewCode:"Opslaan om code te bekijken",defaultName:"Authenticator",errors:{invalidSecretKey:"Ongeldig formaat."}},XT={uploading:"Uploaden...",uploadSuccess:"Bestand succesvol geüpload.",deleteSuccess:"Bijlage is succesvol verwijderd.",firefoxExpandRequired:"Gebruik het grote venster om bestanden te uploaden.",openExpandedWindow:"Open groot venster"},$T={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",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.",offlineMessage:"Je bent offline. Maak verbinding met het internet om je e-mails te laden.",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"},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."}},ZT={serverUrl:"Server URL",language:"Taal",autofillEnabled:"Autofill",version:"Versie",openWebApp:"Web-app openen",lock:"Vergrendelen",globalSettings:"Globale Instellingen",autofillPopup:"Autofill popup",activeOnAllSites:"Actief voor alle sites (tenzij hieronder uitgeschakeld)",disabledOnAllSites:"Uitgeschakeld op alle sites",rightClickContextMenu:"Rechtermuisknop menu",autofillMatching:"Autofill matching",autofillMatchingMode:"Autofill matching modus",autofillMatchingModeDescription:"Bepaalt op welke manier credentials worden beschouwd als matches en worden getoond als suggestie in de autofill popup voor een bepaalde website.",autofillMatchingDefault:"URL + subdomein + naam wildcard",autofillMatchingUrlSubdomain:"URL + subdomein",autofillMatchingUrlExact:"Exacte URL-domein",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",clipboardClearTimeout:"Automatisch klembord wissen na kopiëren",clipboardClearTimeoutDescription:"Automatisch het klembord wissen na kopiëren van gevoelige gegevens",clipboardClearDisabled:"Nooit wissen",clipboardClear5Seconds:"Wis na 5 seconden",clipboardClear10Seconds:"Wis na 10 seconden",clipboardClear15Seconds:"Wis na 15 seconden",autoLockTimeout:"Automatisch vergrendelen",autoLockTimeoutDescription:"Vergrendel de vault automatisch na inactiviteit",autoLockTimeoutHelp:"De vault zal alleen vergrendelen na de opgegeven periode van inactiviteit (geen automatisch invullen of extensie geopend). De vault wordt altijd vergrendeld wanneer de browser wordt afgesloten, ongeacht deze instelling.",autoLockNever:"Nooit",autoLock15Seconds:"15 seconden",autoLock1Minute:"1 minuut",autoLock5Minutes:"5 minuten",autoLock15Minutes:"15 minuten",autoLock30Minutes:"30 minuten",autoLock1Hour:"1 uur",autoLock4Hours:"4 uur",autoLock8Hours:"8 uur",autoLock24Hours:"24 uur",versionPrefix:"Versie ",autofillSettings:"Autofill instellingen",clipboardSettings:"Klembord instellingen",contextMenuSettings:"Context menu instellingen",passkeySettings:"Passkey instellingen",contextMenu:"Context menu",contextMenuEnabled:"Context menu is ingeschakeld",contextMenuDisabled:"Context menu is uitgeschakeld",contextMenuDescription:"Klik met de rechtermuisknop op invoervelden om AliasVault opties te zien",selectLanguage:"Selecteer taal",serverConfiguration:"Serverconfiguratie",serverConfigurationDescription:"Configureer de AliasVault server URL voor self-hosted omgevingen",customApiUrl:"API URL",customClientUrl:"Client URL",apiUrlHint:"De API endpoint URL (meestal client URL + /api)",clientUrlHint:"De webinterface URL van je self-hosted omgeving",autofillSettingsDescription:"Schakel de autofill pop-up in of uit op webpagina's",autofillEnabledDescription:"Autofill suggesties verschijnen op login formulieren",autofillDisabledDescription:"Autofill suggesties zijn uitgeschakeld",languageSettings:"Taal",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"},unlockMethod:{title:"Vault ontgrendelmethode",introText:"Kies hoe je je vault wilt ontgrendelen. Je kunt je hoofdwachtwoord gebruiken (altijd beschikbaar) of een pincode instellen voor snellere toegang. Na 3 mislukte PIN-pogingen moet je je hoofdwachtwoord gebruiken.",password:"Hoofdwachtwoord",pin:"Pincode",pinDescription:"Ontgrendel vault met pincode",setupPin:"Pincode instellen",enterNewPinDescription:"Voer een pincode in van minimaal 6 cijfers",confirmPin:"Bevestig pincode",confirmPinDescription:"Voer je pincode nogmaals in om te bevestigen",invalidPinFormat:"Ongeldige pincode",pinMismatch:"Pincodes komen niet overeen",incorrectPin:"Onjuiste PIN. {{attemptsRemaining}} pogingen resterend.",incorrectPinSingular:"Onjuiste PIN. 1 poging resterend.",enableSuccess:"Pincode succesvol ingeschakeld!",pinLocked:"Pincode is uitgeschakeld. Gebruik je hoofdwachtwoord om je kluis te ontgrendelen.",pinSecurityWarning:"Pincode ontgrendeling in de browserextensie kan minder veilig zijn dan je hoofdwachtwoord, omdat een pincode makkelijker kan worden gebruteforced als iemand toegang heeft tot je apparaat. Gebruik deze optie daarom alleen op apparaten die je volledig vertrouwt."}},eS={passkey:"Passkey",site:"Website",helpText:"Passkeys worden aangemaakt op de website wanneer er om wordt gevraagd. Ze kunnen niet handmatig worden bewerkt. Om deze toegangssleutel te verwijderen, kun je deze verwijderen uit deze credential. Om deze passkey te vervangen of een nieuwe te maken, bezoek de website in kwestie en volg de instructies.",passkeyMarkedForDeletion:"Passkey gemarkeerd om te verwijderen",passkeyWillBeDeleted:"Deze passkey zal worden verwijderd wanneer je deze credential opslaat.",useBrowserPasskey:"Gebruik browser passkey",bypass:{description:"Hoe lang wilt je de browser passkey voor {{origin}} gebruiken?",thisTimeOnly:"Alleen deze keer",alwaysForSite:"Altijd voor deze site"},authenticate:{title:"Inloggen met passkey",signInFor:"Inloggen met passkey voor",selectPasskey:"Selecteer een passkey om in te loggen:",noPasskeysFound:"Geen passkeys gevonden voor deze site"},create:{title:"Passkey aanmaken",createFor:"Maak een nieuwe passkey voor",titleLabel:"Titel",titlePlaceholder:"Voer een naam in voor deze passkey",createButton:"Passkey aanmaken",selectPasskeyToReplace:"Selecteer een passkey om te vervangen:",createNewPasskey:"Passkey aanmaken",replacingPasskey:"Passkey vervangen: {{displayName}}",confirmReplace:"Bevestig vervanging",selectExistingLogin:"Toevoegen aan bestaande login:",selectExistingLoginDescription:"Deze passkey toevoegen aan een bestaande inloggegevens voor deze site.",attachingToCredential:"Passkey toevoegen aan: {{serviceName}}",attachPasskey:"Passkey toevoegen"},settings:{passkeyProvider:"Passkey provider",passkeyProviderOn:"Passkey provider ingeschakeld"}},tS={title:"Recent verwijderd",noItems:"Geen verwijderde items",noItemsDescription:"Items die je verwijdert verschijnen hier gedurende 30 dagen voordat ze definitief verwijderd worden.",description:"Deze items zullen na 30 dagen permanent verwijderd worden. Je kunt ze herstellen of ze direct verwijderen.",restore:"Herstel",deletePermanently:"Permanent verwijderen",emptyAll:"Alles verwijderen",daysRemaining_one:"{{count}} dag resterend",daysRemaining_other:"{{count}} dagen resterend",expiringSoon:"Vervalt binnenkort",confirmDeleteTitle:"Permanent verwijderen?",confirmDeleteMessage:"Dit item zal permanent worden verwijderd en kan niet worden hersteld.",confirmEmptyAllTitle:"Recent verwijderd leegmaken?",confirmEmptyAllMessage:"Alle {{count}} items zullen permanent worden verwijderd en kunnen niet worden hersteld."},aS={title:"Vault upgraden",subtitle:"AliasVault is vernieuwd en je vault moet worden bijgewerkt. Dit kan enkele seconden duren.",versionInformation:"Versie-informatie",yourVault:"Jouw vault versie:",newVersion:"Nieuwe beschikbare versie:",upgrade:"Vault upgraden",upgrading:"Aan het upgraden...",whatsNew:"Wat is er nieuw",whatsNewDescription:"Een upgrade is vereist vanwege de volgende wijzigingen:",noDescriptionAvailable:"Voor deze versie is geen beschrijving beschikbaar.",alerts:{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.",continueUpgrade:"Verdergaan",upgradeFailed:"Upgrade mislukt",failedToApplyMigration:"Kon migratie niet toepassen ({{current}} van {{total}})"}},nS={unsyncedChangesTitle:"Niet-gesynchroniseerde wijzigingen",unsyncedChangesWarning:"Er zijn niet gesynchroniseerde wijzigingen die verloren zullen gaan als je nu uitlogt. Weet je zeker dat je wilt doorgaan?",logoutAnyway:"Toch uitloggen"},rS={auth:zT,menu:VT,common:KT,content:GT,items:qT,itemTypes:WT,fieldLabels:YT,totp:JT,attachmentUploader:XT,emails:$T,settings:ZT,passkeys:eS,recentlyDeleted:tS,upgrade:aS,logout:nS},iS={loginTitle:"Zaloguj się do AliasVault",username:"Nazwa użytkownika lub e-mail",usernamePlaceholder:"nazwa / nazwa@firma.com",passwordPlaceholder:"Wprowadź swoje hasło ",rememberMe:"Zapamiętaj mnie",loginButton:"Zaloguj się",noAccount:"Nie masz jeszcze konta?",createVault:"Utwórz nowy sejf",twoFactorTitle:"Wprowadź kod uwierzytelniający z aplikacji uwierzytelniającej.",authCode:"Kod uwierzytelniania",authCodePlaceholder:"Wpisz 6-cyfrowy kod",verify:"Potwierdź",twoFactorNote:"Uwaga: Jeśli nie masz dostępu do swojego urządzenia uwierzytelniającego, możesz zresetować swój kod 2FA za pomocą kodu odzyskiwania, logując się za pośrednictwem strony internetowej.",masterPassword:"Hasło główne",unlockVault:"Odblokuj",unlockWithPin:"Odblokuj za pomocą kodu PIN",enterPinToUnlock:"Wprowadź swój kod PIN, aby odblokować sejf",useMasterPassword:"Użyj hasła głównego",unlockTitle:"Odblokuj swój sejf",logoutConfirm:"Czy na pewno chcesz się wylogować?",unlockSuccessTitle:"Twój sejf został pomyślnie odblokowany.",unlockSuccessDescription:"Możesz teraz używać automatycznego uzupełniania w formularzach logowania w przeglądarce.",closePopup:"Zamknij to okno.",browseVault:"Przeglądaj zawartość sejfu",connectingTo:"Łączenie z",switchAccounts:"Przełącz konto",loginWithMobile:"Zaloguj się za pomocą aplikacji mobilnej",unlockWithMobile:"Odblokuj za pomocą aplikacji mobilnej",scanQrCode:"Zeskanuj ten kod QR za pomocą aplikacji mobilnej AliasVault, aby się zalogować i odblokować sejf.",errors:{invalidCode:"Wprowadź prawidłowy 6-cyfrowy kod uwierzytelniający.",serverError:"Nie można połączyć się z serwerem AliasVault. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną, jeśli problem będzie się powtarzał.",wrongPassword:"Hasło jest nieprawidłowe. Spróbuj ponownie.",sessionExpired:"Twoja sesja wygasła. Prosimy o zalogowanie się ponownie.",mobileLoginRequestExpired:"Limit czasu logowania upłynął. Proszę odświeżyć stronę i spróbować ponownie."}},sS={vault:"Sejf",emails:"Skrzynka odbiorcza"},oS={loading:"Wczytywanie…",notice:"Uwaga",error:"Błąd",cancel:"Anuluj",confirm:"Potwierdź",back:"Powrót",next:"Dalej",use:"Użyj",add:"Dodaj",delete:"Usuń",undo:"Cofnij",save:"Zapisz",saving:"Zapisywanie...",create:"Utwórz",or:"lub",close:"Zamknąć",logout:"Wyloguj się",copied:"Skopiowano",openInNewWindow:"Otwórz w nowym oknie.",enabled:"Aktywne",disabled:"Nie aktywne",showPassword:"Pokaż hasło",hidePassword:"Ukryj hasło",showDetails:"Pokaż szczegóły",hideDetails:"Ukryj szczegóły",copyToClipboard:"Skopiuj do schowka",loadingEmails:"Ładowanie wiadomości e-mail...",loadingTotpCodes:"Ładowanie kodów TOTP...",attachments:"Załączniki",loadingAttachments:"Ładowanie załączników...",settings:"Ustawienia",recentEmails:"Ostatnie wiadomości e-mail",credentials:"Dane logowania",customFields:"Pola niestandardowe",twoFactorAuthentication:"Weryfikacja dwuetapowa (2FA)",alias:"Alias",notes:"Notatki",email:"Adres e-mail",username:"Nazwa użytkownika",password:"Hasło",generate:"Generate",serviceName:"Nazwa usługi",loggedIn:"Zalogowano",syncingVault:"Synchronizacja sejfu",checkingVaultUpdates:"Sprawdzanie aktualizacji sejfu",syncingUpdatedVault:"Synchronizacja zaktualizowanego sejfu",loadMore:"Załaduj więcej",offline:"Jesteś w trybie offline",offlineMode:"Praca w trybie offline",pendingSync:"Synchronizowanie...",mergingVaultChanges:"Łączenie zmian w sejfie...",uploadingVault:"Ładowanie sejfu...",errors:{serverNotAvailable:"Serwer AliasVault jest niedostępny. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną, jeśli problem nadal występuje.",clientVersionNotSupported:"Ta wersja rozszerzenia przeglądarki AliasVault nie jest już obsługiwana przez serwer. Zaktualizuj rozszerzenie przeglądarki do najnowszej wersji.",browserExtensionOutdated:"To rozszerzenie przeglądarki jest nieaktualne i nie można go używać do uzyskania dostępu do tego sejfu. Aby kontynuować, zaktualizuj to rozszerzenie przeglądarki.",serverVersionNotSupported:"Aby korzystać z tego rozszerzenia przeglądarki, należy zaktualizować serwer AliasVault do nowszej wersji. Jeśli potrzebujesz pomocy, skontaktuj się z działem pomocy technicznej.",serverVersionTooOld:"Aby korzystać z tej funkcji, serwer AliasVault musi zostać zaktualizowany do nowszej wersji. Jeśli potrzebujesz pomocy, skontaktuj się z administratorem serwera.",unknownError:"Wystąpił nieznany błąd",unknownErrorTryAgain:"Wystąpił nieznany błąd. Spróbuj ponownie.",vaultNotAvailable:"Sejf niedostępny",vaultIsLocked:"Sejf jest zablokowany",passwordChanged:"Twoje hasło uległo zmianie od czasu ostatniego logowania. Ze względów bezpieczeństwa prosimy o ponowne zalogowanie się.",syncConflictMaxRetries:"Nie można zsynchronizować sejfu po wielu próbach. Spróbuj ponownie później.",mergeFailed:"Nie udało się scalić zmian w sejfie. Spróbuj ponownie."},apiErrors:{UNKNOWN_ERROR:"Wystąpił nieznany błąd. Spróbuj ponownie.",ACCOUNT_LOCKED:"Konto zostało tymczasowo zablokowane z powodu zbyt wielu nieudanych prób. Spróbuj ponownie później.",ACCOUNT_BLOCKED:"Twoje konto zostało zablokowane. Jeśli uważasz, że to pomyłka, skontaktuj się z pomocą techniczną.",USER_NOT_FOUND:"Nieprawidłowa nazwa użytkownika lub hasło. Spróbuj ponownie.",INVALID_AUTHENTICATOR_CODE:"Nieprawidłowy kod uwierzytelniający. Spróbuj ponownie.",INVALID_RECOVERY_CODE:"Nieprawidłowy kod odzyskiwania. Spróbuj ponownie.",REFRESH_TOKEN_REQUIRED:"Wymagany jest token odświeżania.",INVALID_REFRESH_TOKEN:"Nieprawidłowy token odświeżania.",PUBLIC_REGISTRATION_DISABLED:"Rejestracja nowych kont jest obecnie wyłączona na tym serwerze. Skontaktuj się z administratorem.",USERNAME_REQUIRED:"Wymagane jest podanie nazwy użytkownika.",USERNAME_ALREADY_IN_USE:"Nazwa użytkownika jest już używana.",USERNAME_AVAILABLE:"Nazwa użytkownika jest już używana.",USERNAME_MISMATCH:"Nazwa użytkownika nie pasuje do aktualnego użytkownika.",PASSWORD_MISMATCH:"Podane hasło nie zgadza się z Twoim aktualnym hasłem.",ACCOUNT_SUCCESSFULLY_DELETED:"Konto zostało pomyślnie usunięte.",USERNAME_EMPTY_OR_WHITESPACE:"Nazwa użytkownika nie może być pusta ani zawierać spacji.",USERNAME_TOO_SHORT:"Nazwa użytkownika jest zbyt krótka: musi mieć co najmniej 3 znaki.",USERNAME_TOO_LONG:"Nazwa użytkownika jest zbyt długa: nie może przekraczać 40 znaków.",USERNAME_INVALID_EMAIL:"Nieprawidłowy adres e-mail.",USERNAME_INVALID_CHARACTERS:"Nazwa użytkownika jest nieprawidłowa, może zawierać tylko litery lub cyfry.",VAULT_NOT_UP_TO_DATE:"Twój sejf nie jest aktualny. Zsynchronizuj sejf i spróbuj ponownie.",INTERNAL_SERVER_ERROR:"Wewnętrzny błąd serwera.",VAULT_ERROR:"Lokalny sejf nie jest aktualny. Zsynchronizuj sejf, odświeżając stronę, i spróbuj ponownie."}},lS={or:"lub",new:"Nowy",vaultLocked:"AliasVault jest zablokowany.",creatingNewAlias:"Tworzenie nowego aliasu...",noMatchesFound:"Nie znaleziono żadnych wyników",searchVault:"Przeszukaj sejf...",enterServiceName:"Wprowadź nazwę usługi",enterEmailAddress:"Wprowadź adres e-mail",enterUsername:"Wprowadź nazwę użytkownika",hideFor1Hour:"Ukryj na 1 godzinę (bieżąca strona)",hidePermanently:"Ukryj na stałe (bieżąca strona)",createRandomAlias:"Utwórz losowy alias",createUsernamePassword:"Utwórz nazwę użytkownika/hasło",randomAlias:"Losowy alias",usernamePassword:"Nazwa użytkownika/hasło",createAndSaveAlias:"Utwórz i zapisz alias",createAndSaveCredential:"Utwórz i zapisz dane uwierzytelniające",randomIdentityDescription:"Wygeneruj losową tożsamość z losowym adresem e-mail dostępnym w AliasVault.",randomIdentityDescriptionDropdown:"Losowa tożsamość z losowym adresem e-mail",manualCredentialDescription:"Określ swój adres e-mail i nazwę użytkownika.",manualCredentialDescriptionDropdown:"Ręczne wprowadzanie nazwy użytkownika i hasła",failedToCreateIdentity:"Nie udało się utworzyć tożsamości. Spróbuj ponownie.",enterEmailAndOrUsername:"Wprowadź adres e-mail i/lub nazwę użytkownika",autofillWithAliasVault:"Autouzupełnianie za pomocą AliasVault",generateRandomPassword:"Wygeneruj losowe hasło (skopiuj do schowka)",generateNewPassword:"Wygeneruj nowe hasło",togglePasswordVisibility:"Przełącz widoczność hasła",passwordCopiedToClipboard:"Hasło skopiowane do schowka",openAliasVaultToUpgrade:"Otwórz AliasVault, aby dokonać aktualizacji",vaultUpgradeRequired:"Wymagana aktualizacja sejfu.",dismissPopup:"Zamknij wyskakujące okienko"},cS={title:"Elementy",itemName:"Nazwa",loginCredentials:"Dane logowania",cardInformation:"Informacje o karcie",addItem:"Dodaj element",addNewItem:"Dodaj nowy element",saveItem:"Zapisz element",itemDetails:"Szczegóły produktu",editItem:"Edytuj element",untitled:"Bez tytułu",newFolder:"Nowy folder",createFolder:"Utwórz folder",editFolder:"Edytuj folder",folderName:"Nazwa folderu",folderNameRequired:"Nazwa folderu jest wymagana",folder:"Katalog",welcomeTitle:"Witamy w AliasVault!",welcomeDescription:"Aby skorzystać z rozszerzenia przeglądarki AliasVault - przejdź do strony internetowej i użyj okienka autozupelniania, aby utworzyć nowa tożsamość.",noPasskeysFound:"Nie utworzono jeszcze żadnych kluczy dostępu. Klucze dostępu tworzy się, odwiedzając stronę internetową, która oferuje klucze dostępu jako metodę uwierzytelniania.",noAttachmentsFound:"Nie znaleziono żadnych elementów z załącznikami.",noItemsOfTypeFound:"Nie znaleziono elementów {{type}}",noMatchingItems:"Nie znaleziono pasujących elementów",noMatchingItemsSearch:"Nie znaleziono żadnych elementów pasujących do „{{search}}”",noMatchingItemsWithFilter:"Brak elementów {{filter}} pasujących do „{{search}}”",clearSearch:"Wyczyść wyszukiwanie",clearFilter:"Usuń filtr",emptyFolderHint:"Ten folder jest pusty. Aby przenieść elementy do tego folderu, edytuj element i wybierz ten folder.",allItemsInFolders:"Wszystkie Twoje elementy są uporządkowane w folderach. Kliknij folder powyżej, aby wyświetlić swoje dane logowania, lub skorzystaj z wyszukiwarki, aby znaleźć konkretne elementy.",deleteFolder:"Usuń folder",deleteFolderKeepItems:"Usuń tylko folder",deleteFolderKeepItemsDescription:"Elementy zostaną przeniesione z powrotem do listy głównej.",deleteFolderAndItems:"Usuń folder i wszystkie elementy",deleteFolderAndItemsDescription:"{{count}} element(ów) zostaną przeniesione do Ostatnio usunięte.",filters:{all:"(Wszystkie) pozycje",passkeys:"Klucze dostępu"},deleteItemTitle:"Usuń element",deleteItemConfirm:"Czy na pewno chcesz usunąć ten element?",viewHistory:"Pokaż historię",history:"Historia",noHistoryAvailable:"Brak dostępnej historii",tags:"Znaczniki",changePasswordComplexity:"Zmień komplikację hasła",passwordLength:"Długość hasła",includeLowercase:"Uwzględnij małe litery",includeUppercase:"Uwzględnij wielkie litery",includeNumbers:"Uwzględnij numery",includeSpecialChars:"Uwzględnij znaki specjalne",avoidAmbiguousChars:"Unikaj dwuznacznych znaków (o, 0, itp.)",privateEmailTitle:"Prywatny adres e-mail",privateEmailAliasVaultServer:"Serwer AliasVault",privateEmailDescription:"Szyfrowane E2E, w pełni prywatne.",publicEmailTitle:"Publiczni dostawcy tymczasowych adresów e-mail",publicEmailDescription:"Anonimowe, ale ograniczają prywatność. Treść wiadomości e-mail jest dostępna dla każdego, kto zna adres.",validation:{required:"To pole jest wymagane"}},uS={selectType:"Dodaj nowy element",typeLabel:"Typ elementu",creating:"Tworzenie",editing:"Edytowanie",regenerateAlias:"Ponownie wygeneruj alias",addCustomField:"Dodaj pole niestandardowe",fieldLabel:"Etykieta pola",enterFieldName:"Wprowadź nazwę pola",fieldType:"Typ pola",fieldTypes:{text:"Tekst",hidden:"Ukryty (zamaskowany tekst)",email:"Skrzynka odbiorcza",url:"adres URL",phone:"Numer telefonu",number:"Numer",date:"Data",textArea:"Obszar tekst"},login:{title:"Zaloguj się"},alias:{title:"Tożsamość (Alias)"},creditCard:{title:"Karta płatnicza"},note:{title:"Bezpieczna notatka"}},dS={"login.url":"URL strony internetowej","login.username":"Nazwa użytkownika","login.password":"Hasło","alias.first_name":"Imię","alias.last_name":"Nazwisko","alias.gender":"Płeć","alias.birthdate":"Data urodzenia","login.email":"Skrzynka odbiorcza","notes.content":"Notatki","card.cardholder_name":"Imię i nazwisko posiadacza karty","card.number":"Numer karty","card.expiry_month":"Miesiąc wygaśnięcia","card.expiry_year":"Rok wygaśnięcia","card.cvv":"Kod CVV","card.pin":"Kod PIN"},mS={addCode:"Dodaj kod 2FA",instructions:"Wprowadź tajny klucz wyświetlony na stronie internetowej, na której chcesz dodać uwierzytelnianie dwuskładnikowe.",nameOptional:"Nazwa (opcjonalnie)",secretKey:"Tajny klucz",saveToViewCode:"Zapisz, aby wyświetlić kod",defaultName:"Uwierzytelnianie",errors:{invalidSecretKey:"Nieprawidłowy format tajnego klucza."}},fS={uploading:"Przesyłanie...",uploadSuccess:"Plik został przesłany pomyślnie.",deleteSuccess:"Element został pomyślnie usunięty.",firefoxExpandRequired:"Aby przesłać pliki, użyj rozszerzonego okna.",openExpandedWindow:"Otwórz rozszerzone okno"},gS={title:"Skrzynka odbiorcza",deleteEmailTitle:"Usuń e-mail",deleteEmailConfirm:"Czy na pewno chcesz trwale usunąć ten e-mail?",from:"Od",to:"Do",date:"Data",emailContent:"Treść wiadomości e-mail",emailNotFound:"Nie znaleziono wiadomości e-mail",noEmails:"Nie znaleziono wiadomości e-mail",noEmailsDescription:"Nie otrzymałeś jeszcze żadnych wiadomości e-mail na prywatne adresy e-mail. Kiedy otrzymasz nowy e-mail, pojawi się on tutaj.",offlineMessage:"Jesteś offline. Połącz się z Internetem, aby załadować wiadomości e-mail.",dateFormat:{justNow:"w tej chwili",minutesAgo_single:"{{count}} minut temu",minutesAgo_plural:"{{count}} minut temu",hoursAgo_single:"{{count}} godzinę temu",hoursAgo_plural:"{{count}} godzin temu",yesterday:"wczoraj"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Wybrany adres e-mail jest już w użyciu. Proszę zmienić adres e-mail poprzez edycję danych logowania.",CLAIM_DOES_NOT_EXIST:"Wystąpił błąd podczas próby załadowania wiadomości e-mail. Spróbuj edytować i zapisać wpis logowania, aby zsynchronizować bazę danych, a następnie spróbuj ponownie."}},hS={serverUrl:"Adres URL serwera",language:"Język",autofillEnabled:"Włącz autouzupełnianie",version:"Wersja",openWebApp:"Otwórz aplikację internetową",lock:"Zablokuj",globalSettings:"Ustawienia ogólne",autofillPopup:"Okno autouzupełniania",activeOnAllSites:"Aktywne we wszystkich witrynach (chyba że jest wyłączone)",disabledOnAllSites:"Wyłączone na wszystkich witrynach",rightClickContextMenu:"Aktywacja menu kontekstowego",autofillMatching:"Dopasowanie autouzupełniania",autofillMatchingMode:"Tryb dopasowania autouzupełniania",autofillMatchingModeDescription:"Określa, które dane logowania są uważane za dopasowane i wyświetlane jako sugestie w oknie autouzupełniania dla danej strony internetowej.",autofillMatchingDefault:"Adres URL + subdomena + nazwa wieloznaczna",autofillMatchingUrlSubdomain:"Adres URL + subdomena",autofillMatchingUrlExact:"Dokładna domena adresu URL",siteSpecificSettings:"Ustawienia dotyczące witryny",autofillPopupOn:"Wyskakujące okno autouzupełniania: ",enabledForThisSite:"Włączone dla tej witryny",disabledForThisSite:"Wyłączone dla tej witryny",temporarilyDisabledUntil:"Tymczasowo nieaktywne do ",resetAllSiteSettings:"Zresetuj wszystkie ustawienia witryny",appearance:"Wygląd",theme:"Motyw",useDefault:"Użyj domyślnego",light:"Jasny",dark:"Ciemny",keyboardShortcuts:"Skróty klawiaturowe",configureKeyboardShortcuts:"Skonfiguruj skróty klawiaturowe",configure:"Konfiguracja",clipboardClearTimeout:"Wyczyść schowek po skopiowaniu",clipboardClearTimeoutDescription:"Automatycznie wyczyść schowek po skopiowaniu poufnych danych",clipboardClearDisabled:"Nigdy nie czyść",clipboardClear5Seconds:"Wyczyść po 5 sekundach",clipboardClear10Seconds:"Wyczyść po 10 sekundach",clipboardClear15Seconds:"Wyczyść po 15 sekundach",autoLockTimeout:"Blokada rozszerzenia",autoLockTimeoutDescription:"Automatycznie zablokuj sejf po okresie bezczynności",autoLockTimeoutHelp:"Sejf zostanie zablokowany dopiero po określonym okresie nieaktywności (żadne użycie autouzupełniania lub okienko rozszerzenia nie zostało otwarte). Sejf zostanie zablokowany, gdy przeglądarka zostanie zamknięta, niezależnie od tego ustawienia.",autoLockNever:"Nigdy",autoLock15Seconds:"15 sekund",autoLock1Minute:"1 minuta",autoLock5Minutes:"5 minut",autoLock15Minutes:"15 minut",autoLock30Minutes:"30 minut",autoLock1Hour:"1 godzina",autoLock4Hours:"4 godziny",autoLock8Hours:"8 godzin",autoLock24Hours:"24 godziny",versionPrefix:"Wersja ",autofillSettings:"Ustawienia autouzupełniania",clipboardSettings:"Ustawienia schowka",contextMenuSettings:"Ustawienia menu kontekstowego",passkeySettings:"Ustawienia kluczy dostępu",contextMenu:"Menu kontekstowe",contextMenuEnabled:"Menu kontekstowe jest włączone",contextMenuDisabled:"Menu kontekstowe jest wyłączone",contextMenuDescription:"Kliknij prawym przyciskiem myszy na pola wejściowe, aby uzyskać dostęp do opcji AliasVault",selectLanguage:"Wybierz język",serverConfiguration:"Konfiguracja serwera",serverConfigurationDescription:"Skonfiguruj adres URL serwera sejfu AliasVault",customApiUrl:"Adres URL interfejsu API",customClientUrl:"Adresy URL klienta",apiUrlHint:"Adres URL punktu końcowego API (zazwyczaj adres URL klienta + /api)",clientUrlHint:"Adres URL interfejsu sieci web dla twojej samodzielnej instancji",autofillSettingsDescription:"Włącz lub wyłącz okno autouzupełniania na stronach internetowych",autofillEnabledDescription:"Sugestie autouzupełniania pojawią się na formularzach logowania",autofillDisabledDescription:"Podpowiedzi wyłączone we wszystkich polach",languageSettings:"Język",validation:{apiUrlRequired:"API URL jest wymagane",apiUrlInvalid:"Wprowadź poprawny adres URL API",clientUrlRequired:"Adres URL klienta jest wymagany",clientUrlInvalid:"Wprowadź prawidłowy adres URL klienta"},unlockMethod:{title:"Metoda odblokowania skarbca",introText:"Wybierz sposób odblokowania sejfu. Możesz użyć hasła głównego (zawsze dostępnego) lub skonfigurować kod PIN, aby uzyskać szybszy dostęp. Po 3 nieudanych próbach wprowadzenia kodu PIN konieczne będzie użycie hasła głównego.",password:"Hasło główne",pin:"Kod PIN",pinDescription:"Odblokuj sejf za pomocą kodu PIN",setupPin:"Ustaw kod PIN",enterNewPinDescription:"Wprowadź kod PIN składający się z co najmniej 6 cyfr",confirmPin:"Potwierdź kod PIN",confirmPinDescription:"Wprowadź ponownie swój kod PIN, aby potwierdzić",invalidPinFormat:"Nieprawidłowy format kodu PIN",pinMismatch:"Kody PIN nie są zgodne",incorrectPin:"Nieprawidłowy kod PIN. Pozostało {{attemptsRemaining}} prób.",incorrectPinSingular:"Nieprawidłowy kod PIN. Pozostała 1 próba.",enableSuccess:"Odblokowanie za pomocą kodu PIN zostało aktywowane!",pinLocked:"Odblokowanie za pomocą kodu PIN zostało wyłączone. Aby odblokować sejf, użyj hasła głównego.",pinSecurityWarning:"Odblokowanie za pomocą kodu PIN w rozszerzeniu przeglądarki może być mniej bezpieczne niż hasło główne, ponieważ kody PIN mają zazwyczaj niższą entropię i mogą zostać złamane metodą Brute-Force, jeśli urządzenie zostanie naruszone. Używaj tej funkcji tylko na urządzeniach, którym w pełni ufasz."}},AS={passkey:"Kod dostępu",site:"Strona internetowa",helpText:"Klucze dostępu są tworzone na stronie internetowej po wyświetleniu monitu. Nie można ich edytować ręcznie. Aby usunąć ten klucz dostępu, można go usunąć z tych poświadczeń. Aby zastąpić ten klucz dostępu lub utworzyć nowy, należy odwiedzić stronę internetową i postępować zgodnie z wyświetlanymi instrukcjami.",passkeyMarkedForDeletion:"Klucz dostępu oznaczony do usunięcia",passkeyWillBeDeleted:"To hasło zostanie usunięte po zapisaniu tych danych logowania.",useBrowserPasskey:"Użyj klucza dostępu przeglądarki",bypass:{description:"Jak długo chcesz korzystać z dostawcy kluczy przeglądarki dla {{origin}}?",thisTimeOnly:"Tylko tym razem",alwaysForSite:"Zawsze dla tej witryny"},authenticate:{title:"Zaloguj się za pomocą klucza bezpieczeństwa",signInFor:"Zaloguj się za pomocą klucza bezpieczeństwa dla",selectPasskey:"Wybierz klucz dostępu, aby się zalogować:",noPasskeysFound:"Nie znaleziono kluczy dostępu dla tej witryny"},create:{title:"Utwórz klucz dostępu",createFor:"Utwórz nowy klucz dostępu dla",titleLabel:"Tytuł",titlePlaceholder:"Wprowadź nazwę dla tego klucza dostępu",createButton:"Utwórz klucz dostępu",selectPasskeyToReplace:"Wybierz klucz dostępu, który chcesz zastąpić:",createNewPasskey:"Utwórz nowy klucz dostępu",replacingPasskey:"Zamiana klucza dostępu: {{displayName}}",confirmReplace:"Potwierdź zamianę",selectExistingLogin:"Dodaj do istniejącego loginu:",selectExistingLoginDescription:"Dołącz ten klucz dostępu do istniejącego logowania dla tej witryny.",attachingToCredential:"Dodawanie klucza dostępu do: {{serviceName}}",attachPasskey:"Dodaj klucz dostępu"},settings:{passkeyProvider:"Dostawca klucza dostępu",passkeyProviderOn:"Dostawca klucza dostępu włączony "}},pS={title:"Ostatnio usunięte",noItems:"Brak usuniętych elementów",noItemsDescription:"Usunięte elementy pojawią się tutaj na 30 dni, zanim zostaną trwale usunięte.",description:"Te elementy zostaną trwale usunięte po 30 dniach. Możesz je przywrócić lub natychmiast usunąć.",restore:"Przywróć",deletePermanently:"Usuń bezpowrotnie",emptyAll:"Opróżnij wszystkie",daysRemaining_one:"Pozostało {{count}} dni",daysRemaining_other:"Pozostało {{count}} dni",expiringSoon:"Wkrótce wygasa",confirmDeleteTitle:"Usunąć trwale?",confirmDeleteMessage:"Ten element zostanie trwale usunięty i nie będzie można go odzyskać.",confirmEmptyAllTitle:"Opróżnij ostatnio usunięte?",confirmEmptyAllMessage:"Wszystkie elementy {{count}} zostaną trwale usunięte i nie mogą zostać odzyskane."},yS={title:"Aktualizacja sejfu",subtitle:"Wersja AliasVault jest nieaktualna i konieczna jest aktualizacja Twojego sejfu. Zajmie to tylko kilka sekund.",versionInformation:"Informacje o wersji",yourVault:"Twoja wersja sejfu:",newVersion:"Nowa dostępna wersja:",upgrade:"Aktualizuj sejf",upgrading:"Aktualizacja...",whatsNew:"Co nowego",whatsNewDescription:"Uaktualnienie jest wymagane do obsługi następujących zmian:",noDescriptionAvailable:"Brak dostępnego opisu dla tej wersji.",alerts:{unableToGetVersionInfo:"Nie można uzyskać informacji o wersji. Spróbuj ponownie.",selfHostedServer:"Serwer własny",selfHostedWarning:"Jeśli używasz własnego serwera, upewnij się, że zaktualizujesz swoją samodzielną instancję, ponieważ w przeciwnym razie logowanie się do klienta internetowego przestanie działać.",continueUpgrade:"Kontynuuj aktualizację",upgradeFailed:"Aktualizacja nie powiodła się",failedToApplyMigration:"Nie udało się zastosować migracji ({{current}} of {{total}})"}},ES={unsyncedChangesTitle:"Zmiany niesynchronizowane",unsyncedChangesWarning:"Masz niezsynchronizowane zmiany, które zostaną utracone, jeśli się teraz wylogujesz. Czy na pewno chcesz kontynuować?",logoutAnyway:"Wyloguj się mimo wszystko"},bS={auth:iS,menu:sS,common:oS,content:lS,items:cS,itemTypes:uS,fieldLabels:dS,totp:mS,attachmentUploader:fS,emails:gS,settings:hS,passkeys:AS,recentlyDeleted:pS,upgrade:yS,logout:ES},IS={loginTitle:"Fazer login no AliasVault",username:"Nome de usuário ou e-mai",usernamePlaceholder:"nome / nome@empresa.com",passwordPlaceholder:"Digite sua senha",rememberMe:"Lembrar-me",loginButton:"Entrar",noAccount:"Não possui conta?",createVault:"Criar novo cofre",twoFactorTitle:"Por favor, insira o código de autenticação do seu aplicativo de autenticação.",authCode:"Código de Autenticação",authCodePlaceholder:"Digite o código de 6 dígitos",verify:"Verificar",twoFactorNote:"Nota: se você não tem acesso ao seu aparelho de verificação, você pode resetar seu 2FA com um código de recuperação fazendo login no site.",masterPassword:"Senha Mestre",unlockVault:"Desbloquear",unlockWithPin:"Desbloquear com PIN",enterPinToUnlock:"Digite seu PIN para desbloquear seu cofre",useMasterPassword:"Utilizar Senha Mestre",unlockTitle:"Desbloquear Seu Cofre",logoutConfirm:"Tem certeza que deseja sair?",unlockSuccessTitle:"O seu cofre foi desbloqueado com sucesso",unlockSuccessDescription:"Agora você pode utilizar o preenchimento automático nos formulários de login no seu navegador.",closePopup:"Fechar este pop-up",browseVault:"Navegar por conteúdo do cofre",connectingTo:"Conectando à",switchAccounts:"Mudar de conta?",loginWithMobile:"Entrar utilizado Dispositivo Móvel",unlockWithMobile:"Desbloquear utilizando Dispositivo Móvel",scanQrCode:"Escaneie este código QR com seu aplicativo AliasVault para dispositivo móvel para entrar e desbloquear seu cofre.",errors:{invalidCode:"Por favor digite o código de autenticação de 6 dígitos.",serverError:"Não foi possível conectar ao servidor do AliasVault. Por favor tente novamente mais tarde ou entre em contato com o suporte caso o problema persista.",wrongPassword:"Senha incorreta. Por favor tente novamente.",sessionExpired:"Sua sessão expirou. Por favor, faça login novamente.",mobileLoginRequestExpired:"Requisição de login pelo dispositivo móvel demorou muito. Por favor, atualize a página e tente novamente."}},vS={vault:"Cofre",emails:"E-mails"},wS={loading:"Carregando...",notice:"Aviso",error:"Erro",cancel:"Cancelar",confirm:"Confirmar",back:"Voltar",next:"Próximo",use:"Utilizar",add:"Adicionar",delete:"Excluir",undo:"Desfazer",save:"Salvar",saving:"Salvando...",create:"Criar",or:"Ou",close:"Fechar",logout:"Sair",copied:"Copiado!",openInNewWindow:"Abrir em uma nova janela",enabled:"Habilitado",disabled:"Desabilitado",showPassword:"Mostrar senha",hidePassword:"Ocultar senha",showDetails:"Exibir detalhes",hideDetails:"Esconder detalhes",copyToClipboard:"Copiar para a área de transferência",loadingEmails:"Carregando e-mails...",loadingTotpCodes:"Carregando códigos TOTP...",attachments:"Anexos",loadingAttachments:"Carregando anexos...",settings:"Configurações",recentEmails:"E-mails recentes",credentials:"Credenciais",customFields:"Campos Personalizados",twoFactorAuthentication:"Autenticação de dois fatores",alias:"Alias",notes:"Notas",email:"E-mail",username:"Nome de Usuário",password:"Senha",generate:"Gerar",serviceName:"Nome do Serviço",loggedIn:"Logado",syncingVault:"Sincronizando cofre",checkingVaultUpdates:"Verificando atualizações do cofre",syncingUpdatedVault:"Sincronizando cofre atualizado",loadMore:"Carregar mais",offline:"Offline",offlineMode:"Operando em modo offline",pendingSync:"Sincronizando...",mergingVaultChanges:"Integrando mudanças do cofre...",uploadingVault:"Fazendo upload do cofre...",errors:{serverNotAvailable:"O servidor AliasVault não está disponível. Por favor, tente novamente mais tarde ou entre em contato com o suporte caso o problema persista.",clientVersionNotSupported:"Esta versão da extensão AliasVault para o navegador não é mais suportada pelo servidor. Por favor, atualize sua extensão para a última versão.",browserExtensionOutdated:"Esta extensão do navegador está desatualizada e não pode ser utilizada para acessar este cofre. Por favor, atualize esta extensão para continuar.",serverVersionNotSupported:"O servidor AliasVault precisa ser atualizado para uma nova versão para poder utilizar esta extensão de navegador. Por favor, entre em contato com o suporte caso precise de ajuda.",serverVersionTooOld:"O servidor do AliasVault deve ser atualizado para uma versão mais recente para utilizar esta função. Por favor, entre em contato com o administrador do servidor se precisar de ajuda.",unknownError:"Ocorreu um erro desconhecido",unknownErrorTryAgain:"Ocorreu um erro inesperado. Por favor, tente novamente.",vaultNotAvailable:"Cofre não disponível",vaultIsLocked:"O cofre está bloqueado",passwordChanged:"Sua senha mudou desde o último login. Por favor, realize login novamente por questões de segurança.",syncConflictMaxRetries:"Não foi possível sincronizar seu cofre após várias tentativas. Por favor, tente novamente mais tarde.",mergeFailed:"Falha ao combinar mudanças do cofre. Por favor, tente novamente."},apiErrors:{UNKNOWN_ERROR:"Um erro desconhecido ocorreu. Por favor, tente novamente.",ACCOUNT_LOCKED:"Conta temporariamente bloqueada por muitas tentativas de login falhas. Por favor, tente novamente mais tarde.",ACCOUNT_BLOCKED:"Sua conta foi desabilitada. Se você acredita que isto foi um erro, por favor, entre em contato com o suporte.",USER_NOT_FOUND:"Usuário ou senha incorretos. Por favor, tente novamente.",INVALID_AUTHENTICATOR_CODE:"Código de autenticação incorreto. Por favor, tente novamente.",INVALID_RECOVERY_CODE:"Código de recuperação inválido. Por favor, tente novamente.",REFRESH_TOKEN_REQUIRED:"Token de atualização é obrigatório.",INVALID_REFRESH_TOKEN:"Token de atualização inválido.",PUBLIC_REGISTRATION_DISABLED:"Registro de novas contas está atualmente desabilitado neste servidor. Por favor entre em contato com o administrador.",USERNAME_REQUIRED:"Nome de usuário é obrigatório.",USERNAME_ALREADY_IN_USE:"Nome de usuário já está em uso.",USERNAME_AVAILABLE:"Nome de usuário está disponível.",USERNAME_MISMATCH:"Nome de usuário não corresponde ao usuário atual.",PASSWORD_MISMATCH:"A senha digitada não corresponde á sua senha atual.",ACCOUNT_SUCCESSFULLY_DELETED:"Conta excluída com sucesso.",USERNAME_EMPTY_OR_WHITESPACE:"Nome de usuário não pode estar vazio ou em branco.",USERNAME_TOO_SHORT:"Nome de usuário muito curto: deve ter pelo menos 3 caracteres.",USERNAME_TOO_LONG:"Nome de usuário muito longo: não pode conter mais de 40 caracteres.",USERNAME_INVALID_EMAIL:"Endereço de e-mail inválido.",USERNAME_INVALID_CHARACTERS:"Nome de usuário é inválido, deve conter apenas letras ou números.",VAULT_NOT_UP_TO_DATE:"Seu cofre não está atualizado. Por favor, sincronize seu cofre e tente novamente.",INTERNAL_SERVER_ERROR:"Erro intero do servidor.",VAULT_ERROR:"O cofre local não está atualizado. Por favor, sincronize seu cofre recarregando a página e tente novamente."}},CS={or:"ou",new:"Novo",vaultLocked:"AliasVault está bloqueado.",creatingNewAlias:"Criando novo alias...",noMatchesFound:"Nenhum resultado encontrado",searchVault:"Pesquisar cofre...",enterServiceName:"Digite o nome do serviço",enterEmailAddress:"Digite o endereço de e-mail",enterUsername:"Digite o nome de usuário",hideFor1Hour:"Ocultar por 1 hora (site atual)",hidePermanently:"Ocultar permanentemente (site atual)",createRandomAlias:"Criar alias aleatório",createUsernamePassword:"Criar nome de usuário/senha",randomAlias:"Alias aleatório",usernamePassword:"Nome de usuário/senha",createAndSaveAlias:"Criar e salvar alias",createAndSaveCredential:"Criar e salvar credencial",randomIdentityDescription:"Gerar uma identidade aleatória com um endereço de e-mail aleatório acessível pelo AliasVault.",randomIdentityDescriptionDropdown:"Identidade aleatória com e-mail aleatório",manualCredentialDescription:"Especifique seu próprio endereço de e-mail e nome de usuário.",manualCredentialDescriptionDropdown:"Nome de usuário e senha manuais",failedToCreateIdentity:"Falha ao criar identidade. Por favor, tente novamente.",enterEmailAndOrUsername:"Digite o e-mail e/ou nome de usuário",autofillWithAliasVault:"Preenchimento Automático com AliasVault",generateRandomPassword:"Gerar senha aleatória (copiar para a área de transferência)",generateNewPassword:"Gerar nova senha",togglePasswordVisibility:"Alternar visibilidade da senha",passwordCopiedToClipboard:"Senha copiada para a área de transferência",openAliasVaultToUpgrade:"Abra o AliasVault para atualizar",vaultUpgradeRequired:"Atualização de cofre necessária.",dismissPopup:"Ignorar pop-up"},NS={title:"Itens",itemName:"Nome",loginCredentials:"Credenciais de Login",cardInformation:"Informações do Cartão",addItem:"Adicionar Item",addNewItem:"Adicionar novo item",saveItem:"Salvar Item",itemDetails:"Detalhes do Item",editItem:"Editar Item",untitled:"Sem Título",newFolder:"Nova Pasta",createFolder:"Criar Pasta",editFolder:"Editar Pasta",folderName:"Nome da Pasta",folderNameRequired:"Nome da pasta é obrigatório",folder:"Pasta",welcomeTitle:"Boas-vindas ao AliasVault!",welcomeDescription:"Para utilizar a extensão de navegador do AliasVault: navegue para um site e utilize o pop-up de preenchimento automático do AliasVault para criar uma nova credencial.",noPasskeysFound:"Nenhuma passkey foi criada ainda. Passkeys são veiadas visitando um website que ofereça passkey como método de autenticação.",noAttachmentsFound:"Nenhum item com anexos foi encontrado",noItemsOfTypeFound:"Nenhum item do tipo {{type}} foi encontrado",noMatchingItems:"Nenhum ítem correspondente encontrado",noMatchingItemsSearch:'Nenhum item corresponde à "{{search}}"',noMatchingItemsWithFilter:'Nenhum item com o filtro {{filter}} corresponde à "{{search}}"',clearSearch:"Limpar pesquisa",clearFilter:"Limpar filtro",emptyFolderHint:"Esta pasta está vazia. Para mover itens para esta pasta, edite o item e toque no ícone da pasta no campo de nome.",allItemsInFolders:"Todos os seus itens estão organizados em pastas. Clique em uma pasta acima para ver suas credenciais, ou utilize a busca para encontrar itens específicos.",deleteFolder:"Excluir Pasta",deleteFolderKeepItems:"Excluir apenas a pasta",deleteFolderKeepItemsDescription:"Itens serão movidos de volta para a lista principal.",deleteFolderAndItems:"Excluir pasta e todos os itens",deleteFolderAndItemsDescription:"{{count}} item(s) será(ão) movido(s) para Recentemente Excluídos.",filters:{all:"(Todos os) Itens",passkeys:"Passkeys"},deleteItemTitle:"Excluir Item",deleteItemConfirm:"Tem certeza que deseja excluir este item?",viewHistory:"Visualizar histórico",history:"Histórico",noHistoryAvailable:"Histórico não disponível",tags:"Tags",changePasswordComplexity:"Alterar complexidade de senha",passwordLength:"Tamanho da senha",includeLowercase:"Incluir letras minúsculas",includeUppercase:"Incluir letras maiúsculas",includeNumbers:"Incluir números",includeSpecialChars:"Incluir caracteres especiais",avoidAmbiguousChars:"Evitar caracteres ambíguos (o, 0, etc.)",privateEmailTitle:"E-mail Privado",privateEmailAliasVaultServer:"Servidor AliasVault",privateEmailDescription:"Criptografia E2E, totalmente privado.",publicEmailTitle:"Provedores Públicos de E-mail Temporário",publicEmailDescription:"Anônimo mas com privacidade limitada. Conteúdo do e-mail pode ser lido por qualquer um que souber o endereço.",validation:{required:"Este campo é obrigatório"}},xS={selectType:"Adicionar Novo Item",typeLabel:"Tipo do Item",creating:"Criando",editing:"Editando",regenerateAlias:"Gerar alias novamente",addCustomField:"Adicionar campo personalizado",fieldLabel:"Nome do Campo",enterFieldName:"Digite o nome do campo",fieldType:"Tipo do Campo",fieldTypes:{text:"Texto",hidden:"Escondido (texto mascarado)",email:"E-mail",url:"URL",phone:"Telefone",number:"Número",date:"Data",textArea:"Área de Texto"},login:{title:"Login"},alias:{title:"Alias"},creditCard:{title:"Cartão de Crédito"},note:{title:"Nota Segura"}},TS={"login.url":"URL do Website","login.username":"Nome de usuário","login.password":"Senha","alias.first_name":"Primeiro Nome","alias.last_name":"Sobrenome","alias.gender":"Gênero","alias.birthdate":"Data de nascimento","login.email":"E-mail","notes.content":"Notas","card.cardholder_name":"Nome do Titular do Cartão","card.number":"Número do Cartão","card.expiry_month":"Mês de Expiração","card.expiry_year":"Ano de Expiração","card.cvv":"CVV","card.pin":"Senha"},SS={addCode:"Adicionar Código de Autenticação de Dois Fatores",instructions:"Digite a chave secreta exibida pelo website que você quer adicionar a autenticação de dois fatores.",nameOptional:"Nome (opcional)",secretKey:"Chave Secreta",saveToViewCode:"Salvar para ver código",defaultName:"Autenticador",errors:{invalidSecretKey:"Formato de chave secreta inválido."}},kS={uploading:"Fazendo upload...",uploadSuccess:"Arquivos enviados com sucesso.",deleteSuccess:"Anexo excluído com sucesso.",firefoxExpandRequired:"Para fazer o upload dr arquivos, use a tela expandida.",openExpandedWindow:"Abrir Tela Expandida"},LS={title:"E-mails",deleteEmailTitle:"Excluir E-mail",deleteEmailConfirm:"Tem certeza de que deseja excluir permanentemente este e-mail?",from:"De",to:"Para",date:"Data",emailContent:"Conteúdo do email",emailNotFound:"E-mail não encontrado",noEmails:"Nenhum e-mail encontrado",noEmailsDescription:"Você ainda não recebeu nenhum e-mail em seus endereços de e-mail privados. Quando receber um novo e-mail, ele aparecerá aqui.",offlineMessage:"Você está offline. Por favor, conecte-se à internet para carregar seus e-mails.",dateFormat:{justNow:"agora",minutesAgo_single:"há {{count}} minuto",minutesAgo_plural:"há {{count}} minutos",hoursAgo_single:"há {{count}} hora",hoursAgo_plural:"há {{count}} horas",yesterday:"ontem"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"O e-mail escolhido já está em uso. Por favor, altere o endereço de e-mail editando esta credencial.",CLAIM_DOES_NOT_EXIST:"Ocorreu um erro ao tentar carregar os e-mails. Por favor, tente editar e salvar a credencial para sincronizar com o banco de dados, e tente novamente."}},RS={serverUrl:"URL do servidor",language:"Idioma",autofillEnabled:"Ativar o Preenchimento Automático",version:"Versão",openWebApp:"Abrir aplicativo web",lock:"Bloquear",globalSettings:"Configurações Gerais",autofillPopup:"Pop-up de preenchimento automático",activeOnAllSites:"Ativado em todos os sites (a menos que esteja desabilitado abaixo)",disabledOnAllSites:"Desativado em todos os sites",rightClickContextMenu:"Menu do botão direito",autofillMatching:"Correspondência de Preenchimento Automático",autofillMatchingMode:"Modo de correspondência de preenchimento automático",autofillMatchingModeDescription:"Determina quais credenciais são consideradas uma correspondência e mostradas como sugestões no pop-up de preenchimento automático para um determinado site.",autofillMatchingDefault:"Wildcard URL + subdomínio + nome",autofillMatchingUrlSubdomain:"URL + subdomínio",autofillMatchingUrlExact:"Apenas URL exato do domínio",siteSpecificSettings:"Configurações Específicas do Site",autofillPopupOn:"Pop-up de preenchimento automático em: ",enabledForThisSite:"Habilitado para este site",disabledForThisSite:"Desabilitado para este site",temporarilyDisabledUntil:"Temporariamente desabilitado até ",resetAllSiteSettings:"Redefinir todas as configurações específicas do site",appearance:"Aparência",theme:"Tema",useDefault:"Utilizar padrão",light:"Claro",dark:"Escuro",keyboardShortcuts:"Atalhos do Teclado",configureKeyboardShortcuts:"Configurar atalhos do teclado",configure:"Configurar",clipboardClearTimeout:"Limpar área de transferência após copiar",clipboardClearTimeoutDescription:"Limpar automaticamente a área de transferência após copiar dados sensíveis",clipboardClearDisabled:"Nunca limpar",clipboardClear5Seconds:"Limpar após 5 segundos",clipboardClear10Seconds:"Limpar após 10 segundos",clipboardClear15Seconds:"Limpar após 15 segundos",autoLockTimeout:"Tempo para bloqueio automático",autoLockTimeoutDescription:"Bloquear o cofre automaticamente após período de inatividade",autoLockTimeoutHelp:"O cofre será bloqueado apenas após o período de inatividade especificado (nenhuma utilização de preenchimento automático ou pop-up da extensão abertos). O cofre sempre será bloqueado quando o navegador for fechado, independentemente desta configuração.",autoLockNever:"Nunca",autoLock15Seconds:"15 segundos",autoLock1Minute:"1 minuto",autoLock5Minutes:"5 minutos",autoLock15Minutes:"15 minutos",autoLock30Minutes:"30 minutos",autoLock1Hour:"1 hora",autoLock4Hours:"4 horas",autoLock8Hours:"8 horas",autoLock24Hours:"24 horas",versionPrefix:"Versão ",autofillSettings:"Configurações de Preenchimento Automático",clipboardSettings:"Configurações da Área de Transferência",contextMenuSettings:"Configurações do Menu de Contexto",passkeySettings:"Configurações de Passkey",contextMenu:"Menu de Contexto",contextMenuEnabled:"Menu de contexto está habilitado",contextMenuDisabled:"Menu de contexto está desabilitado",contextMenuDescription:"Clique com o botão direito nos campos para acessar as opções do AliasVault",selectLanguage:"Selecionar Idioma",serverConfiguration:"Configurações do Servidor",serverConfigurationDescription:"Configure o URL do servidor do AliasVault para instâncias self-hosted",customApiUrl:"URL da API",customClientUrl:"URL do Cliente",apiUrlHint:"O URL do endpoint da API (geralmente o URL do cliente + /api)",clientUrlHint:"O URL da interface web da sua instância self-hosted",autofillSettingsDescription:"Habilite ou desabilite o popup de autopreenchimento em páginas web",autofillEnabledDescription:"Sugestões de autopreenchimento aparecerão em formulários de login",autofillDisabledDescription:"Sugestões de autopreenchimento estão desabilitadas globalmente",languageSettings:"Idioma",validation:{apiUrlRequired:"URL de API é obrigatório",apiUrlInvalid:"Por favor, digite um URL de API válido",clientUrlRequired:"URL de Cliente é obrigatório",clientUrlInvalid:"Por favor, digite um URL de cliente válido"},unlockMethod:{title:"Método de Desbloqueio do Cofre",introText:"Escolha como você quer desbloquear seu cofre. Você pode utilizar sua senha mestre (sempre disponível), ou configurar um PIN para facilitar o acesso. Após 3 tentativas incorretas de PIN, você deverá utilizar sua senha mestre.",password:"Senha Mestre",pin:"Código PIN",pinDescription:"Desbloquear cofre com código PIN",setupPin:"Configurar Código PIN",enterNewPinDescription:"Digite um PIN que consista de, pelo menos, 6 dígitos",confirmPin:"Confirmar PIN",confirmPinDescription:"Digite seu PIN novamente para confirmar",invalidPinFormat:"Formato de PIN inválido",pinMismatch:"PINs não correspondem",incorrectPin:"PIN incorreto. {{attemptsRemaining}} tentativas restantes.",incorrectPinSingular:"PIN incorreto. 1 tentativa restante.",enableSuccess:"Desbloqueio por PIN habilitado com sucesso!",pinLocked:"Desbloqueio por PIN foi desabilitado. Por favor, utilize sua senha mestre para desbloquear o cofre.",pinSecurityWarning:"Desbloqueio por PIN na extensão de navegador pode ser menos segura que sua senha mestre, uma vez que PINs geralmente tem uma entropia menor e podem ser vulneráveis à tentativas forçadas caso seu dispositivo esteja comprometido. Utilize apenas em dispositivos que tenha total confiança."}},DS={passkey:"Passkey",site:"Site",helpText:"Passkeys são criadas no website quando solicitado. Elas não podem ser editadas manualmente. Para remover esta passkey, você pode excluí-la desta credencial. Para trocar esta passkey ou gerar uma nova, visite o website e siga as instruções.",passkeyMarkedForDeletion:"Passkey marcada para ser excluída",passkeyWillBeDeleted:"Esta passkey será excluída quando você salvar esta credencial.",useBrowserPasskey:"Utilizar Passkey do Navegador",bypass:{description:"Por quanto tempo você deseja utilizar o provedor de passkey do navegador para {{origin}}?",thisTimeOnly:"Apenas desta vez",alwaysForSite:"Sempre para este site"},authenticate:{title:"Fazer login com uma Passkey",signInFor:"Fazer login com uma passkey para",selectPasskey:"Selecione uma passkey para fazer login:",noPasskeysFound:"Nenhuma passkey foi encontrada para este site"},create:{title:"Criar Passkey",createFor:"Criar nova passkey para",titleLabel:"Título",titlePlaceholder:"Digite um nome para esta passkey",createButton:"Criar Passkey",selectPasskeyToReplace:"Selecione uma passkey para alterar:",createNewPasskey:"Criar Nova Passkey",replacingPasskey:"Alternado passkey: {{displayName}}",confirmReplace:"Confirmar Alterações",selectExistingLogin:"Adicionar à login existente:",selectExistingLoginDescription:"Adicionar este passkey em uma credencial de login para este site.",attachingToCredential:"Adicionando passkey em: {{serviceName}}",attachPasskey:"Adicionar Passkey"},settings:{passkeyProvider:"Provedor de Passkey",passkeyProviderOn:"Provedor de Passkey em "}},BS={title:"Recentemente Excluídos",noItems:"Nenhum item excluído",noItemsDescription:"Itens que você excluir aparecerão aqui por 30 dias, antes de serem removidos permanentemente.",description:"Estes itens serão excluídos permanentemente após 30 dias. Você pode restaurá-los ou excluí-los imediatamente.",restore:"Restaurar",deletePermanently:"Excluir Permanentemente",emptyAll:"Esvaziar Tudo",daysRemaining_one:"{{count}} dia restante",daysRemaining_other:"{{count}} dias restantes",expiringSoon:"Expirando em breve",confirmDeleteTitle:"Excluir Permanentemente?",confirmDeleteMessage:"Este item será excluído permanentemente, e não poderá ser restaurado.",confirmEmptyAllTitle:"Esvaziar Recentemente Excluídos?",confirmEmptyAllMessage:"Todos os {{count}} itens serão excluídos permanentemente, e não poderão ser restaurados."},US={title:"Atualizar Cofre",subtitle:"AliasVault foi atualizado e seu cofre precisa ser atualizado. Isso deve levar apenas alguns segundos.",versionInformation:"Informação de Versão",yourVault:"Versão do seu cofre:",newVersion:"Nova versão disponível:",upgrade:"Atualizar Cofre",upgrading:"Atualizando...",whatsNew:"O Que Há de Novo",whatsNewDescription:"Uma atualização é necessária para utilizar as seguintes mudanças:",noDescriptionAvailable:"Nenhuma descrição disponível para esta versão.",alerts:{unableToGetVersionInfo:"Não foi possível solicitar informações da versão. Por favor, tente novamente.",selfHostedServer:"Servidor Self-Hosted",selfHostedWarning:"Se você está utilizando um servidor self-hosted, faça também a atualização da instância self-hosted, caso contrário o login no cliente web vai parar de funcionar.",continueUpgrade:"Continuar Atualização",upgradeFailed:"Atualização Falhou",failedToApplyMigration:"Falha ao aplicar migração ({{current}} de {{total}})"}},_S={unsyncedChangesTitle:"Alterações Dessincronizadas",unsyncedChangesWarning:"Você tem alterações dessincronizadas que serão perdidas caso você saia da sua conta agora. Têm certeza que deseja continuar?",logoutAnyway:"Sair assim mesmo"},MS={auth:IS,menu:vS,common:wS,content:CS,items:NS,itemTypes:xS,fieldLabels:TS,totp:SS,attachmentUploader:kS,emails:LS,settings:RS,passkeys:DS,recentlyDeleted:BS,upgrade:US,logout:_S},FS={loginTitle:"Autentificare în AliasVault",username:"Numele de utilizator sau adresa de e-mail",usernamePlaceholder:"nume / nume@companie.com",passwordPlaceholder:"Introdu parola",rememberMe:"Ține-mă minte",loginButton:"Autentificare",noAccount:"Nu ai încă un cont?",createVault:"Creează un seif nou",twoFactorTitle:"Introdu codul de autentificare din aplicația ta de autentificare.",authCode:"Cod de autentificare",authCodePlaceholder:"Introdu codul din 6 cifre",verify:"Verifică",twoFactorNote:"Notă: dacă nu ai acces la dispozitivul de autentificare, poți reseta 2FA cu un cod de recuperare autentificându-te prin intermediul site-ului web.",masterPassword:"Parolă principală",unlockVault:"Deblocați",unlockWithPin:"Deblochează cu PIN",enterPinToUnlock:"Introdu codul PIN pentru a debloca seiful",useMasterPassword:"Folosește parola principală",unlockTitle:"Deblochează seiful",logoutConfirm:"Sigur vrei să te deconectezi?",unlockSuccessTitle:"Seiful a fost deblocat cu succes",unlockSuccessDescription:"Acum poți folosi completarea automată pentru câmpurile cu date de autentificare în browserul tău.",closePopup:"Închide această fereastră",browseVault:"Răsfoiește conținutul seifului",connectingTo:"Conectare la",switchAccounts:"Schimbați contul?",loginWithMobile:"Autentificare prin aplicația mobilă",unlockWithMobile:"Deblochează prin aplicația mobilă",scanQrCode:"Scanează acest cod QR cu aplicația mobilă AliasVault pentru a te autentifica și debloca seiful.",errors:{invalidCode:"Introdu un cod de autentificare valid din 6 cifre.",serverError:"Conexiunea la serverul AliasVault a eșuat. Încearcă mai târziu sau contactează asistența dacă problema persistă.",wrongPassword:"Parolă incorectă. Încearcă din nou.",sessionExpired:"Sesiunea a expirat. Autentifică-te din nou.",mobileLoginRequestExpired:"Cererea de autentificare mobilă a expirat. Reîncarcă pagina și încearcă din nou."}},OS={vault:"Seif",emails:"E-mailuri"},jS={loading:"Se încarcă...",notice:"Notificare",error:"Eroare",cancel:"Anulați",confirm:"Confirmă",back:"Înapoi",next:"Înainte",use:"Folosește",add:"Adaugă",delete:"Șterge",undo:"Reveniți",save:"Salvează",saving:"Se salvează...",create:"Creează",or:"Sau",close:"Închide",logout:"Deconectare",copied:"Copiat!",openInNewWindow:"Deschide în fereastră nouă",enabled:"Activat",disabled:"Dezactivat",showPassword:"Afișează parola",hidePassword:"Ascunde parola",showDetails:"Afișează detalii",hideDetails:"Ascunde detalii",copyToClipboard:"Copiază în clipboard",loadingEmails:"Se încarcă e-mailurile...",loadingTotpCodes:"Se încarcă codurile TOTP...",attachments:"Atașamente",loadingAttachments:"Se încarcă atașamentele...",settings:"Setări",recentEmails:"E-mailuri recente",credentials:"Date de autentificare",customFields:"Câmpuri personalizate",twoFactorAuthentication:"Autentificare cu doi factori",alias:"Alias",notes:"Note",email:"E-mail",username:"Utilizator",password:"Parolă",generate:"Generează",serviceName:"Nume Serviciu",loggedIn:"Autentificat",syncingVault:"Se sincronizează seiful",checkingVaultUpdates:"Se verifică actualizările seifului",syncingUpdatedVault:"Se sincronizează seiful actualizat",loadMore:"Încarcă mai multe",offline:"Deconectat",offlineMode:"Funcționează în modul offline",pendingSync:"Se sincronizează...",mergingVaultChanges:"Se îmbină modificările seifului...",uploadingVault:"Se încarcă seiful...",errors:{serverNotAvailable:"Serverul AliasVault nu este disponibil. Încearcă mai târziu sau contactează asistența.",clientVersionNotSupported:"Această versiune a extensiei AliasVault nu mai este compatibilă cu serverul. Actualizează extensia la cea mai recentă versiune.",browserExtensionOutdated:"Versiune extensie incompatibilă. Pentru a accesa seiful, actualizează extensia AliasVault la ultima versiune disponibilă.",serverVersionNotSupported:"Serverul AliasVault trebuie actualizat la o versiune mai nouă pentru a folosi această extensie. Contactează asistența pentru ajutor.",serverVersionTooOld:"Serverul AliasVault trebuie actualizat la o versiune mai nouă pentru a folosi această funcție. Contactează administratorul serverului.",unknownError:"A apărut o eroare necunoscută",unknownErrorTryAgain:"A apărut o eroare necunoscută. Încearcă din nou.",vaultNotAvailable:"Seiful nu este disponibil",vaultIsLocked:"Seiful este blocat",passwordChanged:"Parola ta a fost schimbată de la ultima autentificare. Autentifică-te din nou din motive de securitate.",syncConflictMaxRetries:"Sincronizarea seifului a eșuat după mai multe încercări. Reîncearcă mai târziu.",mergeFailed:"Îmbinarea modificărilor seifului a eșuat. Încearcă din nou."},apiErrors:{UNKNOWN_ERROR:"A apărut o eroare necunoscută. Încearcă din nou.",ACCOUNT_LOCKED:"Cont blocat temporar din cauza prea multor încercări eșuate. Reîncearcă mai târziu.",ACCOUNT_BLOCKED:"Contul tău a fost dezactivat. Dacă crezi că este o greșeală, contactează asistența.",USER_NOT_FOUND:"Utilizator sau parolă invalidă. Încearcă din nou.",INVALID_AUTHENTICATOR_CODE:"Cod de autentificare invalid. Încearcă din nou.",INVALID_RECOVERY_CODE:"Cod de recuperare invalid. Încearcă din nou.",REFRESH_TOKEN_REQUIRED:"Este necesar un token de actualizare.",INVALID_REFRESH_TOKEN:"Token de actualizare nevalid.",PUBLIC_REGISTRATION_DISABLED:"Înregistrarea conturilor noi este dezactivată pe acest server. Contactează administratorul.",USERNAME_REQUIRED:"Numele de utilizator este obligatoriu.",USERNAME_ALREADY_IN_USE:"Numele de utilizator este deja folosit.",USERNAME_AVAILABLE:"Numele de utilizator este disponibil.",USERNAME_MISMATCH:"Numele de utilizator nu se potrivește cu utilizatorul curent.",PASSWORD_MISMATCH:"Parola furnizată nu se potrivește cu parola ta curentă.",ACCOUNT_SUCCESSFULLY_DELETED:"Cont șters cu succes.",USERNAME_EMPTY_OR_WHITESPACE:"Numele de utilizator nu poate fi gol sau format doar din spații goale.",USERNAME_TOO_SHORT:"Nume prea scurt: trebuie să aibă cel puțin 3 caractere.",USERNAME_TOO_LONG:"Nume prea lung: nu poate depăși 40 de caractere.",USERNAME_INVALID_EMAIL:"Adresă de e-mail invalidă.",USERNAME_INVALID_CHARACTERS:"Numele de utilizator este invalid, poate conține doar litere sau cifre.",VAULT_NOT_UP_TO_DATE:"Seiful nu este la zi. Sincronizează seiful și încearcă din nou.",INTERNAL_SERVER_ERROR:"Eroare internă de server.",VAULT_ERROR:"Seiful local nu este la zi. Sincronizează seiful reîncărcând pagina."}},PS={or:"sau",new:"Nou",vaultLocked:"AliasVault este blocat.",creatingNewAlias:"Se creează un alias nou...",noMatchesFound:"Nicio potrivire găsită",searchVault:"Caută în seif...",enterServiceName:"Introdu numele serviciului",enterEmailAddress:"Introdu adresa de e-mail",enterUsername:"Introdu numele de utilizator",hideFor1Hour:"Ascunde pentru 1 oră (site-ul curent)",hidePermanently:"Ascunde definitiv (site-ul curent)",createRandomAlias:"Creează un alias aleatoriu",createUsernamePassword:"Creează utilizator/parolă",randomAlias:"Alias aleatoriu",usernamePassword:"Utilizator/parolă",createAndSaveAlias:"Creează și salvează alias",createAndSaveCredential:"Creează și salvează datele de autentificare",randomIdentityDescription:"Generează o identitate aleatorie cu o adresă de e-mail aleatorie accesibilă în AliasVault.",randomIdentityDescriptionDropdown:"Identitate aleatorie cu e-mail aleatoriu",manualCredentialDescription:"Specifică propria adresă de e-mail și numele de utilizator.",manualCredentialDescriptionDropdown:"Nume de utilizator și parolă introduse manual",failedToCreateIdentity:"Eșec la crearea identității. Încearcă din nou.",enterEmailAndOrUsername:"Introdu adresa de e-mail și/sau numele de utilizator",autofillWithAliasVault:"Completare automată cu AliasVault",generateRandomPassword:"Generează parolă aleatorie (copiază în clipboard)",generateNewPassword:"Generează parolă nouă",togglePasswordVisibility:"Comută vizibilitatea parolei",passwordCopiedToClipboard:"Parolă copiată în clipboard",openAliasVaultToUpgrade:"Deschide AliasVault pentru actualizare",vaultUpgradeRequired:"Este necesară actualizarea seifului.",dismissPopup:"Închide fereastra"},HS={title:"Elemente",itemName:"Nume",loginCredentials:"Date de autentificare",cardInformation:"Informații Card",addItem:"Adaugă element",addNewItem:"Adaugă element nou",saveItem:"Salvează element",itemDetails:"Detalii element",editItem:"Editează element",untitled:"Fără titlu",newFolder:"Dosar nou",createFolder:"Creează dosar",editFolder:"Editează dosarul",folderName:"Nume dosar",folderNameRequired:"Numele dosarului este obligatoriu",folder:"Dosar",welcomeTitle:"Bun venit în AliasVault!",welcomeDescription:"Pentru a utiliza extensia de browser AliasVault: accesează un site web și folosește fereastra pop-up de completare automată AliasVault pentru a crea noi date de autentificare.",noPasskeysFound:"Nu a fost creat niciun passkey încă. Passkey-urile sunt create vizitând site-uri care oferă această metodă de autentificare.",noAttachmentsFound:"Nu s-au găsit elemente cu atașamente",noItemsOfTypeFound:"Nu s-au găsit elemente de tip {{type}}",noMatchingItems:"Nu s-au găsit elemente care să se potrivească",noMatchingItemsSearch:"Nu s-au găsit elemente pentru „{{search}}”",noMatchingItemsWithFilter:"Niciun element {{filter}} nu se potrivește cu „{{search}}”",clearSearch:"Șterge căutarea",clearFilter:"Șterge filtrul",emptyFolderHint:"Acest dosar este gol. Pentru a muta elemente aici, editează elementul și apasă pe pictograma folderului din câmpul de nume.",allItemsInFolders:"Toate elementele tale sunt organizate în dosare. Apasă pe un dosar de mai sus pentru a vizualiza datele de autentificare sau folosește căutarea pentru a găsi elemente specifice.",deleteFolder:"Șterge dosarul",deleteFolderKeepItems:"Șterge doar dosarul",deleteFolderKeepItemsDescription:"Elementele vor fi mutate înapoi în lista principală.",deleteFolderAndItems:"Șterge dosarul și toate elementele",deleteFolderAndItemsDescription:"{{count}} element(e) vor fi mutate la Șterse Recent.",filters:{all:"(Toate) Elementele",passkeys:"Passkeys"},deleteItemTitle:"Șterge element",deleteItemConfirm:"Sigur vrei să ștergi acest element?",viewHistory:"Vezi istoric",history:"Istoric",noHistoryAvailable:"Niciun istoric disponibil",tags:"Etichete",changePasswordComplexity:"Schimbă complexitatea parolei",passwordLength:"Lungime parolă",includeLowercase:"Include litere mici",includeUppercase:"Include litere mari",includeNumbers:"Include cifre",includeSpecialChars:"Include caractere speciale",avoidAmbiguousChars:"Evită caracterele ambigue (o, 0, etc.)",privateEmailTitle:"E-mail Privat",privateEmailAliasVaultServer:"Server AliasVault",privateEmailDescription:"Criptat E2E, complet privat.",publicEmailTitle:"Furnizori Publici de E-mail Temporar",publicEmailDescription:"Anonim, dar cu confidențialitate limitată. Conținutul poate fi citit de oricine cunoaște adresa.",validation:{required:"Acest câmp este obligatoriu"}},QS={selectType:"Adaugă element nou",typeLabel:"Tip element",creating:"Creare",editing:"Editare",regenerateAlias:"Regenerează alias",addCustomField:"Adaugă câmp personalizat",fieldLabel:"Etichetă câmp",enterFieldName:"Introdu numele câmpului",fieldType:"Tip câmp",fieldTypes:{text:"Text",hidden:"Ascuns (text mascat)",email:"E-mail",url:"URL",phone:"Telefon",number:"Număr",date:"Dată",textArea:"Zonă text"},login:{title:"Autentificare"},alias:{title:"Alias"},creditCard:{title:"Card de credit"},note:{title:"Notă securizată"}},zS={"login.url":"URL Website","login.username":"Utilizator","login.password":"Parolă","alias.first_name":"Prenume","alias.last_name":"Nume","alias.gender":"Gen","alias.birthdate":"Data nașterii","login.email":"E-mail","notes.content":"Note","card.cardholder_name":"Nume Titular","card.number":"Număr card","card.expiry_month":"Lună expirare","card.expiry_year":"An expirare","card.cvv":"CVV","card.pin":"PIN"},VS={addCode:"Adaugă cod 2FA",instructions:"Introdu cheia secretă afișată de site-ul unde dorești să activezi autentificarea cu doi factori.",nameOptional:"Nume (opțional)",secretKey:"Cheie Secretă",saveToViewCode:"Salvează pentru a vedea codul",defaultName:"Authenticator",errors:{invalidSecretKey:"Format cheie secretă invalid."}},KS={uploading:"Se încarcă...",uploadSuccess:"Fișiere încărcate cu succes.",deleteSuccess:"Atașament șters cu succes.",firefoxExpandRequired:"Pentru a încărca fișiere, folosește fereastra extinsă.",openExpandedWindow:"Deschide fereastra extinsă"},GS={title:"E-mailuri",deleteEmailTitle:"Șterge e-mail",deleteEmailConfirm:"Sigur vrei să ștergi definitiv acest e-mail?",from:"De la",to:"Către",date:"Data",emailContent:"Conținut e-mail",emailNotFound:"E-mailul nu a fost găsit",noEmails:"Nu s-au găsit e-mailuri",noEmailsDescription:"Nu ai primit încă niciun e-mail pe adresele tale private. Atunci când vei primi un e-mail nou, acesta va apărea aici.",offlineMessage:"Sunteți offline. Conectează-te la internet pentru a încărca e-mailurile.",dateFormat:{justNow:"acum",minutesAgo_single:"{{count}} minut în urmă",minutesAgo_plural:"{{count}} minute în urmă",hoursAgo_single:"{{count}} oră în urmă",hoursAgo_plural:"{{count}} ore în urmă",yesterday:"ieri"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Adresa de e-mail aleasă este deja utilizată. Schimbă adresa de e-mail prin editarea acestor date de autentificare.",CLAIM_DOES_NOT_EXIST:"A apărut o eroare la încărcarea e-mailurilor. Editează și salvează datele de autentificare pentru a sincroniza baza de date, apoi încearcă din nou."}},qS={serverUrl:"URL Server",language:"Limbă",autofillEnabled:"Activează completarea automată",version:"Versiune",openWebApp:"Deschide aplicația web",lock:"Blocați",globalSettings:"Setări Globale",autofillPopup:"Fereastra de completare automată",activeOnAllSites:"Activă pe toate site-urile (cu excepțiile de mai jos)",disabledOnAllSites:"Dezactivat pe toate site-urile",rightClickContextMenu:"Meniu contextual (clic dreapta)",autofillMatching:"Potrivire completare automată",autofillMatchingMode:"Mod de potrivire a completării automate",autofillMatchingModeDescription:"Determină care date de autentificare sunt considerate potrivite și afișate ca sugestii în fereastra de completare automată pentru un anumit site web.",autofillMatchingDefault:"URL + subdomeniu + nume (wildcard)",autofillMatchingUrlSubdomain:"URL + subdomeniu",autofillMatchingUrlExact:"Doar domeniul exact al URL-ului",siteSpecificSettings:"Setări specifice site-ului",autofillPopupOn:"Fereastra de completare automată pe: ",enabledForThisSite:"Activat pentru acest site",disabledForThisSite:"Dezactivat pentru acest site",temporarilyDisabledUntil:"Dezactivat temporar până la ",resetAllSiteSettings:"Resetează toate setările specifice site-ului",appearance:"Aspect",theme:"Temă",useDefault:"Implicită",light:"Luminoasă",dark:"Întunecată",keyboardShortcuts:"Comenzi rapide de tastatură",configureKeyboardShortcuts:"Configurează comenzile rapide de tastatură",configure:"Configurează",clipboardClearTimeout:"Golește clipboardul după copiere",clipboardClearTimeoutDescription:"Golește automat clipboardul după copierea datelor sensibile",clipboardClearDisabled:"Niciodată",clipboardClear5Seconds:"După 5 secunde",clipboardClear10Seconds:"După 10 secunde",clipboardClear15Seconds:"După 15 secunde",autoLockTimeout:"Interval auto-blocare",autoLockTimeoutDescription:"Blocați automat seiful după o perioadă de inactivitate",autoLockTimeoutHelp:"Seiful se va bloca doar după perioada de inactivitate specificată (fără completare automată sau deschiderea extensiei). Seiful se va bloca întotdeauna la închiderea browserului.",autoLockNever:"Niciodată",autoLock15Seconds:"15 secunde",autoLock1Minute:"1 minut",autoLock5Minutes:"5 minute",autoLock15Minutes:"15 minute",autoLock30Minutes:"30 minute",autoLock1Hour:"1 oră",autoLock4Hours:"4 ore",autoLock8Hours:"8 ore",autoLock24Hours:"24 ore",versionPrefix:"Versiune ",autofillSettings:"Setări completare automată",clipboardSettings:"Setări clipboard",contextMenuSettings:"Setări meniu contextual",passkeySettings:"Setări passkey",contextMenu:"Meniu Contextual",contextMenuEnabled:"Meniul contextual este activat",contextMenuDisabled:"Meniul contextual este dezactivat",contextMenuDescription:"Clic dreapta pe câmpurile de introducere pentru a accesa opțiunile AliasVault",selectLanguage:"Selectați limba",serverConfiguration:"Configurare Server",serverConfigurationDescription:"Configurează URL-ul serverului AliasVault pentru instanțele self-hosted",customApiUrl:"URL API",customClientUrl:"URL Client",apiUrlHint:"URL-ul endpoint-ului API (de obicei URL client + /api)",clientUrlHint:"URL-ul interfeței web a instanței tale",autofillSettingsDescription:"Activează sau dezactivează fereastra de completare automată",autofillEnabledDescription:"Sugestiile de completare automată vor apărea în câmpurile de autentificare",autofillDisabledDescription:"Sugestiile sunt dezactivate global",languageSettings:"Limbă",validation:{apiUrlRequired:"URL-ul API este obligatoriu",apiUrlInvalid:"Introdu un URL API valid",clientUrlRequired:"URL-ul Client este obligatoriu",clientUrlInvalid:"Introdu un URL Client valid"},unlockMethod:{title:"Metodă deblocare seif",introText:"Alege cum dorești să îți deblochezi seiful. Poți folosi parola principală (întotdeauna disponibilă) sau poți configura un cod PIN pentru acces rapid. După 3 încercări eșuate ale PIN-ului, va trebui să folosești parola principală.",password:"Parolă principală",pin:"Cod PIN",pinDescription:"Deblochează seiful cu codul PIN",setupPin:"Configurează Cod PIN",enterNewPinDescription:"Introdu un cod PIN de cel puțin 6 cifre",confirmPin:"Confirmă PIN",confirmPinDescription:"Introdu PIN-ul din nou pentru confirmare",invalidPinFormat:"Format PIN invalid",pinMismatch:"PIN-urile nu se potrivesc",incorrectPin:"PIN incorect. {{attemptsRemaining}} încercări rămase.",incorrectPinSingular:"PIN incorect. 1 încercare rămasă.",enableSuccess:"Deblocarea prin PIN a fost activată!",pinLocked:"Deblocarea prin PIN a fost dezactivată. Folosește parola principală.",pinSecurityWarning:"Deblocarea prin PIN în extensia de browser poate fi mai puțin sigură decât parola principală. PIN-urile au o entropie mai scăzută, fiind vulnerabile la atacuri de tip brute-force dacă dispozitivul este compromis. Folosește-o doar pe dispozitive în care ai încredere deplină."}},WS={passkey:"Passkey",site:"Site",helpText:"Passkey-urile sunt create pe site-uri când este solicitat. Nu pot fi editate manual. Pentru a înlocui un passkey, vizitează site-ul respectiv.",passkeyMarkedForDeletion:"Passkey marcat pentru ștergere",passkeyWillBeDeleted:"Acest passkey va fi șters atunci când salvezi aceste date de autentificare.",useBrowserPasskey:"Folosește Passkey-ul Browserului",bypass:{description:"Cât timp dorești să folosești furnizorul de passkey al browserului pentru {{origin}}?",thisTimeOnly:"Doar de data aceasta",alwaysForSite:"Întotdeauna pentru acest site"},authenticate:{title:"Autentificare cu Passkey",signInFor:"Autentificare cu passkey pentru",selectPasskey:"Selectați un passkey pentru autentificare:",noPasskeysFound:"Nu s-au găsit passkey-uri pentru acest site"},create:{title:"Creează Passkey",createFor:"Creează un passkey nou pentru",titleLabel:"Titlu",titlePlaceholder:"Introdu un nume pentru acest passkey",createButton:"Creează Passkey",selectPasskeyToReplace:"Selectați un passkey pentru a-l înlocui:",createNewPasskey:"Creează Passkey Nou",replacingPasskey:"Se înlocuiește passkey-ul: {{displayName}}",confirmReplace:"Confirmă Înlocuirea",selectExistingLogin:"Adaugă la o autentificare existentă:",selectExistingLoginDescription:"Atașează acest passkey unor date de autentificare existente pentru acest site.",attachingToCredential:"Se adaugă passkey-ul la: {{serviceName}}",attachPasskey:"Adaugă Passkey"},settings:{passkeyProvider:"Furnizor Passkey",passkeyProviderOn:"Furnizor Passkey pe "}},YS={title:"Șterse Recent",noItems:"Niciun element șters",noItemsDescription:"Elementele șterse vor apărea aici timp de 30 de zile înainte de a fi eliminate definitiv.",description:"Aceste elemente vor fi șterse definitiv după 30 de zile. Le poți restaura sau șterge imediat.",restore:"Restaurează",deletePermanently:"Șterge Definitiv",emptyAll:"Golește tot",daysRemaining_one:"{{count}} zi rămasă",daysRemaining_other:"{{count}} zile rămase",expiringSoon:"Expiră curând",confirmDeleteTitle:"Ștergi Definitiv?",confirmDeleteMessage:"Acest element va fi șters definitiv și nu va putea fi recuperat.",confirmEmptyAllTitle:"Golești elementele șterse recent?",confirmEmptyAllMessage:"Toate cele {{count}} elemente vor fi șterse definitiv și nu vor putea fi recuperate."},JS={title:"Actualizare Seif",subtitle:"AliasVault s-a actualizat și seiful tău trebuie actualizat. Aceasta va dura doar câteva secunde.",versionInformation:"Informații Versiune",yourVault:"Versiunea seifului tău:",newVersion:"Versiune nouă disponibilă:",upgrade:"Actualizează Seiful",upgrading:"Se actualizează...",whatsNew:"Ce este nou",whatsNewDescription:"Este necesară o actualizare pentru a permite următoarele modificări:",noDescriptionAvailable:"Nicio descriere disponibilă pentru această versiune.",alerts:{unableToGetVersionInfo:"Informațiile despre versiune nu au putut fi obținute. Reîncearcă.",selfHostedServer:"Server Self-Hosted",selfHostedWarning:"Dacă folosești un server self-hosted, asigură-te că actualizezi și instanța serverului, altfel autentificarea în clientul web nu va mai funcționa.",continueUpgrade:"Continuă Actualizarea",upgradeFailed:"Actualizare Eșuată",failedToApplyMigration:"Eșec la aplicarea migrării ({{current}} din {{total}})"}},XS={unsyncedChangesTitle:"Modificări Nesincronizate",unsyncedChangesWarning:"Ai modificări nesincronizate care se vor pierde dacă te deconectezi acum. Sigur vrei să continui?",logoutAnyway:"Deconectează-te oricum"},$S={auth:FS,menu:OS,common:jS,content:PS,items:HS,itemTypes:QS,fieldLabels:zS,totp:VS,attachmentUploader:KS,emails:GS,settings:qS,passkeys:WS,recentlyDeleted:YS,upgrade:JS,logout:XS},ZS={loginTitle:"Войдите в AliasVault",username:"Имя пользователя или почта",usernamePlaceholder:"имя / имя@company.com",passwordPlaceholder:"Введите ваш пароль",rememberMe:"Запомнить меня",loginButton:"Войти",noAccount:"Нет аккаунта?",createVault:"Создать новое хранилище",twoFactorTitle:"Пожалуйста, введите код аутентификации из вашего приложения-аутентификатора.",authCode:"Код аутентификации",authCodePlaceholder:"Введите 6-значный код",verify:"Проверить",twoFactorNote:"Примечание: если у вас нет доступа к устройству аутентификации, вы можете сбросить ваш 2FA с помощью кода восстановления, войдя в систему через сайт.",masterPassword:"Мастер пароль",unlockVault:"Разблокировать",unlockWithPin:"Разблокировать ПИН-кодом\uFEFF",enterPinToUnlock:"Введите ПИН-код для разблокировки хранилища",useMasterPassword:"Использовать мастер-пароль",unlockTitle:"Разблокировать ваше хранилище",logoutConfirm:"Вы уверены, что хотите выйти?",unlockSuccessTitle:"Ваше хранилище успешно разблокировано",unlockSuccessDescription:"Теперь вы можете использовать автозаполнение форм входа в Вашем браузере.",closePopup:"Закрыть окно",browseVault:"Обзор содержимого хранилища",connectingTo:"Подключение к",switchAccounts:"Переключить аккаунт?",loginWithMobile:"Войти с помощью мобильного приложения",unlockWithMobile:"Разблокировать через мобильное приложение",scanQrCode:"Сканируйте QR-код в приложении AliasVault, чтобы войти.",errors:{invalidCode:"Пожалуйста, введите правильный 6-значный код аутентификации.",serverError:"Не удалось подключиться к серверу AliasVault. Пожалуйста, повторите попытку позже или обратитесь в службу поддержки, если проблема не устранится.",wrongPassword:"Неверный пароль. Пожалуйста, повторите попытку.",sessionExpired:"Время сеанса истекло. Пожалуйста, войдите снова.",mobileLoginRequestExpired:"Истекло время ожидания входа. Перезагрузите страницу и повторите попытку."}},e1={vault:"Хранилище",emails:"Почта"},t1={loading:"Загрузка...",notice:"Примечание",error:"Ошибка",cancel:"Отмена",confirm:"Подтвердить",back:"Назад",next:"Далее",use:"Использовать",add:"Добавить",delete:"Удалить",undo:"Отменить",save:"Сохранить",saving:"Saving...",create:"Создать",or:"Или",close:"Закрыть",logout:"Выйти",copied:"Скопировано!",openInNewWindow:"Открыть в новом окне",enabled:"Включено",disabled:"Отключено",showPassword:"Показать пароль",hidePassword:"Скрыть пароль",showDetails:"Показать подробности",hideDetails:"Скрыть подробности",copyToClipboard:"Скопировать в буфер обмена",loadingEmails:"Загрузка писем...",loadingTotpCodes:"Загрузка TOTP кодов...",attachments:"Вложения",loadingAttachments:"Загрузка вложений...",settings:"Настройки",recentEmails:"Последние письма",credentials:"Учетные записи",customFields:"Пользовательские поля",twoFactorAuthentication:"Двухфакторная аутентификация",alias:"Псевдоним",notes:"Заметки",email:"Электронная почта",username:"Имя пользователя",password:"Пароль",generate:"Generate",serviceName:"Название сервиса",loggedIn:"Вход выполнен",syncingVault:"Синхронизация хранилища",checkingVaultUpdates:"Проверка наличия обновлений в хранилище",syncingUpdatedVault:"Синхронизация обновленного хранилища",loadMore:"Загрузить ещё",offline:"Офлайн",offlineMode:"Operating in offline mode",pendingSync:"Синхронизация...",mergingVaultChanges:"Объединение изменений в хранилище...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"Сервер AliasVault недоступен. Пожалуйста, повторите попытку позже или обратитесь в службу поддержки, если проблема не устранится.",clientVersionNotSupported:"Эта версия браузерного расширения AliasVault больше не поддерживается сервером. Пожалуйста, обновите расширение вашего браузера до последней версии.",browserExtensionOutdated:"Это расширение браузера устарело и не может быть использовано для доступа к этому хранилищу. Пожалуйста, обновите расширение, чтобы продолжить.",serverVersionNotSupported:"Чтобы использовать это расширение для браузера, сервер AliasVault необходимо обновить до более новой версии. Пожалуйста, обратитесь в службу поддержки, если вам нужна помощь.",serverVersionTooOld:"Сервер AliasVault необходимо обновить до более новой версии, чтобы использовать эту функцию. Если вам нужна помощь, обратитесь к администратору сервера.",unknownError:"Произошла неизвестная ошибка",unknownErrorTryAgain:"Произошла неизвестная ошибка. Попробуйте снова.",vaultNotAvailable:"Хранилище недоступно",vaultIsLocked:"Хранилище заблокировано",passwordChanged:"С момента вашего последнего входа ваш пароль изменился. Пожалуйста, войдите еще раз в целях безопасности.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Произошла неизвестная ошибка. Пожалуйста, попробуйте снова.",ACCOUNT_LOCKED:"Учетная запись временно заблокирована из-за слишком большого количества неудачных попыток. Пожалуйста, повторите попытку позже.",ACCOUNT_BLOCKED:"Ваша учетная запись была заблокирована. Если вы считаете, что это ошибка, пожалуйста, свяжитесь со службой поддержки.",USER_NOT_FOUND:"Неверное имя пользователя или пароль. Пожалуйста, попробуйте снова.",INVALID_AUTHENTICATOR_CODE:"Неверный код аутентификатора. Пожалуйста, попробуйте снова.",INVALID_RECOVERY_CODE:"Неверный код восстановления. Пожалуйста, попробуйте снова.",REFRESH_TOKEN_REQUIRED:"Требуется токен обновления.",INVALID_REFRESH_TOKEN:"Недопустимый токен обновления.",PUBLIC_REGISTRATION_DISABLED:"В настоящее время регистрация новой учетной записи на этом сервере отключена. Пожалуйста, свяжитесь с администратором.",USERNAME_REQUIRED:"Требуется ввести имя пользователя.",USERNAME_ALREADY_IN_USE:"Имя пользователя уже используется.",USERNAME_AVAILABLE:"Имя пользователя доступно.",USERNAME_MISMATCH:"Имя пользователя не соответствует текущему пользователю.",PASSWORD_MISMATCH:"Указанный пароль не совпадает с вашим текущим паролем.",ACCOUNT_SUCCESSFULLY_DELETED:"Аккаунт успешно удалена.",USERNAME_EMPTY_OR_WHITESPACE:"Имя пользователя не может быть пустым или через пробел.",USERNAME_TOO_SHORT:"Слишком короткое имя пользователя: должно быть не менее 3-х символов.",USERNAME_TOO_LONG:"Слишком длинное имя пользователя: оно не может быть длиннее 40 символов.",USERNAME_INVALID_EMAIL:"Неверный адрес электронной почты.",USERNAME_INVALID_CHARACTERS:"Имя пользователя неверно, может содержать только буквы или цифры.",VAULT_NOT_UP_TO_DATE:"Ваше хранилище не обновлено. Пожалуйста, синхронизируйте ваше хранилище и повторите попытку.",INTERNAL_SERVER_ERROR:"Внутренняя ошибка сервера.",VAULT_ERROR:"Локальное хранилище не обновлено. Пожалуйста, синхронизируйте ваше хранилище, обновив страницу, и повторите попытку."}},a1={or:"или",new:"Новый",vaultLocked:"AliasVault заблокирован.",creatingNewAlias:"Создание нового псевдонима...",noMatchesFound:"Совпадений не найдено",searchVault:"Поиск хранилища...",enterServiceName:"Введите имя сервиса",enterEmailAddress:"Введите адрес электронной почты",enterUsername:"Введите имя пользователя",hideFor1Hour:"Скрыть на 1 час (текущий сайт)",hidePermanently:"Скрыть навсегда (текущий сайт)",createRandomAlias:"Создать случайный псевдоним",createUsernamePassword:"Создайте имя пользователя/пароль",randomAlias:"Случайный псевдоним",usernamePassword:"Имя пользователя/пароль",createAndSaveAlias:"Создать и сохранить псевдоним",createAndSaveCredential:"Создать и сохранить учетные данные",randomIdentityDescription:"Сгенерировать случайную личность со случайным адресом электронной почты, доступным в AliasVault.",randomIdentityDescriptionDropdown:"Случайная личность со случайным адресом электронной почты",manualCredentialDescription:"Укажите свой собственный адрес электронной почты и имя пользователя.",manualCredentialDescriptionDropdown:"Ручной ввод имени пользователя и пароля",failedToCreateIdentity:"Не удалось создать личность. Пожалуйста, попробуйте снова.",enterEmailAndOrUsername:"Введите адрес электронной почты и/или имя пользователя",autofillWithAliasVault:"Автозаполнение с помощью AliasVault",generateRandomPassword:"Сгенерировать случайный пароль (скопировать в буфер обмена)",generateNewPassword:"Сгенерировать новый пароль",togglePasswordVisibility:"Переключение видимости пароля",passwordCopiedToClipboard:"Пароль скопирован в буфер обмена",openAliasVaultToUpgrade:"Откройте AliasVault для обновления",vaultUpgradeRequired:"Требуется обновление хранилища.",dismissPopup:"Закрыть окно"},n1={title:"Записи",itemName:"Имя",loginCredentials:"Учетные данные для авторизации",cardInformation:"Данные карты",addItem:"Добавить запись",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Детали записи",editItem:"Редактировать запись",untitled:"Без названия",newFolder:"Новая папка",createFolder:"Создать папку",editFolder:"Изменить папку",folderName:"Название папки",folderNameRequired:"Название папки обязательно",folder:"Папка",welcomeTitle:"Добро пожаловать в AliasVault!",welcomeDescription:"Чтобы использовать браузерное расширение AliasVault: перейдите на сайт и используйте всплывающее окно автозаполнения AliasVault для создания новых учетных данных.",noPasskeysFound:"Ключи доступа еще не созданы. Ключи доступа создаются при посещении веб-сайта, который предлагает их в качестве метода аутентификации.",noAttachmentsFound:"Элементы с вложениями не найдены",noItemsOfTypeFound:"Элементы типа «{{type}}» не найдены",noMatchingItems:"Совпадений не найдено",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Удалить папку",deleteFolderKeepItems:"Удалить только папку",deleteFolderKeepItemsDescription:"Элементы будут перемещены обратно в основной список.",deleteFolderAndItems:"Удалить папку и все элементы",deleteFolderAndItemsDescription:"{{count}} объект(ов) будет перемещено в раздел «Недавно удалённые».",filters:{all:"(Все) Записи",passkeys:"Ключи доступа"},deleteItemTitle:"Удалить элемент",deleteItemConfirm:"Вы уверены, что хотите удалить этот элемент?",viewHistory:"Посмотреть историю",history:"История",noHistoryAvailable:"История пока пуста",tags:"Теги",changePasswordComplexity:"Изменить сложность пароля",passwordLength:"Длина пароля",includeLowercase:"Включить строчные буквы",includeUppercase:"Включить заглавные буквы",includeNumbers:"Включить числа",includeSpecialChars:"Включить специальные символы",avoidAmbiguousChars:"Избегать двусмысленных символов (o, 0 и т.д.)",privateEmailTitle:"Личная электронная почта",privateEmailAliasVaultServer:"Сервер AliasVault",privateEmailDescription:"Шифрование E2E, полностью приватный.",publicEmailTitle:"Общедоступные временные поставщики электронной почты",publicEmailDescription:"Анонимность, но ограниченная конфиденциальность. Содержимое письма может прочитать любой, кому известен адрес.",validation:{required:"Это поле является обязательным"}},r1={selectType:"Add New Item",typeLabel:"Item Type",creating:"Создание",editing:"Редактирование",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Название поля",enterFieldName:"Введите название поля",fieldType:"Тип поля",fieldTypes:{text:"Текст",hidden:"Hidden (masked text)",email:"Почта",url:"URL",phone:"Телефон",number:"Номер",date:"Дата",textArea:"Текстовая область"},login:{title:"Логин"},alias:{title:"Псевдоним"},creditCard:{title:"Банковская карта"},note:{title:"Secure Note"}},i1={"login.url":"URL веб-сайта","login.username":"Логин","login.password":"Пароль","alias.first_name":"Имя","alias.last_name":"Фамилия","alias.gender":"Пол","alias.birthdate":"Дата рождения","login.email":"Почта","notes.content":"Примечание","card.cardholder_name":"Имя держателя карты","card.number":"Номер карты","card.expiry_month":"Месяц окончания","card.expiry_year":"Год окончания","card.cvv":"CVV-код","card.pin":"PIN"},s1={addCode:"Добавить код 2FA",instructions:"Введите секретный ключ, указанный на веб-сайте, где вы хотите добавить двухфакторную аутентификацию.",nameOptional:"Имя (необязательно)",secretKey:"Секретный ключ",saveToViewCode:"Сохранить для просмотра кода",defaultName:"Authenticator",errors:{invalidSecretKey:"Неверный формат секретного ключа."}},o1={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},l1={title:"Письма",deleteEmailTitle:"Удалить письмо",deleteEmailConfirm:"Вы уверены, что хотите навсегда удалить это письмо?",from:"От",to:"К",date:"Дата",emailContent:"Содержимое письма",emailNotFound:"Адрес электронной почты не найден",noEmails:"Электронные письма не найдены",noEmailsDescription:"Вы еще не получали никаких электронных писем на свои личные адреса электронной почты. Когда вы получите новое электронное письмо, оно появится здесь.",offlineMessage:"Вы не в сети. Пожалуйста, подключитесь к Интернету, чтобы загрузить свои электронные письма.",dateFormat:{justNow:"прямо сейчас",minutesAgo_single:"{{count}} мин назад",minutesAgo_plural:"{{count}} минут назад",hoursAgo_single:"{{count}} часов назад",hoursAgo_plural:"{{count}} часов назад",yesterday:"вчера"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Текущий выбранный адрес электронной почты уже используется. Пожалуйста, измените адрес электронной почты, отредактировав эти учетные данные.",CLAIM_DOES_NOT_EXIST:"При попытке загрузить письма произошла ошибка. Пожалуйста, попробуйте отредактировать и сохранить данные для синхронизации базы данных, затем повторите попытку."}},c1={serverUrl:"URL-адрес сервера",language:"Язык",autofillEnabled:"Включить автозаполнение",version:"Версия",openWebApp:"Открыть веб-приложение",lock:"Заблокировать",globalSettings:"Глобальные настройки",autofillPopup:"Всплывающее окно автозаполнения",activeOnAllSites:"Активен на всех сайтах (если не отключен ниже)",disabledOnAllSites:"Отключено на всех сайтах",rightClickContextMenu:"Контекстное меню правым щелчком мыши",autofillMatching:"Соответствие автозаполнения",autofillMatchingMode:"Режим сопоставления автозаполнения",autofillMatchingModeDescription:"Определяет, какие учетные данные считаются соответствующими и отображаются в качестве предложений во всплывающем окне автозаполнения для данного веб-сайта.",autofillMatchingDefault:"URL + поддомен + подстановочный знак в названии",autofillMatchingUrlSubdomain:"URL + поддомен",autofillMatchingUrlExact:"Только точный URL-адрес домена",siteSpecificSettings:"Настройки для конкретного сайта",autofillPopupOn:"Всплывающее окно автозаполнения: ",enabledForThisSite:"Включено для этого сайта",disabledForThisSite:"Отключено для этого сайта",temporarilyDisabledUntil:"Временно отключен до тех пор, пока",resetAllSiteSettings:"Сбросить все настройки для сайтов",appearance:"Внешний вид",theme:"Тема",useDefault:"Использовать по умолчанию",light:"Светлая",dark:"Темная",keyboardShortcuts:"Горячие клавиши",configureKeyboardShortcuts:"Настройка горячих клавиш",configure:"Настройка",clipboardClearTimeout:"Очистить буфер обмена после копирования",clipboardClearTimeoutDescription:"Автоматическая очистка буфера обмена после копирования конфиденциальных данных",clipboardClearDisabled:"Никогда не очищать",clipboardClear5Seconds:"Очистка через 5 секунд",clipboardClear10Seconds:"Очистка через 10 секунд",clipboardClear15Seconds:"Очистка через 15 секунд",autoLockTimeout:"Тайм-аут автоматической блокировки",autoLockTimeoutDescription:"Автоматическая блокировка хранилища после некоторого периода бездействия",autoLockTimeoutHelp:"Хранилище будет заблокировано только по истечении указанного периода бездействия (не будет использоваться функция автозаполнения или не откроется всплывающее окно с расширением). Хранилище всегда будет заблокировано при закрытии браузера, независимо от этого параметра.",autoLockNever:"Никогда",autoLock15Seconds:"15 секунд",autoLock1Minute:"1 минута",autoLock5Minutes:"5 минут",autoLock15Minutes:"15 минут",autoLock30Minutes:"30 минут",autoLock1Hour:"1 час",autoLock4Hours:"4 часа",autoLock8Hours:"8 часов",autoLock24Hours:"24 часов",versionPrefix:"Версия ",autofillSettings:"Настройки автозаполнения",clipboardSettings:"Настройки буфера обмена",contextMenuSettings:"Настройки контекстного меню",passkeySettings:"Настройки ключа доступа",contextMenu:"Контекстное меню",contextMenuEnabled:"Контекстное меню включено",contextMenuDisabled:"Контекстное меню отключено",contextMenuDescription:"Щелкните правой кнопкой мыши на полях ввода, чтобы получить доступ к параметрам AliasVault",selectLanguage:"Выбрать язык",serverConfiguration:"Конфигурация сервера",serverConfigurationDescription:"Настройте URL-адрес сервера AliasVault для самостоятельно размещенных экземпляров",customApiUrl:"URL-адрес API",customClientUrl:"URL-адрес клиента\uFEFF",apiUrlHint:"URL-адрес конечной точки API (обычно URL-адрес клиента + /api)\uFEFF",clientUrlHint:"URL-адрес веб-интерфейса вашего самостоятельно размещенного экземпляра",autofillSettingsDescription:"Включить или отключить всплывающее окно автозаполнения на веб-страницах",autofillEnabledDescription:"В формах входа будут появляться подсказки для автозаполнения",autofillDisabledDescription:"Подсказки автозаполнения отключены глобально",languageSettings:"Язык",validation:{apiUrlRequired:"Требуется URL-адрес API",apiUrlInvalid:"Пожалуйста, введите корректный URL-адрес API",clientUrlRequired:"Требуется URL-адрес клиента",clientUrlInvalid:"Пожалуйста, введите корректный URL-адрес клиента"},unlockMethod:{title:"Способ разблокировки хранилища",introText:"Выберите способ разблокировки хранилища. Вы можете использовать свой мастер-пароль (он доступен всегда) или установить ПИН-код для быстрого доступа. После 3 неудачных попыток ввода ПИН-кода необходимо будет ввести мастер-пароль.",password:"Мастер-пароль",pin:"ПИН-код",pinDescription:"Разблокировать хранилище ПИН-кодом",setupPin:"Установить ПИН-код",enterNewPinDescription:"Введите ПИН-код, состоящий как минимум из 6 цифр",confirmPin:"Подтвердите ПИН-код\uFEFF",confirmPinDescription:"Повторите ПИН-код для подтверждения",invalidPinFormat:"Неверный формат ПИН-кода\uFEFF",pinMismatch:"ПИН-коды не совпадают",incorrectPin:"Неверный ПИН-код. Осталось {{attemptsRemaining}} попытки.",incorrectPinSingular:"Неверный ПИН-код. Осталась 1 попытка.",enableSuccess:"Разблокировка по ПИН-коду успешно включена",pinLocked:"Разблокировка по ПИН-коду отключена. Пожалуйста, используйте ваш мастер-пароль для разблокировки хранилища.",pinSecurityWarning:"Разблокировка с помощью ПИН-кода в расширении для браузера может быть менее безопасной, чем использование вашего мастер-пароля, поскольку ПИН-коды обычно имеют более низкую энтропию и могут быть подобраны методом перебора (брутфорс), если ваше устройство будет скомпрометировано. Используйте этот способ только на устройствах, которым вы полностью доверяете."}},u1={passkey:"Ключ доступа",site:"Сайт",helpText:"Ключи доступа создаются на веб-сайте по запросу. Их нельзя редактировать вручную. Чтобы удалить этот ключ доступа, вы можете удалить его из этой учетной записи. Чтобы заменить этот ключ доступа или создать новый, посетите веб-сайт и следуйте его инструкциям.",passkeyMarkedForDeletion:"Ключ доступа помечен на удаление\uFEFF",passkeyWillBeDeleted:"Этот ключ доступа будет удален при сохранении этой учетной записи.",useBrowserPasskey:"Использовать ключ доступа из браузера\uFEFF",bypass:{description:"На какой срок вы хотите предоставить сайту {{origin}} доступ к ключам, сохраненным в браузере?",thisTimeOnly:"Только в этот раз",alwaysForSite:"Всегда для этого сайта"},authenticate:{title:"Вход с помощью ключа доступа",signInFor:"Вход с ключом доступа для",selectPasskey:"Выберите ключ доступа для входа:",noPasskeysFound:"Ключи доступа для этого сайта не найдены"},create:{title:"Создание ключа доступа",createFor:"Создайте новый ключ доступа для",titleLabel:"Название",titlePlaceholder:"Укажите название для этого ключа доступа",createButton:"Создать ключ доступа",selectPasskeyToReplace:"Выберите ключ доступа для замены:",createNewPasskey:"Создать новый ключ доступа",replacingPasskey:"Замена ключа доступа: {{displayName}}",confirmReplace:"Подтвердить замену",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Провайдер ключей доступа",passkeyProviderOn:"Провайдер ключей доступа включен "}},d1={title:"Недавно удаленные",noItems:"Нет удаленных элементов",noItemsDescription:"Удаленные элементы будут храниться здесь 30 дней, после чего они будут удалены безвозвратно.",description:"Эти элементы будут безвозвратно удалены через 30 дней. Вы можете восстановить их или удалить немедленно.",restore:"Восстановить",deletePermanently:"Удалить безвозвратно",emptyAll:"Очистить все",daysRemaining_one:"Остался {{count}} день",daysRemaining_other:"Осталось {{count}} дней",expiringSoon:"Скоро будут удалены",confirmDeleteTitle:"Удалить безвозвратно?",confirmDeleteMessage:"Этот элемент будет удален навсегда без возможности восстановления.",confirmEmptyAllTitle:"Очистить «Недавно удалённые»?",confirmEmptyAllMessage:"Все элементы {{count}} будут удалены навсегда без возможности восстановления."},m1={title:"Обновить хранилище",subtitle:"AliasVault обновился, и ваше хранилище необходимо обновить. Это займет всего несколько секунд.",versionInformation:"Информация о версии",yourVault:"Версия вашего хранилища:",newVersion:"Доступна новая версия:",upgrade:"Обновить хранилище",upgrading:"Обновление...",whatsNew:"Что нового",whatsNewDescription:"Для поддержки следующих изменений требуется обновление:",noDescriptionAvailable:"Описание для этой версии недоступно.",alerts:{unableToGetVersionInfo:"Не удалось получить информацию о версии. Пожалуйста, попробуйте снова.",selfHostedServer:"Автономный сервер",selfHostedWarning:"Если вы используете автономный сервер, обязательно обновите свой автономный экземпляр, так как в противном случае вход в веб-клиент перестанет работать.",continueUpgrade:"Продолжить обновление",upgradeFailed:"Ошибка обновления",failedToApplyMigration:"Не удалось применить перенос ({{current}} из {{total}})"}},f1={unsyncedChangesTitle:"Несинхронизированные изменения",unsyncedChangesWarning:"У вас есть несинхронизированные изменения, которые будут потеряны, если вы выйдете из аккаунта сейчас. Вы уверены, что хотите продолжить?",logoutAnyway:"Все равно выйти"},g1={auth:ZS,menu:e1,common:t1,content:a1,items:n1,itemTypes:r1,fieldLabels:i1,totp:s1,attachmentUploader:o1,emails:l1,settings:c1,passkeys:u1,recentlyDeleted:d1,upgrade:m1,logout:f1},h1={loginTitle:"Увійти до AliasVault",username:"Ім'я користувача або електронна пошта",usernamePlaceholder:"ім'я / name@company.com",passwordPlaceholder:"Введіть ваш пароль",rememberMe:"Запам'ятати мене",loginButton:"Увійти",noAccount:"Ще не маєте облікового запису?",createVault:"Створити нове сховище",twoFactorTitle:"Будь ласка, введіть код автентифікації з вашого застосунку для автентифікації.",authCode:"Код автентифікації",authCodePlaceholder:"Введіть 6-значний код",verify:"Перевірка",twoFactorNote:"Примітка: якщо у вас немає доступу до вашого пристрою автентифікатора, ви можете скинути налаштування 2FA за допомогою коду відновлення, увійшовши через вебсайт.",masterPassword:"Головний пароль",unlockVault:"Розблокувати",unlockWithPin:"Розблокувати за допомогою ПІН-коду",enterPinToUnlock:"Введіть свій ПІН-код, щоб розблокувати сховище",useMasterPassword:"Використовуйте головний пароль",unlockTitle:"Розблокувати своє сховище",logoutConfirm:"Ви впевнені, що хочете вийти?",unlockSuccessTitle:"Ваше сховище успішно розблоковано",unlockSuccessDescription:"Тепер ви можете використовувати автозаповнення форм входу у вашому браузері.",closePopup:"Закрити цю підказку",browseVault:"Переглянути вміст сховища",connectingTo:"Підключення до",switchAccounts:"Змінити обліковий запис?",loginWithMobile:"Увійти за допомогою мобільного додатку",unlockWithMobile:"Розблокувати за допомогою мобільного додатку",scanQrCode:"Проскануйте цей QR-код за допомогою мобільного додатка AliasVault, щоб увійти та розблокувати сховище.",errors:{invalidCode:"Будь ласка, введіть дійсний 6-значний код автентифікації.",serverError:"Не вдалося зв’язатися зі сервером AliasVault. Будь ласка, спробуйте пізніше або зверніться до служби підтримки, якщо проблема не зникне.",wrongPassword:"Невірний пароль. Будь ласка, спробуйте ще раз.",sessionExpired:"Час сеансу закінчився. Будь ласка, увійдіть знову.",mobileLoginRequestExpired:"Час очікування запиту на вхід у мобільний додаток закінчився. Перезавантажте сторінку та спробуйте ще раз."}},A1={vault:"Vault",emails:"Електронні адреси"},p1={loading:"Завантаження даних...",notice:"Примітка",error:"Помилка",cancel:"Скасувати",confirm:"Підтвердити",back:"Назад",next:"Далі",use:"Використовувати",add:"Add",delete:"Видалити",undo:"Скасувати",save:"Зберегти",saving:"Saving...",create:"Створити",or:"Або",close:"Закрити",logout:"Вихід",copied:"Скопійовано!",openInNewWindow:"Відкрити у новому вікні",enabled:"Увімкнено",disabled:"Вимкнено",showPassword:"Показати пароль",hidePassword:"Приховати пароль",showDetails:"Показати подробиці",hideDetails:"Приховати подробиці",copyToClipboard:"Копіювати до буфера обміну",loadingEmails:"Завантаження електронних адрес...",loadingTotpCodes:"Завантаження кодів TOTP...",attachments:"Вкладення",loadingAttachments:"Завантаження вкладень...",settings:"Налаштування",recentEmails:"Останні електронні листи",credentials:"Облікові дані",customFields:"Custom Fields",twoFactorAuthentication:"Двофакторна автентифікація",alias:"Псевдонім",notes:"Нотатки",email:"Електронна пошта",username:"Ім'я користувача",password:"Пароль",generate:"Generate",serviceName:"Назва сервісу",loggedIn:"Вхід виконано",syncingVault:"Синхронізація сховища",checkingVaultUpdates:"Перевірка оновлень сховища",syncingUpdatedVault:"Синхронізація оновленого сховища",loadMore:"Завантажити ще",offline:"Offline",offlineMode:"Operating in offline mode",pendingSync:"Syncing...",mergingVaultChanges:"Merging vault changes...",uploadingVault:"Uploading vault...",errors:{serverNotAvailable:"Не вдалося зв’язатися зі сервером AliasVault. Будь ласка, спробуйте пізніше або зверніться до служби підтримки, якщо проблема не зникне.",clientVersionNotSupported:"Ця версія розширення браузера AliasVault більше не підтримується сервером. Будь ласка, оновіть розширення браузера до останньої версії.",browserExtensionOutdated:"Це розширення браузера застаріло, і його не можна використовувати для доступу до цього сховища. Щоб продовжити, оновіть це розширення браузера.",serverVersionNotSupported:"Щоб використовувати це розширення браузера, потрібно оновити сервер AliasVault до новішої версії. Зверніться до служби підтримки, якщо вам потрібна допомога.",serverVersionTooOld:"Щоб скористатися цією функцією, потрібно оновити сервер AliasVault до нової версії. Якщо вам потрібна допомога, будь ласка, зверніться до адміністратора сервера.",unknownError:"Сталася невідома помилка",unknownErrorTryAgain:"Сталася невідома помилка. Будь ласка, спробуйте ще раз.",vaultNotAvailable:"Сховище недоступне",vaultIsLocked:"Сховище заблоковано",passwordChanged:"Ваш пароль змінився з моменту останнього входу. З міркувань безпеки, будь ласка, увійдіть ще раз.",syncConflictMaxRetries:"Could not sync vault after multiple attempts. Please try again later.",mergeFailed:"Failed to merge vault changes. Please try again."},apiErrors:{UNKNOWN_ERROR:"Сталася невідома помилка. Будь ласка, спробуйте ще раз.",ACCOUNT_LOCKED:"Обліковий запис тимчасово заблоковано через занадто багато невдалих спроб. Будь ласка, спробуйте пізніше.",ACCOUNT_BLOCKED:"Ваш обліковий запис вимкнено. Якщо ви вважаєте, що це помилка, зверніться до служби підтримки.",USER_NOT_FOUND:"Недійсне ім'я користувача або пароль. Спробуйте ще раз.",INVALID_AUTHENTICATOR_CODE:"Недійсний код автентифікатора. Спробуйте ще раз.",INVALID_RECOVERY_CODE:"Недійсний код відновлення. Будь ласка, спробуйте ще раз.",REFRESH_TOKEN_REQUIRED:"Необхідне оновлення токена.",INVALID_REFRESH_TOKEN:"Оновлення токена невдале.",PUBLIC_REGISTRATION_DISABLED:"Реєстрація нових облікових записів на цьому сервері наразі вимкнена. Зверніться до адміністратора.",USERNAME_REQUIRED:"Ім'я користувача обов'язкове.",USERNAME_ALREADY_IN_USE:"Ім'я користувача вже використовується.",USERNAME_AVAILABLE:"Ім'я користувача доступне.",USERNAME_MISMATCH:"Ім'я користувача не відповідає поточному користувачеві.",PASSWORD_MISMATCH:"Введений пароль не відповідає вашому поточному паролю.",ACCOUNT_SUCCESSFULLY_DELETED:"Обліковий запис успішно видалено.",USERNAME_EMPTY_OR_WHITESPACE:"Ім’я користувача не може бути порожнім або містити пробіли.",USERNAME_TOO_SHORT:"Ім’я користувача закоротке: має містити щонайменше 3 символи.",USERNAME_TOO_LONG:"Ім'я користувача занадто довге: не може бути довшим за 40 символів.",USERNAME_INVALID_EMAIL:"Недійсна адреса електронної пошти.",USERNAME_INVALID_CHARACTERS:"Ім'я користувача недійсне, може містити лише літери або цифри.",VAULT_NOT_UP_TO_DATE:"Ваше сховище застаріло. Синхронізуйте його та спробуйте ще раз.",INTERNAL_SERVER_ERROR:"Внутрішня помилка сервера.",VAULT_ERROR:"Локальне сховище не оновлене. Синхронізуйте своє сховище, оновивши сторінку, та повторіть спробу."}},y1={or:"або",new:"Новий",vaultLocked:"AliasVault заблоковано.",creatingNewAlias:"Створення нового псевдоніму...",noMatchesFound:"Збігів не знайдено",searchVault:"Пошук сховища...",enterServiceName:"Введіть назву служби",enterEmailAddress:"Введіть електронну адресу",enterUsername:"Введіть ім'я користувача",hideFor1Hour:"Сховати протягом 1 години (поточний сайт)",hidePermanently:"Приховати назавжди (поточний сайт)",createRandomAlias:"Створити випадковий псевдонім",createUsernamePassword:"Створити ім'я користувача/пароль",randomAlias:"Випадковий псевдонім",usernamePassword:"Ім'я користувача/Пароль",createAndSaveAlias:"Створити та зберегти псевдонім",createAndSaveCredential:"Створити та зберегти облікові дані",randomIdentityDescription:"Згенеруйте випадкову особу з випадковою адресою електронної пошти, доступною в AliasVault.",randomIdentityDescriptionDropdown:"Випадкова ідентифікація з випадковою електронною поштою",manualCredentialDescription:"Вкажіть власну адресу електронної пошти та ім'я користувача.",manualCredentialDescriptionDropdown:"Ім'я користувача та пароль вручну",failedToCreateIdentity:"Не вдалося створити ідентифікатор. Спробуйте ще раз.",enterEmailAndOrUsername:"Введіть електронну пошту та/або ім'я користувача",autofillWithAliasVault:"Автозаповнення за допомогою AliasVault",generateRandomPassword:"Згенерувати випадковий пароль (скопіювати в буфер обміну)",generateNewPassword:"Згенерувати новий пароль",togglePasswordVisibility:"Перемикання видимості пароля",passwordCopiedToClipboard:"Пароль скопійовано в буфер обміну",openAliasVaultToUpgrade:"Відкрити AliasVault для покращення",vaultUpgradeRequired:"Потрібне оновлення сховища.",dismissPopup:"Закрити спливаюче вікно"},E1={title:"Items",itemName:"Назва",loginCredentials:"Дані для входу",cardInformation:"Card Information",addItem:"Add Item",addNewItem:"Add new item",saveItem:"Save Item",itemDetails:"Item Details",editItem:"Edit Item",untitled:"Untitled",newFolder:"New Folder",createFolder:"Створити теку",editFolder:"Edit Folder",folderName:"Folder Name",folderNameRequired:"Folder name is required",folder:"Тека",welcomeTitle:"Ласкаво просимо до AliasVult!",welcomeDescription:"Щоб скористатися розширенням браузера AliasVault: перейдіть на вебсайт і скористайтеся спливаючим вікном автозаповнення AliasVault, щоб створити нові облікові дані.",noPasskeysFound:"Ключі доступу ще не створено. Ключі доступу створюються під час відвідування вебсайту, який пропонує ключі доступу як спосіб автентифікації.",noAttachmentsFound:"No items with attachments found",noItemsOfTypeFound:"No {{type}} items found",noMatchingItems:"No matching items found",noMatchingItemsSearch:'No items matching "{{search}}"',noMatchingItemsWithFilter:'No {{filter}} items matching "{{search}}"',clearSearch:"Clear search",clearFilter:"Clear filter",emptyFolderHint:"This folder is empty. To move items to this folder, edit the item and tap the folder icon in the name field.",allItemsInFolders:"All your items are organized in folders. Click a folder above to view your credentials, or use the search to find specific items.",deleteFolder:"Delete Folder",deleteFolderKeepItems:"Delete folder only",deleteFolderKeepItemsDescription:"Items will be moved back to the main list.",deleteFolderAndItems:"Delete folder and all items",deleteFolderAndItemsDescription:"{{count}} item(s) will be moved to Recently Deleted.",filters:{all:"(All) Items",passkeys:"Ключі доступу"},deleteItemTitle:"Delete Item",deleteItemConfirm:"Are you sure you want to delete this item?",viewHistory:"View history",history:"History",noHistoryAvailable:"No history available",tags:"Теги",changePasswordComplexity:"Зміна складності пароля",passwordLength:"Довжина пароля",includeLowercase:"Включити малі літери",includeUppercase:"Включити великі літери",includeNumbers:"Включити числа",includeSpecialChars:"Включити спеціальні символи",avoidAmbiguousChars:"Уникайте неоднозначних символів (o, 0 тощо)",privateEmailTitle:"Приватна електронна адреса",privateEmailAliasVaultServer:"Сервер AliasVault",privateEmailDescription:"Наскрізне шифрування, повністю конфіденційно.",publicEmailTitle:"Публічні тимчасові постачальники електронної пошти",publicEmailDescription:"Анонімно, але обмежена конфіденційність. Зміст електронного листа може прочитати будь-хто, хто знає адресу.",validation:{required:"Це поле обов'язкове"}},b1={selectType:"Add New Item",typeLabel:"Item Type",creating:"Creating",editing:"Editing",regenerateAlias:"Regenerate alias",addCustomField:"Add custom field",fieldLabel:"Field Label",enterFieldName:"Enter field name",fieldType:"Field Type",fieldTypes:{text:"Text",hidden:"Hidden (masked text)",email:"Електронна пошта",url:"URL",phone:"Phone",number:"Number",date:"Date",textArea:"Text Area"},login:{title:"Увійти"},alias:{title:"Псевдонім"},creditCard:{title:"Credit Card"},note:{title:"Secure Note"}},I1={"login.url":"Website URL","login.username":"Username","login.password":"Пароль","alias.first_name":"Ім’я","alias.last_name":"Прізвище","alias.gender":"Стать","alias.birthdate":"Birthdate","login.email":"Пошта","notes.content":"Нотатки","card.cardholder_name":"Cardholder Name","card.number":"Card Number","card.expiry_month":"Expiry Month","card.expiry_year":"Expiry Year","card.cvv":"CVV","card.pin":"PIN"},v1={addCode:"Add 2FA Code",instructions:"Enter the secret key shown by the website where you want to add two-factor authentication.",nameOptional:"Ім'я (необов'язково)",secretKey:"Секретний ключ",saveToViewCode:"Зберегти для перегляду коду",defaultName:"Authenticator",errors:{invalidSecretKey:"Invalid secret key format."}},w1={uploading:"Uploading...",uploadSuccess:"Files uploaded successfully.",deleteSuccess:"Attachment deleted successfully.",firefoxExpandRequired:"To upload files, use the expanded window.",openExpandedWindow:"Open Expanded Window"},C1={title:"Електронні листи",deleteEmailTitle:"Видалити електронного листа",deleteEmailConfirm:"Ви впевнені, що хочете остаточно видалити цей електронний лист?",from:"Від",to:"До",date:"Дата",emailContent:"Вміст електронного листа",emailNotFound:"Електронний лист не знайдено",noEmails:"Електронних листів не знайдено",noEmailsDescription:"Ви ще не отримували жодних листів на свої приватні адреси електронної пошти. Коли ви отримаєте новий лист, він з’явиться тут.",offlineMessage:"Ви офлайн. Будь ласка, приєднайтесь до Інтернету, щоб завантажити свої електронні листи.",dateFormat:{justNow:"щойно",minutesAgo_single:"{{count}} хвилина тому",minutesAgo_plural:"{{count}} хвилин тому",hoursAgo_single:"{{count}} година тому",hoursAgo_plural:"{{count}} годин тому",yesterday:"учора"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"Поточна вибрана електронна адреса вже використовується. Змініть електронну адресу, відредагувавши ці облікові дані.",CLAIM_DOES_NOT_EXIST:"Під час спроби завантажити електронні листи сталася помилка. Спробуйте відредагувати та зберегти запис облікових даних, щоб синхронізувати базу даних, а потім повторіть спробу."}},N1={serverUrl:"URL-адреса сервера",language:"Мова",autofillEnabled:"Увімкнути автозаповнення",version:"Версія",openWebApp:"Відкрити веб додаток",lock:"Заблокувати",globalSettings:"Глобальні налаштування",autofillPopup:"Спливаюче вікно автозаповнення",activeOnAllSites:"Активно на всіх сайтах (якщо не вимкнено нижче)",disabledOnAllSites:"Вимкнено на всіх сайтах",rightClickContextMenu:"Контекстне меню правою кнопкою миші",autofillMatching:"Автозаповнення відповідності",autofillMatchingMode:"Режим автозаповнення відповідностей",autofillMatchingModeDescription:"Визначає, які облікові дані вважаються відповідними та будуть показуватися як пропозиції у спливному вікні автозаповнення для певного вебсайту.",autofillMatchingDefault:"URL-адреса + піддомен + універсальне ім'я",autofillMatchingUrlSubdomain:"URL-адреса + піддомен",autofillMatchingUrlExact:"Лише точний домен URL-адреси",siteSpecificSettings:"Налаштування, специфічні для сайту",autofillPopupOn:"Спливаюче вікно автозаповнення на: ",enabledForThisSite:"Увімкнено для цього сайту",disabledForThisSite:"Вимкнено для цього сайту",temporarilyDisabledUntil:"Тимчасово вимкнено до ",resetAllSiteSettings:"Скинути всі налаштування, характерні для сайту",appearance:"Зовнішній вигляд",theme:"Тема",useDefault:"Використовувати за замовчуванням",light:"Світла",dark:"Темна",keyboardShortcuts:"Комбінації клавіш",configureKeyboardShortcuts:"Налаштування комбінацій клавіш",configure:"Налаштування",clipboardClearTimeout:"Очистити буфер обміну після копіювання",clipboardClearTimeoutDescription:"Автоматично очищати буфер обміну після копіювання конфіденційних даних",clipboardClearDisabled:"Ніколи не очищати",clipboardClear5Seconds:"Очистити після 5 секунд",clipboardClear10Seconds:"Очистити після 10 секунд",clipboardClear15Seconds:"Очистити після 15 секунд",autoLockTimeout:"Тайм-аут автоматичного блокування",autoLockTimeoutDescription:"Автоматично блокувати сховище після періоду бездіяльності",autoLockTimeoutHelp:"Сховище буде заблоковано лише після зазначеного періоду бездіяльності (не використовується автозаповнення або не відкривається спливне вікно розширення). Сховище завжди блокуватиметься, коли браузер закривається, незалежно від цього налаштування.",autoLockNever:"Ніколи",autoLock15Seconds:"15 секунд",autoLock1Minute:"1 хвилина",autoLock5Minutes:"5 хвилин",autoLock15Minutes:"15 хвилин",autoLock30Minutes:"30 хвилин",autoLock1Hour:"1 година",autoLock4Hours:"4 години",autoLock8Hours:"8 годин",autoLock24Hours:"24 години",versionPrefix:"Версія ",autofillSettings:"Налаштування автозаповнення",clipboardSettings:"Параметри буфера обміну",contextMenuSettings:"Налаштування контекстного меню",passkeySettings:"Налаштування ключа доступу",contextMenu:"Контекстне меню",contextMenuEnabled:"Контекстне меню увімкнено",contextMenuDisabled:"Контекстне меню вимкнено",contextMenuDescription:"Натисніть правою кнопкою миші на поля введення, щоб отримати доступ до параметрів AliasVault",selectLanguage:"Виберіть мову",serverConfiguration:"Конфігурація сервера",serverConfigurationDescription:"Налаштування URL-адреси сервера AliasVault для самостійно розміщених екземплярів",customApiUrl:"URL-адреса API",customClientUrl:"URL-адреса клієнта",apiUrlHint:"URL-адреса кінцевої точки API (зазвичай URL-адреса клієнта + /api)",clientUrlHint:"URL-адреса вебінтерфейсу вашого самостійного екземпляра",autofillSettingsDescription:"Увімкнення або вимкнення спливаючого вікна автозаповнення на вебсторінках",autofillEnabledDescription:"",autofillDisabledDescription:"Autofill suggestions are disabled globally",languageSettings:"Мова",validation:{apiUrlRequired:"URL-адреса API обов'язкова",apiUrlInvalid:"Будь ласка, введіть дійсну URL-адресу API",clientUrlRequired:"URL-адреса клієнта обов'язкова",clientUrlInvalid:"Будь ласка, введіть дійсну URL-адресу клієнта"},unlockMethod:{title:"Метод розблокування сховища",introText:"Choose how you want to unlock your vault. You can use your master password (always available) or set up a PIN code for faster access. After 3 failed PIN attempts, you'll need to use your master password.",password:"Головний пароль",pin:"ПІН-код",pinDescription:"Unlock vault with PIN code",setupPin:"Setup PIN Code",enterNewPinDescription:"Enter a PIN code consisting of minimum 6 digits",confirmPin:"Підтвердити ПІН-код",confirmPinDescription:"Enter your PIN again to confirm",invalidPinFormat:"Invalid PIN format",pinMismatch:"PINs do not match",incorrectPin:"Incorrect PIN. {{attemptsRemaining}} attempts remaining.",incorrectPinSingular:"Incorrect PIN. 1 attempt remaining.",enableSuccess:"Розблокування PIN-кодом успішно ввімкнено!",pinLocked:"PIN unlock has been disabled. Please use your master password to unlock your vault.",pinSecurityWarning:"PIN unlock in the browser extension can be less secure than your master password, as PINs typically have lower entropy and may be brute-forced if your device is compromised. Use it only on devices you fully trust."}},x1={passkey:"Ключ доступу",site:"Вебсайт",helpText:"Passkeys are created on the website when prompted. They cannot be manually edited. To remove this passkey, you can delete it from this credential. To replace this passkey or create a new one, visit the website and follow its prompts.",passkeyMarkedForDeletion:"Ключ доступу позначено для видалення",passkeyWillBeDeleted:"Цей ключ доступу буде видалено, коли ви збережете ці облікові дані.",useBrowserPasskey:"Use Browser Passkey",bypass:{description:"How long would you like to use the browser's passkey provider for {{origin}}?",thisTimeOnly:"This time only",alwaysForSite:"Always for this site"},authenticate:{title:"Sign in with Passkey",signInFor:"Sign in with passkey for",selectPasskey:"Select a passkey to sign in:",noPasskeysFound:"No passkeys found for this site"},create:{title:"Create Passkey",createFor:"Create a new passkey for",titleLabel:"Заголовок",titlePlaceholder:"Enter a name for this passkey",createButton:"Create Passkey",selectPasskeyToReplace:"Select a passkey to replace:",createNewPasskey:"Create New Passkey",replacingPasskey:"Replacing passkey: {{displayName}}",confirmReplace:"Confirm Replace",selectExistingLogin:"Add to existing login:",selectExistingLoginDescription:"Attach this passkey to an existing login credential for this site.",attachingToCredential:"Adding passkey to: {{serviceName}}",attachPasskey:"Add Passkey"},settings:{passkeyProvider:"Passkey Provider",passkeyProviderOn:"Passkey Provider on "}},T1={title:"Recently Deleted",noItems:"No deleted items",noItemsDescription:"Items you delete will appear here for 30 days before being permanently removed.",description:"These items will be permanently deleted after 30 days. You can restore them or delete them immediately.",restore:"Restore",deletePermanently:"Delete Permanently",emptyAll:"Empty All",daysRemaining_one:"{{count}} day remaining",daysRemaining_other:"{{count}} days remaining",expiringSoon:"Expiring soon",confirmDeleteTitle:"Delete Permanently?",confirmDeleteMessage:"This item will be permanently deleted and cannot be recovered.",confirmEmptyAllTitle:"Empty Recently Deleted?",confirmEmptyAllMessage:"All {{count}} items will be permanently deleted and cannot be recovered."},S1={title:"Оновлення сховища",subtitle:"AliasVault оновлено, і ваше сховище потрібно оновити. Це займе лише кілька секунд.",versionInformation:"Інформація про версію",yourVault:"Ваша версія сховища:",newVersion:"Доступна нова версія:",upgrade:"Оновлення сховища",upgrading:"Оновлення...",whatsNew:"Що нового",whatsNewDescription:"Для підтримки таких змін потрібне оновлення:",noDescriptionAvailable:"Для цієї версії немає опису.",alerts:{unableToGetVersionInfo:"Не вдалося отримати інформацію про версію. Спробуйте ще раз.",selfHostedServer:"Сервер із самостійним розміщенням",selfHostedWarning:"Якщо ви використовуєте власний сервер, обов’язково оновіть і свій власний екземпляр, інакше вхід до вебклієнта перестане працювати.",continueUpgrade:"Продовжити оновлення",upgradeFailed:"Помилка оновлення",failedToApplyMigration:"Не вдалося застосувати міграцію ({{current}} з {{total}})"}},k1={unsyncedChangesTitle:"Unsynced Changes",unsyncedChangesWarning:"You have unsynced changes that will be lost if you log out now. Are you sure you want to continue?",logoutAnyway:"Log out anyway"},L1={auth:h1,menu:A1,common:p1,content:y1,items:E1,itemTypes:b1,fieldLabels:I1,totp:v1,attachmentUploader:w1,emails:C1,settings:N1,passkeys:x1,recentlyDeleted:T1,upgrade:S1,logout:k1},R1={loginTitle:"登录到 AliasVault",username:"用户名或邮箱",usernamePlaceholder:"姓名 / name@company.com",passwordPlaceholder:"输入您的密码",rememberMe:"记住我",loginButton:"登录",noAccount:"还没有账户？",createVault:"创建新密码库",twoFactorTitle:"请输入认证器的动态验证码。",authCode:"身份验证码",authCodePlaceholder:"输入 6 位数代码",verify:"验证",twoFactorNote:"注意：如果无法访问您的认证设备，您可以通过网站登录，使用恢复码重置双因素认证（2FA）。",masterPassword:"主密码",unlockVault:"解锁",unlockWithPin:"使用 PIN 解锁",enterPinToUnlock:"输入您的 PIN 以解锁密码库",useMasterPassword:"使用主密码",unlockTitle:"解锁您的密码库",logoutConfirm:"确定要退出登录吗？",unlockSuccessTitle:"您的密码库已成功解锁",unlockSuccessDescription:"现在您可以在浏览器的登录表单中使用自动填充功能了。",closePopup:"关闭此弹窗",browseVault:"浏览密码库内容",connectingTo:"正在连接",switchAccounts:"切换账户？",loginWithMobile:"使用移动应用登录",unlockWithMobile:"使用移动应用解锁",scanQrCode:"使用 AliasVault 移动端应用扫描该二维码，即可登录并解锁您的密码库。",errors:{invalidCode:"请输入有效的6位动态验证码。",serverError:"无法连接到AliasVault服务器。请稍后重试，若问题依旧，请联系支持人员。",wrongPassword:"密码不正确。请重试。",sessionExpired:"您的会话已过期。请重新登录。",mobileLoginRequestExpired:"移动端登录请求超时。请重新加载页面后重试。"}},D1={vault:"密码库",emails:"邮件"},B1={loading:"加载中…",notice:"注意",error:"错误",cancel:"取消",confirm:"确认",back:"返回",next:"下一步",use:"使用",add:"添加",delete:"删除",undo:"撤销",save:"保存",saving:"保存中…",create:"创建",or:"或",close:"关闭",logout:"登出",copied:"已复制！",openInNewWindow:"在新窗口中打开",enabled:"启用",disabled:"禁用",showPassword:"显示密码",hidePassword:"隐藏密码",showDetails:"显示详情",hideDetails:"隐藏详情",copyToClipboard:"复制到剪贴板",loadingEmails:"加载邮件中…",loadingTotpCodes:"加载TOTP验证码中…",attachments:"附件",loadingAttachments:"加载附件中…",settings:"设置",recentEmails:"近期邮件",credentials:"凭据",customFields:"自定义字段",twoFactorAuthentication:"双因素认证（2FA）",alias:"别名",notes:"备注",email:"邮箱",username:"用户名",password:"密码",generate:"生成",serviceName:"服务名称",loggedIn:"已登录",syncingVault:"正在同步密码库",checkingVaultUpdates:"检查密码库更新中",syncingUpdatedVault:"同步更新后的密码库",loadMore:"加载更多",offline:"离线",offlineMode:"正在离线模式运行",pendingSync:"同步中…",mergingVaultChanges:"正在合并密码库更改...",uploadingVault:"正在上传密码库…",errors:{serverNotAvailable:"AliasVault服务器不可用。请稍后重试，若问题持续请联系支持人员。",clientVersionNotSupported:"此版本的AliasVault浏览器扩展已不被服务器支持。请将浏览器扩展更新到最新版本。",browserExtensionOutdated:"此浏览器扩展已过时，无法用于访问此密码库。请更新此浏览器扩展以继续。",serverVersionNotSupported:"AliasVault服务器需要更新到新版本才能使用此浏览器扩展。如需帮助，请联系支持人员。",serverVersionTooOld:"AliasVault 服务器需要更新到更高版本才能使用此功能。如需帮助，请联系服务器管理员。",unknownError:"发生未知错误",unknownErrorTryAgain:"发生未知错误，请重试。",vaultNotAvailable:"密码库不可用",vaultIsLocked:"密码库已锁定",passwordChanged:"登录密码已更新，请重新登录以确保账户安全。",syncConflictMaxRetries:"多次尝试后仍无法同步密码库，请稍后重试。",mergeFailed:"合并密码库更改失败，请重试。"},apiErrors:{UNKNOWN_ERROR:"发生未知错误。请重试。",ACCOUNT_LOCKED:"由于多次尝试失败，账户已暂时锁定。请稍后重试。",ACCOUNT_BLOCKED:"您的账户已被停用。若您认为此操作有误，请联系支持人员。",USER_NOT_FOUND:"用户名或密码无效。请重试。",INVALID_AUTHENTICATOR_CODE:"认证器验证码无效。请重试。",INVALID_RECOVERY_CODE:"恢复码无效。请重试。",REFRESH_TOKEN_REQUIRED:"刷新令牌为必填项。",INVALID_REFRESH_TOKEN:"刷新令牌无效。",PUBLIC_REGISTRATION_DISABLED:"当前服务器已禁用新账户注册。请联系管理员。",USERNAME_REQUIRED:"用户名为必填项。",USERNAME_ALREADY_IN_USE:"用户名已被使用。",USERNAME_AVAILABLE:"用户名可用。",USERNAME_MISMATCH:"用户名与当前用户不匹配。",PASSWORD_MISMATCH:"提供的密码与您的当前密码不匹配。",ACCOUNT_SUCCESSFULLY_DELETED:"账户已成功删除。",USERNAME_EMPTY_OR_WHITESPACE:"用户名不能为空或仅含空格。",USERNAME_TOO_SHORT:"用户名过短：至少需要3个字符。",USERNAME_TOO_LONG:"用户名过长：不能超过40个字符。",USERNAME_INVALID_EMAIL:"无效的邮箱地址。",USERNAME_INVALID_CHARACTERS:"用户名无效，只能包含字母或数字。",VAULT_NOT_UP_TO_DATE:"您的密码库不是最新的。请同步您的密码库后重试。",INTERNAL_SERVER_ERROR:"服务器内部错误。",VAULT_ERROR:"本地密码库不是最新的。请刷新页面同步密码库后重试。"}},U1={or:"或",new:"新建",vaultLocked:"AliasVault已锁定。",creatingNewAlias:"正在创建新别名…",noMatchesFound:"未找到匹配项",searchVault:"搜索密码库…",enterServiceName:"输入服务名称",enterEmailAddress:"输入邮箱地址",enterUsername:"输入用户名",hideFor1Hour:"隐藏1小时（当前网站）",hidePermanently:"永久隐藏（当前网站）",createRandomAlias:"创建随机别名",createUsernamePassword:"创建用户名/密码",randomAlias:"随机别名",usernamePassword:"用户名/密码",createAndSaveAlias:"创建并保存别名",createAndSaveCredential:"创建并保存凭据",randomIdentityDescription:"生成一个包含随机邮箱地址的随机身份，可在AliasVault中查看。",randomIdentityDescriptionDropdown:"带随机邮箱的随机身份",manualCredentialDescription:"指定您自己的邮箱地址和用户名。",manualCredentialDescriptionDropdown:"手动输入用户名和密码",failedToCreateIdentity:"创建身份失败。请重试。",enterEmailAndOrUsername:"输入邮箱和/或用户名",autofillWithAliasVault:"使用AliasVault自动填充",generateRandomPassword:"生成随机密码（复制到剪贴板）",generateNewPassword:"生成新密码",togglePasswordVisibility:"切换密码可见性",passwordCopiedToClipboard:"密码已复制到剪贴板",openAliasVaultToUpgrade:"打开AliasVault进行升级",vaultUpgradeRequired:"需要升级密码库。",dismissPopup:"关闭弹窗"},_1={title:"项目",itemName:"名称",loginCredentials:"登录凭据",cardInformation:"卡信息",addItem:"添加项目",addNewItem:"添加新项目",saveItem:"保存项目",itemDetails:"项目详情",editItem:"编辑项目",untitled:"无标题",newFolder:"新建文件夹",createFolder:"创建文件夹",editFolder:"编辑文件夹",folderName:"文件夹名称",folderNameRequired:"文件夹名称为必填项",folder:"文件夹",welcomeTitle:"欢迎使用AliasVault！",welcomeDescription:"要使用AliasVault浏览器扩展：导航到某个网站，使用AliasVault自动填充弹窗创建新凭据。",noPasskeysFound:"尚未创建通行密钥。访问以通行密钥为认证方式的网站才能创建通行密钥。",noAttachmentsFound:"未找到带附件的项目",noItemsOfTypeFound:"未找到 {{type}} 项目",noMatchingItems:"未找到匹配的项目",noMatchingItemsSearch:"未找到匹配“{{search}}”的项目",noMatchingItemsWithFilter:"未找到匹配“{{search}}”的 {{filter}} 项目",clearSearch:"清除搜索",clearFilter:"清除筛选器",emptyFolderHint:"此文件夹为空。要将项目移动到此文件夹，请编辑该项目，然后点击名称字段中的文件夹图标。",allItemsInFolders:"您的所有项目都已整理到文件夹中。点击上方文件夹即可查看您的凭据，或使用搜索查找特定的项目。",deleteFolder:"删除文件夹",deleteFolderKeepItems:"仅删除文件夹",deleteFolderKeepItemsDescription:"项目将被移回主列表。",deleteFolderAndItems:"删除文件夹和所有项目",deleteFolderAndItemsDescription:"{{count}} 个项目将被移至“近期删除”。",filters:{all:"（所有）项目",passkeys:"通行密钥"},deleteItemTitle:"删除项目",deleteItemConfirm:"您确定要删除此项目吗？",viewHistory:"查看历史记录",history:"历史记录",noHistoryAvailable:"暂无历史记录",tags:"标签",changePasswordComplexity:"更改密码复杂度",passwordLength:"密码长度",includeLowercase:"包含小写字母",includeUppercase:"包含大写字母",includeNumbers:"包含数字",includeSpecialChars:"包含特殊字符",avoidAmbiguousChars:"避免易混淆字符（o、0 等）",privateEmailTitle:"私人邮箱",privateEmailAliasVaultServer:"AliasVault 服务器",privateEmailDescription:"端到端加密，完全私密。",publicEmailTitle:"公共临时邮箱提供商",publicEmailDescription:"匿名但隐私性有限，任何知晓其地址的人均可读取邮件内容。",validation:{required:"此字段为必填项"}},M1={selectType:"添加新项目",typeLabel:"项目类型",creating:"创建",editing:"编辑",regenerateAlias:"重新生成别名",addCustomField:"添加自定义字段",fieldLabel:"字段标签",enterFieldName:"输入字段名称",fieldType:"字段类型",fieldTypes:{text:"文本",hidden:"隐藏（已遮挡文本）",email:"邮件",url:"URL",phone:"手机",number:"号码",date:"日期",textArea:"文本区域"},login:{title:"登录"},alias:{title:"别名"},creditCard:{title:"信用卡"},note:{title:"安全笔记"}},F1={"login.url":"网站 URL","login.username":"用户名","login.password":"密码","alias.first_name":"名","alias.last_name":"姓","alias.gender":"性别","alias.birthdate":"出生日期","login.email":"邮件","notes.content":"备注","card.cardholder_name":"持卡人姓名","card.number":"卡号","card.expiry_month":"到期月份","card.expiry_year":"到期年份","card.cvv":"CVV","card.pin":"PIN"},O1={addCode:"添加两步验证码",instructions:"输入要添加两步验证的网站显示的密钥。",nameOptional:"名称（可选）",secretKey:"密钥",saveToViewCode:"保存以查看验证码",defaultName:"身份验证器",errors:{invalidSecretKey:"密钥格式无效。"}},j1={uploading:"上传中…",uploadSuccess:"文件上传成功。",deleteSuccess:"附件删除成功。",firefoxExpandRequired:"要上传文件，请使用展开的窗口。",openExpandedWindow:"打开展开的窗口"},P1={title:"邮件",deleteEmailTitle:"删除邮件",deleteEmailConfirm:"确定要永久删除此邮件吗？",from:"发件人",to:"收件人",date:"日期",emailContent:"邮件内容",emailNotFound:"未找到邮件",noEmails:"未找到邮件",noEmailsDescription:"您的私人邮箱地址尚未收到任何邮件。当您收到新邮件时，会显示在这里。",offlineMessage:"您处于离线状态。请连接互联网以加载邮件。",dateFormat:{justNow:"刚刚",minutesAgo_single:"{{count}}分钟前",minutesAgo_plural:"{{count}}分钟前",hoursAgo_single:"{{count}}小时前",hoursAgo_plural:"{{count}}小时前",yesterday:"昨天"},apiErrors:{CLAIM_DOES_NOT_MATCH_USER:"当前选择的邮箱地址已被使用。请通过编辑此凭据修改邮箱地址。",CLAIM_DOES_NOT_EXIST:"加载邮件时发生错误。请尝试编辑并保存凭据条目以同步数据库，然后重试。"}},H1={serverUrl:"服务器 URL",language:"语言",autofillEnabled:"启用自动填充",version:"版本",openWebApp:"打开网页应用",lock:"锁定",globalSettings:"全局设置",autofillPopup:"自动填充弹窗",activeOnAllSites:"在所有网站上激活（除非在下方禁用）",disabledOnAllSites:"在所有网站上禁用",rightClickContextMenu:"右键上下文菜单",autofillMatching:"自动填充匹配",autofillMatchingMode:"自动填充匹配模式",autofillMatchingModeDescription:"用于判定哪些凭据会被视为匹配项，并在指定网站的自动填充弹窗中显示为建议选项。",autofillMatchingDefault:"URL + 子域名 + 名称通配符",autofillMatchingUrlSubdomain:"URL + 子域名",autofillMatchingUrlExact:"精确匹配URL域名",siteSpecificSettings:"网站特定设置",autofillPopupOn:"自动填充弹窗在以下位置： ",enabledForThisSite:"对此网站启用",disabledForThisSite:"对此网站禁用",temporarilyDisabledUntil:"暂时禁用至 ",resetAllSiteSettings:"重置所有网站特定设置",appearance:"外观",theme:"主题",useDefault:"使用默认",light:"浅色",dark:"深色",keyboardShortcuts:"键盘快捷键",configureKeyboardShortcuts:"配置键盘快捷键",configure:"配置",clipboardClearTimeout:"复制后清除剪贴板",clipboardClearTimeoutDescription:"复制敏感数据后自动清除剪贴板",clipboardClearDisabled:"从不清除",clipboardClear5Seconds:"5秒后清除",clipboardClear10Seconds:"10 秒后清除",clipboardClear15Seconds:"15分钟后清除",autoLockTimeout:"自动锁定超时时间",autoLockTimeoutDescription:"无操作一段时间后自动锁定密码库",autoLockTimeoutHelp:"密码库仅在达到指定的无操作时长后才会锁定（未使用自动填充功能或未打开扩展程序弹窗）。无论此设置如何，关闭浏览器时密码库始终会锁定。",autoLockNever:"从不",autoLock15Seconds:"15 秒",autoLock1Minute:"1 分钟",autoLock5Minutes:"5 分钟",autoLock15Minutes:"15 分钟",autoLock30Minutes:"30 分钟",autoLock1Hour:"1 小时",autoLock4Hours:"4 小时",autoLock8Hours:"8 小时",autoLock24Hours:"24 小时",versionPrefix:"版本 ",autofillSettings:"自动填充设置",clipboardSettings:"剪贴板设置",contextMenuSettings:"上下文菜单设置",passkeySettings:"通行密钥设置",contextMenu:"上下文菜单",contextMenuEnabled:"上下文菜单已启用",contextMenuDisabled:"上下文菜单已停用",contextMenuDescription:"右键点击输入字段即可访问 AliasVault 选项",selectLanguage:"选择语言",serverConfiguration:"服务器配置",serverConfigurationDescription:"为自托管实例配置 AliasVault 服务器 URL",customApiUrl:"API URL",customClientUrl:"客户端 URL",apiUrlHint:"API 端点 URL（通常为客户端 URL + /api）",clientUrlHint:"您自托管实例的 Web 界面 URL",autofillSettingsDescription:"启用或禁用网页上的自动填充弹出窗口",autofillEnabledDescription:"自动填充建议将显示在登录表单上",autofillDisabledDescription:"自动填充建议已全局禁用",languageSettings:"语言",validation:{apiUrlRequired:"API URL 为必填项",apiUrlInvalid:"请输入有效的 API URL",clientUrlRequired:"客户端 URL 为必填项",clientUrlInvalid:"请输入有效的客户端 URL"},unlockMethod:{title:"密码库解锁方式",introText:"选择您解锁密码库的方式。您可以使用主密码（始终可用），也可以设置 PIN 码以便快捷访问。PIN 码输入错误 3 次后，您需要使用主密码。",password:"主密码",pin:"PIN 码",pinDescription:"使用 PIN 码解锁密码库",setupPin:"设置 PIN 码",enterNewPinDescription:"请输入至少 6 位数的 PIN 码",confirmPin:"确认 PIN",confirmPinDescription:"再次输入您的 PIN 以确认",invalidPinFormat:"PIN 格式无效",pinMismatch:"PIN 不一致",incorrectPin:"PIN 码错误，剩余 {{attemptsRemaining}} 次尝试。",incorrectPinSingular:"PIN 码错误，剩余 1 次尝试。",enableSuccess:"PIN 码解锁已成功启用！",pinLocked:"PIN 码解锁已禁用，请使用您的主密码解锁您的密码库。",pinSecurityWarning:"浏览器扩展中的 PIN 码解锁可能不如您的主密码安全，因为 PIN 码的熵值通常较低，若您的设备遭到入侵，则可能被暴力破解。请仅在您完全信任的设备上使用该方式。"}},Q1={passkey:"通行密钥",site:"网站",helpText:"通行密钥会在网站提示时自动生成，无法手动编辑。要移除此通行密钥，您可以在此凭据中进行删除。要替换或创建新的通行密钥，请访问网站并按照其提示操作。",passkeyMarkedForDeletion:"通行密钥已标记为删除",passkeyWillBeDeleted:"保存此凭据后，此通行密钥将被删除。",useBrowserPasskey:"使用浏览器通行密钥",bypass:{description:"对于 {{origin}}，您希望使用浏览器的密码提供程序多长时间？",thisTimeOnly:"仅一次",alwaysForSite:"始终为此网站"},authenticate:{title:"使用通行密钥登录",signInFor:"使用通行密钥登录或",selectPasskey:"选择要登录的通行密钥：",noPasskeysFound:"未找到此网站的通行密钥"},create:{title:"创建通行密钥",createFor:"创建新通行密钥用于",titleLabel:"标题",titlePlaceholder:"输入此通行密钥的名称",createButton:"创建通行密钥",selectPasskeyToReplace:"选择要替换的通行密钥：",createNewPasskey:"创建新通行密钥",replacingPasskey:"替换通行密钥：{{displayName}}",confirmReplace:"确认替换",selectExistingLogin:"添加到现有登录：",selectExistingLoginDescription:"将此通行密钥附加到此站点的现有登录凭据中。",attachingToCredential:"正在将通行密钥添加到：{{serviceName}}",attachPasskey:"添加通行密钥"},settings:{passkeyProvider:"通行密钥提供程序",passkeyProviderOn:"通行密钥提供程序于"}},z1={title:"近期删除",noItems:"没有删除的项目",noItemsDescription:"您删除的项目将在此处停留 30 天，随后永久移除。",description:"这些项目将在 30 天后永久删除。您可以立即还原或永久删除。",restore:"还原",deletePermanently:"永久删除",emptyAll:"全部清空",daysRemaining_one:"剩余 {{count}} 天",daysRemaining_other:"剩余 {{count}} 天",expiringSoon:"即将到期",confirmDeleteTitle:"永久删除吗？",confirmDeleteMessage:"此项目将被永久删除，且无法恢复。",confirmEmptyAllTitle:"清空“近期删除”吗？",confirmEmptyAllMessage:"所有 {{count}} 个项目将被永久删除，且无法恢复。"},V1={title:"升级密码库",subtitle:"AliasVault已更新，您的密码库需要升级，仅需数秒。",versionInformation:"版本信息",yourVault:"您的密码库版本：",newVersion:"新可用版本：",upgrade:"升级密码库",upgrading:"升级中…",whatsNew:"新功能",whatsNewDescription:"需要升级才能支持以下更改：",noDescriptionAvailable:"此版本无可用说明。",alerts:{unableToGetVersionInfo:"无法获取版本信息。请重试。",selfHostedServer:"自托管服务器",selfHostedWarning:"如果您使用的是自托管服务器，请确保同时更新您的自托管实例，否则将无法登录网页客户端。",continueUpgrade:"继续升级",upgradeFailed:"升级失败",failedToApplyMigration:"应用迁移失败（{{current}} / {{total}}）"}},K1={unsyncedChangesTitle:"未同步的更改",unsyncedChangesWarning:"您有更改尚未同步，若您现在退出登录，这些更改将会丢失。您确定要继续吗？",logoutAnyway:"仍要退出登录"},G1={auth:R1,menu:D1,common:B1,content:U1,items:_1,itemTypes:M1,fieldLabels:F1,totp:O1,attachmentUploader:j1,emails:P1,settings:H1,passkeys:Q1,recentlyDeleted:z1,upgrade:V1,logout:K1},vl={de:{translation:ex},en:{translation:Ax},es:{translation:Dx},fi:{translation:Wx},fr:{translation:uT},he:{translation:xT},it:{translation:QT},nl:{translation:rS},pl:{translation:bS},pt:{translation:MS},ro:{translation:$S},ru:{translation:g1},uk:{translation:L1},zh:{translation:G1}},Nl=[{code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪"},{code:"en",name:"English",nativeName:"English",flag:"🇺🇸"},{code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸"},{code:"fi",name:"Finnish",nativeName:"Suomi",flag:"🇫🇮"},{code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷"},{code:"he",name:"Hebrew",nativeName:"עברית",flag:"🇮🇱"},{code:"it",name:"Italian",nativeName:"Italiano",flag:"🇮🇹"},{code:"nl",name:"Dutch",nativeName:"Nederlands",flag:"🇳🇱"},{code:"pl",name:"Polish",nativeName:"Polski",flag:"🇵🇱"},{code:"pt",name:"Portuguese Brazilian",nativeName:"Português Brasileiro",flag:"🇧🇷"},{code:"ro",name:"Romanian",nativeName:"Română",flag:"🇷🇴"},{code:"ru",name:"Russian",nativeName:"Русский",flag:"🇷🇺"},{code:"uk",name:"Ukrainian",nativeName:"Українська",flag:"🇺🇦"},{code:"zh",name:"Chinese",nativeName:"简体中文",flag:"🇨🇳"}],lr="en",Ru=Nl.map(r=>r.code),eu=new Map;async function sy(r){const e=`all:${r}`;if(eu.has(e))return eu.get(e);if(vl[r]){const a=vl[r].translation;return eu.set(e,a),a}if(r!==lr&&vl[lr]){console.warn(`Translations not found for ${r}, falling back to ${lr}`);const a=vl[lr].translation;return eu.set(e,a),a}return console.warn(`No translations found for ${r} and no fallback available`),{}}function q1(r){return Nl.find(e=>e.code===r)}function oy(r,e){return e.split(".").reduce((a,i)=>a&&typeof a=="object"&&a!==null&&i in a?a[i]:void 0,r)}async function W1(){try{const r=await Ce.getItem("local:language");if(r&&Ru.includes(r))return r;const e=navigator.language.split("-")[0],a=Ru.includes(e)?e:lr;return await Ce.setItem("local:language",a),a}catch(r){return console.error("Failed to get current language:",r),lr}}async function Y1(r,e){try{const a=await W1(),i=await sy(a),s=oy(i,r);if(s&&typeof s=="string")return s;if(a!==lr){const c=await sy(lr),d=oy(c,r);if(d&&typeof d=="string")return d}return e||r}catch(a){return console.error("Translation error:",a),e||r}}function J1(r){return r.toISOString().replace("T"," ").replace("Z","").substring(0,23)}function Sf(){return J1(new Date)}class Ol{constructor(e){this.client=e}async withTransaction(e){this.client.beginTransaction();try{const a=await e();return await this.client.commitTransaction(),a}catch(a){throw this.client.rollbackTransaction(),a}}softDelete(e,a){const i=Sf();return this.client.executeUpdate(`UPDATE ${e} SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?`,[i,a])}softDeleteByForeignKey(e,a,i){const s=Sf();return this.client.executeUpdate(`UPDATE ${e} SET IsDeleted = 1, UpdatedAt = ? WHERE ${a} = ?`,[s,i])}hardDelete(e,a){return this.client.executeUpdate(`DELETE FROM ${e} WHERE Id = ?`,[a])}hardDeleteByForeignKey(e,a,i){return this.client.executeUpdate(`DELETE FROM ${e} WHERE ${a} = ?`,[i])}tableExists(e){return this.client.executeQuery("SELECT name FROM sqlite_master WHERE type='table' AND name=?",[e]).length>0}generateId(){return crypto.randomUUID().toUpperCase()}now(){return Sf()}buildInClause(e){return{placeholders:e.map(()=>"?").join(","),values:e}}}var Oa={LoginUsername:"login.username",LoginPassword:"login.password",LoginEmail:"login.email",LoginUrl:"login.url",CardNumber:"card.number",CardCardholderName:"card.cardholder_name",CardExpiryMonth:"card.expiry_month",CardExpiryYear:"card.expiry_year",CardCvv:"card.cvv",CardPin:"card.pin",AliasFirstName:"alias.first_name",AliasLastName:"alias.last_name",AliasGender:"alias.gender",AliasBirthdate:"alias.birthdate",NotesContent:"notes.content"},Xt={Login:"Login",Alias:"Alias",CreditCard:"CreditCard",Note:"Note"},Vt={Text:"Text",Password:"Password",Hidden:"Hidden",Email:"Email",URL:"URL",Date:"Date",Number:"Number",Phone:"Phone",TextArea:"TextArea"},nt={Primary:"Primary",Login:"Login",Alias:"Alias",Card:"Card",Custom:"Custom",Notes:"Notes",Metadata:"Metadata"},Zg={"login.email":{FieldKey:"login.email",FieldType:"Email",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!1},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:nt.Login,DefaultDisplayOrder:10},"login.username":{FieldKey:"login.username",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:nt.Login,DefaultDisplayOrder:15},"login.password":{FieldKey:"login.password",FieldType:"Password",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!0,Category:nt.Login,DefaultDisplayOrder:20},"login.url":{FieldKey:"login.url",FieldType:"URL",IsHidden:!1,IsMultiValue:!0,ApplicableToTypes:{Login:{ShowByDefault:!0},Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Primary,DefaultDisplayOrder:5},"alias.first_name":{FieldKey:"alias.first_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Alias,DefaultDisplayOrder:20},"alias.last_name":{FieldKey:"alias.last_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Alias,DefaultDisplayOrder:30},"alias.gender":{FieldKey:"alias.gender",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Alias,DefaultDisplayOrder:50},"alias.birthdate":{FieldKey:"alias.birthdate",FieldType:"Date",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Alias:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Alias,DefaultDisplayOrder:60},"card.cardholder_name":{FieldKey:"card.cardholder_name",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:10},"card.number":{FieldKey:"card.number",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:20},"card.expiry_month":{FieldKey:"card.expiry_month",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:30},"card.expiry_year":{FieldKey:"card.expiry_year",FieldType:"Text",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:40},"card.cvv":{FieldKey:"card.cvv",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:50},"card.pin":{FieldKey:"card.pin",FieldType:"Hidden",IsHidden:!0,IsMultiValue:!1,ApplicableToTypes:{CreditCard:{ShowByDefault:!1}},EnableHistory:!1,Category:nt.Card,DefaultDisplayOrder:60},"notes.content":{FieldKey:"notes.content",FieldType:"TextArea",IsHidden:!1,IsMultiValue:!1,ApplicableToTypes:{Login:{ShowByDefault:!1},Alias:{ShowByDefault:!1},CreditCard:{ShowByDefault:!1},Note:{ShowByDefault:!0}},EnableHistory:!1,Category:nt.Notes,DefaultDisplayOrder:100}};function ro(r){return Zg[r]}function xl(r,e){return e in r.ApplicableToTypes}function wl(r,e){const a=r.ApplicableToTypes[e];return(a==null?void 0:a.ShowByDefault)??!1}function X1(r){return Object.values(Zg).filter(e=>xl(e,r)).sort((e,a)=>e.DefaultDisplayOrder-a.DefaultDisplayOrder)}function $1(r){return Object.values(Zg).filter(e=>xl(e,r)&&!wl(e,r)).sort((e,a)=>e.DefaultDisplayOrder-a.DefaultDisplayOrder)}function tu(r,e){const a=r.Fields.find(i=>i.FieldKey===e);if(a)return Array.isArray(a.Value)?a.Value[0]:a.Value}function Z1(r,e){const a={};return r.Fields.forEach(i=>{const s=e(i);a[s]||(a[s]=[]),a[s].push(i)}),a}function ek(r){const e=Z1(r,a=>a.FieldKey.startsWith("login.")?nt.Login:a.FieldKey.startsWith("alias.")?nt.Alias:a.FieldKey.startsWith("card.")?nt.Card:a.FieldKey.startsWith("notes.")?nt.Notes:a.FieldKey.startsWith("metadata.")?nt.Metadata:nt.Custom);for(const a of Object.keys(e))e[a].sort((i,s)=>(i.DisplayOrder??0)-(s.DisplayOrder??0));return e}function au(r,e){const a=ro(r);if(!a)throw new Error(`Unknown system field: ${r}. Use createCustomField for custom fields.`);return{FieldKey:r,Label:e.label??r,FieldType:a.FieldType,Value:e.value,IsHidden:a.IsHidden,DisplayOrder:e.displayOrder??a.DefaultDisplayOrder,IsCustomField:!1,EnableHistory:a.EnableHistory}}var kf=10;class Lf{static processFieldRows(e){const a=e.map(c=>this.processFieldRow(c)),i=new Map,s=new Map;for(const c of a){const d=`${c.ItemId}_${c.FieldKey}`;s.has(d)||s.set(d,[]),s.get(d).push(c.Value),i.has(c.ItemId)||i.set(c.ItemId,[]);const m=i.get(c.ItemId);m.find(f=>f.FieldKey===c.FieldKey)||m.push({FieldKey:c.FieldKey,Label:c.Label,FieldType:c.FieldType,Value:"",IsHidden:c.IsHidden===1,DisplayOrder:c.DisplayOrder,IsCustomField:c.IsCustomField,EnableHistory:c.EnableHistory})}for(const[c,d]of i)for(const m of d){const g=`${c}_${m.FieldKey}`,f=s.get(g)||[];f.length===1?m.Value=f[0]:m.Value=f}return i}static processFieldRow(e){if(e.FieldKey){const a=ro(e.FieldKey);return{ItemId:e.ItemId,FieldKey:e.FieldKey,Label:e.FieldKey,FieldType:(a==null?void 0:a.FieldType)||Vt.Text,IsHidden:a!=null&&a.IsHidden?1:0,Value:e.Value,DisplayOrder:(a==null?void 0:a.DefaultDisplayOrder)??e.DisplayOrder,IsCustomField:!1,EnableHistory:(a==null?void 0:a.EnableHistory)??!1}}else return{ItemId:e.ItemId,FieldKey:e.FieldDefinitionId||"",Label:e.CustomLabel||"",FieldType:e.CustomFieldType||Vt.Text,IsHidden:e.CustomIsHidden||0,Value:e.Value,DisplayOrder:e.DisplayOrder,IsCustomField:!0,EnableHistory:e.CustomEnableHistory===1}}static processFieldRowsForSingleItem(e){const a=new Map,i=new Map;for(const s of e){const c=s.FieldKey||s.FieldDefinitionId||"";if(a.has(c)||a.set(c,[]),a.get(c).push(s.Value),!i.has(c))if(s.FieldKey){const d=ro(s.FieldKey);i.set(c,{FieldKey:s.FieldKey,Label:s.FieldKey,FieldType:(d==null?void 0:d.FieldType)||Vt.Text,IsHidden:d!=null&&d.IsHidden?1:0,DisplayOrder:(d==null?void 0:d.DefaultDisplayOrder)??s.DisplayOrder,IsCustomField:!1,EnableHistory:(d==null?void 0:d.EnableHistory)??!1})}else i.set(c,{FieldKey:c,Label:s.CustomLabel||"",FieldType:s.CustomFieldType||Vt.Text,IsHidden:s.CustomIsHidden||0,DisplayOrder:s.DisplayOrder,IsCustomField:!0,EnableHistory:s.CustomEnableHistory===1})}return Array.from(i.entries()).map(([s,c])=>{const d=a.get(s)||[];return{...c,FieldType:c.FieldType,Value:d.length===1?d[0]:d,IsHidden:c.IsHidden===1,IsCustomField:c.IsCustomField,EnableHistory:c.EnableHistory}})}}class gl{static mapRow(e,a=[],i=[]){return{Id:e.Id,Name:e.Name,ItemType:e.ItemType,Logo:e.Logo??void 0,FolderId:e.FolderId,FolderPath:e.FolderPath||null,Tags:i,Fields:a,HasPasskey:e.HasPasskey===1,HasAttachment:e.HasAttachment===1,HasTotp:e.HasTotp===1,CreatedAt:e.CreatedAt,UpdatedAt:e.UpdatedAt}}static mapRows(e,a,i){return e.map(s=>this.mapRow(s,a.get(s.Id)||[],i.get(s.Id)||[]))}static groupTagsByItem(e){const a=new Map;for(const i of e)a.has(i.ItemId)||a.set(i.ItemId,[]),a.get(i.ItemId).push({Id:i.Id,Name:i.Name,Color:i.Color||void 0});return a}static mapTagRows(e){return e.map(a=>({Id:a.Id,Name:a.Name,Color:a.Color||void 0}))}static mapDeletedItemRow(e,a=[]){return{Id:e.Id,Name:e.Name,ItemType:e.ItemType,Logo:e.Logo?new Uint8Array(e.Logo):void 0,FolderId:e.FolderId,FolderPath:e.FolderPath,DeletedAt:e.DeletedAt,HasPasskey:e.HasPasskey===1,HasAttachment:e.HasAttachment===1,HasTotp:e.HasTotp===1,Fields:a,CreatedAt:e.CreatedAt,UpdatedAt:e.UpdatedAt}}}function ly(r){return new Date(r).getTime()}class Rf{static mapRow(e){return{Id:e.Id,ItemId:e.ItemId,RpId:e.RpId,UserHandle:e.UserHandle??void 0,PublicKey:e.PublicKey,PrivateKey:e.PrivateKey,DisplayName:e.DisplayName,PrfKey:e.PrfKey??void 0,AdditionalData:e.AdditionalData,CreatedAt:ly(e.CreatedAt),UpdatedAt:ly(e.UpdatedAt),IsDeleted:e.IsDeleted}}static mapRowWithItem(e){return{...this.mapRow(e),Username:e.Username,ServiceName:e.ServiceName}}static mapRows(e){return e.map(a=>this.mapRow(a))}static mapRowsWithItem(e){return e.map(a=>this.mapRowWithItem(a))}}const va=class va{static getFieldValuesForItems(e){return`
      SELECT
        fv.ItemId,
        fv.FieldKey,
        fv.FieldDefinitionId,
        fd.Label as CustomLabel,
        fd.FieldType as CustomFieldType,
        fd.IsHidden as CustomIsHidden,
        fd.EnableHistory as CustomEnableHistory,
        fv.Value,
        fv.Weight as DisplayOrder
      FROM FieldValues fv
      LEFT JOIN FieldDefinitions fd ON fv.FieldDefinitionId = fd.Id
      WHERE fv.ItemId IN (${Array(e).fill("?").join(",")})
        AND fv.IsDeleted = 0
      ORDER BY fv.ItemId, fv.Weight`}static getTagsForItems(e){return`
      SELECT
        it.ItemId,
        t.Id,
        t.Name,
        t.Color
      FROM ItemTags it
      INNER JOIN Tags t ON it.TagId = t.Id
      WHERE it.ItemId IN (${Array(e).fill("?").join(",")})
        AND it.IsDeleted = 0
        AND t.IsDeleted = 0
      ORDER BY t.DisplayOrder, t.Name`}};Fe(va,"BASE_SELECT",`
    SELECT DISTINCT
      i.Id,
      i.Name,
      i.ItemType,
      i.FolderId,
      f.Name as FolderPath,
      l.FileData as Logo,
      CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
      CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
      CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
      i.CreatedAt,
      i.UpdatedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    LEFT JOIN Folders f ON i.FolderId = f.Id`),Fe(va,"GET_ALL_ACTIVE",`
    ${va.BASE_SELECT}
    WHERE i.IsDeleted = 0 AND i.DeletedAt IS NULL
    ORDER BY i.CreatedAt DESC`),Fe(va,"GET_BY_ID",`
    SELECT
      i.Id,
      i.Name,
      i.ItemType,
      i.FolderId,
      l.FileData as Logo,
      CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
      CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
      CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
      i.CreatedAt,
      i.UpdatedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    WHERE i.Id = ? AND i.IsDeleted = 0`),Fe(va,"GET_RECENTLY_DELETED",`
    ${va.BASE_SELECT},
      i.DeletedAt
    FROM Items i
    LEFT JOIN Logos l ON i.LogoId = l.Id
    LEFT JOIN Folders f ON i.FolderId = f.Id
    WHERE i.IsDeleted = 0 AND i.DeletedAt IS NOT NULL
    ORDER BY i.DeletedAt DESC`),Fe(va,"COUNT_RECENTLY_DELETED",`
    SELECT COUNT(*) as count
    FROM Items
    WHERE IsDeleted = 0 AND DeletedAt IS NOT NULL`),Fe(va,"GET_FIELD_VALUES_FOR_ITEM",`
    SELECT
      fv.FieldKey,
      fv.FieldDefinitionId,
      fd.Label as CustomLabel,
      fd.FieldType as CustomFieldType,
      fd.IsHidden as CustomIsHidden,
      fd.EnableHistory as CustomEnableHistory,
      fv.Value,
      fv.Weight as DisplayOrder
    FROM FieldValues fv
    LEFT JOIN FieldDefinitions fd ON fv.FieldDefinitionId = fd.Id
    WHERE fv.ItemId = ? AND fv.IsDeleted = 0
    ORDER BY fv.Weight`),Fe(va,"GET_TAGS_FOR_ITEM",`
    SELECT
      t.Id,
      t.Name,
      t.Color
    FROM ItemTags it
    INNER JOIN Tags t ON it.TagId = t.Id
    WHERE it.ItemId = ? AND it.IsDeleted = 0 AND t.IsDeleted = 0
    ORDER BY t.DisplayOrder, t.Name`),Fe(va,"INSERT_ITEM",`
    INSERT INTO Items (Id, Name, ItemType, LogoId, FolderId, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),Fe(va,"UPDATE_ITEM",`
    UPDATE Items
    SET Name = ?,
        ItemType = ?,
        FolderId = ?,
        LogoId = COALESCE(?, LogoId),
        UpdatedAt = ?
    WHERE Id = ?`),Fe(va,"UPDATE_ITEM_WITH_LOGO",`
    UPDATE Items
    SET Name = ?,
        ItemType = ?,
        FolderId = ?,
        LogoId = ?,
        UpdatedAt = ?
    WHERE Id = ?`),Fe(va,"TRASH_ITEM",`
    UPDATE Items
    SET DeletedAt = ?,
        UpdatedAt = ?
    WHERE Id = ? AND IsDeleted = 0`),Fe(va,"RESTORE_ITEM",`
    UPDATE Items
    SET DeletedAt = NULL,
        UpdatedAt = ?
    WHERE Id = ? AND IsDeleted = 0 AND DeletedAt IS NOT NULL`),Fe(va,"TOMBSTONE_ITEM",`
    UPDATE Items
    SET IsDeleted = 1,
        Name = NULL,
        LogoId = NULL,
        FolderId = NULL,
        UpdatedAt = ?
    WHERE Id = ?`),Fe(va,"GET_LOGO_ID",`
    SELECT LogoId FROM Items WHERE Id = ?`),Fe(va,"GET_ALL_EMAIL_ADDRESSES",`
    SELECT DISTINCT fv.Value as Email
    FROM FieldValues fv
    INNER JOIN Items i ON fv.ItemId = i.Id
    WHERE fv.FieldKey = ?
      AND fv.Value IS NOT NULL
      AND fv.Value != ''
      AND fv.IsDeleted = 0
      AND i.IsDeleted = 0`);let Ma=va;class Hn{}Fe(Hn,"GET_EXISTING_FOR_ITEM",`
    SELECT Id, FieldKey, FieldDefinitionId, Value
    FROM FieldValues
    WHERE ItemId = ? AND IsDeleted = 0`),Fe(Hn,"INSERT",`
    INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`),Fe(Hn,"UPDATE",`
    UPDATE FieldValues
    SET Value = ?,
        Weight = ?,
        UpdatedAt = ?
    WHERE Id = ?`),Fe(Hn,"SOFT_DELETE",`
    UPDATE FieldValues
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`),Fe(Hn,"GET_FOR_HISTORY",`
    SELECT FieldKey, Value
    FROM FieldValues
    WHERE ItemId = ? AND IsDeleted = 0 AND FieldKey IS NOT NULL`);class Fr{}Fe(Fr,"EXISTS",`
    SELECT Id FROM FieldDefinitions WHERE Id = ?`),Fe(Fr,"EXISTS_ACTIVE",`
    SELECT Id FROM FieldDefinitions WHERE Id = ? AND IsDeleted = 0`),Fe(Fr,"INSERT",`
    INSERT INTO FieldDefinitions (Id, FieldType, Label, IsMultiValue, IsHidden, EnableHistory, Weight, ApplicableToTypes, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`),Fe(Fr,"UPDATE",`
    UPDATE FieldDefinitions
    SET Label = ?,
        FieldType = ?,
        IsHidden = ?,
        Weight = ?,
        UpdatedAt = ?
    WHERE Id = ?`);class sr{static softDeleteOld(e){return`
      UPDATE FieldHistories
      SET IsDeleted = 1, UpdatedAt = ?
      WHERE Id IN (${Array(e).fill("?").join(",")})`}}Fe(sr,"INSERT",`
    INSERT INTO FieldHistories (Id, ItemId, FieldDefinitionId, FieldKey, ValueSnapshot, ChangedAt, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`),Fe(sr,"GET_FOR_FIELD",`
    SELECT
      Id,
      ItemId,
      FieldKey,
      ValueSnapshot,
      ChangedAt,
      CreatedAt,
      UpdatedAt
    FROM FieldHistories
    WHERE ItemId = ? AND FieldKey = ? AND IsDeleted = 0
    ORDER BY ChangedAt DESC
    LIMIT ?`),Fe(sr,"GET_FOR_PRUNING",`
    SELECT Id, ChangedAt
    FROM FieldHistories
    WHERE ItemId = ? AND FieldKey = ? AND IsDeleted = 0
    ORDER BY ChangedAt DESC`),Fe(sr,"SOFT_DELETE",`
    UPDATE FieldHistories
    SET IsDeleted = 1, UpdatedAt = ?
    WHERE Id = ?`);class tk extends Ol{constructor(e,a){super(e),this.logoRepository=a}getAll(){let e;try{e=this.client.executeQuery(Ma.GET_ALL_ACTIVE)}catch(m){if(m instanceof Error&&m.message.includes("no such table"))return[];throw m}if(e.length===0)return[];const a=e.map(m=>m.Id),i=this.client.executeQuery(Ma.getFieldValuesForItems(a.length),a),s=Lf.processFieldRows(i),c=this.client.executeQuery(Ma.getTagsForItems(a.length),a),d=gl.groupTagsByItem(c);return gl.mapRows(e,s,d)}getById(e){const a=this.client.executeQuery(Ma.GET_BY_ID,[e]);if(a.length===0)return null;const i=this.client.executeQuery(Ma.GET_FIELD_VALUES_FOR_ITEM,[e]),s=Lf.processFieldRowsForSingleItem(i),c=this.client.executeQuery(Ma.GET_TAGS_FOR_ITEM,[e]),d=gl.mapTagRows(c);return gl.mapRow(a[0],s,d)}getAllEmailAddresses(){return this.client.executeQuery(Ma.GET_ALL_EMAIL_ADDRESSES,[Oa.LoginEmail]).map(a=>a.Email)}async create(e,a=[],i=[]){return this.withTransaction(async()=>{const s=this.now(),c=e.Id||this.generateId(),d=this.resolveLogoId(e,s);return this.client.executeUpdate(Ma.INSERT_ITEM,[c,e.Name??null,e.ItemType,d,e.FolderId??null,s,s,0]),e.Fields&&e.Fields.length>0&&this.insertFieldValues(c,e.Fields,e.ItemType,s),this.insertTotpCodes(c,i,s),this.insertAttachments(c,a,s),c})}async update(e,a=[],i=[],s=[],c=[]){return this.withTransaction(async()=>{const d=this.now(),m=this.resolveLogoId(e,d),g=this.client.executeQuery("SELECT Name, ItemType, FolderId, LogoId FROM Items WHERE Id = ?",[e.Id])[0];if(g){const f=(e.Name??null)!==g.Name,E=String(e.ItemType)!==String(g.ItemType),p=(e.FolderId??null)!==g.FolderId,C=m!==g.LogoId;(f||E||p||C)&&this.client.executeUpdate(Ma.UPDATE_ITEM_WITH_LOGO,[e.Name??null,e.ItemType,e.FolderId??null,m,d,e.Id])}return await this.trackFieldHistory(e.Id,e.Fields,d),this.updateFieldValues(e,d),this.handleTotpCodes(e.Id,c,s,d),this.handleAttachments(e.Id,i,a,d),1})}async trash(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(Ma.TRASH_ITEM,[a,a,e])})}async restore(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(Ma.RESTORE_ITEM,[a,e])})}async permanentlyDelete(e){return this.withTransaction(async()=>{const a=this.now(),i=this.client.executeQuery(Ma.GET_LOGO_ID,[e]),s=i.length>0?i[0].LogoId:null;this.hardDeleteByForeignKey("FieldValues","ItemId",e),this.hardDeleteByForeignKey("FieldHistories","ItemId",e),this.hardDeleteByForeignKey("Passkeys","ItemId",e),this.hardDeleteByForeignKey("TotpCodes","ItemId",e),this.hardDeleteByForeignKey("Attachments","ItemId",e),this.hardDeleteByForeignKey("ItemTags","ItemId",e);const c=this.client.executeUpdate(Ma.TOMBSTONE_ITEM,[a,e]);return s&&this.logoRepository.cleanupOrphanedLogo(s),c})}getRecentlyDeleted(){let e;try{e=this.client.executeQuery(`
        SELECT DISTINCT
          i.Id,
          i.Name,
          i.ItemType,
          i.FolderId,
          f.Name as FolderPath,
          l.FileData as Logo,
          i.DeletedAt,
          CASE WHEN EXISTS (SELECT 1 FROM Passkeys pk WHERE pk.ItemId = i.Id AND pk.IsDeleted = 0) THEN 1 ELSE 0 END as HasPasskey,
          CASE WHEN EXISTS (SELECT 1 FROM Attachments att WHERE att.ItemId = i.Id AND att.IsDeleted = 0) THEN 1 ELSE 0 END as HasAttachment,
          CASE WHEN EXISTS (SELECT 1 FROM TotpCodes tc WHERE tc.ItemId = i.Id AND tc.IsDeleted = 0) THEN 1 ELSE 0 END as HasTotp,
          i.CreatedAt,
          i.UpdatedAt
        FROM Items i
        LEFT JOIN Logos l ON i.LogoId = l.Id
        LEFT JOIN Folders f ON i.FolderId = f.Id
        WHERE i.IsDeleted = 0 AND i.DeletedAt IS NOT NULL
        ORDER BY i.DeletedAt DESC`)}catch(c){if(c instanceof Error&&c.message.includes("no such table"))return[];throw c}if(e.length===0)return[];const a=e.map(c=>c.Id),i=this.client.executeQuery(Ma.getFieldValuesForItems(a.length),a),s=Lf.processFieldRows(i);return e.map(c=>gl.mapDeletedItemRow(c,s.get(c.Id)||[]))}getRecentlyDeletedCount(){var e;try{return((e=this.client.executeQuery(Ma.COUNT_RECENTLY_DELETED)[0])==null?void 0:e.count)||0}catch(a){if(a instanceof Error&&a.message.includes("no such table"))return 0;throw a}}getFieldHistory(e,a){return this.client.executeQuery(sr.GET_FOR_FIELD,[e,a,kf]).map(s=>({Id:s.Id,ItemId:s.ItemId,FieldKey:s.FieldKey,ValueSnapshot:s.ValueSnapshot,ChangedAt:s.ChangedAt,CreatedAt:s.CreatedAt,UpdatedAt:s.UpdatedAt}))}async deleteFieldHistory(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(sr.SOFT_DELETE,[a,e])})}resolveLogoId(e,a){var m;const i=(m=e.Fields)==null?void 0:m.find(g=>g.FieldKey==="login.url"),s=i==null?void 0:i.Value,c=Array.isArray(s)?s[0]:s,d=this.logoRepository.extractSourceFromUrl(c);if(e.Logo){const g=this.logoRepository.convertLogoToUint8Array(e.Logo);if(g)return this.logoRepository.getOrCreate(d,g,a)}else if(d!=="unknown")return this.logoRepository.getIdForSource(d);return null}insertFieldValues(e,a,i,s){for(const c of a){if((!c.Value||typeof c.Value=="string"&&c.Value.trim()==="")&&!c.IsCustomField)continue;let m=null;c.IsCustomField&&(m=this.ensureFieldDefinition(c,i,s));const f=(Array.isArray(c.Value)?c.Value:[c.Value]).filter(p=>p&&p.trim()!==""),E=c.IsCustomField&&f.length===0?[""]:f;for(const p of E)this.client.executeUpdate(Hn.INSERT,[this.generateId(),e,m,c.IsCustomField?null:c.FieldKey,p,c.DisplayOrder??0,s,s,0]);if(c.EnableHistory&&f.length>0){const p=this.generateId(),C=JSON.stringify(f);this.client.executeUpdate(sr.INSERT,[p,e,null,c.FieldKey,C,s,s,s,0])}}}ensureFieldDefinition(e,a,i){return this.client.executeQuery(Fr.EXISTS,[e.FieldKey]).length===0&&this.client.executeUpdate(Fr.INSERT,[e.FieldKey,e.FieldType,e.Label,0,e.IsHidden?1:0,0,e.DisplayOrder??0,a,i,i,0]),e.FieldKey}updateFieldValues(e,a){const i=this.client.executeQuery(Hn.GET_EXISTING_FOR_ITEM,[e.Id]),s=new Map,c=new Map;for(const m of i){const g=m.FieldKey||m.FieldDefinitionId||"",f=c.get(g)||0;s.set(`${g}:${f}`,{Id:m.Id,Value:m.Value}),c.set(g,f+1)}const d=new Set;if(e.Fields&&e.Fields.length>0)for(const m of e.Fields){if((!m.Value||typeof m.Value=="string"&&m.Value.trim()==="")&&!m.IsCustomField)continue;let f=null;m.IsCustomField&&(f=this.ensureOrUpdateFieldDefinition(m,e.ItemType,a));const E=Array.isArray(m.Value)?m.Value:[m.Value],p=m.FieldKey,C=E.filter(x=>x&&(typeof x!="string"||x.trim()!=="")),I=m.IsCustomField&&C.length===0?[""]:C;for(let x=0;x<I.length;x++){const T=I[x],k=`${p}:${x}`,R=s.get(k);R?(d.add(R.Id),R.Value!==T&&this.client.executeUpdate(Hn.UPDATE,[T,m.DisplayOrder??0,a,R.Id])):this.client.executeUpdate(Hn.INSERT,[this.generateId(),e.Id,f,m.IsCustomField?null:m.FieldKey,T,m.DisplayOrder??0,a,a,0])}}for(const m of i)d.has(m.Id)||this.client.executeUpdate(Hn.SOFT_DELETE,[a,m.Id])}ensureOrUpdateFieldDefinition(e,a,i){return this.client.executeQuery(Fr.EXISTS_ACTIVE,[e.FieldKey]).length===0?this.client.executeUpdate(Fr.INSERT,[e.FieldKey,e.FieldType,e.Label,0,e.IsHidden?1:0,0,e.DisplayOrder??0,a,i,i,0]):this.client.executeUpdate(Fr.UPDATE,[e.Label,e.FieldType,e.IsHidden?1:0,e.DisplayOrder??0,i,e.FieldKey]),e.FieldKey}async trackFieldHistory(e,a,i){const s=this.client.executeQuery(Hn.GET_FOR_HISTORY,[e]),c={};for(const d of s)c[d.FieldKey]||(c[d.FieldKey]=[]),c[d.FieldKey].push(d.Value);for(const d of a){if(!d.EnableHistory)continue;const m=c[d.FieldKey]||[],f=(Array.isArray(d.Value)?d.Value:[d.Value]).filter(p=>p&&p.trim()!=="");if((m.length!==f.length||!m.every((p,C)=>p===f[C]))&&f.length>0){const p=this.generateId(),C=JSON.stringify(f);this.client.executeUpdate(sr.INSERT,[p,e,null,d.FieldKey,C,i,i,i,0]),await this.pruneFieldHistory(e,d.FieldKey,i)}}}async pruneFieldHistory(e,a,i){const s=this.client.executeQuery(sr.GET_FOR_PRUNING,[e,a]);if(s.length>kf){const d=s.slice(kf).map(m=>m.Id);d.length>0&&this.client.executeUpdate(sr.softDeleteOld(d.length),[i,...d])}}insertTotpCodes(e,a,i){for(const s of a)this.client.executeUpdate(`INSERT INTO TotpCodes (Id, Name, SecretKey, ItemId, CreatedAt, UpdatedAt, IsDeleted)
         VALUES (?, ?, ?, ?, ?, ?, ?)`,[s.Id||this.generateId(),s.Name,s.SecretKey,e,i,i,0])}handleTotpCodes(e,a,i,s){const c=this.client.executeQuery("SELECT Id, Name, SecretKey FROM TotpCodes WHERE ItemId = ? AND IsDeleted = 0",[e]),d=new Map(c.map(m=>[m.Id,m]));for(const m of a){const g=i.includes(m.Id);if(m.IsDeleted)g&&this.client.executeUpdate("UPDATE TotpCodes SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,m.Id]);else if(g){const f=d.get(m.Id);f&&(f.Name!==m.Name||f.SecretKey!==m.SecretKey)&&this.client.executeUpdate("UPDATE TotpCodes SET Name = ?, SecretKey = ?, UpdatedAt = ? WHERE Id = ?",[m.Name,m.SecretKey,s,m.Id])}else this.client.executeUpdate(`INSERT INTO TotpCodes (Id, Name, SecretKey, ItemId, CreatedAt, UpdatedAt, IsDeleted)
           VALUES (?, ?, ?, ?, ?, ?, ?)`,[m.Id||this.generateId(),m.Name,m.SecretKey,e,s,s,0])}}insertAttachments(e,a,i){for(const s of a){const c=s.Blob instanceof Uint8Array?s.Blob:new Uint8Array(s.Blob);this.client.executeUpdate(`INSERT INTO Attachments (Id, Filename, Blob, ItemId, CreatedAt, UpdatedAt, IsDeleted)
         VALUES (?, ?, ?, ?, ?, ?, ?)`,[s.Id||this.generateId(),s.Filename,c,e,i,i,0])}}handleAttachments(e,a,i,s){const c=new Set(a.map(d=>d.Id));for(const d of i)c.has(d)||this.client.executeUpdate("UPDATE Attachments SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,d]);for(const d of a){const m=i.includes(d.Id);if(d.IsDeleted)m&&this.client.executeUpdate("UPDATE Attachments SET IsDeleted = 1, UpdatedAt = ? WHERE Id = ?",[s,d.Id]);else if(!m){const g=d.Blob instanceof Uint8Array?d.Blob:new Uint8Array(d.Blob);this.client.executeUpdate(`INSERT INTO Attachments (Id, Filename, Blob, ItemId, CreatedAt, UpdatedAt, IsDeleted)
           VALUES (?, ?, ?, ?, ?, ?, ?)`,[d.Id||this.generateId(),d.Filename,g,e,s,s,0])}}}}const es={GET_BY_RP_ID:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted,
      i.Name as ServiceName,
      (SELECT fv.Value FROM FieldValues fv WHERE fv.ItemId = i.Id AND fv.FieldKey = '${Oa.LoginUsername}' AND fv.IsDeleted = 0 LIMIT 1) as Username
    FROM Passkeys p
    INNER JOIN Items i ON p.ItemId = i.Id
    WHERE p.RpId = ? AND p.IsDeleted = 0
      AND i.IsDeleted = 0 AND i.DeletedAt IS NULL
    ORDER BY p.CreatedAt DESC`,GET_BY_ID_WITH_ITEM:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted,
      i.Name as ServiceName,
      (SELECT fv.Value FROM FieldValues fv WHERE fv.ItemId = i.Id AND fv.FieldKey = '${Oa.LoginUsername}' AND fv.IsDeleted = 0 LIMIT 1) as Username
    FROM Passkeys p
    INNER JOIN Items i ON p.ItemId = i.Id
    WHERE p.Id = ? AND p.IsDeleted = 0
      AND i.IsDeleted = 0 AND i.DeletedAt IS NULL`,GET_BY_ITEM_ID:`
    SELECT
      p.Id,
      p.ItemId,
      p.RpId,
      p.UserHandle,
      p.PublicKey,
      p.PrivateKey,
      p.DisplayName,
      p.PrfKey,
      p.AdditionalData,
      p.CreatedAt,
      p.UpdatedAt,
      p.IsDeleted
    FROM Passkeys p
    WHERE p.ItemId = ? AND p.IsDeleted = 0
    ORDER BY p.CreatedAt DESC`,INSERT:`
    INSERT INTO Passkeys (
      Id, ItemId, RpId, UserHandle, PublicKey, PrivateKey,
      PrfKey, DisplayName, AdditionalData, CreatedAt, UpdatedAt, IsDeleted
    )
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,UPDATE_DISPLAY_NAME:`
    UPDATE Passkeys
    SET DisplayName = ?,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE:`
    UPDATE Passkeys
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE_BY_ITEM:`
    UPDATE Passkeys
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE ItemId = ?`};class ak extends Ol{getByRpId(e){const a=this.client.executeQuery(es.GET_BY_RP_ID,[e]);return Rf.mapRowsWithItem(a)}getById(e){const a=this.client.executeQuery(es.GET_BY_ID_WITH_ITEM,[e]);return a.length===0?null:Rf.mapRowWithItem(a[0])}getByItemId(e){const a=this.client.executeQuery(es.GET_BY_ITEM_ID,[e]);return Rf.mapRows(a)}async create(e){return this.withTransaction(async()=>{const a=this.now();let i=null;e.PrfKey&&(i=e.PrfKey instanceof Uint8Array?e.PrfKey:new Uint8Array(e.PrfKey));let s=null;e.UserHandle&&(s=e.UserHandle instanceof Uint8Array?e.UserHandle:new Uint8Array(e.UserHandle)),this.client.executeUpdate(es.INSERT,[e.Id,e.ItemId,e.RpId,s,e.PublicKey,e.PrivateKey,i,e.DisplayName,e.AdditionalData??null,a,a,0])})}async deleteById(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(es.SOFT_DELETE,[a,e])})}async deleteByItemId(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(es.SOFT_DELETE_BY_ITEM,[a,e])})}async updateDisplayName(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate(es.UPDATE_DISPLAY_NAME,[a,i,e])})}}const Br={GET_ALL:`
    SELECT Id, Name, ParentFolderId, Weight
    FROM Folders
    WHERE IsDeleted = 0
    ORDER BY Weight, Name`,GET_BY_ID:`
    SELECT Id, Name, ParentFolderId
    FROM Folders
    WHERE Id = ? AND IsDeleted = 0`,INSERT:`
    INSERT INTO Folders (Id, Name, ParentFolderId, Weight, IsDeleted, CreatedAt, UpdatedAt)
    VALUES (?, ?, ?, 0, 0, ?, ?)`,UPDATE_NAME:`
    UPDATE Folders
    SET Name = ?,
        UpdatedAt = ?
    WHERE Id = ?`,SOFT_DELETE:`
    UPDATE Folders
    SET IsDeleted = 1,
        UpdatedAt = ?
    WHERE Id = ?`,CLEAR_ITEMS_FOLDER:`
    UPDATE Items
    SET FolderId = NULL,
        UpdatedAt = ?
    WHERE FolderId = ?`,TRASH_ITEMS_IN_FOLDER:`
    UPDATE Items
    SET DeletedAt = ?,
        UpdatedAt = ?,
        FolderId = NULL
    WHERE FolderId = ? AND IsDeleted = 0 AND DeletedAt IS NULL`,MOVE_ITEM:`
    UPDATE Items
    SET FolderId = ?,
        UpdatedAt = ?
    WHERE Id = ?`};class nk extends Ol{async create(e,a){return this.withTransaction(async()=>{const i=crypto.randomUUID().toUpperCase(),s=this.now();return this.client.executeUpdate(Br.INSERT,[i,e,a||null,s,s]),i})}getAll(){try{return this.client.executeQuery(Br.GET_ALL)}catch(e){if(e instanceof Error&&e.message.includes("no such table"))return[];throw e}}getById(e){const a=this.client.executeQuery(Br.GET_BY_ID,[e]);return a.length>0?a[0]:null}async update(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate(Br.UPDATE_NAME,[a,i,e])})}async delete(e){return this.withTransaction(async()=>{const a=this.now();return this.client.executeUpdate(Br.CLEAR_ITEMS_FOLDER,[a,e]),this.client.executeUpdate(Br.SOFT_DELETE,[a,e])})}async deleteWithContents(e){return this.withTransaction(async()=>{const a=this.now(),i=this.client.executeUpdate(Br.TRASH_ITEMS_IN_FOLDER,[a,a,e]);return this.client.executeUpdate(Br.SOFT_DELETE,[a,e]),i})}async moveItem(e,a){return this.withTransaction(async()=>{const i=this.now();return this.client.executeUpdate(Br.MOVE_ITEM,[a,i,e])})}}const nu={GET_SETTING:`
    SELECT s.Value
    FROM Settings s
    WHERE s.Key = ?`,GET_ENCRYPTION_KEYS:`
    SELECT
      x.PublicKey,
      x.PrivateKey,
      x.IsPrimary
    FROM EncryptionKeys x`,GET_TOTP_FOR_ITEM:`
    SELECT
      Id,
      Name,
      SecretKey,
      ItemId
    FROM TotpCodes
    WHERE ItemId = ? AND IsDeleted = 0`,GET_ATTACHMENTS_FOR_ITEM:`
    SELECT
      Id,
      Filename,
      Blob,
      ItemId,
      CreatedAt,
      UpdatedAt,
      IsDeleted
    FROM Attachments
    WHERE ItemId = ? AND IsDeleted = 0`};class rk extends Ol{getSetting(e,a=""){const i=this.client.executeQuery(nu.GET_SETTING,[e]);return i.length>0?i[0].Value:a}getDefaultIdentityLanguage(){return this.getSetting("DefaultIdentityLanguage")}getDefaultIdentityGender(){return this.getSetting("DefaultIdentityGender","random")}getDefaultIdentityAgeRange(){return this.getSetting("DefaultIdentityAgeRange","random")}getPasswordSettings(){const e=this.getSetting("PasswordGenerationSettings"),a={Length:18,UseLowercase:!0,UseUppercase:!0,UseNumbers:!0,UseSpecialChars:!0,UseNonAmbiguousChars:!1};try{if(e)return{...a,...JSON.parse(e)}}catch(i){console.warn("Failed to parse password settings:",i)}return a}getAllEncryptionKeys(){return this.client.executeQuery(nu.GET_ENCRYPTION_KEYS)}getTotpCodesForItem(e){try{return this.tableExists("TotpCodes")?this.client.executeQuery(nu.GET_TOTP_FOR_ITEM,[e]):[]}catch(a){return console.error("Error getting TOTP codes for item:",a),[]}}getAttachmentsForItem(e){try{return this.tableExists("Attachments")?this.client.executeQuery(nu.GET_ATTACHMENTS_FOR_ITEM,[e]):[]}catch(a){return console.error("Error getting attachments for item:",a),[]}}getDefaultEmailDomain(){return this.getSetting("DefaultEmailDomain")}getEffectiveIdentityLanguage(){const e=this.getDefaultIdentityLanguage();return e||navigator.language.substring(0,2)}}const hl={GET_ID_FOR_SOURCE:`
    SELECT Id FROM Logos
    WHERE Source = ? AND IsDeleted = 0
    LIMIT 1`,INSERT:`
    INSERT INTO Logos (Id, Source, FileData, CreatedAt, UpdatedAt, IsDeleted)
    VALUES (?, ?, ?, ?, ?, ?)`,COUNT_USAGE:`
    SELECT COUNT(*) as count FROM Items
    WHERE LogoId = ? AND IsDeleted = 0`,HARD_DELETE:`
    DELETE FROM Logos WHERE Id = ?`};class ik extends Ol{hasLogoForSource(e){return this.client.executeQuery(hl.GET_ID_FOR_SOURCE,[e]).length>0}getIdForSource(e){const a=this.client.executeQuery(hl.GET_ID_FOR_SOURCE,[e]);return a.length>0?a[0].Id:null}getOrCreate(e,a,i){const s=this.getIdForSource(e);if(s)return s;const c=this.generateId();return this.client.executeUpdate(hl.INSERT,[c,e,a,i,i,0]),c}cleanupOrphanedLogo(e){const a=this.client.executeQuery(hl.COUNT_USAGE,[e]);(a.length>0?a[0].count:0)===0&&(this.client.executeUpdate(hl.HARD_DELETE,[e]),console.debug(`[LogoRepository] Deleted orphaned logo: ${e}`))}extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}convertLogoToUint8Array(e){if(!e)return null;try{if(typeof e=="object"&&!ArrayBuffer.isView(e)&&!Array.isArray(e)){const a=Object.values(e);return new Uint8Array(a)}if(Array.isArray(e)||e instanceof ArrayBuffer||e instanceof Uint8Array)return new Uint8Array(e)}catch(a){console.warn("Failed to convert logo to Uint8Array:",a)}return null}}class Tg{constructor(){Fe(this,"db",null);Fe(this,"isInTransaction",!1);Fe(this,"_items",null);Fe(this,"_passkeys",null);Fe(this,"_folders",null);Fe(this,"_settings",null);Fe(this,"_logos",null)}get items(){return this._items||(this._items=new tk(this,this.logos)),this._items}get passkeys(){return this._passkeys||(this._passkeys=new ak(this)),this._passkeys}get folders(){return this._folders||(this._folders=new nk(this)),this._folders}get settings(){return this._settings||(this._settings=new rk(this)),this._settings}get logos(){return this._logos||(this._logos=new ik(this)),this._logos}getDb(){return this.db}async initializeFromBase64(e){try{const a=atob(e),i=new Uint8Array(a.length);for(let c=0;c<a.length;c++)i[c]=a.charCodeAt(c);const s=await Ng({locateFile:c=>`src/${c}`});this.db=new s.Database(i),this._items=null,this._passkeys=null,this._folders=null,this._settings=null,this._logos=null}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(e){throw console.error("Error beginning transaction:",e),e}}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(e){throw console.error("Error committing transaction:",e),e}}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(e){throw console.error("Error rolling back transaction:",e),e}}exportToBase64(){if(!this.db)throw new Error("Database not initialized");try{this.db.run("VACUUM");const e=this.db.export();let a="";for(let i=0;i<e.length;i++)a+=String.fromCharCode(e[i]);return btoa(a)}catch(e){throw console.error("Error exporting SQLite database:",e),e}}executeQuery(e,a=[]){if(!this.db)throw new Error("Database not initialized");try{const i=this.db.prepare(e);i.bind(a);const s=[];for(;i.step();)s.push(i.getAsObject());return i.free(),s}catch(i){throw console.error("Error executing query:",i),i}}executeUpdate(e,a=[]){if(!this.db)throw new Error("Database not initialized");try{const i=this.db.prepare(e);i.bind(a),i.step();const s=this.db.getRowsModified();return i.free(),s}catch(i){throw console.error("Error executing update:",i),i}}executeRaw(e){if(!this.db)throw new Error("Database not initialized");try{const a=e.split(";");for(const i of a){const s=i.trim();s.length===0||s.toUpperCase().startsWith("BEGIN TRANSACTION")||s.toUpperCase().startsWith("COMMIT")||s.toUpperCase().startsWith("ROLLBACK")||this.db.run(s)}}catch(a){throw console.error("Error executing raw SQL:",a),a}}close(){this.db&&(this.db.close(),this.db=null)}async getDatabaseVersion(){if(!this.db)throw new Error("Database not initialized");try{const e=this.executeQuery(`
        SELECT MigrationId
        FROM __EFMigrationsHistory
        ORDER BY MigrationId DESC
        LIMIT 1`);if(e.length===0)throw new Error("No migrations found in the database.");const a=e[0].MigrationId,i=ON(a);if(!i)throw new Error("Could not extract version from migration ID");const s=FN(i);if(!s.isCompatible){const m=await Y1("common.errors.browserExtensionOutdated");throw new cs(m)}if(s.isKnownVersion&&s.clientVersion)return s.clientVersion;const d=new xg().getLatestVersion();return{revision:d.revision,version:i,description:`Unknown version ${i} (backwards compatible)`,releaseVersion:d.releaseVersion,compatibleUpToVersion:d.compatibleUpToVersion}}catch(e){throw console.error("Error getting database version:",e),e}}async getLatestDatabaseVersion(){const a=new xg().getAllVersions();return a[a.length-1]}async hasPendingMigrations(){try{const e=await this.getDatabaseVersion(),a=await this.getLatestDatabaseVersion();return e.revision<a.revision}catch(e){throw console.error("Error checking pending migrations:",e),e}}static imgSrcFromBytes(e){if(!e||Array.isArray(e)&&e.length===0||e instanceof Uint8Array&&e.length===0)return null;try{const a=this.toUint8Array(e),i=this.base64Encode(a);return i?`data:${this.detectMimeType(a)};base64,${i}`:null}catch(a){return console.error("Error setting logo:",a),null}}static extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}static detectMimeType(e){const a=()=>{const c=new TextDecoder().decode(e.slice(0,5)).toLowerCase();return c.includes("<?xml")||c.includes("<svg")},i=()=>e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0,s=()=>e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71;return a()?"image/svg+xml":i()?"image/x-icon":s()?"image/png":"image/x-icon"}static toUint8Array(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);const a=Object.keys(e).length,i=new Uint8Array(a);for(let s=0;s<a;s++)i[s]=e[s];return i}static base64Encode(e){try{const a=Array.from(this.toUint8Array(e));return btoa(a.reduce((i,s)=>i+String.fromCharCode(s),""))}catch(a){return console.error("Error encoding to base64:",a),null}}}const cy={"local:publicEmailDomains":"session:publicEmailDomains","local:privateEmailDomains":"session:privateEmailDomains","local:hiddenPrivateEmailDomains":"session:hiddenPrivateEmailDomains","local:encryptionKeyDerivationParams":"session:encryptionKeyDerivationParams"};async function Tl(r){let e=await Ce.getItem(r);if(e===null&&r in cy){const a=cy[r];e=await Ce.getItem(a),e!==null&&(await Ce.setItem(r,e),await Ce.removeItem(a))}return e}const wb=w.createContext(void 0),sk=({children:r})=>{const[e,a]=w.useState(null),[i,s]=w.useState(!1),[c,d]=w.useState(!1),[m,g]=w.useState(!1),f=w.useRef(!1),[E,p]=w.useState(!1),[C,I]=w.useState(!1),[x,T]=w.useState(0),k=w.useCallback(()=>E||C,[E,C]),R=w.useCallback(async q=>{f.current=q,g(q),await Ce.setItem("local:isOfflineMode",q)},[]);w.useEffect(()=>{(async()=>{const[W,ne,de]=await Promise.all([Ce.getItem("local:isOfflineMode"),Ce.getItem("local:isDirty"),Ce.getItem("local:serverRevision")]);f.current=W??!1,g(W??!1),p(ne??!1),T(de??0)})()},[]);const B=w.useCallback(async q=>{const W=new Tg;return await W.initializeFromBase64(q),a(W),s(!0),d(!0),W},[]),S=w.useCallback(async()=>{try{const q=await lt("GET_VAULT",{},"background");if(q!=null&&q.vault){const W=new Tg;return await W.initializeFromBase64(q.vault),a(W),s(!0),d(!0),W}else return s(!0),d(!1),null}catch(q){return console.error("Error retrieving vault from background:",q),s(!0),d(!1),null}},[]),j=w.useCallback(async()=>{try{const q=await Tl("local:publicEmailDomains"),W=await Tl("local:privateEmailDomains"),ne=await Tl("local:hiddenPrivateEmailDomains"),de=await Ce.getItem("local:serverRevision");return!q&&!W?null:{publicEmailDomains:q??[],privateEmailDomains:W??[],hiddenPrivateEmailDomains:ne??[],serverRevision:de??0}}catch(q){return console.error("Error getting vault metadata from local storage:",q),null}},[]),_=w.useCallback(async()=>{const[q,W]=await Promise.all([Ce.getItem("local:isDirty"),Ce.getItem("local:serverRevision")]);p(q??!1),T(W??0)},[]),P=w.useCallback(async()=>e?await e.hasPendingMigrations():!1,[e]);w.useEffect(()=>{i||S()},[i,S]);const K=w.useCallback(async q=>{await lt("STORE_ENCRYPTION_KEY",q,"background")},[]),H=w.useCallback(async q=>{await lt("STORE_ENCRYPTION_KEY_DERIVATION_PARAMS",q,"background")},[]),Q=w.useCallback(()=>{a(null),s(!1),d(!1)},[]),V=w.useCallback(()=>f.current,[]),G=w.useMemo(()=>({sqliteClient:e,dbInitialized:i,dbAvailable:c,isOffline:m,getIsOffline:V,isDirty:E,isSyncing:C,serverRevision:x,setIsOffline:R,setIsSyncing:I,shouldSuppressEmailErrors:k,loadDatabase:B,loadStoredDatabase:S,storeEncryptionKey:K,storeEncryptionKeyDerivationParams:H,clearDatabase:Q,getVaultMetadata:j,refreshSyncState:_,hasPendingMigrations:P}),[e,i,c,m,V,E,C,x,R,k,B,S,K,H,Q,j,_,P]);return l.jsx(wb.Provider,{value:G,children:r})},Ft=()=>{const r=w.useContext(wb);if(r===void 0)throw new Error("useDb must be used within a DbProvider");return r},bu="local:aliasvault_disabled_sites",Du="local:aliasvault_global_autofill_popup_enabled",uy="local:aliasvault_global_context_menu_enabled",io="local:aliasvault_vault_locked_dismiss_until",ru="local:aliasvault_temporary_disabled_sites",dy="local:aliasvault_clipboard_clear_timeout",my="local:aliasvault_auto_lock_timeout",fy="local:aliasvault_autofill_matching_mode",gy="local:aliasvault_passkey_provider_enabled",os="local:aliasvault_passkey_disabled_sites",Bu="session:pendingRedirectUrl",Df="local:aliasvault_skip_form_restore";var Iu={exports:{}},ok=Iu.exports,hy;function lk(){return hy||(hy=1,function(r,e){(function(a,i){r.exports=i()})(ok,function(){return(()=>{var a,i,s={773:(m,g,f)=>{var E,p=typeof self<"u"&&self.Module!==void 0?self.Module:{},C={};for(E in p)p.hasOwnProperty(E)&&(C[E]=p[E]);var I,x,T,k;I=typeof window=="object",x=typeof importScripts=="function",T=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",k=!I&&!T&&!x;var R,B,S,j,_,P="";T?(P=x?f(967).dirname(P)+"/":"//",R=function(ve,Re){return j||(j=f(145)),_||(_=f(967)),ve=_.normalize(ve),j.readFileSync(ve,Re?null:"utf8")},S=function(ve){var Re=R(ve,!0);return Re.buffer||(Re=new Uint8Array(Re)),G(Re.buffer),Re},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),m.exports=p,process.on("uncaughtException",function(ve){if(!(ve instanceof rt))throw ve}),process.on("unhandledRejection",Z),p.inspect=function(){return"[Emscripten Module object]"}):k?(typeof read<"u"&&(R=function(ve){return read(ve)}),S=function(ve){var Re;return typeof readbuffer=="function"?new Uint8Array(readbuffer(ve)):(G(typeof(Re=read(ve,"binary"))=="object"),Re)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(I||x)&&(x?P=self.location.href:typeof document<"u"&&document.currentScript&&(P=document.currentScript.src),P=P.indexOf("blob:")!==0?P.substr(0,P.lastIndexOf("/")+1):"",R=function(ve){var Re=new XMLHttpRequest;return Re.open("GET",ve,!1),Re.send(null),Re.responseText},x&&(S=function(ve){var Re=new XMLHttpRequest;return Re.open("GET",ve,!1),Re.responseType="arraybuffer",Re.send(null),new Uint8Array(Re.response)}),B=function(ve,Re,$e){var qe=new XMLHttpRequest;qe.open("GET",ve,!0),qe.responseType="arraybuffer",qe.onload=function(){qe.status==200||qe.status==0&&qe.response?Re(qe.response):$e()},qe.onerror=$e,qe.send(null)}),p.print||console.log.bind(console);var K,H,Q=p.printErr||console.warn.bind(console);for(E in C)C.hasOwnProperty(E)&&(p[E]=C[E]);C=null,p.arguments&&p.arguments,p.thisProgram&&p.thisProgram,p.quit&&p.quit,p.wasmBinary&&(K=p.wasmBinary),p.noExitRuntime,typeof WebAssembly!="object"&&Z("no native wasm support detected");var V=!1;function G(ve,Re){ve||Z("Assertion failed: "+Re)}var q,W,ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function de(ve){q=ve,p.HEAP8=new Int8Array(ve),p.HEAP16=new Int16Array(ve),p.HEAP32=new Int32Array(ve),p.HEAPU8=W=new Uint8Array(ve),p.HEAPU16=new Uint16Array(ve),p.HEAPU32=new Uint32Array(ve),p.HEAPF32=new Float32Array(ve),p.HEAPF64=new Float64Array(ve)}p.INITIAL_MEMORY;var X,ae=[],pe=[],Ae=[],O=0,$=null;function Z(ve){throw p.onAbort&&p.onAbort(ve),Q(ve+=""),V=!0,ve="abort("+ve+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(ve)}function ce(ve){return ve.startsWith("data:application/octet-stream;base64,")}function be(ve){return ve.startsWith("file://")}p.preloadedImages={},p.preloadedAudios={};var Le,ke="argon2.wasm";function Se(ve){try{if(ve==ke&&K)return new Uint8Array(K);if(S)return S(ve);throw"both async and sync fetching of the wasm failed"}catch(Re){Z(Re)}}function Te(ve){for(;ve.length>0;){var Re=ve.shift();if(typeof Re!="function"){var $e=Re.func;typeof $e=="number"?Re.arg===void 0?X.get($e)():X.get($e)(Re.arg):$e(Re.arg===void 0?null:Re.arg)}else Re(p)}}function Oe(ve){try{return H.grow(ve-q.byteLength+65535>>>16),de(H.buffer),1}catch{}}ce(ke)||(Le=ke,ke=p.locateFile?p.locateFile(Le,P):P+Le);var Ne,je={a:function(ve,Re,$e){W.copyWithin(ve,Re,Re+$e)},b:function(ve){var Re,$e=W.length,qe=2147418112;if((ve>>>=0)>qe)return!1;for(var dt=1;dt<=4;dt*=2){var Je=$e*(1+.2/dt);if(Je=Math.min(Je,ve+100663296),Oe(Math.min(qe,((Re=Math.max(ve,Je))%65536>0&&(Re+=65536-Re%65536),Re))))return!0}return!1}},ht=(function(){var ve={a:je};function Re(dt,Je){var At,Ot=dt.exports;p.asm=Ot,de((H=p.asm.c).buffer),X=p.asm.k,At=p.asm.d,pe.unshift(At),function(Wt){if(O--,p.monitorRunDependencies&&p.monitorRunDependencies(O),O==0&&$){var Zt=$;$=null,Zt()}}()}function $e(dt){Re(dt.instance)}function qe(dt){return function(){if(!K&&(I||x)){if(typeof fetch=="function"&&!be(ke))return fetch(ke,{credentials:"same-origin"}).then(function(Je){if(!Je.ok)throw"failed to load wasm binary file at '"+ke+"'";return Je.arrayBuffer()}).catch(function(){return Se(ke)});if(B)return new Promise(function(Je,At){B(ke,function(Ot){Je(new Uint8Array(Ot))},At)})}return Promise.resolve().then(function(){return Se(ke)})}().then(function(Je){return WebAssembly.instantiate(Je,ve)}).then(dt,function(Je){Q("failed to asynchronously prepare wasm: "+Je),Z(Je)})}if(O++,p.monitorRunDependencies&&p.monitorRunDependencies(O),p.instantiateWasm)try{return p.instantiateWasm(ve,Re)}catch(dt){return Q("Module.instantiateWasm callback failed with error: "+dt),!1}K||typeof WebAssembly.instantiateStreaming!="function"||ce(ke)||be(ke)||typeof fetch!="function"?qe($e):fetch(ke,{credentials:"same-origin"}).then(function(dt){return WebAssembly.instantiateStreaming(dt,ve).then($e,function(Je){return Q("wasm streaming compile failed: "+Je),Q("falling back to ArrayBuffer instantiation"),qe($e)})})}(),p.___wasm_call_ctors=function(){return(p.___wasm_call_ctors=p.asm.d).apply(null,arguments)},p._argon2_hash=function(){return(p._argon2_hash=p.asm.e).apply(null,arguments)},p._malloc=function(){return(ht=p._malloc=p.asm.f).apply(null,arguments)}),Ye=(p._free=function(){return(p._free=p.asm.g).apply(null,arguments)},p._argon2_verify=function(){return(p._argon2_verify=p.asm.h).apply(null,arguments)},p._argon2_error_message=function(){return(p._argon2_error_message=p.asm.i).apply(null,arguments)},p._argon2_encodedlen=function(){return(p._argon2_encodedlen=p.asm.j).apply(null,arguments)},p._argon2_hash_ext=function(){return(p._argon2_hash_ext=p.asm.l).apply(null,arguments)},p._argon2_verify_ext=function(){return(p._argon2_verify_ext=p.asm.m).apply(null,arguments)},p.stackAlloc=function(){return(Ye=p.stackAlloc=p.asm.n).apply(null,arguments)});function rt(ve){this.name="ExitStatus",this.message="Program terminated with exit("+ve+")",this.status=ve}function la(ve){function Re(){Ne||(Ne=!0,p.calledRun=!0,V||(Te(pe),p.onRuntimeInitialized&&p.onRuntimeInitialized(),function(){if(p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;)$e=p.postRun.shift(),Ae.unshift($e);var $e;Te(Ae)}()))}O>0||(function(){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)$e=p.preRun.shift(),ae.unshift($e);var $e;Te(ae)}(),O>0||(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("")},1),Re()},1)):Re()))}if(p.allocate=function(ve,Re){var $e;return $e=Re==1?Ye(ve.length):ht(ve.length),ve.subarray||ve.slice?W.set(ve,$e):W.set(new Uint8Array(ve),$e),$e},p.UTF8ToString=function(ve,Re){return ve?function($e,qe,dt){for(var Je=qe+dt,At=qe;$e[At]&&!(At>=Je);)++At;if(At-qe>16&&$e.subarray&&ne)return ne.decode($e.subarray(qe,At));for(var Ot="";qe<At;){var Wt=$e[qe++];if(128&Wt){var Zt=63&$e[qe++];if((224&Wt)!=192){var ya=63&$e[qe++];if((Wt=(240&Wt)==224?(15&Wt)<<12|Zt<<6|ya:(7&Wt)<<18|Zt<<12|ya<<6|63&$e[qe++])<65536)Ot+=String.fromCharCode(Wt);else{var U=Wt-65536;Ot+=String.fromCharCode(55296|U>>10,56320|1023&U)}}else Ot+=String.fromCharCode((31&Wt)<<6|Zt)}else Ot+=String.fromCharCode(Wt)}return Ot}(W,ve,Re):""},p.ALLOC_NORMAL=0,$=function ve(){Ne||la(),Ne||($=ve)},p.run=la,p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);p.preInit.length>0;)p.preInit.pop()();la(),m.exports=p,p.unloadRuntime=function(){typeof self<"u"&&delete self.Module,p=H=X=q=W=void 0,delete m.exports}},631:function(m,g,f){var E,p;(p=typeof(E=function(){const C=typeof self<"u"?self:this,I={Argon2d:0,Argon2i:1,Argon2id:2};function x(S){if(x._promise)return x._promise;if(x._module)return Promise.resolve(x._module);let j;return j=C.process&&C.process.versions&&C.process.versions.node?T().then(_=>new Promise(P=>{_.postRun=()=>P(_)})):(C.loadArgon2WasmBinary?C.loadArgon2WasmBinary():Promise.resolve(f(721)).then(_=>function(P){const K=atob(P),H=new Uint8Array(new ArrayBuffer(K.length));for(let Q=0;Q<K.length;Q++)H[Q]=K.charCodeAt(Q);return H}(_))).then(_=>function(P,K){return new Promise(H=>(C.Module={wasmBinary:P,wasmMemory:K,postRun(){H(Module)}},T()))}(_,S?function(P){const V=Math.min(Math.max(Math.ceil(P*1024/65536),256)+256,32767);return new WebAssembly.Memory({initial:V,maximum:32767})}(S):void 0)),x._promise=j,j.then(_=>(x._module=_,delete x._promise,_))}function T(){return C.loadArgon2WasmModule?C.loadArgon2WasmModule():Promise.resolve(f(773))}function k(S,j){return S.allocate(j,"i8",S.ALLOC_NORMAL)}function R(S,j){return k(S,new Uint8Array([...j,0]))}function B(S){if(typeof S!="string")return S;if(typeof TextEncoder=="function")return new TextEncoder().encode(S);if(typeof Buffer=="function")return Buffer.from(S);throw new Error("Don't know how to encode UTF8")}return{ArgonType:I,hash:function(S){const j=S.mem||1024;return x(j).then(_=>{const P=S.time||1,K=S.parallelism||1,H=B(S.pass),Q=R(_,H),V=H.length,G=B(S.salt),q=R(_,G),W=G.length,ne=S.type||I.Argon2d,de=_.allocate(new Array(S.hashLen||24),"i8",_.ALLOC_NORMAL),X=S.secret?k(_,S.secret):0,ae=S.secret?S.secret.byteLength:0,pe=S.ad?k(_,S.ad):0,Ae=S.ad?S.ad.byteLength:0,O=S.hashLen||24,$=_._argon2_encodedlen(P,j,K,W,O,ne),Z=_.allocate(new Array($+1),"i8",_.ALLOC_NORMAL);let ce,be,Le;try{be=_._argon2_hash_ext(P,j,K,Q,V,q,W,de,O,Z,$,ne,X,ae,pe,Ae,19)}catch(ke){ce=ke}if(be!==0||ce){try{ce||(ce=_.UTF8ToString(_._argon2_error_message(be)))}catch{}Le={message:ce,code:be}}else{let ke="";const Se=new Uint8Array(O);for(let Te=0;Te<O;Te++){const Oe=_.HEAP8[de+Te];Se[Te]=Oe,ke+=("0"+(255&Oe).toString(16)).slice(-2)}Le={hash:Se,hashHex:ke,encoded:_.UTF8ToString(Z)}}try{_._free(Q),_._free(q),_._free(de),_._free(Z),pe&&_._free(pe),X&&_._free(X)}catch{}if(ce)throw Le;return Le})},verify:function(S){return x().then(j=>{const _=B(S.pass),P=R(j,_),K=_.length,H=S.secret?k(j,S.secret):0,Q=S.secret?S.secret.byteLength:0,V=S.ad?k(j,S.ad):0,G=S.ad?S.ad.byteLength:0,q=R(j,B(S.encoded));let W,ne,de,X=S.type;if(X===void 0){let ae=S.encoded.split("$")[1];ae&&(ae=ae.replace("a","A"),X=I[ae]||I.Argon2d)}try{ne=j._argon2_verify_ext(q,P,K,H,Q,V,G,X)}catch(ae){W=ae}if(ne||W){try{W||(W=j.UTF8ToString(j._argon2_error_message(ne)))}catch{}de={message:W,code:ne}}try{j._free(P),j._free(q)}catch{}if(W)throw de;return de})},unloadRuntime:function(){x._module&&(x._module.unloadRuntime(),delete x._promise,delete x._module)}}})=="function"?E.apply(g,[]):E)===void 0||(m.exports=p)},721:function(m,g){m.exports=" "},145:()=>{},967:()=>{}},c={};function d(m){var g=c[m];if(g!==void 0)return g.exports;var f=c[m]={exports:{}};return s[m].call(f.exports,f,f.exports,d),f.exports}return i=Object.getPrototypeOf?m=>Object.getPrototypeOf(m):m=>m.__proto__,d.t=function(m,g){if(1&g&&(m=this(m)),8&g||typeof m=="object"&&m&&(4&g&&m.__esModule||16&g&&typeof m.then=="function"))return m;var f=Object.create(null);d.r(f);var E={};a=a||[null,i({}),i([]),i(i)];for(var p=2&g&&m;typeof p=="object"&&!~a.indexOf(p);p=i(p))Object.getOwnPropertyNames(p).forEach(C=>E[C]=()=>m[C]);return E.default=()=>m,d.d(f,E),f},d.d=(m,g)=>{for(var f in g)d.o(g,f)&&!d.o(m,f)&&Object.defineProperty(m,f,{enumerable:!0,get:g[f]})},d.o=(m,g)=>Object.prototype.hasOwnProperty.call(m,g),d.r=m=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(m,"__esModule",{value:!0})},d(631)})()})}(Iu)),Iu.exports}var ck=lk();const Cb=Ri(ck);var VE,KE;const uk=(KE=(VE=globalThis.browser)==null?void 0:VE.runtime)!=null&&KE.id?globalThis.browser:globalThis.chrome,zr=uk,eh="local:aliasvault_pin_enabled",th="local:aliasvault_pin_encrypted_key",ah="local:aliasvault_pin_salt",nh="local:aliasvault_pin_length",lo="local:aliasvault_pin_failed_attempts",Sg=4;class vu extends Error{constructor(){super("PIN locked after too many failed attempts"),this.name="PinLockedError"}}class Bl extends Error{constructor(){super("Invalid PIN format"),this.name="InvalidPinFormatError"}}class kg extends Error{constructor(a){super(`Incorrect PIN. ${a} attempts remaining.`);Fe(this,"attemptsRemaining");this.name="IncorrectPinError",this.attemptsRemaining=a}}async function Nb(){try{return await Ce.getItem(eh)===!0}catch{return!1}}async function dk(){try{return await Ce.getItem(nh)||null}catch{return null}}function rh(r){return/^\d{6,8}$/.test(r)}async function xb(){try{return await Ce.getItem(lo)||0}catch{return 0}}async function Tb(){return await xb()>=Sg}async function mk(r,e){if(!rh(r))throw new Bl;try{const a=crypto.getRandomValues(new Uint8Array(16)),i=Lg(a.buffer),s=await Sb(a),c=await kb(r,s),d=crypto.getRandomValues(new Uint8Array(12)),m=await crypto.subtle.encrypt({name:"AES-GCM",iv:d},c,new TextEncoder().encode(e)),g=new Uint8Array(d.length+m.byteLength);g.set(d,0),g.set(new Uint8Array(m),d.length);const f=Lg(g.buffer);await Promise.all([Ce.setItem(eh,!0),Ce.setItem(th,f),Ce.setItem(ah,i),Ce.setItem(nh,r.length),Ce.setItem(lo,0)])}catch(a){throw a instanceof Bl||console.error("[PinUnlockService] Failed to setup PIN:",a),a}}async function fk(r){if(!rh(r))throw new Bl;if(await Tb())throw new vu;try{const[e,a]=await Promise.all([Ce.getItem(th),Ce.getItem(ah)]);if(!e||!a)throw new vu;const i=new Uint8Array(py(e)),s=i.slice(0,12),c=i.slice(12),d=new Uint8Array(py(a)),m=await Sb(d),g=await kb(r,m),f=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},g,c),E=new TextDecoder().decode(f);return await Ce.setItem(lo,0),E}catch{const a=await xb()+1;throw await Ce.setItem(lo,a),a>=Sg?(await ih(),new vu):new kg(Sg-a)}}async function ih(){try{await Promise.all([Ce.removeItem(eh),Ce.removeItem(th),Ce.removeItem(ah),Ce.removeItem(nh),Ce.removeItem(lo)])}catch(r){throw console.error("[PinUnlockService] Failed to disable PIN:",r),r}}async function Ay(){try{await Ce.setItem(lo,0)}catch(r){console.error("[PinUnlockService] Failed to reset failed attempts:",r)}}async function gk(){const r=zr.runtime.id,e=new TextEncoder().encode(r),a=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(a)}async function Sb(r){const e=await gk(),a=new Uint8Array(r.length+e.length);return a.set(r,0),a.set(e,r.length),a}async function kb(r,e){const a=Lg(e.buffer),i=await Cb.hash({pass:r,salt:a,time:3,mem:65536,parallelism:1,hashLen:32,type:2});return await crypto.subtle.importKey("raw",i.hash,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Lg(r){const e=new Uint8Array(r);let a="";for(let i=0;i<e.byteLength;i++)a+=String.fromCharCode(e[i]);return btoa(a)}function py(r){const e=atob(r),a=new Uint8Array(e.length);for(let i=0;i<e.length;i++)a[i]=e.charCodeAt(i);return a.buffer}const Lb=w.createContext(void 0),hk=({children:r})=>{const[e,a]=w.useState(!1),[i,s]=w.useState(null),[c,d]=w.useState(null),m=Ft(),g=w.useCallback(async()=>{const x=await Ce.getItem("local:accessToken"),T=await Ce.getItem("local:refreshToken"),k=await Ce.getItem("local:username");return a(!0),x&&T&&k?(s(k),!0):!1},[s]),f=w.useCallback(async(x,T,k)=>{await Ce.setItem("local:username",x),await Ce.setItem("local:accessToken",T),await Ce.setItem("local:refreshToken",k),await Ce.setItem(io,0),s(x)},[]),E=w.useCallback(async x=>{await lt("CLEAR_SESSION",{},"background"),m==null||m.clearDatabase();try{await ih()}catch(T){console.error("Failed to remove PIN data:",T)}x&&d(x)},[m]),p=w.useCallback(async x=>{await E(x),await lt("CLEAR_VAULT_DATA",{},"background"),s(null)},[E]),C=w.useCallback(()=>{d(null)},[]),I=w.useMemo(()=>({isInitialized:e,username:i,initializeAuth:g,setAuthTokens:f,clearAuthUserInitiated:p,clearAuthForced:E,globalMessage:c,clearGlobalMessage:C}),[e,i,g,c,f,p,E,C]);return l.jsx(Lb.Provider,{value:I,children:r})},jl=()=>{const r=w.useContext(Lb);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r};class Ak{constructor(){Fe(this,"listeners",new Set)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}emit(e){this.listeners.forEach(a=>{try{a(e)}catch(i){console.error("Error in logout listener:",i)}})}}const Rg=new Ak,Mr=class Mr{constructor(){}static isServerVersionSupported(e){return this.versionGreaterThanOrEqualTo(e,this.MIN_SERVER_VERSION)}static versionGreaterThanOrEqualTo(e,a){const[i,s]=e.split("-"),[c,d]=a.split("-"),m=i.split(".").map(Number),g=c.split(".").map(Number);for(let f=0;f<Math.max(m.length,g.length);f++){const E=m[f]??0,p=g[f]??0;if(E>p)return!0;if(E<p)return!1}return!s&&d?!0:s&&!d?!1:!s&&!d?!0:s>=d}};Fe(Mr,"VERSION","0.26.0-alpha"),Fe(Mr,"API_VERSION",Mr.VERSION.split("-")[0]),Fe(Mr,"MIN_SERVER_VERSION","0.12.0-dev"),Fe(Mr,"CLIENT_NAME","firefox"),Fe(Mr,"DEFAULT_CLIENT_URL","https://app.aliasvault.net"),Fe(Mr,"DEFAULT_API_URL","https://app.aliasvault.net/api");let ja=Mr;class Hr extends Error{constructor(e){super(e),this.name="ApiAuthError"}}class Wu extends Error{constructor(e="Network error",a){super(e),this.name="NetworkError",this.cause=a,Object.setPrototypeOf(this,Wu.prototype)}}class pk{async getBaseUrl(){return(await this.getApiUrl()).replace(/\/$/,"")+"/v1/"}async isSelfHosted(){return await this.getApiUrl()!==ja.DEFAULT_API_URL}async authFetch(e,a={},i=!0,s=!0){const c=new Headers(a.headers??{}),d=await this.getAccessToken();d&&c.set("Authorization",`Bearer ${d}`);const m={...a,headers:c};try{const g=await this.rawFetch(e,m);if(g.status===401){const f=await this.refreshAccessToken();if(f){c.set("Authorization",`Bearer ${f}`);const E=await this.rawFetch(e,{...m,headers:c});if(!E.ok)throw new Hr("Request failed after token refresh");return i?E.json():E}else throw Rg.emit("auth.errors.sessionExpired"),new Hr("Session expired")}if(!g.ok&&s)throw new Error(`HTTP error! status: ${g.status}`);return i?g.json():g}catch(g){throw console.error("API request failed:",g),g}}async rawFetch(e,a={}){const s=await this.getBaseUrl()+e,c=new Headers(a.headers??{});c.set("X-AliasVault-Client",`${ja.CLIENT_NAME}-${ja.API_VERSION}`);const d={...a,headers:c};try{return await fetch(s,d)}catch(m){throw console.error("API request failed:",m),new Wu(m instanceof Error?m.message:"Network request failed",m instanceof Error?m:void 0)}}async get(e){return this.authFetch(e,{method:"GET"})}async downloadBlob(e){try{const i=await(await this.authFetch(e,{method:"GET",headers:{Accept:"application/octet-stream"}},!1)).arrayBuffer();return new Uint8Array(i)}catch(a){throw console.error("Error downloading blob:",a),a}}async post(e,a,i=!0){return this.authFetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},i)}async put(e,a){return this.authFetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}async delete(e){return this.authFetch(e,{method:"DELETE"},!1)}async revokeTokens(){try{const e=await this.getRefreshToken();e&&await this.post("Auth/revoke",{token:await this.getAccessToken(),refreshToken:e},!1)}catch(e){console.error("WebApi revoke tokens error:",e)}}async getStatus(){try{return await this.get("Auth/status")}catch(e){if(e instanceof Hr)throw e;return{clientVersionSupported:!0,serverVersion:"0.0.0",vaultRevision:0,srpSalt:""}}}validateStatusResponse(e){return e.clientVersionSupported?ja.isServerVersionSupported(e.serverVersion)?null:"serverVersionNotSupported":"clientVersionNotSupported"}async refreshAccessToken(){const e=await this.getRefreshToken();if(!e)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:e})});if(!a.ok)throw new Error("Failed to refresh token");const i=await a.json();return this.updateTokens(i.token,i.refreshToken),i.token}catch{return Rg.emit("auth.errors.sessionExpired"),null}}async getAccessToken(){return await Ce.getItem("local:accessToken")??null}async getRefreshToken(){return await Ce.getItem("local:refreshToken")??null}async updateTokens(e,a){await Ce.setItem("local:accessToken",e),await Ce.setItem("local:refreshToken",a)}async getApiUrl(){const e=await Ce.getItem("local:apiUrl");return!e||e.length===0?ja.DEFAULT_API_URL:e}}const Rb=w.createContext(null),yk=({children:r})=>{const[e,a]=w.useState(null);return w.useEffect(()=>{const i=new pk;a(i)},[]),e?l.jsx(Rb.Provider,{value:e,children:r}):null},zn=()=>{const r=w.useContext(Rb);if(!r)throw new Error("useWebApi must be used within a WebApiProvider");return r},Db=w.createContext(void 0),Ek=({children:r})=>{const e=jl(),a=zn(),[i,s]=w.useState(!1),c=w.useRef(!1),{t:d}=Ge(),m=w.useCallback(async p=>{if(!c.current)try{c.current=!0,await a.revokeTokens(),await e.clearAuthForced(p)}catch(C){console.error("Error during logout:",C)}finally{c.current=!1,s(!1)}},[e,a]),g=w.useCallback(async()=>{const p=await e.initializeAuth();return s(p),p},[e]),f=w.useCallback(async(p,C,I)=>{await e.setAuthTokens(p,C,I),s(!0)},[e]);w.useEffect(()=>Rg.subscribe(async C=>{await m(d(C))}),[m,d]),w.useEffect(()=>{g()},[g]);const E=w.useMemo(()=>({isInitialized:e.isInitialized,username:e.username,globalMessage:e.globalMessage,logout:m,initializeAuth:g,setAuthTokens:f,clearGlobalMessage:e.clearGlobalMessage,isLoggedIn:i}),[e.isInitialized,e.username,e.globalMessage,e.clearGlobalMessage,m,g,f,i]);return l.jsx(Db.Provider,{value:E,children:r})},Vn=()=>{const r=w.useContext(Db);if(r===void 0)throw new Error("useApp must be used within an AppProvider");return r};class aa{static isPopup(){return new URLSearchParams(window.location.search).get("expanded")==="true"?!0:window.innerWidth>390}static getReturnPath(){return new URLSearchParams(window.location.search).get("returnTo")}static openInNewPopup(e,a){const c=window.screen.width/2-400,d=window.screen.height/2-1e3/2,m=e||window.location.hash.replace("#",""),g=new URLSearchParams;g.set("expanded","true"),a&&g.set("returnTo",a);const f=`popup.html?${g.toString()}#${m}`;window.open(f,"AliasVaultPopup",`width=800,height=1000,left=${c},top=${d},popup=true`),window.close()}}const bk=()=>{const{t:r}=Ge(),e=Vn(),a=Ft();return!e.isLoggedIn||!a.dbAvailable?null:a.isOffline?l.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 rounded-md text-xs font-medium",children:[l.jsxs("div",{className:"relative",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"})}),a.isDirty&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 bg-red-500 rounded-full"})]}),l.jsx("span",{children:r("common.offline")})]}):a.isSyncing?l.jsx("div",{title:r("common.syncingVault"),className:"flex items-center gap-1.5 px-2 py-1 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-md text-xs font-medium",children:l.jsx("svg",{className:"w-3.5 h-3.5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}):a.isDirty?l.jsx("div",{title:r("common.pendingSync"),className:"flex items-center gap-1.5 px-2 py-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 rounded-md text-xs font-medium",children:l.jsxs("div",{className:"relative",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),l.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full animate-pulse"})]})}):null},Bb=({routes:r=[],rightButtons:e})=>{const{t:a}=Ge(),i=Vn(),s=pa(),c=Ha(),d=r==null?void 0:r.find(E=>{const p=E.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${p}$`).test(c.pathname)}),m=w.useCallback(()=>{const E=aa.getReturnPath();E&&aa.isPopup()&&window.history.length<=2?s(E):s(-1)},[s]),g=()=>{s("/auth-settings")},f=()=>{c.pathname==="/upgrade"||c.pathname==="/login"||c.pathname==="/unlock"||(i.isLoggedIn?s("/items"):s("/"))};return l.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center h-16 px-4",children:[d!=null&&d.showBackButton?l.jsx("button",{id:"back",onClick:m,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:l.jsxs("div",{className:"flex items-center",children:[l.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:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),d.title&&l.jsx("h1",{className:"text-lg font-medium text-gray-900 dark:text-white ml-2",children:d.title})]})}):l.jsx("div",{className:"flex items-center",children:l.jsxs("button",{onClick:()=>f(),className:"flex items-center hover:opacity-80 transition-opacity",children:[l.jsx(Ib,{width:125,height:40,showText:!0,className:"text-gray-900 dark:text-white"}),l.jsx("span",{className:"text-primary-500 text-[10px] font-normal",children:"BETA"})]})}),l.jsx("div",{className:"flex-grow"}),l.jsx(bk,{}),l.jsx("div",{className:"flex items-center gap-2",children:i.isLoggedIn?e:l.jsxs(l.Fragment,{children:[e,l.jsxs("button",{id:"settings",onClick:g,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:[l.jsx("span",{className:"sr-only",children:a("common.settings")}),l.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:l.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"})})]})]})})]})})},Ik=({routes:r,headerButtons:e,message:a,children:i})=>l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[l.jsx(wN,{}),l.jsx(Bb,{routes:r,rightButtons:e}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"calc(100% - 120px)"},children:l.jsxs("div",{className:"px-4 pb-4 pt-2 mb-16",children:[a&&l.jsx("p",{className:"text-red-500 mb-4",children:a}),i||l.jsx(cb,{children:r.map(s=>l.jsx(Yg,{path:s.path,element:s.element},s.path))})]})}),l.jsx(CN,{})]}),vk=({children:r})=>l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[l.jsx("header",{className:"fixed z-30 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-center justify-center h-16 px-4",children:[l.jsx(Ib,{width:125,height:40,showText:!0,className:"text-gray-900 dark:text-white"}),l.jsx("span",{className:"text-primary-500 text-[10px] font-normal",children:"BETA"})]})}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px"},children:l.jsx("div",{className:"p-4",children:r})})]}),Un=()=>{const r={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},e=l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),l.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:r})]});return l.jsx("div",{className:"inline-flex items-center",children:e})},Ub=w.createContext(void 0),wk=({children:r})=>{const[e,a]=w.useState(null),i=w.useCallback(c=>{a(c)},[]),s=w.useMemo(()=>({setHeaderButtons:i,headerButtons:e}),[i,e]);return l.jsx(Ub.Provider,{value:s,children:r})},Kn=()=>{const r=w.useContext(Ub);if(r===void 0)throw new Error("useHeaderButtons must be used within a HeaderButtonsProvider");return r},Ck=()=>{const{isLoading:r}=na();if(!r)return null;const e={width:"40px",height:"40px",borderRadius:"50%",animation:"spin 1s linear infinite"},a=l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
      `}),l.jsx("div",{className:"border-[4px] border-solid border-current/10 dark:border-white/10 border-t-current dark:border-t-white",style:e})]});return l.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:l.jsx("div",{className:"relative",children:a})})},_b=w.createContext(void 0),Nk=({children:r})=>{const[e,a]=w.useState(!0),[i,s]=w.useState(!1),[c,d]=w.useState(void 0),m=E=>{s(!0),d(E)},g=()=>{s(!1),d(void 0)},f=w.useMemo(()=>({isLoading:i,loadingMessage:c,showLoading:m,hideLoading:g,isInitialLoading:e,setIsInitialLoading:a}),[i,c,e]);return l.jsxs(_b.Provider,{value:f,children:[l.jsx(Ck,{message:c}),r]})},na=()=>{const r=w.useContext(_b);if(r===void 0)throw new Error("useLoading must be used within a LoadingProvider");return r},xk="session:lastVisitedPage",Tk="session:lastVisitedTime",Sk="session:navigationHistory",Mb=w.createContext(void 0),kk=({children:r})=>{const e=Ha(),a=pa(),{isInitialized:i,isLoggedIn:s}=Vn(),{dbInitialized:c,dbAvailable:d}=Ft(),m=i&&c,g=m&&(!s||!d),f=w.useCallback(async()=>{if(m&&!g&&!["/","/reinitialize","/login","/unlock","/unlock-success","/auth-settings","/upgrade","/passkeys/create","/passkeys/authenticate"].includes(e.pathname)){const C=e.pathname.split("/").filter(Boolean),I=[];let x="";for(let T=0;T<C.length;T++)x+="/"+C[T],I.push({pathname:x,search:e.search,hash:e.hash});await Promise.all([Ce.setItem(xk,e.pathname),Ce.setItem(Tk,Date.now()),Ce.setItem(Sk,I)])}},[e,m,g]);w.useEffect(()=>{m&&f()},[e.pathname,e.search,e.hash,m,f]),w.useEffect(()=>{m&&!s&&a("/login",{replace:!0})},[m,s]);const E=w.useMemo(()=>({storeCurrentPage:f,isFullyInitialized:m,requiresAuth:g}),[f,m,g]);return l.jsx(Mb.Provider,{value:E,children:r})},Lk=()=>{const r=w.useContext(Mb);if(r===void 0)throw new Error("useNavigation must be used within a NavigationProvider");return r};var Bf,yy;function Rk(){if(yy)return Bf;yy=1;function r(R){this._maxSize=R,this.clear()}r.prototype.clear=function(){this._size=0,this._values=Object.create(null)},r.prototype.get=function(R){return this._values[R]},r.prototype.set=function(R,B){return this._size>=this._maxSize&&this.clear(),R in this._values||this._size++,this._values[R]=B};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,a=/^\d+$/,i=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,c=/^\s*(['"]?)(.*?)(\1)\s*$/,d=512,m=new r(d),g=new r(d),f=new r(d);Bf={Cache:r,split:p,normalizePath:E,setter:function(R){var B=E(R);return g.get(R)||g.set(R,function(j,_){for(var P=0,K=B.length,H=j;P<K-1;){var Q=B[P];if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return j;H=H[B[P++]]}H[B[P]]=_})},getter:function(R,B){var S=E(R);return f.get(R)||f.set(R,function(_){for(var P=0,K=S.length;P<K;)if(_!=null||!B)_=_[S[P++]];else return;return _})},join:function(R){return R.reduce(function(B,S){return B+(I(S)||a.test(S)?"["+S+"]":(B?".":"")+S)},"")},forEach:function(R,B,S){C(Array.isArray(R)?R:p(R),B,S)}};function E(R){return m.get(R)||m.set(R,p(R).map(function(B){return B.replace(c,"$2")}))}function p(R){return R.match(e)||[""]}function C(R,B,S){var j=R.length,_,P,K,H;for(P=0;P<j;P++)_=R[P],_&&(k(_)&&(_='"'+_+'"'),H=I(_),K=!H&&/^\d+$/.test(_),B.call(S,_,H,K,P,R))}function I(R){return typeof R=="string"&&R&&["'",'"'].indexOf(R.charAt(0))!==-1}function x(R){return R.match(i)&&!R.match(a)}function T(R){return s.test(R)}function k(R){return!I(R)&&(x(R)||T(R))}return Bf}var ls=Rk(),Uf,Ey;function Dk(){if(Ey)return Uf;Ey=1;const r=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=E=>E.match(r)||[],a=E=>E[0].toUpperCase()+E.slice(1),i=(E,p)=>e(E).join(p).toLowerCase(),s=E=>e(E).reduce((p,C)=>`${p}${p?C[0].toUpperCase()+C.slice(1).toLowerCase():C.toLowerCase()}`,"");return Uf={words:e,upperFirst:a,camelCase:s,pascalCase:E=>a(s(E)),snakeCase:E=>i(E,"_"),kebabCase:E=>i(E,"-"),sentenceCase:E=>a(i(E," ")),titleCase:E=>e(E).map(a).join(" ")},Uf}var _f=Dk(),iu={exports:{}},by;function Bk(){if(by)return iu.exports;by=1,iu.exports=function(s){return r(e(s),s)},iu.exports.array=r;function r(s,c){var d=s.length,m=new Array(d),g={},f=d,E=a(c),p=i(s);for(c.forEach(function(I){if(!p.has(I[0])||!p.has(I[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});f--;)g[f]||C(s[f],f,new Set);return m;function C(I,x,T){if(T.has(I)){var k;try{k=", node was:"+JSON.stringify(I)}catch{k=""}throw new Error("Cyclic dependency"+k)}if(!p.has(I))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(I));if(!g[x]){g[x]=!0;var R=E.get(I)||new Set;if(R=Array.from(R),x=R.length){T.add(I);do{var B=R[--x];C(B,p.get(B),T)}while(x);T.delete(I)}m[--d]=I}}}function e(s){for(var c=new Set,d=0,m=s.length;d<m;d++){var g=s[d];c.add(g[0]),c.add(g[1])}return Array.from(c)}function a(s){for(var c=new Map,d=0,m=s.length;d<m;d++){var g=s[d];c.has(g[0])||c.set(g[0],new Set),c.has(g[1])||c.set(g[1],new Set),c.get(g[0]).add(g[1])}return c}function i(s){for(var c=new Map,d=0,m=s.length;d<m;d++)c.set(s[d],d);return c}return iu.exports}var Uk=Bk();const _k=Ri(Uk),Mk=Object.prototype.toString,Fk=Error.prototype.toString,Ok=RegExp.prototype.toString,jk=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Pk=/^Symbol\((.*)\)(.*)$/;function Hk(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Iy(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const a=typeof r;if(a==="number")return Hk(r);if(a==="string")return e?`"${r}"`:r;if(a==="function")return"[Function "+(r.name||"anonymous")+"]";if(a==="symbol")return jk.call(r).replace(Pk,"Symbol($1)");const i=Mk.call(r).slice(8,-1);return i==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):i==="Error"||r instanceof Error?"["+Fk.call(r)+"]":i==="RegExp"?Ok.call(r):null}function Li(r,e){let a=Iy(r,e);return a!==null?a:JSON.stringify(r,function(i,s){let c=Iy(this[i],e);return c!==null?c:s},2)}function Fb(r){return r==null?[]:[].concat(r)}let Ob,jb,Pb,Qk=/\$\{\s*(\w+)\s*\}/g;Ob=Symbol.toStringTag;class vy{constructor(e,a,i,s){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[Ob]="Error",this.name="ValidationError",this.value=a,this.path=i,this.type=s,this.errors=[],this.inner=[],Fb(e).forEach(c=>{if(Ga.isError(c)){this.errors.push(...c.errors);const d=c.inner.length?c.inner:[c];this.inner.push(...d)}else this.errors.push(c)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}jb=Symbol.hasInstance;Pb=Symbol.toStringTag;class Ga extends Error{static formatError(e,a){const i=a.label||a.path||"this";return a=Object.assign({},a,{path:i,originalPath:a.path}),typeof e=="string"?e.replace(Qk,(s,c)=>Li(a[c])):typeof e=="function"?e(a):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,a,i,s,c){const d=new vy(e,a,i,s);if(c)return d;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Pb]="Error",this.name=d.name,this.message=d.message,this.type=d.type,this.value=d.value,this.path=d.path,this.errors=d.errors,this.inner=d.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ga)}static[jb](e){return vy[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let ir={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:a,originalValue:i})=>{const s=i!=null&&i!==a?` (cast from the value \`${Li(i,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${Li(a,!0)}\``+s:`${r} must match the configured type. The validated value was: \`${Li(a,!0)}\``+s}},on={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"},zk={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"},Dg={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Vk={isValue:"${path} field must be ${value}"},wu={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Kk={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"},Gk={notType:r=>{const{path:e,value:a,spec:i}=r,s=i.types.length;if(Array.isArray(a)){if(a.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${a.length} for value: \`${Li(a,!0)}\``;if(a.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${a.length} for value: \`${Li(a,!0)}\``}return Ga.formatError(ir.notType,r)}};Object.assign(Object.create(null),{mixed:ir,string:on,number:zk,date:Dg,object:wu,array:Kk,boolean:Vk,tuple:Gk});const sh=r=>r&&r.__isYupSchema__;class Uu{static fromOptions(e,a){if(!a.then&&!a.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:s,otherwise:c}=a,d=typeof i=="function"?i:(...m)=>m.every(g=>g===i);return new Uu(e,(m,g)=>{var f;let E=d(...m)?s:c;return(f=E==null?void 0:E(g))!=null?f:g})}constructor(e,a){this.fn=void 0,this.refs=e,this.refs=e,this.fn=a}resolve(e,a){let i=this.refs.map(c=>c.getValue(a==null?void 0:a.value,a==null?void 0:a.parent,a==null?void 0:a.context)),s=this.fn(i,e,a);if(s===void 0||s===e)return e;if(!sh(s))throw new TypeError("conditions must return a schema object");return s.resolve(a)}}const su={context:"$",value:"."};class ds{constructor(e,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 e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===su.context,this.isValue=this.key[0]===su.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?su.context:this.isValue?su.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&ls.getter(this.path,!0),this.map=a.map}getValue(e,a,i){let s=this.isContext?i:this.isValue?e:a;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,a){return this.getValue(e,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(e){return e&&e.__isYupRef}}ds.prototype.__isYupRef=!0;const is=r=>r==null;function $s(r){function e({value:a,path:i="",options:s,originalValue:c,schema:d},m,g){const{name:f,test:E,params:p,message:C,skipAbsent:I}=r;let{parent:x,context:T,abortEarly:k=d.spec.abortEarly,disableStackTrace:R=d.spec.disableStackTrace}=s;function B(G){return ds.isRef(G)?G.getValue(a,x,T):G}function S(G={}){const q=Object.assign({value:a,originalValue:c,label:d.spec.label,path:G.path||i,spec:d.spec,disableStackTrace:G.disableStackTrace||R},p,G.params);for(const ne of Object.keys(q))q[ne]=B(q[ne]);const W=new Ga(Ga.formatError(G.message||C,q),a,q.path,G.type||f,q.disableStackTrace);return W.params=q,W}const j=k?m:g;let _={path:i,parent:x,type:f,from:s.from,createError:S,resolve:B,options:s,originalValue:c,schema:d};const P=G=>{Ga.isError(G)?j(G):G?g(null):j(S())},K=G=>{Ga.isError(G)?j(G):m(G)};if(I&&is(a))return P(!0);let Q;try{var V;if(Q=E.call(_,a,_),typeof((V=Q)==null?void 0:V.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Q).then(P,K)}}catch(G){K(G);return}P(Q)}return e.OPTIONS=r,e}function qk(r,e,a,i=a){let s,c,d;return e?(ls.forEach(e,(m,g,f)=>{let E=g?m.slice(1,m.length-1):m;r=r.resolve({context:i,parent:s,value:a});let p=r.type==="tuple",C=f?parseInt(E,10):0;if(r.innerType||p){if(p&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${d}" must contain an index to the tuple element, e.g. "${d}[0]"`);if(a&&C>=a.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${m}, in the path: ${e}. because there is no value at that index. `);s=a,a=a&&a[C],r=p?r.spec.types[C]:r.innerType}if(!f){if(!r.fields||!r.fields[E])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${d} which is a type: "${r.type}")`);s=a,a=a&&a[E],r=r.fields[E]}c=E,d=g?"["+m+"]":"."+m}),{schema:r,parent:s,parentPath:c}):{parent:s,parentPath:e,schema:r}}class _u extends Set{describe(){const e=[];for(const a of this.values())e.push(ds.isRef(a)?a.describe():a);return e}resolveAll(e){let a=[];for(const i of this.values())a.push(e(i));return a}clone(){return new _u(this.values())}merge(e,a){const i=this.clone();return e.forEach(s=>i.add(s)),a.forEach(s=>i.delete(s)),i}}function no(r,e=new Map){if(sh(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let a;if(r instanceof Date)a=new Date(r.getTime()),e.set(r,a);else if(r instanceof RegExp)a=new RegExp(r),e.set(r,a);else if(Array.isArray(r)){a=new Array(r.length),e.set(r,a);for(let i=0;i<r.length;i++)a[i]=no(r[i],e)}else if(r instanceof Map){a=new Map,e.set(r,a);for(const[i,s]of r.entries())a.set(i,no(s,e))}else if(r instanceof Set){a=new Set,e.set(r,a);for(const i of r)a.add(no(i,e))}else if(r instanceof Object){a={},e.set(r,a);for(const[i,s]of Object.entries(r))a[i]=no(s,e)}else throw Error(`Unable to clone ${r}`);return a}class ur{constructor(e){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 _u,this._blacklist=new _u,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ir.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(a=>{a.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),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=no(Object.assign({},this.spec,e)),a}label(e){let a=this.clone();return a.spec.label=e,a}meta(...e){if(e.length===0)return this.spec.meta;let a=this.clone();return a.spec.meta=Object.assign(a.spec.meta||{},e[0]),a}withMutation(e){let a=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=a,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let a=this,i=e.clone();const s=Object.assign({},a.spec,i.spec);return i.spec=s,i.internalTests=Object.assign({},a.internalTests,i.internalTests),i._whitelist=a._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=a._blacklist.merge(e._blacklist,e._whitelist),i.tests=a.tests,i.exclusiveTests=a.exclusiveTests,i.withMutation(c=>{e.tests.forEach(d=>{c.test(d.OPTIONS)})}),i.transforms=[...a.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let a=this;if(a.conditions.length){let i=a.conditions;a=a.clone(),a.conditions=[],a=i.reduce((s,c)=>c.resolve(s,e),a),a=a.resolve(e)}return a}resolveOptions(e){var a,i,s,c;return Object.assign({},e,{from:e.from||[],strict:(a=e.strict)!=null?a:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(c=e.disableStackTrace)!=null?c:this.spec.disableStackTrace})}cast(e,a={}){let i=this.resolve(Object.assign({value:e},a)),s=a.assert==="ignore-optionality",c=i._cast(e,a);if(a.assert!==!1&&!i.isType(c)){if(s&&is(c))return c;let d=Li(e),m=Li(c);throw new TypeError(`The value of ${a.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}". 

attempted value: ${d} 
`+(m!==d?`result of cast: ${m}`:""))}return c}_cast(e,a){let i=e===void 0?e:this.transforms.reduce((s,c)=>c.call(this,s,e,this),e);return i===void 0&&(i=this.getDefault(a)),i}_validate(e,a={},i,s){let{path:c,originalValue:d=e,strict:m=this.spec.strict}=a,g=e;m||(g=this._cast(g,Object.assign({assert:!1},a)));let f=[];for(let E of Object.values(this.internalTests))E&&f.push(E);this.runTests({path:c,value:g,originalValue:d,options:a,tests:f},i,E=>{if(E.length)return s(E,g);this.runTests({path:c,value:g,originalValue:d,options:a,tests:this.tests},i,s)})}runTests(e,a,i){let s=!1,{tests:c,value:d,originalValue:m,path:g,options:f}=e,E=T=>{s||(s=!0,a(T,d))},p=T=>{s||(s=!0,i(T,d))},C=c.length,I=[];if(!C)return p([]);let x={value:d,originalValue:m,path:g,options:f,schema:this};for(let T=0;T<c.length;T++){const k=c[T];k(x,E,function(B){B&&(Array.isArray(B)?I.push(...B):I.push(B)),--C<=0&&p(I)})}}asNestedTest({key:e,index:a,parent:i,parentPath:s,originalParent:c,options:d}){const m=e??a;if(m==null)throw TypeError("Must include `key` or `index` for nested validations");const g=typeof m=="number";let f=i[m];const E=Object.assign({},d,{strict:!0,parent:i,value:f,originalValue:c[m],key:void 0,[g?"index":"key"]:m,path:g||m.includes(".")?`${s||""}[${g?m:`"${m}"`}]`:(s?`${s}.`:"")+e});return(p,C,I)=>this.resolve(E)._validate(f,E,C,I)}validate(e,a){var i;let s=this.resolve(Object.assign({},a,{value:e})),c=(i=a==null?void 0:a.disableStackTrace)!=null?i:s.spec.disableStackTrace;return new Promise((d,m)=>s._validate(e,a,(g,f)=>{Ga.isError(g)&&(g.value=f),m(g)},(g,f)=>{g.length?m(new Ga(g,f,void 0,void 0,c)):d(f)}))}validateSync(e,a){var i;let s=this.resolve(Object.assign({},a,{value:e})),c,d=(i=a==null?void 0:a.disableStackTrace)!=null?i:s.spec.disableStackTrace;return s._validate(e,Object.assign({},a,{sync:!0}),(m,g)=>{throw Ga.isError(m)&&(m.value=g),m},(m,g)=>{if(m.length)throw new Ga(m,e,void 0,void 0,d);c=g}),c}isValid(e,a){return this.validate(e,a).then(()=>!0,i=>{if(Ga.isError(i))return!1;throw i})}isValidSync(e,a){try{return this.validateSync(e,a),!0}catch(i){if(Ga.isError(i))return!1;throw i}}_getDefault(e){let a=this.spec.default;return a==null?a:typeof a=="function"?a.call(this,e):no(a)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,a){const i=this.clone({nullable:e});return i.internalTests.nullable=$s({message:a,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),i}optionality(e,a){const i=this.clone({optional:e});return i.internalTests.optionality=$s({message:a,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=ir.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=ir.notNull){return this.nullability(!1,e)}required(e=ir.required){return this.clone().withMutation(a=>a.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let a=this.clone();return a.transforms.push(e),a}test(...e){let a;if(e.length===1?typeof e[0]=="function"?a={test:e[0]}:a=e[0]:e.length===2?a={name:e[0],test:e[1]}:a={name:e[0],message:e[1],test:e[2]},a.message===void 0&&(a.message=ir.default),typeof a.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),s=$s(a),c=a.exclusive||a.name&&i.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&&(i.exclusiveTests[a.name]=!!a.exclusive),i.tests=i.tests.filter(d=>!(d.OPTIONS.name===a.name&&(c||d.OPTIONS.test===s.OPTIONS.test))),i.tests.push(s),i}when(e,a){!Array.isArray(e)&&typeof e!="string"&&(a=e,e=".");let i=this.clone(),s=Fb(e).map(c=>new ds(c));return s.forEach(c=>{c.isSibling&&i.deps.push(c.key)}),i.conditions.push(typeof a=="function"?new Uu(s,a):Uu.fromOptions(s,a)),i}typeError(e){let a=this.clone();return a.internalTests.typeError=$s({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),a}oneOf(e,a=ir.oneOf){let i=this.clone();return e.forEach(s=>{i._whitelist.add(s),i._blacklist.delete(s)}),i.internalTests.whiteList=$s({message:a,name:"oneOf",skipAbsent:!0,test(s){let c=this.schema._whitelist,d=c.resolveAll(this.resolve);return d.includes(s)?!0:this.createError({params:{values:Array.from(c).join(", "),resolved:d}})}}),i}notOneOf(e,a=ir.notOneOf){let i=this.clone();return e.forEach(s=>{i._blacklist.add(s),i._whitelist.delete(s)}),i.internalTests.blacklist=$s({message:a,name:"notOneOf",test(s){let c=this.schema._blacklist,d=c.resolveAll(this.resolve);return d.includes(s)?this.createError({params:{values:Array.from(c).join(", "),resolved:d}}):!0}}),i}strip(e=!0){let a=this.clone();return a.spec.strip=e,a}describe(e){const a=(e?this.resolve(e):this).clone(),{label:i,meta:s,optional:c,nullable:d}=a.spec;return{meta:s,label:i,optional:c,nullable:d,default:a.getDefault(e),type:a.type,oneOf:a._whitelist.describe(),notOneOf:a._blacklist.describe(),tests:a.tests.map(g=>({name:g.OPTIONS.name,params:g.OPTIONS.params})).filter((g,f,E)=>E.findIndex(p=>p.name===g.name)===f)}}}ur.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])ur.prototype[`${r}At`]=function(e,a,i={}){const{parent:s,parentPath:c,schema:d}=qk(this,e,a,i.context);return d[r](s&&s[c],Object.assign({},i,{parent:s,path:e}))};for(const r of["equals","is"])ur.prototype[r]=ur.prototype.oneOf;for(const r of["not","nope"])ur.prototype[r]=ur.prototype.notOneOf;const Wk=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Yk(r){const e=Bg(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let a=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(a=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(a=0-a)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+a,e.second,e.millisecond)}function Bg(r){var e,a;const i=Wk.exec(r);return i?{year:Ur(i[1]),month:Ur(i[2],1)-1,day:Ur(i[3],1),hour:Ur(i[4]),minute:Ur(i[5]),second:Ur(i[6]),millisecond:i[7]?Ur(i[7].substring(0,3)):0,precision:(e=(a=i[7])==null?void 0:a.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:Ur(i[10]),minuteOffset:Ur(i[11])}:null}function Ur(r,e=0){return Number(r)||e}let Jk=/^[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])?)*$/,Xk=/^((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,$k=/^(?:[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,Zk="^\\d{4}-\\d{2}-\\d{2}",e2="\\d{2}:\\d{2}:\\d{2}",t2="(([+-]\\d{2}(:?\\d{2})?)|Z)",a2=new RegExp(`${Zk}T${e2}(\\.\\d+)?${t2}$`),n2=r=>is(r)||r===r.trim(),r2={}.toString();function Ug(){return new Hb}class Hb extends ur{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,a,i)=>{if(!i.spec.coerce||i.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===r2?e:s})})}required(e){return super.required(e).withMutation(a=>a.test({message:e||ir.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(a=>a.OPTIONS.name!=="required"),e))}length(e,a=on.length){return this.test({message:a,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,a=on.min){return this.test({message:a,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,a=on.max){return this.test({name:"max",exclusive:!0,message:a,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,a){let i=!1,s,c;return a&&(typeof a=="object"?{excludeEmptyString:i=!1,message:s,name:c}=a:s=a),this.test({name:c||"matches",message:s||on.matches,params:{regex:e},skipAbsent:!0,test:d=>d===""&&i||d.search(e)!==-1})}email(e=on.email){return this.matches(Jk,{name:"email",message:e,excludeEmptyString:!0})}url(e=on.url){return this.matches(Xk,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=on.uuid){return this.matches($k,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let a="",i,s;return e&&(typeof e=="object"?{message:a="",allowOffset:i=!1,precision:s=void 0}=e:a=e),this.matches(a2,{name:"datetime",message:a||on.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:a||on.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:c=>{if(!c||i)return!0;const d=Bg(c);return d?!!d.z:!1}}).test({name:"datetime_precision",message:a||on.datetime_precision,params:{precision:s},skipAbsent:!0,test:c=>{if(!c||s==null)return!0;const d=Bg(c);return d?d.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=on.trim){return this.transform(a=>a!=null?a.trim():a).test({message:e,name:"trim",test:n2})}lowercase(e=on.lowercase){return this.transform(a=>is(a)?a:a.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>is(a)||a===a.toLowerCase()})}uppercase(e=on.uppercase){return this.transform(a=>is(a)?a:a.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:a=>is(a)||a===a.toUpperCase()})}}Ug.prototype=Hb.prototype;let i2=new Date(""),s2=r=>Object.prototype.toString.call(r)==="[object Date]";class oh extends ur{constructor(){super({type:"date",check(e){return s2(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,a,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Yk(e),isNaN(e)?oh.INVALID_DATE:new Date(e)))})}prepareParam(e,a){let i;if(ds.isRef(e))i=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${a}\` must be a Date or a value that can be \`cast()\` to a Date`);i=s}return i}min(e,a=Dg.min){let i=this.prepareParam(e,"min");return this.test({message:a,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(i)}})}max(e,a=Dg.max){let i=this.prepareParam(e,"max");return this.test({message:a,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(i)}})}}oh.INVALID_DATE=i2;function o2(r,e=[]){let a=[],i=new Set,s=new Set(e.map(([d,m])=>`${d}-${m}`));function c(d,m){let g=ls.split(d)[0];i.add(g),s.has(`${m}-${g}`)||a.push([m,g])}for(const d of Object.keys(r)){let m=r[d];i.add(d),ds.isRef(m)&&m.isSibling?c(m.path,d):sh(m)&&"deps"in m&&m.deps.forEach(g=>c(g,d))}return _k.array(Array.from(i),a).reverse()}function wy(r,e){let a=1/0;return r.some((i,s)=>{var c;if((c=e.path)!=null&&c.includes(i))return a=s,!0}),a}function Qb(r){return(e,a)=>wy(r,e)-wy(r,a)}const l2=(r,e,a)=>{if(typeof r!="string")return r;let i=r;try{i=JSON.parse(r)}catch{}return a.isType(i)?i:r};function Cu(r){if("fields"in r){const e={};for(const[a,i]of Object.entries(r.fields))e[a]=Cu(i);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=Cu(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(Cu)}):"optional"in r?r.optional():r}const c2=(r,e)=>{const a=[...ls.normalizePath(e)];if(a.length===1)return a[0]in r;let i=a.pop(),s=ls.getter(ls.join(a),!0)(r);return!!(s&&i in s)};let Cy=r=>Object.prototype.toString.call(r)==="[object Object]";function Ny(r,e){let a=Object.keys(r.fields);return Object.keys(e).filter(i=>a.indexOf(i)===-1)}const u2=Qb([]);function zb(r){return new Vb(r)}class Vb extends ur{constructor(e){super({type:"object",check(a){return Cy(a)||typeof a=="function"}}),this.fields=Object.create(null),this._sortErrors=u2,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,a={}){var i;let s=super._cast(e,a);if(s===void 0)return this.getDefault(a);if(!this._typeCheck(s))return s;let c=this.fields,d=(i=a.stripUnknown)!=null?i:this.spec.noUnknown,m=[].concat(this._nodes,Object.keys(s).filter(p=>!this._nodes.includes(p))),g={},f=Object.assign({},a,{parent:g,__validating:a.__validating||!1}),E=!1;for(const p of m){let C=c[p],I=p in s;if(C){let x,T=s[p];f.path=(a.path?`${a.path}.`:"")+p,C=C.resolve({value:T,context:a.context,parent:g});let k=C instanceof ur?C.spec:void 0,R=k==null?void 0:k.strict;if(k!=null&&k.strip){E=E||p in s;continue}x=!a.__validating||!R?C.cast(s[p],f):s[p],x!==void 0&&(g[p]=x)}else I&&!d&&(g[p]=s[p]);(I!==p in g||g[p]!==s[p])&&(E=!0)}return E?g:s}_validate(e,a={},i,s){let{from:c=[],originalValue:d=e,recursive:m=this.spec.recursive}=a;a.from=[{schema:this,value:d},...c],a.__validating=!0,a.originalValue=d,super._validate(e,a,i,(g,f)=>{if(!m||!Cy(f)){s(g,f);return}d=d||f;let E=[];for(let p of this._nodes){let C=this.fields[p];!C||ds.isRef(C)||E.push(C.asNestedTest({options:a,key:p,parent:f,parentPath:a.path,originalParent:d}))}this.runTests({tests:E,value:f,originalValue:d,options:a},i,p=>{s(p.sort(this._sortErrors).concat(g),f)})})}clone(e){const a=super.clone(e);return a.fields=Object.assign({},this.fields),a._nodes=this._nodes,a._excludedEdges=this._excludedEdges,a._sortErrors=this._sortErrors,a}concat(e){let a=super.concat(e),i=a.fields;for(let[s,c]of Object.entries(this.fields)){const d=i[s];i[s]=d===void 0?c:d}return a.withMutation(s=>s.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let a={};return this._nodes.forEach(i=>{var s;const c=this.fields[i];let d=e;(s=d)!=null&&s.value&&(d=Object.assign({},d,{parent:d.value,value:d.value[i]})),a[i]=c&&"getDefault"in c?c.getDefault(d):void 0}),a}setFields(e,a){let i=this.clone();return i.fields=e,i._nodes=o2(e,a),i._sortErrors=Qb(Object.keys(e)),a&&(i._excludedEdges=a),i}shape(e,a=[]){return this.clone().withMutation(i=>{let s=i._excludedEdges;return a.length&&(Array.isArray(a[0])||(a=[a]),s=[...i._excludedEdges,...a]),i.setFields(Object.assign(i.fields,e),s)})}partial(){const e={};for(const[a,i]of Object.entries(this.fields))e[a]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return Cu(this)}pick(e){const a={};for(const i of e)this.fields[i]&&(a[i]=this.fields[i]);return this.setFields(a,this._excludedEdges.filter(([i,s])=>e.includes(i)&&e.includes(s)))}omit(e){const a=[];for(const i of Object.keys(this.fields))e.includes(i)||a.push(i);return this.pick(a)}from(e,a,i){let s=ls.getter(e,!0);return this.transform(c=>{if(!c)return c;let d=c;return c2(c,e)&&(d=Object.assign({},c),i||delete d[e],d[a]=s(c)),d})}json(){return this.transform(l2)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||wu.exact,test(a){if(a==null)return!0;const i=Ny(this.schema,a);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,a=wu.noUnknown){typeof e!="boolean"&&(a=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:a,test(s){if(s==null)return!0;const c=Ny(this.schema,s);return!e||c.length===0||this.createError({params:{unknown:c.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,a=wu.noUnknown){return this.noUnknown(!e,a)}transformKeys(e){return this.transform(a=>{if(!a)return a;const i={};for(const s of Object.keys(a))i[e(s)]=a[s];return i})}camelCase(){return this.transformKeys(_f.camelCase)}snakeCase(){return this.transformKeys(_f.snakeCase)}constantCase(){return this.transformKeys(e=>_f.snakeCase(e).toUpperCase())}describe(e){const a=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[c,d]of Object.entries(a.fields)){var s;let m=e;(s=m)!=null&&s.value&&(m=Object.assign({},m,{parent:m.value,value:m.value[c]})),i.fields[c]=d.describe(m)}return i}}zb.prototype=Vb.prototype;const Kb=({variant:r="dropdown",size:e="md"})=>{const{i18n:a}=Ge(),[i,s]=w.useState(!1),c=w.useRef(null),d=q1(a.language)||Nl[0];w.useEffect(()=>{const g=f=>{c.current&&!c.current.contains(f.target)&&s(!1)};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const m=async g=>{await a.changeLanguage(g),await Ce.setItem("local:language",g),s(!1),a.emit("languageChanged",g)};return r==="buttons"?l.jsx("div",{className:"flex space-x-2",children:Nl.map(g=>l.jsxs("button",{onClick:()=>m(g.code),className:`flex items-center space-x-1 px-2 py-1 text-xs rounded transition-colors ${a.language===g.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:g.nativeName,children:[l.jsx("span",{className:"text-sm",children:g.flag}),l.jsx("span",{children:g.code.toUpperCase()})]},g.code))}):l.jsxs("div",{className:"relative",ref:c,children:[l.jsxs("button",{onClick:()=>s(!i),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 ${e==="sm"?"text-sm":"text-base"}`,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("span",{className:"text-lg",children:d.flag}),l.jsx("span",{children:d.nativeName})]}),l.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&l.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:Nl.map(g=>l.jsxs("button",{onClick:()=>m(g.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 ${e==="sm"?"text-sm":"text-base"}`,children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("span",{className:"text-lg",children:g.flag}),l.jsx("span",{className:"text-gray-700 dark:text-gray-200",children:g.nativeName})]}),a.language===g.code&&l.jsx("svg",{className:"w-4 h-4 text-primary-500",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})})]},g.code))})]})},Mf=[{label:"Aliasvault.net",value:ja.DEFAULT_API_URL},{label:"Self-hosted",value:"custom"}],d2=r=>zb().shape({apiUrl:Ug().required(r("settings.validation.apiUrlRequired")).test("is-valid-api-url",r("settings.validation.apiUrlInvalid"),e=>{if(!e)return!0;try{const a=new URL(e);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}}),clientUrl:Ug().required(r("settings.validation.clientUrlRequired")).test("is-valid-client-url",r("settings.validation.clientUrlInvalid"),e=>{if(!e)return!0;try{const a=new URL(e);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}})}),m2=()=>{const{t:r}=Ge(),[e,a]=w.useState(""),[i,s]=w.useState(""),[c,d]=w.useState(""),[m,g]=w.useState(!0),[f,E]=w.useState({}),{setIsInitialLoading:p}=na(),C=d2(r),I=w.useRef(null),x=w.useRef(null),T=w.useRef(null),k=w.useRef(null);w.useEffect(()=>()=>{if(I.current&&clearTimeout(I.current),x.current&&clearTimeout(x.current),T.current!==null){const _=T.current;Ce.setItem("local:apiUrl",_)}if(k.current!==null){const _=k.current;Ce.setItem("local:clientUrl",_)}},[]),w.useEffect(()=>{(async()=>{const P=await Ce.getItem("local:apiUrl"),K=await Ce.getItem("local:clientUrl"),H=await Ce.getItem(Du)!==!1,Q=await Ce.getItem(io);g(Q?!1:H);const V=Mf.find(G=>G.value===P);V?a(V.value):P?(a("custom"),s(P),d(K??"")):a(Mf[0].value),p(!1)})()},[p]);const R=async _=>{const P=_.target.value;a(P),P!=="custom"&&(await Ce.setItem("local:apiUrl",""),await Ce.setItem("local:clientUrl",""),s(""),d(""),E({}))},B=w.useCallback(_=>{const P=_.target.value;s(P),T.current=P,I.current&&clearTimeout(I.current),I.current=setTimeout(async()=>{try{await C.validateAt("apiUrl",{apiUrl:P}),E(K=>({...K,apiUrl:void 0})),await Ce.setItem("local:apiUrl",P),T.current=null}catch(K){K instanceof Ga&&(E(H=>({...H,apiUrl:K.message})),await Ce.setItem("local:apiUrl",ja.DEFAULT_API_URL),await Ce.setItem("local:clientUrl",ja.DEFAULT_CLIENT_URL),T.current=null)}},150)},[C]),S=w.useCallback(_=>{const P=_.target.value;d(P),k.current=P,x.current&&clearTimeout(x.current),x.current=setTimeout(async()=>{try{await C.validateAt("clientUrl",{clientUrl:P}),E(K=>({...K,clientUrl:void 0})),await Ce.setItem("local:clientUrl",P),k.current=null}catch(K){K instanceof Ga&&(E(H=>({...H,clientUrl:K.message})),k.current=null)}},150)},[C]),j=async()=>{const _=!m;await Ce.setItem(Du,_),_&&(await Ce.setItem(bu,[]),await Ce.setItem(io,0)),g(_)};return l.jsxs("div",{className:"p-4 space-y-6",children:[l.jsxs("div",{className:"space-y-4 pb-6 border-b border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.serverConfiguration","Server Configuration")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("settings.serverConfigurationDescription","Configure the AliasVault server URL for self-hosted instances")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"api-connection",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.serverUrl")}),l.jsx("select",{id:"api-connection",value:e,onChange:R,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:Mf.map(_=>l.jsx("option",{value:_.value,children:_.label},_.value))})]}),e==="custom"&&l.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary-500",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"custom-api-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.customApiUrl","API URL")}),l.jsx("input",{id:"custom-api-url",type:"text",value:i,onChange:B,placeholder:"https://vault.example.com/api",className:`w-full bg-gray-50 border ${f.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`}),f.apiUrl&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.apiUrl}),l.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r("settings.apiUrlHint","The API endpoint URL (usually client URL + /api)")})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"custom-client-url",className:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2",children:r("settings.customClientUrl","Client URL")}),l.jsx("input",{id:"custom-client-url",type:"text",value:c,onChange:S,placeholder:"https://vault.example.com",className:`w-full bg-gray-50 border ${f.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`}),f.clientUrl&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.clientUrl}),l.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r("settings.clientUrlHint","The web interface URL of your self-hosted instance")})]})]})]}),l.jsxs("div",{className:"space-y-4 pb-6 border-b border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.autofillSettings","Autofill Settings")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("settings.autofillSettingsDescription","Enable or disable the autofill popup on web pages")})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r("settings.autofillEnabled")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:m?r("settings.autofillEnabledDescription","Autofill suggestions will appear on login forms"):r("settings.autofillDisabledDescription","Autofill suggestions are disabled globally")})]}),l.jsx("button",{onClick:j,className:`px-4 py-2 rounded-md transition-colors font-medium text-sm ${m?"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:m?r("common.enabled","Enabled"):r("common.disabled","Disabled")})]})]}),l.jsxs("div",{className:"space-y-4 pb-6",children:[l.jsx("div",{children:l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-1",children:r("settings.languageSettings","Language")})}),l.jsx("div",{children:l.jsx(Kb,{variant:"dropdown",size:"sm"})})]}),l.jsxs("div",{className:"text-center text-xs text-gray-400 dark:text-gray-600 pt-4 border-t border-gray-200 dark:border-gray-700",children:[r("settings.version"),": ",ja.VERSION]})]})},ta=w.forwardRef(({onClick:r,id:e,children:a,type:i="button",variant:s="primary"},c)=>{const d={primary:"bg-primary-500 hover:bg-primary-600",secondary:"bg-gray-500 hover:bg-gray-600"};return l.jsx("button",{ref:c,className:`${d[s]} text-white font-medium rounded-lg px-4 py-2 text-sm w-full`,onClick:r,type:i,id:e,children:a})});ta.displayName="Button";var Zs={},Ff,xy;function f2(){return xy||(xy=1,Ff=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ff}var Of={},wi={},Ty;function ms(){if(Ty)return wi;Ty=1;let r;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return wi.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},wi.getSymbolTotalCodewords=function(i){return e[i]},wi.getBCHDigit=function(a){let i=0;for(;a!==0;)i++,a>>>=1;return i},wi.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');r=i},wi.isKanjiModeEnabled=function(){return typeof r<"u"},wi.toSJIS=function(i){return r(i)},wi}var jf={},Sy;function lh(){return Sy||(Sy=1,function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+a)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,s){if(r.isValid(i))return i;try{return e(i)}catch{return s}}}(jf)),jf}var Pf,ky;function g2(){if(ky)return Pf;ky=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(e){const a=Math.floor(e/8);return(this.buffer[a]>>>7-e%8&1)===1},put:function(e,a){for(let i=0;i<a;i++)this.putBit((e>>>a-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),e&&(this.buffer[a]|=128>>>this.length%8),this.length++}},Pf=r,Pf}var Hf,Ly;function h2(){if(Ly)return Hf;Ly=1;function r(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return r.prototype.set=function(e,a,i,s){const c=e*this.size+a;this.data[c]=i,s&&(this.reservedBit[c]=!0)},r.prototype.get=function(e,a){return this.data[e*this.size+a]},r.prototype.xor=function(e,a,i){this.data[e*this.size+a]^=i},r.prototype.isReserved=function(e,a){return this.reservedBit[e*this.size+a]},Hf=r,Hf}var Qf={},Ry;function A2(){return Ry||(Ry=1,function(r){const e=ms().getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];const s=Math.floor(i/7)+2,c=e(i),d=c===145?26:Math.ceil((c-13)/(2*s-2))*2,m=[c-7];for(let g=1;g<s-1;g++)m[g]=m[g-1]-d;return m.push(6),m.reverse()},r.getPositions=function(i){const s=[],c=r.getRowColCoords(i),d=c.length;for(let m=0;m<d;m++)for(let g=0;g<d;g++)m===0&&g===0||m===0&&g===d-1||m===d-1&&g===0||s.push([c[m],c[g]]);return s}}(Qf)),Qf}var zf={},Dy;function p2(){if(Dy)return zf;Dy=1;const r=ms().getSymbolSize,e=7;return zf.getPositions=function(i){const s=r(i);return[[0,0],[s-e,0],[0,s-e]]},zf}var Vf={},By;function y2(){return By||(By=1,function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},r.from=function(s){return r.isValid(s)?parseInt(s,10):void 0},r.getPenaltyN1=function(s){const c=s.size;let d=0,m=0,g=0,f=null,E=null;for(let p=0;p<c;p++){m=g=0,f=E=null;for(let C=0;C<c;C++){let I=s.get(p,C);I===f?m++:(m>=5&&(d+=e.N1+(m-5)),f=I,m=1),I=s.get(C,p),I===E?g++:(g>=5&&(d+=e.N1+(g-5)),E=I,g=1)}m>=5&&(d+=e.N1+(m-5)),g>=5&&(d+=e.N1+(g-5))}return d},r.getPenaltyN2=function(s){const c=s.size;let d=0;for(let m=0;m<c-1;m++)for(let g=0;g<c-1;g++){const f=s.get(m,g)+s.get(m,g+1)+s.get(m+1,g)+s.get(m+1,g+1);(f===4||f===0)&&d++}return d*e.N2},r.getPenaltyN3=function(s){const c=s.size;let d=0,m=0,g=0;for(let f=0;f<c;f++){m=g=0;for(let E=0;E<c;E++)m=m<<1&2047|s.get(f,E),E>=10&&(m===1488||m===93)&&d++,g=g<<1&2047|s.get(E,f),E>=10&&(g===1488||g===93)&&d++}return d*e.N3},r.getPenaltyN4=function(s){let c=0;const d=s.data.length;for(let g=0;g<d;g++)c+=s.data[g];return Math.abs(Math.ceil(c*100/d/5)-10)*e.N4};function a(i,s,c){switch(i){case r.Patterns.PATTERN000:return(s+c)%2===0;case r.Patterns.PATTERN001:return s%2===0;case r.Patterns.PATTERN010:return c%3===0;case r.Patterns.PATTERN011:return(s+c)%3===0;case r.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(c/3))%2===0;case r.Patterns.PATTERN101:return s*c%2+s*c%3===0;case r.Patterns.PATTERN110:return(s*c%2+s*c%3)%2===0;case r.Patterns.PATTERN111:return(s*c%3+(s+c)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(s,c){const d=c.size;for(let m=0;m<d;m++)for(let g=0;g<d;g++)c.isReserved(g,m)||c.xor(g,m,a(s,g,m))},r.getBestMask=function(s,c){const d=Object.keys(r.Patterns).length;let m=0,g=1/0;for(let f=0;f<d;f++){c(f),r.applyMask(f,s);const E=r.getPenaltyN1(s)+r.getPenaltyN2(s)+r.getPenaltyN3(s)+r.getPenaltyN4(s);r.applyMask(f,s),E<g&&(g=E,m=f)}return m}}(Vf)),Vf}var ou={},Uy;function Gb(){if(Uy)return ou;Uy=1;const r=lh(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return ou.getBlocksCount=function(s,c){switch(c){case r.L:return e[(s-1)*4+0];case r.M:return e[(s-1)*4+1];case r.Q:return e[(s-1)*4+2];case r.H:return e[(s-1)*4+3];default:return}},ou.getTotalCodewordsCount=function(s,c){switch(c){case r.L:return a[(s-1)*4+0];case r.M:return a[(s-1)*4+1];case r.Q:return a[(s-1)*4+2];case r.H:return a[(s-1)*4+3];default:return}},ou}var Kf={},Al={},_y;function E2(){if(_y)return Al;_y=1;const r=new Uint8Array(512),e=new Uint8Array(256);return function(){let i=1;for(let s=0;s<255;s++)r[s]=i,e[i]=s,i<<=1,i&256&&(i^=285);for(let s=255;s<512;s++)r[s]=r[s-255]}(),Al.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},Al.exp=function(i){return r[i]},Al.mul=function(i,s){return i===0||s===0?0:r[e[i]+e[s]]},Al}var My;function b2(){return My||(My=1,function(r){const e=E2();r.mul=function(i,s){const c=new Uint8Array(i.length+s.length-1);for(let d=0;d<i.length;d++)for(let m=0;m<s.length;m++)c[d+m]^=e.mul(i[d],s[m]);return c},r.mod=function(i,s){let c=new Uint8Array(i);for(;c.length-s.length>=0;){const d=c[0];for(let g=0;g<s.length;g++)c[g]^=e.mul(s[g],d);let m=0;for(;m<c.length&&c[m]===0;)m++;c=c.slice(m)}return c},r.generateECPolynomial=function(i){let s=new Uint8Array([1]);for(let c=0;c<i;c++)s=r.mul(s,new Uint8Array([1,e.exp(c)]));return s}}(Kf)),Kf}var Gf,Fy;function I2(){if(Fy)return Gf;Fy=1;const r=b2();function e(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=r.generateECPolynomial(this.degree)},e.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(i.length+this.degree);s.set(i);const c=r.mod(s,this.genPoly),d=this.degree-c.length;if(d>0){const m=new Uint8Array(this.degree);return m.set(c,d),m}return c},Gf=e,Gf}var qf={},Wf={},Yf={},Oy;function qb(){return Oy||(Oy=1,Yf.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),Yf}var ar={},jy;function Wb(){if(jy)return ar;jy=1;const r="[0-9]+",e="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
]))+`;ar.KANJI=new RegExp(a,"g"),ar.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ar.BYTE=new RegExp(i,"g"),ar.NUMERIC=new RegExp(r,"g"),ar.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+a+"$"),c=new RegExp("^"+r+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ar.testKanji=function(g){return s.test(g)},ar.testNumeric=function(g){return c.test(g)},ar.testAlphanumeric=function(g){return d.test(g)},ar}var Py;function fs(){return Py||(Py=1,function(r){const e=qb(),a=Wb();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(c,d){if(!c.ccBits)throw new Error("Invalid mode: "+c);if(!e.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?c.ccBits[0]:d<27?c.ccBits[1]:c.ccBits[2]},r.getBestModeForData=function(c){return a.testNumeric(c)?r.NUMERIC:a.testAlphanumeric(c)?r.ALPHANUMERIC:a.testKanji(c)?r.KANJI:r.BYTE},r.toString=function(c){if(c&&c.id)return c.id;throw new Error("Invalid mode")},r.isValid=function(c){return c&&c.bit&&c.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+s)}}r.from=function(c,d){if(r.isValid(c))return c;try{return i(c)}catch{return d}}}(Wf)),Wf}var Hy;function v2(){return Hy||(Hy=1,function(r){const e=ms(),a=Gb(),i=lh(),s=fs(),c=qb(),d=7973,m=e.getBCHDigit(d);function g(C,I,x){for(let T=1;T<=40;T++)if(I<=r.getCapacity(T,x,C))return T}function f(C,I){return s.getCharCountIndicator(C,I)+4}function E(C,I){let x=0;return C.forEach(function(T){const k=f(T.mode,I);x+=k+T.getBitsLength()}),x}function p(C,I){for(let x=1;x<=40;x++)if(E(C,x)<=r.getCapacity(x,I,s.MIXED))return x}r.from=function(I,x){return c.isValid(I)?parseInt(I,10):x},r.getCapacity=function(I,x,T){if(!c.isValid(I))throw new Error("Invalid QR Code version");typeof T>"u"&&(T=s.BYTE);const k=e.getSymbolTotalCodewords(I),R=a.getTotalCodewordsCount(I,x),B=(k-R)*8;if(T===s.MIXED)return B;const S=B-f(T,I);switch(T){case s.NUMERIC:return Math.floor(S/10*3);case s.ALPHANUMERIC:return Math.floor(S/11*2);case s.KANJI:return Math.floor(S/13);case s.BYTE:default:return Math.floor(S/8)}},r.getBestVersionForData=function(I,x){let T;const k=i.from(x,i.M);if(Array.isArray(I)){if(I.length>1)return p(I,k);if(I.length===0)return 1;T=I[0]}else T=I;return g(T.mode,T.getLength(),k)},r.getEncodedBits=function(I){if(!c.isValid(I)||I<7)throw new Error("Invalid QR Code version");let x=I<<12;for(;e.getBCHDigit(x)-m>=0;)x^=d<<e.getBCHDigit(x)-m;return I<<12|x}}(qf)),qf}var Jf={},Qy;function w2(){if(Qy)return Jf;Qy=1;const r=ms(),e=1335,a=21522,i=r.getBCHDigit(e);return Jf.getEncodedBits=function(c,d){const m=c.bit<<3|d;let g=m<<10;for(;r.getBCHDigit(g)-i>=0;)g^=e<<r.getBCHDigit(g)-i;return(m<<10|g)^a},Jf}var Xf={},$f,zy;function C2(){if(zy)return $f;zy=1;const r=fs();function e(a){this.mode=r.NUMERIC,this.data=a.toString()}return e.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){let s,c,d;for(s=0;s+3<=this.data.length;s+=3)c=this.data.substr(s,3),d=parseInt(c,10),i.put(d,10);const m=this.data.length-s;m>0&&(c=this.data.substr(s),d=parseInt(c,10),i.put(d,m*3+1))},$f=e,$f}var Zf,Vy;function N2(){if(Vy)return Zf;Vy=1;const r=fs(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(i){this.mode=r.ALPHANUMERIC,this.data=i}return a.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(s){let c;for(c=0;c+2<=this.data.length;c+=2){let d=e.indexOf(this.data[c])*45;d+=e.indexOf(this.data[c+1]),s.put(d,11)}this.data.length%2&&s.put(e.indexOf(this.data[c]),6)},Zf=a,Zf}var eg,Ky;function x2(){if(Ky)return eg;Ky=1;const r=fs();function e(a){this.mode=r.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return e.getBitsLength=function(i){return i*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(a){for(let i=0,s=this.data.length;i<s;i++)a.put(this.data[i],8)},eg=e,eg}var tg,Gy;function T2(){if(Gy)return tg;Gy=1;const r=fs(),e=ms();function a(i){this.mode=r.KANJI,this.data=i}return a.getBitsLength=function(s){return s*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(i){let s;for(s=0;s<this.data.length;s++){let c=e.toSJIS(this.data[s]);if(c>=33088&&c<=40956)c-=33088;else if(c>=57408&&c<=60351)c-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
Make sure your charset is UTF-8`);c=(c>>>8&255)*192+(c&255),i.put(c,13)}},tg=a,tg}var ag={exports:{}},qy;function S2(){return qy||(qy=1,function(r){var e={single_source_shortest_paths:function(a,i,s){var c={},d={};d[i]=0;var m=e.PriorityQueue.make();m.push(i,0);for(var g,f,E,p,C,I,x,T,k;!m.empty();){g=m.pop(),f=g.value,p=g.cost,C=a[f]||{};for(E in C)C.hasOwnProperty(E)&&(I=C[E],x=p+I,T=d[E],k=typeof d[E]>"u",(k||T>x)&&(d[E]=x,m.push(E,x),c[E]=f))}if(typeof s<"u"&&typeof d[s]>"u"){var R=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(R)}return c},extract_shortest_path_from_predecessor_list:function(a,i){for(var s=[],c=i;c;)s.push(c),a[c],c=a[c];return s.reverse(),s},find_path:function(a,i,s){var c=e.single_source_shortest_paths(a,i,s);return e.extract_shortest_path_from_predecessor_list(c,s)},PriorityQueue:{make:function(a){var i=e.PriorityQueue,s={},c;a=a||{};for(c in i)i.hasOwnProperty(c)&&(s[c]=i[c]);return s.queue=[],s.sorter=a.sorter||i.default_sorter,s},default_sorter:function(a,i){return a.cost-i.cost},push:function(a,i){var s={value:a,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=e}(ag)),ag.exports}var Wy;function k2(){return Wy||(Wy=1,function(r){const e=fs(),a=C2(),i=N2(),s=x2(),c=T2(),d=Wb(),m=ms(),g=S2();function f(R){return unescape(encodeURIComponent(R)).length}function E(R,B,S){const j=[];let _;for(;(_=R.exec(S))!==null;)j.push({data:_[0],index:_.index,mode:B,length:_[0].length});return j}function p(R){const B=E(d.NUMERIC,e.NUMERIC,R),S=E(d.ALPHANUMERIC,e.ALPHANUMERIC,R);let j,_;return m.isKanjiModeEnabled()?(j=E(d.BYTE,e.BYTE,R),_=E(d.KANJI,e.KANJI,R)):(j=E(d.BYTE_KANJI,e.BYTE,R),_=[]),B.concat(S,j,_).sort(function(K,H){return K.index-H.index}).map(function(K){return{data:K.data,mode:K.mode,length:K.length}})}function C(R,B){switch(B){case e.NUMERIC:return a.getBitsLength(R);case e.ALPHANUMERIC:return i.getBitsLength(R);case e.KANJI:return c.getBitsLength(R);case e.BYTE:return s.getBitsLength(R)}}function I(R){return R.reduce(function(B,S){const j=B.length-1>=0?B[B.length-1]:null;return j&&j.mode===S.mode?(B[B.length-1].data+=S.data,B):(B.push(S),B)},[])}function x(R){const B=[];for(let S=0;S<R.length;S++){const j=R[S];switch(j.mode){case e.NUMERIC:B.push([j,{data:j.data,mode:e.ALPHANUMERIC,length:j.length},{data:j.data,mode:e.BYTE,length:j.length}]);break;case e.ALPHANUMERIC:B.push([j,{data:j.data,mode:e.BYTE,length:j.length}]);break;case e.KANJI:B.push([j,{data:j.data,mode:e.BYTE,length:f(j.data)}]);break;case e.BYTE:B.push([{data:j.data,mode:e.BYTE,length:f(j.data)}])}}return B}function T(R,B){const S={},j={start:{}};let _=["start"];for(let P=0;P<R.length;P++){const K=R[P],H=[];for(let Q=0;Q<K.length;Q++){const V=K[Q],G=""+P+Q;H.push(G),S[G]={node:V,lastCount:0},j[G]={};for(let q=0;q<_.length;q++){const W=_[q];S[W]&&S[W].node.mode===V.mode?(j[W][G]=C(S[W].lastCount+V.length,V.mode)-C(S[W].lastCount,V.mode),S[W].lastCount+=V.length):(S[W]&&(S[W].lastCount=V.length),j[W][G]=C(V.length,V.mode)+4+e.getCharCountIndicator(V.mode,B))}}_=H}for(let P=0;P<_.length;P++)j[_[P]].end=0;return{map:j,table:S}}function k(R,B){let S;const j=e.getBestModeForData(R);if(S=e.from(B,j),S!==e.BYTE&&S.bit<j.bit)throw new Error('"'+R+'" cannot be encoded with mode '+e.toString(S)+`.
 Suggested mode is: `+e.toString(j));switch(S===e.KANJI&&!m.isKanjiModeEnabled()&&(S=e.BYTE),S){case e.NUMERIC:return new a(R);case e.ALPHANUMERIC:return new i(R);case e.KANJI:return new c(R);case e.BYTE:return new s(R)}}r.fromArray=function(B){return B.reduce(function(S,j){return typeof j=="string"?S.push(k(j,null)):j.data&&S.push(k(j.data,j.mode)),S},[])},r.fromString=function(B,S){const j=p(B,m.isKanjiModeEnabled()),_=x(j),P=T(_,S),K=g.find_path(P.map,"start","end"),H=[];for(let Q=1;Q<K.length-1;Q++)H.push(P.table[K[Q]].node);return r.fromArray(I(H))},r.rawSplit=function(B){return r.fromArray(p(B,m.isKanjiModeEnabled()))}}(Xf)),Xf}var Yy;function L2(){if(Yy)return Of;Yy=1;const r=ms(),e=lh(),a=g2(),i=h2(),s=A2(),c=p2(),d=y2(),m=Gb(),g=I2(),f=v2(),E=w2(),p=fs(),C=k2();function I(P,K){const H=P.size,Q=c.getPositions(K);for(let V=0;V<Q.length;V++){const G=Q[V][0],q=Q[V][1];for(let W=-1;W<=7;W++)if(!(G+W<=-1||H<=G+W))for(let ne=-1;ne<=7;ne++)q+ne<=-1||H<=q+ne||(W>=0&&W<=6&&(ne===0||ne===6)||ne>=0&&ne<=6&&(W===0||W===6)||W>=2&&W<=4&&ne>=2&&ne<=4?P.set(G+W,q+ne,!0,!0):P.set(G+W,q+ne,!1,!0))}}function x(P){const K=P.size;for(let H=8;H<K-8;H++){const Q=H%2===0;P.set(H,6,Q,!0),P.set(6,H,Q,!0)}}function T(P,K){const H=s.getPositions(K);for(let Q=0;Q<H.length;Q++){const V=H[Q][0],G=H[Q][1];for(let q=-2;q<=2;q++)for(let W=-2;W<=2;W++)q===-2||q===2||W===-2||W===2||q===0&&W===0?P.set(V+q,G+W,!0,!0):P.set(V+q,G+W,!1,!0)}}function k(P,K){const H=P.size,Q=f.getEncodedBits(K);let V,G,q;for(let W=0;W<18;W++)V=Math.floor(W/3),G=W%3+H-8-3,q=(Q>>W&1)===1,P.set(V,G,q,!0),P.set(G,V,q,!0)}function R(P,K,H){const Q=P.size,V=E.getEncodedBits(K,H);let G,q;for(G=0;G<15;G++)q=(V>>G&1)===1,G<6?P.set(G,8,q,!0):G<8?P.set(G+1,8,q,!0):P.set(Q-15+G,8,q,!0),G<8?P.set(8,Q-G-1,q,!0):G<9?P.set(8,15-G-1+1,q,!0):P.set(8,15-G-1,q,!0);P.set(Q-8,8,1,!0)}function B(P,K){const H=P.size;let Q=-1,V=H-1,G=7,q=0;for(let W=H-1;W>0;W-=2)for(W===6&&W--;;){for(let ne=0;ne<2;ne++)if(!P.isReserved(V,W-ne)){let de=!1;q<K.length&&(de=(K[q]>>>G&1)===1),P.set(V,W-ne,de),G--,G===-1&&(q++,G=7)}if(V+=Q,V<0||H<=V){V-=Q,Q=-Q;break}}}function S(P,K,H){const Q=new a;H.forEach(function(ne){Q.put(ne.mode.bit,4),Q.put(ne.getLength(),p.getCharCountIndicator(ne.mode,P)),ne.write(Q)});const V=r.getSymbolTotalCodewords(P),G=m.getTotalCodewordsCount(P,K),q=(V-G)*8;for(Q.getLengthInBits()+4<=q&&Q.put(0,4);Q.getLengthInBits()%8!==0;)Q.putBit(0);const W=(q-Q.getLengthInBits())/8;for(let ne=0;ne<W;ne++)Q.put(ne%2?17:236,8);return j(Q,P,K)}function j(P,K,H){const Q=r.getSymbolTotalCodewords(K),V=m.getTotalCodewordsCount(K,H),G=Q-V,q=m.getBlocksCount(K,H),W=Q%q,ne=q-W,de=Math.floor(Q/q),X=Math.floor(G/q),ae=X+1,pe=de-X,Ae=new g(pe);let O=0;const $=new Array(q),Z=new Array(q);let ce=0;const be=new Uint8Array(P.buffer);for(let Oe=0;Oe<q;Oe++){const Ne=Oe<ne?X:ae;$[Oe]=be.slice(O,O+Ne),Z[Oe]=Ae.encode($[Oe]),O+=Ne,ce=Math.max(ce,Ne)}const Le=new Uint8Array(Q);let ke=0,Se,Te;for(Se=0;Se<ce;Se++)for(Te=0;Te<q;Te++)Se<$[Te].length&&(Le[ke++]=$[Te][Se]);for(Se=0;Se<pe;Se++)for(Te=0;Te<q;Te++)Le[ke++]=Z[Te][Se];return Le}function _(P,K,H,Q){let V;if(Array.isArray(P))V=C.fromArray(P);else if(typeof P=="string"){let de=K;if(!de){const X=C.rawSplit(P);de=f.getBestVersionForData(X,H)}V=C.fromString(P,de||40)}else throw new Error("Invalid data");const G=f.getBestVersionForData(V,H);if(!G)throw new Error("The amount of data is too big to be stored in a QR Code");if(!K)K=G;else if(K<G)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+G+`.
`);const q=S(K,H,V),W=r.getSymbolSize(K),ne=new i(W);return I(ne,K),x(ne),T(ne,K),R(ne,H,0),K>=7&&k(ne,K),B(ne,q),isNaN(Q)&&(Q=d.getBestMask(ne,R.bind(null,ne,H))),d.applyMask(Q,ne),R(ne,H,Q),{modules:ne,version:K,errorCorrectionLevel:H,maskPattern:Q,segments:V}}return Of.create=function(K,H){if(typeof K>"u"||K==="")throw new Error("No input text");let Q=e.M,V,G;return typeof H<"u"&&(Q=e.from(H.errorCorrectionLevel,e.M),V=f.from(H.version),G=d.from(H.maskPattern),H.toSJISFunc&&r.setToSJISFunction(H.toSJISFunc)),_(K,V,Q,G)},Of}var ng={},rg={},Jy;function Yb(){return Jy||(Jy=1,function(r){function e(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let i=a.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+a);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(c){return[c,c]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}r.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,c=i.width&&i.width>=21?i.width:void 0,d=i.scale||4;return{width:c,scale:c?4:d,margin:s,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},r.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},r.getImageWidth=function(i,s){const c=r.getScale(i,s);return Math.floor((i+s.margin*2)*c)},r.qrToImageData=function(i,s,c){const d=s.modules.size,m=s.modules.data,g=r.getScale(d,c),f=Math.floor((d+c.margin*2)*g),E=c.margin*g,p=[c.color.light,c.color.dark];for(let C=0;C<f;C++)for(let I=0;I<f;I++){let x=(C*f+I)*4,T=c.color.light;if(C>=E&&I>=E&&C<f-E&&I<f-E){const k=Math.floor((C-E)/g),R=Math.floor((I-E)/g);T=p[m[k*d+R]?1:0]}i[x++]=T.r,i[x++]=T.g,i[x++]=T.b,i[x]=T.a}}}(rg)),rg}var Xy;function R2(){return Xy||(Xy=1,function(r){const e=Yb();function a(s,c,d){s.clearRect(0,0,c.width,c.height),c.style||(c.style={}),c.height=d,c.width=d,c.style.height=d+"px",c.style.width=d+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(c,d,m){let g=m,f=d;typeof g>"u"&&(!d||!d.getContext)&&(g=d,d=void 0),d||(f=i()),g=e.getOptions(g);const E=e.getImageWidth(c.modules.size,g),p=f.getContext("2d"),C=p.createImageData(E,E);return e.qrToImageData(C.data,c,g),a(p,f,E),p.putImageData(C,0,0),f},r.renderToDataURL=function(c,d,m){let g=m;typeof g>"u"&&(!d||!d.getContext)&&(g=d,d=void 0),g||(g={});const f=r.render(c,d,g),E=g.type||"image/png",p=g.rendererOpts||{};return f.toDataURL(E,p.quality)}}(ng)),ng}var ig={},$y;function D2(){if($y)return ig;$y=1;const r=Yb();function e(s,c){const d=s.a/255,m=c+'="'+s.hex+'"';return d<1?m+" "+c+'-opacity="'+d.toFixed(2).slice(1)+'"':m}function a(s,c,d){let m=s+c;return typeof d<"u"&&(m+=" "+d),m}function i(s,c,d){let m="",g=0,f=!1,E=0;for(let p=0;p<s.length;p++){const C=Math.floor(p%c),I=Math.floor(p/c);!C&&!f&&(f=!0),s[p]?(E++,p>0&&C>0&&s[p-1]||(m+=f?a("M",C+d,.5+I+d):a("m",g,0),g=0,f=!1),C+1<c&&s[p+1]||(m+=a("h",E),E=0)):g++}return m}return ig.render=function(c,d,m){const g=r.getOptions(d),f=c.modules.size,E=c.modules.data,p=f+g.margin*2,C=g.color.light.a?"<path "+e(g.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",I="<path "+e(g.color.dark,"stroke")+' d="'+i(E,f,g.margin)+'"/>',x='viewBox="0 0 '+p+" "+p+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(g.width?'width="'+g.width+'" height="'+g.width+'" ':"")+x+' shape-rendering="crispEdges">'+C+I+`</svg>
`;return typeof m=="function"&&m(null,k),k},ig}var Zy;function B2(){if(Zy)return Zs;Zy=1;const r=f2(),e=L2(),a=R2(),i=D2();function s(c,d,m,g,f){const E=[].slice.call(arguments,1),p=E.length,C=typeof E[p-1]=="function";if(!C&&!r())throw new Error("Callback required as last argument");if(C){if(p<2)throw new Error("Too few arguments provided");p===2?(f=m,m=d,d=g=void 0):p===3&&(d.getContext&&typeof f>"u"?(f=g,g=void 0):(f=g,g=m,m=d,d=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(m=d,d=g=void 0):p===2&&!d.getContext&&(g=m,m=d,d=void 0),new Promise(function(I,x){try{const T=e.create(m,g);I(c(T,d,g))}catch(T){x(T)}})}try{const I=e.create(m,g);f(null,c(I,d,g))}catch(I){f(I)}}return Zs.create=e.create,Zs.toCanvas=s.bind(null,a.render),Zs.toDataURL=s.bind(null,a.renderToDataURL),Zs.toString=s.bind(null,function(c,d,m){return i.render(c,m)}),Zs}var U2=B2();const _2=Ri(U2),_n=({isOpen:r,onClose:e,title:a,children:i,maxWidth:s="max-w-md",showCloseButton:c=!0,footer:d,showHeaderBorder:m=!0,bodyClassName:g="px-6 py-4"})=>{const{t:f}=Ge(),E=w.useCallback(I=>{I.key==="Escape"&&e()},[e]);if(w.useEffect(()=>{if(r)return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[r,E]),!r)return null;const p=I=>{I.target===I.currentTarget&&e()},C=a||c;return l.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 transition-opacity",onClick:e}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:p,children:l.jsxs("div",{className:`relative transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow-xl transition-all w-full ${s} mx-4`,children:[C&&l.jsxs("div",{className:`px-6 py-4 flex items-center justify-between ${m?"border-b border-gray-200 dark:border-gray-700":""}`,children:[a&&l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:a}),!a&&l.jsx("div",{}),c&&l.jsxs("button",{type:"button",className:"text-gray-400 hover:text-gray-500 focus:outline-none",onClick:e,children:[l.jsx("span",{className:"sr-only",children:f("common.close")}),l.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})]}),l.jsx("div",{className:g,children:i}),d&&l.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:d})]})})]})};var bn=(r=>(r.TIMEOUT="TIMEOUT",r.GENERIC="GENERIC",r))(bn||{}),sg={},pl={},eE;function M2(){if(eE)return pl;eE=1,pl.byteLength=m,pl.toByteArray=f,pl.fromByteArray=C;for(var r=[],e=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=i.length;s<c;++s)r[s]=i[s],e[i.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(I){var x=I.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=I.indexOf("=");T===-1&&(T=x);var k=T===x?0:4-T%4;return[T,k]}function m(I){var x=d(I),T=x[0],k=x[1];return(T+k)*3/4-k}function g(I,x,T){return(x+T)*3/4-T}function f(I){var x,T=d(I),k=T[0],R=T[1],B=new a(g(I,k,R)),S=0,j=R>0?k-4:k,_;for(_=0;_<j;_+=4)x=e[I.charCodeAt(_)]<<18|e[I.charCodeAt(_+1)]<<12|e[I.charCodeAt(_+2)]<<6|e[I.charCodeAt(_+3)],B[S++]=x>>16&255,B[S++]=x>>8&255,B[S++]=x&255;return R===2&&(x=e[I.charCodeAt(_)]<<2|e[I.charCodeAt(_+1)]>>4,B[S++]=x&255),R===1&&(x=e[I.charCodeAt(_)]<<10|e[I.charCodeAt(_+1)]<<4|e[I.charCodeAt(_+2)]>>2,B[S++]=x>>8&255,B[S++]=x&255),B}function E(I){return r[I>>18&63]+r[I>>12&63]+r[I>>6&63]+r[I&63]}function p(I,x,T){for(var k,R=[],B=x;B<T;B+=3)k=(I[B]<<16&16711680)+(I[B+1]<<8&65280)+(I[B+2]&255),R.push(E(k));return R.join("")}function C(I){for(var x,T=I.length,k=T%3,R=[],B=16383,S=0,j=T-k;S<j;S+=B)R.push(p(I,S,S+B>j?j:S+B));return k===1?(x=I[T-1],R.push(r[x>>2]+r[x<<4&63]+"==")):k===2&&(x=(I[T-2]<<8)+I[T-1],R.push(r[x>>10]+r[x>>4&63]+r[x<<2&63]+"=")),R.join("")}return pl}var lu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var tE;function F2(){return tE||(tE=1,lu.read=function(r,e,a,i,s){var c,d,m=s*8-i-1,g=(1<<m)-1,f=g>>1,E=-7,p=a?s-1:0,C=a?-1:1,I=r[e+p];for(p+=C,c=I&(1<<-E)-1,I>>=-E,E+=m;E>0;c=c*256+r[e+p],p+=C,E-=8);for(d=c&(1<<-E)-1,c>>=-E,E+=i;E>0;d=d*256+r[e+p],p+=C,E-=8);if(c===0)c=1-f;else{if(c===g)return d?NaN:(I?-1:1)*(1/0);d=d+Math.pow(2,i),c=c-f}return(I?-1:1)*d*Math.pow(2,c-i)},lu.write=function(r,e,a,i,s,c){var d,m,g,f=c*8-s-1,E=(1<<f)-1,p=E>>1,C=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=i?0:c-1,x=i?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,d=E):(d=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-d))<1&&(d--,g*=2),d+p>=1?e+=C/g:e+=C*Math.pow(2,1-p),e*g>=2&&(d++,g/=2),d+p>=E?(m=0,d=E):d+p>=1?(m=(e*g-1)*Math.pow(2,s),d=d+p):(m=e*Math.pow(2,p-1)*Math.pow(2,s),d=0));s>=8;r[a+I]=m&255,I+=x,m/=256,s-=8);for(d=d<<s|m,f+=s;f>0;r[a+I]=d&255,I+=x,d/=256,f-=8);r[a+I-x]|=T*128}),lu}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var aE;function O2(){return aE||(aE=1,function(r){const e=M2(),a=F2(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=m,r.SlowBuffer=B,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.kMaxLength=s,m.TYPED_ARRAY_SUPPORT=c(),!m.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 c(){try{const U=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(U,v),U.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function d(U){if(U>s)throw new RangeError('The value "'+U+'" is invalid for option "size"');const v=new Uint8Array(U);return Object.setPrototypeOf(v,m.prototype),v}function m(U,v,N){if(typeof U=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(U)}return g(U,v,N)}m.poolSize=8192;function g(U,v,N){if(typeof U=="string")return C(U,v);if(ArrayBuffer.isView(U))return x(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(At(U,ArrayBuffer)||U&&At(U.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(At(U,SharedArrayBuffer)||U&&At(U.buffer,SharedArrayBuffer)))return T(U,v,N);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const z=U.valueOf&&U.valueOf();if(z!=null&&z!==U)return m.from(z,v,N);const te=k(U);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return m.from(U[Symbol.toPrimitive]("string"),v,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}m.from=function(U,v,N){return g(U,v,N)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function f(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function E(U,v,N){return f(U),U<=0?d(U):v!==void 0?typeof N=="string"?d(U).fill(v,N):d(U).fill(v):d(U)}m.alloc=function(U,v,N){return E(U,v,N)};function p(U){return f(U),d(U<0?0:R(U)|0)}m.allocUnsafe=function(U){return p(U)},m.allocUnsafeSlow=function(U){return p(U)};function C(U,v){if((typeof v!="string"||v==="")&&(v="utf8"),!m.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const N=S(U,v)|0;let z=d(N);const te=z.write(U,v);return te!==N&&(z=z.slice(0,te)),z}function I(U){const v=U.length<0?0:R(U.length)|0,N=d(v);for(let z=0;z<v;z+=1)N[z]=U[z]&255;return N}function x(U){if(At(U,Uint8Array)){const v=new Uint8Array(U);return T(v.buffer,v.byteOffset,v.byteLength)}return I(U)}function T(U,v,N){if(v<0||U.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<v+(N||0))throw new RangeError('"length" is outside of buffer bounds');let z;return v===void 0&&N===void 0?z=new Uint8Array(U):N===void 0?z=new Uint8Array(U,v):z=new Uint8Array(U,v,N),Object.setPrototypeOf(z,m.prototype),z}function k(U){if(m.isBuffer(U)){const v=R(U.length)|0,N=d(v);return N.length===0||U.copy(N,0,0,v),N}if(U.length!==void 0)return typeof U.length!="number"||Ot(U.length)?d(0):I(U);if(U.type==="Buffer"&&Array.isArray(U.data))return I(U.data)}function R(U){if(U>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return U|0}function B(U){return+U!=U&&(U=0),m.alloc(+U)}m.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==m.prototype},m.compare=function(v,N){if(At(v,Uint8Array)&&(v=m.from(v,v.offset,v.byteLength)),At(N,Uint8Array)&&(N=m.from(N,N.offset,N.byteLength)),!m.isBuffer(v)||!m.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===N)return 0;let z=v.length,te=N.length;for(let fe=0,ye=Math.min(z,te);fe<ye;++fe)if(v[fe]!==N[fe]){z=v[fe],te=N[fe];break}return z<te?-1:te<z?1:0},m.isEncoding=function(v){switch(String(v).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}},m.concat=function(v,N){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return m.alloc(0);let z;if(N===void 0)for(N=0,z=0;z<v.length;++z)N+=v[z].length;const te=m.allocUnsafe(N);let fe=0;for(z=0;z<v.length;++z){let ye=v[z];if(At(ye,Uint8Array))fe+ye.length>te.length?(m.isBuffer(ye)||(ye=m.from(ye)),ye.copy(te,fe)):Uint8Array.prototype.set.call(te,ye,fe);else if(m.isBuffer(ye))ye.copy(te,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=ye.length}return te};function S(U,v){if(m.isBuffer(U))return U.length;if(ArrayBuffer.isView(U)||At(U,ArrayBuffer))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const N=U.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&N===0)return 0;let te=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return Re(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return dt(U).length;default:if(te)return z?-1:Re(U).length;v=(""+v).toLowerCase(),te=!0}}m.byteLength=S;function j(U,v,N){let z=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,v>>>=0,N<=v))return"";for(U||(U="utf8");;)switch(U){case"hex":return Ae(this,v,N);case"utf8":case"utf-8":return ne(this,v,N);case"ascii":return ae(this,v,N);case"latin1":case"binary":return pe(this,v,N);case"base64":return W(this,v,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,v,N);default:if(z)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),z=!0}}m.prototype._isBuffer=!0;function _(U,v,N){const z=U[v];U[v]=U[N],U[N]=z}m.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<v;N+=2)_(this,N,N+1);return this},m.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<v;N+=4)_(this,N,N+3),_(this,N+1,N+2);return this},m.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<v;N+=8)_(this,N,N+7),_(this,N+1,N+6),_(this,N+2,N+5),_(this,N+3,N+4);return this},m.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?ne(this,0,v):j.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(v){if(!m.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:m.compare(this,v)===0},m.prototype.inspect=function(){let v="";const N=r.INSPECT_MAX_BYTES;return v=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(v+=" ... "),"<Buffer "+v+">"},i&&(m.prototype[i]=m.prototype.inspect),m.prototype.compare=function(v,N,z,te,fe){if(At(v,Uint8Array)&&(v=m.from(v,v.offset,v.byteLength)),!m.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(N===void 0&&(N=0),z===void 0&&(z=v?v.length:0),te===void 0&&(te=0),fe===void 0&&(fe=this.length),N<0||z>v.length||te<0||fe>this.length)throw new RangeError("out of range index");if(te>=fe&&N>=z)return 0;if(te>=fe)return-1;if(N>=z)return 1;if(N>>>=0,z>>>=0,te>>>=0,fe>>>=0,this===v)return 0;let ye=fe-te,De=z-N;const Nt=Math.min(ye,De),xt=this.slice(te,fe),St=v.slice(N,z);for(let mt=0;mt<Nt;++mt)if(xt[mt]!==St[mt]){ye=xt[mt],De=St[mt];break}return ye<De?-1:De<ye?1:0};function P(U,v,N,z,te){if(U.length===0)return-1;if(typeof N=="string"?(z=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,Ot(N)&&(N=te?0:U.length-1),N<0&&(N=U.length+N),N>=U.length){if(te)return-1;N=U.length-1}else if(N<0)if(te)N=0;else return-1;if(typeof v=="string"&&(v=m.from(v,z)),m.isBuffer(v))return v.length===0?-1:K(U,v,N,z,te);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(U,v,N):Uint8Array.prototype.lastIndexOf.call(U,v,N):K(U,[v],N,z,te);throw new TypeError("val must be string, number or Buffer")}function K(U,v,N,z,te){let fe=1,ye=U.length,De=v.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(U.length<2||v.length<2)return-1;fe=2,ye/=2,De/=2,N/=2}function Nt(St,mt){return fe===1?St[mt]:St.readUInt16BE(mt*fe)}let xt;if(te){let St=-1;for(xt=N;xt<ye;xt++)if(Nt(U,xt)===Nt(v,St===-1?0:xt-St)){if(St===-1&&(St=xt),xt-St+1===De)return St*fe}else St!==-1&&(xt-=xt-St),St=-1}else for(N+De>ye&&(N=ye-De),xt=N;xt>=0;xt--){let St=!0;for(let mt=0;mt<De;mt++)if(Nt(U,xt+mt)!==Nt(v,mt)){St=!1;break}if(St)return xt}return-1}m.prototype.includes=function(v,N,z){return this.indexOf(v,N,z)!==-1},m.prototype.indexOf=function(v,N,z){return P(this,v,N,z,!0)},m.prototype.lastIndexOf=function(v,N,z){return P(this,v,N,z,!1)};function H(U,v,N,z){N=Number(N)||0;const te=U.length-N;z?(z=Number(z),z>te&&(z=te)):z=te;const fe=v.length;z>fe/2&&(z=fe/2);let ye;for(ye=0;ye<z;++ye){const De=parseInt(v.substr(ye*2,2),16);if(Ot(De))return ye;U[N+ye]=De}return ye}function Q(U,v,N,z){return Je(Re(v,U.length-N),U,N,z)}function V(U,v,N,z){return Je($e(v),U,N,z)}function G(U,v,N,z){return Je(dt(v),U,N,z)}function q(U,v,N,z){return Je(qe(v,U.length-N),U,N,z)}m.prototype.write=function(v,N,z,te){if(N===void 0)te="utf8",z=this.length,N=0;else if(z===void 0&&typeof N=="string")te=N,z=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(z)?(z=z>>>0,te===void 0&&(te="utf8")):(te=z,z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-N;if((z===void 0||z>fe)&&(z=fe),v.length>0&&(z<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let ye=!1;for(;;)switch(te){case"hex":return H(this,v,N,z);case"utf8":case"utf-8":return Q(this,v,N,z);case"ascii":case"latin1":case"binary":return V(this,v,N,z);case"base64":return G(this,v,N,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,v,N,z);default:if(ye)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),ye=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(U,v,N){return v===0&&N===U.length?e.fromByteArray(U):e.fromByteArray(U.slice(v,N))}function ne(U,v,N){N=Math.min(U.length,N);const z=[];let te=v;for(;te<N;){const fe=U[te];let ye=null,De=fe>239?4:fe>223?3:fe>191?2:1;if(te+De<=N){let Nt,xt,St,mt;switch(De){case 1:fe<128&&(ye=fe);break;case 2:Nt=U[te+1],(Nt&192)===128&&(mt=(fe&31)<<6|Nt&63,mt>127&&(ye=mt));break;case 3:Nt=U[te+1],xt=U[te+2],(Nt&192)===128&&(xt&192)===128&&(mt=(fe&15)<<12|(Nt&63)<<6|xt&63,mt>2047&&(mt<55296||mt>57343)&&(ye=mt));break;case 4:Nt=U[te+1],xt=U[te+2],St=U[te+3],(Nt&192)===128&&(xt&192)===128&&(St&192)===128&&(mt=(fe&15)<<18|(Nt&63)<<12|(xt&63)<<6|St&63,mt>65535&&mt<1114112&&(ye=mt))}}ye===null?(ye=65533,De=1):ye>65535&&(ye-=65536,z.push(ye>>>10&1023|55296),ye=56320|ye&1023),z.push(ye),te+=De}return X(z)}const de=4096;function X(U){const v=U.length;if(v<=de)return String.fromCharCode.apply(String,U);let N="",z=0;for(;z<v;)N+=String.fromCharCode.apply(String,U.slice(z,z+=de));return N}function ae(U,v,N){let z="";N=Math.min(U.length,N);for(let te=v;te<N;++te)z+=String.fromCharCode(U[te]&127);return z}function pe(U,v,N){let z="";N=Math.min(U.length,N);for(let te=v;te<N;++te)z+=String.fromCharCode(U[te]);return z}function Ae(U,v,N){const z=U.length;(!v||v<0)&&(v=0),(!N||N<0||N>z)&&(N=z);let te="";for(let fe=v;fe<N;++fe)te+=Wt[U[fe]];return te}function O(U,v,N){const z=U.slice(v,N);let te="";for(let fe=0;fe<z.length-1;fe+=2)te+=String.fromCharCode(z[fe]+z[fe+1]*256);return te}m.prototype.slice=function(v,N){const z=this.length;v=~~v,N=N===void 0?z:~~N,v<0?(v+=z,v<0&&(v=0)):v>z&&(v=z),N<0?(N+=z,N<0&&(N=0)):N>z&&(N=z),N<v&&(N=v);const te=this.subarray(v,N);return Object.setPrototypeOf(te,m.prototype),te};function $(U,v,N){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+v>N)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(v,N,z){v=v>>>0,N=N>>>0,z||$(v,N,this.length);let te=this[v],fe=1,ye=0;for(;++ye<N&&(fe*=256);)te+=this[v+ye]*fe;return te},m.prototype.readUintBE=m.prototype.readUIntBE=function(v,N,z){v=v>>>0,N=N>>>0,z||$(v,N,this.length);let te=this[v+--N],fe=1;for(;N>0&&(fe*=256);)te+=this[v+--N]*fe;return te},m.prototype.readUint8=m.prototype.readUInt8=function(v,N){return v=v>>>0,N||$(v,1,this.length),this[v]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(v,N){return v=v>>>0,N||$(v,2,this.length),this[v]|this[v+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(v,N){return v=v>>>0,N||$(v,2,this.length),this[v]<<8|this[v+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(v,N){return v=v>>>0,N||$(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(v,N){return v=v>>>0,N||$(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},m.prototype.readBigUInt64LE=Zt(function(v){v=v>>>0,Ye(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&rt(v,this.length-8);const te=N+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,fe=this[++v]+this[++v]*2**8+this[++v]*2**16+z*2**24;return BigInt(te)+(BigInt(fe)<<BigInt(32))}),m.prototype.readBigUInt64BE=Zt(function(v){v=v>>>0,Ye(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&rt(v,this.length-8);const te=N*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],fe=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+z;return(BigInt(te)<<BigInt(32))+BigInt(fe)}),m.prototype.readIntLE=function(v,N,z){v=v>>>0,N=N>>>0,z||$(v,N,this.length);let te=this[v],fe=1,ye=0;for(;++ye<N&&(fe*=256);)te+=this[v+ye]*fe;return fe*=128,te>=fe&&(te-=Math.pow(2,8*N)),te},m.prototype.readIntBE=function(v,N,z){v=v>>>0,N=N>>>0,z||$(v,N,this.length);let te=N,fe=1,ye=this[v+--te];for(;te>0&&(fe*=256);)ye+=this[v+--te]*fe;return fe*=128,ye>=fe&&(ye-=Math.pow(2,8*N)),ye},m.prototype.readInt8=function(v,N){return v=v>>>0,N||$(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},m.prototype.readInt16LE=function(v,N){v=v>>>0,N||$(v,2,this.length);const z=this[v]|this[v+1]<<8;return z&32768?z|4294901760:z},m.prototype.readInt16BE=function(v,N){v=v>>>0,N||$(v,2,this.length);const z=this[v+1]|this[v]<<8;return z&32768?z|4294901760:z},m.prototype.readInt32LE=function(v,N){return v=v>>>0,N||$(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},m.prototype.readInt32BE=function(v,N){return v=v>>>0,N||$(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},m.prototype.readBigInt64LE=Zt(function(v){v=v>>>0,Ye(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&rt(v,this.length-8);const te=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(z<<24);return(BigInt(te)<<BigInt(32))+BigInt(N+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),m.prototype.readBigInt64BE=Zt(function(v){v=v>>>0,Ye(v,"offset");const N=this[v],z=this[v+7];(N===void 0||z===void 0)&&rt(v,this.length-8);const te=(N<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(te)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+z)}),m.prototype.readFloatLE=function(v,N){return v=v>>>0,N||$(v,4,this.length),a.read(this,v,!0,23,4)},m.prototype.readFloatBE=function(v,N){return v=v>>>0,N||$(v,4,this.length),a.read(this,v,!1,23,4)},m.prototype.readDoubleLE=function(v,N){return v=v>>>0,N||$(v,8,this.length),a.read(this,v,!0,52,8)},m.prototype.readDoubleBE=function(v,N){return v=v>>>0,N||$(v,8,this.length),a.read(this,v,!1,52,8)};function Z(U,v,N,z,te,fe){if(!m.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>te||v<fe)throw new RangeError('"value" argument is out of bounds');if(N+z>U.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(v,N,z,te){if(v=+v,N=N>>>0,z=z>>>0,!te){const De=Math.pow(2,8*z)-1;Z(this,v,N,z,De,0)}let fe=1,ye=0;for(this[N]=v&255;++ye<z&&(fe*=256);)this[N+ye]=v/fe&255;return N+z},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(v,N,z,te){if(v=+v,N=N>>>0,z=z>>>0,!te){const De=Math.pow(2,8*z)-1;Z(this,v,N,z,De,0)}let fe=z-1,ye=1;for(this[N+fe]=v&255;--fe>=0&&(ye*=256);)this[N+fe]=v/ye&255;return N+z},m.prototype.writeUint8=m.prototype.writeUInt8=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,1,255,0),this[N]=v&255,N+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,2,65535,0),this[N]=v&255,this[N+1]=v>>>8,N+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,2,65535,0),this[N]=v>>>8,this[N+1]=v&255,N+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,4,4294967295,0),this[N+3]=v>>>24,this[N+2]=v>>>16,this[N+1]=v>>>8,this[N]=v&255,N+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,4,4294967295,0),this[N]=v>>>24,this[N+1]=v>>>16,this[N+2]=v>>>8,this[N+3]=v&255,N+4};function ce(U,v,N,z,te){ht(v,z,te,U,N,7);let fe=Number(v&BigInt(4294967295));U[N++]=fe,fe=fe>>8,U[N++]=fe,fe=fe>>8,U[N++]=fe,fe=fe>>8,U[N++]=fe;let ye=Number(v>>BigInt(32)&BigInt(4294967295));return U[N++]=ye,ye=ye>>8,U[N++]=ye,ye=ye>>8,U[N++]=ye,ye=ye>>8,U[N++]=ye,N}function be(U,v,N,z,te){ht(v,z,te,U,N,7);let fe=Number(v&BigInt(4294967295));U[N+7]=fe,fe=fe>>8,U[N+6]=fe,fe=fe>>8,U[N+5]=fe,fe=fe>>8,U[N+4]=fe;let ye=Number(v>>BigInt(32)&BigInt(4294967295));return U[N+3]=ye,ye=ye>>8,U[N+2]=ye,ye=ye>>8,U[N+1]=ye,ye=ye>>8,U[N]=ye,N+8}m.prototype.writeBigUInt64LE=Zt(function(v,N=0){return ce(this,v,N,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=Zt(function(v,N=0){return be(this,v,N,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(v,N,z,te){if(v=+v,N=N>>>0,!te){const Nt=Math.pow(2,8*z-1);Z(this,v,N,z,Nt-1,-Nt)}let fe=0,ye=1,De=0;for(this[N]=v&255;++fe<z&&(ye*=256);)v<0&&De===0&&this[N+fe-1]!==0&&(De=1),this[N+fe]=(v/ye>>0)-De&255;return N+z},m.prototype.writeIntBE=function(v,N,z,te){if(v=+v,N=N>>>0,!te){const Nt=Math.pow(2,8*z-1);Z(this,v,N,z,Nt-1,-Nt)}let fe=z-1,ye=1,De=0;for(this[N+fe]=v&255;--fe>=0&&(ye*=256);)v<0&&De===0&&this[N+fe+1]!==0&&(De=1),this[N+fe]=(v/ye>>0)-De&255;return N+z},m.prototype.writeInt8=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,1,127,-128),v<0&&(v=255+v+1),this[N]=v&255,N+1},m.prototype.writeInt16LE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,2,32767,-32768),this[N]=v&255,this[N+1]=v>>>8,N+2},m.prototype.writeInt16BE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,2,32767,-32768),this[N]=v>>>8,this[N+1]=v&255,N+2},m.prototype.writeInt32LE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,4,2147483647,-2147483648),this[N]=v&255,this[N+1]=v>>>8,this[N+2]=v>>>16,this[N+3]=v>>>24,N+4},m.prototype.writeInt32BE=function(v,N,z){return v=+v,N=N>>>0,z||Z(this,v,N,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[N]=v>>>24,this[N+1]=v>>>16,this[N+2]=v>>>8,this[N+3]=v&255,N+4},m.prototype.writeBigInt64LE=Zt(function(v,N=0){return ce(this,v,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=Zt(function(v,N=0){return be(this,v,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Le(U,v,N,z,te,fe){if(N+z>U.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function ke(U,v,N,z,te){return v=+v,N=N>>>0,te||Le(U,v,N,4),a.write(U,v,N,z,23,4),N+4}m.prototype.writeFloatLE=function(v,N,z){return ke(this,v,N,!0,z)},m.prototype.writeFloatBE=function(v,N,z){return ke(this,v,N,!1,z)};function Se(U,v,N,z,te){return v=+v,N=N>>>0,te||Le(U,v,N,8),a.write(U,v,N,z,52,8),N+8}m.prototype.writeDoubleLE=function(v,N,z){return Se(this,v,N,!0,z)},m.prototype.writeDoubleBE=function(v,N,z){return Se(this,v,N,!1,z)},m.prototype.copy=function(v,N,z,te){if(!m.isBuffer(v))throw new TypeError("argument should be a Buffer");if(z||(z=0),!te&&te!==0&&(te=this.length),N>=v.length&&(N=v.length),N||(N=0),te>0&&te<z&&(te=z),te===z||v.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(z<0||z>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),v.length-N<te-z&&(te=v.length-N+z);const fe=te-z;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,z,te):Uint8Array.prototype.set.call(v,this.subarray(z,te),N),fe},m.prototype.fill=function(v,N,z,te){if(typeof v=="string"){if(typeof N=="string"?(te=N,N=0,z=this.length):typeof z=="string"&&(te=z,z=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!m.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(v.length===1){const ye=v.charCodeAt(0);(te==="utf8"&&ye<128||te==="latin1")&&(v=ye)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(N<0||this.length<N||this.length<z)throw new RangeError("Out of range index");if(z<=N)return this;N=N>>>0,z=z===void 0?this.length:z>>>0,v||(v=0);let fe;if(typeof v=="number")for(fe=N;fe<z;++fe)this[fe]=v;else{const ye=m.isBuffer(v)?v:m.from(v,te),De=ye.length;if(De===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(fe=0;fe<z-N;++fe)this[fe+N]=ye[fe%De]}return this};const Te={};function Oe(U,v,N){Te[U]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(U,v){return`The "${U}" argument must be of type number. Received type ${typeof v}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(U,v,N){let z=`The value of "${U}" is out of range.`,te=N;return Number.isInteger(N)&&Math.abs(N)>2**32?te=Ne(String(N)):typeof N=="bigint"&&(te=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(te=Ne(te)),te+="n"),z+=` It must be ${v}. Received ${te}`,z},RangeError);function Ne(U){let v="",N=U.length;const z=U[0]==="-"?1:0;for(;N>=z+4;N-=3)v=`_${U.slice(N-3,N)}${v}`;return`${U.slice(0,N)}${v}`}function je(U,v,N){Ye(v,"offset"),(U[v]===void 0||U[v+N]===void 0)&&rt(v,U.length-(N+1))}function ht(U,v,N,z,te,fe){if(U>N||U<v){const ye=typeof v=="bigint"?"n":"";let De;throw v===0||v===BigInt(0)?De=`>= 0${ye} and < 2${ye} ** ${(fe+1)*8}${ye}`:De=`>= -(2${ye} ** ${(fe+1)*8-1}${ye}) and < 2 ** ${(fe+1)*8-1}${ye}`,new Te.ERR_OUT_OF_RANGE("value",De,U)}je(z,te,fe)}function Ye(U,v){if(typeof U!="number")throw new Te.ERR_INVALID_ARG_TYPE(v,"number",U)}function rt(U,v,N){throw Math.floor(U)!==U?(Ye(U,N),new Te.ERR_OUT_OF_RANGE("offset","an integer",U)):v<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,U)}const la=/[^+/0-9A-Za-z-_]/g;function ve(U){if(U=U.split("=")[0],U=U.trim().replace(la,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Re(U,v){v=v||1/0;let N;const z=U.length;let te=null;const fe=[];for(let ye=0;ye<z;++ye){if(N=U.charCodeAt(ye),N>55295&&N<57344){if(!te){if(N>56319){(v-=3)>-1&&fe.push(239,191,189);continue}else if(ye+1===z){(v-=3)>-1&&fe.push(239,191,189);continue}te=N;continue}if(N<56320){(v-=3)>-1&&fe.push(239,191,189),te=N;continue}N=(te-55296<<10|N-56320)+65536}else te&&(v-=3)>-1&&fe.push(239,191,189);if(te=null,N<128){if((v-=1)<0)break;fe.push(N)}else if(N<2048){if((v-=2)<0)break;fe.push(N>>6|192,N&63|128)}else if(N<65536){if((v-=3)<0)break;fe.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((v-=4)<0)break;fe.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return fe}function $e(U){const v=[];for(let N=0;N<U.length;++N)v.push(U.charCodeAt(N)&255);return v}function qe(U,v){let N,z,te;const fe=[];for(let ye=0;ye<U.length&&!((v-=2)<0);++ye)N=U.charCodeAt(ye),z=N>>8,te=N%256,fe.push(te),fe.push(z);return fe}function dt(U){return e.toByteArray(ve(U))}function Je(U,v,N,z){let te;for(te=0;te<z&&!(te+N>=v.length||te>=U.length);++te)v[te+N]=U[te];return te}function At(U,v){return U instanceof v||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===v.name}function Ot(U){return U!==U}const Wt=function(){const U="0123456789abcdef",v=new Array(256);for(let N=0;N<16;++N){const z=N*16;for(let te=0;te<16;++te)v[z+te]=U[N]+U[te]}return v}();function Zt(U){return typeof BigInt>"u"?ya:U}function ya(){throw new Error("BigInt not supported")}}(sg)),sg}var so=O2();class Lt{static async deriveKeyFromPassword(e,a,i="Argon2Id",s='{"Iterations":2,"MemorySize":19456,"DegreeOfParallelism":1}'){const c=JSON.parse(s);try{if(i!=="Argon2Id")throw new Error("Unsupported encryption type");return(await Cb.hash({pass:e,salt:a,time:c.Iterations,mem:c.MemorySize,parallelism:c.DegreeOfParallelism,hashLen:32,type:2})).hash}catch(d){throw console.error("Argon2 hashing failed:",d),d}}static async symmetricEncrypt(e,a){if(!e)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),f=>f.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["encrypt"]),s=crypto.getRandomValues(new Uint8Array(12)),d=new TextEncoder().encode(e),m=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,d),g=new Uint8Array(s.length+m.byteLength);return g.set(s,0),g.set(new Uint8Array(m),s.length),btoa(Array.from(g).map(f=>String.fromCharCode(f)).join(""))}static async symmetricDecrypt(e,a){if(!e)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),f=>f.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),s=Uint8Array.from(atob(e),f=>f.charCodeAt(0)),c=s.slice(0,12),d=s.slice(12),m=await crypto.subtle.decrypt({name:"AES-GCM",iv:c},i,d);return new TextDecoder().decode(m)}static async symmetricDecryptBytes(e,a){if(!e||e.length===0)return e;const i=await crypto.subtle.importKey("raw",Uint8Array.from(atob(a),m=>m.charCodeAt(0)),{name:"AES-GCM",length:256},!1,["decrypt"]),s=e.slice(0,12),c=e.slice(12),d=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},i,c);return new Uint8Array(d)}static async generateRsaKeyPair(){const e=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",e.publicKey),i=await crypto.subtle.exportKey("jwk",e.privateKey);return{publicKey:JSON.stringify(a),privateKey:JSON.stringify(i)}}static async encryptWithPublicKey(e,a){const i=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),s=new TextEncoder().encode(e),c=await crypto.subtle.encrypt({name:"RSA-OAEP"},i,s);return btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(c))))}static async decryptWithPrivateKey(e,a){try{const i=await crypto.subtle.importKey("jwk",JSON.parse(a),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),s=Uint8Array.from(atob(e),d=>d.charCodeAt(0)),c=await crypto.subtle.decrypt({name:"RSA-OAEP"},i,s);return new Uint8Array(c)}catch(i){throw console.error("RSA decryption failed:",i),new Error(`Failed to decrypt: ${i instanceof Error?i.message:"Unknown error"}`)}}static async decryptEmail(e,a){try{const i=a.find(m=>m.PublicKey===e.encryptionKey);if(!i)throw new Error("Encryption key not found");const s=await Lt.decryptWithPrivateKey(e.encryptedSymmetricKey,i.PrivateKey),c=so.Buffer.from(s).toString("base64"),d={...e};return d.subject=await Lt.symmetricDecrypt(e.subject,c),d.fromDisplay=await Lt.symmetricDecrypt(e.fromDisplay,c),d.fromDomain=await Lt.symmetricDecrypt(e.fromDomain,c),d.fromLocal=await Lt.symmetricDecrypt(e.fromLocal,c),e.messageHtml&&(d.messageHtml=await Lt.symmetricDecrypt(e.messageHtml,c)),e.messagePlain&&(d.messagePlain=await Lt.symmetricDecrypt(e.messagePlain,c)),d}catch(i){throw new Error(i instanceof Error?i.message:"Failed to decrypt email")}}static async decryptEmailList(e,a){return Promise.all(e.map(async i=>{try{const s=a.find(g=>g.PublicKey===i.encryptionKey);if(!s)throw new Error("Encryption key not found");const c=await Lt.decryptWithPrivateKey(i.encryptedSymmetricKey,s.PrivateKey),d=so.Buffer.from(c).toString("base64"),m={...i};return m.subject=await Lt.symmetricDecrypt(i.subject,d),m.fromDisplay=await Lt.symmetricDecrypt(i.fromDisplay,d),m.fromDomain=await Lt.symmetricDecrypt(i.fromDomain,d),m.fromLocal=await Lt.symmetricDecrypt(i.fromLocal,d),i.messagePreview&&(m.messagePreview=await Lt.symmetricDecrypt(i.messagePreview,d)),m}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt email")}}))}static async decryptAttachment(e,a,i){try{const s=i.find(m=>m.PublicKey===a.encryptionKey);if(!s)throw new Error("Encryption key not found");const c=await Lt.decryptWithPrivateKey(a.encryptedSymmetricKey,s.PrivateKey),d=so.Buffer.from(c).toString("base64");return await Lt.symmetricDecryptBytes(e,d)}catch(s){throw new Error(s instanceof Error?s.message:"Failed to decrypt attachment")}}}class j2{constructor(e){Fe(this,"webApi");Fe(this,"pollingInterval",null);Fe(this,"requestId",null);Fe(this,"privateKey",null);this.webApi=e}async initiate(){try{const e=await Lt.generateRsaKeyPair();this.privateKey=e.privateKey;const a=await this.webApi.rawFetch("auth/mobile-login/initiate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientPublicKey:e.publicKey})});if(!a.ok)throw bn.GENERIC;const i=await a.json();return this.requestId=i.requestId,this.requestId}catch(e){throw typeof e=="string"&&Object.values(bn).includes(e)?e:bn.GENERIC}}async startPolling(e,a){if(!this.requestId||!this.privateKey)throw new Error("Must call initiate() before starting polling");const i=async()=>{try{if(!this.requestId){this.stopPolling();return}const s=await this.webApi.rawFetch(`auth/mobile-login/poll/${this.requestId}`,{method:"GET"});if(!s.ok){if(s.status===404){this.stopPolling(),this.privateKey=null,this.requestId=null,a(bn.TIMEOUT);return}throw new Error(`Polling failed: ${s.status}`)}const c=await s.json();if(c.fulfilled&&c.encryptedSymmetricKey){this.stopPolling();const d=await Lt.decryptWithPrivateKey(c.encryptedDecryptionKey,this.privateKey),m=so.Buffer.from(d).toString("base64"),g=await Lt.decryptWithPrivateKey(c.encryptedSymmetricKey,this.privateKey),f=so.Buffer.from(g).toString("base64"),E=await Lt.symmetricDecrypt(c.encryptedToken,f),p=await Lt.symmetricDecrypt(c.encryptedRefreshToken,f),C=await Lt.symmetricDecrypt(c.encryptedUsername,f);this.privateKey=null,this.requestId=null;const I=await this.webApi.rawFetch("auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:C})});if(!I.ok){a(bn.GENERIC);return}const x=await I.json(),T={username:C,token:E,refreshToken:p,decryptionKey:m,salt:x.salt,encryptionType:x.encryptionType,encryptionSettings:x.encryptionSettings};e(T)}}catch{this.stopPolling(),this.privateKey=null,this.requestId=null,a(bn.GENERIC)}};this.pollingInterval=setInterval(i,3e3),setTimeout(()=>{this.pollingInterval&&(this.stopPolling(),this.privateKey=null,this.requestId=null,a(bn.TIMEOUT))},21e4)}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}cleanup(){this.stopPolling(),this.privateKey=null,this.requestId=null}}const Jb=({isOpen:r,onClose:e,onSuccess:a,webApi:i,mode:s="login"})=>{const{t:c}=Ge(),[d,m]=w.useState(null),[g,f]=w.useState(null),[E,p]=w.useState(120),C=w.useRef(null),I=w.useRef(null),x=S=>{switch(S){case bn.TIMEOUT:return c("auth.errors.mobileLoginRequestExpired");case bn.GENERIC:default:return c("common.errors.unknownError")}};w.useEffect(()=>{if(d&&E>0&&r)return I.current=setInterval(()=>{p(S=>S<=1?(I.current&&clearInterval(I.current),0):S-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[d,E,r]),w.useEffect(()=>r?((async()=>{try{f(null),m(null),p(120),C.current||(C.current=new j2(i));const _=`aliasvault://open/mobile-unlock/${await C.current.initiate()}`,P=await _2.toDataURL(_,{width:256,margin:2});m(P),await C.current.startPolling(async K=>{try{await a(K),T()}catch{m(null),f(bn.GENERIC)}},K=>{m(null),f(K)})}catch(j){typeof j=="string"&&Object.values(bn).includes(j)?f(j):f(bn.GENERIC)}})(),()=>{C.current&&C.current.cleanup(),I.current&&clearInterval(I.current)}):void 0,[r]);const T=()=>{C.current&&C.current.cleanup(),I.current&&clearInterval(I.current),m(null),f(null),p(120),e()},k=S=>{const j=Math.floor(S/60),_=S%60;return`${j}:${_.toString().padStart(2,"0")}`},R=c(s==="unlock"?"auth.unlockWithMobile":"auth.loginWithMobile"),B=c("auth.scanQrCode");return l.jsxs(_n,{isOpen:r,onClose:T,title:R,showHeaderBorder:!1,bodyClassName:"px-6 pb-6",children:[l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:B}),g&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 dark:bg-red-900/30 border border-red-400 dark:border-red-700 rounded text-red-700 dark:text-red-400 text-sm",children:x(g)}),d&&l.jsxs("div",{className:"flex flex-col items-center mb-4",children:[l.jsx("img",{src:d,alt:"QR Code",className:"border-4 border-gray-200 dark:border-gray-600 rounded mb-3"}),l.jsx("div",{className:"text-gray-700 dark:text-gray-300 text-sm font-medium",children:k(E)})]}),!d&&!g&&l.jsx("div",{className:"flex justify-center py-8",children:l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})}),l.jsx("button",{type:"button",onClick:T,className:"mt-4 w-full inline-flex 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",children:c("common.cancel")})]})};var Ca=(r=>(r.EXPAND="expand",r.EDIT="edit",r.DELETE="delete",r.SETTINGS="settings",r.RELOAD="reload",r.EXTERNAL_LINK="external_link",r.SAVE="save",r.PLUS="plus",r.TAB="tab",r.EYE="eye",r.EYE_OFF="eye_off",r))(Ca||{});const ch=({type:r,className:e="w-5 h-5"})=>({expand:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.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"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),reload:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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:l.jsxs("svg",{className:e,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[l.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"}),l.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:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),plus:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),tab:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.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"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"})]}),eye:l.jsxs("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.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"})]}),eye_off:l.jsx("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.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"})})})[r]||null,cn=({onClick:r,title:e,iconType:a,variant:i="default",id:s})=>{const c={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 l.jsx("button",{id:s,onClick:r,className:`p-2 rounded-lg ${c[i]}`,title:e,children:l.jsx(ch,{type:a})})},Xb=()=>{const[r,e]=w.useState(ja.DEFAULT_API_URL);return{apiUrl:r,setApiUrl:e,loadApiUrl:async()=>{const s=await Ce.getItem("local:apiUrl");s&&s.length>0?e(s):e(ja.DEFAULT_API_URL)},getDisplayUrl:()=>{const s=r.replace("https://","").replace("http://","").replace(":443","").replace("/api","");return s==="app.aliasvault.net"?"aliasvault.net":s}}},P2=()=>{const{loadApiUrl:r,getDisplayUrl:e}=Xb(),a=pa(),{t:i}=Ge();w.useEffect(()=>{r()},[r]);const s=()=>{a("/auth-settings")};return l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:["(",i("auth.connectingTo")," ",l.jsx("button",{onClick:s,type:"button",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500 underline",children:e()}),")"]})};let Me;function bt(r){kl===Or.length&&Or.push(Or.length+1);const e=kl;return kl=Or[e],Or[e]=r,e}function _g(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const s=r.description;return s==null?"Symbol":`Symbol(${s})`}if(e=="function"){const s=r.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(r)){const s=r.length;let c="[";s>0&&(c+=_g(r[0]));for(let d=1;d<s;d++)c+=", "+_g(r[d]);return c+="]",c}const a=/\[object ([^\]]+)\]/.exec(toString.call(r));let i;if(a&&a.length>1)i=a[1];else return toString.call(r);if(i=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}
${r.stack}`:i}function H2(r){r<132||(Or[r]=kl,kl=r)}function Q2(r,e){r=r>>>0;const a=ft(),i=[];for(let s=r;s<r+4*e;s+=4)i.push(Da(a.getUint32(s,!0)));return i}function nE(r,e){return r=r>>>0,Sl().subarray(r/1,r/1+e)}let as=null;function ft(){return(as===null||as.buffer.detached===!0||as.buffer.detached===void 0&&as.buffer!==Me.memory.buffer)&&(as=new DataView(Me.memory.buffer)),as}function or(r,e){return r=r>>>0,V2(r,e)}let Cl=null;function Sl(){return(Cl===null||Cl.byteLength===0)&&(Cl=new Uint8Array(Me.memory.buffer)),Cl}function Ke(r){return Or[r]}function ts(r,e){try{return r.apply(this,e)}catch(a){Me.__wbindgen_export3(bt(a))}}let Or=new Array(128).fill(void 0);Or.push(void 0,null,!0,!1);let kl=Or.length;function nr(r){return r==null}function Xa(r,e,a){if(a===void 0){const m=Ll.encode(r),g=e(m.length,1)>>>0;return Sl().subarray(g,g+m.length).set(m),Pa=m.length,g}let i=r.length,s=e(i,1)>>>0;const c=Sl();let d=0;for(;d<i;d++){const m=r.charCodeAt(d);if(m>127)break;c[s+d]=m}if(d!==i){d!==0&&(r=r.slice(d)),s=a(s,i,i=d+r.length*3,1)>>>0;const m=Sl().subarray(s+d,s+i),g=Ll.encodeInto(r,m);d+=g.written,s=a(s,i,d,1)>>>0}return Pa=d,s}function Da(r){const e=Ke(r);return H2(r),e}let Nu=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Nu.decode();const z2=2146435072;let og=0;function V2(r,e){return og+=e,og>=z2&&(Nu=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),Nu.decode(),og=e),Nu.decode(Sl().subarray(r,r+e))}const Ll=new TextEncoder;"encodeInto"in Ll||(Ll.encodeInto=function(r,e){const a=Ll.encode(r);return e.set(a),{read:r.length,written:a.length}});let Pa=0;function K2(r){let e,a;try{const c=Me.__wbindgen_add_to_stack_pointer(-16),d=Xa(r,Me.__wbindgen_export,Me.__wbindgen_export2),m=Pa;Me.extractDomain(c,d,m);var i=ft().getInt32(c+4*0,!0),s=ft().getInt32(c+4*1,!0);return e=i,a=s,or(i,s)}finally{Me.__wbindgen_add_to_stack_pointer(16),Me.__wbindgen_export4(e,a,1)}}function G2(r){let e,a;try{const c=Me.__wbindgen_add_to_stack_pointer(-16),d=Xa(r,Me.__wbindgen_export,Me.__wbindgen_export2),m=Pa;Me.extractRootDomain(c,d,m);var i=ft().getInt32(c+4*0,!0),s=ft().getInt32(c+4*1,!0);return e=i,a=s,or(i,s)}finally{Me.__wbindgen_add_to_stack_pointer(16),Me.__wbindgen_export4(e,a,1)}}function q2(r){try{const s=Me.__wbindgen_add_to_stack_pointer(-16);Me.filterCredentials(s,bt(r));var e=ft().getInt32(s+4*0,!0),a=ft().getInt32(s+4*1,!0),i=ft().getInt32(s+4*2,!0);if(i)throw Da(a);return Da(e)}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function W2(){try{const i=Me.__wbindgen_add_to_stack_pointer(-16);Me.getSyncableTableNames(i);var r=ft().getInt32(i+4*0,!0),e=ft().getInt32(i+4*1,!0),a=Q2(r,e).slice();return Me.__wbindgen_export4(r,e*4,4),a}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function Y2(r){try{const s=Me.__wbindgen_add_to_stack_pointer(-16);Me.mergeVaults(s,bt(r));var e=ft().getInt32(s+4*0,!0),a=ft().getInt32(s+4*1,!0),i=ft().getInt32(s+4*2,!0);if(i)throw Da(a);return Da(e)}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function J2(r){try{const s=Me.__wbindgen_add_to_stack_pointer(-16);Me.pruneVault(s,bt(r));var e=ft().getInt32(s+4*0,!0),a=ft().getInt32(s+4*1,!0),i=ft().getInt32(s+4*2,!0);if(i)throw Da(a);return Da(e)}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function X2(r,e,a){let i,s;try{const p=Me.__wbindgen_add_to_stack_pointer(-16),C=Xa(r,Me.__wbindgen_export,Me.__wbindgen_export2),I=Pa,x=Xa(e,Me.__wbindgen_export,Me.__wbindgen_export2),T=Pa,k=Xa(a,Me.__wbindgen_export,Me.__wbindgen_export2),R=Pa;Me.srpDerivePrivateKey(p,C,I,x,T,k,R);var c=ft().getInt32(p+4*0,!0),d=ft().getInt32(p+4*1,!0),m=ft().getInt32(p+4*2,!0),g=ft().getInt32(p+4*3,!0),f=c,E=d;if(g)throw f=0,E=0,Da(m);return i=f,s=E,or(f,E)}finally{Me.__wbindgen_add_to_stack_pointer(16),Me.__wbindgen_export4(i,s,1)}}function $2(r,e,a,i,s){try{const g=Me.__wbindgen_add_to_stack_pointer(-16),f=Xa(r,Me.__wbindgen_export,Me.__wbindgen_export2),E=Pa,p=Xa(e,Me.__wbindgen_export,Me.__wbindgen_export2),C=Pa,I=Xa(a,Me.__wbindgen_export,Me.__wbindgen_export2),x=Pa,T=Xa(i,Me.__wbindgen_export,Me.__wbindgen_export2),k=Pa,R=Xa(s,Me.__wbindgen_export,Me.__wbindgen_export2),B=Pa;Me.srpDeriveSession(g,f,E,p,C,I,x,T,k,R,B);var c=ft().getInt32(g+4*0,!0),d=ft().getInt32(g+4*1,!0),m=ft().getInt32(g+4*2,!0);if(m)throw Da(d);return Da(c)}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function Z2(r){let e,a;try{const f=Me.__wbindgen_add_to_stack_pointer(-16),E=Xa(r,Me.__wbindgen_export,Me.__wbindgen_export2),p=Pa;Me.srpDeriveVerifier(f,E,p);var i=ft().getInt32(f+4*0,!0),s=ft().getInt32(f+4*1,!0),c=ft().getInt32(f+4*2,!0),d=ft().getInt32(f+4*3,!0),m=i,g=s;if(d)throw m=0,g=0,Da(c);return e=m,a=g,or(m,g)}finally{Me.__wbindgen_add_to_stack_pointer(16),Me.__wbindgen_export4(e,a,1)}}function eL(){try{const i=Me.__wbindgen_add_to_stack_pointer(-16);Me.srpGenerateEphemeral(i);var r=ft().getInt32(i+4*0,!0),e=ft().getInt32(i+4*1,!0),a=ft().getInt32(i+4*2,!0);if(a)throw Da(e);return Da(r)}finally{Me.__wbindgen_add_to_stack_pointer(16)}}function tL(){let r,e;try{const s=Me.__wbindgen_add_to_stack_pointer(-16);Me.srpGenerateSalt(s);var a=ft().getInt32(s+4*0,!0),i=ft().getInt32(s+4*1,!0);return r=a,e=i,or(a,i)}finally{Me.__wbindgen_add_to_stack_pointer(16),Me.__wbindgen_export4(r,e,1)}}const aL=new Set(["basic","cors","default"]);async function nL(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(i){if(r.ok&&aL.has(r.type)&&r.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}const a=await r.arrayBuffer();return await WebAssembly.instantiate(a,e)}else{const a=await WebAssembly.instantiate(r,e);return a instanceof WebAssembly.Instance?{instance:a,module:r}:a}}function rL(){const r={};return r.wbg={},r.wbg.__wbg_Error_52673b7de5a0ca89=function(e,a){const i=Error(or(e,a));return bt(i)},r.wbg.__wbg_Number_2d1dcfcf4ec51736=function(e){return Number(Ke(e))},r.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,a){const i=String(Ke(a)),s=Xa(i,Me.__wbindgen_export,Me.__wbindgen_export2),c=Pa;ft().setInt32(e+4*1,c,!0),ft().setInt32(e+4*0,s,!0)},r.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d=function(e,a){const i=Ke(a),s=typeof i=="bigint"?i:void 0;ft().setBigInt64(e+8*1,nr(s)?BigInt(0):s,!0),ft().setInt32(e+4*0,!nr(s),!0)},r.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(e){const a=Ke(e),i=typeof a=="boolean"?a:void 0;return nr(i)?16777215:i?1:0},r.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(e,a){const i=_g(Ke(a)),s=Xa(i,Me.__wbindgen_export,Me.__wbindgen_export2),c=Pa;ft().setInt32(e+4*1,c,!0),ft().setInt32(e+4*0,s,!0)},r.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317=function(e,a){return Ke(e)in Ke(a)},r.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27=function(e){return typeof Ke(e)=="bigint"},r.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd=function(e){return typeof Ke(e)=="function"},r.wbg.__wbg___wbindgen_is_object_ce774f3490692386=function(e){const a=Ke(e);return typeof a=="object"&&a!==null},r.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030=function(e){return typeof Ke(e)=="string"},r.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(e){return Ke(e)===void 0},r.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36=function(e,a){return Ke(e)===Ke(a)},r.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d=function(e,a){return Ke(e)==Ke(a)},r.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(e,a){const i=Ke(a),s=typeof i=="number"?i:void 0;ft().setFloat64(e+8*1,nr(s)?0:s,!0),ft().setInt32(e+4*0,!nr(s),!0)},r.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(e,a){const i=Ke(a),s=typeof i=="string"?i:void 0;var c=nr(s)?0:Xa(s,Me.__wbindgen_export,Me.__wbindgen_export2),d=Pa;ft().setInt32(e+4*1,d,!0),ft().setInt32(e+4*0,c,!0)},r.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(e,a){throw new Error(or(e,a))},r.wbg.__wbg_call_3020136f7a2d6e44=function(){return ts(function(e,a,i){const s=Ke(e).call(Ke(a),Ke(i));return bt(s)},arguments)},r.wbg.__wbg_call_abb4ff46ce38be40=function(){return ts(function(e,a){const i=Ke(e).call(Ke(a));return bt(i)},arguments)},r.wbg.__wbg_crypto_86f2631e91b51511=function(e){const a=Ke(e).crypto;return bt(a)},r.wbg.__wbg_done_62ea16af4ce34b24=function(e){return Ke(e).done},r.wbg.__wbg_entries_83c79938054e065f=function(e){const a=Object.entries(Ke(e));return bt(a)},r.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,a){let i,s;try{i=e,s=a,console.error(or(e,a))}finally{Me.__wbindgen_export4(i,s,1)}},r.wbg.__wbg_getRandomValues_b3f15fcbfabb0f8b=function(){return ts(function(e,a){Ke(e).getRandomValues(Ke(a))},arguments)},r.wbg.__wbg_get_6b7bd52aca3f9671=function(e,a){const i=Ke(e)[a>>>0];return bt(i)},r.wbg.__wbg_get_af9dab7e9603ea93=function(){return ts(function(e,a){const i=Reflect.get(Ke(e),Ke(a));return bt(i)},arguments)},r.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,a){const i=Ke(e)[Ke(a)];return bt(i)},r.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355=function(e){let a;try{a=Ke(e)instanceof ArrayBuffer}catch{a=!1}return a},r.wbg.__wbg_instanceof_Map_084be8da74364158=function(e){let a;try{a=Ke(e)instanceof Map}catch{a=!1}return a},r.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(e){let a;try{a=Ke(e)instanceof Uint8Array}catch{a=!1}return a},r.wbg.__wbg_isArray_51fd9e6422c0a395=function(e){return Array.isArray(Ke(e))},r.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16=function(e){return Number.isSafeInteger(Ke(e))},r.wbg.__wbg_iterator_27b7c8b35ab3e86b=function(){return bt(Symbol.iterator)},r.wbg.__wbg_length_22ac23eaec9d8053=function(e){return Ke(e).length},r.wbg.__wbg_length_d45040a40c570362=function(e){return Ke(e).length},r.wbg.__wbg_msCrypto_d562bbe83e0d4b91=function(e){const a=Ke(e).msCrypto;return bt(a)},r.wbg.__wbg_new_1ba21ce319a06297=function(){const e=new Object;return bt(e)},r.wbg.__wbg_new_25f239778d6112b9=function(){const e=new Array;return bt(e)},r.wbg.__wbg_new_6421f6084cc5bc5a=function(e){const a=new Uint8Array(Ke(e));return bt(a)},r.wbg.__wbg_new_8a6f238a6ece86ea=function(){const e=new Error;return bt(e)},r.wbg.__wbg_new_b546ae120718850e=function(){return bt(new Map)},r.wbg.__wbg_new_no_args_cb138f77cf6151ee=function(e,a){const i=new Function(or(e,a));return bt(i)},r.wbg.__wbg_new_with_length_aa5eaf41d35235e5=function(e){const a=new Uint8Array(e>>>0);return bt(a)},r.wbg.__wbg_next_138a17bbf04e926c=function(e){const a=Ke(e).next;return bt(a)},r.wbg.__wbg_next_3cfe5c0fe2a4cc53=function(){return ts(function(e){const a=Ke(e).next();return bt(a)},arguments)},r.wbg.__wbg_node_e1f24f89a7336c2e=function(e){const a=Ke(e).node;return bt(a)},r.wbg.__wbg_process_3975fd6c72f520aa=function(e){const a=Ke(e).process;return bt(a)},r.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(e,a,i){Uint8Array.prototype.set.call(nE(e,a),Ke(i))},r.wbg.__wbg_randomFillSync_f8c153b79f285817=function(){return ts(function(e,a){Ke(e).randomFillSync(Da(a))},arguments)},r.wbg.__wbg_require_b74f47fc2d022fd6=function(){return ts(function(){const e=vI.require;return bt(e)},arguments)},r.wbg.__wbg_set_3f1d0b984ed272ed=function(e,a,i){Ke(e)[Da(a)]=Da(i)},r.wbg.__wbg_set_7df433eea03a5c14=function(e,a,i){Ke(e)[a>>>0]=Da(i)},r.wbg.__wbg_set_efaaf145b9377369=function(e,a,i){const s=Ke(e).set(Ke(a),Ke(i));return bt(s)},r.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,a){const i=Ke(a).stack,s=Xa(i,Me.__wbindgen_export,Me.__wbindgen_export2),c=Pa;ft().setInt32(e+4*1,c,!0),ft().setInt32(e+4*0,s,!0)},r.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335=function(){const e=typeof global>"u"?null:global;return nr(e)?0:bt(e)},r.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1=function(){const e=typeof globalThis>"u"?null:globalThis;return nr(e)?0:bt(e)},r.wbg.__wbg_static_accessor_SELF_08f5a74c69739274=function(){const e=typeof self>"u"?null:self;return nr(e)?0:bt(e)},r.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024=function(){const e=typeof window>"u"?null:window;return nr(e)?0:bt(e)},r.wbg.__wbg_subarray_845f2f5bce7d061a=function(e,a,i){const s=Ke(e).subarray(a>>>0,i>>>0);return bt(s)},r.wbg.__wbg_value_57b7b035e117f7ee=function(e){const a=Ke(e).value;return bt(a)},r.wbg.__wbg_versions_4e31226f5e8dc909=function(e){const a=Ke(e).versions;return bt(a)},r.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,a){const i=or(e,a);return bt(i)},r.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){const a=BigInt.asUintN(64,e);return bt(a)},r.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return bt(e)},r.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,a){const i=nE(e,a);return bt(i)},r.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return bt(e)},r.wbg.__wbindgen_object_clone_ref=function(e){const a=Ke(e);return bt(a)},r.wbg.__wbindgen_object_drop_ref=function(e){Da(e)},r}function iL(r,e){return Me=r.exports,Yu.__wbindgen_wasm_module=e,as=null,Cl=null,Me.__wbindgen_start(),Me}async function Yu(r){if(Me!==void 0)return Me;typeof r<"u"&&(Object.getPrototypeOf(r)===Object.prototype?{module_or_path:r}=r:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof r>"u"&&(r=new URL("aliasvault_core_bg.wasm",self.location.href));const e=rL();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:a,module:i}=await nL(await r,e);return iL(a,i)}const cu={type:"Argon2Id",settings:JSON.stringify({DegreeOfParallelism:1,MemorySize:19456,Iterations:2})},ha=class ha{static async initWasm(){if(!this.wasmInitialized)return this.wasmInitPromise?this.wasmInitPromise:(this.wasmInitPromise=(async()=>{try{const e=zr.runtime.getURL("src/aliasvault_core_bg.wasm"),i=await(await fetch(e)).arrayBuffer();await Yu({module_or_path:i}),this.wasmInitialized=!0}catch(e){throw this.wasmInitPromise=null,e}})(),this.wasmInitPromise)}static normalizeUsername(e){return e.toLowerCase().trim()}static async generateSalt(){return await this.initWasm(),tL()}static bytesToHexString(e){return Array.from(e).map(a=>a.toString(16).padStart(2,"0")).join("").toUpperCase()}static bytesToBase64(e){return btoa(String.fromCharCode(...e))}static async derivePrivateKey(e,a,i){return await this.initWasm(),X2(e,ha.normalizeUsername(a),i)}static async deriveVerifier(e){return await this.initWasm(),Z2(e)}static async generateEphemeral(){return await this.initWasm(),eL()}static async deriveSession(e,a,i,s,c){return await this.initWasm(),$2(e,a,i,ha.normalizeUsername(s),c)}static async prepareCredentials(e,a,i,s){const c=await Lt.deriveKeyFromPassword(e,a,i,s);return{passwordHashString:ha.bytesToHexString(c),passwordHashBase64:ha.bytesToBase64(c)}}static generateSrpIdentity(){return crypto.randomUUID()}static async prepareRegistration(e,a){const i=ha.normalizeUsername(e),s=await ha.generateSalt(),c=ha.generateSrpIdentity(),d=await ha.prepareCredentials(a,s,cu.type,cu.settings),m=await ha.derivePrivateKey(s,c,d.passwordHashString),g=await ha.deriveVerifier(m);return{username:i,salt:s,verifier:g,encryptionType:cu.type,encryptionSettings:cu.settings,srpIdentity:c}}static async registerUser(e,a,i){try{const s=await ha.prepareRegistration(a,i),c=e.replace(/\/$/,"")+"/v1/",d=await fetch(`${c}Auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok){const g=await d.text();let f=`Registration failed with status ${d.status}`;try{f=JSON.parse(g).title||f}catch{f=g||f}return{success:!1,error:f}}return{success:!0,token:await d.json()}}catch(s){return{success:!1,error:s instanceof Error?s.message:"Unknown error occurred"}}}static async login(e,a,i,s=!1){try{const c=e.replace(/\/$/,"")+"/v1/",d=ha.normalizeUsername(a),m=await fetch(`${c}Auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d})});if(!m.ok){const k=await m.text();try{return{success:!1,error:JSON.parse(k).title}}catch{return{success:!1,error:k||"Login initiation failed"}}}const g=await m.json(),f=g.srpIdentity??d,E=await ha.prepareCredentials(i,g.salt,g.encryptionType,g.encryptionSettings),p=await ha.generateEphemeral(),C=await ha.derivePrivateKey(g.salt,f,E.passwordHashString),I=await ha.deriveSession(p.secret,g.serverEphemeral,g.salt,f,C),x=await fetch(`${c}Auth/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,rememberMe:s,clientPublicEphemeral:p.public,clientSessionProof:I.proof})});if(!x.ok){const k=await x.text();try{return{success:!1,error:JSON.parse(k).title}}catch{return{success:!1,error:k||"Login validation failed"}}}const T=await x.json();return T.requiresTwoFactor?{success:!1,requiresTwoFactor:!0,loginResponse:g,passwordHashBase64:E.passwordHashBase64}:{success:!0,token:T.token,passwordHashBase64:E.passwordHashBase64,loginResponse:g}}catch(c){return{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}}};Fe(ha,"wasmInitialized",!1),Fe(ha,"wasmInitPromise",null);let Ka=ha;class $b{constructor(e){Fe(this,"webApiService");this.webApiService=e}async initiateLogin(e){const a=Ka.normalizeUsername(e),i=await this.webApiService.rawFetch("Auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a})});if(i.status===400){const c=await i.json();throw new Hr(c.title)}return await i.json()}async validateLogin(e,a,i,s){const c=Ka.normalizeUsername(e),d=s.srpIdentity??c,m=await Ka.generateEphemeral(),g=await Ka.derivePrivateKey(s.salt,d,a),f=await Ka.deriveSession(m.secret,s.serverEphemeral,s.salt,d,g),E={username:c,rememberMe:i,clientPublicEphemeral:m.public,clientSessionProof:f.proof},p=await this.webApiService.rawFetch("Auth/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)});if(p.status===400){const I=await p.json();throw new Hr(I.title)}return await p.json()}async validateLogin2Fa(e,a,i,s,c){const d=Ka.normalizeUsername(e),m=s.srpIdentity??d,g=await Ka.generateEphemeral(),f=await Ka.derivePrivateKey(s.salt,m,a),E=await Ka.deriveSession(g.secret,s.serverEphemeral,s.salt,m,f),p={username:d,rememberMe:i,clientPublicEphemeral:g.public,clientSessionProof:E.proof,code2Fa:c},C=await this.webApiService.rawFetch("Auth/validate-2fa",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(C.status===400){const x=await C.json();throw new Hr(x.title)}return await C.json()}}const sL=()=>{const{t:r}=Ge(),e=pa(),a=Vn(),i=Ft(),{setHeaderButtons:s}=Kn(),[c,d]=w.useState({username:"",password:""}),{showLoading:m,hideLoading:g,setIsInitialLoading:f}=na(),[E,p]=w.useState(!0),[C,I]=w.useState(!1),[x,T]=w.useState(null),[k,R]=w.useState(null),[B,S]=w.useState(null),[j,_]=w.useState(!1),[P,K]=w.useState(""),[H,Q]=w.useState(null),[V,G]=w.useState(null),[q,W]=w.useState(!1),ne=zn(),de=new $b(ne),X=async(Z,ce)=>{const be=await Ce.getItem("local:encryptedVault"),Le=await Ce.getItem("local:serverRevision");let ke=Z.vault.blob;if(be&&Le!==null)try{const Te=await Lt.symmetricDecrypt(be,ce);if(Le>=Z.vault.currentRevisionNumber)return console.info(`Existing vault is more advanced (rev ${Le} >= ${Z.vault.currentRevisionNumber}), preserving local vault and will upload to server`),ke=be,await lt("STORE_VAULT_METADATA",{publicEmailDomainList:Z.vault.publicEmailDomainList,privateEmailDomainList:Z.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:Z.vault.hiddenPrivateEmailDomainList},"background"),i.loadDatabase(Te);console.info(`Server vault is more advanced (rev ${Z.vault.currentRevisionNumber} > ${Le}), using server vault`)}catch{console.info("Existing vault could not be decrypted (password changed), using server vault")}await lt("STORE_ENCRYPTED_VAULT",{vaultBlob:Z.vault.blob,serverRevision:Z.vault.currentRevisionNumber},"background"),await lt("STORE_VAULT_METADATA",{publicEmailDomainList:Z.vault.publicEmailDomainList,privateEmailDomainList:Z.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:Z.vault.hiddenPrivateEmailDomainList},"background");const Se=await Lt.symmetricDecrypt(ke,ce);return i.loadDatabase(Se)},ae=async(Z,ce,be,Le,ke)=>{const Se=await ne.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${ce}`}});await a.setAuthTokens(Z,ce,be),await i.storeEncryptionKey(Le),await i.storeEncryptionKeyDerivationParams({salt:ke.salt,encryptionType:ke.encryptionType,encryptionSettings:ke.encryptionSettings});const Te=await X(Se,Le);try{if(await Te.hasPendingMigrations()){e("/upgrade",{replace:!0}),g();return}}catch(Oe){await a.logout(),G(Oe instanceof Error?Oe.message:r("common.errors.unknownError")),g();return}e("/reinitialize",{replace:!0}),g()};w.useEffect(()=>{(async()=>{const ce=await Ce.getItem("local:clientUrl");let be=ja.DEFAULT_CLIENT_URL;ce&&ce.length>0&&(be=ce),Q(be);const Le=await Ce.getItem("local:username");Le&&d(ke=>({...ke,username:Le})),f(!1)})()},[f]),w.useEffect(()=>{const Z=aa.isPopup()?null:l.jsx(l.Fragment,{children:l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:"Open in new window",iconType:Ca.EXPAND})});return s(Z),()=>{s(null)}},[s]);const pe=async Z=>{Z.preventDefault(),G(null);try{m(),a.clearGlobalMessage();const ce=Ka.normalizeUsername(c.username),be=await de.initiateLogin(ce),{passwordHashString:Le,passwordHashBase64:ke}=await Ka.prepareCredentials(c.password,be.salt,be.encryptionType,be.encryptionSettings),Se=await de.validateLogin(ce,Le,E,be);if(Se.requiresTwoFactor){T(be),R(Le),S(ke),_(!0),g();return}if(!Se.token)throw new Error(r("common.errors.unknownError"));await ae(ce,Se.token.token,Se.token.refreshToken,ke,be)}catch(ce){ce instanceof Hr?G(r("common.apiErrors."+ce.message)):G(r("auth.errors.serverError")),g()}},Ae=async Z=>{Z.preventDefault(),G(null);try{if(m(),!k||!B||!x)throw new Error(r("common.errors.unknownError"));const ce=P.trim();if(!/^\d{6}$/.test(ce))throw new Error(r("auth.errors.invalidCode"));const be=Ka.normalizeUsername(c.username),Le=await de.validateLogin2Fa(be,k,E,x,parseInt(P));if(!Le.token)throw new Error(r("common.errors.unknownError"));await ae(be,Le.token.token,Le.token.refreshToken,B,x),_(!1),K(""),R(null),S(null),T(null)}catch(ce){console.error("2FA error:",ce),ce instanceof Hr?G(r("common.apiErrors."+ce.message)):G(r("auth.errors.serverError")),g()}},O=async Z=>{m();try{a.clearGlobalMessage();const ce=await ne.authFetch("Vault",{method:"GET",headers:{Authorization:`Bearer ${Z.token}`}});await a.setAuthTokens(Z.username,Z.token,Z.refreshToken),await i.storeEncryptionKey(Z.decryptionKey),await i.storeEncryptionKeyDerivationParams({salt:Z.salt,encryptionType:Z.encryptionType,encryptionSettings:Z.encryptionSettings});const be=await X(ce,Z.decryptionKey);try{if(await be.hasPendingMigrations()){e("/upgrade",{replace:!0}),g(),f(!1);return}}catch(Le){await a.logout(),G(Le instanceof Error?Le.message:r("common.errors.unknownError")),g();return}g(),f(!1),e("/reinitialize",{replace:!0})}catch(ce){throw G(ce instanceof Error?ce.message:r("common.errors.unknownError")),g(),ce}},$=Z=>{const{name:ce,value:be}=Z.target;d(Le=>({...Le,[ce]:be}))};return j?l.jsx("div",{children:l.jsxs("form",{onSubmit:Ae,className:"bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4",children:[V&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:V}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:r("auth.twoFactorTitle")}),l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 text-sm font-bold mb-2",htmlFor:"twoFactorCode",children:r("auth.authCode")}),l.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:P,onChange:Z=>K(Z.target.value),placeholder:r("auth.authCodePlaceholder"),required:!0})]}),l.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[l.jsx(ta,{type:"submit",children:r("auth.verify")}),l.jsx(ta,{type:"button",onClick:()=>{d({username:"",password:""}),_(!1),K(""),R(null),S(null),T(null),G(null)},variant:"secondary",children:r("common.cancel")})]}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 text-center",children:r("auth.twoFactorNote")})]})}):l.jsx("div",{className:"flex flex-col items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsxs("form",{onSubmit:pe,className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r("auth.loginTitle")}),l.jsx(P2,{})]}),V&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:V}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"username",children:r("auth.username")}),l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"username",type:"text",name:"username",placeholder:r("auth.usernamePlaceholder"),value:c.username,onChange:$,required:!0})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"password",children:r("common.password")}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"password",type:C?"text":"password",name:"password",placeholder:r("auth.passwordPlaceholder"),value:c.password,onChange:$,required:!0}),l.jsx("button",{type:"button",className:"absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:()=>I(!C),tabIndex:-1,children:l.jsx(ch,{type:C?Ca.EYE_OFF:Ca.EYE,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})})]})]}),l.jsx("div",{className:"mb-6",children:l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:E,onChange:Z=>p(Z.target.checked),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-200",children:r("auth.rememberMe")})]})}),l.jsx(ta,{type:"submit",children:l.jsx("div",{className:"flex items-center justify-center gap-2",children:r("auth.loginButton")})}),l.jsxs("button",{type:"button",onClick:()=>W(!0),className:"w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2",children:[l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("auth.loginWithMobile")]}),l.jsxs("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:[r("auth.noAccount")," ",l.jsx("a",{href:H??"",target:"_blank",rel:"noopener noreferrer",className:"text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500",children:r("auth.createVault")})]})]}),l.jsx(Jb,{isOpen:q,onClose:()=>W(!1),onSuccess:O,webApi:ne,mode:"login"})]})})},ns=({type:r,message:e,className:a=""})=>{const i=()=>{const s="p-3 border rounded-md text-sm";switch(r){case"error":return`${s} bg-red-100 dark:bg-red-900/30 border-red-300 dark:border-red-700 text-red-800 dark:text-red-300`;case"success":return`${s} bg-green-100 dark:bg-green-900/30 border-green-300 dark:border-green-700 text-green-800 dark:text-green-300`;case"warning":return`${s} bg-yellow-100 dark:bg-yellow-900/30 border-yellow-300 dark:border-yellow-700 text-yellow-800 dark:text-yellow-300`;case"info":return`${s} bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700 text-blue-800 dark:text-blue-300`;default:return s}};return l.jsx("div",{className:`${i()} ${a}`,children:e})},uh=({isOpen:r,onClose:e,onConfirm:a})=>{const{t:i}=Ge(),[s,c]=w.useState(null),d=w.useCallback(async()=>{try{const m=await lt("GET_SYNC_STATE",{},"background");c(m.isDirty)}catch(m){console.error("Failed to check sync state:",m),c(!1)}},[]);return w.useEffect(()=>{r&&(c(null),d())},[r,d]),!r||s===null?null:s?l.jsxs(_n,{isOpen:r,onClose:e,maxWidth:"max-w-sm",showHeaderBorder:!1,showCloseButton:!1,bodyClassName:"p-6",children:[l.jsxs("div",{className:"flex items-start mb-4",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-6 w-6 text-amber-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.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"})})}),l.jsx("div",{className:"ml-3",children:l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:i("logout.unsyncedChangesTitle")})})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:i("logout.unsyncedChangesWarning")}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:e,className:"flex-1 px-4 py-2 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-md transition-colors",children:i("common.cancel")}),l.jsx("button",{onClick:a,className:"flex-1 px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-md transition-colors",children:i("logout.logoutAnyway")})]})]}):l.jsxs(_n,{isOpen:r,onClose:e,maxWidth:"max-w-sm",showHeaderBorder:!1,showCloseButton:!1,bodyClassName:"p-6",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-3",children:i("common.logout")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:i("auth.logoutConfirm")}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{onClick:e,className:"flex-1 px-4 py-2 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-md transition-colors",children:i("common.cancel")}),l.jsx("button",{onClick:a,className:"flex-1 px-4 py-2 bg-red-500 hover:bg-red-600 text-white rounded-md transition-colors",children:i("common.logout")})]})]})},rE=()=>{var a;const{t:r}=Ge(),{username:e}=jl();return l.jsxs("div",{className:"flex flex-col items-center mb-6",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center mb-3",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-2xl font-medium",children:((a=e==null?void 0:e[0])==null?void 0:a.toUpperCase())||"?"})}),l.jsx("p",{className:"font-medium text-gray-900 dark:text-white text-base",children:e}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("common.loggedIn")})]})},oL=()=>{const{t:r}=Ge(),e=Vn(),a=jl(),i=Ft(),s=pa(),{setHeaderButtons:c}=Kn(),d=zn(),m=new $b(d),[g,f]=w.useState("password"),[E,p]=w.useState(!1),[C,I]=w.useState(""),[x,T]=w.useState(!1),[k,R]=w.useState(""),[B,S]=w.useState(6),j=w.useRef(null),_=w.useRef(null),[P,K]=w.useState(null),{showLoading:H,hideLoading:Q,setIsInitialLoading:V}=na(),[G,q]=w.useState(!1),[W,ne]=w.useState(!1),de=async()=>{try{const Se=await d.getStatus();if(Se.serverVersion==="0.0.0")return V(!1),await i.setIsOffline(!0),{online:!1,error:null};const Te=d.validateStatusResponse(Se);return Te!==null?(await e.logout(r("common.errors."+Te)),{online:!1,error:Te}):(V(!1),await i.setIsOffline(!1),{online:!0,error:null})}catch{return V(!1),{online:!1,error:"sessionExpired"}}};w.useEffect(()=>{(async()=>{const[Te,Oe]=await Promise.all([Nb(),dk()]);p(Te),S(Oe||6),f(Te?"pin":"password"),await de()})()},[]),w.useEffect(()=>{const Se=aa.isPopup()?null:l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Ca.EXPAND});return c(Se),()=>{c(null)}},[c,r]),w.useEffect(()=>{if(g!=="pin")return;const Se=()=>{j.current&&j.current.focus()},Te=()=>{Se()},Oe=()=>{Se()};Se();const Ne=_.current;return Ne&&Ne.addEventListener("click",Te),window.addEventListener("focus",Oe),()=>{Ne&&Ne.removeEventListener("click",Te),window.removeEventListener("focus",Oe)}},[g]);const X=async Se=>{Se.preventDefault(),K(null),H();const Te=await de();if(Te.error){Q();return}try{let Oe;if(Te.online){const je=await m.initiateLogin(a.username);Oe=(await Ka.prepareCredentials(C,je.salt,je.encryptionType,je.encryptionSettings)).passwordHashBase64,await i.storeEncryptionKeyDerivationParams({salt:je.salt,encryptionType:je.encryptionType,encryptionSettings:je.encryptionSettings})}else{const je=await lt("GET_ENCRYPTION_KEY_DERIVATION_PARAMS",{},"background");if(!je){K(r("common.errors.serverNotAvailable")),Q();return}Oe=(await Ka.prepareCredentials(C,je.salt,je.encryptionType,je.encryptionSettings)).passwordHashBase64,await i.setIsOffline(!0)}await i.storeEncryptionKey(Oe);const Ne=await i.loadStoredDatabase();if(!Ne){K(r("auth.errors.wrongPassword")),Q();return}if(await Ne.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await Ce.setItem(io,0),await Ay(),s("/reinitialize",{replace:!0})}catch(Oe){Oe instanceof cs?await e.logout(Oe.message):K(r("auth.errors.wrongPassword")),console.error("Unlock error:",Oe)}finally{Q()}},ae=w.useCallback(async Se=>{R(Se),K(null),Se.length===B&&(await new Promise(Te=>setTimeout(Te,50)),await O(Se))},[B]),pe=Se=>{k.length<8&&ae(k+Se)},Ae=()=>{R(k.slice(0,-1)),K(null)},O=async(Se=k)=>{if(Se.length===B){K(null),H();try{const Te=await fk(Se);(await de()).online||await i.setIsOffline(!0),await i.storeEncryptionKey(Te);const Ne=await i.loadStoredDatabase();if(!Ne)throw new kg(3);if(await Ne.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await Ce.setItem(io,0),s("/reinitialize",{replace:!0}),Q()}catch(Te){if(Te instanceof vu)p(!1),f("password"),K(r("settings.unlockMethod.pinLocked"));else if(Te instanceof kg){const Oe=Te.attemptsRemaining;K(Oe===1?r("settings.unlockMethod.incorrectPinSingular"):r("settings.unlockMethod.incorrectPin",{attemptsRemaining:Oe})),R("")}else Te instanceof Bl?(K(r("settings.unlockMethod.invalidPinFormat")),R("")):(console.error("PIN unlock failed:",Te),K(r("common.errors.unknownErrorTryAgain")),R(""));Q()}}},$=()=>{ne(!0)},Z=async()=>{ne(!1);try{await d.revokeTokens(),await a.clearAuthUserInitiated()}catch(Se){console.error("Error during logout:",Se)}},ce=async Se=>{H();try{await d.revokeTokens(),await a.setAuthTokens(Se.username,Se.token,Se.refreshToken),await i.storeEncryptionKey(Se.decryptionKey),await i.storeEncryptionKeyDerivationParams({salt:Se.salt,encryptionType:Se.encryptionType,encryptionSettings:Se.encryptionSettings});const Te=await i.loadStoredDatabase();if(!Te){K(r("common.errors.unknownErrorTryAgain")),Q();return}if(await Te.hasPendingMigrations()){s("/upgrade",{replace:!0}),Q();return}await Ce.setItem(io,0),await Ay(),s("/reinitialize",{replace:!0})}catch(Te){Te instanceof cs?await e.logout(Te.message):K(r("common.errors.unknownErrorTryAgain")),console.error("Mobile unlock error:",Te)}finally{Q()}},be=()=>{f("password"),K(null)},Le=()=>{f("pin"),K(null)},ke=Array.from({length:B},(Se,Te)=>l.jsx("div",{className:`w-4 h-4 rounded-full border-2 transition-all ${Te<k.length?"bg-primary-500 border-primary-500":"bg-transparent border-gray-300 dark:border-gray-600"}`},Te));return g==="pin"?l.jsx("div",{ref:_,className:"flex flex-col items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsx(rE,{}),l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsxs("div",{className:"text-center mb-4",children:[l.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white mb-1",children:r("auth.unlockTitle")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("auth.enterPinToUnlock")})]}),l.jsx("div",{className:"flex justify-center gap-2 mb-4",children:ke}),P&&l.jsx(ns,{type:"error",message:P,className:"mb-3 text-center"}),l.jsx("input",{ref:j,type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:k,onChange:Se=>ae(Se.target.value.replace(/\D/g,"")),className:"w-0 h-0 opacity-0 absolute",autoFocus:!0,"aria-label":"PIN input"}),l.jsx("div",{children:l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[[1,2,3,4,5,6,7,8,9].map(Se=>l.jsx("button",{type:"button",onClick:()=>pe(Se.toString()),className:"h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95",children:Se},Se)),l.jsx("div",{}),l.jsx("button",{type:"button",onClick:()=>pe("0"),className:"h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95",children:"0"}),l.jsx("button",{type:"button",onClick:Ae,className:"h-12 flex items-center justify-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95","aria-label":"Backspace",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z"})})})]})})]}),l.jsx("div",{className:"mt-4",children:l.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:l.jsx("button",{type:"button",onClick:be,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("auth.useMasterPassword")})})})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center p-4",children:[l.jsxs("div",{className:"w-full max-w-md",children:[l.jsx(rE,{}),l.jsxs("form",{onSubmit:X,className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[l.jsx("div",{className:"text-center mb-6",children:l.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r("auth.unlockTitle")})}),P&&l.jsx(ns,{type:"error",message:P,className:"mb-4 text-center"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 dark:text-gray-200 font-medium mb-2",htmlFor:"password",children:r("auth.masterPassword")}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{className:"shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",id:"password",type:x?"text":"password",value:C,onChange:Se=>I(Se.target.value),placeholder:r("auth.passwordPlaceholder"),required:!0,autoFocus:!0}),l.jsx("button",{type:"button",className:"absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",onClick:()=>T(!x),tabIndex:-1,children:l.jsx(ch,{type:x?Ca.EYE_OFF:Ca.EYE,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})})]})]}),l.jsx(ta,{type:"submit",children:r("auth.unlockVault")}),!i.isOffline&&l.jsxs("button",{type:"button",onClick:()=>q(!0),className:"w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2",children:[l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),r("auth.unlockWithMobile")]}),l.jsxs("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:[r("auth.switchAccounts")," ",l.jsx("button",{type:"button",onClick:$,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("common.logout")})]})]})]}),E&&l.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-6",children:l.jsx("button",{type:"button",onClick:Le,className:"text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium",children:r("auth.unlockWithPin")})}),l.jsx(Jb,{isOpen:G,onClose:()=>q(!1),onSuccess:ce,webApi:d,mode:"unlock"}),l.jsx(uh,{isOpen:W,onClose:()=>ne(!1),onConfirm:Z})]})},lL=()=>{const r=pa(),{t:e}=Ge(),a=()=>{const i=new URL(window.location.href);i.searchParams.delete("mode"),window.history.replaceState({},"",i),r("/items")};return l.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[l.jsx("div",{className:"mb-4 text-green-600 dark:text-green-400",children:l.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}),l.jsx("h2",{className:"text-xl font-semibold mb-4 text-gray-900 dark:text-white",children:e("auth.unlockSuccessTitle")}),l.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-400",children:e("auth.unlockSuccessDescription")}),l.jsxs("div",{className:"space-y-3 w-full",children:[l.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:e("auth.closePopup")}),l.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:e("auth.browseVault")})]})]})},Mu=({isOpen:r,onClose:e,onConfirm:a,title:i,message:s,confirmText:c="",cancelText:d="",variant:m="default"})=>{const g=m==="danger"?"bg-red-600 hover:bg-red-700 focus:ring-red-500":"bg-primary-600 hover:bg-primary-700 focus:ring-primary-500";return l.jsxs(_n,{isOpen:r,onClose:e,maxWidth:"max-w-lg",showHeaderBorder:!1,bodyClassName:"px-4 pb-4 pt-5",children:[l.jsxs("div",{className:"sm:flex sm:items-start",children:[m==="danger"&&l.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:l.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:l.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"})})}),l.jsxs("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[l.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:i}),l.jsx("div",{className:"mt-2",children:l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s})})]})]}),l.jsxs("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[c&&l.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 ${g}`,onClick:a,children:c}),d&&l.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:e,children:d})]})]})};class cL{constructor(){Fe(this,"sqlJsInstance",null);Fe(this,"rustInitialized",!1)}async initRust(){if(this.rustInitialized)return;const e=zr.runtime.getURL("src/aliasvault_core_bg.wasm"),i=await(await fetch(e)).arrayBuffer();await Yu(i),this.rustInitialized=!0}async merge(e,a){try{await this.initRust();const i=this.sqlJsInstance??await Ng({locateFile:d=>`src/${d}`}),s=this.loadDatabase(i,e),c=this.loadDatabase(i,a);try{const d=W2(),m=d.map(C=>({name:C,records:this.readTableAsJson(s,C)})),g=d.map(C=>({name:C,records:this.readTableAsJson(c,C)})),f=JSON.parse(JSON.stringify({local_tables:m,server_tables:g}));console.debug("[VaultMerge] Merge input:",{localTableCount:m.length,serverTableCount:g.length,localTables:m.map(C=>({name:C.name,recordCount:C.records.length})),serverTables:g.map(C=>({name:C.name,recordCount:C.records.length}))});const E=Y2(f);for(const C of E.statements){const I=C.params.map(x=>x===void 0?null:x);s.run(C.sql,I)}const p=this.exportDatabase(s);return{success:E.success,mergedVaultBase64:p,stats:{tablesProcessed:E.stats.tables_processed,recordsFromLocal:E.stats.records_from_local,recordsFromServer:E.stats.records_from_server,recordsCreatedLocally:E.stats.records_created_locally,conflicts:E.stats.conflicts}}}finally{s.close(),c.close()}}catch(i){throw console.error("Vault merge failed:",i),i}}async prune(e,a=30){try{await this.initRust();const i=this.sqlJsInstance??await Ng({locateFile:c=>`src/${c}`}),s=this.loadDatabase(i,e);try{const d=["Items","FieldValues","Attachments","TotpCodes","Passkeys"].map(p=>({name:p,records:this.readTableAsJson(s,p)})),m=JSON.parse(JSON.stringify({tables:d,retention_days:a,current_time:new Date().toISOString()})),g=J2(m);for(const p of g.statements){const C=p.params.map(I=>I===void 0?null:I);s.run(p.sql,C)}const f=this.exportDatabase(s),E=g.statements.length;return E>0&&console.info(`[VaultMerge] Pruned expired items from trash (${E} SQL statements executed)`),{success:g.success,prunedVaultBase64:f,statementCount:E}}finally{s.close()}}catch(i){throw console.error("Vault prune failed:",i),i}}loadDatabase(e,a){const i=atob(a),s=new Uint8Array(i.length);for(let c=0;c<i.length;c++)s[c]=i.charCodeAt(c);return new e.Database(s)}exportDatabase(e){e.run("VACUUM");const a=e.export();let i="";for(let s=0;s<a.length;s++)i+=String.fromCharCode(a[s]);return btoa(i)}readTableAsJson(e,a){const i=[],s=e.prepare(`SELECT * FROM ${a}`);for(;s.step();){const c=s.getAsObject(),d=JSON.parse(JSON.stringify(c));i.push(d)}return s.free(),i}}const uL=new cL,Ju=()=>{const{t:r}=Ge(),e=Vn(),a=Ft(),i=zn(),s=w.useCallback(async m=>await a.hasPendingMigrations()?(m==null||m(),!0):!1,[a]),c=w.useCallback(async(m,g,f)=>(await a.setIsOffline(!0),m==null||m(r("common.offlineMode")),g==null||g(),f==null||f(!1),!0),[a,r]),d=w.useCallback(async(m={})=>{const{onSuccess:g,onError:f,onStatus:E,onOffline:p,onUpgradeRequired:C}=m;try{if(!await e.initializeAuth())return!1;E==null||E(r("common.checkingVaultUpdates"));const x=await i.getStatus(),T=await lt("GET_SYNC_STATE",{},"background");if(x.vaultRevision>T.serverRevision&&a.setIsSyncing(!0),x.serverVersion==="0.0.0")return a.dbAvailable?c(E,p,g):(f==null||f(r("common.errors.serverNotAvailable")),!1);const k=i.validateStatusResponse(x);if(k)return f==null||f(r("common.errors."+k)),!1;const R=await lt("GET_ENCRYPTION_KEY_DERIVATION_PARAMS",{},"background");if(R&&x.srpSalt&&x.srpSalt!==R.salt)return await e.logout(r("common.errors.passwordChanged")),!1;if(a.isOffline&&await a.setIsOffline(!1),x.vaultRevision>T.serverRevision){E==null||E(r("common.syncingUpdatedVault"));const B=await i.get("Vault");try{const S=await lt("GET_ENCRYPTION_KEY",{},"background");if(T.isDirty){E==null||E(r("common.mergingVaultChanges"));const P=await lt("GET_ENCRYPTED_VAULT",{},"background");if(P){const K=await Lt.symmetricDecrypt(P,S),H=await Lt.symmetricDecrypt(B.vault.blob,S),Q=await uL.merge(K,H);if(Q.success){console.info("Vault merge during sync completed:",Q.stats);const V=await Lt.symmetricEncrypt(Q.mergedVaultBase64,S);if(!(await lt("STORE_ENCRYPTED_VAULT",{vaultBlob:V,serverRevision:B.vault.currentRevisionNumber,expectedMutationSeq:T.mutationSequence},"background")).success)return console.info("Mutation detected during merge, re-syncing..."),d(m);E==null||E(r("common.uploadingVault"));const q=await lt("UPLOAD_VAULT",{},"background");if(q.success&&q.status===0)await lt("MARK_VAULT_CLEAN",{mutationSeqAtStart:q.mutationSeqAtStart,newServerRevision:q.newRevisionNumber},"background");else return q.status===2?d(m):(console.error("Failed to upload merged vault:",q.error),f==null||f(q.error??r("common.errors.unknownError")),!1);return await lt("STORE_VAULT_METADATA",{publicEmailDomainList:B.vault.publicEmailDomainList,privateEmailDomainList:B.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:B.vault.hiddenPrivateEmailDomainList},"background"),await a.loadDatabase(Q.mergedVaultBase64),await a.refreshSyncState(),await s(C)?!1:(g==null||g(!0),!0)}else console.error("Vault merge failed during sync, using server vault")}}if(!(await lt("STORE_ENCRYPTED_VAULT",{vaultBlob:B.vault.blob,serverRevision:B.vault.currentRevisionNumber,expectedMutationSeq:T.mutationSequence},"background")).success)return console.info("Mutation detected during sync, re-syncing..."),d(m);await lt("STORE_VAULT_METADATA",{publicEmailDomainList:B.vault.publicEmailDomainList,privateEmailDomainList:B.vault.privateEmailDomainList,hiddenPrivateEmailDomainList:B.vault.hiddenPrivateEmailDomainList},"background");const _=await Lt.symmetricDecrypt(B.vault.blob,S);return await a.loadDatabase(_),await a.refreshSyncState(),await s(C)?!1:(g==null||g(!0),!0)}catch(S){if(S instanceof cs)return await e.logout(S.message),!1;throw new Error("Vault could not be decrypted, if the problem persists please logout and login again.")}}else if(x.vaultRevision===T.serverRevision){if(T.isDirty){E==null||E(r("common.uploadingVault"));const B=await lt("UPLOAD_VAULT",{},"background");if(B.success&&B.status===0)await lt("MARK_VAULT_CLEAN",{mutationSeqAtStart:B.mutationSeqAtStart,newServerRevision:B.newRevisionNumber},"background"),await a.refreshSyncState();else return B.status===2?d(m):(console.error("Failed to upload pending vault:",B.error),f==null||f(B.error??r("common.errors.unknownError")),!1);return g==null||g(!1),!0}}else if(x.vaultRevision<T.serverRevision){console.warn(`Server data loss detected! Server at rev ${x.vaultRevision}, client at rev ${T.serverRevision}. Uploading to recover server state.`),E==null||E(r("common.uploadingVault"));const B=await lt("UPLOAD_VAULT",{},"background");return B.success&&B.status===0?(await lt("MARK_VAULT_CLEAN",{mutationSeqAtStart:B.mutationSeqAtStart,newServerRevision:B.newRevisionNumber},"background"),await a.refreshSyncState(),console.info(`Server recovery complete: rev ${x.vaultRevision} → ${B.newRevisionNumber}`),g==null||g(!1),!0):B.status===2?(console.info("Another client recovered server first, re-syncing..."),d(m)):(console.error("Server recovery failed:",B.error),f==null||f(r("common.errors.unknownError")),!1)}return await s(C)||g==null||g(!1),!1}catch(I){const x=I instanceof Error?I.message:"Unknown error during vault sync";return console.error("Vault sync error:",I),I instanceof cs?(await e.logout(x),!1):I instanceof Hr?!1:I instanceof Wu&&a.dbAvailable?c(E,p,g):(f==null||f(x),!1)}finally{a.setIsSyncing(!1)}},[e,a,i,r,s,c]);return{syncVault:d}};function go(){const r=Ft(),{syncVault:e}=Ju(),a=w.useRef(!1),i=w.useCallback(async d=>{await d();const m=r.sqliteClient.exportToBase64(),g=await lt("GET_ENCRYPTION_KEY",{},"background"),f=await Lt.symmetricEncrypt(m,g);await lt("STORE_ENCRYPTED_VAULT",{vaultBlob:f,markDirty:!0},"background"),await r.refreshSyncState()},[r]),s=w.useCallback(async()=>{if(!a.current){a.current=!0;try{await e({onSuccess:async()=>{await r.refreshSyncState(),r.getIsOffline()||(await lt("GET_SYNC_STATE",{},"background")).isDirty&&(a.current=!1,await s())},onOffline:()=>{},onError:d=>{console.error("Background sync error:",d)}})}catch(d){console.error("Error during background sync:",d)}finally{a.current=!1}}},[r,e]);return{executeVaultMutationAsync:w.useCallback(async d=>{await i(d),s()},[i,s])}}const dL=()=>{var X;const{t:r}=Ge(),{username:e}=Vn(),a=jl(),i=Ft(),{sqliteClient:s}=i,{setHeaderButtons:c}=Kn(),[d,m]=w.useState(!1),[g,f]=w.useState(null),[E,p]=w.useState(null),[C,I]=w.useState(null),[x,T]=w.useState(!1),[k,R]=w.useState(!1),[B,S]=w.useState(!1),{setIsInitialLoading:j}=na(),_=zn(),{executeVaultMutationAsync:P}=go(),{syncVault:K}=Ju(),H=pa();w.useEffect(()=>{const ae=aa.isPopup()?null:l.jsx(l.Fragment,{children:l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Ca.EXPAND})});return c(ae),()=>{c(null)}},[c,r]);const Q=w.useCallback(async()=>{try{if(s){const ae=await s.getDatabaseVersion(),pe=await s.getLatestDatabaseVersion();f(ae),p(pe)}}catch(ae){console.error("Failed to load version information:",ae),I(r("upgrade.alerts.unableToGetVersionInfo"))}finally{j(!1)}},[s,j,r]);w.useEffect(()=>{Q()},[Q]);const V=async()=>{if(!s||!g||!E){I(r("upgrade.alerts.unableToGetVersionInfo"));return}if(await _.isSelfHosted()){T(!0);return}await G()},G=async()=>{if(!s||!g||!E){I(r("upgrade.alerts.unableToGetVersionInfo"));return}m(!0),I(null);try{const pe=new xg().getUpgradeVaultSql(g.revision,E.revision);if(!pe.success)throw new Error(pe.error??r("upgrade.alerts.upgradeFailed"));if(pe.sqlCommands.length===0){await q();return}await P(async()=>{s.beginTransaction();for(let Ae=0;Ae<pe.sqlCommands.length;Ae++){const O=pe.sqlCommands[Ae];try{s.executeRaw(O)}catch($){throw console.error(`Error executing SQL command ${Ae+1}:`,O,$),s.rollbackTransaction(),new Error(r("upgrade.alerts.failedToApplyMigration",{current:Ae+1,total:pe.sqlCommands.length}))}}s.commitTransaction()}),await q()}catch(ae){console.error("Upgrade failed:",ae),I(ae instanceof Error?ae.message:r("common.errors.unknownError"))}finally{m(!1)}},q=async()=>{try{await K({onSuccess:()=>{H("/items")},onError:ae=>{console.error("Sync error after upgrade:",ae),H("/items")}})}catch(ae){console.error("Error during post-upgrade sync:",ae),H("/items")}},W=()=>{S(!0)},ne=async()=>{S(!1);try{await _.revokeTokens(),await a.clearAuthUserInitiated()}catch(ae){console.error("Error during logout:",ae)}},de=()=>{R(!0)};return l.jsxs("div",{children:[d&&l.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:[l.jsx(Un,{}),l.jsx("div",{className:"text-sm text-gray-500 mt-2",children:r("upgrade.upgrading")})]}),l.jsx(Mu,{isOpen:x,onClose:()=>T(!1),onConfirm:()=>{T(!1),G()},title:r("upgrade.alerts.selfHostedServer"),message:r("upgrade.alerts.selfHostedWarning"),confirmText:r("upgrade.alerts.continueUpgrade"),cancelText:r("common.cancel")}),l.jsx(Mu,{isOpen:k,onClose:()=>R(!1),onConfirm:()=>R(!1),title:r("upgrade.whatsNew"),message:`${r("upgrade.whatsNewDescription")}

${(E==null?void 0:E.description)??r("upgrade.noDescriptionAvailable")}`}),l.jsxs("form",{className:"w-full px-2 pt-2 pb-2 mb-4",children:[C&&l.jsx("div",{className:"mb-4 text-red-500 dark:text-red-400",children:C}),l.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((X=e==null?void 0:e[0])==null?void 0:X.toUpperCase())||"?"})})}),l.jsx("div",{children:l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:e})})]}),l.jsx("h2",{className:"text-xl font-bold dark:text-gray-200 mb-4",children:r("upgrade.title")}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-gray-700 dark:text-gray-200 mb-4",children:r("upgrade.subtitle")}),l.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded p-4 mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-200",children:r("upgrade.versionInformation")}),l.jsx("button",{type:"button",onClick:de,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:r("upgrade.whatsNew"),children:"?"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("upgrade.yourVault")}),l.jsx("span",{className:"text-sm font-bold text-orange-600 dark:text-orange-400",children:(g==null?void 0:g.compatibleUpToVersion)??"..."})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("upgrade.newVersion")}),l.jsx("span",{className:"text-sm font-bold text-green-600 dark:text-green-400",children:(E==null?void 0:E.releaseVersion)??"..."})]})]})]})]}),l.jsxs("div",{className:"flex flex-col w-full space-y-2",children:[l.jsx(ta,{type:"button",id:"upgrade-button",onClick:V,children:r(d?"upgrade.upgrading":"upgrade.upgrade")}),l.jsx("button",{type:"button",onClick:W,className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm font-medium py-2",disabled:d,children:r("common.logout")})]})]}),l.jsx(uh,{isOpen:B,onClose:()=>S(!1),onConfirm:ne})]})};class mL{convertAnchorTagsToOpenInNewTab(e){try{const i=new DOMParser().parseFromString(e,"text/html"),s=i.querySelectorAll("a[href]");return s.length>0&&s.forEach(c=>{if((!c.hasAttribute("target")||c.getAttribute("target")!=="_blank")&&c.setAttribute("target","_blank"),!c.hasAttribute("rel"))c.setAttribute("rel","noopener noreferrer");else{const d=c.getAttribute("rel")??"",m=new Set(d.split(" ").filter(g=>g.trim()!==""));m.add("noopener"),m.add("noreferrer"),c.setAttribute("rel",Array.from(m).join(" "))}}),i.documentElement.outerHTML}catch(a){return console.error(`Error in convertAnchorTagsToOpenInNewTab: ${a instanceof Error?a.message:String(a)}`),e}}normalizeUsername(e){return e.toLowerCase().trim()}}const fL=new mL,Pl=(r=!1,e=300)=>{const[a,i]=w.useState(r),s=w.useRef(null),c=w.useRef(null),d=w.useCallback(m=>{if(m)i(!0),c.current=Date.now();else{const g=c.current?Date.now()-c.current:0,f=Math.max(0,e-g);f===0?i(!1):(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{i(!1)},f))}},[e]);return w.useEffect(()=>{r&&(i(!0),c.current=Date.now())},[r,i]),w.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),[a,d]},gL=()=>{const{t:r}=Ge(),{id:e}=Ku(),a=pa(),i=Ft(),s=zn(),[c,d]=w.useState(null),[m,g]=w.useState(null),[f,E]=Pl(!0,150),[p,C]=w.useState(!1),[I,x]=w.useState(!1),{setIsInitialLoading:T}=na(),{setHeaderButtons:k}=Kn(),[R,B]=w.useState(!1);w.useEffect(()=>{aa.isPopup()&&(window.history.replaceState({},"","popup.html#/emails"),window.history.pushState({},"",`popup.html#/emails/${e}`)),(async()=>{try{if(E(!0),d(null),!(i!=null&&i.sqliteClient)||!e)return;if(i.isOffline){d(r("emails.offlineMessage")),E(!1),T(!1);return}const K=await s.get(`Email/${e}`),H=i.sqliteClient.settings.getAllEncryptionKeys(),Q=await Lt.decryptEmail(K,H);g(Q)}catch(K){d(K instanceof Error?K.message:"An error occurred")}finally{E(!1),T(!1)}})()},[e,i==null?void 0:i.sqliteClient,i.isOffline,r,s,E,T]);const S=w.useCallback(async()=>{try{await s.delete(`Email/${e}`),aa.isPopup()?window.close():a("/emails")}catch(P){d(P instanceof Error?P.message:"Failed to delete email")}},[e,s,a]),j=w.useCallback(()=>{aa.openInNewPopup(`/emails/${e}`)},[e]),_=async P=>{try{const K=await s.downloadBlob(`Email/${e}/attachments/${P.id}`);if(!(i!=null&&i.sqliteClient)||!m){d("Database context or email not available");return}const H=i.sqliteClient.settings.getAllEncryptionKeys(),Q=await Lt.decryptAttachment(K,m,H);if(!Q){d("Failed to decrypt attachment");return}const V=new Blob([new Uint8Array(Q)],{type:P.mimeType??"application/octet-stream"}),G=window.URL.createObjectURL(V),q=document.createElement("a");q.href=G,q.download=P.filename,document.body.appendChild(q),q.click(),window.URL.revokeObjectURL(G),document.body.removeChild(q)}catch(K){console.error("handleDownloadAttachment error",K),d(K instanceof Error?K.message:"Failed to download attachment")}};return w.useEffect(()=>{if(!R){const P=l.jsxs("div",{className:"flex items-center gap-2",children:[!aa.isPopup()&&l.jsx(cn,{onClick:j,title:r("common.openInNewWindow"),iconType:Ca.EXPAND}),l.jsx(cn,{onClick:()=>C(!0),title:r("emails.deleteEmailTitle"),iconType:Ca.DELETE,variant:"danger"})]});k(P),B(!0)}return()=>{}},[k,R,j,r]),w.useEffect(()=>()=>k(null),[k]),f?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx(Un,{})}):c?l.jsxs("div",{className:"text-red-500",children:[r("common.error")," ",c]}):m?l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx(Mu,{isOpen:p,onClose:()=>C(!1),onConfirm:()=>{C(!1),S()},title:r("emails.deleteEmailTitle"),message:r("emails.deleteEmailConfirm"),confirmText:r("common.delete"),cancelText:r("common.cancel"),variant:"danger"}),l.jsxs("div",{children:[l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-start",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:m.subject}),l.jsx("button",{onClick:()=>x(!I),className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:r(I?"common.hideDetails":"common.showDetails"),children:l.jsx("svg",{className:`w-4 h-4 text-gray-500 dark:text-gray-400 transition-transform ${I?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})}),I&&l.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400 mt-2",children:[l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.from")})," ",l.jsx("span",{title:m.fromLocal+"@"+m.fromDomain,children:m.fromDisplay})]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.to")})," ",l.jsxs("span",{title:m.toLocal+"@"+m.toDomain,children:[m.toLocal,"@",m.toDomain]})]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-bold",children:r("emails.date")})," ",new Date(m.dateSystem).toLocaleString()]})]})]}),l.jsx("div",{className:"bg-white mt-4",children:m.messageHtml?l.jsx("iframe",{srcDoc:fL.convertAnchorTagsToOpenInNewTab(m.messageHtml),className:"w-full min-h-[500px] border-0",title:r("emails.emailContent")}):l.jsx("pre",{className:"whitespace-pre-wrap text-gray-800 p-3",children:m.messagePlain})}),m.attachments&&m.attachments.length>0&&l.jsxs("div",{className:"p-6 border-t border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:r("common.attachments")}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:m.attachments.map(P=>l.jsxs("button",{onClick:()=>_(P),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:[l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})}),l.jsxs("span",{children:[P.filename," (",Math.ceil(P.filesize/1024)," KB)"]})]},P.id))})]})]})]}):l.jsx("div",{className:"text-gray-500",children:r("emails.emailNotFound")})},Mg=({onClick:r})=>l.jsxs("div",{className:"px-2 items-center",children:[l.jsxs("div",{className:"relative inline-flex items-center",children:[l.jsx("button",{id:"reload-vault",onClick:r,className:"absolute p-2 hover:bg-gray-200 rounded-2xl",children:l.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:l.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"})})}),l.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:[l.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"}),l.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"})]})]}),l.jsx("span",{className:"sr-only",children:"Loading..."})]}),hL=()=>{const{t:r}=Ge(),e=Ft(),a=zn(),{setHeaderButtons:i}=Kn(),[s,c]=w.useState(null),[d,m]=w.useState([]),{setIsInitialLoading:g}=na(),[f,E]=Pl(!0,100),p=w.useCallback(async()=>{try{if(E(!0),c(null),!(e!=null&&e.sqliteClient))return;if(e.isOffline){E(!1),g(!1);return}const I=e.sqliteClient.items.getAllEmailAddresses();try{const x=await a.post("EmailBox/bulk",{addresses:I,page:1,pageSize:50}),T=e.sqliteClient.settings.getAllEncryptionKeys(),k=await Lt.decryptEmailList(x.mails,T);m(k)}catch(x){throw console.error(x),new Error(r("common.errors.unknownError"))}}catch(I){c(I instanceof Error?I.message:r("common.errors.unknownError"))}finally{E(!1),g(!1)}},[e==null?void 0:e.sqliteClient,e.isOffline,a,E,g,r]);w.useEffect(()=>{p()},[p]),w.useEffect(()=>{const I=aa.isPopup()?null:l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Ca.EXPAND});return i(I),()=>{i(null)}},[i,r]);const C=I=>{const x=new Date,T=new Date(I),k=Math.floor((x.getTime()-T.getTime())/1e3);if(k<60)return r("emails.dateFormat.justNow");if(k<3600){const R=Math.floor(k/60);return R===1?r("emails.dateFormat.minutesAgo_single",{count:R}):r("emails.dateFormat.minutesAgo_plural",{count:R})}else if(k<86400){const R=Math.floor(k/3600);return R===1?r("emails.dateFormat.hoursAgo_single",{count:R}):r("emails.dateFormat.hoursAgo_plural",{count:R})}else return k<172800?r("emails.dateFormat.yesterday"):T.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit"})};return f?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx(Un,{})}):s?l.jsxs("div",{className:"text-red-500",children:[r("common.error"),": ",s]}):e.isOffline?l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")})}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:l.jsx("p",{className:"text-sm",children:r("emails.offlineMessage")})})]}):d.length===0?l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")}),l.jsx(Mg,{onClick:p})]}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 space-y-2",children:l.jsx("p",{className:"text-sm",children:r("emails.noEmailsDescription")})})]}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("emails.title")}),l.jsx(Mg,{onClick:p})]}),l.jsx("div",{className:"space-y-2",children:d.map(I=>l.jsxs(qu,{to:`/emails/${I.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:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("div",{className:"text-gray-900 dark:text-white mb-1 font-bold",children:I.subject}),l.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:C(I.dateSystem)})]}),l.jsx("div",{className:"text-gray-600 text-sm dark:text-gray-300 line-clamp-2",children:I.messagePreview})]},I.id))})]})},AL=()=>{const{isFullyInitialized:r}=Lk();return r?l.jsx(EC,{to:"/reinitialize",replace:!0}):null},pL=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),yL=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),EL=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})}),Fu=()=>l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),bL=r=>{switch(r){case nt.Notes:return l.jsx(pL,{});default:return l.jsx(Fu,{})}},IL=r=>{switch(r){case"2fa":return l.jsx(yL,{});case"attachments":return l.jsx(EL,{});default:return l.jsx(Fu,{})}},vL=({optionalSystemFields:r,visibleFieldKeys:e,optionalSections:a,callbacks:i})=>{const{t:s}=Ge(),[c,d]=w.useState(!1),[m,g]=w.useState(!1),[f,E]=w.useState(""),[p,C]=w.useState("Text"),I=w.useCallback(()=>{g(!0),d(!1)},[]),x=w.useCallback(()=>{f.trim()&&(i.onAddCustomField(f,p),E(""),C("Text"),g(!1))},[f,p,i]),T=w.useCallback(()=>{E(""),C("Text"),g(!1)},[]),k=w.useCallback(S=>{i.onAddSystemField(S),d(!1)},[i]),R=w.useCallback(S=>{S(),d(!1)},[]),B=w.useMemo(()=>{const S=[];return r.forEach(j=>{e.has(j.FieldKey)||S.push({key:j.FieldKey,label:s(`fieldLabels.${j.FieldKey}`,{defaultValue:j.FieldKey}),icon:bL(j.Category),action:()=>k(j.FieldKey)})}),a.forEach(j=>{j.isVisible||S.push({key:j.key,label:s(`common.${j.key==="2fa"?"twoFactorAuthentication":j.key}`),icon:IL(j.key),action:()=>R(j.onAdd)})}),S},[r,e,a,s,k,R]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",id:"add-field-menu",onClick:()=>d(!c),className:"w-full px-4 py-2 border-2 border-dashed border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 rounded-md hover:border-primary-500 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors flex items-center justify-center gap-2",children:l.jsx(Fu,{})}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50",onClick:()=>d(!1)}),l.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-1 z-20 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg overflow-hidden",children:[B.map(S=>l.jsxs("button",{type:"button",onClick:S.action,className:"w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 text-gray-700 dark:text-gray-300",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:S.icon}),l.jsx("span",{children:S.label})]},S.key)),l.jsxs("button",{type:"button",onClick:I,className:"w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 text-gray-700 dark:text-gray-300",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:l.jsx(Fu,{})}),l.jsx("span",{children:s("itemTypes.addCustomField")})]})]})]})]}),l.jsx(_n,{isOpen:m,onClose:T,title:s("itemTypes.addCustomField"),footer:l.jsxs("div",{className:"flex gap-3",children:[l.jsx("button",{type:"button",onClick:x,disabled:!f.trim(),className:"flex-1 px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s("common.add")}),l.jsx("button",{type:"button",onClick:T,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500",children:s("common.cancel")})]}),children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s("itemTypes.fieldLabel")}),l.jsx("input",{type:"text",value:f,onChange:S=>E(S.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white",placeholder:s("itemTypes.enterFieldName"),autoFocus:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s("itemTypes.fieldType")}),l.jsxs("select",{value:p,onChange:S=>C(S.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white",children:[l.jsx("option",{value:"Text",children:s("itemTypes.fieldTypes.text")}),l.jsx("option",{value:"Hidden",children:s("itemTypes.fieldTypes.hidden")}),l.jsx("option",{value:"Email",children:s("itemTypes.fieldTypes.email")}),l.jsx("option",{value:"URL",children:s("itemTypes.fieldTypes.url")}),l.jsx("option",{value:"Phone",children:s("itemTypes.fieldTypes.phone")}),l.jsx("option",{value:"Number",children:s("itemTypes.fieldTypes.number")}),l.jsx("option",{value:"Date",children:s("itemTypes.fieldTypes.date")}),l.jsx("option",{value:"TextArea",children:s("itemTypes.fieldTypes.textArea")})]})]})]})})]})},wL=({htmlFor:r,label:e,onLabelChange:a,onDelete:i})=>{const[s,c]=w.useState(!1),[d,m]=w.useState(e),g=()=>{d.trim()&&(a(d.trim()),c(!1))},f=()=>{m(e),c(!1)},E=p=>{p.key==="Enter"?g():p.key==="Escape"&&f()};return s?l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("input",{type:"text",value:d,onChange:p=>m(p.target.value),onKeyDown:E,onBlur:g,className:"flex-1 px-2 py-1 text-sm font-medium text-gray-700 dark:text-gray-300 border border-primary-500 rounded focus:outline-none focus:ring-1 focus:ring-primary-500 dark:bg-gray-700 dark:border-primary-400",placeholder:"Field label",autoFocus:!0}),l.jsx("button",{type:"button",onClick:g,className:"text-green-600 dark:text-green-400 hover:text-green-700 dark:hover:text-green-300 text-xs px-2 py-1",children:"✓"}),l.jsx("button",{type:"button",onClick:f,className:"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 text-xs px-2 py-1",children:"✕"})]}):l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("label",{htmlFor:r,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:e}),l.jsx("button",{type:"button",onClick:()=>c(!0),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-xs",title:"Edit label",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),i&&l.jsx("button",{type:"button",onClick:i,className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 text-xs",title:"Delete field",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]})},CL=({id:r,value:e,onChange:a,error:i,required:s=!1,onRemove:c,onGenerateAlias:d,isEmailMode:m,onEmailModeChange:g})=>{const{t:f}=Ge(),E=Ft(),p=m!==void 0,[C,I]=w.useState(!0),x=p?m:C,T=w.useCallback(Ae=>{const O=typeof Ae=="function"?Ae(x):Ae;p&&g?g(O):I(O)},[p,g,x]),[k,R]=w.useState(""),[B,S]=w.useState(""),[j,_]=w.useState(!1),[P,K]=w.useState([]),[H,Q]=w.useState([]),[V,G]=w.useState([]),q=w.useRef(null),W=w.useRef(!1);w.useEffect(()=>{(async()=>{const O=await E.getVaultMetadata();K((O==null?void 0:O.publicEmailDomains)??[]),Q((O==null?void 0:O.privateEmailDomains)??[]),G((O==null?void 0:O.hiddenPrivateEmailDomains)??[])})()},[E]);const ne=w.useMemo(()=>H.length>0&&!(H.length===1&&(H[0]==="DISABLED.TLD"||H[0]==="")),[H]);w.useEffect(()=>{if(!e){R(""),B||(ne&&H[0]?S(H[0]):P[0]&&S(P[0]));return}if(e.includes("@")){const[Ae,O]=e.split("@");if(R(Ae),S(O),!W.current){const $=P.includes(O)||H.includes(O)||V.includes(O);p&&g?g(!$):p||T(!$)}}else R(e),!B&&!e.includes("@")&&(ne&&H[0]?S(H[0]):P[0]&&S(P[0]))},[e,P,H,V,ne,p,g,B,T]),w.useEffect(()=>{if(W.current||!e||!e.includes("@"))return;const Ae=e.split("@")[1];if(!Ae)return;const O=P.includes(Ae)||H.includes(Ae)||V.includes(Ae);p&&g?g(!O):p||O&&x&&T(!1)},[P,H,V,e,x,p,g,T]),w.useEffect(()=>{if(!x&&e&&!e.includes("@")&&e.trim()){const Ae=ne&&H[0]?H[0]:P[0],O=B||Ae;O&&(!B&&Ae&&S(Ae),a(`${e}@${O}`))}},[e,x,B,ne,H,P,a]);const de=w.useCallback(Ae=>{const O=Ae.target.value;if(W.current=!1,x){a(O);return}if(O.includes("@")){T(!0),a(O);return}if(R(O),!O||O.trim()==="")a("");else{const $=B||(ne&&H[0]?H[0]:P[0]||"");$?(a(`${O}@${$}`),B||S($)):a(O)}},[x,B,a,T,ne,H,P]),X=w.useCallback(Ae=>{S(Ae);const O=k.includes("@")?k.split("@")[0]:k;!O||O.trim()===""?a(""):a(`${O}@${Ae}`),T(!1),_(!1)},[k,a,T]),ae=w.useCallback(()=>{W.current=!0;const Ae=!x;if(T(Ae),Ae)a(""),R("");else{const O=ne&&H[0]?H[0]:P[0];S(O),R(""),a("")}},[x,ne,P,H,a,T]);w.useEffect(()=>{const Ae=O=>{q.current&&!q.current.contains(O.target)&&_(!1)};if(j)return document.addEventListener("mousedown",Ae),()=>{document.removeEventListener("mousedown",Ae)}},[j]);const pe=w.useCallback(()=>{W.current=!0,T(!1);const Ae=ne&&H[0]?H[0]:P[0];Ae&&S(Ae),R(""),a(""),d&&d()},[d,T,ne,H,P,a]);return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{type:"button",onClick:x?void 0:ae,className:`text-sm font-medium transition-colors ${x?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 cursor-pointer"}`,children:f("common.email")}),l.jsx("span",{className:"mx-2 text-gray-400 dark:text-gray-500",children:"/"}),l.jsx("button",{type:"button",onClick:x?pe:void 0,className:`text-sm font-medium transition-colors ${x?"text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 cursor-pointer":"text-primary-600 dark:text-primary-400"}`,children:f("common.alias")}),s&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}),c&&l.jsx("button",{type:"button",onClick:c,className:"w-5 h-5 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors",title:f("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),l.jsxs("div",{className:"relative w-full",children:[l.jsxs("div",{className:"flex w-full",children:[l.jsx("input",{type:"text",id:r,className:`flex-1 min-w-0 px-3 py-2 border text-sm ${i?"border-red-500":"border-gray-300 dark:border-gray-600"} ${x?"rounded-md":"rounded-l-md"} focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white`,value:x?e:k,onChange:de}),!x&&l.jsxs("button",{type:"button",onClick:()=>_(!j),className:`inline-flex items-center px-2 py-2 border border-l-0 border-gray-300 dark:border-gray-600 ${d?"":"rounded-r-md"} bg-gray-50 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-500 cursor-pointer text-sm truncate max-w-[120px]`,children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"@"}),l.jsx("span",{className:"truncate ml-0.5",children:B})]}),!x&&d&&l.jsx("button",{type:"button",onClick:d,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:f("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]}),j&&!x&&l.jsx("div",{ref:q,className:"absolute z-50 mt-2 w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-h-96 overflow-y-auto",children:l.jsxs("div",{className:"p-4",children:[ne&&l.jsxs("div",{className:"mb-4",children:[l.jsxs("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:[f("items.privateEmailTitle")," ",l.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f("items.privateEmailAliasVaultServer"),")"]})]}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:f("items.privateEmailDescription")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:H.filter(Ae=>!V.includes(Ae)).map(Ae=>l.jsx("button",{type:"button",onClick:()=>X(Ae),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${B===Ae?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"}`,children:Ae},Ae))})]}),l.jsxs("div",{className:ne?"border-t border-gray-200 dark:border-gray-600 pt-4":"",children:[l.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:f("items.publicEmailTitle")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:f("items.publicEmailDescription")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:P.map(Ae=>l.jsx("button",{type:"button",onClick:()=>X(Ae),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${B===Ae?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"}`,children:Ae},Ae))})]})]})})]}),i&&l.jsx("p",{className:"text-sm text-red-500 mt-1",children:i})]})},NL=({name:r})=>{switch(r){case"visibility":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return l.jsxs(l.Fragment,{children:[l.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"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"refresh":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M1 20v-6h6"}),l.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 l.jsxs(l.Fragment,{children:[l.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"}),l.jsx("path",{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});default:return null}},Xu=w.forwardRef(({id:r,label:e,value:a,onChange:i,type:s="text",placeholder:c,required:d=!1,multiline:m=!1,rows:g=1,error:f,buttons:E=[],showPassword:p,onShowPasswordChange:C},I)=>{const{t:x}=Ge(),[T,k]=zg.useState(!1),R=p!==void 0?p:T,B=_=>{p!==void 0?C==null||C(_):k(_)},S=`mt-1 block text-sm w-full rounded-md ${f?"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`,j=s==="password"?[...E,{icon:R?"visibility-off":"visibility",onClick:()=>B(!R),title:x(R?"common.hidePassword":"common.showPassword")}]:E;return l.jsxs("div",{children:[l.jsxs("label",{htmlFor:r,className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:[e,d&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsxs("div",{className:"relative",children:[m?l.jsx("textarea",{id:r,value:a,onChange:_=>i(_.target.value),rows:g,placeholder:c,className:S}):l.jsx("input",{ref:I,type:s==="password"&&!R?"password":"text",id:r,value:a,onChange:_=>i(_.target.value),placeholder:c,className:S}),j.length>0&&l.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:j.map((_,P)=>l.jsx("button",{type:"button",onClick:_.onClick,title:_.title,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(NL,{name:_.icon})})},P))})]}),f&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:f})]})});Xu.displayName="FormInput";const uu=({title:r,children:e,actions:a})=>l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[r&&l.jsxs("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white flex items-center justify-between",children:[typeof r=="string"?l.jsx("span",{children:r}):r,a&&l.jsx("div",{className:"flex items-center gap-2",children:a})]}),l.jsx("div",{className:"space-y-4",children:e})]}),xL=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,showValue:d,onShowValueChange:m})=>{const{t:g}=Ge(),[f,E]=w.useState(!1),p=d!==void 0?d:f,C=w.useCallback(x=>{d!==void 0?m==null||m(x):E(x)},[d,m]),I=w.useCallback(()=>{C(!p)},[p,C]);return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:p?"text":"password",id:r,value:a,onChange:x=>i(x.target.value),placeholder:s,className:"outline-0 text-sm 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"})}),l.jsx("div",{className:"flex",children:l.jsx("button",{type:"button",onClick:I,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:g(p?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p?l.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"}):l.jsxs(l.Fragment,{children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.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"})]})})})})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})]})};var TL=class{constructor(r){this.lowercaseChars="abcdefghijklmnopqrstuvwxyz",this.uppercaseChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.numberChars="0123456789",this.specialChars="!@#$%^&*()_+-=[]{}|;:,.<>?",this.ambiguousChars="Il1O0oZzSsBbGg2568|[]{}()<>;:,.`'\"_-",this.length=18,this.useLowercase=!0,this.useUppercase=!0,this.useNumbers=!0,this.useSpecial=!0,this.useNonAmbiguous=!1,r&&this.applySettings(r)}applySettings(r){return this.length=r.Length,this.useLowercase=r.UseLowercase,this.useUppercase=r.UseUppercase,this.useNumbers=r.UseNumbers,this.useSpecial=r.UseSpecialChars,this.useNonAmbiguous=r.UseNonAmbiguousChars,this}setLength(r){return this.length=r,this}useLowercaseLetters(r){return this.useLowercase=r,this}useUppercaseLetters(r){return this.useUppercase=r,this}useNumericCharacters(r){return this.useNumbers=r,this}useSpecialCharacters(r){return this.useSpecial=r,this}useNonAmbiguousCharacters(r){return this.useNonAmbiguous=r,this}getUnbiasedRandomIndex(r){const e=Math.floor(4294967296/r)*r;for(;;){const a=new Uint32Array(1);crypto.getRandomValues(a);const i=a[0];if(i<e)return i%r}}generateRandomPassword(){const r=this.buildCharacterSet();let e=this.generateInitialPassword(r);return e=this.ensureRequirements(e),e}buildCharacterSet(){let r="";return this.useLowercase&&(r+=this.lowercaseChars),this.useUppercase&&(r+=this.uppercaseChars),this.useNumbers&&(r+=this.numberChars),this.useSpecial&&(r+=this.specialChars),r.length===0&&(r=this.lowercaseChars),this.useNonAmbiguous&&(r=this.removeAmbiguousCharacters(r)),r}removeAmbiguousCharacters(r){for(const e of this.ambiguousChars)r=r.replace(e,"");return r}generateInitialPassword(r){let e="";for(let a=0;a<this.length;a++)e+=r[this.getUnbiasedRandomIndex(r.length)];return e}ensureRequirements(r){return this.useLowercase&&!/[a-z]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.lowercaseChars))),this.useUppercase&&!/[A-Z]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.uppercaseChars))),this.useNumbers&&!/\d/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.numberChars))),this.useSpecial&&!/[!@#$%^&*()_+\-=[\]{}|;:,.<>?]/.exec(r)&&(r=this.addCharacterFromSet(r,this.getSafeCharacterSet(this.specialChars))),r}getSafeCharacterSet(r){return this.useNonAmbiguous?this.removeAmbiguousCharacters(r):r}addCharacterFromSet(r,e){const a=this.getUnbiasedRandomIndex(this.length),i=e[this.getUnbiasedRandomIndex(e.length)];return r.substring(0,a)+i+r.substring(a+1)}},dh=r=>new TL(r);const SL=({isOpen:r,onClose:e,onSave:a,onSettingsChange:i,initialSettings:s})=>{const{t:c}=Ge(),[d,m]=w.useState(s),[g,f]=w.useState(""),E=w.useCallback(x=>{try{const k=dh(x).generateRandomPassword();f(k)}catch(T){console.error("Error generating preview password:",T),f("")}},[]);w.useEffect(()=>{r&&(m({...s}),E({...s}))},[r,s,E]);const p=w.useCallback((x,T)=>{const k={...d,[x]:T};m(k),E(k),i==null||i(k)},[d,E,i]),C=w.useCallback(()=>{E(d)},[d,E]),I=w.useCallback(()=>{a(g),e()},[g,a,e]);return l.jsx(_n,{isOpen:r,onClose:e,title:c("items.changePasswordComplexity"),maxWidth:"max-w-lg",footer:l.jsx("div",{className:"flex justify-end",children:l.jsxs("button",{type:"button",className:"inline-flex 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",onClick:I,children:[l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})}),c("common.use")]})}),children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:g,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"}),l.jsx("button",{type:"button",onClick:C,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:c("common.generate"),children:l.jsx("svg",{className:"w-4 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("button",{type:"button",onClick:()=>p("UseLowercase",!d.UseLowercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.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:c("items.includeLowercase"),children:l.jsx("span",{className:"font-mono text-base",children:"a-z"})}),l.jsx("button",{type:"button",onClick:()=>p("UseUppercase",!d.UseUppercase),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.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:c("items.includeUppercase"),children:l.jsx("span",{className:"font-mono text-base",children:"A-Z"})}),l.jsx("button",{type:"button",onClick:()=>p("UseNumbers",!d.UseNumbers),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.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:c("items.includeNumbers"),children:l.jsx("span",{className:"font-mono text-base",children:"0-9"})}),l.jsx("button",{type:"button",onClick:()=>p("UseSpecialChars",!d.UseSpecialChars),className:`flex items-center justify-center px-3 py-2 rounded-md text-sm font-medium transition-colors ${d.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:c("items.includeSpecialChars"),children:l.jsx("span",{className:"font-mono text-base",children:"!@#"})})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("input",{id:"use-non-ambiguous",type:"checkbox",checked:d.UseNonAmbiguousChars,onChange:x=>p("UseNonAmbiguousChars",x.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"}),l.jsx("label",{htmlFor:"use-non-ambiguous",className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:c("items.avoidAmbiguousChars")})]})]})]})})},kL=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,showPassword:d,onShowPasswordChange:m,initialSettings:g,onSettingsChange:f})=>{const{t:E}=Ge(),p=Ft(),[C,I]=w.useState(!1),[x,T]=w.useState(!1),[k,R]=w.useState(null),[B,S]=w.useState(!1),j=d!==void 0?d:C,_=w.useCallback(W=>{d!==void 0?m==null||m(W):I(W)},[d,m]);w.useEffect(()=>{(async()=>{try{if(p.sqliteClient){if(g!==void 0)R(g);else{const ne=p.sqliteClient.settings.getPasswordSettings();R(ne)}S(!0)}}catch(ne){console.error("Error loading password settings:",ne)}})()},[p.sqliteClient,g]);const P=w.useCallback(W=>{try{const de=dh(W).generateRandomPassword();i(de),_(!0)}catch(ne){console.error("Error generating password:",ne)}},[i,_]),K=w.useCallback(W=>{if(!k)return;const ne=parseInt(W.target.value,10),de={...k,Length:ne};R(de),f==null||f(de),P(de)},[k,P,f]),H=w.useCallback(()=>{k&&P(k)},[P,k]),Q=w.useCallback(W=>{i(W),_(!0)},[i,_]),V=w.useCallback(W=>{R(W),f==null||f(W)},[f]),G=w.useCallback(()=>{_(!j)},[j,_]),q=w.useCallback(()=>{T(!0)},[]);return!k||!B?l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsx("div",{className:"animate-pulse bg-gray-200 dark:bg-gray-700 h-10 rounded-lg"})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:j?"text":"password",id:r,value:a,onChange:W=>i(W.target.value),placeholder:s,className:"outline-0 text-sm 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"})}),l.jsxs("div",{className:"flex",children:[l.jsx("button",{type:"button",onClick:G,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:E(j?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:j?l.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"}):l.jsxs(l.Fragment,{children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.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"})]})})}),l.jsx("button",{type:"button",onClick:H,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:E("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]})]}),l.jsxs("div",{className:"pt-2",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{htmlFor:`${r}-length`,className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:E("items.passwordLength")}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:k.Length}),l.jsx("button",{type:"button",onClick:q,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",title:E("items.changePasswordComplexity"),children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.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"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]})]}),l.jsx("input",{type:"range",id:`${r}-length`,min:"8",max:"64",value:k.Length,onChange:K,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c}),l.jsx(SL,{isOpen:x,onClose:()=>T(!1),onSave:Q,onSettingsChange:V,initialSettings:k})]})},LL=({id:r,label:e,value:a,onChange:i,placeholder:s,error:c,onRegenerate:d})=>{const{t:m}=Ge(),g=w.useCallback(E=>{i(E.target.value)},[i]),f=w.useCallback(()=>{d()},[d]);return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:r,className:"block text-sm font-medium text-gray-900 dark:text-white",children:e}),l.jsxs("div",{className:"flex",children:[l.jsx("div",{className:"relative flex-grow",children:l.jsx("input",{type:"text",id:r,value:a,onChange:g,placeholder:s,className:"outline-0 text-sm 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"})}),l.jsx("div",{className:"flex",children:l.jsx("button",{type:"button",onClick:f,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:m("common.generate"),children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})})]}),c&&l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})]})},RL=({attachments:r,onAttachmentsChange:e,itemId:a})=>{const{t:i}=Ge(),[s,c]=w.useState(""),d=!aa.isPopup(),m=async E=>{const p=E.target.files;if(!(!p||p.length===0)){c(i("attachmentUploader.uploading"));try{const C=[...r];for(const I of Array.from(p)){const x=await I.arrayBuffer(),T=new Uint8Array(x),k={Id:crypto.randomUUID().toUpperCase(),Filename:I.name,Blob:T,ItemId:"",CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString(),IsDeleted:!1};C.push(k)}e(C),c(i("attachmentUploader.uploadSuccess")),setTimeout(()=>c(""),3e3)}catch(C){console.error("Error uploading files:",C),c(i("common.errors.unknownErrorTryAgain")),setTimeout(()=>c(""),3e3)}E.target.value=""}},g=E=>{try{const p=[...r],C=p.findIndex(I=>I.Id===E.Id);C!==-1&&p.splice(C,1),e(p),c(i("attachmentUploader.deleteSuccess")),setTimeout(()=>c(""),3e3)}catch(p){console.error("Error deleting attachment:",p),c(i("common.errors.unknownErrorTryAgain")),setTimeout(()=>c(""),3e3)}},f=r.filter(E=>!E.IsDeleted);return l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:i("common.attachments")}),l.jsxs("div",{className:"space-y-4",children:[d?l.jsx("div",{className:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center",children:l.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[l.jsx("p",{className:"mb-3",children:i("attachmentUploader.firefoxExpandRequired")}),l.jsx("button",{type:"button",onClick:()=>{const E=a?`/items/${a}`:"/items";aa.openInNewPopup(void 0,E)},className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-md transition-colors",children:i("attachmentUploader.openExpandedWindow")})]})}):l.jsx("div",{children:l.jsx("input",{type:"file",multiple:!0,onChange:m,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&&l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:s}),f.length>0&&l.jsx("div",{children:l.jsx("div",{className:"space-y-2",children:f.map(E=>l.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:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:E.Filename}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(E.CreatedAt).toLocaleDateString()})]}),l.jsx("button",{type:"button",onClick:()=>g(E),className:"text-red-500 hover:text-red-700 focus:outline-none","aria-label":`Delete ${E.Filename}`,children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]},E.Id))})})]})]})},Fg=({className:r="w-5 h-5"})=>l.jsx("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})}),DL=({itemId:r})=>{const{t:e}=Ge(),a=Ft(),[i,s]=w.useState([]),[c,d]=w.useState(!0);return w.useEffect(()=>{if(!(a!=null&&a.sqliteClient)||!r){d(!1);return}try{const m=a.sqliteClient.passkeys.getByItemId(r);s(m)}catch(m){console.error("Error loading passkeys:",m)}finally{d(!1)}},[a==null?void 0:a.sqliteClient,r]),c?l.jsx("div",{className:"flex justify-center p-2",children:l.jsx(Un,{})}):i.length===0?null:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:e("passkeys.passkey")}),i.map(m=>l.jsx("div",{className:"p-3 rounded bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Fg,{className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"mb-1",children:l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:m.DisplayName||e("passkeys.passkey")})}),l.jsx("div",{className:"space-y-1 mb-2",children:m.RpId&&l.jsxs("div",{children:[l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e("passkeys.site"),":"," "]}),l.jsx("span",{className:"text-sm text-gray-900 dark:text-white",children:m.RpId})]})}),l.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:e("passkeys.helpText")})]})]})},m.Id))]})},BL=({itemId:r,passkeyIdsMarkedForDeletion:e,onPasskeyMarkedForDeletion:a})=>{const{t:i}=Ge(),s=Ft(),[c,d]=w.useState([]),[m,g]=w.useState(!0);w.useEffect(()=>{if(!(s!=null&&s.sqliteClient)||!r){g(!1);return}try{const p=s.sqliteClient.passkeys.getByItemId(r);d(p)}catch(p){console.error("Error loading passkeys:",p)}finally{g(!1)}},[s==null?void 0:s.sqliteClient,r]);const f=p=>{e.includes(p)||a([...e,p])},E=p=>{a(e.filter(C=>C!==p))};return m?l.jsx("div",{className:"flex justify-center p-2",children:l.jsx(Un,{})}):c.length===0?null:l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsx("h2",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-white",children:i("passkeys.passkey")}),l.jsx("div",{className:"space-y-3",children:c.map(p=>e.includes(p.Id)?l.jsx("div",{className:"p-3 rounded bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Fg,{className:"w-5 h-5 text-red-600 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-red-900 dark:text-red-100",children:i("passkeys.passkeyMarkedForDeletion")}),l.jsx("button",{type:"button",onClick:()=>E(p.Id),className:"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",title:i("common.undo"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M3 7v6h6"}),l.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"})]})})]}),l.jsx("p",{className:"text-xs text-red-800 dark:text-red-200",children:i("passkeys.passkeyWillBeDeleted")})]})]})},p.Id):l.jsx("div",{className:"p-3 rounded bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Fg,{className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:p.DisplayName||i("passkeys.passkey")}),l.jsx("button",{type:"button",onClick:()=>f(p.Id),className:"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300",title:i("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),l.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),l.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})]}),l.jsx("div",{className:"space-y-1 mb-2",children:p.RpId&&l.jsxs("div",{children:[l.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[i("passkeys.site"),":"," "]}),l.jsx("span",{className:"text-sm text-gray-900 dark:text-white",children:p.RpId})]})}),l.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:i("passkeys.helpText")})]})]})},p.Id))})]})};//! 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 UL=r=>{const e=new ArrayBuffer(8),a=new Uint8Array(e);let i=r;for(let s=7;s>=0&&i!==0;s--)a[s]=i&255,i-=a[s],i/=256;return a};function Ou(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function _L(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function $u(r,...e){if(!_L(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function ML(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ou(r.outputLen),Ou(r.blockLen)}function co(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Zb(r,e){$u(r);const a=e.outputLen;if(r.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 FL(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function lg(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function rr(r,e){return r<<32-e|r>>>e}function cg(r,e){return r<<e|r>>>32-e>>>0}const iE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function OL(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}function sE(r){for(let e=0;e<r.length;e++)r[e]=OL(r[e])}function jL(r){if(typeof r!="string")throw new Error("utf8ToBytes expected string, got "+typeof r);return new Uint8Array(new TextEncoder().encode(r))}function Zu(r){return typeof r=="string"&&(r=jL(r)),$u(r),r}class mh{clone(){return this._cloneInto()}}function ho(r){const e=i=>r().update(Zu(i)).digest(),a=r();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>r(),e}class eI extends mh{update(e){return co(this),this.iHash.update(e),this}digestInto(e){co(this),$u(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:a,iHash:i,finished:s,destroyed:c,blockLen:d,outputLen:m}=this;return e=e,e.finished=s,e.destroyed=c,e.blockLen=d,e.outputLen=m,e.oHash=a._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(e,a){super(),this.finished=!1,this.destroyed=!1,ML(e);const i=Zu(a);if(this.iHash=e.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 s=this.blockLen,c=new Uint8Array(s);c.set(i.length>s?e.create().update(i).digest():i);for(let d=0;d<c.length;d++)c[d]^=54;this.iHash.update(c),this.oHash=e.create();for(let d=0;d<c.length;d++)c[d]^=106;this.oHash.update(c),c.fill(0)}}const Og=(r,e,a)=>new eI(r,e).update(a).digest();Og.create=(r,e)=>new eI(r,e);function PL(r,e,a,i){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,a,i);const s=BigInt(32),c=BigInt(4294967295),d=Number(a>>s&c),m=Number(a&c),g=i?4:0,f=i?0:4;r.setUint32(e+g,d,i),r.setUint32(e+f,m,i)}function tI(r,e,a){return r&e^~r&a}function aI(r,e,a){return r&e^r&a^e&a}class fh extends mh{update(e){co(this);const{view:a,buffer:i,blockLen:s}=this;e=Zu(e);const c=e.length;for(let d=0;d<c;){const m=Math.min(s-this.pos,c-d);if(m===s){const g=lg(e);for(;s<=c-d;d+=s)this.process(g,d);continue}i.set(e.subarray(d,d+m),this.pos),this.pos+=m,d+=m,this.pos===s&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){co(this),Zb(e,this),this.finished=!0;const{buffer:a,view:i,blockLen:s,isLE:c}=this;let{pos:d}=this;a[d++]=128,this.buffer.subarray(d).fill(0),this.padOffset>s-d&&(this.process(i,0),d=0);for(let p=d;p<s;p++)a[p]=0;PL(i,s-8,BigInt(this.length*8),c),this.process(i,0);const m=lg(e),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=g/4,E=this.get();if(f>E.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<f;p++)m.setUint32(4*p,E[p],c)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const i=e.slice(0,a);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:i,length:s,finished:c,destroyed:d,pos:m}=this;return e.length=s,e.pos=m,e.finished=c,e.destroyed=d,s%a&&e.buffer.set(i),e}constructor(e,a,i,s){super(),this.blockLen=e,this.outputLen=a,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=lg(this.buffer)}}const yl=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Ci=new Uint32Array(80);class HL extends fh{get(){const{A:e,B:a,C:i,D:s,E:c}=this;return[e,a,i,s,c]}set(e,a,i,s,c){this.A=e|0,this.B=a|0,this.C=i|0,this.D=s|0,this.E=c|0}process(e,a){for(let g=0;g<16;g++,a+=4)Ci[g]=e.getUint32(a,!1);for(let g=16;g<80;g++)Ci[g]=cg(Ci[g-3]^Ci[g-8]^Ci[g-14]^Ci[g-16],1);let{A:i,B:s,C:c,D:d,E:m}=this;for(let g=0;g<80;g++){let f,E;g<20?(f=tI(s,c,d),E=1518500249):g<40?(f=s^c^d,E=1859775393):g<60?(f=aI(s,c,d),E=2400959708):(f=s^c^d,E=3395469782);const p=cg(i,5)+f+m+E+Ci[g]|0;m=d,d=c,c=cg(s,30),s=i,i=p}i=i+this.A|0,s=s+this.B|0,c=c+this.C|0,d=d+this.D|0,m=m+this.E|0,this.set(i,s,c,d,m)}roundClean(){Ci.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}constructor(){super(64,20,8,!1),this.A=yl[0]|0,this.B=yl[1]|0,this.C=yl[2]|0,this.D=yl[3]|0,this.E=yl[4]|0}}const QL=ho(()=>new HL),zL=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]),Ni=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xi=new Uint32Array(64);class nI extends fh{get(){const{A:e,B:a,C:i,D:s,E:c,F:d,G:m,H:g}=this;return[e,a,i,s,c,d,m,g]}set(e,a,i,s,c,d,m,g){this.A=e|0,this.B=a|0,this.C=i|0,this.D=s|0,this.E=c|0,this.F=d|0,this.G=m|0,this.H=g|0}process(e,a){for(let p=0;p<16;p++,a+=4)xi[p]=e.getUint32(a,!1);for(let p=16;p<64;p++){const C=xi[p-15],I=xi[p-2],x=rr(C,7)^rr(C,18)^C>>>3,T=rr(I,17)^rr(I,19)^I>>>10;xi[p]=T+xi[p-7]+x+xi[p-16]|0}let{A:i,B:s,C:c,D:d,E:m,F:g,G:f,H:E}=this;for(let p=0;p<64;p++){const C=rr(m,6)^rr(m,11)^rr(m,25),I=E+C+tI(m,g,f)+zL[p]+xi[p]|0,T=(rr(i,2)^rr(i,13)^rr(i,22))+aI(i,s,c)|0;E=f,f=g,g=m,m=d+I|0,d=c,c=s,s=i,i=I+T|0}i=i+this.A|0,s=s+this.B|0,c=c+this.C|0,d=d+this.D|0,m=m+this.E|0,g=g+this.F|0,f=f+this.G|0,E=E+this.H|0,this.set(i,s,c,d,m,g,f,E)}roundClean(){xi.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=Ni[0]|0,this.B=Ni[1]|0,this.C=Ni[2]|0,this.D=Ni[3]|0,this.E=Ni[4]|0,this.F=Ni[5]|0,this.G=Ni[6]|0,this.H=Ni[7]|0}}class VL extends nI{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 KL=ho(()=>new nI),GL=ho(()=>new VL),du=BigInt(2**32-1),jg=BigInt(32);function rI(r,e=!1){return e?{h:Number(r&du),l:Number(r>>jg&du)}:{h:Number(r>>jg&du)|0,l:Number(r&du)|0}}function iI(r,e=!1){let a=new Uint32Array(r.length),i=new Uint32Array(r.length);for(let s=0;s<r.length;s++){const{h:c,l:d}=rI(r[s],e);[a[s],i[s]]=[c,d]}return[a,i]}const qL=(r,e)=>BigInt(r>>>0)<<jg|BigInt(e>>>0),WL=(r,e,a)=>r>>>a,YL=(r,e,a)=>r<<32-a|e>>>a,JL=(r,e,a)=>r>>>a|e<<32-a,XL=(r,e,a)=>r<<32-a|e>>>a,$L=(r,e,a)=>r<<64-a|e>>>a-32,ZL=(r,e,a)=>r>>>a-32|e<<64-a,eR=(r,e)=>e,tR=(r,e)=>r,sI=(r,e,a)=>r<<a|e>>>32-a,oI=(r,e,a)=>e<<a|r>>>32-a,lI=(r,e,a)=>e<<a-32|r>>>64-a,cI=(r,e,a)=>r<<a-32|e>>>64-a;function aR(r,e,a,i){const s=(e>>>0)+(i>>>0);return{h:r+a+(s/2**32|0)|0,l:s|0}}const nR=(r,e,a)=>(r>>>0)+(e>>>0)+(a>>>0),rR=(r,e,a,i)=>e+a+i+(r/2**32|0)|0,iR=(r,e,a,i)=>(r>>>0)+(e>>>0)+(a>>>0)+(i>>>0),sR=(r,e,a,i,s)=>e+a+i+s+(r/2**32|0)|0,oR=(r,e,a,i,s)=>(r>>>0)+(e>>>0)+(a>>>0)+(i>>>0)+(s>>>0),lR=(r,e,a,i,s,c)=>e+a+i+s+c+(r/2**32|0)|0,Et={fromBig:rI,split:iI,toBig:qL,shrSH:WL,shrSL:YL,rotrSH:JL,rotrSL:XL,rotrBH:$L,rotrBL:ZL,rotr32H:eR,rotr32L:tR,rotlSH:sI,rotlSL:oI,rotlBH:lI,rotlBL:cI,add:aR,add3L:nR,add3H:rR,add4L:iR,add4H:sR,add5H:lR,add5L:oR},[cR,uR]=Et.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(r=>BigInt(r))),Ti=new Uint32Array(80),Si=new Uint32Array(80);class uI extends fh{get(){const{Ah:e,Al:a,Bh:i,Bl:s,Ch:c,Cl:d,Dh:m,Dl:g,Eh:f,El:E,Fh:p,Fl:C,Gh:I,Gl:x,Hh:T,Hl:k}=this;return[e,a,i,s,c,d,m,g,f,E,p,C,I,x,T,k]}set(e,a,i,s,c,d,m,g,f,E,p,C,I,x,T,k){this.Ah=e|0,this.Al=a|0,this.Bh=i|0,this.Bl=s|0,this.Ch=c|0,this.Cl=d|0,this.Dh=m|0,this.Dl=g|0,this.Eh=f|0,this.El=E|0,this.Fh=p|0,this.Fl=C|0,this.Gh=I|0,this.Gl=x|0,this.Hh=T|0,this.Hl=k|0}process(e,a){for(let S=0;S<16;S++,a+=4)Ti[S]=e.getUint32(a),Si[S]=e.getUint32(a+=4);for(let S=16;S<80;S++){const j=Ti[S-15]|0,_=Si[S-15]|0,P=Et.rotrSH(j,_,1)^Et.rotrSH(j,_,8)^Et.shrSH(j,_,7),K=Et.rotrSL(j,_,1)^Et.rotrSL(j,_,8)^Et.shrSL(j,_,7),H=Ti[S-2]|0,Q=Si[S-2]|0,V=Et.rotrSH(H,Q,19)^Et.rotrBH(H,Q,61)^Et.shrSH(H,Q,6),G=Et.rotrSL(H,Q,19)^Et.rotrBL(H,Q,61)^Et.shrSL(H,Q,6),q=Et.add4L(K,G,Si[S-7],Si[S-16]),W=Et.add4H(q,P,V,Ti[S-7],Ti[S-16]);Ti[S]=W|0,Si[S]=q|0}let{Ah:i,Al:s,Bh:c,Bl:d,Ch:m,Cl:g,Dh:f,Dl:E,Eh:p,El:C,Fh:I,Fl:x,Gh:T,Gl:k,Hh:R,Hl:B}=this;for(let S=0;S<80;S++){const j=Et.rotrSH(p,C,14)^Et.rotrSH(p,C,18)^Et.rotrBH(p,C,41),_=Et.rotrSL(p,C,14)^Et.rotrSL(p,C,18)^Et.rotrBL(p,C,41),P=p&I^~p&T,K=C&x^~C&k,H=Et.add5L(B,_,K,uR[S],Si[S]),Q=Et.add5H(H,R,j,P,cR[S],Ti[S]),V=H|0,G=Et.rotrSH(i,s,28)^Et.rotrBH(i,s,34)^Et.rotrBH(i,s,39),q=Et.rotrSL(i,s,28)^Et.rotrBL(i,s,34)^Et.rotrBL(i,s,39),W=i&c^i&m^c&m,ne=s&d^s&g^d&g;R=T|0,B=k|0,T=I|0,k=x|0,I=p|0,x=C|0,{h:p,l:C}=Et.add(f|0,E|0,Q|0,V|0),f=m|0,E=g|0,m=c|0,g=d|0,c=i|0,d=s|0;const de=Et.add3L(V,q,ne);i=Et.add3H(de,Q,G,W),s=de|0}({h:i,l:s}=Et.add(this.Ah|0,this.Al|0,i|0,s|0)),{h:c,l:d}=Et.add(this.Bh|0,this.Bl|0,c|0,d|0),{h:m,l:g}=Et.add(this.Ch|0,this.Cl|0,m|0,g|0),{h:f,l:E}=Et.add(this.Dh|0,this.Dl|0,f|0,E|0),{h:p,l:C}=Et.add(this.Eh|0,this.El|0,p|0,C|0),{h:I,l:x}=Et.add(this.Fh|0,this.Fl|0,I|0,x|0),{h:T,l:k}=Et.add(this.Gh|0,this.Gl|0,T|0,k|0),{h:R,l:B}=Et.add(this.Hh|0,this.Hl|0,R|0,B|0),this.set(i,s,c,d,m,g,f,E,p,C,I,x,T,k,R,B)}roundClean(){Ti.fill(0),Si.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 dR extends uI{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 mR=ho(()=>new uI),fR=ho(()=>new dR),dI=[],mI=[],fI=[],gR=BigInt(0),El=BigInt(1),hR=BigInt(2),AR=BigInt(7),pR=BigInt(256),yR=BigInt(113);for(let r=0,e=El,a=1,i=0;r<24;r++){[a,i]=[i,(2*a+3*i)%5],dI.push(2*(5*i+a)),mI.push((r+1)*(r+2)/2%64);let s=gR;for(let c=0;c<7;c++)e=(e<<El^(e>>AR)*yR)%pR,e&hR&&(s^=El<<(El<<BigInt(c))-El);fI.push(s)}const[ER,bR]=iI(fI,!0),oE=(r,e,a)=>a>32?lI(r,e,a):sI(r,e,a),lE=(r,e,a)=>a>32?cI(r,e,a):oI(r,e,a);function IR(r,e=24){const a=new Uint32Array(10);for(let i=24-e;i<24;i++){for(let d=0;d<10;d++)a[d]=r[d]^r[d+10]^r[d+20]^r[d+30]^r[d+40];for(let d=0;d<10;d+=2){const m=(d+8)%10,g=(d+2)%10,f=a[g],E=a[g+1],p=oE(f,E,1)^a[m],C=lE(f,E,1)^a[m+1];for(let I=0;I<50;I+=10)r[d+I]^=p,r[d+I+1]^=C}let s=r[2],c=r[3];for(let d=0;d<24;d++){const m=mI[d],g=oE(s,c,m),f=lE(s,c,m),E=dI[d];s=r[E],c=r[E+1],r[E]=g,r[E+1]=f}for(let d=0;d<50;d+=10){for(let m=0;m<10;m++)a[m]=r[d+m];for(let m=0;m<10;m++)r[d+m]^=~a[(m+2)%10]&a[(m+4)%10]}r[0]^=ER[i],r[1]^=bR[i]}a.fill(0)}class gh extends mh{keccak(){iE||sE(this.state32),IR(this.state32,this.rounds),iE||sE(this.state32),this.posOut=0,this.pos=0}update(e){co(this);const{blockLen:a,state:i}=this;e=Zu(e);const s=e.length;for(let c=0;c<s;){const d=Math.min(a-this.pos,s-c);for(let m=0;m<d;m++)i[this.pos++]^=e[c++];this.pos===a&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:a,pos:i,blockLen:s}=this;e[i]^=a,(a&128)!==0&&i===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){co(this,!1),$u(e),this.finish();const a=this.state,{blockLen:i}=this;for(let s=0,c=e.length;s<c;){this.posOut>=i&&this.keccak();const d=Math.min(i-this.posOut,c-s);e.set(a.subarray(this.posOut,this.posOut+d),s),this.posOut+=d,s+=d}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ou(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Zb(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:i,outputLen:s,rounds:c,enableXOF:d}=this;return e||(e=new gh(a,i,s,d,c)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=c,e.suffix=i,e.outputLen=s,e.enableXOF=d,e.destroyed=this.destroyed,e}constructor(e,a,i,s=!1,c=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=i,this.enableXOF=s,this.rounds=c,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ou(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=FL(this.state)}}const ed=(r,e,a)=>ho(()=>new gh(e,r,a)),vR=ed(6,144,224/8),wR=ed(6,136,256/8),CR=ed(6,104,384/8),NR=ed(6,72,512/8),uo=(()=>{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})(),cE={SHA1:QL,SHA224:GL,SHA256:KL,SHA384:fR,SHA512:mR,"SHA3-224":vR,"SHA3-256":wR,"SHA3-384":CR,"SHA3-512":NR},hh=r=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(r):return"SHA1";case/^SHA(?:2?-)?224$/i.test(r):return"SHA224";case/^SHA(?:2?-)?256$/i.test(r):return"SHA256";case/^SHA(?:2?-)?384$/i.test(r):return"SHA384";case/^SHA(?:2?-)?512$/i.test(r):return"SHA512";case/^SHA3-224$/i.test(r):return"SHA3-224";case/^SHA3-256$/i.test(r):return"SHA3-256";case/^SHA3-384$/i.test(r):return"SHA3-384";case/^SHA3-512$/i.test(r):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${r}`)}},xR=(r,e,a)=>{if(Og){const i=cE[r]??cE[hh(r)];return Og(i,e,a)}else throw new Error("Missing HMAC function")},Pg="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",TR=r=>{r=r.replace(/ /g,"");let e=r.length;for(;r[e-1]==="=";)--e;r=(e<r.length?r.substring(0,e):r).toUpperCase();const a=new ArrayBuffer(r.length*5/8|0),i=new Uint8Array(a);let s=0,c=0,d=0;for(let m=0;m<r.length;m++){const g=Pg.indexOf(r[m]);if(g===-1)throw new TypeError(`Invalid character found: ${r[m]}`);c=c<<5|g,s+=5,s>=8&&(s-=8,i[d++]=c>>>s)}return i},SR=r=>{let e=0,a=0,i="";for(let s=0;s<r.length;s++)for(a=a<<8|r[s],e+=8;e>=5;)i+=Pg[a>>>e-5&31],e-=5;return e>0&&(i+=Pg[a<<5-e&31]),i},kR=r=>{r=r.replace(/ /g,"");const e=new ArrayBuffer(r.length/2),a=new Uint8Array(e);for(let i=0;i<r.length;i+=2)a[i/2]=parseInt(r.substring(i,i+2),16);return a},LR=r=>{let e="";for(let a=0;a<r.length;a++){const i=r[a].toString(16);i.length===1&&(e+="0"),e+=i}return e.toUpperCase()},RR=r=>{const e=new ArrayBuffer(r.length),a=new Uint8Array(e);for(let i=0;i<r.length;i++)a[i]=r.charCodeAt(i)&255;return a},DR=r=>{let e="";for(let a=0;a<r.length;a++)e+=String.fromCharCode(r[a]);return e},uE=uo.TextEncoder?new uo.TextEncoder:null,dE=uo.TextDecoder?new uo.TextDecoder:null,BR=r=>{if(!uE)throw new Error("Encoding API not available");return uE.encode(r)},UR=r=>{if(!dE)throw new Error("Encoding API not available");return dE.decode(r)},_R=r=>{var e;if((e=uo.crypto)!=null&&e.getRandomValues)return uo.crypto.getRandomValues(new Uint8Array(r));throw new Error("Cryptography API not available")};class jr{static fromLatin1(e){return new jr({buffer:RR(e).buffer})}static fromUTF8(e){return new jr({buffer:BR(e).buffer})}static fromBase32(e){return new jr({buffer:TR(e).buffer})}static fromHex(e){return new jr({buffer:kR(e).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:DR(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:UR(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:SR(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:LR(this.bytes)}),this.hex}constructor({buffer:e,size:a=20}={}){this.bytes=typeof e>"u"?_R(a):new Uint8Array(e),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}const MR=(r,e)=>{{if(r.length!==e.length)throw new TypeError("Input strings must have the same length");let a=-1,i=0;for(;++a<r.length;)i|=r.charCodeAt(a)^e.charCodeAt(a);return i===0}};class Aa{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:e,algorithm:a=Aa.defaults.algorithm,digits:i=Aa.defaults.digits,counter:s=Aa.defaults.counter}){const c=xR(a,e.bytes,UL(s)),d=c[c.byteLength-1]&15;return(((c[d]&127)<<24|(c[d+1]&255)<<16|(c[d+2]&255)<<8|c[d+3]&255)%10**i).toString().padStart(i,"0")}generate({counter:e=this.counter++}={}){return Aa.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:e})}static validate({token:e,secret:a,algorithm:i,digits:s=Aa.defaults.digits,counter:c=Aa.defaults.counter,window:d=Aa.defaults.window}){if(e.length!==s)return null;let m=null;const g=f=>{const E=Aa.generate({secret:a,algorithm:i,digits:s,counter:f});MR(e,E)&&(m=f-c)};g(c);for(let f=1;f<=d&&m===null&&(g(c-f),!(m!==null||(g(c+f),m!==null)));++f);return m}validate({token:e,counter:a=this.counter,window:i}){return Aa.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:a,window:i})}toString(){const e=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}constructor({issuer:e=Aa.defaults.issuer,label:a=Aa.defaults.label,issuerInLabel:i=Aa.defaults.issuerInLabel,secret:s=new jr,algorithm:c=Aa.defaults.algorithm,digits:d=Aa.defaults.digits,counter:m=Aa.defaults.counter}={}){this.issuer=e,this.label=a,this.issuerInLabel=i,this.secret=typeof s=="string"?jr.fromBase32(s):s,this.algorithm=hh(c),this.digits=d,this.counter=m}}class oa{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:e=oa.defaults.period,timestamp:a=Date.now()}={}){return Math.floor(a/1e3/e)}counter({timestamp:e=Date.now()}={}){return oa.counter({period:this.period,timestamp:e})}static remaining({period:e=oa.defaults.period,timestamp:a=Date.now()}={}){return e*1e3-a%(e*1e3)}remaining({timestamp:e=Date.now()}={}){return oa.remaining({period:this.period,timestamp:e})}static generate({secret:e,algorithm:a,digits:i,period:s=oa.defaults.period,timestamp:c=Date.now()}){return Aa.generate({secret:e,algorithm:a,digits:i,counter:oa.counter({period:s,timestamp:c})})}generate({timestamp:e=Date.now()}={}){return oa.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e})}static validate({token:e,secret:a,algorithm:i,digits:s,period:c=oa.defaults.period,timestamp:d=Date.now(),window:m}){return Aa.validate({token:e,secret:a,algorithm:i,digits:s,counter:oa.counter({period:c,timestamp:d}),window:m})}validate({token:e,timestamp:a,window:i}){return oa.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:a,window:i})}toString(){const e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}constructor({issuer:e=oa.defaults.issuer,label:a=oa.defaults.label,issuerInLabel:i=oa.defaults.issuerInLabel,secret:s=new jr,algorithm:c=oa.defaults.algorithm,digits:d=oa.defaults.digits,period:m=oa.defaults.period}={}){this.issuer=e,this.label=a,this.issuerInLabel=i,this.secret=typeof s=="string"?jr.fromBase32(s):s,this.algorithm=hh(c),this.digits=d,this.period=m}}const FR=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,OR=/^[2-7A-Z]+=*$/i,jR=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,PR=/^[+-]?\d+$/,mE=/^\+?[1-9]\d*$/;class HR{static parse(e){let a;try{a=e.match(FR)}catch{}if(!Array.isArray(a))throw new URIError("Invalid URI format");const i=a[1].toLowerCase(),s=a[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),c=a[3].split("&").reduce((g,f)=>{const E=f.split(/=(.*)/,2).map(decodeURIComponent),p=E[0].toLowerCase(),C=E[1],I=g;return I[p]=C,I},{});let d;const m={};if(i==="hotp")if(d=Aa,typeof c.counter<"u"&&PR.test(c.counter))m.counter=parseInt(c.counter,10);else throw new TypeError("Missing or invalid 'counter' parameter");else if(i==="totp"){if(d=oa,typeof c.period<"u")if(mE.test(c.period))m.period=parseInt(c.period,10);else throw new TypeError("Invalid 'period' parameter")}else throw new TypeError("Unknown OTP type");if(typeof c.issuer<"u"&&(m.issuer=c.issuer),s.length===2?(m.label=s[1],typeof m.issuer>"u"||m.issuer===""?m.issuer=s[0]:s[0]===""&&(m.issuerInLabel=!1)):(m.label=s[0],typeof m.issuer<"u"&&m.issuer!==""&&(m.issuerInLabel=!1)),typeof c.secret<"u"&&OR.test(c.secret))m.secret=c.secret;else throw new TypeError("Missing or invalid 'secret' parameter");if(typeof c.algorithm<"u")if(jR.test(c.algorithm))m.algorithm=c.algorithm;else throw new TypeError("Invalid 'algorithm' parameter");if(typeof c.digits<"u")if(mE.test(c.digits))m.digits=parseInt(c.digits,10);else throw new TypeError("Invalid 'digits' parameter");return new d(m)}static stringify(e){if(e instanceof Aa||e instanceof oa)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const QR=({totpCodes:r,onTotpCodesChange:e,originalTotpCodeIds:a,isAddFormVisible:i,formData:s,onStateChange:c})=>{const{t:d}=Ge(),[m,g]=w.useState(null),f=(R,B)=>{let S=R.trim(),j=B.trim();if(S.toLowerCase().startsWith("otpauth://totp/"))try{const _=HR.parse(S);_ instanceof oa&&(S=_.secret.base32,!j&&_.label&&(j=_.label))}catch{throw new Error(d("totp.errors.invalidSecretKey"))}if(S=S.replace(/\s/g,""),!/^[A-Z2-7]+=*$/i.test(S))throw new Error(d("totp.errors.invalidSecretKey"));return{secretKey:S,name:j||d("totp.defaultName")}},E=()=>{c({isAddFormVisible:!0,formData:{name:"",secretKey:""}}),g(null)},p=()=>{c({isAddFormVisible:!1,formData:{name:"",secretKey:""}}),g(null)},C=R=>{c({isAddFormVisible:i,formData:{...s,...R}})},I=R=>{if(R==null||R.preventDefault(),g(null),!s.secretKey){g(d("items.validation.required"));return}try{const{secretKey:B,name:S}=f(s.secretKey,s.name),j={Id:crypto.randomUUID().toUpperCase(),Name:S,SecretKey:B,ItemId:""},_=[...r,j];e(_),p()}catch(B){B instanceof Error?g(B.message):g(d("common.errors.unknownErrorTryAgain"))}},x=R=>{const B=a.includes(R.Id);let S;B?S=r.map(j=>j.Id===R.Id?{...j,IsDeleted:!0}:j):S=r.filter(j=>j.Id!==R.Id),e(S)},T=r.filter(R=>!R.IsDeleted),k=T.length>0;return l.jsxs("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:d("common.twoFactorAuthentication")}),k&&!i&&l.jsx("button",{type:"button",onClick:E,className:"w-8 h-8 flex items-center justify-center text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800",title:d("totp.addCode"),children:l.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),!k&&!i&&l.jsxs("button",{type:"button",onClick:E,className:"w-full py-1.5 px-4 flex items-center justify-center gap-2 text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600 dark:focus:ring-primary-800",children:[l.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),l.jsx("span",{children:d("totp.addCode")})]}),i&&l.jsxs("div",{className:"p-4 mb-4 bg-gray-50 border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h4",{className:"text-lg font-medium text-gray-900 dark:text-white",children:d("totp.addCode")}),k&&l.jsx("button",{type:"button",onClick:p,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white",children:l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 14 14",children:l.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})})})]}),l.jsx("p",{className:"mb-4 text-sm text-gray-500 dark:text-gray-400",children:d("totp.instructions")}),m&&l.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg dark:bg-red-900/20 dark:border-red-800",children:l.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:m})}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"totp-name",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:d("totp.nameOptional")}),l.jsx("input",{id:"totp-name",type:"text",value:s.name,onChange:R=>C({name:R.target.value}),className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"totp-secret",className:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:d("totp.secretKey")}),l.jsx("input",{id:"totp-secret",type:"text",value:s.secretKey,onChange:R=>C({secretKey:R.target.value}),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),I(R))},className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:R=>I(R),className:"text-white bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",children:d("common.save")})})]}),k&&l.jsx("div",{className:"grid grid-cols-1 gap-4 mt-4",children:T.map(R=>l.jsx("div",{className:"p-2 ps-3 pe-3 bg-gray-50 border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600",children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:R.Name})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex flex-col items-end",children:l.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:d("totp.saveToViewCode")})}),l.jsx("button",{type:"button",onClick:()=>x(R),className:"text-red-600 hover:text-red-800 dark:text-red-500 dark:hover:text-red-400",children:l.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})]})]})},R.Id))})]})},zR=({inputRef:r,value:e,onChange:a,folders:i,selectedFolderId:s,onFolderChange:c})=>{const{t:d}=Ge(),[m,g]=w.useState(!1),f=i.find(x=>x.Id===s),E=w.useCallback(x=>{c(x),g(!1)},[c]),p=w.useCallback(x=>{a(x.target.value)},[a]),C=w.useCallback(()=>{g(!0)},[]),I=w.useCallback(()=>{g(!1)},[]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("label",{htmlFor:"itemName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[d("items.itemName")," ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{ref:r,id:"itemName",type:"text",value:e,onChange:p,className:`w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white ${s?"pr-28":"pr-10"}`,required:!0}),l.jsxs("button",{type:"button",onClick:C,className:`absolute right-1 z-10 flex items-center gap-1 px-2 py-1 rounded transition-colors text-xs ${s?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400 hover:bg-primary-200 dark:hover:bg-primary-900/50":"text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600"}`,title:(f==null?void 0:f.Name)||"-",children:[l.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),s&&l.jsx("span",{className:"max-w-16 truncate",children:f==null?void 0:f.Name})]})]})]}),m&&l.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 transition-opacity",onClick:I}),l.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:l.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-sm",children:[l.jsxs("button",{type:"button",className:"absolute right-4 top-4 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:I,children:[l.jsx("span",{className:"sr-only",children:d("common.close")}),l.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]}),l.jsx("div",{className:"mb-4",children:l.jsx("h3",{className:"text-lg font-semibold leading-6 text-gray-900 dark:text-white",children:d("items.folder")})}),l.jsxs("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:[l.jsxs("button",{type:"button",onClick:()=>E(null),className:`w-full px-3 py-2 text-left rounded-md flex items-center gap-3 transition-colors ${s?"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700":"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300"}`,children:[l.jsx("svg",{className:`w-5 h-5 ${s?"text-gray-400":"text-primary-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})}),l.jsx("span",{className:"font-medium",children:"—"}),!s&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})})]}),i.map(x=>l.jsxs("button",{type:"button",onClick:()=>E(x.Id),className:`w-full px-3 py-2 text-left rounded-md flex items-center gap-3 transition-colors ${s===x.Id?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}`,children:[l.jsx("svg",{className:`w-5 h-5 ${s===x.Id?"text-primary-500":"text-gray-400"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsx("span",{className:"font-medium",children:x.Name}),s===x.Id&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})})]},x.Id))]})]})})]})]})},ju=[{type:Xt.Login,titleKey:"itemTypes.login.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})},{type:Xt.Alias,titleKey:"itemTypes.alias.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})},{type:Xt.CreditCard,titleKey:"itemTypes.creditCard.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})},{type:Xt.Note,titleKey:"itemTypes.note.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}],VR=({selectedType:r,isEditMode:e,showDropdown:a,onDropdownToggle:i,onTypeChange:s,onRegenerateAlias:c})=>{const{t:d}=Ge(),m=ju.find(g=>g.type===r);return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"w-full px-4 py-2 bg-primary-50 dark:bg-primary-900/20 border border-primary-200 dark:border-primary-800 rounded-lg flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:()=>i(!a),className:"flex-1 flex items-center justify-between hover:opacity-80 transition-opacity",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-primary-600 dark:text-primary-400",children:m==null?void 0:m.iconSvg}),l.jsxs("span",{className:"text-primary-700 dark:text-primary-300 font-medium text-sm",children:[d(e?"itemTypes.editing":"itemTypes.creating")," ",m?d(m.titleKey):""]})]}),l.jsx("svg",{className:`w-4 h-4 text-primary-500 transition-transform ${a?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r===Xt.Alias&&!e&&c&&l.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),c()},className:"flex-shrink-0 p-1.5 text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 hover:bg-primary-100 dark:hover:bg-primary-900/40 rounded transition-colors",title:d("itemTypes.regenerateAlias"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),l.jsx("div",{className:"absolute z-20 mt-1 w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg",children:ju.map(g=>l.jsxs("button",{type:"button",onClick:()=>s(g.type),className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 ${r===g.type?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-900 dark:text-white"}`,children:[l.jsx("span",{className:r===g.type?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400",children:g.iconSvg}),l.jsx("span",{className:"font-medium",children:d(g.titleKey)}),r===g.type&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})})]},g.type))})]})]})};var gI=(r=>(r.Male="Male",r.Female="Female",r.Other="Other",r))(gI||{}),Ah=class _r{constructor(){this.symbols=[".","-"]}generateUsername(e){let a=this.generateEmailPrefix(e);return a=a.replace(/[^a-zA-Z0-9]/g,""),a.length<_r.MIN_LENGTH?a+=this.generateRandomString(_r.MIN_LENGTH-a.length):a.length>_r.MAX_LENGTH&&(a=a.substring(0,_r.MAX_LENGTH)),a}generateEmailPrefix(e){const a=[];switch(typeof e.birthDate=="string"&&(e.birthDate=new Date(e.birthDate)),this.getSecureRandom(4)){case 0:a.push(e.firstName.substring(0,1).toLowerCase()+e.lastName.toLowerCase());break;case 1:a.push((e.firstName+e.lastName).toLowerCase());break;case 2:a.push(e.firstName.toLowerCase()+e.lastName.substring(0,1).toLowerCase());break;case 3:a.push(e.firstName.substring(0,Math.min(3,e.firstName.length)).toLowerCase()+e.lastName.toLowerCase());break}switch(this.getSecureRandom(2)){case 0:a.push(e.birthDate.getFullYear().toString());break;case 1:a.push(e.birthDate.getFullYear().toString().substring(2));break}let i=a.join(this.getRandomSymbol());if(this.getSecureRandom(2)===0){const s=this.getSecureRandom(i.length);i=i.slice(0,s)+this.getRandomSymbol()+i.slice(s)}return i=this.sanitizeEmailPrefix(i),i.length<_r.MIN_LENGTH?i+=this.generateRandomString(_r.MIN_LENGTH-i.length):i.length>_r.MAX_LENGTH&&(i=i.substring(0,_r.MAX_LENGTH)),i}generateRandomEmailPrefix(e=14){return this.generateRandomString(e)}sanitizeEmailPrefix(e){let a=e.replace(/[^a-zA-Z0-9._-]/g,"");return a=a.replace(/[-_.]{2,}/g,i=>i[0]),a=a.replace(/^[-._]+/,""),a=a.replace(/[-._]*$/,""),a}getRandomSymbol(){return this.getSecureRandom(3)===0?this.symbols[this.getSecureRandom(this.symbols.length)]:""}generateRandomString(e){const a="abcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:e},()=>a.charAt(this.getSecureRandom(a.length))).join("")}getSecureRandom(e){const a=new Uint32Array(1);return crypto.getRandomValues(a),a[0]%e}};Ah.MIN_LENGTH=6;Ah.MAX_LENGTH=20;var ph=Ah,td=class{constructor(){this.firstNamesMale=[],this.firstNamesFemale=[],this.lastNames=[],this.random=Math.random,this.firstNamesMale=this.getFirstNamesMaleJson(),this.firstNamesFemale=this.getFirstNamesFemaleJson(),this.lastNames=this.getLastNamesJson()}getFirstNamesMaleByDecade(){return[]}getFirstNamesFemaleByDecade(){return[]}generateRandomDateOfBirth(r){if(r){const{targetYear:m,yearDeviation:g}=r;if(g===0){const f=new Date(m,0,1),E=new Date(m,11,31),p=f.getTime()+this.random()*(E.getTime()-f.getTime());return new Date(p)}else{const f=m-g,E=m+g,p=new Date(f,0,1),C=new Date(E,11,31),I=p.getTime()+this.random()*(C.getTime()-p.getTime());return new Date(I)}}const e=new Date,a=21,i=65,s=new Date(e.getFullYear()-i,e.getMonth(),e.getDate()),c=new Date(e.getFullYear()-a,e.getMonth(),e.getDate()),d=s.getTime()+this.random()*(c.getTime()-s.getTime());return new Date(d)}selectFirstnamesForBirthdate(r,e){const a=r.getFullYear(),i=e?this.getFirstNamesMaleByDecade():this.getFirstNamesFemaleByDecade();if(i.length===0)return e?this.firstNamesMale:this.firstNamesFemale;const s=i.filter(d=>a>=d.startYear&&a<=d.endYear);if(s.length>0){const d=[];return s.forEach(m=>d.push(...m.names)),d}const c=[];return i.forEach(d=>c.push(...d.names)),c.length>0?c:e?this.firstNamesMale:this.firstNamesFemale}generateRandomIdentity(r,e){const a={firstName:"",lastName:"",gender:"Male",birthDate:new Date,emailPrefix:"",nickName:""};let i;r==="random"||r===void 0?i=this.random()<.5?"Male":"Female":r==="male"?i="Male":r==="female"?i="Female":i="Male",a.gender=i,a.birthDate=this.generateRandomDateOfBirth(e);let s;if(i==="Male")s=this.selectFirstnamesForBirthdate(a.birthDate,!0);else if(i==="Female")s=this.selectFirstnamesForBirthdate(a.birthDate,!1);else{const d=this.random()<.5;s=this.selectFirstnamesForBirthdate(a.birthDate,d)}a.firstName=s[Math.floor(this.random()*s.length)],a.lastName=this.lastNames[Math.floor(this.random()*this.lastNames.length)];const c=new ph;return a.emailPrefix=c.generateEmailPrefix(a),a.nickName=c.generateUsername(a),a}},KR=["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"],GR=["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"],qR=["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"],fE=class extends td{getFirstNamesMaleJson(){return KR}getFirstNamesFemaleJson(){return GR}getLastNamesJson(){return qR}},WR=["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"],YR=["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"],JR=["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"],XR=class extends td{getFirstNamesMaleJson(){return WR}getFirstNamesFemaleJson(){return YR}getLastNamesJson(){return JR}},$R=["Müller","Schmidt","Schneider","Fischer","Weber","Meyer","Wagner","Schulz","Becker","Hoffmann","Schäfer","Koch","Richter","Bauer","Klein","Wolf","Schröder","Neumann","Schwarz","Zimmermann","Braun","Hofmann","Krüger","Hartmann","Lange","Schmitt","Werner","Schmitz","Krause","Meier","Lehmann","Schmid","Schulze","Maier","Köhler","Herrmann","Walter","König","Mayer","Huber","Kaiser","Fuchs","Peters","Lang","Scholz","Möller","Weiß","Jung","Hahn","Schubert","Vogel","Friedrich","Günther","Keller","Winkler","Frank","Berger","Roth","Beck","Lorenz","Baumann","Franke","Albrecht","Schuster","Simon","Ludwig","Böhm","Winter","Kraus","Martin","Schumacher","Krämer","Vogt","Otto","Jäger","Stein","Groß","Sommer","Seidel","Heinrich","Haas","Brandt","Schreiber","Graf","Dietrich","Schulte","Kühn","Ziegler","Kuhn","Pohl","Engel","Horn","Bergmann","Voigt","Busch","Thomas","Sauer","Arnold","Pfeiffer","Wolff","Beyer","Seifert","Ernst","Lindner","Hübner","Kramer","Jansen","Franz","Peter","Hansen","Wenzel","Götz","Paul","Riedel","Barth","Kern","Hermann","Nagel","Wilhelm","Ott","Bock","Langer","Grimm","Ritter","Haase","Lenz","Förster","Mohr","Kruse","Schumann","Jahn","Thiel","Kaufmann","Zimmer","Hoppe","Petersen","Fiedler","Berg","Arndt","Marx","Lutz","Fritz","Kraft","Michel","Walther","Böttcher","Schütz","Eckert","Sander","Thiele","Reuter","Reinhardt","Schindler","Ebert","Kunz","Schilling","Schramm","Voß","Nowak","Hein","Hesse","Frey","Rudolph","Fröhlich","Beckmann","Kunze","Herzog","Bayer","Behrens","Stephan","Büttner","Gruber","Adam","Gärtner","Witt","Maurer","Bender","Bachmann","Schultz","Seitz","Geiger","Stahl","Steiner","Scherer","Kirchner","Dietz","Ullrich","Kurz","Breuer","Gerlach","Ulrich","Brinkmann","Fink","Heinz","Löffler","Reichert","Naumann","Böhme","Schröter","Blum","Göbel","Moser","Schlüter","Brunner","Körner","Schenk","Wirth","Wegner","Brand","Wendt","Stark","Schwab","Krebs","Heller","Wolter","Reimann","Rieger","Unger","Binder","Bruns","Döring","Menzel","Buchholz","Ackermann","Rose","Meißner","Janssen","Bartsch","May","Hirsch","Jakob","Schiller","Kopp","John","Hinz","Bach","Pfeifer","Bischoff","Engelhardt","Wilke","Sturm","Hildebrandt","Siebert","Urban","Link","Rohde","Kohl","Linke","Wittmann","Fricke","Köster","Gebhardt","Weiss","Vetter","Freitag","Nickel","Hennig","Rau","Münch","Witte","Noack","Renner","Westphal","Reich","Will","Baier","Kolb","Brückner","Marquardt","Kiefer","Keil","Henning","Heinze","Funk","Lemke","Ahrens","Esser","Pieper","Baum","Conrad","Schlegel","Fuhrmann","Decker","Jacob","Held","Röder","Berndt","Hanke","Kirsch","Neubauer","Hammer","Stoll","Erdmann","Mann","Philipp","Schön","Wiese","Kremer","Bartels","Klose","Mertens","Schreiner","Dittrich","Krieger","Kröger","Krug","Harms","Henke","Großmann","Martens","Heß","Schrader","Strauß","Adler","Herbst","Kühne","Heine","Konrad","Kluge","Henkel","Wiedemann","Albert","Popp","Wimmer","Karl","Wahl","Stadler","Hamann","Kuhlmann","Steffen","Lindemann","Fritsch","Bernhardt","Burkhardt","Preuß","Metzger","Bader","Nolte","Hauser","Blank","Beier","Klaus","Probst","Hess","Zander","Miller","Niemann","Funke","Haupt","Burger","Bode","Holz","Jost","Rauch","Rothe","Herold","Jordan","Anders","Fleischer","Wiegand","Hartung","Janßen","Lohmann","Krauß","Vollmer","Baur","Heinemann","Wild","Brenner","Reichel","Wetzel","Christ","Rausch","Hummel","Reiter","Mayr","Knoll","Kroll","Wegener","Beer","Schade","Neubert","Merz","Schüler","Strobel","Diehl","Behrendt","Glaser","Feldmann","Hagen","Jacobs","Rupp","Geißler","Straub","Hohmann","Römer","Stock","Haag","Meister","Freund","Dörr","Kessler","Betz","Seiler","Altmann","Weise","Metz","Eder","Busse","Mai","Wunderlich","Schütte","Hentschel","Voss","Weis","Heck","Born","Falk","Raab","Lauer","Völker","Bittner","Merkel","Sonntag","Moritz","Ehlers","Bertram","Hartwig","Rapp","Gerber","Zeller","Scharf","Pietsch","Kellner","Bär","Eichhorn","Giese","Wulf","Block","Opitz","Gottschalk","Jürgens","Greiner","Wieland","Benz","Keßler","Steffens","Heil","Seeger","Stumpf","Gross","Bühler","Eberhardt","Hiller","Buck","Weigel","Schweizer","Albers","Heuer","Pape","Hempel","Schott","Schütze","Scheffler","Engelmann","Wiesner","Runge","Geyer","Neuhaus","Forster","Oswald","Radtke","Heim","Geisler","Appel","Weidner","Seidl","Moll","Dorn","Klemm","Barthel","Gabriel","Springer","Timm","Engels","Kretschmer","Reimer","Steinbach","Hensel","Wichmann","Eichler","Hecht","Winkelmann","Heise","Noll","Fleischmann","Neugebauer","Hinrichs","Schaller","Lechner","Brandl","Mack","Gebauer","Siegel","Zahn","Singer","Michels","Schuler","Scholl","Uhlig","Brüggemann","Specht","Bürger","Eggert","Baumgartner","Weller","Schnell","Börner","Brauer","Kohler","Pfaff","Auer","Drescher","Otte","Frenzel","Petzold","Rother","Hagemann","Sattler","Wirtz","Ruf","Schirmer","Sauter","Schürmann","Junker","Walz","Dreyer","Sievers","Haller","Prinz","Stolz","Hausmann","Dick","Lux","Schnabel","Elsner","Kühl","Gerhardt","Klotz","Rabe","Schick","Faber","Riedl","Kranz","Fries","Reichelt","Rösch","Langner","Maaß","Wittig","Geier","Finke","Kasper","Maas","Bremer","Rath","Knapp","Dittmann","Kahl","Volk","Faust","Harder","Biermann","Pütz","Kempf","Mielke","Michaelis","Yilmaz","Abel","Thieme","Schütt","Hauck","Cordes","Eberle","Schaefer","Wehner","Haug","Fritzsche","Kilian","Eggers","Große","Matthes","Reinhold","Paulus","Dürr","Bohn","Thoma","Schober","Koller","Korn","Höhne","Hering","Gerdes","Ullmann","Jensen","Endres","Bernhard","Leonhardt","Eckhardt","Schaaf","Höfer","Junge","Rademacher","Pilz","Hellwig","Knorr","Helbig","Melzer","Lippert","Evers","Bahr","Klinger","Heitmann","Ehrhardt","Heinrichs","Horstmann","Behr","Stöhr","Drews","Rudolf","Sieber","Theis","Groth","Hecker","Weiler","Kemper","Rost","Lück","Claus","Hildebrand","Steinmetz","Götze","Trautmann","Blume","Kurth","Augustin","Nitsche","Janke","Jahnke","Klug","Damm","Heimann","Strauch","Schlosser","Uhl","Böhmer","Ries","Hellmann","Höhn","Hertel","Dreher","Borchert","Huth","Sperling","Just","Stenzel","Kunkel","Lau","Sprenger","Schönfeld","Pohlmann","Heilmann","Wacker","Lehner","Teichmann","Kaminski","Vogl","Gehrke","Hartl","Vogler","Schroeder","Thomsen","Nitschke","Engler","Liedtke","Wille","Starke","Friedrichs","Kirchhoff","Schwarze","Balzer","Reinhard","Heinen","Lotz","Küster","Kretzschmar","Schöne","Clemens","Hornung","Ulbrich","Renz","Hofer","Ruppert","Lohse","Schuh","Amann","Westermann","Stiller","Burmeister","Alt","Hampel","Brockmann","Wessel","Späth","Hoyer","Mader","Bartel","Rößler","Krieg","Grote","Schwarzer","Schweitzer","Scheer","Bosch","Zink","Roos","Wagener","Oppermann","Henze","Lehnert","Seemann","Trapp","Reiß","David","Pfeffer","Grau","Horst","Diekmann","Korte","Rehm","Wilde","Schleicher","Lampe","Grundmann","Veit","Daniel","Eisele","Hafner","Steinert","Sachs","Pfister","Kühnel","Schüller","Klatt","Bischof","Wendel","Tietz","Frick","Buschmann","Steinke","Menke","Baumeister","Kirschner","Loos","Ebner","Kastner","Wolters","Orth","Stange","Becher","Helm","Knobloch","Wörner","Heyer","Nguyen","Baumgärtner","Grund","Brüning","Ostermann","Cremer","Schauer","Jacobi","Ewald","Fürst","Widmann","Otten","Büchner","Petri","Fritsche","Kock","Ehlert","Kleine","Eckstein","Hacker","Brandes","Buchner","Hagedorn","Keck","Häusler","Muth","Apel","Heuser","Bastian","Kersten","Stamm","Niemeyer","Berthold","Gehrmann","Weinert","Schatz","Hager","Volkmann","Michael","Wieczorek","Wilms","Burghardt","Schultze","Merten","Schwartz","Kling","Rode","Neu","Mende","Thies","Böttger","Schell","Spindler","Pabst","Grün","Weiland","Mühlbauer","Hanisch","Doll","Janzen","Adams","Hermes","Haack","Cramer","Spies","Stern","Kugler","Budde","Jakobs","Scheller","Rösler","Reiser","Jonas","Herr","Ebeling","Wulff","Pauli","Löhr","Lukas","Rahn","Sachse","Köhn","Backhaus","Mahler","Hille","Kowalski","Heidrich","Brück","Gottwald","Heidenreich","Baumgarten","Hamm","Körber","Kübler","Frisch","Hardt","Enders","Bräuer","Seidler","Küpper","Lauterbach","Zeidler","Eckardt","Kreuzer","Schiffer","Schaper","Gehring","Hannemann","Ortmann","Petry","Thiemann","Tiedemann","Grünewald","Johannsen","Scheel","Volz","Kunert","Dieckmann","Bormann","Obermeier","Knauer","Schaub","Eilers","Berner","Pahl","Reinecke","Herz","Henn","Brehm","Hoff","Resch","Ochs","Krohn","Lerch","Raabe","Ehrlich","Hack","Friedl","Reis","Rogge","Meurer","Thelen","Drechsler","Hölscher","Morgenstern","Sommerfeld","Ebel","Kellermann","Rupprecht","Post","Hillebrand","Hill","Paulsen","Grabowski","Bolz","Lorenzen","Welsch","Seibel","Kleinert","Schröer","Jaeger","Wächter","Boldt","Palm","Kratz","Reimers","Pusch","Exner","Dietze","Wüst","Andres","Heide","Kaya","Reichardt","Kummer","Metzner","Grube","Ewert","Grunwald","Habermann","Zorn","Fichtner","Emmerich","Mangold","Reif","Ahlers","Kästner","Küppers","Petermann","Stratmann","Sailer","Schuhmacher","Hoch","Struck","Buchmann","Rauscher","Lüdtke","Wendler","Dreier","Zöller","Bucher","Siegert","Finger","Hopf","Rieck","Friese","Hopp","Sahin","Henrich","Spengler"],ZR=["Michael","Peter","Hans","Klaus","Wolfgang","Thomas","Jürgen","Andreas","Bernd","Manfred","Rainer","Uwe","Dieter","Joachim","Karl","Holger","Werner","Ralf","Frank","Norbert","Ulrich","Rolf","Jörg","Gerhard","Günther","Helmut","Harald","Jens","Horst","Heinz","Reinhardt","Martin","Detlef","Stefan","Matthias","Volker","Christian","Gerd","Rüdiger","Alexander","Bernhard","Hartmut","Walter","Herbert","Georg","Ronald","Axel","Roland","Dirk","Josef","Lothar","Wilfried","Jan","Karsten","Udo","Ingo","Hermann","Kurt","Olaf","Franz","Siegfried","Dietmar","Mohammed","Heinrich","Alfred","Christoph","Viktor","Lutz","Johannes","Torsten","Kai","Rudolf","Richard","Waldemar","Robert","Jörn","Johann","Ernst","Reinhold","Eckhard","Friedrich","Burghard","Wilhelm","Heiko","Jochen","Harry","Hubert","Paul","Erich","Fred","Achim","Ali","Wolf","Erwin","Mario","Andre","Eberhard","Winfried","Heino","Sven","Willi","Ulf","Bodo","Henry","Vladimir","Dietrich","John","Armin","Edgar","Friedhelm","Gunnar","Arno","Fritz","Gerald","Henning","Abdul","Karlheinz","Andrzej","Markus","Otto","Roman","Knut","Wolfram","Nobert","Gunther","Konrad","Heiner","Mehmet","Nils","Bruno"],eD=["Thomas","Michael","Andreas","Stefan","Frank","Torsten","Peter","Jörg","Ralf","Matthias","Christian","Dirk","Jens","Martin","Klaus","Jürgen","Karsten","Uwe","Bernd","Markus","Oliver","Sven","Wolfgang","Holger","Olaf","Hans","Rainer","Kai","Jan","Volker","Joachim","Christoph","Alexander","Axel","Heiko","Norbert","Manfred","Andre","Dieter","Robert","Ulrich","Detlef","Harald","Ingo","Marc","Roland","Lars","Rolf","Marco","Jochen","Guido","Mike","Jörn","Georg","Gerhard","Rüdiger","Mario","Lutz","Bernhard","Nils","Udo","Dietmar","Gerd","Karl","Horst","Günther","Steffen","Johannes","Werner","Ronald","Arne","Daniel","Helmut","Achim","Mohammed","René","Ulf","Hartmut","Björn","Erik","Heinz","Patrick","Viktor","Walter","Ali","Gerald","Reinhardt","Henning","Tobias","Mehmet","Armin","Sebastian","Helge","Gunnar","Richard","Waldemar","Josef","Knut","Boris","Hermann","Paul","Burghard","Florian","Lothar","Sönke","Tim","Philipp","Franz","Clemens","Wilfried","Siegfried","Johann","Ahmet","Eckhard","Fred","Heinrich","Roman","John","Arno","Mustafa","Hasan","Gregor","Alfred","Arnd","Rudolf","Sergej","David","Manuel","Marcel","Friedrich","José","Marek","Mirko","Sascha","Thilo","Bodo","Darius","Hendrik","Herbert","Nikolai","Wolf","Nikola","Roger","Edgar","Ernst","Henry","Wolfram","Christopher","Vladimir","Gunther","Hüseyin","Harry","Hauke","Wilhelm","Arthur","Winfried","Henrik","Antonio","Felix","Anton","Bruno","Igor","Götz","Tom","Heino","Abdul","Miroslaw","Sören","Bert","Elmar","Hubert","Kurt","Ole","Tillmann","Ahmad","Andrej","Dennis","Adam","Ibrahim","Malte","Raphael","Reinhold","Eduard","Erwin","Marius","Nikolaus","Carlos","Ismail","Nico","Gernot","Jacek","Nicolas","Peer","Albert","Heiner","Timo","Andrzej","Jean","Berthold","Hanno"],tD=["Christian","Michael","Stefan","Andreas","Markus","Thomas","Matthias","Sven","Jan","Alexander","Oliver","Martin","Torsten","Frank","Marco","Marc","Jens","Daniel","Karsten","Andre","Sebastian","Lars","Dirk","Tobias","Jörg","Sascha","Kai","Florian","Christoph","Björn","Peter","Dennis","Mike","Ralf","Patrick","Robert","Holger","René","Nils","Heiko","Mario","Philipp","Olaf","Steffen","Tim","Timo","Ingo","Jürgen","Volker","Marcel","Benjamin","Bernd","Axel","Arne","Klaus","David","Jörn","Felix","Boris","Henning","Wolfgang","Uwe","Mirko","Torben","Johannes","Nico","Manuel","Jochen","Hans","Ali","Joachim","Malte","Mohammed","Roland","Simon","Rainer","Fabian","Gunnar","Ulrich","Ronny","Mehmet","Erik","Guido","Sergej","Hendrik","Viktor","Dominik","Roman","Georg","Bastian","Murat","Helge","Sören","Christopher","Karl","Andrej","Mustafa","Ulf","Lutz","Ole","Ahmet","Moritz","Enrico","Nicolas","Sönke","Paul","Harald","Norbert","Henrik","Raphael","Nikolai","Tom","Danny","Gerrit","Hasan","Gregor","Arthur","Bernhard","Marius","Konstantin","Achim","Norman","John","Thilo","Waldemar","Julian","Clemens","Hakan","Till","Ronald","Eduard","Erkan","Hauke","Manfred","Rüdiger","Adam","Ahmad","Klaas","Ibrahim","Vladimir","Adrian","Eugen","Falk","Maximilian","Richard","Andy","Frederik","Marek","Tino","Kevin","Knut","Pascal","Arnd","Detlef","Gerald","Max","Darius","Heinrich","Hüseyin","Igor","Alexej","Dieter","Eike","Tomasz","Wilhelm","Dietmar","Franz","Gerhard","Johann","Antonio","José","Rolf","Abdul","Peer","Ismail","Nikola","Bülent","Gerd","Jakob","Lukas","Niklas","Robin","Gordon","Friedrich","Jonas","Leif","Michel","Hermann","Oleg","Sandro","Tillmann","Burghard","Henry","Jean","Steven","Benedikt","Nikolaus","Ricardo","Roberto","Vitali","Amir","Günther","Helmut","Ivan","Rico","Falko","Jacek","Kim","Krzysztof","Piotr","Said","Silvio","Udo","Vitalij","Werner","Armin","Ayhan","Bodo","Carlos","Cengiz","Josef","Pierre","Ömer","Arno","Atilla","Birger","Dimitri","Georgios","Götz","Hagen","Hannes","Hartmut","Juan","Kolja","Marcin","Toni","Louis","Metin","Paulo","Pawel","Yusuf","Albert","Alex","Chris","Gunther","Lasse","Orhan","Ramazan","Rudolf","Walter"],aD=["Christian","Sebastian","Jan","Daniel","Stefan","Alexander","Michael","Dennis","Martin","Florian","Tobias","Matthias","Philipp","Patrick","Thomas","Benjamin","Andreas","Markus","Christoph","Marcel","Sven","Sascha","Tim","David","Felix","Johannes","Robert","Marco","Andre","Marc","Oliver","Christopher","Nils","Fabian","Simon","Björn","Timo","René","Dominik","Julian","Jens","Lars","Peter","Steffen","Manuel","Lukas","Moritz","Maximilian","Jonas","Mike","Kai","Frank","Paul","Kevin","Torben","Nico","Karsten","Torsten","Mario","Malte","Bastian","Hendrik","Max","Dirk","Pascal","Erik","Sören","Arne","Jakob","Nicolas","Konstantin","Niklas","Marius","Frederik","Roman","Henning","Jörg","Mirko","Mohammed","Viktor","Ali","Ralf","Raphael","Adrian","Danny","Steven","Ole","Hannes","Lennard","Benedikt","Georg","Marvin","Eugen","Robin","Jochen","Tom","Arthur","Heiko","Nikolai","Jannik","Till","Hans","Richard","Henrik","Pierre","Ronny","Sergej","Holger","Jannis","John","Boris","Jörn","Michel","Johann","Gregor","Klaus","Norman","Clemens","Hauke","Jonathan","Vincent","Enrico","Kim","Axel","Andrej","Toni","Karl","Waldemar","Bernd","Mehmet","Anton","Wolfgang","Ahmad","Mustafa","Andy","Ahmet","Lasse","Tino","Eike","Gerrit","Konrad","Joachim","Steve","Julius","Eduard","Murat","Dimitri","Friedrich","Gunnar","Jürgen","Adam","Ibrahim","Maurice","Klaas","Sönke","Bernhard","Igor","Tillmann","Alexej","Chris","Vladimir","Serkan","Thilo","Helge","Olaf","Roland","Gabriel","Nick","Falk","Nikola","Rico","Kolja","Leif","Pawel","Amir","Ingo","Jascha","Alex","Fatih","Gökhan","Hakan","Hasan","Kamil","Lutz","Marcin","Uwe","Achim","Finn","Samuel","Valentin","Vitali","Damian","Dustin","Franz","Leon","Darius","Erkan","Henry","Maxim","Peer"],nD=["Jan","Lukas","Philipp","Tim","Alexander","Daniel","Tobias","Dennis","Marcel","Felix","Kevin","Florian","Maximilian","Niklas","Jonas","Sebastian","Patrick","Fabian","Christian","Jannik","Julian","David","Marvin","Timo","Marc","Nico","Simon","Finn","Dominik","Nils","Leon","Pascal","Lennard","Max","Tom","Christopher","Benjamin","Moritz","Paul","Lars","Marco","Sven","Christoph","Robin","Johannes","Malte","Michael","Torben","Jakob","Matthias","Martin","Stefan","Mike","Andre","Jannis","Hendrik","Luca","Björn","Nicolas","Markus","René","Vincent","Jonathan","Steven","Frederik","Sascha","Thomas","Erik","Robert","Oliver","Andreas","Nick","Marius","Kai","Ole","Manuel","Joshua","Justin","Steffen","Adrian","Konstantin","Benedikt","Lasse","Louis","Maurice","Julius","Mirko","Anton","Till","John","Henrik","Henry","Bastian","Sören","Leonard","Raphael","Johann","Arne","Hannes","Michel","Karl","Mario","Ben","Mohammed","Viktor","Linus","Nikolai","Dustin","Aaron","Valentin","Peter","Toni","Henning","Marlon","Clemens","Danny","Justus","Jasper","Julien","Chris","Jens","Joel","Hauke","Kim","Richard","Gerrit","Cedric","Pierre","Karsten","Thore","Vivian","Mats","Ricardo","Arthur","Bennet","Fabio","Jannek","Kilian","Leo","Melvin","Noah","Samuel","Timon","Eike","Ali","Leif","Peer","Jean","Hans","Jeremy","Merlin","Jannes","Calvin","Jona","Elias","Lorenz","Marten","Can","Dario","Georg","Ahmet","Enrico","Oskar","Tristan","Jascha","Roman","Colin","Gabriel","Jason","Klaas","Morten","Nikola","Phil","Sönke","Alex","Cem","Konrad","Mattis","Rico","Armin","Brian","Frank","Gregor","Ralf","Thies","Norman","Ruben","Ahmad","Emre","Levin","Mehmet","Torge","Torsten","Bjarne","Kornelius","Steve","Jerome","Marek","Sandro","Thilo","Franz","Kenneth","Axel","Burak","Jörn","Kjell","Milan","Tjark","Kolja","Miguel","Tillmann","Emil","Friedrich","Lion","Rasmus","Tino","Caspar","Mert","Amir","Ibrahim","Joe","Leonhard","Mustafa","Onur","Ferdinand","Joscha","Laurenz","Maxim","Sam","Yasin","Antonio","Jeffrey","Jendrik","Nikolaus","Philippe","Sinan","Damian","Dirk","Fritz","Helge","Juri","Leander","Matti","Michele","Nino","Rouven","Said","Tarek","Theo","Timothy"],rD=["Leon","Lukas","Luca","Jonas","Tim","Finn","Paul","Felix","Maximilian","Louis","Niklas","Max","Ben","Julian","Jan","Philipp","Elias","Moritz","Noah","Jannik","Jannis","Tom","Nico","Simon","David","Alexander","Fabian","Erik","Jakob","Florian","Nils","Justin","Lennard","Nick","Linus","Daniel","Tobias","Jason","Dominik","Colin","Marvin","Mika","Sebastian","Kevin","Johannes","Julius","Robin","Jonathan","Henry","Hannes","Anton","Vincent","Benjamin","Marlon","Timo","Lenny","Adrian","Marc","Joel","Raphael","Dennis","Till","Joshua","Aaron","Emil","Pascal","Ole","Leonard","Leo","Lasse","Marcel","Samuel","Konstantin","Karl","Oskar","Lars","Lennox","Mattis","Jona","Kilian","Christian","Maurice","Justus","Jamie","Oliver","Malte","Silas","Michael","Mohammed","Jeremy","John","Phil","Bastian","Maxim","Johann","Liam","Nicolas","Mike","Levin","Benedikt","Marco","Noel","Luke","Bennet","Cedric","Gabriel","Theo","Matteo","Tyler","Valentin","Fabio","Marius","Jayden","Toni","Richard","Mats","Hendrik","Jannes","Henrik","Julien","Manuel","Arthur","Patrick","Matthias","Frederik","Connor","Tristan","Torben","Markus","Kai","Martin","Arda","Andreas","Damian","Timon","Franz","Michel","Levi","Finley","Robert","Thomas","Ian","Arne","Dustin","Christopher","Christoph","Bruno","Diego","Matti","Clemens","Leander","Magnus","Milan","Danny","Laurin","Lorenz","Laurenz","Sven","Ali","Leandro","Steven","Chris","Dean","Lenn","Pepe","Jasper","Konrad","Devin","Can","Domenik","Friedrich","Sean","Kian","Sam","Kjell","Ryan","Andre","Bjarne","Ruben","Stefan","Nikita","René","Peter","Hugo","Melvin","Jean","Leopold","Malik","Willi","Fritz","Leonardo","Quentin","Ahmet","Enrico","Emilio","Brian","Ferdinand","Antonio","Marten","Nevio","Thore","Joris","Leonhard","Roman","Anthony","Viktor","Henning","Sascha","Alex","Adam","Elia","Josef","Theodor","Jaron","Leif","Georg","Piet","Alessandro","Kaan","Lion","Miguel","Alessio","Carlos","Luan","Ilyas","Ricardo","Yusuf","Jannek","Mert","Peer","Yasin","Enes","Marek","Nino","Arian","Carlo","Janne","Gustav","Hasan","Mattes","Mustafa","William","Jerome","Milo","Dario","Mehmet","Hans","Thilo","Neo","Sören","Mirko","Sandro","Tamino","Emilian","Björn","Korbinian","Pierre","Emanuel","Bela","Benno","Merlin","Tino","Keno","Ludwig","Emre","Jordan","Kerem","Gianluca","Ibrahim","Jesse","Mario","Tjark","Eddy","Lian","Fiete","Etienne","Klaas","Marian","Efe","Jack","Calvin","Semih","Rico","Mick","Darian","Joost","Tommy","Angelo","Romeo","Keanu","Kurt","Raik","Tammo","Dylan","Nikolai","Thies","Armin","Darius","Maddox","Rasmus"],iD=["Ben","Leon","Paul","Jonas","Finn","Lukas","Louis","Luca","Noah","Elias","Felix","Maximilian","Max","Henry","Julian","Moritz","Tim","Emil","Jakob","Philipp","Niklas","Oskar","David","Anton","Alexander","Liam","Matteo","Theo","Tom","Jan"],sD=["Noah","Matteo","Leon","Elias","Finn","Paul","Luca","Emil","Louis","Theo","Henry","Felix","Ben","Liam","Leo","Lukas","Jonas","Jakob","Anton","Oskar","Maximilian","Mohammed","Levi","Milan","Jona","David","Karl","Jannis","Lio","Moritz","Adam","Max","Samuel","Mats","Alexander","Jonathan","Raphael","Aaron","Linus","Julian","Milo","Theodor","Carlo","Philipp","Valentin","Leonard","Erik","Mika","Johann","Niklas"],oD=["Angelika","Monika","Sabine","Karin","Petra","Gabriele","Birgit","Brigitte","Renate","Susanne","Barbara","Ursula","Ute","Marion","Jutta","Ingrid","Cornelia","Heike","Maria","Regina","Elke","Silvia","Andrea","Ulrike","Gisela","Angela","Bärbel","Christine","Martina","Christiane","Doris","Helga","Dagmar","Sigrid","Christa","Gudrun","Beate","Rita","Hannelore","Marlies","Eva","Claudia","Anke","Marianne","Annette","Elisabeth","Astrid","Erika","Heidi","Christel","Rosemarie","Anna","Bettina","Gabriela","Roswita","Ilona","Annegret","Evelyn","Sonja","Inge","Christina","Carmen","Irene","Kirsten","Lydia","Silke","Marina","Margret","Marita","Ruth","Maren","Sibylle","Waltraud","Ingeborg","Katharina","Vera","Heidemarie","Kerstin","Heidrun","Margrit","Carola","Iris","Antje","Katrin","Margit","Manuela","Veronika","Olga","Anne","Dorothea","Hildegard","Irmgard","Edith","Uta","Regine","Margarete","Anita","Frauke","Karen","Valentina","Anja","Tatjana","Ellen","Edeltraud","Verena","Dörte","Ilse","Gerda","Ines","Britta","Corinna","Elvira","Michaela","Annemarie","Anneliese","Gertrud","Gitta","Marie","Susann","Maike","Stefanie","Danuta","Gunda","Margot","Johanna","Irina","Ina","Theresa","Nina","Wiebke"],lD=["Sabine","Susanne","Petra","Andrea","Claudia","Birgit","Martina","Anja","Heike","Kerstin","Bettina","Gabriele","Katrin","Silke","Ute","Christine","Stefanie","Monika","Britta","Ulrike","Barbara","Kirsten","Silvia","Karin","Annette","Christiane","Beate","Manuela","Angela","Anke","Nicole","Marion","Cornelia","Christina","Angelika","Astrid","Elke","Michaela","Regina","Dagmar","Katja","Brigitte","Maria","Iris","Jutta","Antje","Tanja","Doris","Maike","Simone","Maren","Corinna","Sonja","Daniela","Carola","Alexandra","Eva","Ursula","Carmen","Sandra","Karen","Ines","Marina","Katharina","Elisabeth","Bärbel","Renate","Gaby","Anne","Anna","Gabriela","Sibylle","Heidi","Uta","Ina","Sigrid","Frauke","Ilona","Ingrid","Gudrun","Wiebke","Tatjana","Yvonne","Carolin","Patricia","Dörte","Susann","Birte","Rita","Julia","Irina","Bianca","Nikola","Ilka","Olga","Jeanette","Marlies","Helga","Melanie","Verena","Vera","Regine","Kirstin","Evelyn","Irene","Lydia","Christa","Annett","Marianne","Dorothea","Annegret","Elena","Gisela","Imke","Isabell","Heidrun","Viola","Diana","Esther","Susan","Inga","Judith","Ruth","Cordula","Jacqueline","Kai","Veronika","Carina","Roswita","Constanze","Marita","Natalie","Ramona","Ellen","Erika","Fatma","Nina","Svetlana","Dorothee","Inge","Nadja","Jasmin","Anita","Franziska","Friederike","Marie","Svenja","Jessica","Natascha","Rosemarie","Valentina","Ayse","Linda","Beatrix","Johanna","Ariane","Gesa","Larissa","Malgorzata","Miriam","Gunda","Margarete","Natalia","Almut","Ewa","Gitta","Jolanta","Babette","Beatrice","Christel","Christin","Sabrina","Dorit","Jana","Juliane","Hilke","Margret","Beata","Galina","Liane","Danuta","Elvira","Ingeborg","Rosa","Emine","Grit","Hannah","Sabina","Agnes","Edith","Gundula","Inken","Maja","Margit","Bozena","Helena","Theresa","Elzbieta","Hannelore","Tina"],cD=["Nicole","Stefanie","Sandra","Katrin","Claudia","Tanja","Anja","Melanie","Andrea","Daniela","Julia","Susanne","Katja","Christina","Kerstin","Silke","Sabine","Alexandra","Yvonne","Sonja","Nadine","Nina","Simone","Maike","Petra","Christine","Britta","Martina","Anna","Michaela","Manuela","Bianca","Katharina","Silvia","Bettina","Heike","Ulrike","Birgit","Anke","Christiane","Jessica","Monika","Maren","Eva","Anne","Antje","Diana","Jana","Cornelia","Wiebke","Kirsten","Miriam","Tina","Carolin","Astrid","Annette","Maria","Annika","Jennifer","Tatjana","Angela","Corinna","Barbara","Verena","Elena","Jasmin","Birte","Inga","Olga","Natalie","Ines","Iris","Ina","Marion","Beate","Irina","Svenja","Judith","Carina","Sarah","Patricia","Karin","Carmen","Franziska","Janine","Juliane","Saskia","Carola","Doreen","Frauke","Marina","Ute","Isabell","Annett","Christin","Karen","Mandy","Nadja","Svetlana","Natalia","Gabriele","Sabrina","Elke","Ramona","Natascha","Friederike","Ilka","Vanessa","Dagmar","Imke","Jeanette","Dörte","Angelika","Nikola","Rebecca","Regina","Janina","Kirstin","Johanna","Jutta","Elisabeth","Anita","Mareike","Sibylle","Maja","Esther","Vera","Agnieszka","Jenny","Peggy","Ariane","Hannah","Steffi","Joana","Victoria","Magdalena","Fatma","Lena","Sina","Doris","Uta","Larissa","Marie","Evelyn","Ann","Constanze","Jacqueline","Kati","Lydia","Agnes","Dana","Dorothea","Ilona","Kim","Ayse","Gaby","Katarzyna","Mirja","Pamela","Heidi","Helena","Viola","Isabella","Susann","Cindy","Cordula","Emine","Kathleen","Nancy","Beata","Denise","Susan","Ursula","Veronika","Brigitte","Gesa","Martha","Mirjam","Beatrice","Hatice","Dorothee","Linda","Malgorzata","Pia","Grit","Irene","Filiz","Yasemin","Berit","Ellen","Janet","Laura","Lisa","Renate","Ruth","Ewa","Gabriela","Ingrid","Liane","Mariam","Monique","Tamara","Antonia","Svantje","Alice","Margarete","Nele","Manja","Nora","Oksana","Özlem","Nadia","Ricarda","Bärbel","Carolina","Hülya","Inken","Rita","Sophie","Valentina","Violetta","Vivien","Britt","Inna","Leyla","Arzu","Kai","Natalja","Sandy","Silvana","Sophia","Beatrix","Ludmilla","Romy","Selma","Elvira","Helene","Henrike","Oxana","Rabea","Sabina","Wenke","Annegret","Aylin","Charlotte","Dorit","Emma","Jeannine","Marianne","Mona"],uD=["Julia","Stefanie","Anna","Katharina","Katrin","Sarah","Sandra","Nadine","Melanie","Christina","Jennifer","Nicole","Sabrina","Jessica","Annika","Claudia","Nina","Anne","Daniela","Franziska","Anja","Carolin","Jasmin","Christin","Katja","Janina","Jana","Janine","Yvonne","Alexandra","Svenja","Maike","Lena","Laura","Maria","Tanja","Susanne","Lisa","Andrea","Christine","Miriam","Sonja","Johanna","Ann","Sabine","Vanessa","Kerstin","Natalie","Bianca","Eva","Mareike","Marie","Verena","Jacqueline","Isabell","Hannah","Saskia","Simone","Tina","Juliane","Maren","Elena","Rebecca","Martina","Christiane","Carina","Mandy","Olga","Denise","Wiebke","Diana","Marina","Tatjana","Jenny","Manuela","Linda","Michaela","Nadja","Inga","Antje","Corinna","Patricia","Silvia","Ulrike","Kim","Judith","Ines","Monika","Birte","Ina","Victoria","Elisabeth","Theresa","Sina","Irina","Sophie","Silke","Friederike","Britta","Nora","Lea","Nele","Natascha","Bettina","Doreen","Barbara","Angela","Ramona","Cornelia","Anke","Natalia","Magdalena","Nancy","Annette","Astrid","Aylin","Susann","Kathleen","Alina","Lydia","Joana","Kirsten","Jeanette","Martha","Heike","Mona","Anita","Dana","Veronika","Yasemin","Sophia","Carolina","Svetlana","Esther","Charlotte","Antonia","Constanze","Vivien","Luisa","Svantje","Helena","Petra","Steffi","Pia","Susan","Monique","Lina","Mariam","Vera","Merle","Angelika","Karin","Maja","Frauke","Agnes","Isabella","Josephine","Frederike","Michelle","Carmen","Carola","Cindy","Madeleine","Janna","Larissa","Gina","Marlene","Anastasia","Elisa","Regina","Viola","Özlem","Alice","Evelyn","Marleen","Dominique","Lara","Karen","Nikola","Marion","Annabell","Annett","Dorothea","Iris","Henrike","Kira","Mirja","Camilla","Ronja","Valentina","Alena","Ariane","Dorothee","Fatma","Gesa","Agnieszka","Birgit","Ricarda","Sandy","Beate"],dD=["Julia","Anna","Sarah","Lisa","Laura","Katharina","Lena","Vanessa","Annika","Jennifer","Jana","Lea","Marie","Jasmin","Franziska","Hannah","Jessica","Michelle","Nina","Alina","Johanna","Carolin","Christina","Kim","Nadine","Jacqueline","Ann","Luisa","Sophie","Lara","Natalie","Svenja","Sabrina","Isabell","Sandra","Janina","Melanie","Leonie","Antonia","Saskia","Stefanie","Aylin","Denise","Nele","Pia","Alexandra","Katrin","Sophia","Sina","Melina","Janine","Vivien","Rebecca","Anne","Miriam","Victoria","Nicole","Mareike","Lina","Josephine","Merle","Clara","Maria","Maike","Charlotte","Celina","Paula","Carina","Larissa","Christin","Linda","Mandy","Theresa","Kimberly","Elena","Melissa","Jule","Celine","Daniela","Jenny","Kira","Patricia","Ronja","Bianca","Eva","Sonja","Joana","Gina","Tanja","Nora","Yvonne","Pauline","Emily","Natascha","Anja","Marina","Friederike","Angelina","Nadja","Paulina","Lynn","Alicia","Svea","Amelie","Katja","Juliane","Lilly","Marlene","Verena","Chantal","Milena","Maja","Chiara","Selina","Alena","Carlotta","Mona","Annabell","Carla","Claudia","Tatjana","Maren","Elisabeth","Emma","Helena","Inga","Luise","Tamara","Christine","Fiona","Judith","Frederike","Finja","Jill","Fenja","Tina","Cindy","Ina","Janne","Marleen","Mia","Samantha","Annalena","Janika","Henrike","Wiebke","Elisa","Esther","Ricarda","Janna","Stella","Carolina","Dana","Helen","Madeleine","Mara","Simone","Corinna","Diana","Fabienne","Monique","Samira","Sandy","Tabea","Valerie","Malin","Andrea","Birte","Swantje","Veronika","Kerstin","Magdalena","Ramona","Susanne","Greta","Juli","Kaja","Lucy","Zoe","Angelique","Jasmina","Tessa","Lydia","Sabine","Dominique","Malina","Michaela","Charline","Monika","Karen","Mira","Yasemin","Alica","Alice","Alisa","Angelika","Emilia","Henriette","Marieke","Vera","Anneke","Felicia","Giulia","Liza","Maxi","Viola","Annkatrin","Lotta","Olivia","Anastasia","Dilara","Felicitas","Mariam","Marisa","Rieke","Rosa","Beatrice","Constanze","Dorothea","Isabella","Juliana","Katerina","Martina","Merve","Philine","Valentina","Justine","Melisa","Michele","Mika","Nancy","Selin","Alissa","Angela","Cara","Charleen","Deborah","Ellen","Imke","Irina","Jeanette","Leona","Lorena","Manuela","Martha","Silvia","Viviane","Aline","Desiree","Xenia"],mD=["Hannah","Leonie","Anna","Lea","Lena","Mia","Emily","Laura","Lara","Sarah","Emma","Lilly","Marie","Sophie","Nele","Johanna","Lina","Julia","Maja","Sophia","Lisa","Amelie","Alina","Luisa","Leni","Clara","Jana","Charlotte","Paula","Emilia","Jasmin","Zoe","Annika","Katharina","Chiara","Pia","Finja","Josephine","Angelina","Jule","Lucy","Melina","Antonia","Vanessa","Emely","Victoria","Celina","Michelle","Nina","Isabell","Franziska","Fiona","Amy","Celine","Maria","Pauline","Stella","Carolin","Lia","Marlene","Melissa","Ida","Greta","Selina","Helena","Aylin","Merle","Ronja","Sina","Vivien","Mara","Eva","Kim","Elisa","Theresa","Jolina","Mathilda","Jette","Lotta","Luise","Elena","Carla","Jessica","Larissa","Luna","Nelly","Alicia","Lana","Linda","Milena","Miriam","Samira","Frieda","Magdalena","Carlotta","Alexandra","Fabienne","Kira","Helene","Nora","Elisabeth","Natalie","Tabea","Romy","Anne","Paulina","Juli","Christina","Annalena","Kimberly","Samantha","Annabell","Ella","Lynn","Mira","Letizia","Jennifer","Carina","Aaliyah","Rebecca","Anastasia","Dana","Isabella","Diana","Olivia","Lenja","Mariella","Mila","Lucia","Martha","Leyla","Joana","Elina","Carolina","Xenia","Gina","Nicole","Janina","Saskia","Evelyn","Anni","Marleen","Melanie","Svenja","Svea","Chantal","Tessa","Maike","Fenja","Leona","Josie","Joline","Cheyenne","Lorena","Noemi","Helen","Ann","Alissa","Malin","Lilian","Lotte","Mina","Felicitas","Liv","Jenny","Jill","Valentina","Veronika","Alexa","Kaja","Rieke","Yara","Dilara","Tuana","Laila","Tamara","Alisa","Ela","Marina","Alessia","Luana","Patricia","Lene","Jacqueline","Janne","Henriette","Ashley","Franka","Milla","Florentine","Selin","Selma","Giulia","Mona","Lisann","Aleyna","Rosalie","Sonja","Elif","Thea","Maren","Enya","Nadine","Alisha","Freya","Jamie","Denise","Aurelia","Ina","Christin","Judith","Lilith","Alena","Felicia","Juliana","Sandra","Zoey","Linnea","Soraya","Nisa","Stefanie","Juliane","Daria","Jasmina","Josefin","Friederike","Marla","Rosa","Cara","Nika","Naomi","Vivian","Amina","Elli","Cora","Luca","Madita","Mailin","Marieke","Tara","Amira","Liana","Lydia","Joy","Madlen","Nike","Hailey","Madeleine","Mareike","Aimee","Cassandra","Heidi","Joyce","Alea","Janine","Jonna","Sydney","Alia","Ilayda","Livia","Maira","Leana","Valerie","Thalia","Ellen","Emmi","Melisa","Inga","Julina","Smilla","Katja","Melinda","Valeria","Anouk","Liliana","Sabrina","Wiebke","Joleen","Leandra","Zeynep","Katrin","Tamina","Jenna","Levke","Salome","Annelie","Cecilia","Annemarie","Jona","Mary","Mirja","Collien","Alice","Azra","Ceylin","Lavinia","Maxi","Anja","Henrike","Mariam"],fD=["Mia","Emma","Hannah","Sophia","Emilia","Anna","Lea","Lina","Marie","Lena","Leonie","Emily","Amelie","Luisa","Johanna","Clara","Sophie","Lilly","Mila","Leni","Laura","Lara","Nele","Maja","Charlotte","Sarah","Ella","Ida","Mathilda","Frieda"],gD=["Emilia","Sophia","Emma","Hannah","Mia","Lina","Mila","Ella","Clara","Lea","Marie","Leni","Lia","Mathilda","Ida","Anna","Frieda","Leonie","Emily","Maja","Lilly","Luisa","Charlotte","Amelie","Sophie","Lena","Johanna","Lara","Mira","Nora","Nele","Sarah","Malia","Lotta","Juna","Paula","Luna","Elisa","Maria","Romy","Laura","Helena","Thea","Mara","Victoria","Antonia","Elena","Tilda","Carla","Eva"],hD=class extends td{getFirstNamesMaleJson(){return[]}getFirstNamesFemaleJson(){return[]}getLastNamesJson(){return $R}getFirstNamesMaleByDecade(){return[{startYear:1950,endYear:1959,names:ZR},{startYear:1960,endYear:1969,names:eD},{startYear:1970,endYear:1979,names:tD},{startYear:1980,endYear:1989,names:aD},{startYear:1990,endYear:1999,names:nD},{startYear:2e3,endYear:2009,names:rD},{startYear:2010,endYear:2019,names:iD},{startYear:2020,endYear:2029,names:sD}]}getFirstNamesFemaleByDecade(){return[{startYear:1950,endYear:1959,names:oD},{startYear:1960,endYear:1969,names:lD},{startYear:1970,endYear:1979,names:cD},{startYear:1980,endYear:1989,names:uD},{startYear:1990,endYear:1999,names:dD},{startYear:2e3,endYear:2009,names:mD},{startYear:2010,endYear:2019,names:fD},{startYear:2020,endYear:2029,names:gD}]}},AD=["Rossi","Russo","Ferrari","Esposito","Bianchi","Romano","Colombo","Ricci","Marino","Greco","Bruno","Gallo","Conti","De Luca","Mancini","Costa","Giordano","Rizzo","Lombardi","Moretti","Barbieri","Fontana","Santoro","Mariani","Rinaldi","Caruso","Ferrara","Galli","Martini","Leone","Longo","Gentile","Martinelli","Vitale","Serra","Coppola","De Santis","D'Angelo","Marchetti","Parisi","Villa","Conte","Ferraro","Ferri","Fabbri","Bianco","Marini","Grasso","Valentini","Messina"],pD=["Giuseppe","Giovanni","Antonio","Mario","Luigi","Francesco","Angelo","Vincenzo","Pietro","Salvatore","Carlo","Franco","Pasquale","Domenico","Raffaele","Carmelo","Paolo","Sergio","Bruno","Luciano","Giorgio","Aldo","Renato","Piero","Guido","Nicola","Rosario","Vittorio","Michele","Umberto","Romano","Gino","Silvano","Renzo","Attilio","Augusto","Benito","Biagio","Cesare","Corrado","Dino","Egidio","Elio","Enzo","Ettore","Fausto","Felice","Ferdinando","Ferruccio","Gaetano","Gastone","Gennaro","Gerardo","Germano","Italo","Lino","Marino","Nello","Nino","Orazio","Orlando","Osvaldo","Ottavio","Primo","Remo","Rinaldo","Rocco","Ruggero","Severino","Silvio","Ugo","Valerio","Vasco","Walter","Agostino","Alfredo","Armando","Arturo","Claudio","Enrico","Giancarlo","Gianfranco","Alberto","Marcello","Roberto","Stefano","Mauro","Fabio","Maurizio","Massimo","Alessandro","Lorenzo","Andrea","Marco","Giuliano","Adriano","Gianni","Sandro","Leone"],yD=["Roberto","Stefano","Paolo","Marco","Luca","Alessandro","Massimo","Mauro","Fabrizio","Maurizio","Gianluca","Claudio","Giorgio","Piero","Gianfranco","Gianni","Valter","Ivan","Danilo","Moreno","Loris","Sandro","Dario","Nicola","Enrico","Alberto","Fabio","Giuseppe","Antonio","Giovanni","Francesco","Andrea","Michele","Daniele","Emanuele","Vittorio","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Diego","Dino","Donatello","Duccio","Edmondo","Egidio","Elio","Enea","Ercole","Ermanno","Eros","Ezio","Fausto","Ferdinando","Fiorello","Flavio","Floriano","Folco","Franco","Fulvio","Gabriele","Gaetano","Gastone","Giacomo","Gianbattista","Giancarlo","Gianmaria","Gianpaolo","Gianpiero","Gilberto","Gino","Giordano","Gualtiero","Guido","Gustavo","Iacopo","Igor","Ilario","Italo","Ivano","Jacopo","Lamberto","Lando","Lanfranco","Lazzaro","Leo","Leonardo","Leone"],ED=["Alessandro","Andrea","Marco","Luca","Stefano","Davide","Gianluca","Fabio","Francesco","Massimo","Roberto","Simone","Daniele","Emanuele","Christian","Riccardo","Federico","Matteo","Gabriele","Michele","Lorenzo","Alessio","Nicola","Alberto","Fabrizio","Massimiliano","Giorgio","Enrico","Claudio","Paolo","Ivan","Mirko","Manuel","Denis","Igor","Omar","Cristian","Yuri","Alex","Samuel","Mattia","Pietro","Vincenzo","Angelo","Salvatore","Luigi","Domenico","Raffaele","Rosario","Carmelo","Pasquale","Diego","Dario","Giulio","Valerio","Maurizio","Gianni","Sandro","Loris","Moreno","Danilo","Tiziano","Antonello","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Demetrio","Dino","Edoardo","Elia","Emilio","Enzo","Ermanno","Eros","Eugenio","Fausto","Flavio","Fulvio","Gaetano","Gerardo","Gianbattista","Gianmaria","Gianpaolo","Gilberto","Giuliano","Iacopo","Leonardo","Marcello","Martino","Niccolò","Piero","Rinaldo","Ruggero","Samuele","Saverio","Sebastiano","Tommaso"],bD=["Marco","Andrea","Luca","Alessandro","Stefano","Daniele","Simone","Davide","Matteo","Francesco","Lorenzo","Federico","Gianluca","Fabio","Massimo","Emanuele","Riccardo","Nicola","Christian","Roberto","Michele","Giuseppe","Antonio","Giovanni","Paolo","Alberto","Filippo","Giorgio","Enrico","Tommaso","Giacomo","Mattia","Gabriele","Samuele","Pietro","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Alessio","Cristian","Manuel","Mirko","Ivan","Omar","Denis","Igor","Yuri","Alex","Samuel","Jacopo","Nicolò","Edoardo","Leonardo","Diego","Dario","Giulio","Valerio","Claudio","Mauro","Fabrizio","Maurizio","Gianni","Piero","Sandro","Loris","Moreno","Danilo","Valter","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Demetrio","Dino","Elia","Emilio","Enzo","Ermanno","Eros","Eugenio","Fausto"],ID=["Matteo","Andrea","Luca","Alessandro","Davide","Lorenzo","Francesco","Simone","Marco","Mattia","Federico","Riccardo","Gabriele","Stefano","Daniele","Nicola","Christian","Giacomo","Filippo","Tommaso","Emanuele","Michele","Giuseppe","Antonio","Giovanni","Alberto","Giorgio","Enrico","Pietro","Samuele","Alessio","Edoardo","Leonardo","Diego","Nicolò","Manuel","Mirko","Ivan","Jacopo","Giulio","Valerio","Claudio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Massimo","Fabio","Gianluca","Maurizio","Fabrizio","Mauro","Gianni","Piero","Sandro","Loris","Moreno","Danilo","Valter","Silvano","Romano","Giuliano","Tiziano","Massimiliano","Antonello","Arrigo","Aurelio","Bernardo","Carlo","Cesare","Corrado","Costantino","Damiano","Dino","Elia","Emilio","Enea","Ettore","Eugenio","Flavio","Gaetano","Gerardo","Gianmaria","Gianpaolo","Gilberto","Gualtiero","Guido","Gustavo","Iacopo","Igor"],vD=["Francesco","Alessandro","Andrea","Matteo","Lorenzo","Mattia","Davide","Simone","Luca","Gabriele","Riccardo","Federico","Marco","Tommaso","Leonardo","Giuseppe","Antonio","Giovanni","Filippo","Giacomo","Christian","Edoardo","Samuele","Alessio","Michele","Daniele","Stefano","Nicola","Pietro","Giorgio","Enrico","Emanuele","Alberto","Diego","Nicolò","Manuel","Jacopo","Giulio","Valerio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Kevin","Thomas","Nicholas","Samuel","Gabriel","Daniel","David","Jonathan","Michael","Patrick","Simon","Steven","William","Anthony","Christopher","George","Harry","Jack","James","Joseph","Joshua","Matthew","Oliver","Oscar","Richard","Robert","Ryan","Elia","Gioele","Enea","Liam","Noah","Ethan","Bryan","Nathan","Aron","Zeno","Leone","Brando","Tancredi","Manfredi","Dante","Lapo","Romeo","Ettore","Achille","Michelangelo","Orlando"],wD=["Francesco","Alessandro","Leonardo","Lorenzo","Mattia","Andrea","Gabriele","Matteo","Riccardo","Tommaso","Edoardo","Giuseppe","Antonio","Davide","Federico","Diego","Giovanni","Marco","Nicolò","Samuele","Michele","Pietro","Luca","Simone","Filippo","Giacomo","Christian","Alessio","Emanuele","Daniele","Stefano","Nicola","Giorgio","Enrico","Alberto","Manuel","Jacopo","Giulio","Valerio","Paolo","Roberto","Vincenzo","Angelo","Raffaele","Domenico","Rosario","Salvatore","Luigi","Mario","Carmelo","Pasquale","Nathan","Liam","Noah","Ethan","Mason","Logan","Lucas","Oliver","Elijah","Aiden","James","Benjamin","William","Alexander","Michael","Daniel","Henry","Jackson","Sebastian","Jack","Samuel","David","Joseph","Carter","Owen","Wyatt","John","Matthew","Luke","Julian","Gioele","Elia","Enea","Leone","Brando","Tancredi","Manfredi","Dante","Lapo","Romeo","Ettore","Achille","Michelangelo","Orlando","Cesare","Vittorio","Augusto","Sebastiano","Damiano","Gregorio","Ludovico","Martino","Niccolò","Rocco","Santo","Saverio","Tiziano","Valentino","Vasco","Zaccaria"],CD=["Maria","Anna","Rosa","Giuseppina","Angela","Giovanna","Teresa","Lucia","Carmela","Caterina","Francesca","Antonietta","Carla","Rita","Paola","Luisa","Fernanda","Franca","Gabriella","Giuliana","Lina","Mirella","Bruna","Adriana","Silvana","Marisa","Iolanda","Ines","Ida","Ester","Elvira","Elsa","Elena","Edda","Dina","Delia","Clara","Bice","Bianca","Assunta","Antonia","Annunziata","Amelia","Amalia","Agata","Ada","Adele","Adelina","Albina","Alda","Alma","Anita","Armida","Aurelia","Aurora","Beatrice","Celeste","Cesira","Clelia","Clotilde","Concetta","Costanza","Daria","Deanna","Dolores","Domenica","Dora","Edvige","Elda","Eleonora","Elisabetta","Emma","Enrica","Ersilia","Eugenia","Evelina","Fabiola","Fiammetta","Filomena","Flora","Floriana","Fulvia","Gemma","Gilda","Gina","Gioia","Grazia","Graziella","Immacolata","Irene","Irma","Isa","Jolanda","Laura","Lidia"],ND=["Roberta","Patrizia","Cinzia","Daniela","Lorella","Nadia","Monica","Susanna","Tiziana","Donatella","Simonetta","Antonella","Sabrina","Loredana","Marina","Barbara","Paola","Laura","Cristina","Rossella","Simona","Stefania","Manuela","Sonia","Sandra","Loretta","Orietta","Gigliola","Fiorella","Gabriella","Raffaella","Isabella","Marta","Elisabetta","Claudia","Alessandra","Federica","Michela","Serena","Valeria","Cecilia","Letizia","Luciana","Mara","Marcella","Margherita","Mariella","Marilena","Marisa","Milena","Mirella","Natalia","Nicoletta","Norma","Novella","Olga","Ombretta","Oriana","Ornella","Ottavia","Pamela","Piera","Priscilla","Rachele","Rebecca","Regina","Renata","Rita","Romina","Rosalina","Rosanna","Rosetta","Rosina","Santina","Savina","Silvia","Sofia","Speranza","Tina","Vanda","Vanna","Velia","Vera","Vilma","Vincenza","Violante","Virginia","Vittoria","Viviana","Wanda","Zita"],xD=["Barbara","Katia","Debora","Erika","Pamela","Samantha","Moira","Natascia","Tamara","Tatiana","Jessica","Valentina","Ilaria","Serena","Chiara","Silvia","Elena","Elisa","Francesca","Alessia","Federica","Giorgia","Martina","Giulia","Sara","Alice","Veronica","Eleonora","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Monica","Manuela","Michela","Simona","Stefania","Claudia","Valeria","Roberta","Laura","Cristina","Daniela","Paola","Alessandra","Cecilia","Letizia","Marta","Elisabetta","Raffaella","Gabriella","Cinzia","Nadia","Donatella","Lorella","Susanna","Simonetta","Marina","Rossella","Sandra","Loretta","Orietta","Fiorella","Isabella","Gigliola","Margherita","Agnese"],TD=["Valentina","Francesca","Alessandra","Chiara","Silvia","Elena","Laura","Cristina","Roberta","Sara","Giulia","Martina","Alice","Ilaria","Serena","Federica","Michela","Simona","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Eleonora","Veronica","Elisa","Giorgia","Alessia","Noemi","Giada","Aurora","Sofia","Ludovica","Ginevra","Beatrice","Matilde","Vittoria","Emma","Nicole","Gaia","Camilla","Bianca","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Katia","Debora","Erika","Pamela","Samantha","Moira","Natascia","Tamara","Tatiana","Jessica","Greta","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel"],SD=["Giulia","Chiara","Martina","Sara","Francesca","Alessia","Silvia","Valentina","Alice","Federica","Giorgia","Elena","Laura","Elisa","Ilaria","Eleonora","Serena","Roberta","Cristina","Veronica","Simona","Michela","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Noemi","Giada","Aurora","Sofia","Ludovica","Ginevra","Beatrice","Matilde","Vittoria","Emma","Nicole","Gaia","Camilla","Bianca","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Anna","Maria","Greta","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel","Emily","Jennifer","Jasmine","Luna","Maya","Mia","Michelle","Siria","Sole","Stella","Viola","Virginia","Zoe","Adele","Agata"],kD=["Giulia","Sofia","Martina","Sara","Chiara","Aurora","Alice","Alessia","Francesca","Giorgia","Ginevra","Ludovica","Greta","Gaia","Emma","Beatrice","Matilde","Vittoria","Noemi","Giada","Elena","Elisa","Anna","Maria","Nicole","Valentina","Federica","Silvia","Laura","Ilaria","Eleonora","Serena","Roberta","Cristina","Veronica","Simona","Michela","Manuela","Monica","Daniela","Paola","Barbara","Stefania","Claudia","Valeria","Arianna","Melissa","Vanessa","Sabrina","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Rachele","Rebecca","Angelica","Benedetta","Costanza","Diletta","Lucrezia","Marta","Miriam","Asia","Desiree","Sharon","Denise","Chanel","Emily","Jennifer","Jasmine","Luna","Maya","Mia","Michelle","Siria","Sole","Stella","Viola","Virginia","Zoe","Adele","Agata","Ambra","Cecilia"],LD=["Sofia","Aurora","Giulia","Ginevra","Alice","Giorgia","Emma","Greta","Martina","Beatrice","Matilde","Ludovica","Vittoria","Nicole","Chiara","Anna","Sara","Bianca","Gaia","Noemi","Francesca","Alessia","Elena","Elisa","Maria","Adele","Viola","Mia","Ambra","Cecilia","Margherita","Linda","Eleonora","Elisabetta","Valeria","Veronica","Vanessa","Sabrina","Pamela","Debora","Nadia","Sonia","Tiziana","Loredana","Antonella","Annamaria","Mariangela","Rosaria","Concetta","Assunta","Domenica","Vincenza","Filomena","Maddalena","Teresa","Lucia","Carmela","Caterina","Antonietta","Carla","Rita","Franca","Marinella","Silvana","Patrizia","Luisa","Ilaria","Monica","Manuela","Michela","Simona","Barbara","Agnese","Anita","Isabel","Chloe","Emily","Luna","Sole","Stella","Azzurra","Gioia","Diletta","Benedetta","Costanza","Angelica","Lucrezia","Marta","Miriam","Rachele","Rebecca","Serena","Zoe","Agata","Cloe","Dafne","Diana","Eva","Flora","Frida","Glenda","Irene","Iris"],RD=class extends td{getFirstNamesMaleJson(){return[]}getFirstNamesFemaleJson(){return[]}getLastNamesJson(){return AD}getFirstNamesMaleByDecade(){return[{startYear:1950,endYear:1959,names:pD},{startYear:1960,endYear:1969,names:yD},{startYear:1970,endYear:1979,names:ED},{startYear:1980,endYear:1989,names:bD},{startYear:1990,endYear:1999,names:ID},{startYear:2e3,endYear:2009,names:vD},{startYear:2010,endYear:2019,names:wD}]}getFirstNamesFemaleByDecade(){return[{startYear:1950,endYear:1959,names:CD},{startYear:1960,endYear:1969,names:ND},{startYear:1970,endYear:1979,names:xD},{startYear:1980,endYear:1989,names:TD},{startYear:1990,endYear:1999,names:SD},{startYear:2e3,endYear:2009,names:kD},{startYear:2010,endYear:2019,names:LD}]}},DD=class{static normalizeBirthDate(r){if(!r||r.trim()===""||r.startsWith("0001-01-01"))return"";const e=r.trim(),a=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(a){const[,s,c,d]=a;return`${s}-${c}-${d}`}const i=new Date(e);if(!isNaN(i.getTime())){const s=i.getFullYear().toString().padStart(4,"0"),c=(i.getMonth()+1).toString().padStart(2,"0"),d=i.getDate().toString().padStart(2,"0");return`${s}-${c}-${d}`}return""}static isValidBirthDate(r){if(!r||r.trim()===""||r.startsWith("0001-01-01"))return!1;const e=new Date(r);return isNaN(e.getTime())?!1:e.getFullYear()>1&&e.getFullYear()<9999}};function BD(r){if(r==="random"||!r)return null;const e=r.split("-");if(e.length!==2)return null;const a=parseInt(e[0],10),i=parseInt(e[1],10);if(isNaN(a)||isNaN(i))return null;const s=new Date().getFullYear(),c=Math.floor((a+i)/2),d=s-c,m=Math.floor((i-a)/2);return{targetYear:d,yearDeviation:m}}var UD=r=>{switch(r.toLowerCase()){case"en":return new fE;case"nl":return new XR;case"de":return new hD;case"it":return new RD;default:return console.warn(`Language '${r}' is not supported. Falling back to English.`),new fE}};const _D=()=>{const r=Ft(),[e,a]=w.useState({username:null,password:null,email:null}),i=w.useCallback(async()=>{if(!(r!=null&&r.sqliteClient))throw new Error("Database not initialized");const d=r.sqliteClient.settings.getEffectiveIdentityLanguage(),m=UD(d),g=r.sqliteClient.settings.getPasswordSettings(),f=dh(g);return{identityGenerator:m,passwordGenerator:f}},[r==null?void 0:r.sqliteClient]),s=w.useCallback(async()=>{if(!(r!=null&&r.sqliteClient))return null;try{const{identityGenerator:d,passwordGenerator:m}=await i(),g=r.sqliteClient.settings.getDefaultIdentityGender(),f=r.sqliteClient.settings.getDefaultIdentityAgeRange(),E=BD(f),p=d.generateRandomIdentity(g,E),C=m.generateRandomPassword(),I=r.sqliteClient.settings.getDefaultEmailDomain(),x=I?`${p.emailPrefix}@${I}`:p.emailPrefix,T={email:x,firstName:p.firstName,lastName:p.lastName,gender:p.gender,birthdate:DD.normalizeBirthDate(p.birthDate.toISOString()),username:p.nickName,password:C};return a({username:p.nickName,password:C,email:x}),T}catch(d){return console.error("Error generating random alias:",d),null}},[r==null?void 0:r.sqliteClient,i]),c=w.useCallback(()=>new ph().generateRandomEmailPrefix(),[]);return{generateAlias:s,generateRandomEmailPrefix:c,lastGeneratedValues:e,setLastGeneratedValues:a}},MD=({formId:r,isLoading:e,formData:a,onRestore:i,skipRestore:s=!1})=>{const c=w.useRef(!1),d=w.useCallback(async()=>{if(e)return;await lt("PERSIST_FORM_VALUES",JSON.stringify({formId:r,data:a}),"background")},[r,a,e]),m=w.useCallback(async()=>{if(s||c.current)return!1;const f=await lt("GET_PERSISTED_FORM_VALUES",null,"background");try{if(!f)return!1;let E=null;try{E=JSON.parse(f)}catch(C){return console.error("Error parsing persisted form data:",C),!1}return E.formId===r?(c.current=!0,i(E.data),!0):!1}catch(E){return console.error("Error loading persisted form data:",E),!1}},[r,i,s]),g=w.useCallback(async()=>{await lt("CLEAR_PERSISTED_FORM_VALUES",null,"background")},[]);return w.useEffect(()=>{e||d()},[e,d]),w.useEffect(()=>()=>{g()},[g]),{loadPersistedValues:m,clearPersistedValues:g,persistFormValues:d}},Dn={username:["username","login","identifier","user"],fullName:["fullname","full-name","full name"],firstName:["firstname","first-name","first_name","fname","name","given-name"],lastName:["lastname","last-name","last_name","lname","surname","family-name"],email:["email","mail","emailaddress"],emailConfirm:["confirm","verification","repeat","retype","verify","email2"],password:["password","pwd","pass"],birthdate:["birthdate","birth-date","dob","date-of-birth"],gender:["gender","sex"],birthDateDay:["-day","birthdate_d","birthdayday","_day","day"],birthDateMonth:["-month","birthdate_m","birthdaymonth","_month","month"],birthDateYear:["-year","birthdate_y","birthdayyear","_year","year"]},ug={male:["male","man","m","gender1","mr","mr."],female:["female","woman","f","gender2","mrs","mrs.","ms","ms."],other:["other","diverse","custom","prefer not","unknown","gender3"]},FD=new Set(["login","signin","sign","register","signup","account","authentication","password","access","auth","session","authenticate","credentials","logout","signout","portal","dashboard","home","welcome","page","site","secure","member","user","profile","settings","menu","overview","index","main","start","landing","free","create","new","your","special","offer","deal","discount","promotion","newsletter","help","support","contact","about","faq","terms","privacy","cookie","service","services","products","shop","store","cart","checkout","online","web","digital","mobile","my","personal","private","general","default","standard","website","system","admin","administrator","platform","portal","gateway","api","interface","console","today","now","current","latest","newest","recent","the","and","or","but","to","up"]),Bn={username:["gebruikersnaam","gebruiker","login","identifier"],fullName:["volledige naam"],firstName:["voornaam","naam"],lastName:["achternaam"],email:["e-mailadres","e-mail"],emailConfirm:["bevestig","herhaal","verificatie"],password:["wachtwoord","pwd"],birthdate:["geboortedatum","geboorte-datum"],gender:["geslacht","aanhef"],birthDateDay:["dag"],birthDateMonth:["maand"],birthDateYear:["jaar"]},dg={male:["man","mannelijk","heer"],female:["vrouw","vrouwelijk","mevrouw"],other:["anders","iets","overig","onbekend"]},OD=new Set(["inloggen","registreren","registratie","aanmelden","inschrijven","uitloggen","wachtwoord","toegang","authenticatie","account","portaal","overzicht","startpagina","welkom","pagina","beveiligd","lid","gebruiker","profiel","instellingen","menu","begin","hoofdpagina","gratis","nieuw","jouw","schrijf","nieuwsbrief","aanbieding","korting","speciaal","actie","hulp","ondersteuning","contact","over","voorwaarden","privacy","cookie","dienst","diensten","producten","winkel","bestellen","winkelwagen","online","web","digitaal","mobiel","mijn","persoonlijk","privé","algemeen","standaard","systeem","beheer","beheerder","platform","portaal","interface","console","vandaag","nu","huidig","recent","nieuwste","je","in","op","de","van","ons","allemaal"]),Ra={username:[...new Set([...Dn.username,...Bn.username])],fullName:[...new Set([...Dn.fullName,...Bn.fullName])],firstName:[...new Set([...Dn.firstName,...Bn.firstName])],lastName:[...new Set([...Dn.lastName,...Bn.lastName])],email:[...new Set([...Bn.email,...Dn.email])],emailConfirm:[...new Set([...Dn.emailConfirm,...Bn.emailConfirm])],password:[...new Set([...Dn.password,...Bn.password])],birthdate:[...new Set([...Dn.birthdate,...Bn.birthdate])],gender:[...new Set([...Dn.gender,...Bn.gender])],birthDateDay:[...new Set([...Dn.birthDateDay,...Bn.birthDateDay])],birthDateMonth:[...new Set([...Dn.birthDateMonth,...Bn.birthDateMonth])],birthDateYear:[...new Set([...Dn.birthDateYear,...Bn.birthDateYear])]},bl={male:[...new Set([...ug.male,...dg.male])],female:[...new Set([...ug.female,...dg.female])],other:[...new Set([...ug.other,...dg.other])]},gE=new Set([...FD,...OD]);class hE{constructor(e,a){Fe(this,"document");Fe(this,"clickedElement");Fe(this,"visibilityCache");this.document=e,this.clickedElement=a??null,this.visibilityCache=new Map}containsLoginForm(){let e=this.getFormWrapper();return(e==null?void 0:e.getAttribute("role"))==="dialog"&&(e=e.querySelector("form")??e),e||(e=this.document.body),e.querySelectorAll("input").length>200?!1:!!(this.containsPasswordField(e)||this.containsLikelyUsernameOrEmailField(e))}getForm(){if(!this.clickedElement)return null;const e=this.getFormWrapper();return this.detectFormFields(e)}static getSuggestedServiceName(e,a){const i=e.title,s=4,c=50,d=x=>{const T=x.length>=3&&x.length<=c,k=x.split(/[\s|\-—/\\]+/).length<=s;return T&&k},m=x=>{const T=x.toLowerCase().split(" ").map(B=>B.toLowerCase());let k=0;for(;k<T.length&&gE.has(T[k].toLowerCase());)k++;let R=T.length-1;for(;R>k&&gE.has(T[R].toLowerCase());)R--;return T.slice(k,R+1)},g=(x,T)=>x.split(/[\s|]+/).filter(k=>T.includes(k.toLowerCase())).join(" "),f=a.hostname.replace(/^www\./,""),p=/[|\-—/\\:]/.exec(i);if(p){const x=p.index,T=i.substring(0,x).trim(),k=i.substring(x+1).trim(),R=m(T),B=m(k),S=g(T,R),j=g(k,B),_=d(S),P=d(j);if(_&&P)return[S,j,f];if(_)return[S,f];if(P)return[j,f]}const C=m(i),I=g(i,C);return d(I)?[I,f]:[f]}getFormWrapper(){var e;return(e=this.clickedElement)==null?void 0:e.closest('form, [role="dialog"]')}getActualInputElement(e){if(e.tagName.toLowerCase()==="input")return e;const a=e;if(a.shadowRoot){const s=a.shadowRoot.querySelector("input, textarea");if(s)return s}const i=e.querySelector("input, textarea");return i||e}isElementVisible(e){var i;if(!e)return!1;if(this.visibilityCache.has(e))return this.visibilityCache.get(e);let a=e;for(;a;){try{const s=(i=this.document.defaultView)==null?void 0:i.getComputedStyle(a);if(!s){let c=a;for(;c;)this.visibilityCache.set(c,!0),c=c.parentElement;return!0}if(s.display==="none"){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}if(s.visibility==="hidden"){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}if(parseFloat(s.opacity)===0){let c=a;for(;c;)this.visibilityCache.set(c,!1),c=c.parentElement;return!1}}catch{let s=a;for(;s;)this.visibilityCache.set(s,!0),s=s.parentElement;return!0}a=a.parentElement}return this.visibilityCache.set(e,!0),!0}findAllInputFields(e,a,i,s=[]){var p,C,I,x,T,k,R,B;const c=e?Array.from(e.querySelectorAll("input, select, [type]")):Array.from(this.document.querySelectorAll("input, select, [type]")),m=(e?Array.from(e.querySelectorAll("*")):Array.from(this.document.querySelectorAll("*"))).filter(S=>{const j=S;return j.shadowRoot?j.shadowRoot.querySelector("input, textarea")!==null:!1}),f=[...c,...m].filter((S,j,_)=>_.indexOf(S)===j),E=[];for(const S of Array.from(f)){if(s.includes(S)||!this.isElementVisible(S))continue;let _=S.tagName.toLowerCase()==="select"?"select":((p=S.type)==null?void 0:p.toLowerCase())||((C=S.getAttribute("type"))==null?void 0:C.toLowerCase())||"";const P=S,K=P.shadowRoot&&P.shadowRoot.querySelector("input, textarea");if(K&&!_){const W=P.shadowRoot.querySelector("input, textarea");W&&(_=((I=W.type)==null?void 0:I.toLowerCase())||"text")}if(!i.includes(_)&&!(K&&i.includes("text")&&!_))continue;if(i.includes("email")&&_==="email"){E.push({input:S,score:-1});continue}const H=[S.id,S.getAttribute("name"),S.getAttribute("placeholder")].map(W=>(W==null?void 0:W.toLowerCase())??"");if(S.id||S.getAttribute("name")){const W=this.document.querySelector(`label[for="${S.id||S.getAttribute("name")}"]`);W&&H.push(((x=W.textContent)==null?void 0:x.toLowerCase())??"")}let Q=S;for(let W=0;W<3&&Q;W++){const ne=Q.querySelectorAll('[slot="label"], [slot="helper-text"]');for(const de of Array.from(ne)){const X=((T=de.textContent)==null?void 0:T.toLowerCase())??"";X&&H.push(X)}if(Q.shadowRoot){const de=Q.shadowRoot.querySelectorAll('slot[name="label"], slot[name="helper-text"]');for(const X of Array.from(de)){const ae=X.assignedNodes();for(const pe of ae)pe.textContent&&H.push(pe.textContent.toLowerCase())}}Q=Q.parentElement}const V=S.parentElement;if(V)for(const W of Array.from(V.children))W!==S&&Array.from(W.classList).some(ne=>ne.toLowerCase().includes("label"))&&H.push(((k=W.textContent)==null?void 0:k.toLowerCase())??"");let G=S;for(let W=0;W<5&&G&&!(G.children.length>15);W++){const ne=G.querySelector("label");if(ne){H.push(((R=ne.textContent)==null?void 0:R.toLowerCase())??"");break}const de=G.closest("td");if(de){const X=de.closest("tr");if(X){for(const ae of Array.from(X.querySelectorAll("td")))if(ae!==de){H.push(((B=ae.textContent)==null?void 0:B.toLowerCase())??"");break}}break}G=G.parentElement}let q=a.length;for(let W=0;W<a.length;W++)if(H.some(ne=>ne.includes(a[W]))){q=W;break}q<a.length&&E.push({input:S,score:q})}return E.sort((S,j)=>S.score-j.score).map(S=>S.input)}findInputField(e,a,i,s=[]){const c=this.findAllInputFields(e,a,i,s),d=this.filterOutNestedDuplicates(c,s);if(i.includes("email")){const m=d.find(g=>(g.type||"").toLowerCase()==="email");if(m)return m}return d.length>0?d[0]:null}findEmailField(e){const a=this.findAllInputFields(e,Ra.email,["text","email"]),s=this.filterOutNestedDuplicates(a)[0]??null,c=s?this.findAllInputFields(e,Ra.emailConfirm,["text","email"],[s]):[],m=this.filterOutNestedDuplicates(c)[0]??null;return{primary:s,confirm:m}}findBirthdateFields(e,a=[]){const i=this.findInputField(e,Ra.birthdate,["date","text"],a);let s="yyyy-mm-dd";if(e&&i){const g=i.closest("div");if(g){const E=[...Array.from(g.getElementsByTagName("label")),...Array.from(g.getElementsByTagName("span")),g].map(p=>{var C;return((C=p.textContent)==null?void 0:C.toLowerCase())??""}).join(" ").replace(/[\s\u00A0]/g,"").toLowerCase();if(/dd[-/]mm[-/]jj/i.test(E)||/dd[-/]mm[-/]yyyy/i.test(E)?s=E.includes("/")?"dd/mm/yyyy":"dd-mm-yyyy":/mm[-/]dd[-/]yyyy/i.test(E)?s=E.includes("/")?"mm/dd/yyyy":"mm-dd-yyyy":/yyyy[-/]mm[-/]dd/i.test(E)&&(s=E.includes("/")?"yyyy/mm/dd":"yyyy-mm-dd"),s==="yyyy-mm-dd"&&i.placeholder){const p=i.placeholder.toLowerCase();/dd[-/]mm/i.test(p)?s=p.includes("/")?"dd/mm/yyyy":"dd-mm-yyyy":/mm[-/]dd/i.test(p)&&(s=p.includes("/")?"mm/dd/yyyy":"mm-dd-yyyy")}}}if(i)return{single:i,format:s,day:null,month:null,year:null};const c=this.findInputField(e,Ra.birthDateDay,["text","number","select"],a),d=this.findInputField(e,Ra.birthDateMonth,["text","number","select"],a),m=this.findInputField(e,Ra.birthDateYear,["text","number","select"],a);return{single:null,format:"yyyy-mm-dd",day:c,month:d,year:m}}findGenderField(e,a=[]){const i=this.findInputField(e,Ra.gender,["select"],a);if((i==null?void 0:i.tagName.toLowerCase())==="select")return{type:"select",field:i};const s=e?e.querySelectorAll('input[type="radio"][name*="gender"], input[type="radio"][name*="sex"]'):null;if(s&&s.length>0){const d=(m,g=!1)=>Array.from(s).find(f=>{var p,C;const E=[f.value,f.id,f.name,((C=(p=f.labels)==null?void 0:p[0])==null?void 0:C.textContent)??""].map(I=>(I==null?void 0:I.toLowerCase())??"");return g&&(bl.male.some(I=>E.some(x=>x.includes(I)))||bl.female.some(I=>E.some(x=>x.includes(I))))?!1:m.some(I=>E.some(x=>x.includes(I)))})??null;return{type:"radio",field:null,radioButtons:{male:d(bl.male),female:d(bl.female),other:d(bl.other)}}}return{type:"text",field:this.findInputField(e,Ra.gender,["text"],a)}}filterOutNestedDuplicates(e,a=[]){if(e.length===0)return e;const i=[];for(const s of e){let c=!0;for(const d of a){if(s===d){c=!1;break}if(d.contains(s)){c=!1;break}if(s.contains(d)){c=!1;break}const m=s,g=d;if(g.shadowRoot&&g.shadowRoot.contains(s)){c=!1;break}if(m.shadowRoot&&m.shadowRoot.contains(d)){c=!1;break}const f=this.getActualInputElement(s),E=this.getActualInputElement(d);if(f===E){c=!1;break}}if(c){for(const d of e)if(s!==d){if(s.contains(d)){c=!1;break}const m=s;if(m.shadowRoot&&m.shadowRoot.contains(d)){c=!1;break}}if(c){const d=this.getActualInputElement(s);if(d!==s&&e.includes(d))continue;i.push(s)}}}return i}findPasswordField(e){const a=this.findAllInputFields(e,Ra.password,["password"]),i=this.filterOutNestedDuplicates(a);return{primary:i[0]??null,confirm:i[1]??null}}containsPasswordField(e){const a=this.findPasswordField(e);return!!(a.primary&&this.isElementVisible(a.primary))}containsLikelyUsernameOrEmailField(e){const a=this.findEmailField(e);if(a.primary&&this.isElementVisible(a.primary))return!0;const i=this.findInputField(e,Ra.username,["text"],[]);if(i&&this.isElementVisible(i))return!0;const s=this.findInputField(e,Ra.firstName,["text"],[]);if(s&&this.isElementVisible(s))return!0;const c=this.findInputField(e,Ra.lastName,["text"],[]);return!!(c&&this.isElementVisible(c))}isAutofillTriggerableField(){const e=this.getFormWrapper();if(!this.clickedElement)return!1;const a=this.getActualInputElement(this.clickedElement),i=[this.clickedElement,a].filter((m,g,f)=>m&&f.indexOf(m)===g);if(this.findAllInputFields(e,Ra.username,["text"]).some(m=>i.includes(m)))return!0;const c=this.findPasswordField(e);return!!(c.primary&&i.includes(c.primary)||c.confirm&&i.includes(c.confirm)||this.findAllInputFields(e,Ra.email,["text","email"]).some(m=>i.includes(m)))}detectFormFields(e){const a=[],i=this.findEmailField(e);i.primary&&a.push(i.primary),i.confirm&&a.push(i.confirm);const s=this.findPasswordField(e);s.primary&&a.push(s.primary),s.confirm&&a.push(s.confirm);const c=this.findInputField(e,Ra.username,["text"],a);c&&a.push(c);const d=this.findInputField(e,Ra.fullName,["text"],a);d&&a.push(d);const m=this.findInputField(e,Ra.lastName,["text"],a);m&&a.push(m);const g=this.findInputField(e,Ra.firstName,["text"],a);g&&a.push(g);const f=this.findBirthdateFields(e,a);f.single&&a.push(f.single),f.day&&a.push(f.day),f.month&&a.push(f.month),f.year&&a.push(f.year);const E=this.findGenderField(e,a);return E.field&&a.push(E.field),{form:e,emailField:i.primary,emailConfirmField:i.confirm,usernameField:c,passwordField:s.primary,passwordConfirmField:s.confirm,fullNameField:d,firstNameField:g,lastNameField:m,birthdateField:f,genderField:E}}}class AE{static getServiceInfo(e,a){const i=hE.getSuggestedServiceName(e,a),s=a.href;let c="";try{const d=new URL(s);(d.protocol==="http:"||d.protocol==="https:")&&(c=d.origin+d.pathname,c.endsWith("/")&&(c=c.slice(0,-1)))}catch(d){console.error("Error parsing current URL:",d)}return{suggestedNames:i,currentUrl:s,serviceUrl:c,domain:a.hostname.replace(/^www\./,"")}}static getServiceInfoFromTab(e,a){try{const i=new URL(e),s={href:e,hostname:i.hostname,protocol:i.protocol,pathname:i.pathname,origin:i.origin},c={title:a||i.hostname},d=hE.getSuggestedServiceName(c,s);let m="";return(i.protocol==="http:"||i.protocol==="https:")&&(m=i.origin+i.pathname,m.endsWith("/")&&(m=m.slice(0,-1))),{suggestedNames:d,currentUrl:e,serviceUrl:m,domain:i.hostname.replace(/^www\./,"")}}catch(i){console.error("Error parsing tab URL:",i);const s=e.replace(/^https?:\/\/(www\.)?/,"").split("/")[0];return{suggestedNames:[s],currentUrl:e,serviceUrl:e,domain:s}}}static getEncodedServiceInfo(e,a){const i=this.getServiceInfo(e,a);return{serviceName:i.suggestedNames.length>0?encodeURIComponent(i.suggestedNames[0]):"",serviceUrl:i.serviceUrl?encodeURIComponent(i.serviceUrl):"",currentUrl:encodeURIComponent(i.currentUrl),domain:encodeURIComponent(i.domain)}}static getEncodedServiceInfoFromTab(e,a){const i=this.getServiceInfoFromTab(e,a);return{serviceName:i.suggestedNames.length>0?encodeURIComponent(i.suggestedNames[0]):"",serviceUrl:i.serviceUrl?encodeURIComponent(i.serviceUrl):"",currentUrl:encodeURIComponent(i.currentUrl),domain:encodeURIComponent(i.domain)}}}const jD=()=>{const[r]=gb();return{detectService:w.useCallback(async a=>{let i=a||"",s="";try{const c=r.get("serviceName"),d=r.get("serviceUrl"),m=r.get("currentUrl");if(c||d||m){if(c&&(i=decodeURIComponent(c)),d&&(s=decodeURIComponent(d)),m&&(!c||!d)){const g=decodeURIComponent(m),f=AE.getServiceInfoFromTab(g);!c&&f.suggestedNames.length>0&&(i=f.suggestedNames[0]),!d&&f.serviceUrl&&(s=f.serviceUrl)}}else{const[g]=await zr.tabs.query({active:!0,currentWindow:!0});if(g!=null&&g.url){const f=AE.getServiceInfoFromTab(g.url,g.title);f.suggestedNames.length>0&&!i&&(i=f.suggestedNames[0]),f.serviceUrl&&(s=f.serviceUrl)}}}catch(c){console.error("Error detecting service information:",c)}return{serviceName:i,serviceUrl:s}},[r])}},PD=5e3;class ki{static extractSourceFromUrl(e){if(!e)return"unknown";try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase().replace(/^www\./,"")}catch{return"unknown"}}static normalizeUrl(e){if(!e)return;const a=e.trim();if(a&&!(!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("www.")))return a.startsWith("www.")?`https://${a}`:a}static extractFirstValidUrl(e){if(!e)return;const i=(Array.isArray(e)?e:[e]).find(s=>{const c=s==null?void 0:s.trim();return c&&(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("www."))});return ki.normalizeUrl(i)}static hasLogoForUrl(e,a){if(!e)return!1;const i=ki.extractSourceFromUrl(e);return i==="unknown"?!1:a.logos.hasLogoForSource(i)}static async fetchFavicon(e,a,i,s=PD){const c=ki.normalizeUrl(e);if(!c)return{success:!1,error:"Invalid URL"};const d=ki.extractSourceFromUrl(c);if(d==="unknown")return{success:!1,error:"Could not extract domain from URL"};if(a.logos.hasLogoForSource(d))return{success:!1,skipped:!0};try{const m=new Promise((E,p)=>setTimeout(()=>p(new Error("Favicon extraction timed out")),s)),g=i.get(`Favicon/Extract?url=${encodeURIComponent(c)}`),f=await Promise.race([g,m]);return f!=null&&f.image?{success:!0,imageData:Uint8Array.from(so.Buffer.from(f.image,"base64"))}:{success:!1,error:"No favicon returned from server"}}catch(m){const g=m instanceof Error?m.message:"Unknown error";return console.error("[Favicon] Error extracting favicon:",g),{success:!1,error:g}}}static async fetchAndAttachFavicon(e,a,i,s){const c=ki.extractFirstValidUrl(a);if(!c)return{...e,Logo:void 0};const d=await ki.fetchFavicon(c,i,s);return d.success&&d.imageData?{...e,Logo:d.imageData}:e}}const HD=[Xt.Login,Xt.Alias,Xt.CreditCard,Xt.Note],QD=Xt.Login,pE=()=>{const{t:r}=Ge(),{id:e}=Ku(),[a]=gb(),i=pa(),s=Ft(),c=e!==void 0&&e.length>0,d=a.get("type"),m=a.get("name"),g=a.get("folderId"),{executeVaultMutationAsync:f}=go(),{setHeaderButtons:E}=Kn(),{setIsInitialLoading:p}=na(),{generateAlias:C,generateRandomEmailPrefix:I,lastGeneratedValues:x}=_D(),{detectService:T}=jD(),k=zn(),[R,B]=w.useState(!0),[S,j]=w.useState(!1),[_,P]=w.useState(null),[K,H]=w.useState({}),[Q,V]=w.useState([]),[G,q]=w.useState([]),[W,ne]=w.useState(!1),[de,X]=w.useState(!1),[ae,pe]=w.useState(!1),Ae=w.useRef(!1),O=w.useRef(null),[$,Z]=w.useState(!1),[ce,be]=w.useState(new Set),[Le,ke]=w.useState(new Set),[Se,Te]=w.useState([]),[Oe,Ne]=w.useState([]),[je,ht]=w.useState({isAddFormVisible:!1,formData:{name:"",secretKey:""}}),[Ye,rt]=w.useState([]),[la,ve]=w.useState([]),[Re,$e]=w.useState([]),[qe,dt]=w.useState(!0),[Je,At]=w.useState(void 0),[Ot]=w.useState(!1),Wt=w.useCallback(ie=>{ie.item&&P(ie.item),ie.fieldValues&&H(ie.fieldValues),ie.customFields&&V(ie.customFields),ie.totpEditorState&&ht(ie.totpEditorState),ie.show2FA!==void 0&&X(ie.show2FA),ie.showAttachments!==void 0&&pe(ie.showAttachments),ie.manuallyAddedFields&&be(new Set(ie.manuallyAddedFields)),ie.isLoginEmailInEmailMode!==void 0&&dt(ie.isLoginEmailInEmailMode),ie.passwordSettings!==void 0&&At(ie.passwordSettings)},[]),{loadPersistedValues:Zt,clearPersistedValues:ya}=MD({formId:e||null,isLoading:R,formData:{item:_,fieldValues:K,customFields:Q,totpEditorState:je,show2FA:de,showAttachments:ae,manuallyAddedFields:Array.from(ce),isLoginEmailInEmailMode:qe,passwordSettings:Je},onRestore:Wt,skipRestore:Ot}),U=w.useMemo(()=>_?X1(_.ItemType):[],[_]),v=w.useMemo(()=>U.find(ie=>ie.FieldKey==="notes.content"),[U]),N=w.useMemo(()=>_?$1(_.ItemType):[],[_]),z=w.useMemo(()=>{const ie=new Set;return U.forEach(Ue=>{_&&wl(Ue,_.ItemType)&&ie.add(Ue.FieldKey)}),ce.forEach(Ue=>ie.add(Ue)),Le.forEach(Ue=>ie.add(Ue)),Object.keys(K).forEach(Ue=>{const Be=K[Ue];Be&&(Array.isArray(Be)?Be.length>0:Be.toString().trim()!=="")&&ie.add(Ue)}),ie},[_,U,ce,Le,K]),te=w.useCallback(ie=>{if(!_)return!1;if(ce.has(ie.FieldKey)||Le.has(ie.FieldKey))return!0;const Ue=U.find(Be=>Be.FieldKey===ie.FieldKey);return Ue?wl(Ue,_.ItemType):!0},[_,U,ce,Le]),fe=w.useMemo(()=>U.filter(ie=>ie.Category===nt.Primary),[U]),ye=w.useMemo(()=>{const ie={};return U.forEach(Ue=>{if(Ue.Category===nt.Notes||Ue.Category===nt.Metadata||Ue.Category===nt.Primary)return;const Be=Ue.Category;ie[Be]||(ie[Be]=[]),ie[Be].push(Ue)}),ie},[U]);w.useEffect(()=>{if(!(s!=null&&s.sqliteClient)||!e||!c){const ie=d&&HD.includes(d)?d:QD;(async()=>{const{serviceName:Be,serviceUrl:Ze}=await T(m),Tt={Id:crypto.randomUUID().toUpperCase(),Name:Be,ItemType:ie,FolderId:g||null,Fields:[],CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString()};if(P(Tt),dt(ie===Xt.Login),Ze&&H(it=>({...it,"login.url":Ze})),s!=null&&s.sqliteClient){const it=s.sqliteClient.folders.getAll();q(it)}(await zr.storage.local.get([Df]))[Df]?await zr.storage.local.remove([Df]):await Zt(),B(!1),p(!1)})();return}try{const ie=s.sqliteClient.items.getById(e);if(ie){P(ie);const Ue=s.sqliteClient.folders.getAll();q(Ue);const Be={},Ze=[],Tt=new Set;ie.Fields.forEach(st=>{Be[st.FieldKey]=st.Value,Tt.add(st.FieldKey),st.IsCustomField&&Ze.push({tempId:st.FieldKey,label:st.Label,fieldType:st.FieldType,isHidden:st.IsHidden,displayOrder:st.DisplayOrder})}),H(Be),V(Ze),ke(Tt);const yt=s.sqliteClient.settings.getTotpCodesForItem(e);Te(yt),Ne(yt.map(st=>st.Id)),yt.length>0&&X(!0);const it=s.sqliteClient.settings.getAttachmentsForItem(e);rt(it),ve(it.map(st=>st.Id)),it.length>0&&pe(!0),B(!1),p(!1)}else console.error("Item not found"),i("/items")}catch(ie){console.error("Error loading item:",ie),B(!1),p(!1)}},[s==null?void 0:s.sqliteClient,e,c,d,m,g,i,p,T,Zt]);const De=w.useCallback(async()=>{const ie=await C();ie&&(H(Ue=>{const Be=Ue["login.username"]||"",Ze=Ue["login.password"]||"",Tt=Ue["login.email"]||"",yt={...Ue,"alias.first_name":ie.firstName,"alias.last_name":ie.lastName,"alias.gender":ie.gender,"alias.birthdate":ie.birthdate};return(!Tt||Tt===x.email)&&(yt["login.email"]=ie.email),(!Be||Be===x.username)&&(yt["login.username"]=ie.username),(!Ze||Ze===x.password)&&(yt["login.password"]=ie.password),yt}),Z(!0))},[C,x]),Nt=w.useCallback(()=>{if(!(s!=null&&s.sqliteClient))return;const ie=K["alias.first_name"]||"",Ue=K["alias.last_name"]||"";let Be;if(!ie.trim()&&!Ue.trim())Be=I();else{const yt=K["alias.gender"]||gI.Other,it=K["alias.birthdate"]||"";Be=new ph().generateEmailPrefix({firstName:ie,lastName:Ue,gender:yt,birthDate:it?new Date(it):new Date,emailPrefix:"",nickName:""})}const Ze=s.sqliteClient.settings.getDefaultEmailDomain(),Tt=Ze?`${Be}@${Ze}`:Be;H(yt=>({...yt,"login.email":Tt}))},[s==null?void 0:s.sqliteClient,K,I]),xt=w.useCallback(()=>{if(!(s!=null&&s.sqliteClient))return;const ie=I(),Ue=s.sqliteClient.settings.getDefaultEmailDomain(),Be=Ue?`${ie}@${Ue}`:ie;H(Ze=>({...Ze,"login.email":Be}))},[s==null?void 0:s.sqliteClient,I]),St=w.useCallback(async()=>{const ie=await C();ie&&H(Ue=>({...Ue,"login.username":ie.username}))},[C]),mt=w.useMemo(()=>{if(!_)return!1;const ie=U.find(Ue=>Ue.FieldKey==="alias.first_name");return ie?wl(ie,_.ItemType):!1},[_,U]),Vr=w.useMemo(()=>U.some(ie=>ie.FieldKey==="login.username"||ie.FieldKey==="login.password"),[U]);w.useEffect(()=>{!c&&mt&&!R&&(s!=null&&s.sqliteClient)&&!Ae.current&&(Ae.current=!0,De())},[c,mt,R,s==null?void 0:s.sqliteClient,De]),w.useEffect(()=>{!c&&!R&&O.current&&O.current.focus()},[c,R]);const ca=w.useCallback((ie,Ue)=>{H(Be=>({...Be,[ie]:Ue}))},[]),Mn=w.useCallback(async()=>{if(_)try{const ie=[];U.forEach(Be=>{const Ze=K[Be.FieldKey];Ze&&(Array.isArray(Ze)?Ze.length>0:Ze.trim()!=="")&&ie.push({FieldKey:Be.FieldKey,Label:Be.FieldKey,FieldType:Be.FieldType,Value:Ze,IsHidden:Be.IsHidden,DisplayOrder:Be.DefaultDisplayOrder,IsCustomField:!1,EnableHistory:Be.EnableHistory})}),Q.forEach(Be=>{const Ze=K[Be.tempId]||"";ie.push({FieldKey:Be.tempId,Label:Be.label,FieldType:Be.fieldType,Value:Ze,IsHidden:Be.isHidden,DisplayOrder:Be.displayOrder,IsCustomField:!0,EnableHistory:!1})});let Ue={..._,Id:c?_.Id:crypto.randomUUID().toUpperCase(),Fields:ie,UpdatedAt:new Date().toISOString()};if(s!=null&&s.sqliteClient&&(B(!0),Ue=await ki.fetchAndAttachFavicon(Ue,K["login.url"],s.sqliteClient,k)),!(s!=null&&s.sqliteClient))throw new Error("Database not initialized");await f(async()=>{if(B(!1),c){if(await s.sqliteClient.items.update(Ue,la,Ye,Oe,Se),Re.length>0)for(const Be of Re)await s.sqliteClient.passkeys.deleteById(Be)}else await s.sqliteClient.items.create(Ue,Ye,Se)}),ya(),c?i(-1):i(`/items/${Ue.Id}`,{replace:!0})}catch(ie){console.error("Error saving item:",ie)}},[_,K,U,Q,s,c,f,i,la,Ye,Oe,Se,Re,k,ya]),Gn=w.useCallback(async()=>{if(!(!_||!c||!(s!=null&&s.sqliteClient)))try{await f(async()=>{await s.sqliteClient.items.trash(_.Id)}),i("/items")}catch(ie){console.error("Error deleting item:",ie)}finally{j(!1)}},[_,c,s,f,i]),gs=w.useCallback((ie,Ue)=>{const Ze={tempId:crypto.randomUUID(),label:ie,fieldType:Ue,isHidden:!1,displayOrder:U.length+Q.length+1};V(Tt=>[...Tt,Ze])},[U.length,Q.length]),_e=w.useCallback(ie=>{V(Ue=>Ue.filter(Be=>Be.tempId!==ie)),H(Ue=>{const Be={...Ue};return delete Be[ie],Be})},[]),hs=w.useCallback((ie,Ue)=>{V(Be=>Be.map(Ze=>Ze.tempId===ie?{...Ze,label:Ue}:Ze))},[]),Di=w.useCallback(ie=>{if(!_)return;const Ue=_.ItemType;!c&&Ue!==ie&&(H(Be=>{const Ze={};return Object.entries(Be).forEach(([Tt,yt])=>{const it=ro(Tt);it?xl(it,ie)&&(Ze[Tt]=yt):Ze[Tt]=yt}),Ze}),be(Be=>{const Ze=new Set;return Be.forEach(Tt=>{const yt=ro(Tt);(!yt||xl(yt,ie))&&Ze.add(Tt)}),Ze}),ke(Be=>{const Ze=new Set;return Be.forEach(Tt=>{const yt=ro(Tt);(!yt||xl(yt,ie))&&Ze.add(Tt)}),Ze})),Ae.current=!1,dt(ie===Xt.Login),P({..._,ItemType:ie,Fields:c?_.Fields:[]}),ne(!1)},[_,c]),xa=w.useCallback(()=>{H(ie=>({...ie,"notes.content":""})),be(ie=>{const Ue=new Set(ie);return Ue.delete("notes.content"),Ue})},[]),dr=w.useCallback(()=>{X(!0),ht({isAddFormVisible:!0,formData:{name:"",secretKey:""}})},[]),Kr=w.useCallback(()=>{pe(!0)},[]),qa=w.useCallback(ie=>{be(Ue=>new Set(Ue).add(ie))},[]),Kt=w.useMemo(()=>{const ie=[];return Vr&&ie.push({key:"2fa",isVisible:de,onAdd:dr}),ie.push({key:"attachments",isVisible:ae,onAdd:Kr}),ie},[Vr,de,ae,dr,Kr]),Ea=w.useCallback(ie=>{be(Ue=>{const Be=new Set(Ue);return Be.delete(ie),Be}),H(Ue=>{const Be={...Ue};return delete Be[ie],Be})},[]);w.useEffect(()=>{const ie=l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx(cn,{onClick:()=>j(!0),title:r("items.deleteItemTitle"),iconType:Ca.DELETE,variant:"danger"}),l.jsx(cn,{id:"save-credential",onClick:Mn,title:r("items.saveItem"),iconType:Ca.SAVE})]});return E(ie),()=>E(null)},[E,c,r,Mn]);const Gt=w.useCallback((ie,Ue,Be,Ze,Tt,yt)=>{const it=K[ie]||"";if(Tt){const Ut=Array.isArray(it)&&it.length>0?it:it?[it]:[""];return l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:Ue}),Ut.map((Wa,ra)=>l.jsxs("div",{className:"relative",children:[l.jsx("input",{id:`${ie}-${ra}`,type:"text",value:Wa,onChange:qr=>{const mr=[...Ut];mr[ra]=qr.target.value,ca(ie,mr.filter(Bi=>Bi.trim()!==""))},className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white"}),ra===Ut.length-1&&l.jsx("button",{type:"button",onClick:()=>ca(ie,[...Ut,""]),className:"absolute right-2 top-1/2 -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-400 hover:text-primary-500 dark:hover:text-primary-400 transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})})]},`${ie}-${ra}`))]})}const st=Array.isArray(it)?it[0]||"":it,un=(Ut,Wa=!0)=>yt?l.jsxs("div",{className:"relative",children:[Ut,l.jsx("button",{type:"button",onClick:yt,className:`absolute right-2 ${Wa?"top-[38px]":"top-1/2"} -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors`,title:r("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):Ut;switch(Be){case Vt.Password:return un(l.jsx(kL,{id:ie,label:Ue,value:st,onChange:Ut=>ca(ie,Ut),showPassword:$,onShowPasswordChange:Z,initialSettings:Je,onSettingsChange:At}));case Vt.Hidden:return un(l.jsx(xL,{id:ie,label:Ue,value:st,onChange:Ut=>ca(ie,Ut)}));case Vt.TextArea:return un(l.jsxs("div",{children:[Ue&&l.jsx("label",{htmlFor:ie,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:Ue}),l.jsx("textarea",{id:ie,value:st,onChange:Ut=>ca(ie,Ut.target.value),rows:4,className:`w-full px-3 py-2 ${yt?"pr-10":""} border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white`})]}));case Vt.Email:return l.jsx(CL,{id:ie,value:st,onChange:Ut=>ca(ie,Ut),onRemove:yt,onGenerateAlias:mt?Nt:xt,isEmailMode:qe,onEmailModeChange:dt});case Vt.URL:case Vt.Phone:case Vt.Number:case Vt.Date:case Vt.Text:default:return ie==="login.username"&&mt?l.jsx(LL,{id:ie,label:Ue,value:st,onChange:Ut=>ca(ie,Ut),onRegenerate:St}):un(l.jsx(Xu,{id:ie,label:Ue,value:st,onChange:Ut=>ca(ie,Ut),type:"text"}))}},[K,ca,$,r,Nt,xt,mt,St,qe,Je]),Gr=w.useCallback(ie=>{ie.preventDefault(),Mn()},[Mn]),qn=w.useCallback(ie=>{switch(ie){case nt.Login:return r("items.loginCredentials");case nt.Alias:return r("common.alias");case nt.Card:return r("items.cardInformation");default:return ie}},[r]),As=w.useCallback(ie=>ie===nt.Alias&&mt?l.jsx(l.Fragment,{children:l.jsx("button",{type:"button",onClick:De,className:"p-1.5 text-gray-400 hover:text-primary-500 focus:outline-none",title:r("common.generate"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M23 4v6h-6"}),l.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})}):null,[mt,De,r]);return R||!_?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx(Un,{})}):l.jsxs("form",{onSubmit:Gr,className:"space-y-4",children:[l.jsx(VR,{selectedType:_.ItemType,isEditMode:c,showDropdown:W,onDropdownToggle:ne,onTypeChange:Di,onRegenerateAlias:mt&&!c?De:void 0}),l.jsxs(uu,{children:[l.jsx(zR,{inputRef:O,value:_.Name||"",onChange:ie=>P({..._,Name:ie}),folders:G,selectedFolderId:_.FolderId,onFolderChange:ie=>P({..._,FolderId:ie})}),fe.map(ie=>l.jsx("div",{children:Gt(ie.FieldKey,r(`fieldLabels.${ie.FieldKey}`,{defaultValue:ie.FieldKey}),ie.FieldType,ie.IsHidden,ie.IsMultiValue)},ie.FieldKey))]}),c&&_.HasPasskey&&l.jsx(BL,{itemId:_.Id,passkeyIdsMarkedForDeletion:Re,onPasskeyMarkedForDeletion:$e}),Object.keys(ye).map(ie=>{const Ue=ye[ie],Be=Ue.filter(it=>te(it)),Ze=ie===nt.Login?Ue.find(it=>it.FieldKey==="login.email"):null,Tt=Ze&&!te(Ze),yt=ie===nt.Login?[...Be].sort((it,st)=>{const un={"login.email":0,"login.username":1,"login.password":2},Ut=un[it.FieldKey]??99,Wa=un[st.FieldKey]??99;return Ut-Wa}):Be;return yt.length===0&&!Tt?null:l.jsx(uu,{title:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{children:qn(ie)}),Tt&&l.jsxs("button",{type:"button",onClick:()=>qa("login.email"),className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 border border-dashed border-gray-300 dark:border-gray-600 hover:border-primary-400 dark:hover:border-primary-500",children:[l.jsxs("svg",{className:"w-2.5 h-2.5 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),l.jsx("span",{children:r("common.email")})]})]}),actions:As(ie),children:yt.map(it=>{const st=_&&ce.has(it.FieldKey)&&!wl(it,_.ItemType);return l.jsx(zg.Fragment,{children:Gt(it.FieldKey,r(`fieldLabels.${it.FieldKey}`,{defaultValue:it.FieldKey}),it.FieldType,it.IsHidden,it.IsMultiValue,st?()=>Ea(it.FieldKey):void 0)},it.FieldKey)})},ie)}),v&&z.has("notes.content")&&l.jsx(uu,{title:r("common.notes"),actions:te(v)?void 0:l.jsx("button",{type:"button",onClick:xa,className:"p-1.5 text-gray-400 hover:text-red-500 focus:outline-none",title:r("common.delete"),children:l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),children:Gt(v.FieldKey,"",v.FieldType,v.IsHidden,v.IsMultiValue)}),Q.length>0&&l.jsx(uu,{title:r("common.customFields"),children:Q.map(ie=>l.jsxs("div",{children:[l.jsx(wL,{htmlFor:ie.tempId,label:ie.label,onLabelChange:Ue=>hs(ie.tempId,Ue),onDelete:()=>_e(ie.tempId)}),Gt(ie.tempId,"",ie.fieldType,ie.isHidden,!1)]},ie.tempId))}),de&&Vr&&l.jsx(QR,{totpCodes:Se,onTotpCodesChange:Te,originalTotpCodeIds:Oe,isAddFormVisible:je.isAddFormVisible,formData:je.formData,onStateChange:ht}),ae&&l.jsx(RL,{attachments:Ye,onAttachmentsChange:rt,itemId:c?e:void 0}),l.jsx(vL,{optionalSystemFields:N,visibleFieldKeys:z,optionalSections:Kt,callbacks:{onAddSystemField:qa,onAddCustomField:gs}}),c&&l.jsx(Mu,{isOpen:S,onClose:()=>j(!1),title:r("items.deleteItemTitle"),message:r("items.deleteItemConfirm"),confirmText:r("common.delete"),cancelText:r("common.cancel"),onConfirm:Gn,variant:"danger"})]})},zD=({itemId:r})=>{const{t:e}=Ge(),[a,i]=w.useState([]),[s,c]=w.useState(!0),d=Ft(),m=g=>{try{const f=g.Blob instanceof Uint8Array?g.Blob:new Uint8Array(g.Blob),E=new Blob([f]),p=URL.createObjectURL(E),C=document.createElement("a");C.href=p,C.download=g.Filename,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(p)}catch(f){console.error("Error downloading attachment:",f)}};return w.useEffect(()=>{(async()=>{if(!(!(d!=null&&d.sqliteClient)||!r))try{const f=d.sqliteClient.settings.getAttachmentsForItem(r);i(f)}catch(f){console.error("Error loading attachments:",f)}finally{c(!1)}})()},[r,d==null?void 0:d.sqliteClient]),s?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:e("common.attachments")}),e("common.loadingAttachments")]}):a.length===0?null:l.jsx("div",{className:"mb-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:e("common.attachments")}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(g=>l.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:()=>m(g),"aria-label":`Download ${g.Filename}`,children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:g.Filename}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(g.CreatedAt).toLocaleDateString()})]})}),l.jsx("div",{className:"flex items-center",children:l.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})})]})},g.Id))})]})})};class VD{constructor(){Fe(this,"currentCopiedId","");Fe(this,"onCopyCallbacks",[])}setCopied(e){this.currentCopiedId=e,this.notifySubscribers()}getCopiedId(){return this.currentCopiedId}subscribe(e){return this.onCopyCallbacks.push(e),()=>{this.onCopyCallbacks=this.onCopyCallbacks.filter(a=>a!==e)}}notifySubscribers(){this.onCopyCallbacks.forEach(e=>e(this.currentCopiedId))}}const mu=new VD,mg=({name:r})=>{switch(r){case"visibility":return l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),l.jsx("circle",{cx:"12",cy:"12",r:"3"})]});case"visibility-off":return l.jsxs(l.Fragment,{children:[l.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"}),l.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]});case"copy":return l.jsxs(l.Fragment,{children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.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 l.jsx(l.Fragment,{children:l.jsx("polyline",{points:"20 6 9 17 4 12"})});default:return null}},xu=({id:r,label:e,value:a,type:i="text",labelSuffix:s})=>{const{t:c}=Ge(),[d,m]=w.useState(!1),[g,f]=w.useState(!1);w.useEffect(()=>{const p=mu.subscribe(C=>{f(C===r)});return()=>{p()}},[r]);const E=async()=>{try{await navigator.clipboard.writeText(a),mu.setCopied(r),await lt("CLIPBOARD_COPIED",{value:a},"background"),setTimeout(()=>{mu.getCopiedId()===r&&mu.setCopied("")},2e3)}catch(p){console.error("Failed to copy text:",p)}};return l.jsxs("div",{children:[l.jsxs("label",{htmlFor:r,className:"block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:[e,s]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:i==="password"&&!d?"password":"text",id:r,readOnly:!0,value:a,onClick:E,className:`w-full px-3 py-2.5 bg-white border ${g?"border-green-500 border-2":"border-gray-300"} text-gray-900 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`}),l.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[g?l.jsx("button",{type:"button",className:"p-1 text-green-500 dark:text-green-400 transition-colors duration-200",title:c("common.copied"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(mg,{name:"check"})})}):l.jsx("button",{type:"button",onClick:E,className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:c("common.copyToClipboard"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(mg,{name:"copy"})})}),i==="password"&&l.jsx("button",{type:"button",onClick:()=>m(!d),className:"p-1 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors duration-200",title:c(d?"common.hidePassword":"common.showPassword"),children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx(mg,{name:d?"visibility-off":"visibility"})})})]})]})]})},KD=({isOpen:r,onClose:e,itemId:a,fieldKey:i,fieldLabel:s,fieldType:c,isHidden:d})=>{const{t:m}=Ge(),g=Ft(),{executeVaultMutationAsync:f}=go(),[E,p]=w.useState([]),[C,I]=w.useState(!0),[x,T]=w.useState(null),k=d||c===Vt.Password||c===Vt.Hidden,R=w.useCallback(async()=>{if(g!=null&&g.sqliteClient)try{I(!0);const _=g.sqliteClient.items.getFieldHistory(a,i);p(_)}catch(_){console.error("Error loading field history:",_)}finally{I(!1)}},[g==null?void 0:g.sqliteClient,a,i]);w.useEffect(()=>{r&&R()},[r,g==null?void 0:g.sqliteClient,a,i,R]);const B=_=>{try{return new Date(_).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return _}},S=_=>{try{return JSON.parse(_)}catch{return[_]}},j=async _=>{if(g!=null&&g.sqliteClient)try{await f(async()=>{await g.sqliteClient.items.deleteFieldHistory(_)}),R(),T(null)}catch(P){console.error("Error deleting field history:",P)}};return l.jsx(_n,{isOpen:r,onClose:e,title:`${s} ${m("items.history")}`,maxWidth:"max-w-2xl",bodyClassName:"px-4 pb-4 pt-4 overflow-y-auto max-h-[60vh]",children:C?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):E.length===0?l.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:m("items.noHistoryAvailable")}):l.jsx("div",{className:"space-y-3",children:E.map(_=>{const P=S(_.ValueSnapshot),K=x===_.Id;return l.jsxs("div",{className:"rounded-lg p-4 border border-gray-200 dark:border-gray-700",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:B(_.ChangedAt)}),K?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>j(_.Id),className:"text-xs px-2 py-1 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 font-medium",children:m("common.confirm")}),l.jsx("button",{type:"button",onClick:()=>T(null),className:"text-xs px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:m("common.cancel")})]}):l.jsx("button",{type:"button",onClick:()=>T(_.Id),className:"text-xs px-2 py-1 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 transition-colors",title:m("common.delete"),children:l.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]}),P.map((H,Q)=>l.jsx("div",{className:"mt-2",children:l.jsx(xu,{id:`history-${_.Id}-${Q}`,label:"",value:H,type:k?"password":"text"})},Q))]},_.Id)})})})},GD=r=>{const e=/(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 r.replace(e,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>`)},eo=({field:r,itemId:e,hideLabel:a=!1})=>{const{t:i}=Ge(),s=Ft(),[c,d]=w.useState(!1),[m,g]=w.useState(0),f=r.IsCustomField?r.Label||r.FieldKey:i(`fieldLabels.${r.FieldKey}`,{defaultValue:r.FieldKey}),E=r.EnableHistory===!0;if(w.useEffect(()=>{if(E&&e&&(s!=null&&s.sqliteClient))try{const T=s.sqliteClient.items.getFieldHistory(e,r.FieldKey);if(T.length>1)g(T.length);else if(T.length===1){const k=Array.isArray(r.Value)?r.Value:[r.Value],R=JSON.stringify(k.filter(S=>S&&S.trim()!=="")),B=T[0].ValueSnapshot;g(R!==B?1:0)}else g(0)}catch(T){console.error("[FieldBlock] Error checking history:",T)}},[E,e,r.FieldKey,r.Value,s==null?void 0:s.sqliteClient]),!r.Value||typeof r.Value=="string"&&r.Value.trim()==="")return null;const p=Array.isArray(r.Value)?r.Value:[r.Value];if(p.length>1)return l.jsx("div",{className:"space-y-2",children:p.map((T,k)=>l.jsx(xu,{id:`${r.FieldKey}-${k}`,label:k===0?f:`${f} ${k+1}`,value:T,type:r.FieldType===Vt.Password?"password":"text"},`${r.FieldKey}-${k}`))});const C=p[0],I=m>0&&e?l.jsx("button",{type:"button",onClick:()=>d(!0),className:"ml-2 inline-flex items-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 focus:outline-none",title:i("items.viewHistory"),children:l.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}):null,x=c&&e?l.jsx(KD,{isOpen:c,onClose:()=>d(!1),itemId:e,fieldKey:r.FieldKey,fieldLabel:f,fieldType:r.FieldType,isHidden:r.IsHidden}):null;switch(r.FieldType){case Vt.Password:case Vt.Hidden:return l.jsxs(l.Fragment,{children:[l.jsx(xu,{id:r.FieldKey,label:f,value:C,type:"password",labelSuffix:I}),x]});case Vt.TextArea:return l.jsxs("div",{children:[!a&&l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),l.jsx("div",{className:"p-4 bg-gray-50 rounded-lg dark:bg-gray-700",children:l.jsx("p",{className:"text-gray-900 dark:text-gray-100 whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:GD(C)}})})]});case Vt.Email:case Vt.URL:case Vt.Phone:case Vt.Date:case Vt.Number:case Vt.Text:default:return l.jsxs(l.Fragment,{children:[l.jsx(xu,{id:r.FieldKey,label:f,value:C,type:"text",labelSuffix:I}),x]})}},qD=({itemId:r})=>{const{t:e}=Ge(),[a,i]=w.useState([]),[s,c]=w.useState(!0),[d,m]=w.useState({}),[g,f]=w.useState(null),E=Ft(),p=(T=30)=>{const k=new oa({secret:"dummy",algorithm:"SHA1",digits:6,period:T});return k.period-Math.floor(Date.now()/1e3)%k.period},C=()=>{const T=p();return Math.floor((30-T)/30*100)},I=T=>{try{return new oa({secret:T,algorithm:"SHA1",digits:6,period:30}).generate()}catch(k){return console.error("Error generating TOTP code:",k),"Error"}},x=async(T,k)=>{try{await navigator.clipboard.writeText(T),f(k),await lt("CLIPBOARD_COPIED",{value:T},"background"),setTimeout(()=>{f(null)},2e3)}catch(R){console.error("Failed to copy:",R)}};return w.useEffect(()=>{(async()=>{if(!(!(E!=null&&E.sqliteClient)||!r))try{const k=E.sqliteClient.settings.getTotpCodesForItem(r);i(k)}catch(k){console.error("Error loading TOTP codes:",k)}finally{c(!1)}})()},[r,E==null?void 0:E.sqliteClient]),w.useEffect(()=>{const T=B=>{const S={};return a.forEach(j=>{const _=I(j.SecretKey);_!=="Error"?S[j.Id]=_:S[j.Id]=B[j.Id]??"Error"}),S},k={};a.forEach(B=>{k[B.Id]=I(B.SecretKey)}),m(k);const R=setInterval(()=>{m(T)},1e3);return()=>{clearInterval(R)}},[a]),s?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:e("common.twoFactorAuthentication")}),e("common.loadingTotpCodes")]}):a.length===0?null:l.jsx("div",{className:"mb-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:e("common.twoFactorAuthentication")}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:a.map(T=>l.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:()=>x(d[T.Id],T.Id),"aria-label":`Copy ${T.Name} code`,children:l.jsxs("div",{className:"flex justify-between items-center gap-2",children:[l.jsx("div",{className:"flex items-center flex-1",children:l.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white",children:T.Name})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:d[T.Id]}),l.jsx("div",{className:"text-xs",children:g===T.Id?l.jsx("span",{className:"text-green-600 dark:text-green-400",children:e("common.copied")}):l.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[p(),"s"]})})]}),l.jsx("div",{className:"w-1 h-6 bg-gray-200 rounded-full dark:bg-gray-600",children:l.jsx("div",{className:"bg-blue-600 rounded-full transition-all",style:{height:`${C()}%`,width:"100%"}})})]})]})},T.Id))})]})})};var Tu={Placeholder:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <circle cx="10" cy="10" r="6.5" fill="none" stroke="#f49541" stroke-width="2.5"/>
  <circle cx="10" cy="10" r="2.5" fill="none" stroke="#f49541" stroke-width="2"/>
  <path d="M15 15L27 27" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
  <path d="M19 19L23 15" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
  <path d="M24 24L28 20" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
</svg>`,Note:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M8 4C6.9 4 6 4.9 6 6V26C6 27.1 6.9 28 8 28H24C25.1 28 26 27.1 26 26V11L19 4H8Z" fill="#f49541"/>
  <path d="M19 4V11H26L19 4Z" fill="#d68338"/>
  <rect x="10" y="14" width="12" height="1.5" rx="0.75" fill="#ffe096"/>
  <rect x="10" y="18" width="10" height="1.5" rx="0.75" fill="#ffe096"/>
  <rect x="10" y="22" width="8" height="1.5" rx="0.75" fill="#ffe096"/>
</svg>`,CreditCard:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <rect x="2" y="11" width="28" height="4" fill="#d68338"/>
  <rect x="5" y="18" width="8" height="2" rx="1" fill="#ffe096"/>
  <rect x="5" y="22" width="5" height="1.5" rx="0.75" fill="#fbcb74"/>
</svg>`,Visa:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096"/>
</svg>`,Mastercard:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <circle cx="13" cy="16" r="5" fill="#d68338"/>
  <circle cx="19" cy="16" r="5" fill="#ffe096"/>
  <path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74"/>
</svg>`,Amex:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <text x="16" y="18" text-anchor="middle" fill="#ffe096" font-size="8" font-weight="bold" font-family="Arial, sans-serif">AMEX</text>
</svg>`,Discover:`<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
  <circle cx="20" cy="16" r="4" fill="#ffe096"/>
  <path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096"/>
  <rect x="11" y="14" width="1.5" height="3" fill="#ffe096"/>
  <path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096"/>
</svg>`};const fg=({svg:r,className:e="w-8 h-8"})=>l.jsx("div",{className:`${e} flex-shrink-0`,dangerouslySetInnerHTML:{__html:r}}),WD=r=>{if(!r)return"CreditCard";const e=r.replace(/[\s-]/g,"");return/^\d{4,}/.test(e)?/^4/.test(e)?"Visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"Mastercard":/^3[47]/.test(e)?"Amex":/^6(?:011|22|4[4-9]|5)/.test(e)?"Discover":"CreditCard":"CreditCard"},YD=r=>Tu[WD(r)],hI=({item:r,className:e="w-8 h-8"})=>{var i;if(r.ItemType===Xt.Note)return l.jsx(fg,{svg:Tu.Note,className:e});if(r.ItemType===Xt.CreditCard){const s=(i=r.Fields)==null?void 0:i.find(d=>d.FieldKey===Oa.CardNumber),c=s!=null&&s.Value?Array.isArray(s.Value)?s.Value[0]:s.Value:void 0;return l.jsx(fg,{svg:YD(c),className:e})}const a=r.Logo&&r.Logo.length>0?Tg.imgSrcFromBytes(r.Logo):null;return a?l.jsx("img",{src:a,alt:r.Name||"Item",className:`${e} flex-shrink-0`,onError:s=>{const c=s.target;c.style.display="none";const d=c.parentElement;if(d){const m=document.createElement("div");m.className=e,m.innerHTML=Tu.Placeholder,d.insertBefore(m,c)}}}):l.jsx(fg,{svg:Tu.Placeholder,className:e})},JD=({email:r})=>{const{t:e}=Ge(),[a,i]=w.useState([]),[s,c]=w.useState([]),[d,m]=w.useState(!0),[g,f]=w.useState(0),[E,p]=w.useState(!1),[C,I]=w.useState(null),[x,T]=w.useState(!1),[k,R]=w.useState(2),B=zn(),S=Ft(),j=3,_=k<a.length,P=(V,G)=>{const q=V.slice(0,G);c(q)},K=()=>{const V=Math.min(k+j,a.length);R(V),P(a,V)},H=async V=>(await Tl("local:publicEmailDomains")??[]).some(q=>V.toLowerCase().endsWith(`@${q.toLowerCase()}`)),Q=async V=>(await Tl("local:privateEmailDomains")??[]).some(q=>V.toLowerCase().endsWith(`@${q.toLowerCase()}`));return w.useEffect(()=>{const V=async()=>{var q;try{if(S.isOffline){m(!1);return}I(null);const W=await H(r),ne=await Q(r),de=W||ne;if(p(W),T(de),!de)return;if(W){const X=r.split("@")[0],ae=await fetch(`https://api.spamok.com/v2/EmailBox/${X}`,{headers:{"X-Asdasd-Platform-Id":"av-chrome","X-Asdasd-Platform-Version":ja.VERSION}});if(!ae.ok){I(e("common.errors.unknownError"));return}const pe=await ae.json(),Ae=((q=pe==null?void 0:pe.mails)==null?void 0:q.toSorted((O,$)=>new Date($.dateSystem).getTime()-new Date(O.dateSystem).getTime()))??[];d&&Ae.length>0&&f(Ae[0].id),i(O=>JSON.stringify(O.map(Z=>Z.id))!==JSON.stringify(Ae.map(Z=>Z.id))?(P(Ae,k),Ae):O)}else if(ne)try{const X=await B.authFetch(`EmailBox/${r}`,{method:"GET"},!0,!1);try{const pe=X.mails.toSorted((Ae,O)=>new Date(O.dateSystem).getTime()-new Date(Ae.dateSystem).getTime());if(pe){const Ae=await Lt.decryptEmailList(pe,S.sqliteClient.settings.getAllEncryptionKeys());d&&Ae.length>0&&f(Ae[0].id),i(O=>JSON.stringify(O.map(Z=>Z.id))!==JSON.stringify(Ae.map(Z=>Z.id))?(P(Ae,k),Ae):O),I(null)}}catch{const ae=X;if(S.shouldSuppressEmailErrors())return;I(e("emails.apiErrors."+(ae==null?void 0:ae.code)));return}}catch{if(S.shouldSuppressEmailErrors())return;I(e("common.errors.unknownError"));return}}catch(W){console.error("Error loading emails:",W),I(e("common.errors.unknownError"))}m(!1)};V();const G=setInterval(V,2e3);return()=>clearInterval(G)},[r,d,B,S,e,k]),x?S.isOffline?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("div",{className:"flex items-center gap-2 mb-2",children:l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")})}),l.jsx("p",{className:"text-sm",children:e("emails.offlineMessage")})]}):C?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsx("div",{className:"flex items-center gap-2 mb-2",children:l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")})}),l.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded",children:l.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:C})})]}):d?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),e("common.loadingEmails")]}):a.length===0?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 mb-4 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),e("emails.noEmails")]}):l.jsxs("div",{className:"space-y-2 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:e("common.recentEmails")}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]}),s.map(V=>E?l.jsxs("a",{href:`https://spamok.com/${r.split("@")[0]}/${V.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 ${V.id>g?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[l.jsx("div",{className:"truncate flex-1",children:l.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[V.subject.substring(0,30),V.subject.length>30?"...":""]})}),l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(V.dateSystem).toLocaleDateString()})]},V.id):l.jsxs(qu,{to:`/emails/${V.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 ${V.id>g?"bg-yellow-50 dark:bg-yellow-900/30":""}`,children:[l.jsx("span",{className:"truncate flex-1",children:l.jsxs("span",{className:"text-sm text-gray-900 dark:text-white",children:[V.subject.substring(0,30),V.subject.length>30?"...":""]})}),l.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:new Date(V.dateSystem).toLocaleDateString()})]},V.id)),_&&l.jsxs("button",{onClick:K,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:[l.jsx("span",{children:e("common.loadMore")}),l.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}):null},XD=()=>{const{t:r}=Ge(),{id:e}=Ku(),a=pa(),i=Ft(),[s,c]=w.useState(null),{setIsInitialLoading:d}=na(),{setHeaderButtons:m}=Kn(),g=w.useCallback(()=>{aa.openInNewPopup(`/items/${e}`)},[e]),f=w.useCallback(()=>{a(`/items/${e}/edit`)},[e,a]);if(w.useEffect(()=>{if(aa.isPopup()&&(window.history.replaceState({},"","popup.html#/items"),window.history.pushState({},"",`popup.html#/items/${e}`)),!(!(i!=null&&i.sqliteClient)||!e))try{const I=i.sqliteClient.items.getById(e);I?(c(I),d(!1)):(console.error("Item not found"),a("/items"))}catch(I){console.error("Error loading item:",I)}},[i.sqliteClient,e,a,d]),w.useEffect(()=>{const I=l.jsxs("div",{className:"flex items-center gap-2",children:[!aa.isPopup()&&l.jsx(cn,{onClick:g,title:r("common.openInNewWindow"),iconType:Ca.EXPAND}),l.jsx(cn,{onClick:f,title:r("items.editItem"),iconType:Ca.EDIT})]});return m(I),()=>{}},[m,f,g,r]),w.useEffect(()=>()=>m(null),[m]),!s)return l.jsx("div",{children:r("common.loading")});const E=s.Fields.filter(I=>I.FieldType===Vt.URL&&I.Value),p={...s,Fields:s.Fields.filter(I=>I.FieldType!==Vt.URL)},C=ek(p);return l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"flex justify-between items-start",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(hI,{item:s,className:"w-12 h-12 rounded-lg"}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.Name||r("items.untitled")}),E.length>0&&l.jsx("div",{className:"mt-1 space-y-1",children:E.flatMap(I=>(Array.isArray(I.Value)?I.Value:[I.Value]).map((T,k)=>/^https?:\/\//i.test(T)?l.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"block text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 break-all text-sm",children:T},`${I.FieldKey}-${k}`):l.jsx("span",{className:"block text-gray-500 dark:text-gray-300 break-all text-sm",children:T},`${I.FieldKey}-${k}`)))})]})]})}),(s.ItemType===Xt.Login||s.ItemType===Xt.Alias)&&(()=>{const I=s.Fields.find(k=>k.FieldKey==="login.email"),x=I==null?void 0:I.Value,T=Array.isArray(x)?x[0]:x;return T?l.jsx(JD,{email:T}):null})(),(s.ItemType===Xt.Login||s.ItemType===Xt.Alias)&&l.jsx(qD,{itemId:s.Id}),(s.ItemType===Xt.Login||s.ItemType===Xt.Alias)&&s.HasPasskey&&l.jsx(DL,{itemId:s.Id}),s.ItemType===Xt.Note&&C[nt.Notes]&&C[nt.Notes].length>0&&C[nt.Notes].map(I=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r(`fieldLabels.${I.FieldKey}`,{defaultValue:I.Label||I.FieldKey})}),l.jsx(eo,{field:I,itemId:s.Id,hideLabel:!0})]},I.FieldKey)),Object.keys(C).length>0&&l.jsxs(l.Fragment,{children:[C[nt.Login]&&C[nt.Login].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.credentials")}),C[nt.Login].map(I=>l.jsx(eo,{field:I,itemId:s.Id},I.FieldKey))]}),C[nt.Alias]&&C[nt.Alias].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.alias")}),C[nt.Alias].map(I=>l.jsx(eo,{field:I,itemId:s.Id},I.FieldKey))]}),C[nt.Card]&&C[nt.Card].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("items.cardInformation")}),C[nt.Card].map(I=>l.jsx(eo,{field:I,itemId:s.Id},I.FieldKey))]}),s.ItemType!==Xt.Note&&C[nt.Notes]&&C[nt.Notes].length>0&&C[nt.Notes].map(I=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r(`fieldLabels.${I.FieldKey}`,{defaultValue:I.Label||I.FieldKey})}),l.jsx(eo,{field:I,itemId:s.Id,hideLabel:!0})]},I.FieldKey)),C[nt.Custom]&&C[nt.Custom].length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:r("common.customFields")}),C[nt.Custom].map(I=>l.jsx(eo,{field:I,itemId:s.Id},I.FieldKey))]})]}),l.jsx(zD,{itemId:s.Id}),s.Tags&&s.Tags.length>0&&l.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r("items.tags")}),l.jsx("div",{className:"flex flex-wrap gap-2",children:s.Tags.map(I=>l.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:I.Name},I.Id))})]})]})},$D=({isOpen:r,onClose:e,onDeleteFolderOnly:a,onDeleteFolderAndContents:i,itemCount:s})=>{const{t:c}=Ge(),[d,m]=w.useState(!1),g=async()=>{m(!0);try{await a(),e()}catch(p){console.error("Error deleting folder:",p)}finally{m(!1)}},f=async()=>{m(!0);try{await i(),e()}catch(p){console.error("Error deleting folder with contents:",p)}finally{m(!1)}},E=()=>{d||e()};return l.jsx(_n,{isOpen:r,onClose:E,title:c("items.deleteFolder"),footer:l.jsx("div",{className:"flex justify-end",children:l.jsx("button",{type:"button",onClick:E,disabled:d,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50",children:c("common.cancel")})}),children:l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"space-y-3 pt-2",children:[l.jsx("button",{type:"button",onClick:g,disabled:d,className:"w-full p-3 text-left border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"mt-0.5 text-orange-500",children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 14l2 2 4-4"})]})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:c("items.deleteFolderKeepItems")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:c("items.deleteFolderKeepItemsDescription")})]})]})}),s>0&&l.jsx("button",{type:"button",onClick:f,disabled:d,className:"w-full p-3 text-left border border-red-300 dark:border-red-700 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"mt-0.5 text-red-500",children:l.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-red-600 dark:text-red-400",children:c("items.deleteFolderAndItems")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:c("items.deleteFolderAndItemsDescription",{count:s})})]})]})})]})})})},yE=({isOpen:r,onClose:e,onSave:a,initialName:i="",mode:s})=>{const{t:c}=Ge(),[d,m]=w.useState(i),[g,f]=w.useState(!1),[E,p]=w.useState(null);w.useEffect(()=>{r&&(m(i),p(null))},[r,i]);const C=async I=>{I.preventDefault();const x=d.trim();if(!x){p(c("items.folderNameRequired"));return}f(!0),p(null);try{await a(x),e()}catch(T){p(c("common.errors.unknownErrorTryAgain")),console.error("Error saving folder:",T)}finally{f(!1)}};return l.jsx(_n,{isOpen:r,onClose:e,title:c(s==="create"?"items.createFolder":"items.editFolder"),footer:l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:e,disabled:g,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50",children:c("common.cancel")}),l.jsx("button",{type:"submit",form:"folder-form",disabled:g,className:"px-4 py-2 text-sm font-medium text-white bg-orange-600 hover:bg-orange-700 rounded focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:opacity-50",children:c(g?"common.saving":s==="create"?"common.create":"common.save")})]}),children:l.jsxs("form",{id:"folder-form",onSubmit:C,children:[l.jsx("label",{htmlFor:"folderName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("items.folderName")}),l.jsx("input",{id:"folderName",type:"text",value:d,onChange:I=>m(I.target.value),autoFocus:!0,className:"w-full p-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-blue-500 focus:border-blue-500"}),E&&l.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:E})]})})},EE=({folder:r,onClick:e})=>l.jsxs("button",{onClick:e,className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-700/50 hover:bg-gray-50 dark:hover:bg-gray-600/50 border border-gray-200 dark:border-gray-600 rounded-full text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-orange-500/50",children:[l.jsx("svg",{className:"w-3.5 h-3.5 text-orange-500 dark:text-orange-400 flex-shrink-0",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M10 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-8l-2-2z"})}),l.jsx("span",{className:"text-gray-700 dark:text-gray-200 font-medium truncate max-w-[120px]",children:r.name}),r.itemCount>0&&l.jsx("span",{className:"text-gray-400 dark:text-gray-500 text-xs",children:r.itemCount})]}),ZD=({item:r,showFolderPath:e=!1})=>{const{t:a}=Ge(),i=pa(),s=d=>{var f,E;let m="";const g=(f=d.Fields)==null?void 0:f.find(p=>p.FieldKey===Oa.LoginUsername);if(g&&g.Value&&(m=Array.isArray(g.Value)?g.Value[0]:g.Value),!m){const p=(E=d.Fields)==null?void 0:E.find(C=>C.FieldKey===Oa.LoginEmail);p&&p.Value&&(m=Array.isArray(p.Value)?p.Value[0]:p.Value)}return m.length>33?m.slice(0,30)+"...":m},c=d=>{let m=a("items.untitled");return d.Name&&(m=d.Name),m.length>33?m.slice(0,30)+"...":m};return l.jsx("li",{children:l.jsxs("button",{onClick:()=>i(`/items/${r.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:[l.jsx("div",{className:"w-8 h-8 mr-2 flex-shrink-0",children:l.jsx(hI,{item:r,className:"w-8 h-8"})}),l.jsxs("div",{className:"text-left flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:e&&r.FolderPath?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:[r.FolderPath," > "]}),c(r)]}):c(r)}),r.HasPasskey&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Has passkey",children:l.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})}),r.HasAttachment&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Has attachments",children:l.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),r.HasTotp&&l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",viewBox:"0 -960 960 960",fill:"currentColor","aria-label":"Has 2FA",children:l.jsx("path",{d:"M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm100-200h46v-240h-36l-70 50 24 36 36-26v180Zm124 0h156v-40h-94l-2-2q21-20 34.5-34t21.5-22q18-18 27-36t9-38q0-29-22-48.5T458-600q-26 0-47 15t-29 39l40 16q5-13 14.5-20.5T458-558q15 0 24.5 8t9.5 20q0 11-4 20.5T470-486l-32 32-54 54v40Zm296 0q36 0 58-20t22-52q0-18-10-32t-28-22v-2q14-8 22-20.5t8-29.5q0-27-21-44.5T678-600q-25 0-46.5 14.5T604-550l40 16q4-12 13-19t21-7q13 0 21.5 7.5T708-534q0 14-10 22t-26 8h-18v40h20q20 0 31 8t11 22q0 13-11 22.5t-25 9.5q-17 0-26-7.5T638-436l-40 16q7 29 28.5 44.5T680-360ZM160-240h640v-480H160v480Zm0 0v-480 480Z"})})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s(r)})]})]})})},oo="items-filter",eB=5*60*1e3,tB=()=>{try{const r=localStorage.getItem(oo);if(!r)return"all";const{filter:e,timestamp:a}=JSON.parse(r);return Date.now()-a>eB?(localStorage.removeItem(oo),"all"):e}catch{return"all"}},fu=r=>{try{localStorage.setItem(oo,JSON.stringify({filter:r,timestamp:Date.now()}))}catch{}},gu=r=>Object.values(Xt).includes(r),bE=()=>{const{t:r}=Ge(),{folderId:e}=Ku(),a=Ha(),i=Ft(),s=Vn(),c=pa(),{syncVault:d}=Ju(),{executeVaultMutationAsync:m}=go(),{setHeaderButtons:g}=Kn(),[f,E]=w.useState([]),[p,C]=w.useState(""),[I,x]=w.useState(tB()),[T,k]=w.useState(!1),[R,B]=w.useState(!1),[S,j]=w.useState(!1),[_,P]=w.useState(!1),[K,H]=w.useState(0),[Q,V]=w.useState(0),{setIsInitialLoading:G}=na(),q=e??null,W=w.useMemo(()=>{if(!q||!(i!=null&&i.sqliteClient))return null;const je=i.sqliteClient.folders.getAll().find(ht=>ht.Id===q);return(je==null?void 0:je.Name)??null},[q,i==null?void 0:i.sqliteClient,Q]),[ne,de]=Pl(!0,100);w.useEffect(()=>{const Ne=a.state;Ne!=null&&Ne.resetFilters&&(C(""),x("all"),localStorage.removeItem(oo),c(a.pathname,{replace:!0,state:{}}))},[a.state,a.pathname,c]);const X=w.useCallback(()=>{const Ne=new URLSearchParams;gu(I)&&Ne.set("type",I),q&&Ne.set("folderId",q);const je=Ne.toString();c(je?`/items/add?${je}`:"/items/add")},[c,I,q]),ae=w.useCallback(()=>{B(!0)},[]),pe=w.useCallback(async Ne=>{if(!(i!=null&&i.sqliteClient)){console.error("[FOLDER DEBUG] No sqliteClient available");return}await m(async()=>{await i.sqliteClient.folders.create(Ne,q)});const je=i.sqliteClient.items.getAll();E(je)},[i,q,m]),Ae=w.useCallback(async()=>{if(!(i!=null&&i.sqliteClient)||!q)return;await m(async()=>{await i.sqliteClient.folders.delete(q)});const Ne=i.sqliteClient.items.getAll();E(Ne);const je=i.sqliteClient.items.getRecentlyDeletedCount();H(je),c("/items")},[i,q,m,c]),O=w.useCallback(async()=>{if(!(i!=null&&i.sqliteClient)||!q)return;await m(async()=>{await i.sqliteClient.folders.deleteWithContents(q)});const Ne=i.sqliteClient.items.getAll();E(Ne);const je=i.sqliteClient.items.getRecentlyDeletedCount();H(je),c("/items")},[i,q,m,c]),$=w.useCallback(async Ne=>{!(i!=null&&i.sqliteClient)||!q||(await m(async()=>{await i.sqliteClient.folders.update(q,Ne)}),V(je=>je+1),P(!1))},[i,q,m]),Z=w.useCallback(async()=>{if(i!=null&&i.sqliteClient)try{await d({onSuccess:async Ne=>{},onOffline:()=>{},onError:async Ne=>{console.error("Error syncing vault:",Ne)}})}catch(Ne){console.error("Error refreshing items:",Ne),await s.logout("Error while syncing vault, please re-authenticate.")}},[i,s,d]),ce=w.useCallback(async()=>{de(!0),await Z(),de(!1)},[Z,de]);w.useEffect(()=>{const Ne=l.jsxs("div",{className:"flex items-center gap-2",children:[!aa.isPopup()&&l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Ca.EXPAND}),l.jsx(cn,{onClick:X,title:r("items.addNewItem"),iconType:Ca.PLUS})]});return g(Ne),()=>g(null)},[g,X,r]),w.useEffect(()=>{(async()=>{var je,ht;if(i!=null&&i.sqliteClient){de(!0);const Ye=((je=i.sqliteClient)==null?void 0:je.items.getAll())??[];E(Ye);const rt=((ht=i.sqliteClient)==null?void 0:ht.items.getRecentlyDeletedCount())??0;H(rt),de(!1),G(!1)}})()},[i==null?void 0:i.sqliteClient,de,G]);const be=()=>{if(q&&W)return W;switch(I){case"passkeys":return r("items.filters.passkeys");case"attachments":return r("common.attachments");case"all":return r("items.title");default:if(gu(I)){const Ne=ju.find(je=>je.type===I);if(Ne)return r(Ne.titleKey)}return r("items.title")}},Le=w.useCallback((Ne,je)=>{C(""),c(`/items/folder/${Ne}`)},[c]),ke=()=>{if(q||p)return[];if(!(i!=null&&i.sqliteClient))return[];const Ne=i.sqliteClient.folders.getAll(),je=new Map;return f.forEach(Ye=>{Ye.FolderId&&je.set(Ye.FolderId,(je.get(Ye.FolderId)||0)+1)}),Ne.map(Ye=>({id:Ye.Id,name:Ye.Name,itemCount:je.get(Ye.Id)||0})).sort((Ye,rt)=>Ye.name.localeCompare(rt.name))},Se=f.filter(Ne=>{var la,ve;if(q!==null){if(Ne.FolderId!==q)return!1}else if(!p&&Ne.FolderId)return!1;let je=!0;if(I==="passkeys"?je=Ne.HasPasskey===!0:I==="attachments"?je=Ne.HasAttachment===!0:gu(I)&&(je=Ne.ItemType===I),!je)return!1;const ht=p.toLowerCase().trim();return!!(!ht||(((la=Ne.Name)==null?void 0:la.toLowerCase())||"").includes(ht)||((ve=Ne.Fields)==null?void 0:ve.some(Re=>(Array.isArray(Re.Value)?Re.Value.join(" ").toLowerCase():(Re.Value||"").toLowerCase()).includes(ht)||Re.Label.toLowerCase().includes(ht))))}),Te=ke(),Oe=f.length>0&&f.every(Ne=>Ne.FolderId!==null);return ne?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx(Un,{})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center gap-2 mb-4",children:[l.jsxs("div",{className:"relative min-w-0 flex-1 flex items-center gap-2",children:[Oe&&!q?l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl min-w-0",children:l.jsx("span",{className:"truncate",children:r("items.title")})}):l.jsxs("button",{onClick:()=>k(!T),className:"flex items-center gap-1 text-gray-900 dark:text-white text-xl hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none min-w-0",children:[l.jsxs("h2",{className:"flex items-baseline gap-1.5 min-w-0 overflow-hidden",children:[l.jsx("span",{className:"truncate",children:be()}),l.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400 shrink-0",children:["(",Se.length,")"]})]}),l.jsx("svg",{className:"w-4 h-4 mt-1 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),q&&l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("button",{onClick:()=>P(!0),title:r("items.editFolder"),className:"p-1.5 text-gray-400 hover:text-orange-500 dark:text-gray-500 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})}),l.jsx("button",{onClick:()=>j(!0),title:r("items.deleteFolder"),className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-gray-500 dark:hover:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:l.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[l.jsx("polyline",{points:"3 6 5 6 21 6"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]}),T&&!(Oe&&!q)&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>k(!1)}),l.jsx("div",{className:"absolute left-0 top-full mt-1 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-20",children:l.jsxs("div",{className:"py-1",children:[l.jsx("button",{onClick:()=>{const Ne="all";x(Ne),fu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="all"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("items.filters.all")}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),ju.map(Ne=>l.jsxs("button",{onClick:()=>{const je=Ne.type;x(je),fu(je),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-2 ${I===Ne.type?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:[l.jsx("span",{className:I===Ne.type?"text-orange-500 dark:text-orange-400":"text-gray-400 dark:text-gray-500",children:Ne.iconSvg}),r(Ne.titleKey)]},Ne.type)),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),l.jsx("button",{onClick:()=>{const Ne="passkeys";x(Ne),fu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="passkeys"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("items.filters.passkeys")}),l.jsx("button",{onClick:()=>{const Ne="attachments";x(Ne),fu(Ne),k(!1)},className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${I==="attachments"?"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400":"text-gray-700 dark:text-gray-300"}`,children:r("common.attachments")}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),l.jsxs("button",{onClick:()=>{k(!1),c("/items/deleted")},className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 flex items-center justify-between",children:[l.jsx("span",{children:r("recentlyDeleted.title")}),K>0&&l.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:K})]})]})})]})]}),l.jsx(Mg,{onClick:ce})]}),f.length>0?l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"text",value:p,onChange:Ne=>C(Ne.target.value),placeholder:`${r("content.searchVault")}`,autoFocus:!0,className:"w-full p-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-blue-500 focus:border-blue-500"})}):l.jsx(l.Fragment,{}),f.length===0?l.jsx(l.Fragment,{children:l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[l.jsx("p",{children:r("items.welcomeTitle")}),l.jsx("p",{children:r("items.welcomeDescription")})]})}):Se.length===0&&Te.length===0&&!Oe?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-3 mb-10",children:[(I!=="all"||p)&&l.jsxs(l.Fragment,{children:[l.jsx("p",{children:p&&I!=="all"?r("items.noMatchingItemsWithFilter",{filter:be(),search:p}):p?r("items.noMatchingItemsSearch",{search:p}):I==="passkeys"?r("items.noPasskeysFound"):I==="attachments"?r("items.noAttachmentsFound"):gu(I)?r("items.noItemsOfTypeFound",{type:be()}):r("items.noMatchingItems")}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[p&&l.jsxs("button",{onClick:()=>C(""),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearSearch")]}),I!=="all"&&l.jsxs("button",{onClick:()=>{x("all"),localStorage.removeItem(oo)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearFilter")]})]})]}),q&&l.jsx("p",{className:"text-sm",children:r("items.emptyFolderHint")})]}):Oe&&Se.length===0&&!q&&!p?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[Te.map(Ne=>l.jsx(EE,{folder:Ne,onClick:()=>Le(Ne.id,Ne.name)},Ne.id)),l.jsxs("button",{onClick:ae,className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-orange-600 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700/50",children:[l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsxs("svg",{className:"w-3 h-3 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})]})]}),l.jsx("div",{className:"text-gray-500 dark:text-gray-400 text-sm",children:l.jsx("p",{children:r("items.allItemsInFolders")})})]}):l.jsxs(l.Fragment,{children:[!q&&!p&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[Te.map(Ne=>l.jsx(EE,{folder:Ne,onClick:()=>Le(Ne.id,Ne.name)},Ne.id)),l.jsxs("button",{onClick:ae,className:`inline-flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-full transition-colors focus:outline-none ${Te.length>0?"text-gray-500 dark:text-gray-400 hover:text-orange-600 dark:hover:text-orange-400 hover:bg-gray-100 dark:hover:bg-gray-700/50":"text-gray-400 dark:text-gray-500 border border-dashed border-gray-300 dark:border-gray-600 hover:border-orange-400 dark:hover:border-orange-500 hover:text-orange-600 dark:hover:text-orange-400"}`,children:[l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),l.jsxs("svg",{className:"w-3 h-3 -ml-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Te.length===0&&l.jsx("span",{children:r("items.newFolder")})]})]}),Se.length>0&&l.jsx("ul",{id:"items-list",className:"space-y-2",children:Se.map(Ne=>l.jsx(ZD,{item:Ne,showFolderPath:!!p&&!!Ne.FolderPath},Ne.Id))}),(I!=="all"||p)&&l.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mt-4 pt-4",children:[p&&l.jsxs("button",{onClick:()=>C(""),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearSearch")]}),I!=="all"&&l.jsxs("button",{onClick:()=>{x("all"),localStorage.removeItem(oo)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-100 dark:bg-orange-900/30 hover:bg-orange-200 dark:hover:bg-orange-900/50 text-orange-700 dark:text-orange-300 rounded-lg transition-colors",children:[l.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),r("items.clearFilter")]})]})]}),l.jsx(yE,{isOpen:R,onClose:()=>B(!1),onSave:pe,mode:"create"}),l.jsx(yE,{isOpen:_,onClose:()=>P(!1),onSave:$,initialName:W||"",mode:"edit"}),l.jsx($D,{isOpen:S,onClose:()=>j(!1),onDeleteFolderOnly:Ae,onDeleteFolderAndContents:O,itemCount:Se.length})]})},IE=[{type:"Login",titleKey:"itemTypes.login.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.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"})})},{type:"Alias",titleKey:"itemTypes.alias.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})},{type:"CreditCard",titleKey:"itemTypes.creditCard.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})},{type:"Note",titleKey:"itemTypes.note.title",iconSvg:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}],aB=()=>{const{t:r}=Ge(),e=pa(),{setIsInitialLoading:a}=na(),[i,s]=w.useState(""),[c,d]=w.useState("Login"),[m,g]=w.useState(!1);w.useEffect(()=>{a(!1)},[a]);const f=w.useCallback(()=>{const C=new URLSearchParams;C.set("type",c),i.trim()&&C.set("name",i.trim()),e(`/items/add?${C.toString()}`)},[c,i,e]),E=w.useCallback(C=>{d(C),g(!1)},[]),p=IE.find(C=>C.type===c);return l.jsxs("div",{className:"p-4 space-y-6",children:[l.jsx("div",{children:l.jsx(Xu,{id:"itemName",label:r("common.serviceName"),value:i,onChange:s,type:"text",placeholder:r("common.serviceName")})}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:r("itemTypes.typeLabel")}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>g(!m),className:"w-full px-4 py-3 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-primary-600 dark:text-primary-400",children:p==null?void 0:p.iconSvg}),l.jsx("span",{className:"font-medium",children:p?r(p.titleKey):""})]}),l.jsx("svg",{className:`w-5 h-5 text-gray-400 transition-transform ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),l.jsx("div",{className:"absolute z-20 mt-1 w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg",children:IE.map(C=>l.jsxs("button",{type:"button",onClick:()=>E(C.type),className:`w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 border-b border-gray-100 dark:border-gray-700 last:border-b-0 ${c===C.type?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300":"text-gray-900 dark:text-white"}`,children:[l.jsx("span",{className:c===C.type?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400",children:C.iconSvg}),l.jsx("span",{className:"font-medium",children:r(C.titleKey)}),c===C.type&&l.jsx("svg",{className:"w-5 h-5 ml-auto text-primary-600 dark:text-primary-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})})]},C.type))})]})]})]}),l.jsx("button",{type:"button",onClick:f,className:"w-full px-4 py-3 bg-primary-600 text-white rounded-md hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 font-medium",children:r("common.next")})]})},vE=({isOpen:r,onClose:e,onConfirm:a,title:i,message:s,confirmText:c})=>{const{t:d}=Ge();return l.jsx(_n,{isOpen:r,onClose:e,title:i,maxWidth:"max-w-sm",footer:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:e,className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded",children:d("common.cancel")}),l.jsx("button",{onClick:a,className:"px-4 py-2 text-sm bg-red-600 text-white rounded hover:bg-red-700",children:c})]}),children:l.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:s})})},nB=(r,e=30)=>{const a=new Date(r),i=new Date(a.getTime()+e*24*60*60*1e3),s=new Date,c=Math.ceil((i.getTime()-s.getTime())/(24*60*60*1e3));return Math.max(0,c)},rB=()=>{const{t:r}=Ge(),e=Ft(),{executeVaultMutationAsync:a}=go(),{setHeaderButtons:i}=Kn(),[s,c]=w.useState([]),[d,m]=w.useState(null),[g,f]=w.useState(!1),[E,p]=w.useState(!1),[C,I]=Pl(!0,100),x=w.useCallback(()=>{if(e!=null&&e.sqliteClient){const S=e.sqliteClient.items.getRecentlyDeleted();c(S)}},[e==null?void 0:e.sqliteClient]),T=w.useCallback(async S=>{e!=null&&e.sqliteClient&&(await a(async()=>{await e.sqliteClient.items.restore(S)}),x())},[e==null?void 0:e.sqliteClient,a,x]),k=w.useCallback(async()=>{!(e!=null&&e.sqliteClient)||!d||(await a(async()=>{await e.sqliteClient.items.permanentlyDelete(d)}),x(),f(!1),m(null))},[e==null?void 0:e.sqliteClient,a,x,d]),R=w.useCallback(async()=>{e!=null&&e.sqliteClient&&(await a(async()=>{for(const S of s)await e.sqliteClient.items.permanentlyDelete(S.Id)}),x(),p(!1))},[e==null?void 0:e.sqliteClient,a,s,x]);w.useEffect(()=>(i(null),()=>i(null)),[i]),w.useEffect(()=>{(async()=>{e!=null&&e.sqliteClient&&(I(!0),x(),I(!1))})()},[e==null?void 0:e.sqliteClient,I,x]);const B=w.useCallback(()=>{f(!1),m(null)},[]);return C?l.jsx("div",{className:"flex justify-center items-center p-8",children:l.jsx(Un,{})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsxs("h2",{className:"flex items-baseline gap-1.5 text-gray-900 dark:text-white text-xl",children:[r("recentlyDeleted.title"),l.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:["(",s.length,")"]})]}),s.length>0&&l.jsx("button",{onClick:()=>p(!0),className:"text-sm text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300",children:r("recentlyDeleted.emptyAll")})]}),s.length===0?l.jsxs("div",{className:"text-gray-500 dark:text-gray-400 space-y-2 mb-10",children:[l.jsx("p",{children:r("recentlyDeleted.noItems")}),l.jsx("p",{className:"text-sm",children:r("recentlyDeleted.noItemsDescription")})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4",children:r("recentlyDeleted.description")}),l.jsx("ul",{className:"space-y-2",children:s.map(S=>{const j=S.DeletedAt,_=j?nB(j):30;return l.jsx("li",{className:"relative",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[S.Logo&&l.jsx("img",{src:`data:image/png;base64,${btoa(String.fromCharCode(...S.Logo))}`,alt:"",className:"w-6 h-6 rounded"}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-white truncate",children:S.Name||r("items.untitled")})]}),l.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:_>0?r("recentlyDeleted.daysRemaining",{count:_}):l.jsx("span",{className:"text-red-500",children:r("recentlyDeleted.expiringSoon")})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>T(S.Id),className:"px-3 py-1 text-sm bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded hover:bg-green-200 dark:hover:bg-green-900/50",children:r("recentlyDeleted.restore")}),l.jsx("button",{onClick:()=>{m(S.Id),f(!0)},className:"px-3 py-1 text-sm bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 rounded hover:bg-red-200 dark:hover:bg-red-900/50",children:r("common.delete")})]})]})})},S.Id)})})]}),l.jsx(vE,{isOpen:g&&!!d,onClose:B,onConfirm:k,title:r("recentlyDeleted.confirmDeleteTitle"),message:r("recentlyDeleted.confirmDeleteMessage"),confirmText:r("recentlyDeleted.deletePermanently")}),l.jsx(vE,{isOpen:E,onClose:()=>p(!1),onConfirm:R,title:r("recentlyDeleted.confirmEmptyAllTitle"),message:r("recentlyDeleted.confirmEmptyAllMessage",{count:s.length}),confirmText:r("recentlyDeleted.emptyAll")})]})},AI=({isOpen:r,origin:e,onChoice:a,onCancel:i})=>{const{t:s}=Ge();return l.jsxs(_n,{isOpen:r,onClose:i,title:s("passkeys.useBrowserPasskey"),showCloseButton:!0,children:[l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:s("passkeys.bypass.description",{origin:e})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ta,{variant:"primary",onClick:()=>a("once"),children:s("passkeys.bypass.thisTimeOnly")}),l.jsx(ta,{variant:"secondary",onClick:()=>a("always"),children:s("passkeys.bypass.alwaysForSite")}),l.jsx(ta,{variant:"secondary",onClick:i,children:s("common.cancel")})]})]})};function pI(r={}){const{enabled:e=!0}=r,a=Ha(),i=pa(),{dbInitialized:s,dbAvailable:c}=Ft();return w.useEffect(()=>{if(!(!e||!s)&&!c){const d=`${a.pathname}${a.search}`;Ce.setItem(Bu,d),i("/unlock")}},[e,s,c,a,i]),{isLocked:s&&!c}}async function iB(){const r=await Ce.getItem(Bu);return r&&await Ce.removeItem(Bu),r}async function sB(){await Ce.removeItem(Bu)}var rs=(r=>(r.DEFAULT="default",r.URL_EXACT="url_exact",r.URL_SUBDOMAIN="url_subdomain",r))(rs||{});let gg=null;async function yh(){return gg||(gg=(async()=>{const r=zr.runtime.getURL("src/aliasvault_core_bg.wasm"),e=await(await fetch(r)).arrayBuffer();await Yu(e)})()),gg}function oB(r,e){var i;const a=(i=r.Fields)==null?void 0:i.find(s=>s.FieldKey===e);return a?Array.isArray(a.Value)?a.Value.filter(s=>s&&s.length>0):a.Value?[a.Value]:[]:[]}async function lB(r,e,a,i="default"){return await yh(),q2({credentials:r.map(c=>({Id:c.Id,ItemName:c.Name??"",ItemUrls:oB(c,Oa.LoginUrl)})),current_url:e,page_title:a,matching_mode:i}).matched_ids.map(c=>r.find(d=>d.Id===c)).filter(c=>c!==void 0)}async function Eh(r){return await yh(),K2(r)}async function bh(r){return await yh(),G2(r)}const ze=class ze{constructor(){}static async createPasskey(e,a,i){var ne,de,X,ae,pe;ze.pickSupportedAlgorithm(a.publicKey.pubKeyCredParams);const s=((ne=a.publicKey.rp)==null?void 0:ne.id)||new URL(a.origin).hostname,c=new Uint8Array(await crypto.subtle.digest("SHA-256",ze.te(s))),d=await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!0,["sign","verify"]),m=await crypto.subtle.exportKey("jwk",d.publicKey),g=await crypto.subtle.exportKey("jwk",d.privateKey),f=ze.toB64u(e),E=ze.buildCoseEc2Es256(m);let p=65;const C=(de=a.publicKey.authenticatorSelection)==null?void 0:de.userVerification,I=!!(i!=null&&i.uvPerformed);(C==="required"||C==="preferred"&&I)&&(p|=4),p|=8,p|=16;const x=new Uint8Array([0,0,0,0]),T=new Uint8Array([e.length>>8&255,e.length&255]),k=ze.concat(ze.AAGUID,T,e,E),R=ze.concat(c,new Uint8Array([p]),x,k),S={type:"webauthn.create",challenge:ze.challengeToB64u(a.publicKey.challenge),origin:a.origin,crossOrigin:!1},j=JSON.stringify(S),_=ze.te(j),P=a.publicKey.attestation||"none",K=P==="none"||P==="indirect"?ze.buildAttObjNone(R):await ze.buildAttObjPackedSelf(R,_,d.privateKey);let H=null;(X=a.publicKey.user)!=null&&X.id&&(H=typeof a.publicKey.user.id=="string"?a.publicKey.user.id:ze.toB64(a.publicKey.user.id instanceof Uint8Array?a.publicKey.user.id:new Uint8Array(a.publicKey.user.id)));let Q,V=!1,G;if(i!=null&&i.enablePrf){const Ae=new Uint8Array(32);if(crypto.getRandomValues(Ae),Q=ze.toB64u(Ae),V=!0,i!=null&&i.prfInputs){const O=ze.fromB64u(i.prfInputs.first);if(G={first:await ze.evaluatePrf(Ae,O)},i.prfInputs.second){const $=ze.fromB64u(i.prfInputs.second);G.second=await ze.evaluatePrf(Ae,$)}}}const q={rpId:s,credentialId:f,publicKey:m,privateKey:g,userId:H,userName:(ae=a.publicKey.user)==null?void 0:ae.name,userDisplayName:(pe=a.publicKey.user)==null?void 0:pe.displayName,prfSecret:Q};return{credential:{id:f,rawId:f,response:{clientDataJSON:ze.toB64u(_),attestationObject:ze.toB64u(K)},type:"public-key"},stored:q,prfEnabled:V,prfResults:G}}static async getAssertion(e,a,i){const s=a,c=e.publicKey.rpId||new URL(e.origin).hostname,d=new Uint8Array(await crypto.subtle.digest("SHA-256",ze.te(c)));let m=1;const g=e.publicKey.userVerification,f=!!(i!=null&&i.uvPerformed);(g==="required"||g==="preferred"&&f)&&(m|=4),((i==null?void 0:i.includeBEBS)??!0)&&(m|=8,m|=16);const E=new Uint8Array([0,0,0,0]),p=ze.concat(d,new Uint8Array([m]),E),I={type:"webauthn.get",challenge:ze.challengeToB64u(e.publicKey.challenge),origin:e.origin,crossOrigin:!1},x=JSON.stringify(I),T=ze.te(x),k=new Uint8Array(await crypto.subtle.digest("SHA-256",T)),R=ze.concat(p,k),B=await crypto.subtle.importKey("jwk",s.privateKey,{name:"ECDSA",namedCurve:"P-256"},!1,["sign"]),S=new Uint8Array(await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},B,R)),j=ze.ecdsaRawToDer(S);let _=null;s.userId&&(_=s.userId.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""));let P;if(i!=null&&i.prfInputs&&s.prfSecret){const K=ze.fromB64u(s.prfSecret);if(P={first:await ze.evaluatePrf(K,i.prfInputs.first)},i.prfInputs.second){const Q=await ze.evaluatePrf(K,i.prfInputs.second);P.second=Q}}return{id:s.credentialId,rawId:s.credentialId,clientDataJSON:ze.toB64u(T),authenticatorData:ze.toB64u(p),signature:ze.toB64u(j),userHandle:_,prfResults:P}}static async evaluatePrf(e,a){const i=a instanceof Uint8Array?a:new Uint8Array(a),s=ze.te("WebAuthn PRF\0"),c=ze.concat(s,i),d=await crypto.subtle.digest("SHA-256",c),m=await crypto.subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await crypto.subtle.sign("HMAC",m,d)}static pickSupportedAlgorithm(e){if(!e||e.length===0)return-7;if(!e.some(i=>i.type==="public-key"&&i.alg===-7))throw new Error("No supported algorithm (ES256) in pubKeyCredParams");return-7}static buildCoseEc2Es256(e){const a=ze.pad32(ze.fromB64u(e.x)),i=ze.pad32(ze.fromB64u(e.y));return new Uint8Array([165,1,2,3,38,32,1,33,88,32,...a,34,88,32,...i])}static buildAttObjNone(e){const a=ze.cborText("fmt"),i=ze.cborText("none"),s=ze.cborText("attStmt"),c=new Uint8Array([160]),d=ze.cborText("authData"),m=ze.cborBstr(e);return ze.concat(new Uint8Array([163]),a,i,s,c,d,m)}static async buildAttObjPackedSelf(e,a,i){const s=new Uint8Array(await crypto.subtle.digest("SHA-256",a)),c=ze.concat(e,s),d=new Uint8Array(await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},i,c)),m=ze.ecdsaRawToDer(d),g=ze.concat(ze.cborText("alg"),new Uint8Array([38]),ze.cborText("sig"),ze.cborBstr(m)),f=ze.concat(new Uint8Array([162]),g),E=ze.cborText("fmt"),p=ze.cborText("packed"),C=ze.cborText("attStmt"),I=ze.cborText("authData"),x=ze.cborBstr(e);return ze.concat(new Uint8Array([163]),E,p,C,f,I,x)}static cborText(e){const a=ze.te(e);return a.length<=23?new Uint8Array([96|a.length,...a]):a.length<=255?new Uint8Array([120,a.length,...a]):new Uint8Array([121,a.length>>8&255,a.length&255,...a])}static cborBstr(e){return e.length<=23?new Uint8Array([64|e.length,...e]):e.length<=255?new Uint8Array([88,e.length,...e]):new Uint8Array([89,e.length>>8&255,e.length&255,...e])}static ecdsaRawToDer(e){if(e.length!==64)throw new Error("Unexpected ECDSA signature length");const a=e.slice(0,32),i=e.slice(32,64),s=ze.derInt(a),c=ze.derInt(i);return new Uint8Array([48,s.length+c.length,...s,...c])}static derInt(e){let a=0;for(;a<e.length-1&&e[a]===0;)a++;let i=e.slice(a);if((i[0]&128)!==0){const s=new Uint8Array(i.length+1);s[0]=0,s.set(i,1),i=s}return new Uint8Array([2,i.length,...i])}static te(e){return new TextEncoder().encode(e)}static toB64(e){let a="";for(let i=0;i<e.length;i++)a+=String.fromCharCode(e[i]);return btoa(a)}static toB64u(e){return ze.toB64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}static fromB64u(e){const a=e.replace(/-/g,"+").replace(/_/g,"/"),i=a.length%4===2?"==":a.length%4===3?"=":"",s=atob(a+i),c=new Uint8Array(s.length);for(let d=0;d<s.length;d++)c[d]=s.charCodeAt(d);return c}static challengeToB64u(e){if(typeof e=="string")return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");const a=e instanceof Uint8Array?e:new Uint8Array(e);return ze.toB64u(a)}static pad32(e){if(e.length===32)return e;const a=new Uint8Array(32);return a.set(e,32-e.length),a}static concat(...e){const a=e.reduce((c,d)=>c+d.length,0),i=new Uint8Array(a);let s=0;for(const c of e)i.set(c,s),s+=c.length;return i}};Fe(ze,"AAGUID",new Uint8Array([161,26,95,170,159,50,75,140,140,93,47,125,19,232,201,66]));let Pu=ze;class Fa{constructor(){}static guidToBytes(e){const a=e.replace(/-/g,"");if(a.length!==32)throw new Error("Invalid GUID format");const i=new Uint8Array(16);for(let s=0;s<16;s++)i[s]=parseInt(a.substr(s*2,2),16);return i}static bytesToGuid(e){if(e.length!==16)throw new Error("Invalid byte length for GUID");const a=Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("");return[a.substr(0,8),a.substr(8,4),a.substr(12,4),a.substr(16,4),a.substr(20)].join("-").toUpperCase()}static bytesToBase64Url(e){let a="";return e.forEach(s=>a+=String.fromCharCode(s)),btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static base64UrlToBytes(e){let i=e.replace(/=+$/,"").replace(/-/g,"+").replace(/_/g,"/");for(;i.length%4;)i+="=";const s=atob(i),c=new Uint8Array(s.length);for(let d=0;d<s.length;d++)c[d]=s.charCodeAt(d);return c}static guidToBase64url(e){return this.bytesToBase64Url(this.guidToBytes(e))}static base64urlToGuid(e){return this.bytesToGuid(this.base64UrlToBytes(e))}static arrayBufferToBase64(e){const a=new Uint8Array(e);let i="";for(let s=0;s<a.length;s++)i+=String.fromCharCode(a[s]);return btoa(i)}static bytesToBase64url(e){const a=e instanceof Uint8Array?e:new Uint8Array(e);return this.bytesToBase64Url(a)}static base64urlToBytes(e){return this.base64UrlToBytes(e)}}const cB=()=>{const{t:r}=Ge(),e=Ha(),{setIsInitialLoading:a}=na(),i=Ft(),[s,c]=w.useState(null),[d,m]=w.useState(!1),[g,f]=w.useState(null),[E,p]=w.useState([]),[C,I]=w.useState(!1),{isLocked:x}=pI(),T=w.useRef(null);w.useEffect(()=>{(async()=>{if(!i.dbInitialized||x)return;const P=new URLSearchParams(e.search).get("requestId");if(P)try{const K=await lt("GET_REQUEST_DATA",{requestId:P},"background");if(K&&K.type==="get"){c(K);const H=K.publicKey.rpId||new URL(K.origin).hostname,Q=i.sqliteClient.passkeys.getByRpId(H);let V=Q;if(K.publicKey.allowCredentials&&K.publicKey.allowCredentials.length>0){const G=new Set(K.publicKey.allowCredentials.map(q=>{try{return Fa.base64urlToGuid(q.id)}catch(W){return console.warn("Failed to convert credential ID to GUID:",q.id,W),null}}).filter(q=>q!==null));V=Q.filter(q=>G.has(q.Id))}p(V.map(G=>({id:G.Id,displayName:G.DisplayName,serviceName:G.ServiceName,rpId:G.RpId,username:G.Username})))}}catch(K){console.error("Failed to fetch request data:",K),f(r("common.errors.unknownError"))}a(!1)})()},[e,a,i.dbInitialized,x,i.sqliteClient,r]),w.useEffect(()=>{E.length>0&&T.current&&T.current.focus()},[E.length]),w.useEffect(()=>{const j=_=>{_.key==="Enter"&&!d&&E.length>0&&k(E[0].id)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[d,E]);const k=async j=>{var _,P;if(!(!s||!i.sqliteClient)){m(!0),f(null);try{const K=i.sqliteClient.passkeys.getById(j);if(!K)throw new Error(r("common.errors.unknownError"));const H=JSON.parse(K.PublicKey),Q=JSON.parse(K.PrivateKey);let V;if(K.PrfKey)try{V=Fa.bytesToBase64url(K.PrfKey)}catch(pe){console.warn("Failed to convert PrfKey to base64url",pe)}let G=null;if(K.UserHandle)try{const pe=K.UserHandle instanceof Uint8Array?K.UserHandle:new Uint8Array(K.UserHandle);G=Fa.bytesToBase64url(pe)}catch(pe){console.warn("Failed to convert UserHandle to base64",pe)}const q={rpId:K.RpId,credentialId:Fa.guidToBase64url(K.Id),publicKey:H,privateKey:Q,userId:G,userName:K.Username??void 0,userDisplayName:K.ServiceName??void 0,prfSecret:V},W={origin:s.origin,requestId:s.requestId,publicKey:{rpId:s.publicKey.rpId,challenge:s.publicKey.challenge,userVerification:s.publicKey.userVerification}};let ne;if((P=(_=s.publicKey.extensions)==null?void 0:_.prf)!=null&&P.eval){const pe=s.publicKey.extensions.prf.eval.first;let Ae;if(typeof pe=="object"&&pe!==null&&!Array.isArray(pe)){const O=Object.keys(pe).map(Number).sort(($,Z)=>$-Z);Ae=new Uint8Array(O.length);for(let $=0;$<O.length;$++)Ae[$]=pe[$]}else if(typeof pe=="string"){const O=atob(pe);Ae=new Uint8Array(O.length);for(let $=0;$<O.length;$++)Ae[$]=O.charCodeAt($)}else throw new Error("Unknown PRF input format");if(ne={first:Ae},s.publicKey.extensions.prf.eval.second){const O=s.publicKey.extensions.prf.eval.second;let $;if(typeof O=="object"&&O!==null&&!Array.isArray(O)){const Z=Object.keys(O).map(Number).sort((ce,be)=>ce-be);$=new Uint8Array(Z.length);for(let ce=0;ce<Z.length;ce++)$[ce]=O[ce]}else if(typeof O=="string"){const Z=atob(O);$=new Uint8Array(Z.length);for(let ce=0;ce<Z.length;ce++)$[ce]=Z.charCodeAt(ce)}else throw console.error("[PasskeyAuth] Unknown PRF second input type:",typeof O),new Error("Unknown PRF second input format");ne.second=$}}const de=await Pu.getAssertion(W,q,{uvPerformed:!0,includeBEBS:!0,prfInputs:ne});let X;de.prfResults&&(X={first:Fa.arrayBufferToBase64(de.prfResults.first)},de.prfResults.second&&(X.second=Fa.arrayBufferToBase64(de.prfResults.second)));const ae={id:de.id,rawId:de.rawId,clientDataJSON:de.clientDataJSON,authenticatorData:de.authenticatorData,signature:de.signature,userHandle:de.userHandle,prfResults:X};await lt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,credential:ae},"background")}catch(K){console.error("PasskeyAuthenticate: Error during authentication",K),m(!1),f(r("common.errors.unknownError"))}}},R=async()=>{I(!0)},B=async j=>{if(s){if(j==="always"){const _=new URL(s.origin).hostname,P=await bh(await Eh(_)),K=await Ce.getItem(os)??[];K.includes(P)||(K.push(P),await Ce.setItem(os,K))}await lt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,fallback:!0},"background")}},S=async()=>{s&&await lt("PASSKEY_POPUP_RESPONSE",{requestId:s.requestId,cancelled:!0},"background")};return s?l.jsxs(l.Fragment,{children:[l.jsx(AI,{isOpen:C&&!!s,origin:s?new URL(s.origin).hostname:"",onChoice:B,onCancel:()=>I(!1)}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("passkeys.authenticate.title")}),l.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[r("passkeys.authenticate.signInFor")," ",l.jsx("strong",{children:s.origin})]})]}),g&&l.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:l.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:g})}),l.jsx("div",{className:"space-y-4",children:E&&E.length>0?l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.authenticate.selectPasskey")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:E.map((j,_)=>l.jsxs("div",{ref:_===0?T:null,tabIndex:0,className:"p-3 rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",onClick:()=>!d&&k(j.id),onKeyDown:P=>{P.key==="Enter"&&!d&&k(j.id)},children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:j.serviceName}),l.jsx("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-400",children:l.jsx("span",{className:"truncate",children:j.displayName})})]},j.id))})]}):l.jsx("div",{className:"text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg",children:l.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:r("passkeys.authenticate.noPasskeysFound")})})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ta,{variant:"secondary",onClick:R,children:r("passkeys.useBrowserPasskey")}),l.jsx(ta,{variant:"secondary",onClick:S,children:r("common.cancel")})]})]})]}):l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Un,{})})},hg=({variant:r,children:e,className:a=""})=>{const i={info:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200",warning:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200",error:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200",success:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200"};return l.jsx("div",{className:`p-3 border rounded-lg ${i[r]} ${a}`,children:l.jsx("p",{className:"text-sm",children:e})})},uB=()=>{var O,$;const{t:r}=Ge(),e=Ha(),{setIsInitialLoading:a}=na(),i=Ft(),s=zn(),{executeVaultMutationAsync:c}=go(),[d,m]=w.useState(null),[g,f]=w.useState(""),[E,p]=w.useState(null),{isLocked:C}=pI(),[I,x]=w.useState([]),[T,k]=w.useState([]),[R,B]=w.useState(null),[S,j]=w.useState(null),[_,P]=w.useState(!1),[K,H]=w.useState(!1),[Q,V]=w.useState(!1),G=w.useRef(null),q=w.useRef(null);w.useEffect(()=>{(async()=>{var Le,ke,Se,Te,Oe,Ne,je,ht;if(!i.dbInitialized||C)return;const be=new URLSearchParams(e.search).get("requestId");if(be)try{const Ye=await lt("GET_REQUEST_DATA",{requestId:be},"background");if(Ye&&Ye.type==="create"){m(Ye);const rt=((ke=(Le=Ye.publicKey)==null?void 0:Le.rp)==null?void 0:ke.name)||((Te=(Se=Ye.publicKey)==null?void 0:Se.rp)==null?void 0:Te.id)||"Passkey";if(f(rt),i.sqliteClient&&((Ne=(Oe=Ye.publicKey)==null?void 0:Oe.rp)!=null&&Ne.id)){const la=i.sqliteClient.passkeys.getByRpId(Ye.publicKey.rp.id);let ve=la;if(((je=Ye.publicKey.user)!=null&&je.id||(ht=Ye.publicKey.user)!=null&&ht.name)&&(ve=la.filter(Re=>{var $e,qe;if(($e=Ye.publicKey.user)!=null&&$e.id&&Re.UserHandle)try{const dt=Fa.base64urlToBytes(Ye.publicKey.user.id),Je=Re.UserHandle instanceof Uint8Array?Re.UserHandle:new Uint8Array(Re.UserHandle);if(dt.length===Je.length&&dt.every((At,Ot)=>At===Je[Ot]))return!0}catch{}return!!((qe=Ye.publicKey.user)!=null&&qe.name&&Re.Username&&Re.Username===Ye.publicKey.user.name)})),x(ve),ve.length===0){const $e=i.sqliteClient.items.getAll().filter(dt=>{const Je=tu(dt,Oa.LoginUsername),At=tu(dt,Oa.LoginPassword);return!Je&&!At?!1:!dt.HasPasskey});let qe=[];$e.length>0&&(qe=await lB($e,Ye.origin,Ye.publicKey.rp.name||"",rs.URL_SUBDOMAIN),k(qe)),qe.length===0&&P(!0)}}}}catch(Ye){console.error("Failed to fetch request data:",Ye),p(r("common.errors.unknownError"))}a(!1)})()},[e,a,i.dbInitialized,i.sqliteClient,C,r]),w.useEffect(()=>{_&&q.current?q.current.focus():!_&&I.length>0&&G.current&&G.current.focus()},[_,I.length]),w.useEffect(()=>{const Z=ce=>{ce.key==="Enter"&&!K&&_&&X()};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[_,K]);const W=()=>{B(null),j(null),P(!0)},ne=Z=>{B(Z),j(null),P(!0)},de=Z=>{j(Z),B(null),P(!0)},X=async()=>{var Z,ce;if(!(!d||!i.sqliteClient)){p(null);try{let be;if(d.origin){H(!0);try{const qe=new Promise((At,Ot)=>setTimeout(()=>Ot(new Error("Favicon extraction timed out")),5e3)),dt=s.get("Favicon/Extract?url="+d.origin),Je=await Promise.race([dt,qe]);if(Je!=null&&Je.image){const At=atob(Je.image),Ot=new Uint8Array(At.length);for(let Wt=0;Wt<At.length;Wt++)Ot[Wt]=At.charCodeAt(Wt);be=Ot}}catch{}}const Le={origin:d.origin,requestId:d.requestId,publicKey:{rp:d.publicKey.rp,user:d.publicKey.user,challenge:d.publicKey.challenge,pubKeyCredParams:d.publicKey.pubKeyCredParams,attestation:d.publicKey.attestation,authenticatorSelection:d.publicKey.authenticatorSelection}},ke=crypto.randomUUID().toUpperCase(),Se=Fa.guidToBytes(ke),Te=Fa.guidToBase64url(ke),Oe=(ce=(Z=d.publicKey)==null?void 0:Z.extensions)==null?void 0:ce.prf,Ne=!!Oe,je=Oe==null?void 0:Oe.eval,ht=await Pu.createPasskey(Se,Le,{uvPerformed:!0,credentialIdBytes:16,enablePrf:Ne,prfInputs:je}),{credential:Ye,stored:rt,prfEnabled:la,prfResults:ve}=ht;await c(async()=>{if(R){const qe=i.sqliteClient.passkeys.getById(R);if(qe){const dt=i.sqliteClient.items.getById(qe.ItemId);dt&&await i.sqliteClient.items.update({...dt,Name:g,Logo:be??dt.Logo,Fields:[...(dt.Fields||[]).filter(At=>At.FieldKey!==Oa.LoginUrl&&At.FieldKey!==Oa.LoginUsername),au(Oa.LoginUrl,{value:d.origin}),au(Oa.LoginUsername,{value:d.publicKey.user.name})]},[],[]),await i.sqliteClient.passkeys.deleteById(R);let Je=null;if(rt.userId)try{Je=Fa.base64urlToBytes(rt.userId)}catch{Je=null}await i.sqliteClient.passkeys.create({Id:ke,ItemId:qe.ItemId,RpId:rt.rpId,UserHandle:Je,PublicKey:JSON.stringify(rt.publicKey),PrivateKey:JSON.stringify(rt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:rt.prfSecret?Fa.base64urlToBytes(rt.prfSecret):void 0,AdditionalData:null})}}else if(S){let qe=null;if(rt.userId)try{qe=Fa.base64urlToBytes(rt.userId)}catch{qe=null}await i.sqliteClient.passkeys.create({Id:ke,ItemId:S,RpId:rt.rpId,UserHandle:qe,PublicKey:JSON.stringify(rt.publicKey),PrivateKey:JSON.stringify(rt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:rt.prfSecret?Fa.base64urlToBytes(rt.prfSecret):void 0,AdditionalData:null})}else{const qe={Id:"",Name:g,ItemType:Xt.Login,Logo:be,Fields:[au(Oa.LoginUrl,{value:d.origin}),au(Oa.LoginUsername,{value:d.publicKey.user.name})],CreatedAt:new Date().toISOString(),UpdatedAt:new Date().toISOString()},dt=await i.sqliteClient.items.create(qe,[]);let Je=null;if(rt.userId)try{Je=Fa.base64urlToBytes(rt.userId)}catch{Je=null}await i.sqliteClient.passkeys.create({Id:ke,ItemId:dt,RpId:rt.rpId,UserHandle:Je,PublicKey:JSON.stringify(rt.publicKey),PrivateKey:JSON.stringify(rt.privateKey),DisplayName:d.publicKey.user.displayName||d.publicKey.user.name||"",PrfKey:rt.prfSecret?Fa.base64urlToBytes(rt.prfSecret):void 0,AdditionalData:null})}});let Re;la&&(Re={prf:{enabled:!0,results:ve?{first:Fa.bytesToBase64url(new Uint8Array(ve.first)),second:ve.second?Fa.bytesToBase64url(new Uint8Array(ve.second)):void 0}:void 0}});const $e={id:Te,rawId:Te,clientDataJSON:Ye.response.clientDataJSON,attestationObject:Ye.response.attestationObject,extensions:Re};await lt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,credential:$e},"background"),H(!1)}catch(be){console.error("PasskeyCreate: Error creating passkey",be),p(r("common.errors.unknownError"))}}},ae=async()=>{V(!0)},pe=async Z=>{if(d){if(Z==="always"){const ce=new URL(d.origin).hostname,be=await bh(await Eh(ce)),Le=await Ce.getItem(os)??[];Le.includes(be)||(Le.push(be),await Ce.setItem(os,Le))}await lt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,fallback:!0},"background")}},Ae=async()=>{d&&await lt("PASSKEY_POPUP_RESPONSE",{requestId:d.requestId,cancelled:!0},"background")};return d?l.jsxs(l.Fragment,{children:[l.jsx(AI,{isOpen:Q&&!!d,origin:d?new URL(d.origin).hostname:"",onChoice:pe,onCancel:()=>V(!1)}),K&&l.jsx("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:l.jsx(Un,{})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:r("passkeys.create.title")}),l.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[r("passkeys.create.createFor")," ",l.jsx("strong",{children:d.origin})]})]}),E&&l.jsx(hg,{variant:"error",children:E}),!_&&I.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(ta,{variant:"primary",onClick:W,ref:G,children:r("passkeys.create.createNewPasskey")}),l.jsx(ta,{variant:"secondary",onClick:ae,children:r("passkeys.useBrowserPasskey")}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"px-2 bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400",children:r("common.or")})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.create.selectPasskeyToReplace")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:I.map(Z=>l.jsx("button",{onClick:()=>ne(Z.Id),className:"w-full p-3 text-left rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:Z.ServiceName}),l.jsx("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-400",children:l.jsx("span",{className:"truncate",children:Z.DisplayName})})]}),l.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},Z.Id))})]}),l.jsx(ta,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]}),!_&&I.length===0&&T.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(ta,{variant:"primary",onClick:W,ref:G,children:r("passkeys.create.createNewPasskey")}),l.jsx(ta,{variant:"secondary",onClick:ae,children:r("passkeys.useBrowserPasskey")}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"px-2 bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400",children:r("common.or")})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r("passkeys.create.selectExistingLogin")}),l.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:r("passkeys.create.selectExistingLoginDescription")}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-2 bg-gray-50 dark:bg-gray-800",children:T.map(Z=>l.jsx("button",{onClick:()=>de(Z.Id),className:"w-full p-3 text-left rounded-lg border cursor-pointer transition-colors bg-white border-gray-200 hover:bg-gray-100 hover:border-gray-300 dark:bg-gray-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:border-gray-500 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center flex-1 min-w-0",children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-medium text-gray-900 dark:text-white text-sm truncate",children:Z.Name}),tu(Z,Oa.LoginUsername)&&l.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:tu(Z,Oa.LoginUsername)})]})}),l.jsx("svg",{className:"w-5 h-5 text-gray-400 flex-shrink-0 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},Z.Id))})]}),l.jsx(ta,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]}),_&&l.jsxs("div",{className:"space-y-4",children:[R&&l.jsx(hg,{variant:"warning",children:r("passkeys.create.replacingPasskey",{displayName:((O=I.find(Z=>Z.Id===R))==null?void 0:O.DisplayName)||""})}),S&&l.jsx(hg,{variant:"info",children:r("passkeys.create.attachingToCredential",{serviceName:(($=T.find(Z=>Z.Id===S))==null?void 0:$.Name)||""})}),!S&&l.jsx(Xu,{id:"displayName",label:r("passkeys.create.titleLabel"),value:g,onChange:f,placeholder:r("passkeys.create.titlePlaceholder"),ref:q}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ta,{variant:"primary",onClick:X,children:r(R?"passkeys.create.confirmReplace":S?"passkeys.create.attachPasskey":"passkeys.create.createButton")}),I.length>0||T.length>0?l.jsx(ta,{variant:"secondary",onClick:()=>{P(!1),B(null),j(null)},children:r("common.back")}):l.jsxs(l.Fragment,{children:[l.jsx(ta,{variant:"secondary",onClick:ae,children:r("passkeys.useBrowserPasskey")}),l.jsx(ta,{variant:"secondary",onClick:Ae,children:r("common.cancel")})]})]})]})]})]}):l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Un,{})})},wE="session:lastVisitedPage",CE="session:lastVisitedTime",NE="session:navigationHistory",dB=120*1e3,mB=()=>{const r=pa(),{setIsInitialLoading:e}=na(),{syncVault:a}=Ju(),i=w.useRef(!1),{isInitialized:s,isLoggedIn:c}=Vn(),{dbInitialized:d,dbAvailable:m}=Ft(),g=s&&d,f=g&&(!c||!m),E=w.useCallback(async()=>{const[p,C,I]=await Promise.all([Ce.getItem(wE),Ce.getItem(CE),Ce.getItem(NE)]);if(p&&C&&Date.now()-C<=dB){(I==null?void 0:I.length)>1?(r(I[0].pathname,{replace:!0}),r(p,{replace:!1})):r(p,{replace:!0});return}await Promise.all([Ce.removeItem(wE),Ce.removeItem(CE),Ce.removeItem(NE),lt("CLEAR_PERSISTED_FORM_VALUES",null,"background")]),r("/items",{replace:!0})},[r]);return w.useEffect(()=>{(async()=>{const I=new URLSearchParams(window.location.search).get("mode")==="inline_unlock",x=await iB();if(!g)return;const T=!i.current;f?(e(!1),c?m||r("/unlock",{replace:!0}):r("/login",{replace:!0})):T?(i.current=!0,e(!1),I?r("/unlock-success",{replace:!0}):x?r(x,{replace:!0}):await E(),a({onUpgradeRequired:()=>{r("/upgrade",{replace:!0})},onError:k=>{console.error("Background vault sync error:",k)}})):(e(!1),E())})()},[g,f,c,m,r,e,a,E]),null},fB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na(),[a,i]=w.useState({disabledUrls:[],temporaryDisabledUrls:{},currentUrl:"",isEnabled:!0,isGloballyEnabled:!0}),[s,c]=w.useState(rs.DEFAULT),d=async()=>{const C={active:!0,currentWindow:!0},[I]=await zr.tabs.query(C);return I},m=w.useCallback(async()=>{const C=await d(),I=new URL(C.url??"").hostname,x=await Ce.getItem(bu)??[],T=await Ce.getItem(ru)??{},k=await Ce.getItem(Du)!==!1,R=Date.now(),B=Object.fromEntries(Object.entries(T).filter(([j,_])=>_>R));Object.keys(B).length!==Object.keys(T).length&&await Ce.setItem(ru,B);const S=await Ce.getItem(fy)??rs.DEFAULT;c(S),i({disabledUrls:x,temporaryDisabledUrls:B,currentUrl:I,isEnabled:!x.includes(I)&&!(I in B),isGloballyEnabled:k}),e(!1)},[e]);w.useEffect(()=>{m()},[m]);const g=async()=>{const{currentUrl:C,disabledUrls:I,temporaryDisabledUrls:x,isEnabled:T}=a;let k=[...I],R={...x};T?(k.includes(C)||k.push(C),delete R[C]):(k=k.filter(B=>B!==C),delete R[C]),await Ce.setItem(bu,k),await Ce.setItem(ru,R),i(B=>({...B,disabledUrls:k,temporaryDisabledUrls:R,isEnabled:!T}))},f=async()=>{await Ce.setItem(bu,[]),await Ce.setItem(ru,{}),i(C=>({...C,disabledUrls:[],temporaryDisabledUrls:{},isEnabled:!0}))},E=async()=>{const C=!a.isGloballyEnabled;await Ce.setItem(Du,C),i(I=>({...I,isGloballyEnabled:C}))},p=async C=>{await Ce.setItem(fy,C),c(C)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.globalSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.autofillPopup")}),l.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?r("settings.activeOnAllSites"):r("settings.disabledOnAllSites")})]}),l.jsx("button",{onClick:E,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?r("common.enabled"):r("common.disabled")})]})})})]}),a.isGloballyEnabled&&l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.siteSpecificSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[r("settings.autofillPopupOn"),a.currentUrl]}),l.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?r("settings.enabledForThisSite"):r("settings.disabledForThisSite")}),!a.isEnabled&&a.temporaryDisabledUrls[a.currentUrl]&&l.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:[r("settings.temporarilyDisabledUntil"),new Date(a.temporaryDisabledUrls[a.currentUrl]).toLocaleTimeString()]})]}),a.isGloballyEnabled&&l.jsx("button",{onClick:g,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?r("common.enabled"):r("common.disabled")})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:f,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:r("settings.resetAllSiteSettings")})})]})})]}),l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.autofillMatching")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.autofillMatchingMode")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.autofillMatchingModeDescription")}),l.jsxs("select",{value:s,onChange:C=>p(C.target.value),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:rs.DEFAULT,children:r("settings.autofillMatchingDefault")}),l.jsx("option",{value:rs.URL_SUBDOMAIN,children:r("settings.autofillMatchingUrlSubdomain")}),l.jsx("option",{value:rs.URL_EXACT,children:r("settings.autofillMatchingUrlExact")})]})]})})})]})]})},yI=({title:r,content:e,className:a=""})=>{const[i,s]=w.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>s(!0),className:`${a}`,type:"button","aria-label":"Help",children:l.jsx("svg",{className:"w-4 h-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-help",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsx(_n,{isOpen:i,onClose:()=>s(!1),title:r,children:l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:e})})]})},gB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na(),[a,i]=w.useState(0);w.useEffect(()=>{(async()=>{const d=await Ce.getItem(my)??0;i(d),e(!1)})()},[e]);const s=async c=>{await Ce.setItem(my,c),await lt("SET_AUTO_LOCK_TIMEOUT",c,"background"),i(c)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.autoLockTimeout")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.autoLockTimeout")}),l.jsx(yI,{title:r("settings.autoLockTimeout"),content:r("settings.autoLockTimeoutHelp"),className:"ml-2"})]}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.autoLockTimeoutDescription")}),l.jsxs("select",{value:a,onChange:c=>s(Number(c.target.value)),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:"0",children:r("settings.autoLockNever")}),l.jsx("option",{value:"15",children:r("settings.autoLock15Seconds")}),l.jsx("option",{value:"60",children:r("settings.autoLock1Minute")}),l.jsx("option",{value:"300",children:r("settings.autoLock5Minutes")}),l.jsx("option",{value:"900",children:r("settings.autoLock15Minutes")}),l.jsx("option",{value:"1800",children:r("settings.autoLock30Minutes")}),l.jsx("option",{value:"3600",children:r("settings.autoLock1Hour")}),l.jsx("option",{value:"14400",children:r("settings.autoLock4Hours")}),l.jsx("option",{value:"28800",children:r("settings.autoLock8Hours")}),l.jsx("option",{value:"86400",children:r("settings.autoLock24Hours")})]})]})})})]})})},hB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na(),[a,i]=w.useState(10);w.useEffect(()=>{(async()=>{const d=await Ce.getItem(dy)??10;i(d),e(!1)})()},[e]);const s=async c=>{await Ce.setItem(dy,c),await lt("SET_CLIPBOARD_CLEAR_TIMEOUT",c,"background"),i(c)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.clipboardSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.clipboardClearTimeout")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:r("settings.clipboardClearTimeoutDescription")}),l.jsxs("select",{value:a,onChange:c=>s(Number(c.target.value)),className:"w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500",children:[l.jsx("option",{value:"0",children:r("settings.clipboardClearDisabled")}),l.jsx("option",{value:"5",children:r("settings.clipboardClear5Seconds")}),l.jsx("option",{value:"10",children:r("settings.clipboardClear10Seconds")}),l.jsx("option",{value:"15",children:r("settings.clipboardClear15Seconds")})]})]})})})]})})},AB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na(),[a,i]=w.useState(!0),s=w.useCallback(async()=>{const d=await Ce.getItem(uy)!==!1;i(d),e(!1)},[e]);w.useEffect(()=>{s()},[s]);const c=async()=>{const d=!a;await Ce.setItem(uy,d),await lt("TOGGLE_CONTEXT_MENU",{enabled:d},"background"),i(d)};return l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.contextMenu")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.rightClickContextMenu")}),l.jsx("p",{className:`text-sm mt-1 ${a?"text-gray-600 dark:text-gray-400":"text-red-600 dark:text-red-400"}`,children:r(a?"settings.contextMenuEnabled":"settings.contextMenuDisabled")}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2",children:r("settings.contextMenuDescription")})]}),l.jsx("button",{onClick:c,className:`px-4 py-2 rounded-md transition-colors ${a?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:r(a?"common.enabled":"common.disabled")})]})})})]})})},pB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na();return w.useEffect(()=>{e(!1)},[e]),l.jsx("div",{className:"space-y-6",children:l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.language")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-3",children:r("settings.selectLanguage")}),l.jsx(Kb,{variant:"dropdown",size:"sm"})]})})})]})})},yB=()=>{const{t:r}=Ge(),{setIsInitialLoading:e}=na(),[a,i]=w.useState({disabledUrls:[],currentUrl:"",isEnabled:!0,isGloballyEnabled:!0}),s=async()=>{const f={active:!0,currentWindow:!0},[E]=await zr.tabs.query(f);return E},c=w.useCallback(async()=>{const f=await s(),E=new URL(f.url??"").hostname,p=await bh(await Eh(E)),C=await Ce.getItem(os)??[],I=await Ce.getItem(gy)!==!1,x=!C.includes(p);i({disabledUrls:C,currentUrl:p,isEnabled:x,isGloballyEnabled:I}),e(!1)},[e]);w.useEffect(()=>{c()},[c]);const d=async()=>{const{currentUrl:f,disabledUrls:E,isEnabled:p}=a;let C=[...E];p?C.includes(f)||C.push(f):C=C.filter(I=>I!==f),await Ce.setItem(os,C),i(I=>({...I,disabledUrls:C,isEnabled:!p}))},m=async()=>{await Ce.setItem(os,[]),i(f=>({...f,disabledUrls:[],isEnabled:!0}))},g=async()=>{const f=!a.isGloballyEnabled;await Ce.setItem(gy,f),i(E=>({...E,isGloballyEnabled:f}))};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.globalSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("passkeys.settings.passkeyProvider")}),l.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?r("settings.activeOnAllSites"):r("settings.disabledOnAllSites")})]}),l.jsx("button",{onClick:g,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?r("common.enabled"):r("common.disabled")})]})})})]}),a.isGloballyEnabled&&l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.siteSpecificSettings")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs("p",{className:"font-medium text-gray-900 dark:text-white",children:[r("passkeys.settings.passkeyProviderOn"),a.currentUrl]}),l.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?r("settings.enabledForThisSite"):r("settings.disabledForThisSite")})]}),a.isGloballyEnabled&&l.jsx("button",{onClick:d,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?r("common.enabled"):r("common.disabled")})]}),l.jsx("div",{className:"mt-4",children:l.jsx("button",{onClick:m,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:r("settings.resetAllSiteSettings")})})]})})]})]})},xE="local:theme",EI=w.createContext(void 0),EB=({children:r})=>{const[e,a]=w.useState("system"),[i,s]=w.useState(!1);w.useEffect(()=>{(async()=>{const E=await d();a(E)})()},[]);const c=w.useCallback(f=>{a(f),m(f)},[]),d=async()=>await Ce.getItem(xE)||"system",m=async f=>{await Ce.setItem(xE,f)};w.useEffect(()=>{const f=()=>{if(e==="system"){const E=window.matchMedia("(prefers-color-scheme: dark)").matches;s(E),document.documentElement.classList.toggle("dark",E)}else{const E=e==="dark";s(E),document.documentElement.classList.toggle("dark",E)}};if(f(),e==="system"){const E=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>f();return E.addEventListener("change",p),()=>E.removeEventListener("change",p)}},[e]);const g=w.useMemo(()=>({theme:e,setTheme:c,isDarkMode:i}),[e,i,c]);return l.jsx(EI.Provider,{value:g,children:r})},bB=()=>{const r=w.useContext(EI);if(r===void 0)throw new Error("useTheme must be used within a ThemeProvider");return r},IB=()=>{var V,G;const{t:r}=Ge(),{theme:e,setTheme:a}=bB(),i=Vn(),s=jl(),c=zn(),{setHeaderButtons:d}=Kn(),{setIsInitialLoading:m}=na(),{loadApiUrl:g,getDisplayUrl:f}=Xb(),E=pa(),[p,C]=w.useState(!1),I=async()=>{const q=await Ce.getItem("local:clientUrl");let W=ja.DEFAULT_CLIENT_URL;q&&q.length>0&&(W=q),window.open(W,"_blank")};w.useEffect(()=>{const q=l.jsxs("div",{className:"flex items-center gap-2",children:[!aa.isPopup()&&l.jsx(l.Fragment,{children:l.jsx(cn,{onClick:()=>aa.openInNewPopup(),title:r("common.openInNewWindow"),iconType:Ca.EXPAND})}),l.jsx(cn,{onClick:I,title:r("settings.openWebApp"),iconType:Ca.EXTERNAL_LINK})]});return d(q),()=>d(null)},[d,r]);const x=w.useCallback(async()=>{await g(),m(!1)},[m,g]);w.useEffect(()=>{x()},[x]);const T=async q=>{a(q)},k=()=>{C(!0)},R=async()=>{C(!1);try{await c.revokeTokens(),await s.clearAuthUserInitiated()}catch(q){console.error("Error during logout:",q)}},B=async()=>{await lt("LOCK_VAULT",{},"background"),E("/unlock")},S=()=>{E("/settings/autofill")},j=()=>{E("/settings/clipboard")},_=()=>{E("/settings/language")},P=()=>{E("/settings/auto-lock")},K=()=>{E("/settings/unlock-method")},H=()=>{E("/settings/context-menu")},Q=()=>{E("/settings/passkeys")};return l.jsxs(l.Fragment,{children:[l.jsx(uh,{isOpen:p,onClose:()=>C(!1),onConfirm:R}),l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h2",{className:"text-gray-900 dark:text-white text-xl",children:r("common.settings")})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center",children:l.jsx("span",{className:"text-primary-600 dark:text-primary-400 text-lg font-medium",children:((G=(V=i.username)==null?void 0:V[0])==null?void 0:G.toUpperCase())||"?"})})}),l.jsxs("div",{children:[l.jsx("p",{className:"text font-medium text-gray-900 dark:text-white",children:i.username}),l.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:r("common.loggedIn")})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:B,title:r("settings.lock"),className:"p-2 bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 rounded-md transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24","aria-label":r("settings.lock"),children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),l.jsx("button",{onClick:k,title:r("common.logout"),className:"p-2 bg-red-100 hover:bg-red-200 dark:bg-red-900/30 dark:hover:bg-red-900/50 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 rounded-md transition-colors",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24","aria-label":r("common.logout"),children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})})})]})]})})})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsxs("button",{onClick:K,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.unlockMethod.title")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:P,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.autoLockTimeout")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:S,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.autofillSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:Q,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",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"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.passkeySettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})})}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsxs("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:[l.jsxs("button",{onClick:j,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.clipboardSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:H,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16m-7 6h7"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.contextMenuSettings")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),l.jsxs("button",{onClick:_,className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-3 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})}),l.jsx("span",{className:"text-gray-900 dark:text-white text-left",children:r("settings.language")})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})})}),l.jsxs("section",{children:[l.jsx("h3",{className:"text-md font-semibold text-gray-900 dark:text-white mb-3",children:r("settings.appearance")}),l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white mb-2",children:r("settings.theme")}),l.jsxs("div",{className:"flex flex-col space-y-2",children:[l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"system",checked:e==="system",onChange:()=>T("system"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.useDefault")})]}),l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"light",checked:e==="light",onChange:()=>T("light"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.light")})]}),l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"radio",name:"theme",value:"dark",checked:e==="dark",onChange:()=>T("dark"),className:"mr-2"}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r("settings.dark")})]})]})]})})})]}),!1,l.jsxs("div",{className:"text-center text-gray-400 dark:text-gray-600",children:[r("settings.versionPrefix"),ja.VERSION," (",f(),")"]})]})]})},vB=()=>{const{t:r}=Ge(),e=Ft(),{setIsInitialLoading:a,showLoading:i,hideLoading:s}=na(),[c,d]=w.useState(void 0),[m,g]=w.useState(null),[f,E]=w.useState(null),[p,C]=w.useState(!1),[I,x]=w.useState(1),[T,k]=w.useState(""),[R,B]=w.useState(""),[S,j]=w.useState(!1),_=w.useCallback(async()=>{try{const[V,G]=await Promise.all([Nb(),Tb()]);d(V),j(G),a(!1)}catch(V){console.error("Failed to load PIN settings:",V),g(r("common.errors.unknownErrorTryAgain")),a(!1)}},[a,r]);w.useEffect(()=>{_()},[_]);const P=()=>{if(g(null),E(null),!e.dbAvailable){g(r("common.errors.unknownErrorTryAgain"));return}x(1),k(""),B(""),C(!0)},K=V=>{if(V.preventDefault(),g(null),!rh(T)){g(r("settings.unlockMethod.invalidPinFormat"));return}x(2)},H=async V=>{if(V.preventDefault(),g(null),E(null),T!==R){g(r("settings.unlockMethod.pinMismatch"));return}try{i();const q=await Ce.getItem("session:encryptionKey");if(!q){g(r("common.errors.unknownErrorTryAgain")),s();return}await mk(T,q),d(!0),C(!1),x(1),k(""),B(""),E(r("settings.unlockMethod.enableSuccess")),s()}catch(G){console.error("Failed to enable PIN:",G),G instanceof Bl?g(r("settings.unlockMethod.invalidPinFormat")):g(r("common.errors.unknownErrorTryAgain")),s()}},Q=async()=>{g(null),E(null);try{i(),await ih(),d(!1),j(!1),s()}catch(V){console.error("Failed to disable PIN:",V),g(r("common.errors.unknownErrorTryAgain")),s()}};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-start gap-2",children:l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("settings.unlockMethod.introText")})}),l.jsxs("div",{className:"mt-6",children:[m&&l.jsx(ns,{type:"error",message:m,className:"mb-4"}),f&&l.jsx(ns,{type:"success",message:f,className:"mb-4"}),S&&l.jsx(ns,{type:"warning",message:r("settings.unlockMethod.pinLocked"),className:"mb-4"}),l.jsx("section",{children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.unlockMethod.pin")}),l.jsx(yI,{title:r("common.notice"),content:r("settings.unlockMethod.pinSecurityWarning"),className:"ml-2"})]}),l.jsx("p",{className:"text-sm mt-1 text-gray-600 dark:text-gray-400",children:r("settings.unlockMethod.pinDescription")})]})]}),c!==void 0&&l.jsx("button",{onClick:c&&!S?Q:P,className:`px-4 py-2 rounded-md transition-colors ${c&&!S?"bg-green-500 hover:bg-green-600 text-white":"bg-red-500 hover:bg-red-600 text-white"}`,children:r(c&&!S?"common.enabled":"common.disabled")})]})})})}),l.jsx("section",{className:"mt-4",children:l.jsx("div",{className:"bg-gray-50 dark:bg-gray-700/30 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("svg",{className:"w-5 h-5 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),l.jsx("div",{children:l.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:r("settings.unlockMethod.password")})})]}),l.jsx("div",{className:"px-4 py-2 rounded-md bg-green-500 text-white hover:bg-green-600 cursor-not-allowed",children:r("common.enabled")})]})})})}),p&&l.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md w-full mx-4 relative",children:[l.jsx("button",{type:"button",onClick:()=>{C(!1),x(1),k(""),B(""),g(null)},className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 transition-colors","aria-label":"Cancel",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),I===1&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 pr-8",children:r("settings.unlockMethod.setupPin")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:r("settings.unlockMethod.enterNewPinDescription")}),l.jsxs("form",{onSubmit:K,children:[l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:T,onChange:V=>k(V.target.value.replace(/\D/g,"")),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-center text-2xl tracking-widest",autoFocus:!0})}),m&&l.jsx(ns,{type:"error",message:m,className:"mb-4"}),l.jsx(ta,{type:"submit",children:r("common.next")})]})]}),I===2&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4 pr-8",children:r("settings.unlockMethod.confirmPin")}),l.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:r("settings.unlockMethod.confirmPinDescription")}),l.jsxs("form",{onSubmit:H,children:[l.jsx("div",{className:"mb-4",children:l.jsx("input",{type:"password",inputMode:"numeric",pattern:"[0-9]*",maxLength:8,value:R,onChange:V=>B(V.target.value.replace(/\D/g,"")),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-center text-2xl tracking-widest",autoFocus:!0})}),m&&l.jsx(ns,{type:"error",message:m,className:"mb-4"}),l.jsx(ta,{type:"submit",children:r("common.confirm")})]})]})]})})]})]})},wB=({routes:r,isLoading:e,message:a,headerButtons:i})=>{const s=Ha(),c=r.find(f=>{const E=f.path.replace(/:\w+/g,"[^/]+");return new RegExp(`^${E}$`).test(s.pathname)}),d=(c==null?void 0:c.layout)??"default",m=e&&l.jsx("div",{className:"fixed inset-0 bg-white dark:bg-gray-900 z-50 flex items-center justify-center",children:l.jsx(Un,{})}),g=l.jsx(cb,{children:r.map(f=>l.jsx(Yg,{path:f.path,element:f.element},f.path))});switch(d){case"passkey":return l.jsxs(vk,{children:[m,a&&l.jsx("p",{className:"mb-4 text-red-500 dark:text-red-400 text-sm",children:a}),g]});case"auth":return l.jsxs("div",{className:"min-h-screen min-w-[350px] bg-white dark:bg-gray-900 flex flex-col max-h-[600px]",children:[m,l.jsx(Bb,{routes:r,rightButtons:i}),l.jsxs("main",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-gray-900",style:{paddingTop:"64px",height:"100%"},children:[a&&l.jsx("div",{className:"px-4 pt-0",children:l.jsx("p",{className:"text-red-500 dark:text-red-400 text-sm",children:a})}),g]})]});case"default":default:return l.jsxs(l.Fragment,{children:[m,l.jsx(Ik,{routes:r,headerButtons:i,message:a,children:g})]})}},CB=()=>{const{t:r}=Ge(),e=Vn(),{isInitialLoading:a}=na(),[i,s]=Pl(!0,150),[c,d]=w.useState(null),{headerButtons:m}=Kn(),g=zg.useMemo(()=>[{path:"/",element:l.jsx(AL,{}),showBackButton:!1},{path:"/reinitialize",element:l.jsx(mB,{}),showBackButton:!1},{path:"/login",element:l.jsx(sL,{}),showBackButton:!1,layout:"auth"},{path:"/unlock",element:l.jsx(oL,{}),showBackButton:!1,layout:"auth"},{path:"/unlock-success",element:l.jsx(lL,{}),showBackButton:!1},{path:"/upgrade",element:l.jsx(dL,{}),showBackButton:!1},{path:"/auth-settings",element:l.jsx(m2,{}),showBackButton:!0,title:r("common.settings")},{path:"/items",element:l.jsx(bE,{}),showBackButton:!1},{path:"/items/folder/:folderId",element:l.jsx(bE,{}),showBackButton:!0,title:r("items.title")},{path:"/items/select-type",element:l.jsx(aB,{}),showBackButton:!0,title:r("itemTypes.selectType")},{path:"/items/add",element:l.jsx(pE,{}),showBackButton:!0,title:r("items.addItem")},{path:"/items/deleted",element:l.jsx(rB,{}),showBackButton:!0,title:r("recentlyDeleted.title")},{path:"/items/:id",element:l.jsx(XD,{}),showBackButton:!0,title:r("items.itemDetails")},{path:"/items/:id/edit",element:l.jsx(pE,{}),showBackButton:!0,title:r("items.editItem")},{path:"/passkeys/create",element:l.jsx(uB,{}),layout:"passkey"},{path:"/passkeys/authenticate",element:l.jsx(cB,{}),layout:"passkey"},{path:"/emails",element:l.jsx(hL,{}),showBackButton:!1},{path:"/emails/:id",element:l.jsx(gL,{}),showBackButton:!0,title:r("emails.title")},{path:"/settings",element:l.jsx(IB,{}),showBackButton:!1},{path:"/settings/unlock-method",element:l.jsx(vB,{}),showBackButton:!0,title:r("settings.unlockMethod.title")},{path:"/settings/autofill",element:l.jsx(fB,{}),showBackButton:!0,title:r("settings.autofillSettings")},{path:"/settings/context-menu",element:l.jsx(AB,{}),showBackButton:!0,title:r("settings.contextMenuSettings")},{path:"/settings/clipboard",element:l.jsx(hB,{}),showBackButton:!0,title:r("settings.clipboardSettings")},{path:"/settings/language",element:l.jsx(pB,{}),showBackButton:!0,title:r("settings.language")},{path:"/settings/auto-lock",element:l.jsx(gB,{}),showBackButton:!0,title:r("settings.autoLockTimeout")},{path:"/settings/passkeys",element:l.jsx(yB,{}),showBackButton:!0,title:r("settings.passkeySettings")}],[r]);return w.useEffect(()=>{a||s(!1)},[a,s]),w.useEffect(()=>{lt("POPUP_HEARTBEAT",{},"background").catch(()=>{});const f=setInterval(()=>{lt("POPUP_HEARTBEAT",{},"background").catch(()=>{})},5e3);return()=>{clearInterval(f)}},[]),w.useEffect(()=>{window.location.hash&&window.location.hash!=="#/"&&window.location.hash!=="#"||sB()},[]),w.useEffect(()=>{e.globalMessage?d(e.globalMessage):d(null)},[e,e.globalMessage]),l.jsx(KC,{children:l.jsx(kk,{children:l.jsx(wB,{routes:g,isLoading:i,message:c,headerButtons:m})})})},ut=r=>typeof r=="string",Il=()=>{let r,e;const a=new Promise((i,s)=>{r=i,e=s});return a.resolve=r,a.reject=e,a},TE=r=>r==null?"":""+r,NB=(r,e,a)=>{r.forEach(i=>{e[i]&&(a[i]=e[i])})},xB=/###/g,SE=r=>r&&r.indexOf("###")>-1?r.replace(xB,"."):r,kE=r=>!r||ut(r),Rl=(r,e,a)=>{const i=ut(e)?e.split("."):e;let s=0;for(;s<i.length-1;){if(kE(r))return{};const c=SE(i[s]);!r[c]&&a&&(r[c]=new a),Object.prototype.hasOwnProperty.call(r,c)?r=r[c]:r={},++s}return kE(r)?{}:{obj:r,k:SE(i[s])}},LE=(r,e,a)=>{const{obj:i,k:s}=Rl(r,e,Object);if(i!==void 0||e.length===1){i[s]=a;return}let c=e[e.length-1],d=e.slice(0,e.length-1),m=Rl(r,d,Object);for(;m.obj===void 0&&d.length;)c=`${d[d.length-1]}.${c}`,d=d.slice(0,d.length-1),m=Rl(r,d,Object),m!=null&&m.obj&&typeof m.obj[`${m.k}.${c}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${c}`]=a},TB=(r,e,a,i)=>{const{obj:s,k:c}=Rl(r,e,Object);s[c]=s[c]||[],s[c].push(a)},Hu=(r,e)=>{const{obj:a,k:i}=Rl(r,e);if(a&&Object.prototype.hasOwnProperty.call(a,i))return a[i]},SB=(r,e,a)=>{const i=Hu(r,a);return i!==void 0?i:Hu(e,a)},bI=(r,e,a)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in r?ut(r[i])||r[i]instanceof String||ut(e[i])||e[i]instanceof String?a&&(r[i]=e[i]):bI(r[i],e[i],a):r[i]=e[i]);return r},to=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const LB=r=>ut(r)?r.replace(/[&<>"'\/]/g,e=>kB[e]):r;class RB{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const a=this.regExpMap.get(e);if(a!==void 0)return a;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const DB=[" ",",","?","!",";"],BB=new RB(20),UB=(r,e,a)=>{e=e||"",a=a||"";const i=DB.filter(d=>e.indexOf(d)<0&&a.indexOf(d)<0);if(i.length===0)return!0;const s=BB.getRegExp(`(${i.map(d=>d==="?"?"\\?":d).join("|")})`);let c=!s.test(r);if(!c){const d=r.indexOf(a);d>0&&!s.test(r.substring(0,d))&&(c=!0)}return c},Hg=(r,e,a=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const i=e.split(a);let s=r;for(let c=0;c<i.length;){if(!s||typeof s!="object")return;let d,m="";for(let g=c;g<i.length;++g)if(g!==c&&(m+=a),m+=i[g],d=s[m],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&g<i.length-1)continue;c+=g-c+1;break}s=d}return s},Ul=r=>r==null?void 0:r.replace("_","-"),_B={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var a,i;(i=(a=console==null?void 0:console[r])==null?void 0:a.apply)==null||i.call(a,console,e)}};class Qu{constructor(e,a={}){this.init(e,a)}init(e,a={}){this.prefix=a.prefix||"i18next:",this.logger=e||_B,this.options=a,this.debug=a.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,a,i,s){return s&&!this.debug?null:(ut(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[a](e))}create(e){return new Qu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Qu(this.logger,e)}}var cr=new Qu;class ad{constructor(){this.observers={}}on(e,a){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(a)||0;this.observers[i].set(a,s+1)}),this}off(e,a){if(this.observers[e]){if(!a){delete this.observers[e];return}this.observers[e].delete(a)}}emit(e,...a){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,c])=>{for(let d=0;d<c;d++)s.apply(s,[e,...a])})}}class RE extends ad{constructor(e,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const a=this.options.ns.indexOf(e);a>-1&&this.options.ns.splice(a,1)}getResource(e,a,i,s={}){var f,E;const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,d=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;e.indexOf(".")>-1?m=e.split("."):(m=[e,a],i&&(Array.isArray(i)?m.push(...i):ut(i)&&c?m.push(...i.split(c)):m.push(i)));const g=Hu(this.data,m);return!g&&!a&&!i&&e.indexOf(".")>-1&&(e=m[0],a=m[1],i=m.slice(2).join(".")),g||!d||!ut(i)?g:Hg((E=(f=this.data)==null?void 0:f[e])==null?void 0:E[a],i,c)}addResource(e,a,i,s,c={silent:!1}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[e,a];i&&(m=m.concat(d?i.split(d):i)),e.indexOf(".")>-1&&(m=e.split("."),s=a,a=m[1]),this.addNamespaces(a),LE(this.data,m,s),c.silent||this.emit("added",e,a,i,s)}addResources(e,a,i,s={silent:!1}){for(const c in i)(ut(i[c])||Array.isArray(i[c]))&&this.addResource(e,a,c,i[c],{silent:!0});s.silent||this.emit("added",e,a,i)}addResourceBundle(e,a,i,s,c,d={silent:!1,skipCopy:!1}){let m=[e,a];e.indexOf(".")>-1&&(m=e.split("."),s=i,i=a,a=m[1]),this.addNamespaces(a);let g=Hu(this.data,m)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?bI(g,i,c):g={...g,...i},LE(this.data,m,g),d.silent||this.emit("added",e,a,i)}removeResourceBundle(e,a){this.hasResourceBundle(e,a)&&delete this.data[e][a],this.removeNamespaces(a),this.emit("removed",e,a)}hasResourceBundle(e,a){return this.getResource(e,a)!==void 0}getResourceBundle(e,a){return a||(a=this.options.defaultNS),this.getResource(e,a)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const a=this.getDataByLanguage(e);return!!(a&&Object.keys(a)||[]).find(s=>a[s]&&Object.keys(a[s]).length>0)}toJSON(){return this.data}}var II={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,a,i,s){return r.forEach(c=>{var d;e=((d=this.processors[c])==null?void 0:d.process(e,a,i,s))??e}),e}};const DE={},BE=r=>!ut(r)&&typeof r!="boolean"&&typeof r!="number";class zu extends ad{constructor(e,a={}){super(),NB(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=cr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,a={interpolation:{}}){const i={...a};if(e==null)return!1;const s=this.resolve(e,i);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,a){let i=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const d=i&&e.indexOf(i)>-1,m=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!UB(e,i,s);if(d&&!m){const g=e.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:e,namespaces:ut(c)?[c]:c};const f=e.split(i);(i!==s||i===s&&this.options.ns.indexOf(f[0])>-1)&&(c=f.shift()),e=f.join(s)}return{key:e,namespaces:ut(c)?[c]:c}}translate(e,a,i){let s=typeof a=="object"?{...a}:a;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const c=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,d=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:m,namespaces:g}=this.extractFromKey(e[e.length-1],s),f=g[g.length-1];let E=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;E===void 0&&(E=":");const p=s.lng||this.language,C=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return C?c?{res:`${f}${E}${m}`,usedKey:m,exactUsedKey:m,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${E}${m}`:c?{res:m,usedKey:m,exactUsedKey:m,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:m;const I=this.resolve(e,s);let x=I==null?void 0:I.res;const T=(I==null?void 0:I.usedKey)||m,k=(I==null?void 0:I.exactUsedKey)||m,R=["[object Number]","[object Function]","[object RegExp]"],B=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,j=s.count!==void 0&&!ut(s.count),_=zu.hasDefaultValue(s),P=j?this.pluralResolver.getSuffix(p,s.count,s):"",K=s.ordinal&&j?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",H=j&&!s.ordinal&&s.count===0,Q=H&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${K}`]||s.defaultValue;let V=x;S&&!x&&_&&(V=Q);const G=BE(V),q=Object.prototype.toString.apply(V);if(S&&V&&G&&R.indexOf(q)<0&&!(ut(B)&&Array.isArray(V))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,V,{...s,ns:g}):`key '${m} (${this.language})' returned an object instead of string.`;return c?(I.res=W,I.usedParams=this.getUsedParamsDetails(s),I):W}if(d){const W=Array.isArray(V),ne=W?[]:{},de=W?k:T;for(const X in V)if(Object.prototype.hasOwnProperty.call(V,X)){const ae=`${de}${d}${X}`;_&&!x?ne[X]=this.translate(ae,{...s,defaultValue:BE(Q)?Q[X]:void 0,joinArrays:!1,ns:g}):ne[X]=this.translate(ae,{...s,joinArrays:!1,ns:g}),ne[X]===ae&&(ne[X]=V[X])}x=ne}}else if(S&&ut(B)&&Array.isArray(x))x=x.join(B),x&&(x=this.extendTranslation(x,e,s,i));else{let W=!1,ne=!1;!this.isValidLookup(x)&&_&&(W=!0,x=Q),this.isValidLookup(x)||(ne=!0,x=m);const X=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:x,ae=_&&Q!==x&&this.options.updateMissing;if(ne||W||ae){if(this.logger.log(ae?"updateKey":"missingKey",p,f,m,ae?Q:x),d){const $=this.resolve(m,{...s,keySeparator:!1});$&&$.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 pe=[];const Ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ae&&Ae[0])for(let $=0;$<Ae.length;$++)pe.push(Ae[$]);else this.options.saveMissingTo==="all"?pe=this.languageUtils.toResolveHierarchy(s.lng||this.language):pe.push(s.lng||this.language);const O=($,Z,ce)=>{var Le;const be=_&&ce!==x?ce:X;this.options.missingKeyHandler?this.options.missingKeyHandler($,f,Z,be,ae,s):(Le=this.backendConnector)!=null&&Le.saveMissing&&this.backendConnector.saveMissing($,f,Z,be,ae,s),this.emit("missingKey",$,f,Z,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?pe.forEach($=>{const Z=this.pluralResolver.getSuffixes($,s);H&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(ce=>{O([$],m+ce,s[`defaultValue${ce}`]||Q)})}):O(pe,m,Q))}x=this.extendTranslation(x,e,s,I,i),ne&&x===m&&this.options.appendNamespaceToMissingKey&&(x=`${f}${E}${m}`),(ne||W)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${E}${m}`:m,W?x:void 0,s))}return c?(I.res=x,I.usedParams=this.getUsedParamsDetails(s),I):x}extendTranslation(e,a,i,s,c){var g,f;if((g=this.i18nFormat)!=null&&g.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const E=ut(e)&&(((f=i==null?void 0:i.interpolation)==null?void 0:f.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(E){const I=e.match(this.interpolator.nestingRegexp);p=I&&I.length}let C=i.replace&&!ut(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),e=this.interpolator.interpolate(e,C,i.lng||this.language||s.usedLng,i),E){const I=e.match(this.interpolator.nestingRegexp),x=I&&I.length;p<x&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...I)=>(c==null?void 0:c[0])===I[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${I[0]} in key: ${a[0]}`),null):this.translate(...I,a),i)),i.interpolation&&this.interpolator.reset()}const d=i.postProcess||this.options.postProcess,m=ut(d)?[d]:d;return e!=null&&(m!=null&&m.length)&&i.applyPostProcessor!==!1&&(e=II.handle(m,e,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,a={}){let i,s,c,d,m;return ut(e)&&(e=[e]),e.forEach(g=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(g,a),E=f.key;s=E;let p=f.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const C=a.count!==void 0&&!ut(a.count),I=C&&!a.ordinal&&a.count===0,x=a.context!==void 0&&(ut(a.context)||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);p.forEach(k=>{var R,B;this.isValidLookup(i)||(m=k,!DE[`${T[0]}-${k}`]&&((R=this.utils)!=null&&R.hasLoadedNamespace)&&!((B=this.utils)!=null&&B.hasLoadedNamespace(m))&&(DE[`${T[0]}-${k}`]=!0,this.logger.warn(`key "${s}" for languages "${T.join(", ")}" won't get resolved as namespace "${m}" 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!!!")),T.forEach(S=>{var P;if(this.isValidLookup(i))return;d=S;const j=[E];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(j,E,S,k,a);else{let K;C&&(K=this.pluralResolver.getSuffix(S,a.count,a));const H=`${this.options.pluralSeparator}zero`,Q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(C&&(j.push(E+K),a.ordinal&&K.indexOf(Q)===0&&j.push(E+K.replace(Q,this.options.pluralSeparator)),I&&j.push(E+H)),x){const V=`${E}${this.options.contextSeparator}${a.context}`;j.push(V),C&&(j.push(V+K),a.ordinal&&K.indexOf(Q)===0&&j.push(V+K.replace(Q,this.options.pluralSeparator)),I&&j.push(V+H))}}let _;for(;_=j.pop();)this.isValidLookup(i)||(c=_,i=this.getResource(S,k,_,a))}))})}),{res:i,usedKey:s,exactUsedKey:c,usedLng:d,usedNS:m}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,a,i,s={}){var c;return(c=this.i18nFormat)!=null&&c.getResource?this.i18nFormat.getResource(e,a,i,s):this.resourceStore.getResource(e,a,i,s)}getUsedParamsDetails(e={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!ut(e.replace);let s=i?e.replace:e;if(i&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const c of a)delete s[c]}return s}static hasDefaultValue(e){const a="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&a===i.substring(0,a.length)&&e[i]!==void 0)return!0;return!1}}class UE{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=cr.create("languageUtils")}getScriptPartFromCode(e){if(e=Ul(e),!e||e.indexOf("-")<0)return null;const a=e.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(e){if(e=Ul(e),!e||e.indexOf("-")<0)return e;const a=e.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(e){if(ut(e)&&e.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(e)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let a;return e.forEach(i=>{if(a)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(a=s)}),!a&&this.options.supportedLngs&&e.forEach(i=>{if(a)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return a=s;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(d=>{if(d===c)return d;if(!(d.indexOf("-")<0&&c.indexOf("-")<0)&&(d.indexOf("-")>0&&c.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===c||d.indexOf(c)===0&&c.length>1))return d})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(e,a){if(!e)return[];if(typeof e=="function"&&(e=e(a)),ut(e)&&(e=[e]),Array.isArray(e))return e;if(!a)return e.default||[];let i=e[a];return i||(i=e[this.getScriptPartFromCode(a)]),i||(i=e[this.formatLanguageCode(a)]),i||(i=e[this.getLanguagePartFromCode(a)]),i||(i=e.default),i||[]}toResolveHierarchy(e,a){const i=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],e),s=[],c=d=>{d&&(this.isSupportedCode(d)?s.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return ut(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(e))):ut(e)&&c(this.formatLanguageCode(e)),i.forEach(d=>{s.indexOf(d)<0&&c(this.formatLanguageCode(d))}),s}}const _E={zero:0,one:1,two:2,few:3,many:4,other:5},ME={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class MB{constructor(e,a={}){this.languageUtils=e,this.options=a,this.logger=cr.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,a){this.rules[e]=a}clearCache(){this.pluralRulesCache={}}getRule(e,a={}){const i=Ul(e==="dev"?"en":e),s=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:s});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let d;try{d=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ME;if(!e.match(/-|_/))return ME;const g=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(g,a)}return this.pluralRulesCache[c]=d,d}needsPlural(e,a={}){let i=this.getRule(e,a);return i||(i=this.getRule("dev",a)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,a,i={}){return this.getSuffixes(e,i).map(s=>`${a}${s}`)}getSuffixes(e,a={}){let i=this.getRule(e,a);return i||(i=this.getRule("dev",a)),i?i.resolvedOptions().pluralCategories.sort((s,c)=>_E[s]-_E[c]).map(s=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,a,i={}){const s=this.getRule(e,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(a)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",a,i))}}const FE=(r,e,a,i=".",s=!0)=>{let c=SB(r,e,a);return!c&&s&&ut(a)&&(c=Hg(r,a,i),c===void 0&&(c=Hg(e,a,i))),c},Ag=r=>r.replace(/\$/g,"$$$$");class FB{constructor(e={}){var a;this.logger=cr.create("interpolator"),this.options=e,this.format=((a=e==null?void 0:e.interpolation)==null?void 0:a.format)||(i=>i),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:a,escapeValue:i,useRawValueToEscape:s,prefix:c,prefixEscaped:d,suffix:m,suffixEscaped:g,formatSeparator:f,unescapeSuffix:E,unescapePrefix:p,nestingPrefix:C,nestingPrefixEscaped:I,nestingSuffix:x,nestingSuffixEscaped:T,nestingOptionsSeparator:k,maxReplaces:R,alwaysFormat:B}=e.interpolation;this.escape=a!==void 0?a:LB,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=c?to(c):d||"{{",this.suffix=m?to(m):g||"}}",this.formatSeparator=f||",",this.unescapePrefix=E?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":E||"",this.nestingPrefix=C?to(C):I||to("$t("),this.nestingSuffix=x?to(x):T||to(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=R||1e3,this.alwaysFormat=B!==void 0?B:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(a,i)=>(a==null?void 0:a.source)===i?(a.lastIndex=0,a):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,a,i,s){var I;let c,d,m;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=x=>{if(x.indexOf(this.formatSeparator)<0){const B=FE(a,g,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(B,void 0,i,{...s,...a,interpolationkey:x}):B}const T=x.split(this.formatSeparator),k=T.shift().trim(),R=T.join(this.formatSeparator).trim();return this.format(FE(a,g,k,this.options.keySeparator,this.options.ignoreJSONStructure),R,i,{...s,...a,interpolationkey:k})};this.resetRegExp();const E=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((I=s==null?void 0:s.interpolation)==null?void 0:I.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>Ag(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?Ag(this.escape(x)):Ag(x)}].forEach(x=>{for(m=0;c=x.regex.exec(e);){const T=c[1].trim();if(d=f(T),d===void 0)if(typeof E=="function"){const R=E(e,c,s);d=ut(R)?R:""}else if(s&&Object.prototype.hasOwnProperty.call(s,T))d="";else if(p){d=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${e}`),d="";else!ut(d)&&!this.useRawValueToEscape&&(d=TE(d));const k=x.safeValue(d);if(e=e.replace(c[0],k),p?(x.regex.lastIndex+=d.length,x.regex.lastIndex-=c[0].length):x.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),e}nest(e,a,i={}){let s,c,d;const m=(g,f)=>{const E=this.nestingOptionsSeparator;if(g.indexOf(E)<0)return g;const p=g.split(new RegExp(`${E}[ ]*{`));let C=`{${p[1]}`;g=p[0],C=this.interpolate(C,d);const I=C.match(/'/g),x=C.match(/"/g);(((I==null?void 0:I.length)??0)%2===0&&!x||x.length%2!==0)&&(C=C.replace(/'/g,'"'));try{d=JSON.parse(C),f&&(d={...f,...d})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${E}${C}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,g};for(;s=this.nestingRegexp.exec(e);){let g=[];d={...i},d=d.replace&&!ut(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(g=s[1].slice(f).split(this.formatSeparator).map(E=>E.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),c=a(m.call(this,s[1].trim(),d),d),c&&s[0]===e&&!ut(c))return c;ut(c)||(c=TE(c)),c||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),c=""),g.length&&(c=g.reduce((E,p)=>this.format(E,p,i.lng,{...i,interpolationkey:s[1].trim()}),c.trim())),e=e.replace(s[0],c),this.regexp.lastIndex=0}return e}}const OB=r=>{let e=r.toLowerCase().trim();const a={};if(r.indexOf("(")>-1){const i=r.split("(");e=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);e==="currency"&&s.indexOf(":")<0?a.currency||(a.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?a.range||(a.range=s.trim()):s.split(";").forEach(d=>{if(d){const[m,...g]=d.split(":"),f=g.join(":").trim().replace(/^'+|'+$/g,""),E=m.trim();a[E]||(a[E]=f),f==="false"&&(a[E]=!1),f==="true"&&(a[E]=!0),isNaN(f)||(a[E]=parseInt(f,10))}})}return{formatName:e,formatOptions:a}},OE=r=>{const e={};return(a,i,s)=>{let c=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(c={...c,[s.interpolationkey]:void 0});const d=i+JSON.stringify(c);let m=e[d];return m||(m=r(Ul(i),s),e[d]=m),m(a)}},jB=r=>(e,a,i)=>r(Ul(a),i)(e);class PB{constructor(e={}){this.logger=cr.create("formatter"),this.options=e,this.init(e)}init(e,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const i=a.cacheInBuiltFormats?OE:jB;this.formats={number:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c});return m=>d.format(m)}),currency:i((s,c)=>{const d=new Intl.NumberFormat(s,{...c,style:"currency"});return m=>d.format(m)}),datetime:i((s,c)=>{const d=new Intl.DateTimeFormat(s,{...c});return m=>d.format(m)}),relativetime:i((s,c)=>{const d=new Intl.RelativeTimeFormat(s,{...c});return m=>d.format(m,c.range||"day")}),list:i((s,c)=>{const d=new Intl.ListFormat(s,{...c});return m=>d.format(m)})}}add(e,a){this.formats[e.toLowerCase().trim()]=a}addCached(e,a){this.formats[e.toLowerCase().trim()]=OE(a)}format(e,a,i,s={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(m=>m.indexOf(")")>-1)){const m=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,m)].join(this.formatSeparator)}return c.reduce((m,g)=>{var p;const{formatName:f,formatOptions:E}=OB(g);if(this.formats[f]){let C=m;try{const I=((p=s==null?void 0:s.formatParams)==null?void 0:p[s.interpolationkey])||{},x=I.locale||I.lng||s.locale||s.lng||i;C=this.formats[f](m,x,{...E,...s,...I})}catch(I){this.logger.warn(I)}return C}else this.logger.warn(`there was no format function for ${f}`);return m},e)}}const HB=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class QB extends ad{constructor(e,a,i,s={}){var c,d;super(),this.backend=e,this.store=a,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=cr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(d=(c=this.backend)==null?void 0:c.init)==null||d.call(c,i,s.backend,s)}queueLoad(e,a,i,s){const c={},d={},m={},g={};return e.forEach(f=>{let E=!0;a.forEach(p=>{const C=`${f}|${p}`;!i.reload&&this.store.hasResourceBundle(f,p)?this.state[C]=2:this.state[C]<0||(this.state[C]===1?d[C]===void 0&&(d[C]=!0):(this.state[C]=1,E=!1,d[C]===void 0&&(d[C]=!0),c[C]===void 0&&(c[C]=!0),g[p]===void 0&&(g[p]=!0)))}),E||(m[f]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(g)}}loaded(e,a,i){const s=e.split("|"),c=s[0],d=s[1];a&&this.emit("failedLoading",c,d,a),!a&&i&&this.store.addResourceBundle(c,d,i,void 0,void 0,{skipCopy:!0}),this.state[e]=a?-1:2,a&&i&&(this.state[e]=0);const m={};this.queue.forEach(g=>{TB(g.loaded,[c],d),HB(g,e),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(f=>{m[f]||(m[f]={});const E=g.loaded[f];E.length&&E.forEach(p=>{m[f][p]===void 0&&(m[f][p]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(g=>!g.done)}read(e,a,i,s=0,c=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:a,fcName:i,tried:s,wait:c,callback:d});return}this.readingCalls++;const m=(f,E)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&E&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,a,i,s+1,c*2,d)},c);return}d(f,E)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const f=g(e,a);f&&typeof f.then=="function"?f.then(E=>m(null,E)).catch(m):m(null,f)}catch(f){m(f)}return}return g(e,a,m)}prepareLoading(e,a,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();ut(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ut(a)&&(a=[a]);const c=this.queueLoad(e,a,i,s);if(!c.toLoad.length)return c.pending.length||s(),null;c.toLoad.forEach(d=>{this.loadOne(d)})}load(e,a,i){this.prepareLoading(e,a,{},i)}reload(e,a,i){this.prepareLoading(e,a,{reload:!0},i)}loadOne(e,a=""){const i=e.split("|"),s=i[0],c=i[1];this.read(s,c,"read",void 0,void 0,(d,m)=>{d&&this.logger.warn(`${a}loading namespace ${c} for language ${s} failed`,d),!d&&m&&this.logger.log(`${a}loaded namespace ${c} for language ${s}`,m),this.loaded(e,d,m)})}saveMissing(e,a,i,s,c,d={},m=()=>{}){var g,f,E,p,C;if((f=(g=this.services)==null?void 0:g.utils)!=null&&f.hasLoadedNamespace&&!((p=(E=this.services)==null?void 0:E.utils)!=null&&p.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${i}" 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(!(i==null||i==="")){if((C=this.backend)!=null&&C.create){const I={...d,isUpdate:c},x=this.backend.create.bind(this.backend);if(x.length<6)try{let T;x.length===5?T=x(e,a,i,s,I):T=x(e,a,i,s),T&&typeof T.then=="function"?T.then(k=>m(null,k)).catch(m):m(null,T)}catch(T){m(T)}else x(e,a,i,s,m,I)}!e||!e[0]||this.store.addResource(e[0],a,i,s)}}}const jE=()=>({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:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),ut(r[1])&&(e.defaultValue=r[1]),ut(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const a=r[3]||r[2];Object.keys(a).forEach(i=>{e[i]=a[i]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),PE=r=>{var e,a;return ut(r.ns)&&(r.ns=[r.ns]),ut(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),ut(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((a=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:a.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},hu=()=>{},zB=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(a=>{typeof r[a]=="function"&&(r[a]=r[a].bind(r))})};class _l extends ad{constructor(e={},a){if(super(),this.options=PE(e),this.services={},this.logger=cr,this.modules={external:[]},zB(this),a&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,a),this;setTimeout(()=>{this.init(e,a)},0)}}init(e={},a){this.isInitializing=!0,typeof e=="function"&&(a=e,e={}),e.defaultNS==null&&e.ns&&(ut(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=jE();this.options={...i,...this.options,...PE(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?cr.init(s(this.modules.logger),this.options):cr.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=PB;const E=new UE(this.options);this.store=new RE(this.options.resources,this.options);const p=this.services;p.logger=cr,p.resourceStore=this.store,p.languageUtils=E,p.pluralResolver=new MB(E,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.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"),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=s(f),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new FB(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new QB(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(I,...x)=>{this.emit(I,...x)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new zu(this.services,this.options),this.translator.on("*",(I,...x)=>{this.emit(I,...x)}),this.modules.external.forEach(I=>{I.init&&I.init(this)})}if(this.format=this.options.interpolation.format,a||(a=hu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=(...E)=>this.store[f](...E)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...E)=>(this.store[f](...E),this)});const m=Il(),g=()=>{const f=(E,p)=>{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),m.resolve(p),a(E,p)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),m}loadResources(e,a=hu){var c,d;let i=a;const s=ut(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const m=[],g=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&m.indexOf(p)<0&&m.push(p)})};s?g(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(E=>g(E)),(d=(c=this.options.preload)==null?void 0:c.forEach)==null||d.call(c,f=>g(f)),this.services.backendConnector.load(m,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(f)})}else i(null)}reloadResources(e,a,i){const s=Il();return typeof e=="function"&&(i=e,e=void 0),typeof a=="function"&&(i=a,a=void 0),e||(e=this.languages),a||(a=this.options.ns),i||(i=hu),this.services.backendConnector.reload(e,a,c=>{s.resolve(),i(c)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&II.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let a=0;a<this.languages.length;a++){const i=this.languages[a];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,a){this.isLanguageChangingTo=e;const i=Il();this.emit("languageChanging",e);const s=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},c=(m,g)=>{g?this.isLanguageChangingTo===e&&(s(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),a&&a(m,(...f)=>this.t(...f))},d=m=>{var E,p;!e&&!m&&this.services.languageDetector&&(m=[]);const g=ut(m)?m:m&&m[0],f=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(ut(m)?[m]:m);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),(p=(E=this.services.languageDetector)==null?void 0:E.cacheUserLanguage)==null||p.call(E,f)),this.loadResources(f,C=>{c(C,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(e),i}getFixedT(e,a,i){const s=(c,d,...m)=>{let g;typeof d!="object"?g=this.options.overloadTranslationOptionHandler([c,d].concat(m)):g={...d},g.lng=g.lng||s.lng,g.lngs=g.lngs||s.lngs,g.ns=g.ns||s.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||s.keyPrefix);const f=this.options.keySeparator||".";let E;return g.keyPrefix&&Array.isArray(c)?E=c.map(p=>`${g.keyPrefix}${f}${p}`):E=g.keyPrefix?`${g.keyPrefix}${f}${c}`:c,this.t(E,g)};return ut(e)?s.lng=e:s.lngs=e,s.ns=a,s.keyPrefix=i,s}t(...e){var a;return(a=this.translator)==null?void 0:a.translate(...e)}exists(...e){var a;return(a=this.translator)==null?void 0:a.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,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 i=a.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(m,g)=>{const f=this.services.backendConnector.state[`${m}|${g}`];return f===-1||f===0||f===2};if(a.precheck){const m=a.precheck(this,d);if(m!==void 0)return m}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(i,e)&&(!s||d(c,e)))}loadNamespaces(e,a){const i=Il();return this.options.ns?(ut(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),a&&a(s)}),i):(a&&a(),Promise.resolve())}loadLanguages(e,a){const i=Il();ut(e)&&(e=[e]);const s=this.options.preload||[],c=e.filter(d=>s.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return c.length?(this.options.preload=s.concat(c),this.loadResources(d=>{i.resolve(),a&&a(d)}),i):(a&&a(),Promise.resolve())}dir(e){var s,c;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";if(Intl.Locale){const d=new Intl.Locale(e);if(d&&d.getTextInfo){const m=d.getTextInfo();if(m&&m.direction)return m.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"],i=((c=this.services)==null?void 0:c.languageUtils)||new UE(jE());return e.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},a){return new _l(e,a)}cloneInstance(e={},a=hu){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},c=new _l(s);if((e.debug!==void 0||e.prefix!==void 0)&&(c.logger=c.logger.clone(e)),["store","services","language"].forEach(m=>{c[m]=this[m]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},i){const m=Object.keys(this.store.data).reduce((g,f)=>(g[f]={...this.store.data[f]},g[f]=Object.keys(g[f]).reduce((E,p)=>(E[p]={...g[f][p]},E),g[f]),g),{});c.store=new RE(m,s),c.services.resourceStore=c.store}return c.translator=new zu(c.services,s),c.translator.on("*",(m,...g)=>{c.emit(m,...g)}),c.init(s,a),c.translator.options=s,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Na=_l.createInstance();Na.createInstance=_l.createInstance;Na.createInstance;Na.dir;Na.init;Na.loadResources;Na.reloadResources;Na.use;Na.changeLanguage;Na.getFixedT;Na.t;Na.exists;Na.setDefaultNamespace;Na.hasLoadedNamespace;Na.loadNamespaces;Na.loadLanguages;const VB=async()=>{const r=await Ce.getItem("local:language");if(r&&Ru.includes(r))return r;const e=navigator.language.split("-")[0];return Ru.includes(e)?e:lr},KB=async()=>{const r=await VB();await Na.use(Ew).init({resources:vl,lng:r,fallbackLng:lr,debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1,bindI18n:"languageChanged loaded",bindI18nStore:""}})};KB().catch(r=>{console.error("Failed to initialize i18n:",r),Na.emit("initialized")});const HE=()=>{ow.createRoot(document.getElementById("root")).render(l.jsx(sk,{children:l.jsx(yk,{children:l.jsx(hk,{children:l.jsx(Ek,{children:l.jsx(Nk,{children:l.jsx(wk,{children:l.jsx(EB,{children:l.jsx(CB,{})})})})})})})}))};Na.isInitialized?HE():Na.on("initialized",HE)});export default GB();
