PageSourceSearch

https://data.archiveye.ai/assets/index-aHol2QYl.js

js archiveye.ai collected 2026-10-05 12:52:05 UTC 1,643,795 bytes, 1,497 lines download raw bytes

vendor: 4,678 bytes, lines 1-17
1function iM(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function ml(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pv={exports:{}},nd={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var EE;function rM(){if(EE)return nd;EE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var u in r)u!=="key"&&(s[u]=r[u])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:l,ref:r!==void 0?r:null,props:s}}return nd.Fragment=e,nd.jsx=n,nd.jsxs=n,nd}var AE;function sM(){return AE||(AE=1,pv.exports=rM()),pv.exports}var o=sM(),mv={exports:{}},ht={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var kE;function aM(){if(kE)return ht;kE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=x&&B[x]||B["@@iterator"],typeof B=="function"?B:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function E(B,H,P){this.props=B,this.context=H,this.refs=A,this.updater=P||w}E.prototype.isReactComponent={},E.prototype.setState=function(B,H){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,H,"setState")},E.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=E.prototype;function N(B,H,P){this.props=B,this.context=H,this.refs=A,this.updater=P||w}var _=N.prototype=new k;_.constructor=N,C(_,E.prototype),_.isPureReactComponent=!0;var R=Array.isArray;function T(){}var L={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function U(B,H,P){var J=P.ref;return{$$typeof:t,type:B,key:H,ref:J!==void 0?J:null,props:P}}function D(B,H){return U(B.type,H,B.props)}function G(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function Z(B){var H={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(P){return H[P]})}var Q=/\/+/g;function K(B,H){return typeof B=="object"&&B!==null&&B.key!=null?Z(""+B.key):H.toString(36)}function q(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(T,T):(B.status="pending",B.then(function(H){B.status==="pending"&&(B.status="fulfilled",B.value=H)},function(H){B.status==="pending"&&(B.status="rejected",B.reason=H)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function F(B,H,P,J,he){var ue=typeof B;(ue==="undefined"||ue==="boolean")&&(B=null);var W=!1;if(B===null)W=!0;else switch(ue){case"bigint":case"string":case"number":W=!0;break;case"object":switch(B.$$typeof){case t:case e:W=!0;break;case p:return W=B._init,F(W(B._payload),H,P,J,he)}}
vendor: 4,355 bytes, line 17
17if(W)return he=he(B),W=J===""?"."+K(B,0):J,R(he)?(P="",W!=null&&(P=W.replace(Q,"$&/")+"/"),F(he,H,P,"",function(pe){return pe})):he!=null&&(G(he)&&(he=D(he,P+(he.key==null||B&&B.key===he.key?"":(""+he.key).replace(Q,"$&/")+"/")+W)),H.push(he)),1;W=0;var fe=J===""?".":J+":";if(R(B))for(var se=0;se<B.length;se++)J=B[se],ue=fe+K(J,se),W+=F(J,H,P,ue,he);else if(se=b(B),typeof se=="function")for(B=se.call(B),se=0;!(J=B.next()).done;)J=J.value,ue=fe+K(J,se++),W+=F(J,H,P,ue,he);else if(ue==="object"){if(typeof B.then=="function")return F(q(B),H,P,J,he);throw H=String(B),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return W}function V(B,H,P){if(B==null)return B;var J=[],he=0;return F(B,J,"","",function(ue){return H.call(P,ue,he++)}),J}function O(B){if(B._status===-1){var H=B._result;H=H(),H.then(function(P){(B._status===0||B._status===-1)&&(B._status=1,B._result=P)},function(P){(B._status===0||B._status===-1)&&(B._status=2,B._result=P)}),B._status===-1&&(B._status=0,B._result=H)}if(B._status===1)return B._result.default;throw B._result}var X=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},$={map:V,forEach:function(B,H,P){V(B,function(){H.apply(this,arguments)},P)},count:function(B){var H=0;return V(B,function(){H++}),H},toArray:function(B){return V(B,function(H){return H})||[]},only:function(B){if(!G(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return ht.Activity=m,ht.Children=$,ht.Component=E,ht.Fragment=n,ht.Profiler=r,ht.PureComponent=N,ht.StrictMode=i,ht.Suspense=d,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ht.__COMPILER_RUNTIME={__proto__:null,c:function(B){return L.H.useMemoCache(B)}},ht.cache=function(B){return function(){return B.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(B,H,P){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var J=C({},B.props),he=B.key;if(H!=null)for(ue in H.key!==void 0&&(he=""+H.key),H)!M.call(H,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&H.ref===void 0||(J[ue]=H[ue]);var ue=arguments.length-2;if(ue===1)J.children=P;else if(1<ue){for(var W=Array(ue),fe=0;fe<ue;fe++)W[fe]=arguments[fe+2];J.children=W}return U(B.type,he,J)},ht.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:s,_context:B},B},ht.createElement=function(B,H,P){var J,he={},ue=null;if(H!=null)for(J in H.key!==void 0&&(ue=""+H.key),H)M.call(H,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(he[J]=H[J]);var W=arguments.length-2;if(W===1)he.children=P;else if(1<W){for(var fe=Array(W),se=0;se<W;se++)fe[se]=arguments[se+2];he.children=fe}if(B&&B.defaultProps)for(J in W=B.defaultProps,W)he[J]===void 0&&(he[J]=W[J]);return U(B,ue,he)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(B){return{$$typeof:u,render:B}},ht.isValidElement=G,ht.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:O}},ht.memo=function(B,H){return{$$typeof:f,type:B,compare:H===void 0?null:H}},ht.startTransition=function(B){var H=L.T,P={};L.T=P;try{var J=B(),he=L.S;he!==null&&he(P,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(T,X)}catch(ue){X(ue)}finally{H!==null&&P.types!==null&&(H.types=P.types),L.T=H}},ht.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ht.use=function(B){return L.H.use(B)},ht.useActionState=function(B,H,P){return L.H.useActionState(B,H,P)},ht.useCallback=function(B,H){return L.H.useCallback(B,H)},ht.useContext=function(B){return L.H.useContext(B)},ht.useDebugValue=function(){},ht.useDeferredValue=function(B,H){return L.H.useDeferredValue(B,H)},ht.useEffect=function(B,H){return L.H.useEffect(B,H)}
vendor: 6,275 bytes, lines 17-33
17,ht.useEffectEvent=function(B){return L.H.useEffectEvent(B)},ht.useId=function(){return L.H.useId()},ht.useImperativeHandle=function(B,H,P){return L.H.useImperativeHandle(B,H,P)},ht.useInsertionEffect=function(B,H){return L.H.useInsertionEffect(B,H)},ht.useLayoutEffect=function(B,H){return L.H.useLayoutEffect(B,H)},ht.useMemo=function(B,H){return L.H.useMemo(B,H)},ht.useOptimistic=function(B,H){return L.H.useOptimistic(B,H)},ht.useReducer=function(B,H,P){return L.H.useReducer(B,H,P)},ht.useRef=function(B){return L.H.useRef(B)},ht.useState=function(B){return L.H.useState(B)},ht.useSyncExternalStore=function(B,H,P){return L.H.useSyncExternalStore(B,H,P)},ht.useTransition=function(){return L.H.useTransition()},ht.version="19.2.0",ht}var NE;function hm(){return NE||(NE=1,mv.exports=aM()),mv.exports}var v=hm();const ui=ml(v),qy=iM({__proto__:null,default:ui},[v]);var gv={exports:{}},id={},xv={exports:{}},vv={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var jE;function oM(){return jE||(jE=1,(function(t){function e(F,V){var O=F.length;F.push(V);e:for(;0<O;){var X=O-1>>>1,$=F[X];if(0<r($,V))F[X]=V,F[O]=$,O=X;else break e}}function n(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var V=F[0],O=F.pop();if(O!==V){F[0]=O;e:for(var X=0,$=F.length,B=$>>>1;X<B;){var H=2*(X+1)-1,P=F[H],J=H+1,he=F[J];if(0>r(P,O))J<$&&0>r(he,P)?(F[X]=he,F[J]=O,X=J):(F[X]=P,F[H]=O,X=H);else if(J<$&&0>r(he,O))F[X]=he,F[J]=O,X=J;else break e}}return V}function r(F,V){var O=F.sortIndex-V.sortIndex;return O!==0?O:F.id-V.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,m=null,x=3,b=!1,w=!1,C=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function _(F){for(var V=n(f);V!==null;){if(V.callback===null)i(f);else if(V.startTime<=F)i(f),V.sortIndex=V.expirationTime,e(d,V);else break;V=n(f)}}function R(F){if(C=!1,_(F),!w)if(n(d)!==null)w=!0,T||(T=!0,Z());else{var V=n(f);V!==null&&q(R,V.startTime-F)}}var T=!1,L=-1,M=5,U=-1;function D(){return A?!0:!(t.unstable_now()-U<M)}function G(){if(A=!1,T){var F=t.unstable_now();U=F;var V=!0;try{e:{w=!1,C&&(C=!1,k(L),L=-1),b=!0;var O=x;try{t:{for(_(F),m=n(d);m!==null&&!(m.expirationTime>F&&D());){var X=m.callback;if(typeof X=="function"){m.callback=null,x=m.priorityLevel;var $=X(m.expirationTime<=F);if(F=t.unstable_now(),typeof $=="function"){m.callback=$,_(F),V=!0;break t}m===n(d)&&i(d),_(F)}else i(d);m=n(d)}if(m!==null)V=!0;else{var B=n(f);B!==null&&q(R,B.startTime-F),V=!1}}break e}finally{m=null,x=O,b=!1}V=void 0}}finally{V?Z():T=!1}}}var Z;if(typeof N=="function")Z=function(){N(G)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,K=Q.port2;Q.port1.onmessage=G,Z=function(){K.postMessage(null)}}else Z=function(){E(G,0)};function q(F,V){L=E(function(){F(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(F){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var O=x;x=V;try{return F()}finally{x=O}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(F,V){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var O=x;x=F;try{return V()}finally{x=O}},t.unstable_scheduleCallback=function(F,V,O){var X=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?X+O:X):O=X,F){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=O+$,F={id:p++,callback:V,priorityLevel:F,startTime:O,expirationTime:$,sortIndex:-1},O>X?(F.sortIndex=O,e(f,F),n(d)===null&&F===n(f)&&(C?(k(L),L=-1):C=!0,q(R,O-X))):(F.sortIndex=$,e(d,F),w||b||(w=!0,T||(T=!0,Z()))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var V=x;return function(){var O=x;x=V;try{return F.apply(this,arguments)}finally{x=O}}}})(vv)),vv}var _E;function lM(){return _E||(_E=1,xv.exports=oM()),xv.exports}var bv={exports:{}},oi={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var TE;function cM(){if(TE)return oi;TE=1;var t=hm();function e(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return oi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,oi.createPortal=function(d,f){var p=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 s(d,f,null,p)},oi.flushSync=function(d){var f=l.T,p=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=f,i.p=p,i.d.f()}}
vendor: 5,240 bytes, lines 33-41
33,oi.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(d,f))},oi.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},oi.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?i.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):p==="script"&&i.d.X(d,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},oi.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);i.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(d)},oi.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);i.d.L(d,p,{crossOrigin:m,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})}},oi.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);i.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(d)},oi.requestFormReset=function(d){i.d.r(d)},oi.unstable_batchedUpdates=function(d,f){return d(f)},oi.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},oi.useFormStatus=function(){return l.H.useHostTransitionStatus()},oi.version="19.2.0",oi}var RE;function mN(){if(RE)return bv.exports;RE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),bv.exports=cM(),bv.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var PE;function uM(){if(PE)return id;PE=1;var t=lM(),e=hm(),n=mN();function i(a){var c="https://react.dev/errors/"+a;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function l(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function u(a){if(a.tag===31){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function d(a){if(s(a)!==a)throw Error(i(188))}function f(a){var c=a.alternate;if(!c){if(c=s(a),c===null)throw Error(i(188));return c!==a?null:a}for(var h=a,g=c;;){var y=h.return;if(y===null)break;var S=y.alternate;if(S===null){if(g=y.return,g!==null){h=g;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===h)return d(y),a;if(S===g)return d(y),c;S=S.sibling}throw Error(i(188))}if(h.return!==g.return)h=y,g=S;else{for(var j=!1,z=y.child;z;){if(z===h){j=!0,h=y,g=S;break}if(z===g){j=!0,g=y,h=S;break}z=z.sibling}if(!j){for(z=S.child;z;){if(z===h){j=!0,h=S,g=y;break}if(z===g){j=!0,g=S,h=y;break}z=z.sibling}if(!j)throw Error(i(189))}}if(h.alternate!==g)throw Error(i(190))}if(h.tag!==3)throw Error(i(188));return h.stateNode.current===h?a:c}function p(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a;for(a=a.child;a!==null;){if(c=p(a),c!==null)return c;a=a.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Z(a){return a===null||typeof a!="object"?null:(a=G&&a[G]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Symbol.for("react.client.reference");function K(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===Q?null:a.displayName||a.name||null;
vendor: 11,619 bytes, lines 41-48
41if(typeof a=="string")return a;switch(a){case C:return"Fragment";case E:return"Profiler";case A:return"StrictMode";case R:return"Suspense";case T:return"SuspenseList";case U:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case N:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case _:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return c=a.displayName||null,c!==null?c:K(a.type)||"Memo";case M:c=a._payload,a=a._init;try{return K(a(c))}catch{}}return null}var q=Array.isArray,F=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},X=[],$=-1;function B(a){return{current:a}}function H(a){0>$||(a.current=X[$],X[$]=null,$--)}function P(a,c){$++,X[$]=a.current,a.current=c}var J=B(null),he=B(null),ue=B(null),W=B(null);function fe(a,c){switch(P(ue,c),P(he,a),P(J,null),c.nodeType){case 9:case 11:a=(a=c.documentElement)&&(a=a.namespaceURI)?KC(a):0;break;default:if(a=c.tagName,c=c.namespaceURI)c=KC(c),a=WC(c,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}H(J),P(J,a)}function se(){H(J),H(he),H(ue)}function pe(a){a.memoizedState!==null&&P(W,a);var c=J.current,h=WC(c,a.type);c!==h&&(P(he,a),P(J,h))}function Ee(a){he.current===a&&(H(J),H(he)),W.current===a&&(H(W),Zu._currentValue=O)}var Ce,Ne;function qe(a){if(Ce===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Ce=c&&c[1]||"",Ne=-1<h.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+Ce+a+Ne}var pt=!1;function $e(a,c){if(!a||pt)return"";pt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(de){var ce=de}Reflect.construct(a,[],Se)}else{try{Se.call()}catch(de){ce=de}a.call(Se.prototype)}}else{try{throw Error()}catch(de){ce=de}(Se=a())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(de){if(de&&ce&&typeof de.stack=="string")return[de.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=g.DetermineComponentFrameRoot(),j=S[0],z=S[1];if(j&&z){var Y=j.split(`
44`),oe=z.split(`
45`);for(y=g=0;g<Y.length&&!Y[g].includes("DetermineComponentFrameRoot");)g++;for(;y<oe.length&&!oe[y].includes("DetermineComponentFrameRoot");)y++;if(g===Y.length||y===oe.length)for(g=Y.length-1,y=oe.length-1;1<=g&&0<=y&&Y[g]!==oe[y];)y--;for(;1<=g&&0<=y;g--,y--)if(Y[g]!==oe[y]){if(g!==1||y!==1)do if(g--,y--,0>y||Y[g]!==oe[y]){var ge=`
46`+Y[g].replace(" at new "," at ");return a.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",a.displayName)),ge}while(1<=g&&0<=y);break}}}finally{pt=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?qe(h):""}function je(a,c){switch(a.tag){case 26:case 27:case 5:return qe(a.type);case 16:return qe("Lazy");case 13:return a.child!==c&&c!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return $e(a.type,!1);case 11:return $e(a.type.render,!1);case 1:return $e(a.type,!0);case 31:return qe("Activity");default:return""}}function xt(a){try{var c="",h=null;do c+=je(a,h),h=a,a=a.return;while(a);return c}catch(g){return`
47Error generating stack: `+g.message+`
48`+g.stack}}var Ae=Object.prototype.hasOwnProperty,at=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,me=t.unstable_shouldYield,rt=t.unstable_requestPaint,ve=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,le=t.unstable_ImmediatePriority,ye=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,et=t.unstable_LowPriority,nt=t.unstable_IdlePriority,en=t.log,tn=t.unstable_setDisableYieldValue,cn=null,zt=null;function mn(a){if(typeof en=="function"&&tn(a),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(cn,a)}catch{}}var yt=Math.clz32?Math.clz32:su,Ai=Math.log,Fn=Math.LN2;function su(a){return a>>>=0,a===0?32:31-(Ai(a)/Fn|0)|0}var bo=256,yo=262144,wo=4194304;function Nr(a){var c=a&42;if(c!==0)return c;switch(a&-a){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:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function So(a,c,h){var g=a.pendingLanes;if(g===0)return 0;var y=0,S=a.suspendedLanes,j=a.pingedLanes;a=a.warmLanes;var z=g&134217727;return z!==0?(g=z&~S,g!==0?y=Nr(g):(j&=z,j!==0?y=Nr(j):h||(h=z&~a,h!==0&&(y=Nr(h))))):(z=g&~S,z!==0?y=Nr(z):j!==0?y=Nr(j):h||(h=g&~a,h!==0&&(y=Nr(h)))),y===0?0:c!==0&&c!==y&&(c&S)===0&&(S=y&-y,h=c&-c,S>=h||S===32&&(h&4194048)!==0)?c:y}function Ps(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function El(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 xh(){var a=wo;return wo<<=1,(wo&62914560)===0&&(wo=4194304),a}function Co(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function Eo(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ug(a,c,h,g,y,S){var j=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var z=a.entanglements,Y=a.expirationTimes,oe=a.hiddenUpdates;for(h=j&~h;0<h;){var ge=31-yt(h),Se=1<<ge;z[ge]=0,Y[ge]=-1;var ce=oe[ge];if(ce!==null)for(oe[ge]=null,ge=0;ge<ce.length;ge++){var de=ce[ge];de!==null&&(de.lane&=-536870913)}h&=~Se}g!==0&&vh(a,g,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(j&~c))}function vh(a,c,h){a.pendingLanes|=c,a.suspendedLanes&=~c;var g=31-yt(c);a.entangledLanes|=c,a.entanglements[g]=a.entanglements[g]|1073741824|h&261930}function Al(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var g=31-yt(h),y=1<<g;y&c|a[g]&c&&(a[g]|=c),h&=~y}}function bh(a,c){var h=c&-c;return h=(h&42)!==0?1:kl(h),(h&(a.suspendedLanes|c))!==0?0:h}function kl(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function au(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ou(){var a=V.p;return a!==0?a:(a=window.event,a===void 0?32:xE(a.type))}function jr(a,c){var h=V.p;try{return V.p=a,c()}finally{V.p=h}}var ki=Math.random().toString(36).slice(2),gn="__reactFiber$"+ki,Jn="__reactProps$"+ki,Ds="__reactContainer$"+ki,Ao="__reactEvents$"+ki,yh="__reactListeners$"+ki,dg="__reactHandles$"+ki,wh="__reactResources$"+ki,ya="__reactMarker$"+ki;function Nl(a){delete a[gn],delete a[Jn],delete a[Ao],delete a[yh],delete a[dg]}function Ls(a){var c=a[gn];if(c)return c;for(var h=a.parentNode;h;){if(c=h[Ds]||h[gn]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=tE(a);a!==null;){if(h=a[gn])return h;a=tE(a)}return c}a=h,h=a.parentNode}return null}function Os(a){if(a=a[gn]||a[Ds]){var c=a.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return a}return null}function Ms(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a.stateNode;throw Error(i(33))}function wa(a){var c=a[wh];return c||(c=a[wh]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Nn(a){a[ya]=!0}var Sh=new Set,Ch={};function ts(a,c){_r(a,c),_r(a+"Capture",c)}function _r(a,c){for(Ch[a]=c,a=0;a<c.length;a++)Sh.add(c[a])}var jl=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]*$"),Eh={},Ah={};function hg(a){return Ae.call(Ah,a)?!0:Ae.call(Eh,a)?!1:jl.test(a)?Ah[a]=!0:(Eh[a]=!0,!1)}function _l(a,c,h){if(hg(c))if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(c);return}}a.setAttribute(c,""+h)}}function Tl(a,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttribute(c,""+h)}}function Tr(a,c,h,g){if(g===null)a.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(c,h,""+g)}}function Ni(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function lu(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function fg(a,c,h){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,c);if(!a.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var y=g.get,S=g.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return y.call(this)},set:function(j){h=""+j,S.call(this,j)}}),Object.defineProperty(a,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(j){h=""+j},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ko(a){if(!a._valueTracker){var c=lu(a)?"checked":"value";a._valueTracker=fg(a,c,""+a[c])}}function kh(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return a&&(g=lu(a)?a.checked?"true":"false":a.value),a=g,a!==h?(c.setValue(a),!0):!1}function No(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var pg=/[\n"\\]/g;function Wn(a){return a.replace(pg,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Rl(a,c,h,g,y,S,j,z){a.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.type=j:a.removeAttribute("type"),c!=null?j==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+Ni(c)):a.value!==""+Ni(c)&&(a.value=""+Ni(c)):j!=="submit"&&j!=="reset"||a.removeAttribute("value"),c!=null?Pl(a,j,Ni(c)):h!=null?Pl(a,j,Ni(h)):g!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&t
vendor: 5,690 bytes, line 48
48ypeof y!="function"&&typeof y!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?a.name=""+Ni(z):a.removeAttribute("name")}function cu(a,c,h,g,y,S,j,z){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),c!=null||h!=null){if(!(S!=="submit"&&S!=="reset"||c!=null)){ko(a);return}h=h!=null?""+Ni(h):"",c=c!=null?""+Ni(c):h,z||c===a.value||(a.value=c),a.defaultValue=c}g=g??y,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=z?a.checked:!!g,a.defaultChecked=!!g,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.name=j),ko(a)}function Pl(a,c,h){c==="number"&&No(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function Is(a,c,h,g){if(a=a.options,c){c={};for(var y=0;y<h.length;y++)c["$"+h[y]]=!0;for(h=0;h<a.length;h++)y=c.hasOwnProperty("$"+a[h].value),a[h].selected!==y&&(a[h].selected=y),y&&g&&(a[h].defaultSelected=!0)}else{for(h=""+Ni(h),c=null,y=0;y<a.length;y++){if(a[y].value===h){a[y].selected=!0,g&&(a[y].defaultSelected=!0);return}c!==null||a[y].disabled||(c=a[y])}c!==null&&(c.selected=!0)}}function uu(a,c,h){if(c!=null&&(c=""+Ni(c),c!==a.value&&(a.value=c),h==null)){a.defaultValue!==c&&(a.defaultValue=c);return}a.defaultValue=h!=null?""+Ni(h):""}function mg(a,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(i(92));if(q(g)){if(1<g.length)throw Error(i(93));g=g[0]}h=g}h==null&&(h=""),c=h}h=Ni(c),a.defaultValue=h,g=a.textContent,g===h&&g!==""&&g!==null&&(a.value=g),ko(a)}function er(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var du=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 hu(a,c,h){var g=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?a.setProperty(c,""):c==="float"?a.cssFloat="":a[c]="":g?a.setProperty(c,h):typeof h!="number"||h===0||du.has(c)?c==="float"?a.cssFloat=h:a[c]=(""+h).trim():a[c]=h+"px"}function Rr(a,c,h){if(c!=null&&typeof c!="object")throw Error(i(62));if(a=a.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var y in c)g=c[y],c.hasOwnProperty(y)&&h[y]!==g&&hu(a,y,g)}else for(var S in c)c.hasOwnProperty(S)&&hu(a,S,c[S])}function ns(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Dl=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
48-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"]]),Sa=/^[\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 jo(a){return Sa.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function tr(){}var fu=null;function pu(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ca=null,Ea=null;function mu(a){var c=Os(a);if(c&&(a=c.stateNode)){var h=a[Jn]||null;e:switch(a=c.stateNode,c.type){case"input":if(Rl(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Wn(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==a&&g.form===a.form){var y=g[Jn]||null;if(!y)throw Error(i(90));Rl(g,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===a.form&&kh(g)}break e;case"textarea":uu(a,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&Is(a,!!h.multiple,c,!1)}}}var gu=!1;function xn(a,c,h){if(gu)return a(c,h);gu=!0;try{var g=a(c);return g}
vendor: 9,049 bytes, line 48
48finally{if(gu=!1,(Ca!==null||Ea!==null)&&(df(),Ca&&(c=Ca,a=Ea,Ea=Ca=null,mu(c),a)))for(c=0;c<a.length;c++)mu(a[c])}}function I(a,c){var h=a.stateNode;if(h===null)return null;var g=h[Jn]||null;if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(i(231,c,typeof h));return h}var te=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),we=!1;if(te)try{var ze={};Object.defineProperty(ze,"passive",{get:function(){we=!0}}),window.addEventListener("test",ze,ze),window.removeEventListener("test",ze,ze)}catch{we=!1}var ot=null,Yt=null,Yn=null;function nn(){if(Yn)return Yn;var a,c=Yt,h=c.length,g,y="value"in ot?ot.value:ot.textContent,S=y.length;for(a=0;a<h&&c[a]===y[a];a++);var j=h-a;for(g=1;g<=j&&c[h-g]===y[S-g];g++);return Yn=y.slice(a,1<g?1-g:void 0)}function Tt(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function rn(){return!0}function zs(){return!1}function ai(a){function c(h,g,y,S,j){this._reactName=h,this._targetInst=y,this.type=g,this.nativeEvent=S,this.target=j,this.currentTarget=null;for(var z in a)a.hasOwnProperty(z)&&(h=a[z],this[z]=h?h(S):S[z]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?rn:zs,this.isPropagationStopped=zs,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),c}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nh=ai(Fs),xu=m({},Fs,{view:0,detail:0}),t4=ai(xu),gg,xg,vu,jh=m({},xu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bg,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==vu&&(vu&&a.type==="mousemove"?(gg=a.screenX-vu.screenX,xg=a.screenY-vu.screenY):xg=gg=0,vu=a),gg)},movementY:function(a){return"movementY"in a?a.movementY:xg}}),X0=ai(jh),n4=m({},jh,{dataTransfer:0}),i4=ai(n4),r4=m({},xu,{relatedTarget:0}),vg=ai(r4),s4=m({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),a4=ai(s4),o4=m({},Fs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),l4=ai(o4),c4=m({},Fs,{data:0}),Q0=ai(c4),u4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d4={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"},h4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function f4(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=h4[a])?!!c[a]:!1}function bg(){return f4}var p4=m({},xu,{key:function(a){if(a.key){var c=u4[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Tt(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?d4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bg,charCode:function(a){return a.type==="keypress"?Tt(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Tt(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),m4=ai(p4),g4=m({},jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z0=ai(g4),x4=m({},xu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bg}),v4=ai(x4),b4=m({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),y4=ai(b4),w4=m({},jh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),S4=ai(w4),C4=m({},Fs,{newState:0,oldState:0}),E4=ai(C4),A4=[9,13,27,32],yg=te&&"CompositionEvent"in window,bu=null;te&&"documentMode"in document&&(bu=document.documentMode);var k4=te&&"TextEvent"in window&&!bu,J0=te&&(!yg||bu&&8<bu&&11>=bu),e1=" ",t1=!1;function n1(a,c){switch(a){case"keyup":return A4.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ll=!1;function N4(a,c){switch(a){case"compositionend":return i1(c);case"keypress":return c.which!==32?null:(t1=!0,e1);case"textInput":return a=c.data,a===e1&&t1?null:a;default:return null}}function j4(a,c){if(Ll)return a==="compositionend"||!yg&&n1(a,c)?(a=nn(),Yn=Yt=ot=null,Ll=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return J0&&c.locale!=="ko"?null:c.data;default:return null}}var _4={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 r1(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!_4[a.type]:c==="textarea"}function s1(a,c,h,g){Ca?Ea?Ea.push(g):Ea=[g]:Ca=g,c=vf(c,"onChange"),0<c.length&&(h=new Nh("onChange","change",null,h,g),a.push({event:h,listeners:c}))}var yu=null,wu=null;function T4(a){UC(a,0)}function _h(a){var c=Ms(a);if(kh(c))return a}function a1(a,c){if(a==="change")return c}var o1=!1;if(te){var wg;if(te){var Sg="oninput"in document;if(!Sg){var l1=document.createElement("div");l1.setAttribute("oninput","return;"),Sg=typeof l1.oninput=="function"}wg=Sg}else wg=!1;o1=wg&&(!document.documentMode||9<document.documentMode)}function c1(){yu&&(yu.detachEvent("onpropertychange",u1),wu=yu=null)}function u1(a){if(a.propertyName==="value"&&_h(wu)){var c=[];s1(c,wu,a,pu(a)),xn(T4,c)}}function R4(a,c,h){a==="focusin"?(c1(),yu=c,wu=h,yu.attachEvent("onpropertychange",u1)):a==="focusout"&&c1()}function P4(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return _h(wu)}function D4(a,c){if(a==="click")return _h(c)}function L4(a,c){if(a==="input"||a==="change")return _h(c)}function O4(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Ui=typeof Object.is=="function"?Object.is:O4;function Su(a,c){if(Ui(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var y=h[g];if(!Ae.call(c,y)||!Ui(a[y],c[y]))return!1}return!0}function d1(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function h1(a,c){var h=d1(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=c&&g>=c)return{node:h,offset:c-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=d1(h)}}function f1(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?f1(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function p1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var c=No(a.document);c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=No(a.document)}return c}function Cg(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var M4=te&&"documentMode"in document&&11>=document.documentMode,Ol=null,Eg=null,Cu=null,Ag=!1;function m1(a,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ag||Ol==null||Ol!==No(g)||(g=Ol,"selectionStart"in g&&Cg(g)?g={start:g.
vendor: 22,605 bytes, line 48
48selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Cu&&Su(Cu,g)||(Cu=g,g=vf(Eg,"onSelect"),0<g.length&&(c=new Nh("onSelect","select",null,c,h),a.push({event:c,listeners:g}),c.target=Ol)))}function _o(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var Ml={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionrun:_o("Transition","TransitionRun"),transitionstart:_o("Transition","TransitionStart"),transitioncancel:_o("Transition","TransitionCancel"),transitionend:_o("Transition","TransitionEnd")},kg={},g1={};te&&(g1=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function To(a){if(kg[a])return kg[a];if(!Ml[a])return a;var c=Ml[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in g1)return kg[a]=c[h];return a}var x1=To("animationend"),v1=To("animationiteration"),b1=To("animationstart"),I4=To("transitionrun"),z4=To("transitionstart"),F4=To("transitioncancel"),y1=To("transitionend"),w1=new Map,Ng="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(" ");Ng.push("scrollEnd");function Pr(a,c){w1.set(a,c),ts(c,[a])}var Th=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},nr=[],Il=0,jg=0;function Rh(){for(var a=Il,c=jg=Il=0;c<a;){var h=nr[c];nr[c++]=null;var g=nr[c];nr[c++]=null;var y=nr[c];nr[c++]=null;var S=nr[c];if(nr[c++]=null,g!==null&&y!==null){var j=g.pending;j===null?y.next=y:(y.next=j.next,j.next=y),g.pending=y}S!==0&&S1(h,y,S)}}function Ph(a,c,h,g){nr[Il++]=a,nr[Il++]=c,nr[Il++]=h,nr[Il++]=g,jg|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function _g(a,c,h,g){return Ph(a,c,h,g),Dh(a)}function Ro(a,c){return Ph(a,null,null,c),Dh(a)}function S1(a,c,h){a.lanes|=h;var g=a.alternate;g!==null&&(g.lanes|=h);for(var y=!1,S=a.return;S!==null;)S.childLanes|=h,g=S.alternate,g!==null&&(g.childLanes|=h),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&c!==null&&(y=31-yt(h),a=S.hiddenUpdates,g=a[y],g===null?a[y]=[c]:g.push(c),c.lane=h|536870912),S):null}function Dh(a){if(50<Vu)throw Vu=0,zx=null,Error(i(185));for(var c=a.return;c!==null;)a=c,c=a.return;return a.tag===3?a.stateNode:null}var zl={};function $4(a,c,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bi(a,c,h,g){return new $4(a,c,h,g)}function Tg(a){return a=a.prototype,!(!a||!a.isReactComponent)}function $s(a,c){var h=a.alternate;return h===null?(h=Bi(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function C1(a,c){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,c=h.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),a}function Lh(a,c,h,g,y,S){var j=0;if(g=a,typeof a=="function")Tg(a)&&(j=1);else if(typeof a=="string")j=VO(a,h,J.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case U:return a=Bi(31,h,c,y),a.elementType=U,a.lanes=S,a;case C:return Po(h.children,y,S,c);case A:j=8,y|=24;break;case E:return a=Bi(12,h,c,y|2),a.elementType=E,a.lanes=S,a;case R:return a=Bi(13,h,c,y),a.elementType=R,a.lanes=S,a;case T:return a=Bi(19,h,c,y),a.elementType=T,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:j=10;break e;case k:j=9;break e;case _:j=11;break e;case L:j=14;break e;case M:j=16,g=null;break e}j=29,h=Error(i(130,a===null?"null":typeof a,"")),g=null}return c=Bi(j,h,c,y),c.elementType=a,c.type=g,c.lanes=S,c}function Po(a,c,h,g){return a=Bi(7,a,g,c),a.lanes=h,a}function Rg(a,c,h){return a=Bi(6,a,null,c),a.lanes=h,a}function E1(a){var c=Bi(18,null,null,0);return c.stateNode=a,c}function Pg(a,c,h){return c=Bi(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}var A1=new WeakMap;function ir(a,c){if(typeof a=="object"&&a!==null){var h=A1.get(a);return h!==void 0?h:(c={value:a,source:c,stack:xt(c)},A1.set(a,c),c)}return{value:a,source:c,stack:xt(c)}}var Fl=[],$l=0,Oh=null,Eu=0,rr=[],sr=0,Aa=null,is=1,rs="";function Us(a,c){Fl[$l++]=Eu,Fl[$l++]=Oh,Oh=a,Eu=c}function k1(a,c,h){rr[sr++]=is,rr[sr++]=rs,rr[sr++]=Aa,Aa=a;var g=is;a=rs;var y=32-yt(g)-1;g&=~(1<<y),h+=1;var S=32-yt(c)+y;if(30<S){var j=y-y%5;S=(g&(1<<j)-1).toString(32),g>>=j,y-=j,is=1<<32-yt(c)+y|h<<y|g,rs=S+a}else is=1<<S|h<<y|g,rs=a}function Dg(a){a.return!==null&&(Us(a,1),k1(a,1,0))}function Lg(a){for(;a===Oh;)Oh=Fl[--$l],Fl[$l]=null,Eu=Fl[--$l],Fl[$l]=null;for(;a===Aa;)Aa=rr[--sr],rr[sr]=null,rs=rr[--sr],rr[sr]=null,is=rr[--sr],rr[sr]=null}function N1(a,c){rr[sr++]=is,rr[sr++]=rs,rr[sr++]=Aa,is=c.id,rs=c.overflow,Aa=a}var ei=null,Xt=null,Nt=!1,ka=null,ar=!1,Og=Error(i(519));function Na(a){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Au(ir(c,a)),Og}function j1(a){var c=a.stateNode,h=a.type,g=a.memoizedProps;switch(c[gn]=a,c[Jn]=g,h){case"dialog":St("cancel",c),St("close",c);break;case"iframe":case"object":case"embed":St("load",c);break;case"video":case"audio":for(h=0;h<Ku.length;h++)St(Ku[h],c);break;case"source":St("error",c);break;case"img":case"image":case"link":St("error",c),St("load",c);break;case"details":St("toggle",c);break;case"input":St("invalid",c),cu(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":St("invalid",c);break;case"textarea":St("invalid",c),mg(c,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||g.suppressHydrationWarning===!0||VC(c.textContent,h)?(g.popover!=null&&(St("beforetoggle",c),St("toggle",c)),g.onScroll!=null&&St("scroll",c),g.onScrollEnd!=null&&St("scrollend",c),g.onClick!=null&&(c.onclick=tr),c=!0):c=!1,c||Na(a,!0)}function _1(a){for(ei=a.return;ei;)switch(ei.tag){case 5:case 31:case 13:ar=!1;return;case 27:case 3:ar=!0;return;default:ei=ei.return}}function Ul(a){if(a!==ei)return!1;if(!Nt)return _1(a),Nt=!0,!1;var c=a.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||Jx(a.type,a.memoizedProps)),h=!h),h&&Xt&&Na(a),_1(a),c===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Xt=eE(a)}else if(c===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Xt=eE(a)}else c===27?(c=Xt,Ua(a.type)?(a=rv,rv=null,Xt=a):Xt=c):Xt=ei?lr(a.stateNode.nextSibling):null;return!0}function Do(){Xt=ei=null,Nt=!1}function Mg(){var a=ka;return a!==null&&(Ri===null?Ri=a:Ri.push.apply(Ri,a),ka=null),a}function Au(a){ka===null?ka=[a]:ka.push(a)}var Ig=B(null),Lo=null,Bs=null;function ja(a,c,h){P(Ig,c._currentValue),c._currentValue=h}function Hs(a){a._currentValue=Ig.current,H(Ig)}function zg(a,c,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===h)break;a=a.return}}function Fg(a,c,h,g){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var j=y.child;S=S.firstContext;e:for(;S!==null;){var z=S;S=y;for(var Y=0;Y<c.length;Y++)if(z.context===c[Y]){S.lanes|=h,z=S.alternate,z!==null&&(z.lanes|=h),zg(S.return,h,a),g||(j=null);break e}S=z.next}}else if(y.tag===18){if(j=y.return,j===null)throw Error(i(341));j.lanes|=h,S=j.alternate,S!==null&&(S.lanes|=h),zg(j,h,a),j=null}else j=y.child;if(j!==null)j.return=y;else for(j=y;j!==null;){if(j===a){j=null;break}if(y=j.sibling,y!==null){y.return=j.return,j=y;break}j=j.return}y=j}}function Bl(a,c,h,g){a=null;for(var y=c,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var j=y.alternate;if(j===null)throw Error(i(387));if(j=j.memoizedProps,j!==null){var z=y.type;Ui(y.pendingProps.value,j.value)||(a!==null?a.push(z):a=[z])}}else if(y===W.current){if(j=y.alternate,j===null)throw Error(i(387));j.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Zu):a=[Zu])}y=y.return}a!==null&&Fg(c,a,h,g),c.flags|=262144}function Mh(a){for(a=a.firstContext;a!==null;){if(!Ui(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Oo(a){Lo=a,Bs=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ti(a){return T1(Lo,a)}function Ih(a,c){return Lo===null&&Oo(a),T1(a,c)}function T1(a,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},Bs===null){if(a===null)throw Error(i(308));Bs=c,a.dependencies={lanes:0,firstContext:c},a.flags|=524288}else Bs=Bs.next=c;return h}var U4=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(h,g){a.push(g)}};this.abort=function(){c.aborted=!0,a.forEach(function(h){return h()})}},B4=t.unstable_scheduleCallback,H4=t.unstable_NormalPriority,jn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $g(){return{controller:new U4,data:new Map,refCount:0}}function ku(a){a.refCount--,a.refCount===0&&B4(H4,function(){a.controller.abort()})}var Nu=null,Ug=0,Hl=0,Gl=null;function G4(a,c){if(Nu===null){var h=Nu=[];Ug=0,Hl=Gx(),Gl={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Ug++,c.then(R1,R1),c}function R1(){if(--Ug===0&&Nu!==null){Gl!==null&&(Gl.status="fulfilled");var a=Nu;Nu=null,Hl=0,Gl=null;for(var c=0;c<a.length;c++)(0,a[c])()}}function V4(a,c){var h=[],g={status:"pending",value:null,reason:null,then:function(y){h.push(y)}};return a.then(function(){g.status="fulfilled",g.value=c;for(var y=0;y<h.length;y++)(0,h[y])(c)},function(y){for(g.status="rejected",g.reason=y,y=0;y<h.length;y++)(0,h[y])(void 0)}),g}var P1=F.S;F.S=function(a,c){mC=ve(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&G4(a,c),P1!==null&&P1(a,c)};var Mo=B(null);function Bg(){var a=Mo.current;return a!==null?a:Ht.pooledCache}function zh(a,c){c===null?P(Mo,Mo.current):P(Mo,c.pool)}function D1(){var a=Bg();return a===null?null:{parent:jn._currentValue,pool:a}}var Vl=Error(i(460)),Hg=Error(i(474)),Fh=Error(i(542)),$h={then:function(){}};function L1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function O1(a,c,h){switch(h=a[h],h===void 0?a.push(c):h!==c&&(c.then(tr,tr),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,I1(a),a;default:if(typeof c.status=="string")c.then(tr,tr);else{if(a=Ht,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=c,a.status="pending",a.then(function(g){if(c.status==="pending"){var y=c;y.status="fulfilled",y.value=g}},function(g){if(c.status==="pending"){var y=c;y.status="rejected",y.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,I1(a),a}throw zo=c,Vl}}function Io(a){try{var c=a._init;return c(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(zo=h,Vl):h}}var zo=null;function M1(){if(zo===null)throw Error(i(459));var a=zo;return zo=null,a}function I1(a){if(a===Vl||a===Fh)throw Error(i(483))}var ql=null,ju=0;function Uh(a){var c=ju;return ju+=1,ql===null&&(ql=[]),O1(ql,a,c)}function _u(a,c){c=c.props.ref,a.ref=c!==void 0?c:null}function Bh(a,c){throw c.$$typeof===x?Error(i(525)):(a=Object.prototype.toString.call(c),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a)))}function z1(a){function c(re,ne){if(a){var ae=re.deletions;ae===null?(re.deletions=[ne],re.flags|=16):ae.push(ne)}}function h(re,ne){if(!a)return null;for(;ne!==null;)c(re,ne),ne=ne.sibling;return null}function g(re){for(var ne=new Map;re!==null;)re.key!==null?ne.set(re.key,re):ne.set(re.index,re),re=re.sibling;return ne}function y(re,ne){return re=$s(re,ne),re.index=0,re.sibling=null,re}function S(re,ne,ae){return re.index=ae,a?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ne?(re.flags|=67108866,ne):ae):(re.flags|=67108866,ne)):(re.flags|=1048576,ne)}function j(re){return a&&re.alternate===null&&(re.flags|=67108866),re}function z(re,ne,ae,be){return ne===null||ne.tag!==6?(ne=Rg(ae,re.mode,be),ne.return=re,ne):(ne=y(ne,ae),ne.return=re,ne)}function Y(re,ne,ae,be){var We=ae.type;return We===C?ge(re,ne,ae.props.children,be,ae.key):ne!==null&&(ne.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===M&&Io(We)===ne.type)?(ne=y(ne,ae.props),_u(ne,ae),ne.return=re,ne):(ne=Lh(ae.type,ae.key,ae.props,null,re.mode,be),_u(ne,ae),ne.return=re,ne)}function oe(re,ne,ae,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ae.containerInfo||ne.stateNode.implementation!==ae.implementation?(ne=Pg(ae,re.mode,be),ne.return=re,ne):(ne=y(ne,ae.children||[]),ne.return=re,ne)}function ge(re,ne,ae,be,We){return ne===null||ne.tag!==7?(ne=Po(ae,re.mode,be,We),ne.return=re,ne):(ne=y(ne,ae),ne.return=re,ne)}function Se(re,ne,ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Rg(""+ne,re.mode,ae),ne.return=re,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return ae=Lh(ne.type,ne.key,ne.props,null,re.mode,ae),_u(ae,ne),ae.return=re,ae;case w:return ne=Pg(ne,re.mode,ae),ne.return=re,ne;case M:return ne=Io(ne),Se(re,ne,ae)}if(q(ne)||Z(ne))return ne=Po(ne,re.mode,ae,null),ne.return=re,ne;if(typeof ne.then=="function")return Se(re,Uh(ne),ae);if(ne.$$typeof===N)return Se(re,Ih(re,ne),ae);Bh(re,ne)}return null}function ce(re,ne,ae,be){var We=ne!==null?ne.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return We!==null?null:z(re,ne,""+ae,be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return ae.key===We?Y(re,ne,ae,be):null;case w:return ae.key===We?oe(re,ne,ae,be):null;case M:return ae=Io(ae),ce(re,ne,ae,be)}if(q(ae)||Z(ae))return We!==null?null:ge(re,ne,ae,be,null);if(typeof ae.then=="function")return ce(re,ne,Uh(ae),be);if(ae.$$typeof===N)return ce(re,ne,Ih(re,ae),be);Bh(re,ae)}return null}function de(re,ne,ae,be,We){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return re=re.get(ae)||null,z(ne,re,""+be,We);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case b:return re=re.get(be.key===null?ae:be.key)||null,Y(ne,re,be,We);case w:return re=re.get(be.key===null?ae:be.key)||null,oe(ne,re,be,We);case M:return be=Io(be),de(re,ne,ae,be,We)}if(q(be)||Z(be))return re=re.get(ae)||null,ge(ne,re,be,We,null);if(typeof be.then=="function")return de(re,ne,ae,Uh(be),We);if(be.$$typeof===N)return de(re,ne,ae,Ih(ne,be),We);Bh(ne,be)}return null}function Ue(re,ne,ae,be){for(var We=null,Pt=null,Ge=ne,mt=ne=0,kt=null;Ge!==null&&mt<ae.length;mt++){Ge.index>mt?(kt=Ge,Ge=null):kt=Ge.sibling;var Dt=ce(re,Ge,ae[mt],be);if(Dt===null){Ge===null&&(Ge=kt);break}a&&Ge&&Dt.alternate===null&&c(re,Ge),ne=S(Dt,ne,mt),Pt===null?We=Dt:Pt.sibling=Dt,Pt=Dt,Ge=kt}if(mt===ae.length)return h(re,Ge),Nt&&Us(re,mt),We;if(Ge===null){for(;mt<ae.length;mt++)Ge=Se(re,ae[mt],be),Ge!==null&&(ne=S(Ge,ne,mt),Pt===null?We=Ge:Pt.sibling=Ge,Pt=Ge);return Nt&&Us(re,mt),We}for(Ge=g(Ge);mt<ae.length;mt++)kt=de(Ge,re,mt,ae[mt],be),kt!==null&&(a&&kt.alternate!==null&&Ge.delete(kt.key===null?mt:kt.key),ne=S(kt,ne,mt),Pt===null?We=kt:Pt.sibling=kt,Pt=kt);return a&&Ge.forEach(function(qa){return c(re,qa)}),Nt&&Us(re,mt),We}function tt(re,ne,ae,be){if(ae==null)throw Error(i(151));for(var We=null,Pt=null,Ge=ne,mt=ne=0,kt=null,Dt=ae.next();Ge!==null&&!Dt.done;mt++,Dt=ae.next()){Ge.index>mt?(kt=Ge,Ge=null):kt=Ge.sibling;var qa=ce(re,Ge,Dt.value,be);if(qa===null){Ge===null&&(Ge=kt);break}a&&Ge&&qa.alternate===null&&c(re,Ge),ne=S(qa,ne,mt),Pt===null?We=qa:Pt.sibling=qa,Pt=qa,Ge=kt}if(Dt.done)return h(re,Ge),Nt&&Us(re,mt),We;if(Ge===null){for(;!Dt.done;mt++,Dt=ae.next())Dt=Se(re,Dt.value,be),Dt!==null&&(ne=S(Dt,ne,mt),Pt===null?We=Dt:Pt.sibling=Dt,Pt=Dt);return Nt&&Us(re,mt),We}for(Ge=g(Ge);!Dt.done;mt++,Dt=ae.next())Dt=de(Ge,re,mt,Dt.value,be),Dt!==null&&(a&&Dt.alternate!==null&&Ge.delete(Dt.key===null?mt:Dt.key),ne=S(Dt,ne,mt),Pt===null?We=Dt:Pt.sibling=Dt,Pt=Dt);return a&&Ge.forEach(function(nM){return c(re,nM)}),Nt&&Us(re,mt),We}function Ut(re,ne,ae,be){if(typeof ae=="object"&&ae!==null&&ae.type===C&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:e:{for(var We=ae.key;ne!==null;){if(ne.key===We){if(We=ae.type,We===C){if(ne.tag===7){h(re,ne.sibling),be=y(ne,ae.props.children),be.return=re,re=be;break e}}else if(ne.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===M&&Io(We)===ne.type){h(re,ne.sibling),be=y(ne,ae.props),_u(be,ae),be.return=re,re=be;break e}h(re,ne);break}else c(re,ne);ne=ne.sibling}ae.type===C?(be=Po(ae.props.children,re.mode,be,ae.key),be.return=re,re=be):(be=Lh(ae.type,ae.key,ae.props,null,re.mode,be),_u(be,ae),be.return=re,re=be)}return j(re);case w:e:{for(We=ae.key;ne!==null;){if(ne.key===We)if(ne.tag===4&&ne.stateNode.containerInfo===ae.containerInfo&&ne.stateNode.implementation===ae.implementation){h(re,ne.sibling),be=y(ne,ae.children||[]),be.return=re,re=be;break e}else{h(re,ne);break}else c(re,ne);ne=ne.sibling}be=Pg(ae,re.mode,be),be.return=re,re=be}return j(re);case M:return ae=Io(ae),Ut(re,ne,ae,be)}if(q(ae))return Ue(re,ne,ae,be);if(Z(ae)){if(We=Z(ae),typeof We!="function")throw Error(i(150));return ae=We.call(ae),tt(re,ne,ae,be)}if(typeof ae.then=="function")return Ut(re,ne,Uh(ae),be);if(ae.$$typeof===N)return Ut(re,ne,Ih(re,ae),be);Bh(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ne!==null&&ne.tag===6?(h(re,ne.sibling),be=y(ne,ae),be.return=re,re=be):(h(re,ne),be=Rg(ae,re.mode,be),be.return=re,re=be),j(re)):h(re,ne)}return function(re,ne,ae,be){try{ju=0;var We=Ut(re,ne,ae,be);return ql=null,We}catch(Ge){if(Ge===Vl||Ge===Fh)throw Ge;var Pt=Bi(29,Ge,null,re.mode);return Pt.lanes=be,Pt.return=re,Pt}finally{}}}var Fo=z1(!0),F1=z1(!1),_a=!1;function Gg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vg(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ta(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ra(a,c,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Lt&2)!==0){var y=g.pending;return y===null?c.next=c:(c.next=y.next,y.next=c),g.pending=c,c=Dh(a),S1(a,null,h),c}return Ph(a,g,c,h),Dh(a)}function Tu(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,Al(a,h)}}function qg(a,c){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var y=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var j={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};S===null?y=S=j:S=S.next=j,h=h.next}while(h!==null);S===null?y=S=c:S=S.next=c}else y=S=c;h={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:g.shared,callbacks:g.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}var Kg=!1;function Ru(){if(Kg){var a=Gl;if(a!==null)throw a}}function Pu(a,c,h,g){Kg=!1;var y=a.updateQueue;_a=!1;var S=y.firstBaseUpdate,j=y.lastBaseUpdate,z=y.shared.pending;if(z!==null){y.shared.pending=null;var Y=z,oe=Y.next;Y.next=null,j===null?S=oe:j.next=oe,j=Y;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==j&&(z===null?ge.firstBaseUpdate=oe:z.next=oe,ge.lastBaseUpdate=Y))}if(S!==null){var Se=y.baseState;j=0,ge=oe=Y=null,z=S;do{var ce=z.lane&-536870913,de=ce!==z.lane;if(de?(At&ce)===ce:(g&ce)===ce){ce!==0&&ce===Hl&&(Kg=!0),ge!==null&&(ge=ge.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ue=a,tt=z;ce=c;var Ut=h;switch(tt.tag){case 1:if(Ue=tt.payload,typeof Ue=="function"){Se=Ue.call(Ut,Se,ce);break e}Se=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=tt.payload,ce=typeof Ue=="function"?Ue.call(Ut,Se,ce):Ue,ce==null)break e;Se=m({},Se,ce);break e;case 2:_a=!0}}ce=z.callback,ce!==null&&(a.flags|=64,de&&(a.flags|=8192),de=y.callbacks,de===null?y.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ge===null?(oe=ge=de,Y=Se):ge=ge.next=de,j|=ce;
vendor: 4,217 bytes, line 48
48if(z=z.next,z===null){if(z=y.shared.pending,z===null)break;de=z,z=de.next,de.next=null,y.lastBaseUpdate=de,y.shared.pending=null}}while(!0);ge===null&&(Y=Se),y.baseState=Y,y.firstBaseUpdate=oe,y.lastBaseUpdate=ge,S===null&&(y.shared.lanes=0),Ma|=j,a.lanes=j,a.memoizedState=Se}}function $1(a,c){if(typeof a!="function")throw Error(i(191,a));a.call(c)}function U1(a,c){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)$1(h[a],c)}var Kl=B(null),Hh=B(0);function B1(a,c){a=Zs,P(Hh,a),P(Kl,c),Zs=a|c.baseLanes}function Wg(){P(Hh,Zs),P(Kl,Kl.current)}function Yg(){Zs=Hh.current,H(Kl),H(Hh)}var Hi=B(null),or=null;function Pa(a){var c=a.alternate;P(Cn,Cn.current&1),P(Hi,a),or===null&&(c===null||Kl.current!==null||c.memoizedState!==null)&&(or=a)}function Xg(a){P(Cn,Cn.current),P(Hi,a),or===null&&(or=a)}function H1(a){a.tag===22?(P(Cn,Cn.current),P(Hi,a),or===null&&(or=a)):Da()}function Da(){P(Cn,Cn.current),P(Hi,Hi.current)}function Gi(a){H(Hi),or===a&&(or=null),H(Cn)}var Cn=B(0);function Gh(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||nv(h)||iv(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Gs=0,ft=null,Ft=null,_n=null,Vh=!1,Wl=!1,$o=!1,qh=0,Du=0,Yl=null,q4=0;function vn(){throw Error(i(321))}function Qg(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!Ui(a[h],c[h]))return!1;return!0}function Zg(a,c,h,g,y,S){return Gs=S,ft=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,F.H=a===null||a.memoizedState===null?kS:fx,$o=!1,S=h(g,y),$o=!1,Wl&&(S=V1(c,h,g,y)),G1(a),S}function G1(a){F.H=Mu;var c=Ft!==null&&Ft.next!==null;if(Gs=0,_n=Ft=ft=null,Vh=!1,Du=0,Yl=null,c)throw Error(i(300));a===null||Tn||(a=a.dependencies,a!==null&&Mh(a)&&(Tn=!0))}function V1(a,c,h,g){ft=a;var y=0;do{if(Wl&&(Yl=null),Du=0,Wl=!1,25<=y)throw Error(i(301));if(y+=1,_n=Ft=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}F.H=NS,S=c(h,g)}while(Wl);return S}function K4(){var a=F.H,c=a.useState()[0];return c=typeof c.then=="function"?Lu(c):c,a=a.useState()[0],(Ft!==null?Ft.memoizedState:null)!==a&&(ft.flags|=1024),c}function Jg(){var a=qh!==0;return qh=0,a}function ex(a,c,h){c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~h}function tx(a){if(Vh){for(a=a.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}Vh=!1}Gs=0,_n=Ft=ft=null,Wl=!1,Du=qh=0,Yl=null}function xi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?ft.memoizedState=_n=a:_n=_n.next=a,_n}function En(){if(Ft===null){var a=ft.alternate;a=a!==null?a.memoizedState:null}else a=Ft.next;var c=_n===null?ft.memoizedState:_n.next;if(c!==null)_n=c,Ft=a;else{if(a===null)throw ft.alternate===null?Error(i(467)):Error(i(310));Ft=a,a={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},_n===null?ft.memoizedState=_n=a:_n=_n.next=a}return _n}function Kh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lu(a){var c=Du;return Du+=1,Yl===null&&(Yl=[]),a=O1(Yl,a,c),c=ft,(_n===null?c.memoizedState:_n.next)===null&&(c=c.alternate,F.H=c===null||c.memoizedState===null?kS:fx),a}function Wh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Lu(a);if(a.$$typeof===N)return ti(a)}throw Error(i(438,String(a)))}function nx(a){var c=null,h=ft.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var g=ft.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(y){return y.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Kh(),ft.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(a),g=0;g<a;g++)h[g]=D;return c.index++,h}
vendor: 15,586 bytes, line 48
48function Vs(a,c){return typeof c=="function"?c(a):c}function Yh(a){var c=En();return ix(c,Ft,a)}function ix(a,c,h){var g=a.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=h;var y=a.baseQueue,S=g.pending;if(S!==null){if(y!==null){var j=y.next;y.next=S.next,S.next=j}c.baseQueue=y=S,g.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{c=y.next;var z=j=null,Y=null,oe=c,ge=!1;do{var Se=oe.lane&-536870913;if(Se!==oe.lane?(At&Se)===Se:(Gs&Se)===Se){var ce=oe.revertLane;if(ce===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Se===Hl&&(ge=!0);else if((Gs&ce)===ce){oe=oe.next,ce===Hl&&(ge=!0);continue}else Se={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(z=Y=Se,j=S):Y=Y.next=Se,ft.lanes|=ce,Ma|=ce;Se=oe.action,$o&&h(S,Se),S=oe.hasEagerState?oe.eagerState:h(S,Se)}else ce={lane:Se,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(z=Y=ce,j=S):Y=Y.next=ce,ft.lanes|=Se,Ma|=Se;oe=oe.next}while(oe!==null&&oe!==c);if(Y===null?j=S:Y.next=z,!Ui(S,a.memoizedState)&&(Tn=!0,ge&&(h=Gl,h!==null)))throw h;a.memoizedState=S,a.baseState=j,a.baseQueue=Y,g.lastRenderedState=S}return y===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function rx(a){var c=En(),h=c.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=a;var g=h.dispatch,y=h.pending,S=c.memoizedState;if(y!==null){h.pending=null;var j=y=y.next;do S=a(S,j.action),j=j.next;while(j!==y);Ui(S,c.memoizedState)||(Tn=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),h.lastRenderedState=S}return[S,g]}function q1(a,c,h){var g=ft,y=En(),S=Nt;if(S){if(h===void 0)throw Error(i(407));h=h()}else h=c();var j=!Ui((Ft||y).memoizedState,h);if(j&&(y.memoizedState=h,Tn=!0),y=y.queue,ox(Y1.bind(null,g,y,a),[a]),y.getSnapshot!==c||j||_n!==null&&_n.memoizedState.tag&1){if(g.flags|=2048,Xl(9,{destroy:void 0},W1.bind(null,g,y,h,c),null),Ht===null)throw Error(i(349));S||(Gs&127)!==0||K1(g,c,h)}return h}function K1(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=ft.updateQueue,c===null?(c=Kh(),ft.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function W1(a,c,h,g){c.value=h,c.getSnapshot=g,X1(c)&&Q1(a)}function Y1(a,c,h){return h(function(){X1(c)&&Q1(a)})}function X1(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!Ui(a,h)}catch{return!0}}function Q1(a){var c=Ro(a,2);c!==null&&Pi(c,a,2)}function sx(a){var c=xi();if(typeof a=="function"){var h=a;if(a=h(),$o){mn(!0);try{h()}finally{mn(!1)}}}return c.memoizedState=c.baseState=a,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:a},c}function Z1(a,c,h,g){return a.baseState=h,ix(a,Ft,typeof g=="function"?g:Vs)}function W4(a,c,h,g,y){if(Zh(a))throw Error(i(485));if(a=c.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){S.listeners.push(j)}};F.T!==null?h(!0):S.isTransition=!1,g(S),h=c.pending,h===null?(S.next=c.pending=S,J1(c,S)):(S.next=h.next,c.pending=h.next=S)}}function J1(a,c){var h=c.action,g=c.payload,y=a.state;if(c.isTransition){var S=F.T,j={};F.T=j;try{var z=h(y,g),Y=F.S;Y!==null&&Y(j,z),eS(a,c,z)}catch(oe){ax(a,c,oe)}finally{S!==null&&j.types!==null&&(S.types=j.types),F.T=S}}else try{S=h(y,g),eS(a,c,S)}catch(oe){ax(a,c,oe)}}function eS(a,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){tS(a,c,g)},function(g){return ax(a,c,g)}):tS(a,c,h)}function tS(a,c,h){c.status="fulfilled",c.value=h,nS(c),a.state=h,c=a.pending,c!==null&&(h=c.next,h===c?a.pending=null:(h=h.next,c.next=h,J1(a,h)))}function ax(a,c,h){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,nS(c),c=c.next;while(c!==g)}a.action=null}function nS(a){a=a.listeners;for(var c=0;c<a.length;c++)(0,a[c])()}function iS(a,c){return c}function rS(a,c){if(Nt){var h=Ht.formState;if(h!==null){e:{var g=ft;if(Nt){if(Xt){t:{for(var y=Xt,S=ar;y.nodeType!==8;){if(!S){y=null;break t}if(y=lr(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){Xt=lr(y.nextSibling),g=y.data==="F!";break e}}Na(g)}g=!1}g&&(c=h[0])}}return h=xi(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iS,lastRenderedState:c},h.queue=g,h=CS.bind(null,ft,g),g.dispatch=h,g=sx(!1),S=hx.bind(null,ft,!1,g.queue),g=xi(),y={state:c,dispatch:null,action:a,pending:null},g.queue=y,h=W4.bind(null,ft,y,S,h),y.dispatch=h,g.memoizedState=a,[c,h,!1]}function sS(a){var c=En();return aS(c,Ft,a)}function aS(a,c,h){if(c=ix(a,c,iS)[0],a=Yh(Vs)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=Lu(c)}catch(j){throw j===Vl?Fh:j}else g=c;c=En();var y=c.queue,S=y.dispatch;return h!==c.memoizedState&&(ft.flags|=2048,Xl(9,{destroy:void 0},Y4.bind(null,y,h),null)),[g,S,a]}function Y4(a,c){a.action=c}function oS(a){var c=En(),h=Ft;if(h!==null)return aS(c,h,a);En(),c=c.memoizedState,h=En();var g=h.queue.dispatch;return h.memoizedState=a,[c,g,!1]}function Xl(a,c,h,g){return a={tag:a,create:h,deps:g,inst:c,next:null},c=ft.updateQueue,c===null&&(c=Kh(),ft.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,c.lastEffect=a),a}function lS(){return En().memoizedState}function Xh(a,c,h,g){var y=xi();ft.flags|=a,y.memoizedState=Xl(1|c,{destroy:void 0},h,g===void 0?null:g)}function Qh(a,c,h,g){var y=En();g=g===void 0?null:g;var S=y.memoizedState.inst;Ft!==null&&g!==null&&Qg(g,Ft.memoizedState.deps)?y.memoizedState=Xl(c,S,h,g):(ft.flags|=a,y.memoizedState=Xl(1|c,S,h,g))}function cS(a,c){Xh(8390656,8,a,c)}function ox(a,c){Qh(2048,8,a,c)}function X4(a){ft.flags|=4;var c=ft.updateQueue;if(c===null)c=Kh(),ft.updateQueue=c,c.events=[a];else{var h=c.events;h===null?c.events=[a]:h.push(a)}}function uS(a){var c=En().memoizedState;return X4({ref:c,nextImpl:a}),function(){if((Lt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function dS(a,c){return Qh(4,2,a,c)}function hS(a,c){return Qh(4,4,a,c)}function fS(a,c){if(typeof c=="function"){a=a();var h=c(a);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function pS(a,c,h){h=h!=null?h.concat([a]):null,Qh(4,4,fS.bind(null,c,a),h)}function lx(){}function mS(a,c){var h=En();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&Qg(c,g[1])?g[0]:(h.memoizedState=[a,c],a)}function gS(a,c){var h=En();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&Qg(c,g[1]))return g[0];if(g=a(),$o){mn(!0);try{a()}finally{mn(!1)}}return h.memoizedState=[g,c],g}function cx(a,c,h){return h===void 0||(Gs&1073741824)!==0&&(At&261930)===0?a.memoizedState=c:(a.memoizedState=h,a=xC(),ft.lanes|=a,Ma|=a,h)}function xS(a,c,h,g){return Ui(h,c)?h:Kl.current!==null?(a=cx(a,h,g),Ui(a,c)||(Tn=!0),a):(Gs&42)===0||(Gs&1073741824)!==0&&(At&261930)===0?(Tn=!0,a.memoizedState=h):(a=xC(),ft.lanes|=a,Ma|=a,c)}function vS(a,c,h,g,y){var S=V.p;V.p=S!==0&&8>S?S:8;var j=F.T,z={};F.T=z,hx(a,!1,c,h);try{var Y=y(),oe=F.S;if(oe!==null&&oe(z,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ge=V4(Y,g);Ou(a,c,ge,Ki(a))}else Ou(a,c,g,Ki(a))}catch(Se){Ou(a,c,{then:function(){},status:"rejected",reason:Se},Ki())}finally{V.p=S,j!==null&&z.types!==null&&(j.types=z.types),F.T=j}}function Q4(){}function ux(a,c,h,g){if(a.tag!==5)throw Error(i(476));var y=bS(a).queue;vS(a,y,c,O,h===null?Q4:function(){return yS(a),h(g)})}function bS(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:O},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:h},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function yS(a){var c=bS(a);c.next===null&&(c=a.alternate.memoizedState),Ou(a,c.next.queue,{},Ki())}function dx(){return ti(Zu)}function wS(){return En().memoizedState}function SS(){return En().memoizedState}function Z4(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var h=Ki();a=Ta(h);var g=Ra(c,a,h);g!==null&&(Pi(g,c,h),Tu(g,c,h)),c={cache:$g()},a.payload=c;return}c=c.return}}function J4(a,c,h){var g=Ki();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Zh(a)?ES(c,h):(h=_g(a,c,h,g),h!==null&&(Pi(h,a,g),AS(h,c,g)))}function CS(a,c,h){var g=Ki();Ou(a,c,h,g)}function Ou(a,c,h,g){var y={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Zh(a))ES(c,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var j=c.lastRenderedState,z=S(j,h);if(y.hasEagerState=!0,y.eagerState=z,Ui(z,j))return Ph(a,c,y,0),Ht===null&&Rh(),!1}catch{}finally{}if(h=_g(a,c,y,g),h!==null)return Pi(h,a,g),AS(h,c,g),!0}return!1}function hx(a,c,h,g){if(g={lane:2,revertLane:Gx(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Zh(a)){if(c)throw Error(i(479))}else c=_g(a,h,g,2),c!==null&&Pi(c,a,2)}function Zh(a){var c=a.alternate;return a===ft||c!==null&&c===ft}function ES(a,c){Wl=Vh=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function AS(a,c,h){if((h&4194048)!==0){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,Al(a,h)}}var Mu={readContext:ti,use:Wh,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};Mu.useEffectEvent=vn;var kS={readContext:ti,use:Wh,useCallback:function(a,c){return xi().memoizedState=[a,c===void 0?null:c],a},useContext:ti,useEffect:cS,useImperativeHandle:function(a,c,h){h=h!=null?h.concat([a]):null,Xh(4194308,4,fS.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Xh(4194308,4,a,c)},useInsertionEffect:function(a,c){Xh(4,2,a,c)},useMemo:function(a,c){var h=xi();c=c===void 0?null:c;var g=a();if($o){mn(!0);try{a()}finally{mn(!1)}}return h.memoizedState=[g,c],g},useReducer:function(a,c,h){var g=xi();if(h!==void 0){var y=h(c);if($o){mn(!0);try{h(c)}finally{mn(!1)}}}else y=c;return g.memoizedState=g.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},g.queue=a,a=a.dispatch=J4.bind(null,ft,a),[g.memoizedState,a]},useRef:function(a){var c=xi();return a={current:a},c.memoizedState=a},useState:function(a){a=sx(a);var c=a.queue,h=CS.bind(null,ft,c);return c.dispatch=h,[a.memoizedState,h]},useDebugValue:lx,useDeferredValue:function(a,c){var h=xi();return cx(h,a,c)},useTransition:function(){var a=sx(!1);return a=vS.bind(null,ft,a.queue,!0,!1),xi().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,h){var g=ft,y=xi();if(Nt){if(h===void 0)throw Error(i(407));h=h()}else{if(h=c(),Ht===null)throw Error(i(349));(At&127)!==0||K1(g,c,h)}y.memoizedState=h;var S={value:h,getSnapshot:c};return y.queue=S,cS(Y1.bind(null,g,S,a),[a]),g.flags|=2048,Xl(9,{destroy:void 0},W1.bind(null,g,S,h,c),null),h},useId:function(){var a=xi(),c=Ht.identifierPrefix;if(Nt){var h=rs,g=is;h=(g&~(1<<32-yt(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=qh++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=q4++,c="_"+c+"r_"+h.toString(32)+"_";return a.memoizedState=c},useHostTransitionStatus:dx,useFormState:rS,useActionState:rS,useOptimistic:function(a){var c=xi();c.memoizedState=c.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=hx.bind(null,ft,!0,h),h.dispatch=c,[a,c]},useMemoCache:nx,useCacheRefresh:function(){return xi().memoizedState=Z4.bind(null,ft)},useEffectEvent:function(a){var c=xi(),h={impl:a};return c.memoizedState=h,function(){if((Lt&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},fx={readContext:ti,use:Wh,useCallback:mS,useContext:ti,useEffect:ox,useImperativeHandle:pS,useInsertionEffect:dS,useLayoutEffect:hS,useMemo:gS,useReducer:Yh,useRef:lS,useState:function(){return Yh(Vs)},useDebugValue:lx,useDeferredValue:function(a,c){var h=En();return xS(h,Ft.memoizedState,a,c)},useTransition:function(){var a=Yh(Vs)[0],c=En().memoizedState;return[typeof a=="boolean"?a:Lu(a),c]},useSyncExternalStore:q1,useId:wS,useHostTransitionStatus:dx,useFormState:sS,useActionState:sS,useOptimistic:function(a,c){var h=En();return Z1(h,Ft,a,c)},useMemoCache:nx,useCacheRefresh:SS};fx.useEffectEvent=uS;var NS={readContext:ti,use:Wh,useCallback:mS,useContext:ti,useEffect:ox,useImperativeHandle:pS,useInsertionEffect:dS,useLayoutEffect:hS,useMemo:gS,useReducer:rx,useRef:lS,useState:function(){return rx(Vs)},useDebugValue:lx,useDeferredValue:function(a,c){var h=En();return Ft===null?cx(h,a,c):xS(h,Ft.memoizedState,a,c)},useTransition:function(){var a=rx(Vs)[0],c=En().memoizedState;return[typeof a=="boolean"?a:Lu(a),c]},useSyncExternalStore:q1,useId:wS,useHostTransitionStatus:dx,useFormState:oS,useActionState:oS,useOptimistic:function(a,c){var h=En();return Ft!==null?Z1(h,Ft,a,c):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:nx,useCacheRefresh:SS};NS.useEffectEvent=uS;function px(a,c,h,g){c=a.memoizedState,h=h(g,c),h=h==null?c:m({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var mx={enqueueSetState:function(a,c,h){a=a._reactInternals;var g=Ki(),y=Ta(g);y.payload=c,h!=null&&(y.callback=h),c=Ra(a,y,g),c!==null&&(Pi(c,a,g),Tu(c,a,g))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var g=Ki(),y=Ta(g);y.tag=1,y.payload=c,h!=null&&(y.callback=h),c=Ra(a,y,g),c!==null&&(Pi(c,a,g),Tu(c,a,g))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Ki(),g=Ta(h);g.tag=2,c!=null&&(g.callback=c),c=Ra(a,g,h),c!==null&&(Pi(c,a,h),Tu(c,a,h))}};function jS(a,c,h,g,y,S,j){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,S,j):c.prototype&&c.prototype.isPureReactComponent?!Su(h,g)||!Su(y,S):!0}function _S(a,c,h,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==a&&mx.enqueueReplaceState(c,c.state,null)}function Uo(a,c){var h=c;if("ref"in c){h={};for(var g in c)g!=="ref"&&(h[g]=c[g])}if(a=a.defaultProps){h===c&&(h=m({},h));for(var y in a)h[y]===void 0&&(h[y]=a[y])}return h}function TS(a){Th(a)}function RS(a){console.error(a)}function PS(a){Th(a)}function Jh(a,c){try{var h=a.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function DS(a,c,h){try{var g=a.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function gx(a,c,h){return h=Ta(h),h.tag=3,h.payload={element:null},h.callback=function(){Jh(a,c)},h}function LS(a){return a=Ta(a),a.tag=3,a}function OS(a,c,h,g){var y=h.type.getDerivedStateFromError;if(typeof y=="function"){var S=g.value;a.payload=function(){return y(S)},a.callback=function(){DS(c,h,g)}}var j=h.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(a.callback=function(){DS(c,h,g),typeof y!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var z=g.stack;this.componentDidCatch(g.value,{componentStack:z!==null?z:""})})}
vendor: 12,200 bytes, line 48
48function eO(a,c,h,g,y){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=h.alternate,c!==null&&Bl(c,h,y,!0),h=Hi.current,h!==null){switch(h.tag){case 31:case 13:return or===null?hf():h.alternate===null&&bn===0&&(bn=3),h.flags&=-257,h.flags|=65536,h.lanes=y,g===$h?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),Ux(a,g,y)),!1;case 22:return h.flags|=65536,g===$h?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([g]):h.add(g)),Ux(a,g,y)),!1}throw Error(i(435,h.tag))}return Ux(a,g,y),hf(),!1}if(Nt)return c=Hi.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=y,g!==Og&&(a=Error(i(422),{cause:g}),Au(ir(a,h)))):(g!==Og&&(c=Error(i(423),{cause:g}),Au(ir(c,h))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,g=ir(g,h),y=gx(a.stateNode,g,y),qg(a,y),bn!==4&&(bn=2)),!1;var S=Error(i(520),{cause:g});if(S=ir(S,h),Gu===null?Gu=[S]:Gu.push(S),bn!==4&&(bn=2),c===null)return!0;g=ir(g,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,a=y&-y,h.lanes|=a,a=gx(h.stateNode,g,a),qg(h,a),!1;case 1:if(c=h.type,S=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ia===null||!Ia.has(S))))return h.flags|=65536,y&=-y,h.lanes|=y,y=LS(y),OS(y,a,h,g),qg(h,y),!1}h=h.return}while(h!==null);return!1}var xx=Error(i(461)),Tn=!1;function ni(a,c,h,g){c.child=a===null?F1(c,null,h,g):Fo(c,a.child,h,g)}function MS(a,c,h,g,y){h=h.render;var S=c.ref;if("ref"in g){var j={};for(var z in g)z!=="ref"&&(j[z]=g[z])}else j=g;return Oo(c),g=Zg(a,c,h,j,S,y),z=Jg(),a!==null&&!Tn?(ex(a,c,y),qs(a,c,y)):(Nt&&z&&Dg(c),c.flags|=1,ni(a,c,g,y),c.child)}function IS(a,c,h,g,y){if(a===null){var S=h.type;return typeof S=="function"&&!Tg(S)&&S.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=S,zS(a,c,S,g,y)):(a=Lh(h.type,null,g,c,c.mode,y),a.ref=c.ref,a.return=c,c.child=a)}if(S=a.child,!Ax(a,y)){var j=S.memoizedProps;if(h=h.compare,h=h!==null?h:Su,h(j,g)&&a.ref===c.ref)return qs(a,c,y)}return c.flags|=1,a=$s(S,g),a.ref=c.ref,a.return=c,c.child=a}function zS(a,c,h,g,y){if(a!==null){var S=a.memoizedProps;if(Su(S,g)&&a.ref===c.ref)if(Tn=!1,c.pendingProps=g=S,Ax(a,y))(a.flags&131072)!==0&&(Tn=!0);else return c.lanes=a.lanes,qs(a,c,y)}return vx(a,c,h,g,y)}function FS(a,c,h,g){var y=g.children,S=a!==null?a.memoizedState:null;if(a===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(S=S!==null?S.baseLanes|h:h,a!==null){for(g=c.child=a.child,y=0;g!==null;)y=y|g.lanes|g.childLanes,g=g.sibling;g=y&~S}else g=0,c.child=null;return $S(a,c,S,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},a!==null&&zh(c,S!==null?S.cachePool:null),S!==null?B1(c,S):Wg(),H1(c);else return g=c.lanes=536870912,$S(a,c,S!==null?S.baseLanes|h:h,h,g)}else S!==null?(zh(c,S.cachePool),B1(c,S),Da(),c.memoizedState=null):(a!==null&&zh(c,null),Wg(),Da());return ni(a,c,y,h),c.child}function Iu(a,c){return a!==null&&a.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function $S(a,c,h,g,y){var S=Bg();return S=S===null?null:{parent:jn._currentValue,pool:S},c.memoizedState={baseLanes:h,cachePool:S},a!==null&&zh(c,null),Wg(),H1(c),a!==null&&Bl(a,c,g,!0),c.childLanes=y,null}function ef(a,c){return c=nf({mode:c.mode,children:c.children},a.mode),c.ref=a.ref,a.child=c,c.return=a,c}function US(a,c,h){return Fo(c,a.child,null,h),a=ef(c,c.pendingProps),a.flags|=2,Gi(c),c.memoizedState=null,a}function tO(a,c,h){var g=c.pendingProps,y=(c.flags&128)!==0;if(c.flags&=-129,a===null){if(Nt){if(g.mode==="hidden")return a=ef(c,g),c.lanes=536870912,Iu(null,a);if(Xg(c),(a=Xt)?(a=JC(a,ar),a=a!==null&&a.data==="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Aa!==null?{id:is,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},h=E1(a),h.return=c,c.child=h,ei=c,Xt=null)):a=null,a===null)throw Na(c);return c.lanes=536870912,null}return ef(c,g)}var S=a.memoizedState;if(S!==null){var j=S.dehydrated;if(Xg(c),y)if(c.flags&256)c.flags&=-257,c=US(a,c,h);else if(c.memoizedState!==null)c.child=a.child,c.flags|=128,c=null;else throw Error(i(558));else if(Tn||Bl(a,c,h,!1),y=(h&a.childLanes)!==0,Tn||y){if(g=Ht,g!==null&&(j=bh(g,h),j!==0&&j!==S.retryLane))throw S.retryLane=j,Ro(a,j),Pi(g,a,j),xx;hf(),c=US(a,c,h)}else a=S.treeContext,Xt=lr(j.nextSibling),ei=c,Nt=!0,ka=null,ar=!1,a!==null&&N1(c,a),c=ef(c,g),c.flags|=4096;return c}return a=$s(a.child,{mode:g.mode,children:g.children}),a.ref=c.ref,c.child=a,a.return=c,a}function tf(a,c){var h=c.ref;if(h===null)a!==null&&a.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(i(284));(a===null||a.ref!==h)&&(c.flags|=4194816)}}function vx(a,c,h,g,y){return Oo(c),h=Zg(a,c,h,g,void 0,y),g=Jg(),a!==null&&!Tn?(ex(a,c,y),qs(a,c,y)):(Nt&&g&&Dg(c),c.flags|=1,ni(a,c,h,y),c.child)}function BS(a,c,h,g,y,S){return Oo(c),c.updateQueue=null,h=V1(c,g,h,y),G1(a),g=Jg(),a!==null&&!Tn?(ex(a,c,S),qs(a,c,S)):(Nt&&g&&Dg(c),c.flags|=1,ni(a,c,h,S),c.child)}function HS(a,c,h,g,y){if(Oo(c),c.stateNode===null){var S=zl,j=h.contextType;typeof j=="object"&&j!==null&&(S=ti(j)),S=new h(g,S),c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=mx,c.stateNode=S,S._reactInternals=c,S=c.stateNode,S.props=g,S.state=c.memoizedState,S.refs={},Gg(c),j=h.contextType,S.context=typeof j=="object"&&j!==null?ti(j):zl,S.state=c.memoizedState,j=h.getDerivedStateFromProps,typeof j=="function"&&(px(c,h,j,g),S.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(j=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),j!==S.state&&mx.enqueueReplaceState(S,S.state,null),Pu(c,g,S,y),Ru(),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(a===null){S=c.stateNode;var z=c.memoizedProps,Y=Uo(h,z);S.props=Y;var oe=S.context,ge=h.contextType;j=zl,typeof ge=="object"&&ge!==null&&(j=ti(ge));var Se=h.getDerivedStateFromProps;ge=typeof Se=="function"||typeof S.getSnapshotBeforeUpdate=="function",z=c.pendingProps!==z,ge||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(z||oe!==j)&&_S(c,S,g,j),_a=!1;var ce=c.memoizedState;S.state=ce,Pu(c,g,S,y),Ru(),oe=c.memoizedState,z||ce!==oe||_a?(typeof Se=="function"&&(px(c,h,Se,g),oe=c.memoizedState),(Y=_a||jS(c,h,Y,g,ce,oe,j))?(ge||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(c.flags|=4194308)):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=oe),S.props=g,S.state=oe,S.context=j,g=Y):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{S=c.stateNode,Vg(a,c),j=c.memoizedProps,ge=Uo(h,j),S.props=ge,Se=c.pendingProps,ce=S.context,oe=h.contextType,Y=zl,typeof oe=="object"&&oe!==null&&(Y=ti(oe)),z=h.getDerivedStateFromProps,(oe=typeof z=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(j!==Se||ce!==Y)&&_S(c,S,g,Y),_a=!1,ce=c.memoizedState,S.state=ce,Pu(c,g,S,y),Ru();var de=c.memoizedState;j!==Se||ce!==de||_a||a!==null&&a.dependencies!==null&&Mh(a.dependencies)?(typeof z=="function"&&(px(c,h,z,g),de=c.memoizedState),(ge=_a||jS(c,h,ge,g,ce,de,Y)||a!==null&&a.dependencies!==null&&Mh(a.dependencies))?(oe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(g,de,Y),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(g,de,Y)),typeof S.componentDidUpdate=="function"&&(c.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof S.componentDidUpdate!="function"||j===a.memoizedProps&&ce===a.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ce===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=de),S.props=g,S.state=de,S.context=Y,g=ge):(typeof S.componentDidUpdate!="function"||j===a.memoizedProps&&ce===a.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ce===a.memoizedState||(c.flags|=1024),g=!1)}return S=g,tf(a,c),g=(c.flags&128)!==0,S||g?(S=c.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:S.render(),c.flags|=1,a!==null&&g?(c.child=Fo(c,a.child,null,y),c.child=Fo(c,null,h,y)):ni(a,c,h,y),c.memoizedState=S.state,a=c.child):a=qs(a,c,y),a}function GS(a,c,h,g){return Do(),c.flags|=256,ni(a,c,h,g),c.child}var bx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yx(a){return{baseLanes:a,cachePool:D1()}}function wx(a,c,h){return a=a!==null?a.childLanes&~h:0,c&&(a|=qi),a}function VS(a,c,h){var g=c.pendingProps,y=!1,S=(c.flags&128)!==0,j;if((j=S)||(j=a!==null&&a.memoizedState===null?!1:(Cn.current&2)!==0),j&&(y=!0,c.flags&=-129),j=(c.flags&32)!==0,c.flags&=-33,a===null){if(Nt){if(y?Pa(c):Da(),(a=Xt)?(a=JC(a,ar),a=a!==null&&a.data!=="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Aa!==null?{id:is,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},h=E1(a),h.return=c,c.child=h,ei=c,Xt=null)):a=null,a===null)throw Na(c);return iv(a)?c.lanes=32:c.lanes=536870912,null}var z=g.children;return g=g.fallback,y?(Da(),y=c.mode,z=nf({mode:"hidden",children:z},y),g=Po(g,y,h,null),z.return=c,g.return=c,z.sibling=g,c.child=z,g=c.child,g.memoizedState=yx(h),g.childLanes=wx(a,j,h),c.memoizedState=bx,Iu(null,g)):(Pa(c),Sx(c,z))}var Y=a.memoizedState;if(Y!==null&&(z=Y.dehydrated,z!==null)){if(S)c.flags&256?(Pa(c),c.flags&=-257,c=Cx(a,c,h)):c.memoizedState!==null?(Da(),c.child=a.child,c.flags|=128,c=null):(Da(),z=g.fallback,y=c.mode,g=nf({mode:"visible",children:g.children},y),z=Po(z,y,h,null),z.flags|=2,g.return=c,z.return=c,g.sibling=z,c.child=g,Fo(c,a.child,null,h),g=c.child,g.memoizedState=yx(h),g.childLanes=wx(a,j,h),c.memoizedState=bx,c=Iu(null,g));else if(Pa(c),iv(z)){if(j=z.nextSibling&&z.nextSibling.dataset,j)var oe=j.dgst;j=oe,g=Error(i(419)),g.stack="",g.digest=j,Au({value:g,source:null,stack:null}),c=Cx(a,c,h)}else if(Tn||Bl(a,c,h,!1),j=(h&a.childLanes)!==0,Tn||j){if(j=Ht,j!==null&&(g=bh(j,h),g!==0&&g!==Y.retryLane))throw Y.retryLane=g,Ro(a,g),Pi(j,a,g),xx;nv(z)||hf(),c=Cx(a,c,h)}else nv(z)?(c.flags|=192,c.child=a.child,c=null):(a=Y.treeContext,Xt=lr(z.nextSibling),ei=c,Nt=!0,ka=null,ar=!1,a!==null&&N1(c,a),c=Sx(c,g.children),c.flags|=4096);return c}return y?(Da(),z=g.fallback,y=c.mode,Y=a.child,oe=Y.sibling,g=$s(Y,{mode:"hidden",children:g.children}),g.subtreeFlags=Y.subtreeFlags&65011712,oe!==null?z=$s(oe,z):(z=Po(z,y,h,null),z.flags|=2),z.return=c,g.return=c,g.sibling=z,c.child=g,Iu(null,g),g=c.child,z=a.child.memoizedState,z===null?z=yx(h):(y=z.cachePool,y!==null?(Y=jn._currentValue,y=y.parent!==Y?{parent:Y,pool:Y}:y):y=D1(),z={baseLanes:z.baseLanes|h,cachePool:y}),g.memoizedState=z,g.childLanes=wx(a,j,h),c.memoizedState=bx,Iu(a.child,g)):(Pa(c),h=a.child,a=h.sibling,h=$s(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,a!==null&&(j=c.deletions,j===null?(c.deletions=[a],c.flags|=16):j.push(a)),c.child=h,c.memoizedState=null,h)}function Sx(a,c){return c=nf({mode:"visible",children:c},a.mode),c.return=a,a.child=c}function nf(a,c){return a=Bi(22,a,null,c),a.lanes=0,a}function Cx(a,c,h){return Fo(c,a.child,null,h),a=Sx(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function qS(a,c,h){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),zg(a.return,c,h)}
vendor: 4,051 bytes, line 48
48function Ex(a,c,h,g,y,S){var j=a.memoizedState;j===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:y,treeForkCount:S}:(j.isBackwards=c,j.rendering=null,j.renderingStartTime=0,j.last=g,j.tail=h,j.tailMode=y,j.treeForkCount=S)}function KS(a,c,h){var g=c.pendingProps,y=g.revealOrder,S=g.tail;g=g.children;var j=Cn.current,z=(j&2)!==0;if(z?(j=j&1|2,c.flags|=128):j&=1,P(Cn,j),ni(a,c,g,h),g=Nt?Eu:0,!z&&a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&qS(a,h,c);else if(a.tag===19)qS(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(h=c.child,y=null;h!==null;)a=h.alternate,a!==null&&Gh(a)===null&&(y=h),h=h.sibling;h=y,h===null?(y=c.child,c.child=null):(y=h.sibling,h.sibling=null),Ex(c,!1,y,h,S,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,y=c.child,c.child=null;y!==null;){if(a=y.alternate,a!==null&&Gh(a)===null){c.child=y;break}a=y.sibling,y.sibling=h,h=y,y=a}Ex(c,!0,h,null,S,g);break;case"together":Ex(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function qs(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),Ma|=c.lanes,(h&c.childLanes)===0)if(a!==null){if(Bl(a,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(a!==null&&c.child!==a.child)throw Error(i(153));if(c.child!==null){for(a=c.child,h=$s(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=$s(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function Ax(a,c){return(a.lanes&c)!==0?!0:(a=a.dependencies,!!(a!==null&&Mh(a)))}function nO(a,c,h){switch(c.tag){case 3:fe(c,c.stateNode.containerInfo),ja(c,jn,a.memoizedState.cache),Do();break;case 27:case 5:pe(c);break;case 4:fe(c,c.stateNode.containerInfo);break;case 10:ja(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Xg(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Pa(c),c.flags|=128,null):(h&c.child.childLanes)!==0?VS(a,c,h):(Pa(c),a=qs(a,c,h),a!==null?a.sibling:null);Pa(c);break;case 19:var y=(a.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(Bl(a,c,h,!1),g=(h&c.childLanes)!==0),y){if(g)return KS(a,c,h);c.flags|=128}if(y=c.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(Cn,Cn.current),g)break;return null;case 22:return c.lanes=0,FS(a,c,h,c.pendingProps);case 24:ja(c,jn,a.memoizedState.cache)}return qs(a,c,h)}function WS(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps)Tn=!0;else{if(!Ax(a,h)&&(c.flags&128)===0)return Tn=!1,nO(a,c,h);Tn=(a.flags&131072)!==0}else Tn=!1,Nt&&(c.flags&1048576)!==0&&k1(c,Eu,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(a=Io(c.elementType),c.type=a,typeof a=="function")Tg(a)?(g=Uo(a,g),c.tag=1,c=HS(null,c,a,g,h)):(c.tag=0,c=vx(null,c,a,g,h));else{if(a!=null){var y=a.$$typeof;if(y===_){c.tag=11,c=MS(null,c,a,g,h);break e}else if(y===L){c.tag=14,c=IS(null,c,a,g,h);break e}}throw c=K(a)||a,Error(i(306,c,""))}}return c;case 0:return vx(a,c,c.type,c.pendingProps,h);case 1:return g=c.type,y=Uo(g,c.pendingProps),HS(a,c,g,y,h);case 3:e:{if(fe(c,c.stateNode.containerInfo),a===null)throw Error(i(387));g=c.pendingProps;var S=c.memoizedState;y=S.element,Vg(a,c),Pu(c,g,null,h);var j=c.memoizedState;if(g=j.cache,ja(c,jn,g),g!==S.cache&&Fg(c,[jn],h,!0),Ru(),g=j.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:j.cache},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){c=GS(a,c,g,h);break e}else if(g!==y){y=ir(Error(i(424)),c),Au(y),c=GS(a,c,g,h);break e}else{switch(a=c.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Xt=lr(a.firstChild),ei=c,Nt=!0,ka=null,ar=!0,h=F1(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Do(),g===y){c=qs(a,c,h);break e}ni(a,c,g,h)}c=c.child}return c;
vendor: 5,066 bytes, line 48
48case 26:return tf(a,c),a===null?(h=sE(c.type,null,c.pendingProps,null))?c.memoizedState=h:Nt||(h=c.type,a=c.pendingProps,g=bf(ue.current).createElement(h),g[gn]=c,g[Jn]=a,ii(g,h,a),Nn(g),c.stateNode=g):c.memoizedState=sE(c.type,a.memoizedProps,c.pendingProps,a.memoizedState),null;case 27:return pe(c),a===null&&Nt&&(g=c.stateNode=nE(c.type,c.pendingProps,ue.current),ei=c,ar=!0,y=Xt,Ua(c.type)?(rv=y,Xt=lr(g.firstChild)):Xt=y),ni(a,c,c.pendingProps.children,h),tf(a,c),a===null&&(c.flags|=4194304),c.child;case 5:return a===null&&Nt&&((y=g=Xt)&&(g=PO(g,c.type,c.pendingProps,ar),g!==null?(c.stateNode=g,ei=c,Xt=lr(g.firstChild),ar=!1,y=!0):y=!1),y||Na(c)),pe(c),y=c.type,S=c.pendingProps,j=a!==null?a.memoizedProps:null,g=S.children,Jx(y,S)?g=null:j!==null&&Jx(y,j)&&(c.flags|=32),c.memoizedState!==null&&(y=Zg(a,c,K4,null,null,h),Zu._currentValue=y),tf(a,c),ni(a,c,g,h),c.child;case 6:return a===null&&Nt&&((a=h=Xt)&&(h=DO(h,c.pendingProps,ar),h!==null?(c.stateNode=h,ei=c,Xt=null,a=!0):a=!1),a||Na(c)),null;case 13:return VS(a,c,h);case 4:return fe(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=Fo(c,null,g,h):ni(a,c,g,h),c.child;case 11:return MS(a,c,c.type,c.pendingProps,h);case 7:return ni(a,c,c.pendingProps,h),c.child;case 8:return ni(a,c,c.pendingProps.children,h),c.child;case 12:return ni(a,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,ja(c,c.type,g.value),ni(a,c,g.children,h),c.child;case 9:return y=c.type._context,g=c.pendingProps.children,Oo(c),y=ti(y),g=g(y),c.flags|=1,ni(a,c,g,h),c.child;case 14:return IS(a,c,c.type,c.pendingProps,h);case 15:return zS(a,c,c.type,c.pendingProps,h);case 19:return KS(a,c,h);case 31:return tO(a,c,h);case 22:return FS(a,c,h,c.pendingProps);case 24:return Oo(c),g=ti(jn),a===null?(y=Bg(),y===null&&(y=Ht,S=$g(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=h),y=S),c.memoizedState={parent:g,cache:y},Gg(c),ja(c,jn,y)):((a.lanes&h)!==0&&(Vg(a,c),Pu(c,null,null,h),Ru()),y=a.memoizedState,S=c.memoizedState,y.parent!==g?(y={parent:g,cache:g},c.memoizedState=y,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=y),ja(c,jn,g)):(g=S.cache,ja(c,jn,g),g!==y.cache&&Fg(c,[jn],h,!0))),ni(a,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function Ks(a){a.flags|=4}function kx(a,c,h,g,y){if((c=(a.mode&32)!==0)&&(c=!1),c){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(wC())a.flags|=8192;else throw zo=$h,Hg}else a.flags&=-16777217}function YS(a,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!uE(c))if(wC())a.flags|=8192;else throw zo=$h,Hg}function rf(a,c){c!==null&&(a.flags|=4),a.flags&16384&&(c=a.tag!==22?xh():536870912,a.lanes|=c,ec|=c)}function zu(a,c){if(!Nt)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Qt(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(c)for(var y=a.child;y!==null;)h|=y.lanes|y.childLanes,g|=y.subtreeFlags&65011712,g|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)h|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=g,a.childLanes=h,c}function iO(a,c,h){var g=c.pendingProps;switch(Lg(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(c),null;case 1:return Qt(c),null;case 3:return h=c.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Hs(jn),se(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Ul(c)?Ks(c):a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Mg())),Qt(c),null;case 26:var y=c.type,S=c.memoizedState;return a===null?(Ks(c),S!==null?(Qt(c),YS(c,S)):(Qt(c),kx(c,y,null,g,h))):S?S!==a.memoizedState?(Ks(c),Qt(c),YS(c,S)):(Qt(c),c.flags&=-16777217):(a=a.memoizedProps,a!==g&&Ks(c),Qt(c),kx(c,y,a,g,h)),null;case 27:if(Ee(c),h=ue.current,y=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==g&&Ks(c);else{if(!g){if(c.stateNode===null)throw Error(i(166));return Qt(c),null}a=J.current,Ul(c)?j1(c):(a=nE(y,g,h),c.stateNode=a,Ks(c))}return Qt(c),null;case 5:if(Ee(c),y=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==g&&Ks(c);else{if(!g){if(c.stateNode===null)throw Error(i(166));return Qt(c),null}if(S=J.current,Ul(c))j1(c);else{var j=bf(ue.current);switch(S){case 1:S=j.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=j.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=j.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=j.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;
vendor: 26,222 bytes, line 48
48case"select":S=typeof g.is=="string"?j.createElement("select",{is:g.is}):j.createElement("select"),g.multiple?S.multiple=!0:g.size&&(S.size=g.size);break;default:S=typeof g.is=="string"?j.createElement(y,{is:g.is}):j.createElement(y)}}S[gn]=c,S[Jn]=g;e:for(j=c.child;j!==null;){if(j.tag===5||j.tag===6)S.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===c)break e;for(;j.sibling===null;){if(j.return===null||j.return===c)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}c.stateNode=S;e:switch(ii(S,y,g),y){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ks(c)}}return Qt(c),kx(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,h),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==g&&Ks(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(i(166));if(a=ue.current,Ul(c)){if(a=c.stateNode,h=c.memoizedProps,g=null,y=ei,y!==null)switch(y.tag){case 27:case 5:g=y.memoizedProps}a[gn]=c,a=!!(a.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||VC(a.nodeValue,h)),a||Na(c,!0)}else a=bf(a).createTextNode(g),a[gn]=c,c.stateNode=a}return Qt(c),null;case 31:if(h=c.memoizedState,a===null||a.memoizedState!==null){if(g=Ul(c),h!==null){if(a===null){if(!g)throw Error(i(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[gn]=c}else Do(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Qt(c),a=!1}else h=Mg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return c.flags&256?(Gi(c),c):(Gi(c),null);if((c.flags&128)!==0)throw Error(i(558))}return Qt(c),null;case 13:if(g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ul(c),g!==null&&g.dehydrated!==null){if(a===null){if(!y)throw Error(i(318));if(y=c.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[gn]=c}else Do(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Qt(c),y=!1}else y=Mg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return c.flags&256?(Gi(c),c):(Gi(c),null)}return Gi(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,a=a!==null&&a.memoizedState!==null,h&&(g=c.child,y=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(y=g.alternate.memoizedState.cachePool.pool),S=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(S=g.memoizedState.cachePool.pool),S!==y&&(g.flags|=2048)),h!==a&&h&&(c.child.flags|=8192),rf(c,c.updateQueue),Qt(c),null);case 4:return se(),a===null&&Wx(c.stateNode.containerInfo),Qt(c),null;case 10:return Hs(c.type),Qt(c),null;case 19:if(H(Cn),g=c.memoizedState,g===null)return Qt(c),null;if(y=(c.flags&128)!==0,S=g.rendering,S===null)if(y)zu(g,!1);else{if(bn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(S=Gh(a),S!==null){for(c.flags|=128,zu(g,!1),a=S.updateQueue,c.updateQueue=a,rf(c,a),c.subtreeFlags=0,a=h,h=c.child;h!==null;)C1(h,a),h=h.sibling;return P(Cn,Cn.current&1|2),Nt&&Us(c,g.treeForkCount),c.child}a=a.sibling}g.tail!==null&&ve()>cf&&(c.flags|=128,y=!0,zu(g,!1),c.lanes=4194304)}else{if(!y)if(a=Gh(S),a!==null){if(c.flags|=128,y=!0,a=a.updateQueue,c.updateQueue=a,rf(c,a),zu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!S.alternate&&!Nt)return Qt(c),null}else 2*ve()-g.renderingStartTime>cf&&h!==536870912&&(c.flags|=128,y=!0,zu(g,!1),c.lanes=4194304);g.isBackwards?(S.sibling=c.child,c.child=S):(a=g.last,a!==null?a.sibling=S:c.child=S,g.last=S)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=ve(),a.sibling=null,h=Cn.current,P(Cn,y?h&1|2:h&1),Nt&&Us(c,g.treeForkCount),a):(Qt(c),null);case 22:case 23:return Gi(c),Yg(),g=c.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(h&536870912)!==0&&(c.flags&128)===0&&(Qt(c),c.subtreeFlags&6&&(c.flags|=8192)):Qt(c),h=c.updateQueue,h!==null&&rf(c,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048),a!==null&&H(Mo),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Hs(jn),Qt(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function rO(a,c){switch(Lg(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Hs(jn),se(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(Gi(c),c.alternate===null)throw Error(i(340));Do()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(Gi(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Do()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return H(Cn),null;case 4:return se(),null;case 10:return Hs(c.type),null;case 22:case 23:return Gi(c),Yg(),a!==null&&H(Mo),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return Hs(jn),null;case 25:return null;default:return null}}function XS(a,c){switch(Lg(c),c.tag){case 3:Hs(jn),se();break;case 26:case 27:case 5:Ee(c);break;case 4:se();break;case 31:c.memoizedState!==null&&Gi(c);break;case 13:Gi(c);break;case 19:H(Cn);break;case 10:Hs(c.type);break;case 22:case 23:Gi(c),Yg(),a!==null&&H(Mo);break;case 24:Hs(jn)}}function Fu(a,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var y=g.next;h=y;do{if((h.tag&a)===a){g=void 0;var S=h.create,j=h.inst;g=S(),j.destroy=g}h=h.next}while(h!==y)}}catch(z){It(c,c.return,z)}}function La(a,c,h){try{var g=c.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var S=y.next;g=S;do{if((g.tag&a)===a){var j=g.inst,z=j.destroy;if(z!==void 0){j.destroy=void 0,y=c;var Y=h,oe=z;try{oe()}catch(ge){It(y,Y,ge)}}}g=g.next}while(g!==S)}}catch(ge){It(c,c.return,ge)}}function QS(a){var c=a.updateQueue;if(c!==null){var h=a.stateNode;try{U1(c,h)}catch(g){It(a,a.return,g)}}}function ZS(a,c,h){h.props=Uo(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(g){It(a,c,g)}}function $u(a,c){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof h=="function"?a.refCleanup=h(g):h.current=g}}catch(y){It(a,c,y)}}function ss(a,c){var h=a.ref,g=a.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(y){It(a,c,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(y){It(a,c,y)}else h.current=null}function JS(a){var c=a.type,h=a.memoizedProps,g=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(y){It(a,a.return,y)}}function Nx(a,c,h){try{var g=a.stateNode;kO(g,a.type,h,c),g[Jn]=c}catch(y){It(a,a.return,y)}}function eC(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ua(a.type)||a.tag===4}function jx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||eC(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ua(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _x(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(a),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=tr));else if(g!==4&&(g===27&&Ua(a.type)&&(h=a.stateNode,c=null),a=a.child,a!==null))for(_x(a,c,h),a=a.sibling;a!==null;)_x(a,c,h),a=a.sibling}function sf(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(g!==4&&(g===27&&Ua(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(sf(a,c,h),a=a.sibling;a!==null;)sf(a,c,h),a=a.sibling}function tC(a){var c=a.stateNode,h=a.memoizedProps;try{for(var g=a.type,y=c.attributes;y.length;)c.removeAttributeNode(y[0]);ii(c,g,h),c[gn]=a,c[Jn]=h}catch(S){It(a,a.return,S)}}var Ws=!1,Rn=!1,Tx=!1,nC=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function sO(a,c){if(a=a.containerInfo,Qx=kf,a=p1(a),Cg(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var y=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var j=0,z=-1,Y=-1,oe=0,ge=0,Se=a,ce=null;t:for(;;){for(var de;Se!==h||y!==0&&Se.nodeType!==3||(z=j+y),Se!==S||g!==0&&Se.nodeType!==3||(Y=j+g),Se.nodeType===3&&(j+=Se.nodeValue.length),(de=Se.firstChild)!==null;)ce=Se,Se=de;for(;;){if(Se===a)break t;if(ce===h&&++oe===y&&(z=j),ce===S&&++ge===g&&(Y=j),(de=Se.nextSibling)!==null)break;Se=ce,ce=Se.parentNode}Se=de}h=z===-1||Y===-1?null:{start:z,end:Y}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zx={focusedElem:a,selectionRange:h},kf=!1,Xn=c;Xn!==null;)if(c=Xn,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Xn=a;else for(;Xn!==null;){switch(c=Xn,S=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)y=a[h],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,h=c,y=S.memoizedProps,S=S.memoizedState,g=h.stateNode;try{var Ue=Uo(h.type,y);a=g.getSnapshotBeforeUpdate(Ue,S),g.__reactInternalSnapshotBeforeUpdate=a}catch(tt){It(h,h.return,tt)}}break;case 3:if((a&1024)!==0){if(a=c.stateNode.containerInfo,h=a.nodeType,h===9)tv(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":tv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=c.sibling,a!==null){a.return=c.return,Xn=a;break}Xn=c.return}}function iC(a,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Xs(a,h),g&4&&Fu(5,h);break;case 1:if(Xs(a,h),g&4)if(a=h.stateNode,c===null)try{a.componentDidMount()}catch(j){It(h,h.return,j)}else{var y=Uo(h.type,c.memoizedProps);c=c.memoizedState;try{a.componentDidUpdate(y,c,a.__reactInternalSnapshotBeforeUpdate)}catch(j){It(h,h.return,j)}}g&64&&QS(h),g&512&&$u(h,h.return);break;case 3:if(Xs(a,h),g&64&&(a=h.updateQueue,a!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{U1(a,c)}catch(j){It(h,h.return,j)}}break;case 27:c===null&&g&4&&tC(h);case 26:case 5:Xs(a,h),c===null&&g&4&&JS(h),g&512&&$u(h,h.return);break;case 12:Xs(a,h);break;case 31:Xs(a,h),g&4&&aC(a,h);break;case 13:Xs(a,h),g&4&&oC(a,h),g&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=pO.bind(null,h),LO(a,h))));break;case 22:if(g=h.memoizedState!==null||Ws,!g){c=c!==null&&c.memoizedState!==null||Rn,y=Ws;var S=Rn;Ws=g,(Rn=c)&&!S?Qs(a,h,(h.subtreeFlags&8772)!==0):Xs(a,h),Ws=y,Rn=S}break;case 30:break;default:Xs(a,h)}}function rC(a){var c=a.alternate;c!==null&&(a.alternate=null,rC(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&Nl(c)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var sn=null,ji=!1;function Ys(a,c,h){for(h=h.child;h!==null;)sC(a,c,h),h=h.sibling}function sC(a,c,h){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(cn,h)}catch{}switch(h.tag){case 26:Rn||ss(h,c),Ys(a,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Rn||ss(h,c);var g=sn,y=ji;Ua(h.type)&&(sn=h.stateNode,ji=!1),Ys(a,c,h),Yu(h.stateNode),sn=g,ji=y;break;case 5:Rn||ss(h,c);case 6:if(g=sn,y=ji,sn=null,Ys(a,c,h),sn=g,ji=y,sn!==null)if(ji)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(h.stateNode)}catch(S){It(h,c,S)}else try{sn.removeChild(h.stateNode)}catch(S){It(h,c,S)}break;case 18:sn!==null&&(ji?(a=sn,QC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),lc(a)):QC(sn,h.stateNode));break;case 4:g=sn,y=ji,sn=h.stateNode.containerInfo,ji=!0,Ys(a,c,h),sn=g,ji=y;break;case 0:case 11:case 14:case 15:La(2,h,c),Rn||La(4,h,c),Ys(a,c,h);break;case 1:Rn||(ss(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&ZS(h,c,g)),Ys(a,c,h);break;case 21:Ys(a,c,h);break;case 22:Rn=(g=Rn)||h.memoizedState!==null,Ys(a,c,h),Rn=g;break;default:Ys(a,c,h)}}function aC(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{lc(a)}catch(h){It(c,c.return,h)}}}function oC(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{lc(a)}catch(h){It(c,c.return,h)}}function aO(a){switch(a.tag){case 31:case 13:case 19:var c=a.stateNode;return c===null&&(c=a.stateNode=new nC),c;case 22:return a=a.stateNode,c=a._retryCache,c===null&&(c=a._retryCache=new nC),c;default:throw Error(i(435,a.tag))}}function af(a,c){var h=aO(a);c.forEach(function(g){if(!h.has(g)){h.add(g);var y=mO.bind(null,a,g);g.then(y,y)}})}function _i(a,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var y=h[g],S=a,j=c,z=j;e:for(;z!==null;){switch(z.tag){case 27:if(Ua(z.type)){sn=z.stateNode,ji=!1;break e}break;case 5:sn=z.stateNode,ji=!1;break e;case 3:case 4:sn=z.stateNode.containerInfo,ji=!0;break e}z=z.return}if(sn===null)throw Error(i(160));sC(S,j,y),sn=null,ji=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)lC(c,a),c=c.sibling}var Dr=null;function lC(a,c){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:_i(c,a),Ti(a),g&4&&(La(3,a,a.return),Fu(3,a),La(5,a,a.return));break;case 1:_i(c,a),Ti(a),g&512&&(Rn||h===null||ss(h,h.return)),g&64&&Ws&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var y=Dr;if(_i(c,a),Ti(a),g&512&&(Rn||h===null||ss(h,h.return)),g&4){var S=h!==null?h.memoizedState:null;if(g=a.memoizedState,h===null)if(g===null)if(a.stateNode===null){e:{g=a.type,h=a.memoizedProps,y=y.ownerDocument||y;t:switch(g){case"title":S=y.getElementsByTagName("title")[0],(!S||S[ya]||S[gn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(g),y.head.insertBefore(S,y.querySelector("head > title"))),ii(S,g,h),S[gn]=a,Nn(S),g=S;break e;case"link":var j=lE("link","href",y).get(g+(h.href||""));if(j){for(var z=0;z<j.length;z++)if(S=j[z],S.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&S.getAttribute("rel")===(h.rel==null?null:h.rel)&&S.getAttribute("title")===(h.title==null?null:h.title)&&S.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){j.splice(z,1);break t}}S=y.createElement(g),ii(S,g,h),y.head.appendChild(S);break;case"meta":if(j=lE("meta","content",y).get(g+(h.content||""))){for(z=0;z<j.length;z++)if(S=j[z],S.getAttribute("content")===(h.content==null?null:""+h.content)&&S.getAttribute("name")===(h.name==null?null:h.name)&&S.getAttribute("property")===(h.property==null?null:h.property)&&S.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&S.getAttribute("charset")===(h.charSet==null?null:h.charSet)){j.splice(z,1);break t}}S=y.createElement(g),ii(S,g,h),y.head.appendChild(S);break;default:throw Error(i(468,g))}S[gn]=a,Nn(S),g=S}a.stateNode=g}else cE(y,a.type,a.stateNode);else a.stateNode=oE(y,g,a.memoizedProps);else S!==g?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,g===null?cE(y,a.type,a.stateNode):oE(y,g,a.memoizedProps)):g===null&&a.stateNode!==null&&Nx(a,a.memoizedProps,h.memoizedProps)}break;case 27:_i(c,a),Ti(a),g&512&&(Rn||h===null||ss(h,h.return)),h!==null&&g&4&&Nx(a,a.memoizedProps,h.memoizedProps);break;case 5:if(_i(c,a),Ti(a),g&512&&(Rn||h===null||ss(h,h.return)),a.flags&32){y=a.stateNode;try{er(y,"")}catch(Ue){It(a,a.return,Ue)}}g&4&&a.stateNode!=null&&(y=a.memoizedProps,Nx(a,y,h!==null?h.memoizedProps:y)),g&1024&&(Tx=!0);break;case 6:if(_i(c,a),Ti(a),g&4){if(a.stateNode===null)throw Error(i(162));g=a.memoizedProps,h=a.stateNode;try{h.nodeValue=g}catch(Ue){It(a,a.return,Ue)}}break;case 3:if(Sf=null,y=Dr,Dr=yf(c.containerInfo),_i(c,a),Dr=y,Ti(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{lc(c.containerInfo)}catch(Ue){It(a,a.return,Ue)}Tx&&(Tx=!1,cC(a));break;case 4:g=Dr,Dr=yf(a.stateNode.containerInfo),_i(c,a),Ti(a),Dr=g;break;case 12:_i(c,a),Ti(a);break;case 31:_i(c,a),Ti(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,af(a,g)));break;case 13:_i(c,a),Ti(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(lf=ve()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,af(a,g)));break;case 22:y=a.memoizedState!==null;var Y=h!==null&&h.memoizedState!==null,oe=Ws,ge=Rn;if(Ws=oe||y,Rn=ge||Y,_i(c,a),Rn=ge,Ws=oe,Ti(a),g&8192)e:for(c=a.stateNode,c._visibility=y?c._visibility&-2:c._visibility|1,y&&(h===null||Y||Ws||Rn||Bo(a)),h=null,c=a;;){if(c.tag===5||c.tag===26){if(h===null){Y=h=c;try{if(S=Y.stateNode,y)j=S.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{z=Y.stateNode;var Se=Y.memoizedProps.style,ce=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;z.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ue){It(Y,Y.return,Ue)}}}else if(c.tag===6){if(h===null){Y=c;try{Y.stateNode.nodeValue=y?"":Y.memoizedProps}catch(Ue){It(Y,Y.return,Ue)}}}else if(c.tag===18){if(h===null){Y=c;try{var de=Y.stateNode;y?ZC(de,!0):ZC(Y.stateNode,!1)}catch(Ue){It(Y,Y.return,Ue)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===a)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break e;for(;c.sibling===null;){if(c.return===null||c.return===a)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=a.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,af(a,h))));break;case 19:_i(c,a),Ti(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,af(a,g)));break;case 30:break;case 21:break;default:_i(c,a),Ti(a)}}function Ti(a){var c=a.flags;if(c&2){try{for(var h,g=a.return;g!==null;){if(eC(g)){h=g;break}g=g.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var y=h.stateNode,S=jx(a);sf(a,S,y);break;case 5:var j=h.stateNode;h.flags&32&&(er(j,""),h.flags&=-33);var z=jx(a);sf(a,z,j);break;case 3:case 4:var Y=h.stateNode.containerInfo,oe=jx(a);_x(a,oe,Y);break;default:throw Error(i(161))}}catch(ge){It(a,a.return,ge)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function cC(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var c=a;cC(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),a=a.sibling}}function Xs(a,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)iC(a,c.alternate,c),c=c.sibling}function Bo(a){for(a=a.child;a!==null;){var c=a;switch(c.tag){case 0:case 11:case 14:case 15:La(4,c,c.return),Bo(c);break;case 1:ss(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&ZS(c,c.return,h),Bo(c);break;case 27:Yu(c.stateNode);case 26:case 5:ss(c,c.return),Bo(c);break;case 22:c.memoizedState===null&&Bo(c);break;case 30:Bo(c);break;default:Bo(c)}a=a.sibling}}function Qs(a,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,y=a,S=c,j=S.flags;switch(S.tag){case 0:case 11:case 15:Qs(y,S,h),Fu(4,S);break;case 1:if(Qs(y,S,h),g=S,y=g.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(oe){It(g,g.return,oe)}if(g=S,y=g.updateQueue,y!==null){var z=g.stateNode;try{var Y=y.shared.hiddenCallbacks;if(Y!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Y.length;y++)$1(Y[y],z)}catch(oe){It(g,g.return,oe)}}h&&j&64&&QS(S),$u(S,S.return);break;case 27:tC(S);case 26:case 5:Qs(y,S,h),h&&g===null&&j&4&&JS(S),$u(S,S.return);break;case 12:Qs(y,S,h);break;case 31:Qs(y,S,h),h&&j&4&&aC(y,S);break;case 13:Qs(y,S,h),h&&j&4&&oC(y,S);break;case 22:S.memoizedState===null&&Qs(y,S,h),$u(S,S.return);break;case 30:break;default:Qs(y,S,h)}c=c.sibling}}function Rx(a,c){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(a=c.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&ku(h))}function Px(a,c){a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&ku(a))}function Lr(a,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)uC(a,c,h,g),c=c.sibling}function uC(a,c,h,g){var y=c.flags;switch(c.tag){case 0:case 11:case 15:Lr(a,c,h,g),y&2048&&Fu(9,c);break;case 1:Lr(a,c,h,g);break;case 3:Lr(a,c,h,g),y&2048&&(a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&ku(a)));break;case 12:if(y&2048){Lr(a,c,h,g),a=c.stateNode;try{var S=c.memoizedProps,j=S.id,z=S.onPostCommit;typeof z=="function"&&z(j,c.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){It(c,c.return,Y)}}else Lr(a,c,h,g);break;case 31:Lr(a,c,h,g);break;case 13:Lr(a,c,h,g);break;case 23:break;case 22:S=c.stateNode,j=c.alternate,c.memoizedState!==null?S._visibility&2?Lr(a,c,h,g):Uu(a,c):S._visibility&2?Lr(a,c,h,g):(S._visibility|=2,Ql(a,c,h,g,(c.subtreeFlags&10256)!==0||!1)),y&2048&&Rx(j,c);break;case 24:Lr(a,c,h,g),y&2048&&Px(c.alternate,c);break;default:Lr(a,c,h,g)}}function Ql(a,c,h,g,y){for(y=y&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var S=a,j=c,z=h,Y=g,oe=j.flags;switch(j.tag){case 0:case 11:case 15:Ql(S,j,z,Y,y),Fu(8,j);break;case 23:break;case 22:var ge=j.stateNode;j.memoizedState!==null?ge._visibility&2?Ql(S,j,z,Y,y):Uu(S,j):(ge._visibility|=2,Ql(S,j,z,Y,y)),y&&oe&2048&&Rx(j.alternate,j);break;case 24:Ql(S,j,z,Y,y),y&&oe&2048&&Px(j.alternate,j);break;default:Ql(S,j,z,Y,y)}c=c.sibling}}function Uu(a,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=a,g=c,y=g.flags;switch(g.tag){case 22:Uu(h,g),y&2048&&Rx(g.alternate,g);break;case 24:Uu(h,g),y&2048&&Px(g.alternate,g);break;default:Uu(h,g)}c=c.sibling}}var Bu=8192;function Zl(a,c,h){if(a.subtreeFlags&Bu)for(a=a.child;a!==null;)dC(a,c,h),a=a.sibling}function dC(a,c,h){switch(a.tag){case 26:Zl(a,c,h),a.flags&Bu&&a.memoizedState!==null&&qO(h,Dr,a.memoizedState,a.memoizedProps);break;case 5:Zl(a,c,h);break;case 3:case 4:var g=Dr;Dr=yf(a.stateNode.containerInfo),Zl(a,c,h),Dr=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=Bu,Bu=16777216,Zl(a,c,h),Bu=g):Zl(a,c,h));break;default:Zl(a,c,h)}}function hC(a){var c=a.alternate;if(c!==null&&(a=c.child,a!==null)){c.child=null;do c=a.sibling,a.sibling=null,a=c;while(a!==null)}}function Hu(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Xn=g,pC(g,a)}hC(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)fC(a),a=a.sibling}function fC(a){switch(a.tag){case 0:case 11:case 15:Hu(a),a.flags&2048&&La(9,a,a.return);break;case 3:Hu(a);break;case 12:Hu(a);break;case 22:var c=a.stateNode;a.memoizedState!==null&&c._visibility&2&&(a.return===null||a.return.tag!==13)?(c._visibility&=-3,of(a)):Hu(a);break;default:Hu(a)}}function of(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Xn=g,pC(g,a)}hC(a)}for(a=a.child;a!==null;){switch(c=a,c.tag){case 0:case 11:case 15:La(8,c,c.return),of(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,of(c));break;default:of(c)}a=a.sibling}}function pC(a,c){for(;Xn!==null;){var h=Xn;switch(h.tag){case 0:case 11:case 15:La(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:ku(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Xn=g;else e:for(h=a;Xn!==null;){g=Xn;var y=g.sibling,S=g.return;if(rC(g),g===h){Xn=null;break e}if(y!==null){y.return=S,Xn=y;break e}Xn=S}}}var oO={getCacheForType:function(a){var c=ti(jn),h=c.data.get(a);return h===void 0&&(h=a(),c.data.set(a,h)),h},cacheSignal:function(){return ti(jn).controller.signal}},lO=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Ht=null,wt=null,At=0,Mt=0,Vi=null,Oa=!1,Jl=!1,Dx=!1,Zs=0,bn=0,Ma=0,Ho=0,Lx=0,qi=0,ec=0,Gu=null,Ri=null,Ox=!1,lf=0,mC=0,cf=1/0,uf=null,Ia=null,$n=0,za=null,tc=null,Js=0,Mx=0,Ix=null,gC=null,Vu=0,zx=null;function Ki(){return(Lt&2)!==0&&At!==0?At&-At:F.T!==null?Gx():ou()}function xC(){if(qi===0)if((At&536870912)===0||Nt){var a=yo;yo<<=1,(yo&3932160)===0&&(yo=262144),qi=a}else qi=536870912;return a=Hi.current,a!==null&&(a.flags|=32),qi}function Pi(a,c,h){(a===Ht&&(Mt===2||Mt===9)||a.cancelPendingCommit!==null)&&(nc(a,0),Fa(a,At,qi,!1)),Eo(a,h),((Lt&2)===0||a!==Ht)&&(a===Ht&&((Lt&2)===0&&(Ho|=h),bn===4&&Fa(a,At,qi,!1)),as(a))}function vC(a,c,h){if((Lt&6)!==0)throw Error(i(327));var g=!h&&(c&127)===0&&(c&a.expiredLanes)===0||Ps(a,c),y=g?dO(a,c):$x(a,c,!0),S=g;do{if(y===0){Jl&&!g&&Fa(a,c,0,!1);break}else{if(h=a.current.alternate,S&&!cO(h)){y=$x(a,c,!1),S=!1;continue}if(y===2){if(S=c,a.errorRecoveryDisabledLanes&S)var j=0;else j=a.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){c=j;e:{var z=a;y=Gu;var Y=z.current.memoizedState.isDehydrated;if(Y&&(nc(z,j).flags|=256),j=$x(z,j,!1),j!==2){if(Dx&&!Y){z.errorRecoveryDisabledLanes|=S,Ho|=S,y=4;break e}S=Ri,Ri=y,S!==null&&(Ri===null?Ri=S:Ri.push.apply(Ri,S))}y=j}if(S=!1,y!==2)continue}}if(y===1){nc(a,0),Fa(a,c,0,!0);break}e:{switch(g=a,S=y,S){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:Fa(g,c,qi,!Oa);break e;case 2:Ri=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(y=lf+300-ve(),10<y)){if(Fa(g,c,qi,!Oa),So(g,0,!0)!==0)break e;Js=c,g.timeoutHandle=YC(bC.bind(null,g,h,Ri,uf,Ox,c,qi,Ho,ec,Oa,S,"Throttled",-0,0),y);break e}bC(g,h,Ri,uf,Ox,c,qi,Ho,ec,Oa,S,null,-0,0)}}break}while(!0);as(a)}
vendor: 14,650 bytes, line 48
48function bC(a,c,h,g,y,S,j,z,Y,oe,ge,Se,ce,de){if(a.timeoutHandle=-1,Se=c.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tr},dC(c,S,Se);var Ue=(S&62914560)===S?lf-ve():(S&4194048)===S?mC-ve():0;if(Ue=KO(Se,Ue),Ue!==null){Js=S,a.cancelPendingCommit=Ue(NC.bind(null,a,c,S,h,g,y,j,z,Y,ge,Se,null,ce,de)),Fa(a,S,j,!oe);return}}NC(a,c,S,h,g,y,j,z,Y)}function cO(a){for(var c=a;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var y=h[g],S=y.getSnapshot;y=y.value;try{if(!Ui(S(),y))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Fa(a,c,h,g){c&=~Lx,c&=~Ho,a.suspendedLanes|=c,a.pingedLanes&=~c,g&&(a.warmLanes|=c),g=a.expirationTimes;for(var y=c;0<y;){var S=31-yt(y),j=1<<S;g[S]=-1,y&=~j}h!==0&&vh(a,h,c)}function df(){return(Lt&6)===0?(qu(0),!1):!0}function Fx(){if(wt!==null){if(Mt===0)var a=wt.return;else a=wt,Bs=Lo=null,tx(a),ql=null,ju=0,a=wt;for(;a!==null;)XS(a.alternate,a),a=a.return;wt=null}}function nc(a,c){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,_O(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),Js=0,Fx(),Ht=a,wt=h=$s(a.current,null),At=c,Mt=0,Vi=null,Oa=!1,Jl=Ps(a,c),Dx=!1,ec=qi=Lx=Ho=Ma=bn=0,Ri=Gu=null,Ox=!1,(c&8)!==0&&(c|=c&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=c;0<g;){var y=31-yt(g),S=1<<y;c|=a[y],g&=~S}return Zs=c,Rh(),h}function yC(a,c){ft=null,F.H=Mu,c===Vl||c===Fh?(c=M1(),Mt=3):c===Hg?(c=M1(),Mt=4):Mt=c===xx?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Vi=c,wt===null&&(bn=1,Jh(a,ir(c,a.current)))}function wC(){var a=Hi.current;return a===null?!0:(At&4194048)===At?or===null:(At&62914560)===At||(At&536870912)!==0?a===or:!1}function SC(){var a=F.H;return F.H=Mu,a===null?Mu:a}function CC(){var a=F.A;return F.A=oO,a}function hf(){bn=4,Oa||(At&4194048)!==At&&Hi.current!==null||(Jl=!0),(Ma&134217727)===0&&(Ho&134217727)===0||Ht===null||Fa(Ht,At,qi,!1)}function $x(a,c,h){var g=Lt;Lt|=2;var y=SC(),S=CC();(Ht!==a||At!==c)&&(uf=null,nc(a,c)),c=!1;var j=bn;e:do try{if(Mt!==0&&wt!==null){var z=wt,Y=Vi;switch(Mt){case 8:Fx(),j=6;break e;case 3:case 2:case 9:case 6:Hi.current===null&&(c=!0);var oe=Mt;if(Mt=0,Vi=null,ic(a,z,Y,oe),h&&Jl){j=0;break e}break;default:oe=Mt,Mt=0,Vi=null,ic(a,z,Y,oe)}}uO(),j=bn;break}catch(ge){yC(a,ge)}while(!0);return c&&a.shellSuspendCounter++,Bs=Lo=null,Lt=g,F.H=y,F.A=S,wt===null&&(Ht=null,At=0,Rh()),j}function uO(){for(;wt!==null;)EC(wt)}function dO(a,c){var h=Lt;Lt|=2;var g=SC(),y=CC();Ht!==a||At!==c?(uf=null,cf=ve()+500,nc(a,c)):Jl=Ps(a,c);e:do try{if(Mt!==0&&wt!==null){c=wt;var S=Vi;t:switch(Mt){case 1:Mt=0,Vi=null,ic(a,c,S,1);break;case 2:case 9:if(L1(S)){Mt=0,Vi=null,AC(c);break}c=function(){Mt!==2&&Mt!==9||Ht!==a||(Mt=7),as(a)},S.then(c,c);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:L1(S)?(Mt=0,Vi=null,AC(c)):(Mt=0,Vi=null,ic(a,c,S,7));break;case 5:var j=null;switch(wt.tag){case 26:j=wt.memoizedState;case 5:case 27:var z=wt;if(j?uE(j):z.stateNode.complete){Mt=0,Vi=null;var Y=z.sibling;if(Y!==null)wt=Y;else{var oe=z.return;oe!==null?(wt=oe,ff(oe)):wt=null}break t}}Mt=0,Vi=null,ic(a,c,S,5);break;case 6:Mt=0,Vi=null,ic(a,c,S,6);break;case 8:Fx(),bn=6;break e;default:throw Error(i(462))}}hO();break}catch(ge){yC(a,ge)}while(!0);return Bs=Lo=null,F.H=g,F.A=y,Lt=h,wt!==null?0:(Ht=null,At=0,Rh(),bn)}function hO(){for(;wt!==null&&!me();)EC(wt)}function EC(a){var c=WS(a.alternate,a,Zs);a.memoizedProps=a.pendingProps,c===null?ff(a):wt=c}function AC(a){var c=a,h=c.alternate;switch(c.tag){case 15:case 0:c=BS(h,c,c.pendingProps,c.type,void 0,At);break;case 11:c=BS(h,c,c.pendingProps,c.type.render,c.ref,At);break;case 5:tx(c);default:XS(h,c),c=wt=C1(c,Zs),c=WS(h,c,Zs)}a.memoizedProps=a.pendingProps,c===null?ff(a):wt=c}function ic(a,c,h,g){Bs=Lo=null,tx(c),ql=null,ju=0;var y=c.return;try{if(eO(a,y,c,h,At)){bn=1,Jh(a,ir(h,a.current)),wt=null;return}}catch(S){if(y!==null)throw wt=y,S;bn=1,Jh(a,ir(h,a.current)),wt=null;return}c.flags&32768?(Nt||g===1?a=!0:Jl||(At&536870912)!==0?a=!1:(Oa=a=!0,(g===2||g===9||g===3||g===6)&&(g=Hi.current,g!==null&&g.tag===13&&(g.flags|=16384))),kC(c,a)):ff(c)}function ff(a){var c=a;do{if((c.flags&32768)!==0){kC(c,Oa);return}a=c.return;var h=iO(c.alternate,c,Zs);if(h!==null){wt=h;return}if(c=c.sibling,c!==null){wt=c;return}wt=c=a}while(c!==null);bn===0&&(bn=5)}function kC(a,c){do{var h=rO(a.alternate,a);if(h!==null){h.flags&=32767,wt=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(a=a.sibling,a!==null)){wt=a;return}wt=a=h}while(a!==null);bn=6,wt=null}function NC(a,c,h,g,y,S,j,z,Y){a.cancelPendingCommit=null;do pf();while($n!==0);if((Lt&6)!==0)throw Error(i(327));if(c!==null){if(c===a.current)throw Error(i(177));if(S=c.lanes|c.childLanes,S|=jg,ug(a,h,S,j,z,Y),a===Ht&&(wt=Ht=null,At=0),tc=c,za=a,Js=h,Mx=S,Ix=y,gC=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,gO(Ie,function(){return PC(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=F.T,F.T=null,y=V.p,V.p=2,j=Lt,Lt|=4;try{sO(a,c,h)}finally{Lt=j,V.p=y,F.T=g}}$n=1,jC(),_C(),TC()}}function jC(){if($n===1){$n=0;var a=za,c=tc,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=F.T,F.T=null;var g=V.p;V.p=2;var y=Lt;Lt|=4;try{lC(c,a);var S=Zx,j=p1(a.containerInfo),z=S.focusedElem,Y=S.selectionRange;if(j!==z&&z&&z.ownerDocument&&f1(z.ownerDocument.documentElement,z)){if(Y!==null&&Cg(z)){var oe=Y.start,ge=Y.end;if(ge===void 0&&(ge=oe),"selectionStart"in z)z.selectionStart=oe,z.selectionEnd=Math.min(ge,z.value.length);else{var Se=z.ownerDocument||document,ce=Se&&Se.defaultView||window;if(ce.getSelection){var de=ce.getSelection(),Ue=z.textContent.length,tt=Math.min(Y.start,Ue),Ut=Y.end===void 0?tt:Math.min(Y.end,Ue);!de.extend&&tt>Ut&&(j=Ut,Ut=tt,tt=j);var re=h1(z,tt),ne=h1(z,Ut);if(re&&ne&&(de.rangeCount!==1||de.anchorNode!==re.node||de.anchorOffset!==re.offset||de.focusNode!==ne.node||de.focusOffset!==ne.offset)){var ae=Se.createRange();ae.setStart(re.node,re.offset),de.removeAllRanges(),tt>Ut?(de.addRange(ae),de.extend(ne.node,ne.offset)):(ae.setEnd(ne.node,ne.offset),de.addRange(ae))}}}}for(Se=[],de=z;de=de.parentNode;)de.nodeType===1&&Se.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<Se.length;z++){var be=Se[z];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}kf=!!Qx,Zx=Qx=null}finally{Lt=y,V.p=g,F.T=h}}a.current=c,$n=2}}function _C(){if($n===2){$n=0;var a=za,c=tc,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=F.T,F.T=null;var g=V.p;V.p=2;var y=Lt;Lt|=4;try{iC(a,c.alternate,c)}finally{Lt=y,V.p=g,F.T=h}}$n=3}}function TC(){if($n===4||$n===3){$n=0,rt();var a=za,c=tc,h=Js,g=gC;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?$n=5:($n=0,tc=za=null,RC(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Ia=null),au(h),c=c.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(cn,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=F.T,y=V.p,V.p=2,F.T=null;try{for(var S=a.onRecoverableError,j=0;j<g.length;j++){var z=g[j];S(z.value,{componentStack:z.stack})}}finally{F.T=c,V.p=y}}(Js&3)!==0&&pf(),as(a),y=a.pendingLanes,(h&261930)!==0&&(y&42)!==0?a===zx?Vu++:(Vu=0,zx=a):Vu=0,qu(0)}}function RC(a,c){(a.pooledCacheLanes&=c)===0&&(c=a.pooledCache,c!=null&&(a.pooledCache=null,ku(c)))}function pf(){return jC(),_C(),TC(),PC()}function PC(){if($n!==5)return!1;var a=za,c=Mx;Mx=0;var h=au(Js),g=F.T,y=V.p;try{V.p=32>h?32:h,F.T=null,h=Ix,Ix=null;var S=za,j=Js;if($n=0,tc=za=null,Js=0,(Lt&6)!==0)throw Error(i(331));var z=Lt;if(Lt|=4,fC(S.current),uC(S,S.current,j,h),Lt=z,qu(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(cn,S)}catch{}return!0}finally{V.p=y,F.T=g,RC(a,c)}}function DC(a,c,h){c=ir(h,c),c=gx(a.stateNode,c,2),a=Ra(a,c,2),a!==null&&(Eo(a,2),as(a))}function It(a,c,h){if(a.tag===3)DC(a,a,h);else for(;c!==null;){if(c.tag===3){DC(c,a,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ia===null||!Ia.has(g))){a=ir(h,a),h=LS(2),g=Ra(c,h,2),g!==null&&(OS(h,g,c,a),Eo(g,2),as(g));break}}c=c.return}}function Ux(a,c,h){var g=a.pingCache;if(g===null){g=a.pingCache=new lO;var y=new Set;g.set(c,y)}else y=g.get(c),y===void 0&&(y=new Set,g.set(c,y));y.has(h)||(Dx=!0,y.add(h),a=fO.bind(null,a,c,h),c.then(a,a))}function fO(a,c,h){var g=a.pingCache;g!==null&&g.delete(c),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,Ht===a&&(At&h)===h&&(bn===4||bn===3&&(At&62914560)===At&&300>ve()-lf?(Lt&2)===0&&nc(a,0):Lx|=h,ec===At&&(ec=0)),as(a)}function LC(a,c){c===0&&(c=xh()),a=Ro(a,c),a!==null&&(Eo(a,c),as(a))}function pO(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),LC(a,h)}function mO(a,c){var h=0;switch(a.tag){case 31:case 13:var g=a.stateNode,y=a.memoizedState;y!==null&&(h=y.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(i(314))}g!==null&&g.delete(c),LC(a,h)}function gO(a,c){return at(a,c)}var mf=null,rc=null,Bx=!1,gf=!1,Hx=!1,$a=0;function as(a){a!==rc&&a.next===null&&(rc===null?mf=rc=a:rc=rc.next=a),gf=!0,Bx||(Bx=!0,vO())}function qu(a,c){if(!Hx&&gf){Hx=!0;do for(var h=!1,g=mf;g!==null;){if(a!==0){var y=g.pendingLanes;if(y===0)var S=0;else{var j=g.suspendedLanes,z=g.pingedLanes;S=(1<<31-yt(42|a)+1)-1,S&=y&~(j&~z),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,zC(g,S))}else S=At,S=So(g,g===Ht?S:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(S&3)===0||Ps(g,S)||(h=!0,zC(g,S));g=g.next}while(h);Hx=!1}}function xO(){OC()}function OC(){gf=Bx=!1;var a=0;$a!==0&&jO()&&(a=$a);for(var c=ve(),h=null,g=mf;g!==null;){var y=g.next,S=MC(g,c);S===0?(g.next=null,h===null?mf=y:h.next=y,y===null&&(rc=h)):(h=g,(a!==0||(S&3)!==0)&&(gf=!0)),g=y}$n!==0&&$n!==5||qu(a),$a!==0&&($a=0)}function MC(a,c){for(var h=a.suspendedLanes,g=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var j=31-yt(S),z=1<<j,Y=y[j];Y===-1?((z&h)===0||(z&g)!==0)&&(y[j]=El(z,c)):Y<=c&&(a.expiredLanes|=z),S&=~z}if(c=Ht,h=At,h=So(a,a===c?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,h===0||a===c&&(Mt===2||Mt===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&xe(g),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Ps(a,h)){if(c=h&-h,c===a.callbackPriority)return c;switch(g!==null&&xe(g),au(h)){case 2:case 8:h=ye;break;case 32:h=Ie;break;case 268435456:h=nt;break;default:h=Ie}return g=IC.bind(null,a),h=at(h,g),a.callbackPriority=c,a.callbackNode=h,c}return g!==null&&g!==null&&xe(g),a.callbackPriority=2,a.callbackNode=null,2}function IC(a,c){if($n!==0&&$n!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(pf()&&a.callbackNode!==h)return null;var g=At;return g=So(a,a===Ht?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(vC(a,g,c),MC(a,ve()),a.callbackNode!=null&&a.callbackNode===h?IC.bind(null,a):null)}function zC(a,c){if(pf())return null;vC(a,c,!0)}function vO(){TO(function(){(Lt&6)!==0?at(le,xO):OC()})}function Gx(){if($a===0){var a=Hl;a===0&&(a=bo,bo<<=1,(bo&261888)===0&&(bo=256)),$a=a}return $a}function FC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:jo(""+a)}function $C(a,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,a.id&&h.setAttribute("form",a.id),c.parentNode.insertBefore(h,c),a=new FormData(a),h.parentNode.removeChild(h),a}function bO(a,c,h,g,y){if(c==="submit"&&h&&h.stateNode===y){var S=FC((y[Jn]||null).action),j=g.submitter;j&&(c=(c=j[Jn]||null)?FC(c.formAction):j.getAttribute("formAction"),c!==null&&(S=c,j=null));var z=new Nh("action","action",null,g,y);a.push({event:z,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if($a!==0){var Y=j?$C(y,j):new FormData(y);ux(h,{pending:!0,data:Y,method:y.method,action:S},null,Y)}}else typeof S=="function"&&(z.preventDefault(),Y=j?$C(y,j):new FormData(y),ux(h,{pending:!0,data:Y,method:y.method,action:S},S,Y))},currentTarget:y}]})}}for(var Vx=0;Vx<Ng.length;Vx++){var qx=Ng[Vx],yO=qx.toLowerCase(),wO=qx[0].toUpperCase()+qx.slice(1);Pr(yO,"on"+wO)}Pr(x1,"onAnimationEnd"),Pr(v1,"onAnimationIteration"),Pr(b1,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(I4,"onTransitionRun"),Pr(z4,"onTransitionStart"),Pr(F4,"onTransitionCancel"),Pr(y1,"onTransitionEnd"),_r("onMouseEnter",["mouseout","mouseover"]),_r("onMouseLeave",["mouseout","mouseover"]),_r("onPointerEnter",["pointerout","pointerover"]),_r("onPointerLeave",["pointerout","pointerover"]),ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ts("onBeforeInput",["compositionend","keypress","textInput","paste"]),ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ku="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(" "),SO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ku));function UC(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],y=g.event;g=g.listeners;e:{var S=void 0;if(c)for(var j=g.length-1;0<=j;j--){var z=g[j],Y=z.instance,oe=z.currentTarget;if(z=z.listener,Y!==S&&y.isPropagationStopped())break e;S=z,y.currentTarget=oe;try{S(y)}catch(ge){Th(ge)}y.currentTarget=null,S=Y}else for(j=0;j<g.length;j++){if(z=g[j],Y=z.instance,oe=z.currentTarget,z=z.listener,Y!==S&&y.isPropagationStopped())break e;S=z,y.currentTarget=oe;try{S(y)}catch(ge){Th(ge)}y.currentTarget=null,S=Y}}}}function St(a,c){var h=c[Ao];h===void 0&&(h=c[Ao]=new Set);var g=a+"__bubble";h.has(g)||(BC(c,a,2,!1),h.add(g))}function Kx(a,c,h){var g=0;c&&(g|=4),BC(h,a,g,c)}var xf="_reactListening"+Math.random().toString(36).slice(2);
vendor: 3,496 bytes, line 48
48function Wx(a){if(!a[xf]){a[xf]=!0,Sh.forEach(function(h){h!=="selectionchange"&&(SO.has(h)||Kx(h,!1,a),Kx(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[xf]||(c[xf]=!0,Kx("selectionchange",!1,c))}}function BC(a,c,h,g){switch(xE(c)){case 2:var y=XO;break;case 8:y=QO;break;default:y=cv}h=y.bind(null,c,h,a),y=void 0,!we||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(y=!0),g?y!==void 0?a.addEventListener(c,h,{capture:!0,passive:y}):a.addEventListener(c,h,!0):y!==void 0?a.addEventListener(c,h,{passive:y}):a.addEventListener(c,h,!1)}function Yx(a,c,h,g,y){var S=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var j=g.tag;if(j===3||j===4){var z=g.stateNode.containerInfo;if(z===y)break;if(j===4)for(j=g.return;j!==null;){var Y=j.tag;if((Y===3||Y===4)&&j.stateNode.containerInfo===y)return;j=j.return}for(;z!==null;){if(j=Ls(z),j===null)return;if(Y=j.tag,Y===5||Y===6||Y===26||Y===27){g=S=j;continue e}z=z.parentNode}}g=g.return}xn(function(){var oe=S,ge=pu(h),Se=[];e:{var ce=w1.get(a);if(ce!==void 0){var de=Nh,Ue=a;switch(a){case"keypress":if(Tt(h)===0)break e;case"keydown":case"keyup":de=m4;break;case"focusin":Ue="focus",de=vg;break;case"focusout":Ue="blur",de=vg;break;case"beforeblur":case"afterblur":de=vg;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=X0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=i4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=v4;break;case x1:case v1:case b1:de=a4;break;case y1:de=y4;break;case"scroll":case"scrollend":de=t4;break;case"wheel":de=S4;break;case"copy":case"cut":case"paste":de=l4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Z0;break;case"toggle":case"beforetoggle":de=E4}var tt=(c&4)!==0,Ut=!tt&&(a==="scroll"||a==="scrollend"),re=tt?ce!==null?ce+"Capture":null:ce;tt=[];for(var ne=oe,ae;ne!==null;){var be=ne;if(ae=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ae===null||re===null||(be=I(ne,re),be!=null&&tt.push(Wu(ne,be,ae))),Ut)break;ne=ne.return}0<tt.length&&(ce=new de(ce,Ue,null,h,ge),Se.push({event:ce,listeners:tt}))}}if((c&7)===0){e:{if(ce=a==="mouseover"||a==="pointerover",de=a==="mouseout"||a==="pointerout",ce&&h!==fu&&(Ue=h.relatedTarget||h.fromElement)&&(Ls(Ue)||Ue[Ds]))break e;if((de||ce)&&(ce=ge.window===ge?ge:(ce=ge.ownerDocument)?ce.defaultView||ce.parentWindow:window,de?(Ue=h.relatedTarget||h.toElement,de=oe,Ue=Ue?Ls(Ue):null,Ue!==null&&(Ut=s(Ue),tt=Ue.tag,Ue!==Ut||tt!==5&&tt!==27&&tt!==6)&&(Ue=null)):(de=null,Ue=oe),de!==Ue)){if(tt=X0,be="onMouseLeave",re="onMouseEnter",ne="mouse",(a==="pointerout"||a==="pointerover")&&(tt=Z0,be="onPointerLeave",re="onPointerEnter",ne="pointer"),Ut=de==null?ce:Ms(de),ae=Ue==null?ce:Ms(Ue),ce=new tt(be,ne+"leave",de,h,ge),ce.target=Ut,ce.relatedTarget=ae,be=null,Ls(ge)===oe&&(tt=new tt(re,ne+"enter",Ue,h,ge),tt.target=ae,tt.relatedTarget=Ut,be=tt),Ut=be,de&&Ue)t:{for(tt=CO,re=de,ne=Ue,ae=0,be=re;be;be=tt(be))ae++;be=0;for(var We=ne;We;We=tt(We))be++;for(;0<ae-be;)re=tt(re),ae--;for(;0<be-ae;)ne=tt(ne),be--;for(;ae--;){if(re===ne||ne!==null&&re===ne.alternate){tt=re;break t}re=tt(re),ne=tt(ne)}tt=null}else tt=null;de!==null&&HC(Se,ce,de,tt,!1),Ue!==null&&Ut!==null&&HC(Se,Ut,Ue,tt,!0)}}
vendor: 5,240 bytes, lines 48-49
48e:{if(ce=oe?Ms(oe):window,de=ce.nodeName&&ce.nodeName.toLowerCase(),de==="select"||de==="input"&&ce.type==="file")var Pt=a1;else if(r1(ce))if(o1)Pt=L4;else{Pt=P4;var Ge=R4}else de=ce.nodeName,!de||de.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&ns(oe.elementType)&&(Pt=a1):Pt=D4;if(Pt&&(Pt=Pt(a,oe))){s1(Se,Pt,h,ge);break e}Ge&&Ge(a,ce,oe),a==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&Pl(ce,"number",ce.value)}switch(Ge=oe?Ms(oe):window,a){case"focusin":(r1(Ge)||Ge.contentEditable==="true")&&(Ol=Ge,Eg=oe,Cu=null);break;case"focusout":Cu=Eg=Ol=null;break;case"mousedown":Ag=!0;break;case"contextmenu":case"mouseup":case"dragend":Ag=!1,m1(Se,h,ge);break;case"selectionchange":if(M4)break;case"keydown":case"keyup":m1(Se,h,ge)}var mt;if(yg)e:{switch(a){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Ll?n1(a,h)&&(kt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(kt="onCompositionStart");kt&&(J0&&h.locale!=="ko"&&(Ll||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Ll&&(mt=nn()):(ot=ge,Yt="value"in ot?ot.value:ot.textContent,Ll=!0)),Ge=vf(oe,kt),0<Ge.length&&(kt=new Q0(kt,a,null,h,ge),Se.push({event:kt,listeners:Ge}),mt?kt.data=mt:(mt=i1(h),mt!==null&&(kt.data=mt)))),(mt=k4?N4(a,h):j4(a,h))&&(kt=vf(oe,"onBeforeInput"),0<kt.length&&(Ge=new Q0("onBeforeInput","beforeinput",null,h,ge),Se.push({event:Ge,listeners:kt}),Ge.data=mt)),bO(Se,a,oe,h,ge)}UC(Se,c)})}function Wu(a,c,h){return{instance:a,listener:c,currentTarget:h}}function vf(a,c){for(var h=c+"Capture",g=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=I(a,h),y!=null&&g.unshift(Wu(a,y,S)),y=I(a,c),y!=null&&g.push(Wu(a,y,S))),a.tag===3)return g;a=a.return}return[]}function CO(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function HC(a,c,h,g,y){for(var S=c._reactName,j=[];h!==null&&h!==g;){var z=h,Y=z.alternate,oe=z.stateNode;if(z=z.tag,Y!==null&&Y===g)break;z!==5&&z!==26&&z!==27||oe===null||(Y=oe,y?(oe=I(h,S),oe!=null&&j.unshift(Wu(h,oe,Y))):y||(oe=I(h,S),oe!=null&&j.push(Wu(h,oe,Y)))),h=h.return}j.length!==0&&a.push({event:c,listeners:j})}var EO=/\r\n?/g,AO=/\u0000|\uFFFD/g;function GC(a){return(typeof a=="string"?a:""+a).replace(EO,`
49`).replace(AO,"")}function VC(a,c){return c=GC(c),GC(a)===c}function $t(a,c,h,g,y,S){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||er(a,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&er(a,""+g);break;case"className":Tl(a,"class",g);break;case"tabIndex":Tl(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Tl(a,h,g);break;case"style":Rr(a,g,S);break;case"data":if(c!=="object"){Tl(a,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||h!=="href")){a.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=jo(""+g),a.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(h,"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 S=="function"&&(h==="formAction"?(c!=="input"&&$t(a,c,"name",y.name,y,null),$t(a,c,"formEncType",y.formEncType,y,null),$t(a,c,"formMethod",y.formMethod,y,null),$t(a,c,"formTarget",y.formTarget,y,null)):($t(a,c,"encType",y.encType,y,null),$t(a,c,"method",y.method,y,null),$t(a,c,"target",y.target,y,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(h);break}g=jo(""+g),a.setAttribute(h,g);break;case"onClick":g!=null&&(a.onclick=tr);break;case"onScroll":g!=null&&St("scroll",a);break;case"onScrollEnd":g!=null&&St("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(i(61));if(h=g.__html,h!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}h=jo(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""+g):a.removeAttribute(h);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"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":g===!0?a.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(h,g):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(h,g):a.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(h):a.setAttribute(h,g);break;case"popover":St("beforetoggle",a),St("toggle",a),_l(a,"popover",g);break;case"xlinkActuate":Tr(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Tr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Tr(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Tr(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Tr(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Tr(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Tr(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Tr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Tr(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":_l(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=Dl.get(h)||h,_l(a,h,g))}}function Xx(a,c,h,g,y,S){switch(h){case"style":Rr(a,g,S);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(i(61));if(h=g.__html,h!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"children":typeof g=="string"?er(a,g):(typeof g=="number"||typeof g=="bigint")&&er(a,""+g);break;case"onScroll":g!=null&&St("scroll",a);break;case"onScrollEnd":g!=null&&St("scrollend",a);break;case"onClick":g!=null&&(a.onclick=tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ch.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(y=h.endsWith("Capture"),c=h.slice(2,y?h.length-7:void 0),S=a[Jn]||null,S=S!=null?S[h]:null,typeof S=="function"&&a.removeEventListener(c,S,y),typeof g=="function")){typeof S!="function"&&S!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(c,g,y);break e}h in a?a[h]=g:g===!0?a.setAttribute(h,""):_l(a,h,g)}}}function ii(a,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",a),St("load",a);var g=!1,y=!1,S;for(S in h)if(h.hasOwnProperty(S)){var j=h[S];if(j!=null)switch(S){case"src":g=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:$t(a,c,S,j,h,null)}}y&&$t(a,c,"srcSet",h.srcSet,h,null),g&&$t(a,c,"src",h.src,h,null);return;case"input":St("invalid",a);var z=S=j=y=null,Y=null,oe=null;for(g in h)if(h.hasOwnProperty(g)){var ge=h[g];if(ge!=null)switch(g){case"name":y=ge;break;case"type":j=ge;break;case"checked":Y=ge;break;case"defaultChecked":oe=ge;break;case"value":S=ge;break;case"defaultValue":z=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,c));break;default:$t(a,c,g,ge,h,null)}}cu(a,S,z,Y,oe,j,y,!1);return;case"select":St("invalid",a),g=j=S=null;for(y in h)if(h.hasOwnProperty(y)&&(z=h[y],z!=null))switch(y){case"value":S=z;break;case"defaultValue":j=z;break;case"multiple":g=z;default:$t(a,c,y,z,h,null)}c=S,h=j,a.multiple=!!g,c!=null?Is(a,!!g,c,!1):h!=null&&Is(a,!!g,h,!0);return;case"textarea":St("invalid",a),S=y=g=null;for(j in h)if(h.hasOwnProperty(j)&&(z=h[j],z!=null))switch(j){case"value":g=z;break;case"defaultValue":y=z;break;case"children":S=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(i(91));break;default:$t(a,c,j,z,h,null)}mg(a,g,y,S);return;case"option":for(Y in h)if(h.hasOwnProperty(Y)&&(g=h[Y],g!=null))switch(Y){case"selected":a.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:$t(a,c,Y,g,h,null)}return;case"dialog":St("beforetoggle",a),St("toggle",a),St("cancel",a),St("close",a);break;case"iframe":case"object":St("load",a);break;case"video":case"audio":for(g=0;g<Ku.length;g++)St(Ku[g],a);break;case"image":St("error",a),St("load",a);break;case"details":St("toggle",a);break;case"embed":case"source":case"link":St("error",a),St("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in h)if(h.hasOwnProperty(oe)&&(g=h[oe],g!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,c));default:$t(a,c,oe,g,h,null)}return;default:if(ns(c)){for(ge in h)h.hasOwnProperty(ge)&&(g=h[ge],g!==void 0&&Xx(a,c,ge,g,h,void 0));return}}for(z in h)h.hasOwnProperty(z)&&(g=h[z],g!=null&&$t(a,c,z,g,h,null))}function kO(a,c,h,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,j=null,z=null,Y=null,oe=null,ge=null;for(de in h){var Se=h[de];if(h.hasOwnProperty(de)&&Se!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":Y=Se;default:g.hasOwnProperty(de)||$t(a,c,de,null,g,Se)}}for(var ce in g){var de=g[ce];if(Se=h[ce],g.hasOwnProperty(ce)&&(de!=null||Se!=null))switch(ce){case"type":S=de;break;case"name":y=de;break;case"checked":oe=de;break;case"defaultChecked":ge=de;break;case"value":j=de;break;case"defaultValue":z=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,c));break;default:de!==Se&&$t(a,c,ce,de,g,Se)}}Rl(a,j,z,Y,oe,ge,S,y);return;case"select":de=j=z=ce=null;for(S in h)if(Y=h[S],h.hasOwnProperty(S)&&Y!=null)switch(S){case"value":break;case"multiple":de=Y;default:g.hasOwnProperty(S)||$t(a,c,S,null,g,Y)}for(y in g)if(S=g[y],Y=h[y],g.hasOwnProperty(y)&&(S!=null||Y!=null))switch(y){case"value":ce=S;break;case"defaultValue":z=S;break;case"multiple":j=S;default:S!==Y&&$t(a,c,y,S,g,Y)}c=z,h=j,g=de,ce!=null?Is(a,!!h,ce,!1):!!g!=!!h&&(c!=null?Is(a,!!h,c,!0):Is(a,!!h,h?[]:"",!1));return;
vendor: 5,845 bytes, line 49
49case"textarea":de=ce=null;for(z in h)if(y=h[z],h.hasOwnProperty(z)&&y!=null&&!g.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:$t(a,c,z,null,g,y)}for(j in g)if(y=g[j],S=h[j],g.hasOwnProperty(j)&&(y!=null||S!=null))switch(j){case"value":ce=y;break;case"defaultValue":de=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==S&&$t(a,c,j,y,g,S)}uu(a,ce,de);return;case"option":for(var Ue in h)if(ce=h[Ue],h.hasOwnProperty(Ue)&&ce!=null&&!g.hasOwnProperty(Ue))switch(Ue){case"selected":a.selected=!1;break;default:$t(a,c,Ue,null,g,ce)}for(Y in g)if(ce=g[Y],de=h[Y],g.hasOwnProperty(Y)&&ce!==de&&(ce!=null||de!=null))switch(Y){case"selected":a.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:$t(a,c,Y,ce,g,de)}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 tt in h)ce=h[tt],h.hasOwnProperty(tt)&&ce!=null&&!g.hasOwnProperty(tt)&&$t(a,c,tt,null,g,ce);for(oe in g)if(ce=g[oe],de=h[oe],g.hasOwnProperty(oe)&&ce!==de&&(ce!=null||de!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,c));break;default:$t(a,c,oe,ce,g,de)}return;default:if(ns(c)){for(var Ut in h)ce=h[Ut],h.hasOwnProperty(Ut)&&ce!==void 0&&!g.hasOwnProperty(Ut)&&Xx(a,c,Ut,void 0,g,ce);for(ge in g)ce=g[ge],de=h[ge],!g.hasOwnProperty(ge)||ce===de||ce===void 0&&de===void 0||Xx(a,c,ge,ce,g,de);return}}for(var re in h)ce=h[re],h.hasOwnProperty(re)&&ce!=null&&!g.hasOwnProperty(re)&&$t(a,c,re,null,g,ce);for(Se in g)ce=g[Se],de=h[Se],!g.hasOwnProperty(Se)||ce===de||ce==null&&de==null||$t(a,c,Se,ce,g,de)}function qC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function NO(){if(typeof performance.getEntriesByType=="function"){for(var a=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var y=h[g],S=y.transferSize,j=y.initiatorType,z=y.duration;if(S&&z&&qC(j)){for(j=0,z=y.responseEnd,g+=1;g<h.length;g++){var Y=h[g],oe=Y.startTime;if(oe>z)break;var ge=Y.transferSize,Se=Y.initiatorType;ge&&qC(Se)&&(Y=Y.responseEnd,j+=ge*(Y<z?1:(z-oe)/(Y-oe)))}if(--g,c+=8*(S+j)/(y.duration/1e3),a++,10<a)break}}if(0<a)return c/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Qx=null,Zx=null;function bf(a){return a.nodeType===9?a:a.ownerDocument}function KC(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function WC(a,c){if(a===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&c==="foreignObject"?0:a}function Jx(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var ev=null;function jO(){var a=window.event;return a&&a.type==="popstate"?a===ev?!1:(ev=a,!0):(ev=null,!1)}var YC=typeof setTimeout=="function"?setTimeout:void 0,_O=typeof clearTimeout=="function"?clearTimeout:void 0,XC=typeof Promise=="function"?Promise:void 0,TO=typeof queueMicrotask=="function"?queueMicrotask:typeof XC<"u"?function(a){return XC.resolve(null).then(a).catch(RO)}:YC;function RO(a){setTimeout(function(){throw a})}function Ua(a){return a==="head"}function QC(a,c){var h=c,g=0;do{var y=h.nextSibling;if(a.removeChild(h),y&&y.nodeType===8)if(h=y.data,h==="/$"||h==="/&"){if(g===0){a.removeChild(y),lc(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Yu(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Yu(h);for(var S=h.firstChild;S;){var j=S.nextSibling,z=S.nodeName;S[ya]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=j}}else h==="body"&&Yu(a.ownerDocument.body);h=y}while(h);lc(c)}function ZC(a,c){var h=a;a=0;do{var g=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=g}while(h)}function tv(a){var c=a.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":tv(h),Nl(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function PO(a,c,h,g){for(;a.nodeType===1;){var y=h;if(a.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[ya])switch(c){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(c==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;
vendor: 11,298 bytes, line 49
49if(a=lr(a.nextSibling),a===null)break}return null}function DO(a,c,h){if(c==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=lr(a.nextSibling),a===null))return null;return a}function JC(a,c){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=lr(a.nextSibling),a===null))return null;return a}function nv(a){return a.data==="$?"||a.data==="$~"}function iv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function LO(a,c){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=c;else if(a.data!=="$?"||h.readyState!=="loading")c();else{var g=function(){c(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function lr(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return a}var rv=null;function eE(a){a=a.nextSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(c===0)return lr(a.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}a=a.nextSibling}return null}function tE(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return a;c--}else h!=="/$"&&h!=="/&"||c++}a=a.previousSibling}return null}function nE(a,c,h){switch(c=bf(h),a){case"html":if(a=c.documentElement,!a)throw Error(i(452));return a;case"head":if(a=c.head,!a)throw Error(i(453));return a;case"body":if(a=c.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Yu(a){for(var c=a.attributes;c.length;)a.removeAttributeNode(c[0]);Nl(a)}var cr=new Map,iE=new Set;function yf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ea=V.d;V.d={f:OO,r:MO,D:IO,C:zO,L:FO,m:$O,X:BO,S:UO,M:HO};function OO(){var a=ea.f(),c=df();return a||c}function MO(a){var c=Os(a);c!==null&&c.tag===5&&c.type==="form"?yS(c):ea.r(a)}var sc=typeof document>"u"?null:document;function rE(a,c,h){var g=sc;if(g&&typeof c=="string"&&c){var y=Wn(c);y='link[rel="'+a+'"][href="'+y+'"]',typeof h=="string"&&(y+='[crossorigin="'+h+'"]'),iE.has(y)||(iE.add(y),a={rel:a,crossOrigin:h,href:c},g.querySelector(y)===null&&(c=g.createElement("link"),ii(c,"link",a),Nn(c),g.head.appendChild(c)))}}function IO(a){ea.D(a),rE("dns-prefetch",a,null)}function zO(a,c){ea.C(a,c),rE("preconnect",a,c)}function FO(a,c,h){ea.L(a,c,h);var g=sc;if(g&&a&&c){var y='link[rel="preload"][as="'+Wn(c)+'"]';c==="image"&&h&&h.imageSrcSet?(y+='[imagesrcset="'+Wn(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(y+='[imagesizes="'+Wn(h.imageSizes)+'"]')):y+='[href="'+Wn(a)+'"]';var S=y;switch(c){case"style":S=ac(a);break;case"script":S=oc(a)}cr.has(S)||(a=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:a,as:c},h),cr.set(S,a),g.querySelector(y)!==null||c==="style"&&g.querySelector(Xu(S))||c==="script"&&g.querySelector(Qu(S))||(c=g.createElement("link"),ii(c,"link",a),Nn(c),g.head.appendChild(c)))}}function $O(a,c){ea.m(a,c);var h=sc;if(h&&a){var g=c&&typeof c.as=="string"?c.as:"script",y='link[rel="modulepreload"][as="'+Wn(g)+'"][href="'+Wn(a)+'"]',S=y;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=oc(a)}if(!cr.has(S)&&(a=m({rel:"modulepreload",href:a},c),cr.set(S,a),h.querySelector(y)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Qu(S)))return}g=h.createElement("link"),ii(g,"link",a),Nn(g),h.head.appendChild(g)}}}function UO(a,c,h){ea.S(a,c,h);var g=sc;if(g&&a){var y=wa(g).hoistableStyles,S=ac(a);c=c||"default";var j=y.get(S);if(!j){var z={loading:0,preload:null};if(j=g.querySelector(Xu(S)))z.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":c},h),(h=cr.get(S))&&sv(a,h);var Y=j=g.createElement("link");Nn(Y),ii(Y,"link",a),Y._p=new Promise(function(oe,ge){Y.onload=oe,Y.onerror=ge}),Y.addEventListener("load",function(){z.loading|=1}),Y.addEventListener("error",function(){z.loading|=2}),z.loading|=4,wf(j,c,g)}j={type:"stylesheet",instance:j,count:1,state:z},y.set(S,j)}}}function BO(a,c){ea.X(a,c);var h=sc;if(h&&a){var g=wa(h).hoistableScripts,y=oc(a),S=g.get(y);S||(S=h.querySelector(Qu(y)),S||(a=m({src:a,async:!0},c),(c=cr.get(y))&&av(a,c),S=h.createElement("script"),Nn(S),ii(S,"link",a),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(y,S))}}function HO(a,c){ea.M(a,c);var h=sc;if(h&&a){var g=wa(h).hoistableScripts,y=oc(a),S=g.get(y);S||(S=h.querySelector(Qu(y)),S||(a=m({src:a,async:!0,type:"module"},c),(c=cr.get(y))&&av(a,c),S=h.createElement("script"),Nn(S),ii(S,"link",a),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(y,S))}}function sE(a,c,h,g){var y=(y=ue.current)?yf(y):null;if(!y)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=ac(h.href),h=wa(y).hoistableStyles,g=h.get(c),g||(g={type:"style",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=ac(h.href);var S=wa(y).hoistableStyles,j=S.get(a);if(j||(y=y.ownerDocument||y,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,j),(S=y.querySelector(Xu(a)))&&!S._p&&(j.instance=S,j.state.loading=5),cr.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},cr.set(a,h),S||GO(y,a,h,j.state))),c&&g===null)throw Error(i(528,""));return j}if(c&&g!==null)throw Error(i(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=oc(h),h=wa(y).hoistableScripts,g=h.get(c),g||(g={type:"script",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function ac(a){return'href="'+Wn(a)+'"'}function Xu(a){return'link[rel="stylesheet"]['+a+"]"}function aE(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function GO(a,c,h,g){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=a.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),ii(c,"link",h),Nn(c),a.head.appendChild(c))}function oc(a){return'[src="'+Wn(a)+'"]'}function Qu(a){return"script[async]"+a}function oE(a,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var g=a.querySelector('style[data-href~="'+Wn(h.href)+'"]');if(g)return c.instance=g,Nn(g),g;var y=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),Nn(g),ii(g,"style",y),wf(g,h.precedence,a),c.instance=g;case"stylesheet":y=ac(h.href);var S=a.querySelector(Xu(y));if(S)return c.state.loading|=4,c.instance=S,Nn(S),S;g=aE(h),(y=cr.get(y))&&sv(g,y),S=(a.ownerDocument||a).createElement("link"),Nn(S);var j=S;return j._p=new Promise(function(z,Y){j.onload=z,j.onerror=Y}),ii(S,"link",g),c.state.loading|=4,wf(S,h.precedence,a),c.instance=S;case"script":return S=oc(h.src),(y=a.querySelector(Qu(S)))?(c.instance=y,Nn(y),y):(g=h,(y=cr.get(S))&&(g=m({},h),av(g,y)),a=a.ownerDocument||a,y=a.createElement("script"),Nn(y),ii(y,"link",g),a.head.appendChild(y),c.instance=y);case"void":return null;default:throw Error(i(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,wf(g,h.precedence,a));return c.instance}function wf(a,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=g.length?g[g.length-1]:null,S=y,j=0;j<g.length;j++){var z=g[j];if(z.dataset.precedence===c)S=z;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(a,c.firstChild))}function sv(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.title==null&&(a.title=c.title)}function av(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.integrity==null&&(a.integrity=c.integrity)}var Sf=null;function lE(a,c,h){if(Sf===null){var g=new Map,y=Sf=new Map;y.set(h,g)}else y=Sf,g=y.get(h),g||(g=new Map,y.set(h,g));if(g.has(a))return g;for(g.set(a,null),h=h.getElementsByTagName(a),y=0;y<h.length;y++){var S=h[y];if(!(S[ya]||S[gn]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var j=S.getAttribute(c)||"";j=a+j;var z=g.get(j);z?z.push(S):g.set(j,[S])}}return g}function cE(a,c,h){a=a.ownerDocument||a,a.head.insertBefore(h,c==="title"?a.querySelector("head > title"):null)}function VO(a,c,h){if(h===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return a=c.disabled,typeof c.precedence=="string"&&a==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function uE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function qO(a,c,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var y=ac(g.href),S=c.querySelector(Xu(y));if(S){c=S._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=Cf.bind(a),c.then(a,a)),h.state.loading|=4,h.instance=S,Nn(S);return}S=c.ownerDocument||c,g=aE(g),(y=cr.get(y))&&sv(g,y),S=S.createElement("link"),Nn(S);var j=S;j._p=new Promise(function(z,Y){j.onload=z,j.onerror=Y}),ii(S,"link",g),h.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=Cf.bind(a),c.addEventListener("load",h),c.addEventListener("error",h))}}var ov=0;function KO(a,c){return a.stylesheets&&a.count===0&&Af(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var g=setTimeout(function(){if(a.stylesheets&&Af(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+c);0<a.imgBytes&&ov===0&&(ov=62500*NO());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Af(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>ov?50:800)+c);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(y)}}:null}function Cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Af(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ef=null;function Af(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ef=new Map,c.forEac
vendor: 1,454 bytes, line 49
49h(WO,a),Ef=null,Cf.call(a))}function WO(a,c){if(!(c.state.loading&4)){var h=Ef.get(a);if(h)var g=h.get(null);else{h=new Map,Ef.set(a,h);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var j=y[S];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(h.set(j.dataset.precedence,j),g=j)}g&&h.set(null,g)}y=c.instance,j=y.getAttribute("data-precedence"),S=h.get(j)||g,S===g&&h.set(null,y),h.set(j,y),this.count++,g=Cf.bind(this),y.addEventListener("load",g),y.addEventListener("error",g),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),c.state.loading|=4}}var Zu={$$typeof:N,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function YO(a,c,h,g,y,S,j,z,Y){this.tag=1,this.containerInfo=a,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=Co(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Co(0),this.hiddenUpdates=Co(null),this.identifierPrefix=g,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}
vendor: 8,406 bytes, line 49
49function dE(a,c,h,g,y,S,j,z,Y,oe,ge,Se){return a=new YO(a,c,h,j,Y,oe,ge,Se,z),c=1,S===!0&&(c|=24),S=Bi(3,null,null,c),a.current=S,S.stateNode=a,c=$g(),c.refCount++,a.pooledCache=c,c.refCount++,S.memoizedState={element:g,isDehydrated:h,cache:c},Gg(S),a}function hE(a){return a?(a=zl,a):zl}function fE(a,c,h,g,y,S){y=hE(y),g.context===null?g.context=y:g.pendingContext=y,g=Ta(c),g.payload={element:h},S=S===void 0?null:S,S!==null&&(g.callback=S),h=Ra(a,g,c),h!==null&&(Pi(h,a,c),Tu(h,a,c))}function pE(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function lv(a,c){pE(a,c),(a=a.alternate)&&pE(a,c)}function mE(a){if(a.tag===13||a.tag===31){var c=Ro(a,67108864);c!==null&&Pi(c,a,67108864),lv(a,67108864)}}function gE(a){if(a.tag===13||a.tag===31){var c=Ki();c=kl(c);var h=Ro(a,c);h!==null&&Pi(h,a,c),lv(a,c)}}var kf=!0;function XO(a,c,h,g){var y=F.T;F.T=null;var S=V.p;try{V.p=2,cv(a,c,h,g)}finally{V.p=S,F.T=y}}function QO(a,c,h,g){var y=F.T;F.T=null;var S=V.p;try{V.p=8,cv(a,c,h,g)}finally{V.p=S,F.T=y}}function cv(a,c,h,g){if(kf){var y=uv(g);if(y===null)Yx(a,c,g,Nf,h),vE(a,g);else if(JO(y,a,c,h,g))g.stopPropagation();else if(vE(a,g),c&4&&-1<ZO.indexOf(a)){for(;y!==null;){var S=Os(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var j=Nr(S.pendingLanes);if(j!==0){var z=S;for(z.pendingLanes|=2,z.entangledLanes|=2;j;){var Y=1<<31-yt(j);z.entanglements[1]|=Y,j&=~Y}as(S),(Lt&6)===0&&(cf=ve()+500,qu(0))}}break;case 31:case 13:z=Ro(S,2),z!==null&&Pi(z,S,2),df(),lv(S,2)}if(S=uv(g),S===null&&Yx(a,c,g,Nf,h),S===y)break;y=S}y!==null&&g.stopPropagation()}else Yx(a,c,g,null,h)}}function uv(a){return a=pu(a),dv(a)}var Nf=null;function dv(a){if(Nf=null,a=Ls(a),a!==null){var c=s(a);if(c===null)a=null;else{var h=c.tag;if(h===13){if(a=l(c),a!==null)return a;a=null}else if(h===31){if(a=u(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null)}}return Nf=a,null}function xE(a){switch(a){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(Me()){case le:return 2;case ye:return 8;case Ie:case et:return 32;case nt:return 268435456;default:return 32}default:return 32}}var hv=!1,Ba=null,Ha=null,Ga=null,Ju=new Map,ed=new Map,Va=[],ZO="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 vE(a,c){switch(a){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":Ju.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ed.delete(c.pointerId)}}function td(a,c,h,g,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:S,targetContainers:[y]},c!==null&&(c=Os(c),c!==null&&mE(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,y!==null&&c.indexOf(y)===-1&&c.push(y),a)}function JO(a,c,h,g,y){switch(c){case"focusin":return Ba=td(Ba,a,c,h,g,y),!0;case"dragenter":return Ha=td(Ha,a,c,h,g,y),!0;case"mouseover":return Ga=td(Ga,a,c,h,g,y),!0;case"pointerover":var S=y.pointerId;return Ju.set(S,td(Ju.get(S)||null,a,c,h,g,y)),!0;case"gotpointercapture":return S=y.pointerId,ed.set(S,td(ed.get(S)||null,a,c,h,g,y)),!0}return!1}function bE(a){var c=Ls(a.target);if(c!==null){var h=s(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){a.blockedOn=c,jr(a.priority,function(){gE(h)});return}}else if(c===31){if(c=u(h),c!==null){a.blockedOn=c,jr(a.priority,function(){gE(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function jf(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=uv(a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);fu=g,h.target.dispatchEvent(g),fu=null}else return c=Os(h),c!==null&&mE(c),a.blockedOn=h,!1;c.shift()}return!0}function yE(a,c,h){jf(a)&&h.delete(c)}function eM(){hv=!1,Ba!==null&&jf(Ba)&&(Ba=null),Ha!==null&&jf(Ha)&&(Ha=null),Ga!==null&&jf(Ga)&&(Ga=null),Ju.forEach(yE),ed.forEach(yE)}function _f(a,c){a.blockedOn===c&&(a.blockedOn=null,hv||(hv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eM)))}var Tf=null;function wE(a){Tf!==a&&(Tf=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Tf===a&&(Tf=null);for(var c=0;c<a.length;c+=3){var h=a[c],g=a[c+1],y=a[c+2];if(typeof g!="function"){if(dv(g||h)===null)continue;break}var S=Os(h);S!==null&&(a.splice(c,3),c-=3,ux(S,{pending:!0,data:y,method:h.method,action:g},g,y))}}))}function lc(a){function c(Y){return _f(Y,a)}Ba!==null&&_f(Ba,a),Ha!==null&&_f(Ha,a),Ga!==null&&_f(Ga,a),Ju.forEach(c),ed.forEach(c);for(var h=0;h<Va.length;h++){var g=Va[h];g.blockedOn===a&&(g.blockedOn=null)}for(;0<Va.length&&(h=Va[0],h.blockedOn===null);)bE(h),h.blockedOn===null&&Va.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var y=h[g],S=h[g+1],j=y[Jn]||null;if(typeof S=="function")j||wE(h);else if(j){var z=null;if(S&&S.hasAttribute("formAction")){if(y=S,j=S[Jn]||null)z=j.formAction;else if(dv(y)!==null)continue}else z=j.action;typeof z=="function"?h[g+1]=z:(h.splice(g,3),g-=3),wE(h)}}}function SE(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(j){return y=j})},focusReset:"manual",scroll:"manual"})}function c(){y!==null&&(y(),y=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),y!==null&&(y(),y=null)}}}function fv(a){this._internalRoot=a}Rf.prototype.render=fv.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(i(409));var h=c.current,g=Ki();fE(h,g,a,c,null,null)},Rf.prototype.unmount=fv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;fE(a.current,2,null,a,null,null),df(),c[Ds]=null}};function Rf(a){this._internalRoot=a}Rf.prototype.unstable_scheduleHydration=function(a){if(a){var c=ou();a={blockedOn:null,target:a,priority:c};for(var h=0;h<Va.length&&c!==0&&c<Va[h].priority;h++);Va.splice(h,0,a),h===0&&bE(a)}};var CE=e.version;if(CE!=="19.2.0")throw Error(i(527,CE,"19.2.0"));V.findDOMNode=function(a){var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=f(c),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var tM={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.0"};
vendor: 10,381 bytes, lines 49-89
49if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pf.isDisabled&&Pf.supportsFiber)try{cn=Pf.inject(tM),zt=Pf}catch{}}return id.createRoot=function(a,c){if(!r(a))throw Error(i(299));var h=!1,g="",y=TS,S=RS,j=PS;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(S=c.onCaughtError),c.onRecoverableError!==void 0&&(j=c.onRecoverableError)),c=dE(a,1,!1,null,null,h,g,null,y,S,j,SE),a[Ds]=c.current,Wx(a),new fv(c)},id.hydrateRoot=function(a,c,h){if(!r(a))throw Error(i(299));var g=!1,y="",S=TS,j=RS,z=PS,Y=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(y=h.identifierPrefix),h.onUncaughtError!==void 0&&(S=h.onUncaughtError),h.onCaughtError!==void 0&&(j=h.onCaughtError),h.onRecoverableError!==void 0&&(z=h.onRecoverableError),h.formState!==void 0&&(Y=h.formState)),c=dE(a,1,!0,c,h??null,g,y,Y,S,j,z,SE),c.context=hE(null),h=c.current,g=Ki(),g=kl(g),y=Ta(g),y.callback=null,Ra(h,y,g),h=g,c.current.lanes=h,Eo(c,h),as(c),a[Ds]=c.current,Wx(a),new Rf(c)},id.version="19.2.0",id}var DE;function dM(){if(DE)return gv.exports;DE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),gv.exports=uM(),gv.exports}var hM=dM(),fs=function(){return fs=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},fs.apply(this,arguments)};function gN(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function gl(t,e,n,i){function r(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function u(p){try{f(i.next(p))}catch(m){l(m)}}function d(p){try{f(i.throw(p))}catch(m){l(m)}}function f(p){p.done?s(p.value):r(p.value).then(u,d)}f((i=i.apply(t,e||[])).next())})}function fM(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}var fp="right-scroll-bar-position",pp="width-before-scroll-bar",pM="with-scroll-bars-hidden",mM="--removed-body-scroll-bar-size";function yv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function gM(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var xM=typeof window<"u"?v.useLayoutEffect:v.useEffect,LE=new WeakMap;function vM(t,e){var n=gM(null,function(i){return t.forEach(function(r){return yv(r,i)})});return xM(function(){var i=LE.get(n);if(i){var r=new Set(i),s=new Set(t),l=n.current;r.forEach(function(u){s.has(u)||yv(u,null)}),s.forEach(function(u){r.has(u)||yv(u,l)})}LE.set(n,t)},[t]),n}function bM(t){return t}function yM(t,e){e===void 0&&(e=bM);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var l=e(s,i);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(s){for(i=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){i=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(s),l=n}var d=function(){var p=l;l=[],p.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return r}function wM(t){t===void 0&&(t={});var e=yM(null);return e.options=fs({async:!0,ssr:!1},t),e}var xN=function(t){var e=t.sideCar,n=gN(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return v.createElement(i,fs({},n))};xN.isSideCarExport=!0;function SM(t,e){return t.useMedium(e),xN}var vN=wM(),wv=function(){},fm=v.forwardRef(function(t,e){var n=v.useRef(null),i=v.useState({onScrollCapture:wv,onWheelCapture:wv,onTouchMoveCapture:wv}),r=i[0],s=i[1],l=t.forwardProps,u=t.children,d=t.className,f=t.removeScrollBar,p=t.enabled,m=t.shards,x=t.sideCar,b=t.noRelative,w=t.noIsolation,C=t.inert,A=t.allowPinchZoom,E=t.as,k=E===void 0?"div":E,N=t.gapMode,_=gN(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=x,T=vM([n,e]),L=fs(fs({},_),r);return v.createElement(v.Fragment,null,p&&v.createElement(R,{sideCar:vN,removeScrollBar:f,shards:m,noRelative:b,noIsolation:w,inert:C,setCallbacks:s,allowPinchZoom:!!A,lockRef:n,gapMode:N}),l?v.cloneElement(v.Children.only(u),fs(fs({},L),{ref:T})):v.createElement(k,fs({},L,{className:d,ref:T}),u))});fm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fm.classNames={fullWidth:pp,zeroRight:fp};var CM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function EM(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=CM();return e&&t.setAttribute("nonce",e),t}function AM(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function kM(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var NM=function(){var t=0,e=null;return{add:function(n){t==0&&(e=EM())&&(AM(e,n),kM(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},jM=function(){var t=NM();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},bN=function(){var t=jM(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},_M={left:0,top:0,right:0,gap:0},Sv=function(t){return parseInt(t||"",10)||0},TM=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[Sv(n),Sv(i),Sv(r)]},RM=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return _M;var e=TM(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},PM=bN(),Cc="data-scroll-locked",DM=function(t,e,n,i){var r=t.left,s=t.top,l=t.right,u=t.gap;return n===void 0&&(n="margin"),`
50  .`.concat(pM,` {
51   overflow: hidden `).concat(i,`;
52   padding-right: `).concat(u,"px ").concat(i,`;
53  }
54  body[`).concat(Cc,`] {
55    overflow: hidden `).concat(i,`;
56    overscroll-behavior: contain;
57    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
58    padding-left: `.concat(r,`px;
59    padding-top: `).concat(s,`px;
60    padding-right: `).concat(l,`px;
61    margin-left:0;
62    margin-top:0;
63    margin-right: `).concat(u,"px ").concat(i,`;
64    `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(i,";")].filter(Boolean).join(""),`
65  }
66  
67  .`).concat(fp,` {
68    right: `).concat(u,"px ").concat(i,`;
69  }
70  
71  .`).concat(pp,` {
72    margin-right: `).concat(u,"px ").concat(i,`;
73  }
74  
75  .`).concat(fp," .").concat(fp,` {
76    right: 0 `).concat(i,`;
77  }
78  
79  .`).concat(pp," .").concat(pp,` {
80    margin-right: 0 `).concat(i,`;
81  }
82  
83  body[`).concat(Cc,`] {
84    `).concat(mM,": ").concat(u,`px;
85  }
86`)},OE=function(){var t=parseInt(document.body.getAttribute(Cc)||"0",10);return isFinite(t)?t:0},LM=function(){v.useEffect(function(){return document.body.setAttribute(Cc,(OE()+1).toString()),function(){var t=OE()-1;t<=0?document.body.removeAttribute(Cc):document.body.setAttribute(Cc,t.toString())}},[])},OM=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;LM();var s=v.useMemo(function(){return RM(r)},[r]);return v.createElement(PM,{styles:DM(s,!e,r,n?"":"!important")})},Rb=!1;if(typeof window<"u")try{var Df=Object.defineProperty({},"passive",{get:function(){return Rb=!0,!0}});window.addEventListener("test",Df,Df),window.removeEventListener("test",Df,Df)}catch{Rb=!1}var cc=Rb?{passive:!1}:!1,MM=function(t){return t.tagName==="TEXTAREA"},yN=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!MM(t)&&n[e]==="visible")},IM=function(t){return yN(t,"overflowY")},zM=function(t){return yN(t,"overflowX")},ME=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=wN(t,i);if(r){var s=SN(t,i),l=s[1],u=s[2];if(l>u)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},FM=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},$M=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},wN=function(t,e){return t==="v"?IM(e):zM(e)},SN=function(t,e){return t==="v"?FM(e):$M(e)},UM=function(t,e){return t==="h"&&e==="rtl"?-1:1},BM=function(t,e,n,i,r){var s=UM(t,window.getComputedStyle(e).direction),l=s*i,u=n.target,d=e.contains(u),f=!1,p=l>0,m=0,x=0;do{if(!u)break;var b=SN(t,u),w=b[0],C=b[1],A=b[2],E=C-A-s*w;(w||E)&&wN(t,u)&&(m+=E,x+=w);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!d&&u!==document.body||d&&(e.contains(u)||e===u));return(p&&Math.abs(m)<1||!p&&Math.abs(x)<1)&&(f=!0),f},Lf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},IE=function(t){return[t.deltaX,t.deltaY]},zE=function(t){return t&&"current"in t?t.current:t},HM=function(t,e){return t[0]===e[0]&&t[1]===e[1]},GM=function(t){return`
87  .block-interactivity-`.concat(t,` {pointer-events: none;}
88  .allow-interactivity-`).concat(t,` {pointer-events: all;}
89`)},VM=0,uc=[];function qM(t){var e=v.useRef([]),n=v.useRef([0,0]),i=v.useRef(),r=v.useState(VM++)[0],s=v.useState(bN)[0],l=v.useRef(t);v.useEffect(function(){l.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));
89var C=fM([t.lockRef.current],(t.shards||[]).map(zE),!0).filter(Boolean);return C.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),C.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(C,A){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var E=Lf(C),k=n.current,N="deltaX"in C?C.deltaX:k[0]-E[0],_="deltaY"in C?C.deltaY:k[1]-E[1],R,T=C.target,L=Math.abs(N)>Math.abs(_)?"h":"v";if("touches"in C&&L==="h"&&T.type==="range")return!1;var M=ME(L,T);if(!M)return!0;if(M?R=L:(R=L==="v"?"h":"v",M=ME(L,T)),!M)return!1;if(!i.current&&"changedTouches"in C&&(N||_)&&(i.current=R),!R)return!0;var U=i.current||R;return BM(U,A,C,U==="h"?N:_)},[]),d=v.useCallback(function(C){var A=C;if(!(!uc.length||uc[uc.length-1]!==s)){var E="deltaY"in A?IE(A):Lf(A),k=e.current.filter(function(R){return R.name===A.type&&(R.target===A.target||A.target===R.shadowParent)&&HM(R.delta,E)})[0];if(k&&k.should){A.cancelable&&A.preventDefault();return}if(!k){var N=(l.current.shards||[]).map(zE).filter(Boolean).filter(function(R){return R.contains(A.target)}),_=N.length>0?u(A,N[0]):!l.current.noIsolation;_&&A.cancelable&&A.preventDefault()}}},[]),f=v.useCallback(function(C,A,E,k){var N={name:C,delta:A,target:E,should:k,shadowParent:KM(E)};e.current.push(N),setTimeout(function(){e.current=e.current.filter(function(_){return _!==N})},1)},[]),p=v.useCallback(function(C){n.current=Lf(C),i.current=void 0},[]),m=v.useCallback(function(C){f(C.type,IE(C),C.target,u(C,t.lockRef.current))},[]),x=v.useCallback(function(C){f(C.type,Lf(C),C.target,u(C,t.lockRef.current))},[]);v.useEffect(function(){return uc.push(s),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:x}),document.addEventListener("wheel",d,cc),document.addEventListener("touchmove",d,cc),document.addEventListener("touchstart",p,cc),function(){uc=uc.filter(function(C){return C!==s}),document.removeEventListener("wheel",d,cc),document.removeEventListener("touchmove",d,cc),document.removeEventListener("touchstart",p,cc)}},[]);var b=t.removeScrollBar,w=t.inert;return v.createElement(v.Fragment,null,w?v.createElement(s,{styles:GM(r)}):null,b?v.createElement(OM,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function KM(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const WM=SM(vN,qM);var Kd=v.forwardRef(function(t,e){return v.createElement(fm,fs({},t,{ref:e,sideCar:WM}))});Kd.classNames=fm.classNames;function Qo(t){return Object.keys(t)}function Cv(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Ky(t,e){const n={...t},i=e;return Cv(t)&&Cv(e)&&Object.keys(e).forEach(r=>{Cv(i[r])&&r in t?n[r]=Ky(n[r],i[r]):n[r]=i[r]}),n}function YM(t){return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:t.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function XM(t){const e=YM(t);return typeof e=="number"?e:typeof e=="string"?e.includes("calc")||e.includes("var")?e:e.includes("px")?Number(e.replace("px","")):e.includes("rem")?Number(e.replace("rem",""))*16:e.includes("em")?Number(e.replace("em",""))*16:Number(e):NaN}function FE(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function CN(t,{shouldScale:e=!1}={}){function n(i){if(i===0||i==="0")return`0${t}`;if(typeof i=="number"){const r=`${i/16}${t}`;return e?FE(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(s=>n(s)).join(",");if(i.includes(" "))return i.split(" ").map(s=>n(s)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const s=`${Number(r)/16}${t}`;return e?FE(s):s}}return i}return n}const Te=CN("rem",{shouldScale:!0}),$E=CN("em"),EN=typeof document<"u"?v.useLayoutEffect:v.useEffect;function AN(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=AN(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function Hc(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=AN(t))&&(i&&(i+=" "),i+=e);return i}const kN=v.createContext(null);function NN(){const t=v.useContext(kN);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function QM(){return NN().cssVariablesResolver}function jN(){return NN().getStyleNonce}function ZM(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function JM(t){let e=t.replace("#","");if(e.length===3){const l=e.split("");e=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}if(e.length===8){const l=parseInt(e.slice(6,8),16)/255;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:l}}const n=parseInt(e,16),i=n>>16&255,r=n>>8&255,s=n&255;return{r:i,g:r,b:s,a:1}}function eI(t){const[e,n,i,r]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:i,a:r===void 0?1:r}}function tI(t){const e=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=t.match(e);if(!n)return{r:0,g:0,b:0,a:1};const i=parseInt(n[1],10),r=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,l=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*s-1))*r,d=i/60,f=u*(1-Math.abs(d%2-1)),p=s-u/2;let m,x,b;return d>=0&&d<1?(m=u,x=f,b=0):d>=1&&d<2?(m=f,x=u,b=0):d>=2&&d<3?(m=0,x=u,b=f):d>=3&&d<4?(m=0,x=f,b=u):d>=4&&d<5?(m=f,x=0,b=u):(m=u,x=0,b=f),{r:Math.round((m+p)*255),g:Math.round((x+p)*255),b:Math.round((b+p)*255),a:l||1}}function Wy(t){return ZM(t)?JM(t):t.startsWith("rgb")?eI(t):t.startsWith("hsl")?tI(t):{r:0,g:0,b:0,a:1}}function Of(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:i,b:r,a:s}=Wy(t),l=1-e,u=d=>Math.round(d*l);return`rgba(${u(n)}, ${u(i)}, ${u(r)}, ${s})`}function Rd(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function Ev(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function nI(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function iI(t){if(t.startsWith("oklch("))return(nI(t)||0)/100;const{r:e,g:n,b:i}=Wy(t),r=e/255,s=n/255,l=i/255,u=Ev(r),d=Ev(s),f=Ev(l);return .2126*u+.7152*d+.0722*f}function rd(t,e=.179){return t.startsWith("var(")?!1:iI(t)>e}function Yy({color:t,theme:e,colorScheme:n}){if(typeof t!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof t}`);if(t==="bright")return{color:t,value:n==="dark"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:rd(n==="dark"?e.white:e.black,e.luminanceThreshold),variable:"--mantine-color-bright"};if(t==="dimmed")return{color:t,value:n==="dark"?e.colors.dark[2]:e.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:rd(n==="dark"?e.colors.dark[2]:e.colors.gray[6],e.luminanceThreshold),variable:"--mantine-color-dimmed"};if(t==="white"||t==="black")return{color:t,value:t==="white"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:rd(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[i,r]=t.split("."),s=r?Number(r):void 0,l=i in e.colors;if(l){const u=s!==void 0?e.colors[i][s]:e.colors[i][Rd(e,n||"light")];return{color:i,value:u,shade:s,isThemeColor:l,isLight:rd(u,e.luminanceThreshold),variable:r?`--mantine-color-${i}-${s}`:`--mantine-color-${i}-filled`}}return{color:t,value:t,isThemeColor:l,isLight:rd(t,e.luminanceThreshold),shade:s,variable:void 0}}function UE(t,e){const n=Yy({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function BE(t,e){const n={from:t?.from||e.defaultGradient.from,to:t?.to||e.defaultGradient.to,deg:t?.deg??e.defaultGradient.deg??0},i=UE(n.from,e),r=UE(n.to,e);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function aa(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var(")){const s=(1-e)*100;return`color-mix(in srgb, ${t}, transparent ${s}%)`}if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:i,b:r}=Wy(t);return`rgba(${n}, ${i}, ${r}, ${e})`}const dc=aa,rI=({color:t,theme:e,variant:n,gradient:i,autoContrast:r})=>{const s=Yy({color:t,theme:e}),l=typeof r=="boolean"?r:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const u=l&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${t}-filled)`,hover:`var(--mantine-color-${t}-filled-hover)`,color:u,border:`${Te(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:u,border:`${Te(1)} solid transparent`}:{background:t,hover:Of(t,.1),color:u,border:`${Te(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${t}-light)`,hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Te(1)} solid transparent`};const u=e.colors[s.color][s.shade];return{background:aa(u,.1),hover:aa(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Te(1)} solid transparent`}}return{background:aa(t,.1),hover:aa(t,.12),color:t,border:`${Te(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${t}-outline-hover)`,color:`var(--mantine-color-${t}-outline)`,border:`${Te(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:aa(e.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${Te(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:aa(t,.05),color:t,border:`${Te(1)} solid ${t}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Te(1)} solid transparent`};const u=e.colors[s.color][s.shade];return{background:"transparent",hover:aa(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Te(1)} solid transparent`}}return{background:"transparent",hover:aa(t,.12),color:t,border:`${Te(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${Te(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${Te(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${Te(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Of(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${Te(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Of(e.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${Te(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Of(e.white,.01),color:t,border:`${Te(1)} solid transparent`}:n==="gradient"?{background:BE(i,e),hover:BE(i,e),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${Te(1)} solid var(--mantine-color-default-border)`}:{}},sI={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},HE="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Xy={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:sI,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:rI,autoContrast:!1,luminanceThreshold:.3,fontFamily:HE,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:HE,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:Te(34),lineHeight:"1.3"},h2:{fontSize:Te(26),lineHeight:"1.35"},h3:{fontSize:Te(22),lineHeight:"1.4"},h4:{fontSize:Te(18),lineHeight:"1.45"},h5:{fontSize:Te(16),lineHeight:"1.5"},h6:{fontSize:Te(14),lineHeight:"1.5"}}},fontSizes:{xs:Te(12),sm:Te(14),md:Te(16),lg:Te(18),xl:Te(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:Te(2),sm:Te(4),md:Te(8),lg:Te(16),xl:Te(32)},spacing:{xs:Te(10),sm:Te(12),md:Te(16),lg:Te(20),xl:Te(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${Te(1)} ${Te(3)} rgba(0, 0, 0, 0.05), 0 ${Te(1)} ${Te(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${Te(1)} ${Te(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Te(10)} ${Te(15)} ${Te(-5)}, rgba(0, 0, 0, 0.04) 0 ${Te(7)} ${Te(7)} ${Te(-5)}`,md:`0 ${Te(1)} ${Te(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Te(20)} ${Te(25)} ${Te(-5)}, rgba(0, 0, 0, 0.04) 0 ${Te(10)} ${Te(10)} ${Te(-5)}`,lg:`0 ${Te(1)} ${Te(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Te(28)} ${Te(23)} ${Te(-7)}, rgba(0, 0, 0, 0.04) 0 ${Te(12)} ${Te(12)} ${Te(-7)}`,xl:`0 ${Te(1)} ${Te(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Te(36)} ${Te(28)} ${Te(-7)}, rgba(0, 0, 0, 0.04) 0 ${Te(17)} ${Te(17)} ${Te(-7)}`},other:{},components:{}};function GE(t){return t==="auto"||t==="dark"||t==="light"}function aI({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const i=window.localStorage.getItem(t);return GE(i)?i:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:n=>{e=i=>{i.storageArea===window.localStorage&&i.key===t&&GE(i.newValue)&&n(i.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}const oI="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",VE="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Av(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function qE(t){if(!(t.primaryColor in t.colors))throw new Error(oI);if(typeof t.primaryShade=="object"&&(!Av(t.primaryShade.dark)||!Av(t.primaryShade.light)))throw new Error(VE);if(typeof t.primaryShad
89e=="number"&&!Av(t.primaryShade))throw new Error(VE)}function lI(t,e){if(!e)return qE(t),t;const n=Ky(t,e);return e.fontFamily&&!e.headings?.fontFamily&&(n.headings.fontFamily=e.fontFamily),qE(n),n}const Qy=v.createContext(null),cI=()=>v.useContext(Qy)||Xy;function _N(){const t=v.useContext(Qy);if(!t)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return t}function TN({theme:t,children:e,inherit:n=!0}){const i=cI(),r=v.useMemo(()=>lI(n?i:Xy,t),[t,i,n]);return o.jsx(Qy.Provider,{value:r,children:e})}TN.displayName="@mantine/core/MantineThemeProvider";function uI(){const t=_N(),e=jN(),n=Qo(t.breakpoints).reduce((i,r)=>{const s=t.breakpoints[r].includes("px"),l=XM(t.breakpoints[r]),u=s?`${l-.1}px`:$E(l-.1),d=s?`${l}px`:$E(l);return`${i}@media (max-width: ${u}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${d}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return o.jsx("style",{"data-mantine-styles":"classes",nonce:e?.(),dangerouslySetInnerHTML:{__html:n}})}function kv(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function sd(t,e){return(Array.isArray(t)?t:[t]).reduce((i,r)=>`${r}{${i}}`,e)}function dI(t,e){const n=kv(t.variables),i=n?sd(e,n):"",r=kv(t.dark),s=kv(t.light),l=r?sd(e===":host"?`${e}([data-mantine-color-scheme="dark"])`:`${e}[data-mantine-color-scheme="dark"]`,r):"",u=s?sd(e===":host"?`${e}([data-mantine-color-scheme="light"])`:`${e}[data-mantine-color-scheme="light"]`,s):"";return`${i}
90
91${l}
92
93${u}`}function hI({color:t,theme:e,autoContrast:n}){return e.autoContrast&&Yy({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function KE(t,e){return hI({color:t.colors[t.primaryColor][Rd(t,e)],theme:t,autoContrast:null})}function Mf({theme:t,color:e,colorScheme:n,name:i=e,withColorValues:r=!0}){if(!t.colors[e])return{};if(n==="light"){const u=Rd(t,"light"),d={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${u})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${u===9?8:u+1})`,[`--mantine-color-${i}-light`]:dc(t.colors[e][u],.1),[`--mantine-color-${i}-light-hover`]:dc(t.colors[e][u],.12),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${u})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${u})`,[`--mantine-color-${i}-outline-hover`]:dc(t.colors[e][u],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...d}:d}const s=Rd(t,"dark"),l={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${s})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${s===9?8:s+1})`,[`--mantine-color-${i}-light`]:dc(t.colors[e][Math.max(0,s-2)],.15),[`--mantine-color-${i}-light-hover`]:dc(t.colors[e][Math.max(0,s-2)],.2),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${Math.max(s-5,0)})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(s-4,0)})`,[`--mantine-color-${i}-outline-hover`]:dc(t.colors[e][Math.max(s-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...l}:l}function fI(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function hc(t,e,n){Qo(e).forEach(i=>
93Object.assign(t,{[`--mantine-${n}-${i}`]:e[i]}))}const RN=t=>{const e=Rd(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:Te(t.defaultRadius),i={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":t.scale.toString(),"--mantine-cursor-type":t.cursorType,"--mantine-webkit-font-smoothing":t.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":t.fontSmoothing?"grayscale":"unset","--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-line-height":t.lineHeights.md,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":t.headings.fontWeight,"--mantine-heading-text-wrap":t.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${t.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${t.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${t.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${t.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${t.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":KE(t,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":t.black,"--mantine-color-body":t.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-${e})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":KE(t,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};hc(i.variables,t.breakpoints,"breakpoint"),hc(i.variables,t.spacing,"spacing"),hc(i.variables,t.fontSizes,"font-size"),hc(i.variables,t.lineHeights,"line-height"),hc(i.variables,t.shadows,"shadow"),hc(i.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((s,l)=>{i.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${t.primaryColor}-${l})`}),Qo(t.colors).forEach(s=>{const l=t.colors[s];if(fI(l)){Object.assign(i.light,Mf({theme:t,name:l.name,color:l.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,Mf({theme:t,name:l.name,color:l.dark,colorScheme:"dark",withColorValues:!0}));return}l.forEach((u,d)=>{i.variables[`--mantine-color-${s}-${d}`]=u}),Object.assign(i.light,Mf({theme:t,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,Mf({theme:t,color:s,colorScheme:"dark",withColorValues:!1}))});const r=t.headings.sizes;return Qo(r).forEach(s=>{i.variables[`--mantine-${s}-font-size`]=r[s].fontSize,i.variables[`--mantine-${s}-line-height`]=r[s].lineHeight,i.variables[`--mantine-${s}-font-weight`]=r[s].fontWeight||t.headings.fontWeight}),i};function pI({theme:t,generator:e}){const n=RN(t),i=e?.(t);return i?Ky(n,i):n}const Nv=RN(Xy);function mI(t){const e={variables:{},light:{},dark:{}};
93return Qo(t.variables).forEach(n=>{Nv.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),Qo(t.light).forEach(n=>{Nv.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),Qo(t.dark).forEach(n=>{Nv.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function gI(t){return`
94  ${t}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
95  ${t}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
96`}function PN({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=_N(),i=jN(),r=QM(),s=pI({theme:n,generator:r}),l=t===":root"&&e,u=l?mI(s):s,d=dI(u,t);return d?o.jsx("style",{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${d}${l?"":gI(t)}`}}):null}PN.displayName="@mantine/CssVariables";function fc(t,e){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,i=t!=="auto"?t:n?"dark":"light";e()?.setAttribute("data-mantine-color-scheme",i)}function xI({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:i}){const r=v.useRef(null),[s,l]=v.useState(()=>t.get(e)),u=i||s,d=v.useCallback(p=>{i||(fc(p,n),l(p),t.set(p))},[t.set,u,i]),f=v.useCallback(()=>{l(e),fc(e,n),t.clear()},[t.clear,e]);return v.useEffect(()=>(t.subscribe(d),t.unsubscribe),[t.subscribe,t.unsubscribe]),EN(()=>{fc(t.get(e),n)},[]),v.useEffect(()=>{if(i)return fc(i,n),()=>{};i===void 0&&fc(s,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const p=m=>{s==="auto"&&fc(m.matches?"dark":"light",n)};return r.current?.addEventListener("change",p),()=>r.current?.removeEventListener("change",p)},[s,i]),{colorScheme:u,setColorScheme:d,clearColorScheme:f}}function vI({respectReducedMotion:t,getRootElement:e}){EN(()=>{t&&e()?.setAttribute("data-respect-reduced-motion","true")},[t])}function DN({theme:t,children:e,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:s=!0,withCssVariables:l=!0,cssVariablesSelector:u=":root",classNamesPrefix:d="mantine",colorSchemeManager:f=aI(),defaultColorScheme:p="light",getRootElement:m=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:b,stylesTransform:w,env:C}){const{colorScheme:A,setColorScheme:E,clearColorScheme:k}=xI({defaultColorScheme:p,forceColorScheme:b,manager:f,getRootElement:m});return vI({respectReducedMotion:t?.respectReducedMotion||!1,getRootElement:m}),o.jsx(kN.Provider,{value:{colorScheme:A,setColorScheme:E,clearColorScheme:k,getRootElement:m,classNamesPrefix:d,getStyleNonce:n,cssVariablesResolver:x,cssVariablesSelector:u,withStaticClasses:i,stylesTransform:w,env:C},children:o.jsxs(TN,{theme:t,children:[l&&o.jsx(PN,{cssVariablesSelector:u,deduplicateCssVariables:s}),r&&o.jsx(uI,{}),e]})})}DN.displayName="@mantine/core/MantineProvider";var Wd=mN();const bI=ml(Wd);function pm(){return typeof window<"u"}function Gc(t){return LN(t)?(t.nodeName||"").toLowerCase():"#document"}function Qi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function js(t){var e;return(e=(LN(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function LN(t){return pm()?t instanceof Node||t instanceof Qi(t).Node:!1}function Wr(t){return pm()?t instanceof Element||t instanceof Qi(t).Element:!1}function Cs(t){return pm()?t instanceof HTMLElement||t instanceof Qi(t).HTMLElement:!1}function WE(t){return!pm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qi(t).ShadowRoot}const yI=new Set(["inline","contents"]);function Yd(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Yr(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!yI.has(r)}const wI=new Set(["table","td","th"]);function SI(t){return wI.has(Gc(t))}const CI=[":popover-open",":modal"];function mm(t){return CI.some(e=>{try{return t.matches(e)}catch{return!1}})}const EI=["transform","translate","scale","rotate","perspective"],AI=["transform","translate","scale","rotate","perspective","filter"],kI=["paint","layout","strict","content"];function Zy(t){const e=Jy(),n=Wr(t)?Yr(t):t;return EI.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||AI.some(i=>(n.willChange||"").includes(i))||kI.some(i=>(n.contain||"").includes(i))}function NI(t){let e=oo(t);for(;Cs(e)&&!Pc(e);){if(Zy(e))return e;if(mm(e))return null;e=oo(e)}return null}function Jy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jI=new Set(["html","body","#document"]);function Pc(t){return jI.has(Gc(t))}function Yr(t){return Qi(t).getComputedStyle(t)}function gm(t){return Wr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oo(t){if(Gc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||WE(t)&&t.host||js(t);return WE(e)?e.host:e}function ON(t){const e=oo(t);return Pc(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cs(e)&&Yd(e)?e:ON(e)}function Pd(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ON(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),l=Qi(r);if(s){const u=Pb(l);
vendor: 14,672 bytes, line 96
96return e.concat(l,l.visualViewport||[],Yd(r)?r:[],u&&n?Pd(u):[])}return e.concat(r,Pd(r,[],n))}function Pb(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const _I=["top","right","bottom","left"],lo=Math.min,Xi=Math.max,_p=Math.round,If=Math.floor,ws=t=>({x:t,y:t}),TI={left:"right",right:"left",bottom:"top",top:"bottom"},RI={start:"end",end:"start"};function Db(t,e,n){return Xi(t,lo(e,n))}function pa(t,e){return typeof t=="function"?t(e):t}function ma(t){return t.split("-")[0]}function Vc(t){return t.split("-")[1]}function ew(t){return t==="x"?"y":"x"}function tw(t){return t==="y"?"height":"width"}const PI=new Set(["top","bottom"]);function ps(t){return PI.has(ma(t))?"y":"x"}function nw(t){return ew(ps(t))}function DI(t,e,n){n===void 0&&(n=!1);const i=Vc(t),r=nw(t),s=tw(r);let l=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=Tp(l)),[l,Tp(l)]}function LI(t){const e=Tp(t);return[Lb(t),e,Lb(e)]}function Lb(t){return t.replace(/start|end/g,e=>RI[e])}const YE=["left","right"],XE=["right","left"],OI=["top","bottom"],MI=["bottom","top"];function II(t,e,n){switch(t){case"top":case"bottom":return n?e?XE:YE:e?YE:XE;case"left":case"right":return e?OI:MI;default:return[]}}function zI(t,e,n,i){const r=Vc(t);let s=II(ma(t),n==="start",i);return r&&(s=s.map(l=>l+"-"+r),e&&(s=s.concat(s.map(Lb)))),s}function Tp(t){return t.replace(/left|right|bottom|top/g,e=>TI[e])}function FI(t){return{top:0,right:0,bottom:0,left:0,...t}}function MN(t){return typeof t!="number"?FI(t):{top:t,right:t,bottom:t,left:t}}function Rp(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function QE(t,e,n){let{reference:i,floating:r}=t;const s=ps(e),l=nw(e),u=tw(l),d=ma(e),f=s==="y",p=i.x+i.width/2-r.width/2,m=i.y+i.height/2-r.height/2,x=i[u]/2-r[u]/2;let b;switch(d){case"top":b={x:p,y:i.y-r.height};break;case"bottom":b={x:p,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:m};break;case"left":b={x:i.x-r.width,y:m};break;default:b={x:i.x,y:i.y}}switch(Vc(e)){case"start":b[l]-=x*(n&&f?-1:1);break;case"end":b[l]+=x*(n&&f?-1:1);break}return b}const $I=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l}=n,u=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:p,y:m}=QE(f,i,d),x=i,b={},w=0;for(let C=0;C<u.length;C++){const{name:A,fn:E}=u[C],{x:k,y:N,data:_,reset:R}=await E({x:p,y:m,initialPlacement:i,placement:x,strategy:r,middlewareData:b,rects:f,platform:l,elements:{reference:t,floating:e}});p=k??p,m=N??m,b={...b,[A]:{...b[A],..._}},R&&w<=50&&(w++,typeof R=="object"&&(R.placement&&(x=R.placement),R.rects&&(f=R.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:r}):R.rects),{x:p,y:m}=QE(f,x,d)),C=-1)}return{x:p,y:m,placement:x,strategy:r,middlewareData:b}};async function Dd(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:l,elements:u,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:x=!1,padding:b=0}=pa(e,t),w=MN(b),A=u[x?m==="floating"?"reference":"floating":m],E=Rp(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:f,rootBoundary:p,strategy:d})),k=m==="floating"?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),_=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},R=Rp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:N,strategy:d}):k);return{top:(E.top-R.top+w.top)/_.y,bottom:(R.bottom-E.bottom+w.bottom)/_.y,left:(E.left-R.left+w.left)/_.x,right:(R.right-E.right+w.right)/_.x}}const UI=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:l,elements:u,middlewareData:d}=e,{element:f,padding:p=0}=pa(t,e)||{};if(f==null)return{};const m=MN(p),x={x:n,y:i},b=nw(r),w=tw(b),C=await l.getDimensions(f),A=b==="y",E=A?"top":"left",k=A?"bottom":"right",N=A?"clientHeight":"clientWidth",_=s.reference[w]+s.reference[b]-x[b]-s.floating[w],R=x[b]-s.reference[b],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let L=T?T[N]:0;(!L||!await(l.isElement==null?void 0:l.isElement(T)))&&(L=u.floating[N]||s.floating[w]);const M=_/2-R/2,U=L/2-C[w]/2-1,D=lo(m[E],U),G=lo(m[k],U),Z=D,Q=L-C[w]-G,K=L/2-C[w]/2+M,q=Db(Z,K,Q),F=!d.arrow&&Vc(r)!=null&&K!==q&&s.reference[w]/2-(K<Z?D:G)-C[w]/2<0,V=F?K<Z?K-Z:K-Q:0;return{[b]:x[b]+V,data:{[b]:q,centerOffset:K-q-V,...F&&{alignmentOffset:V}},reset:F}}}),BI=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:s,rects:l,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...A}=pa(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=ma(r),k=ps(u),N=ma(u)===u,_=await(d.isRTL==null?void 0:d.isRTL(f.floating)),R=x||(N||!C?[Tp(u)]:LI(u)),T=w!=="none";!x&&T&&R.push(...zI(u,C,w,_));const L=[u,...R],M=await Dd(e,A),U=[];let D=((i=s.flip)==null?void 0:i.overflows)||[];if(p&&U.push(M[E]),m){const K=DI(r,l,_);U.push(M[K[0]],M[K[1]])}if(D=[...D,{placement:r,overflows:U}],!U.every(K=>K<=0)){var G,Z;const K=(((G=s.flip)==null?void 0:G.index)||0)+1,q=L[K];if(q&&(!(m==="alignment"?k!==ps(q):!1)||D.every(O=>ps(O.placement)===k?O.overflows[0]>0:!0)))return{data:{index:K,overflows:D},reset:{placement:q}};let F=(Z=D.filter(V=>V.overflows[0]<=0).sort((V,O)=>V.overflows[1]-O.overflows[1])[0])==null?void 0:Z.placement;if(!F)switch(b){case"bestFit":{var Q;const V=(Q=D.filter(O=>{if(T){const X=ps(O.placement);return X===k||X==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(X=>X>0).reduce((X,$)=>X+$,0)]).sort((O,X)=>O[1]-X[1])[0])==null?void 0:Q[0];V&&(F=V);break}case"initialPlacement":F=u;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function ZE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function JE(t){return _I.some(e=>t[e]>=0)}const HI=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=pa(t,e);switch(i){case"referenceHidden":{const s=await Dd(e,{...r,elementContext:"reference"}),l=ZE(s,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:JE(l)}}}case"escaped":{const s=await Dd(e,{...r,altBoundary:!0}),l=ZE(s,n.floating);return{data:{escapedOffsets:l,escaped:JE(l)}}}default:return{}}}}},IN=new Set(["left","top"]);async function GI(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),l=ma(n),u=Vc(n),d=ps(n)==="y",f=IN.has(l)?-1:1,p=s&&d?-1:1,m=pa(e,t);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(b=u==="end"?w*-1:w),d?{x:b*p,y:x*f}:{x:x*f,y:b*p}}const VI=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:l,middlewareData:u}=e,d=await GI(e,t);return l===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:r+d.x,y:s+d.y,data:{...d,placement:l}}}}},qI=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:A=>{let{x:E,y:k}=A;return{x:E,y:k}}},...d}=pa(t,e),f={x:n,y:i},p=await Dd(e,d),m=ps(ma(r)),x=ew(m);let b=f[x],w=f[m];if(s){const A=x==="y"?"top":"left",E=x==="y"?"bottom":"right",k=b+p[A],N=b-p[E];b=Db(k,b,N)}if(l){const A=m==="y"?"top":"left",E=m==="y"?"bottom":"right",k=w+p[A],N=w-p[E];w=Db(k,w,N)}const C=u.fn({...e,[x]:b,[m]:w});return{...C,data:{x:C.x-n,y:C.y-i,enabled:{[x]:s,[m]:l}}}}}},KI=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:l}=e,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=pa(t,e),p={x:n,y:i},m=ps(r),x=ew(m);let b=p[x],w=p[m];const C=pa(u,e),A=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(d){const N=x==="y"?"height":"width",_=s.reference[x]-s.floating[N]+A.mainAxis,R=s.reference[x]+s.reference[N]-A.mainAxis;b<_?b=_:b>R&&(b=R)}if(f){var E,k;const N=x==="y"?"width":"height",_=IN.has(ma(r)),R=s.reference[m]-s.floating[N]+(_&&((E=l.offset)==null?void 0:E[m])||0)+(_?0:A.crossAxis),T=s.reference[m]+s.reference[N]+(_?0:((k=l.offset)==null?void 0:k[m])||0)-(_?A.crossAxis:0);w<R?w=R:w>T&&(w=T)}return{[x]:b,[m]:w}}}},WI=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:l,elements:u}=e,{apply:d=()=>{},...f}=pa(t,e),p=await Dd(e,f),m=ma(r),x=Vc(r),b=ps(r)==="y",{width:w,height:C}=s.floating;let A,E;m==="top"||m==="bottom"?(A=m,E=x===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(E=m,A=x==="end"?"top":"bottom");const k=C-p.top-p.bottom,N=w-p.left-p.right,_=lo(C-p[A],k),R=lo(w-p[E],N),T=!e.middlewareData.shift;let L=_,M=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(M=N),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(L=k),T&&!x){const D=Xi(p.left,0),G=Xi(p.right,0),Z=Xi(p.top,0),Q=Xi(p.bottom,0);b?M=w-2*(D!==0||G!==0?D+G:Xi(p.left,p.right)):L=C-2*(Z!==0||Q!==0?Z+Q:Xi(p.top,p.bottom))}await d({...e,availableWidth:M,availableHeight:L});const U=await l.getDimensions(u.floating);return w!==U.width||C!==U.height?{reset:{rects:!0}}:{}}}};function zN(t){const e=Yr(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Cs(t),s=r?t.offsetWidth:n,l=r?t.offsetHeight:i,u=_p(n)!==s||_p(i)!==l;return u&&(n=s,i=l),{width:n,height:i,$:u}}function iw(t){return Wr(t)?t:t.contextElement}function Ec(t){const e=iw(t);if(!Cs(e))return ws(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=zN(e);let l=(s?_p(n.width):n.width)/i,u=(s?_p(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const YI=ws(0);function FN(t){const e=Qi(t);return!Jy()||!e.visualViewport?YI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XI(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qi(t)?!1:e}function el(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=iw(t);let l=ws(1);e&&(i?Wr(i)&&(l=Ec(i)):l=Ec(t));const u=XI(s,n,i)?FN(s):ws(0);let d=(r.left+u.x)/l.x,f=(r.top+u.y)/l.y,p=r.width/l.x,m=r.height/l.y;if(s){const x=Qi(s),b=i&&Wr(i)?Qi(i):i;let w=x,C=Pb(w);for(;C&&i&&b!==w;){const A=Ec(C),E=C.getBoundingClientRect(),k=Yr(C),N=E.left+(C.clientLeft+parseFloat(k.paddingLeft))*A.x,_=E.top+(C.clientTop+parseFloat(k.paddingTop))*A.y;d*=A.x,f*=A.y,p*=A.x,m*=A.y,d+=N,f+=_,w=Qi(C),C=Pb(w)}}return Rp({width:p,height:m,x:d,y:f})}function xm(t,e){const n=gm(t).scrollLeft;return e?e.left+n:el(js(t)).left+n}function $N(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-xm(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function QI(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",l=js(i),u=e?mm(e.floating):!1;if(i===l||u&&s)return n;let d={scrollLeft:0,scrollTop:0},f=ws(1);const p=ws(0),m=Cs(i);if((m||!m&&!s)&&((Gc(i)!=="body"||Yd(l))&&(d=gm(i)),Cs(i))){const b=el(i);f=Ec(i),p.x=b.x+i.clientLeft,p.y=b.y+i.clientTop}const x=l&&!m&&!s?$N(l,d):ws(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+x.x,y:n.y*f.y-d.scrollTop*f.y+p.y+x.y}}function ZI(t){return Array.from(t.getClientRects())}function JI(t){const e=js(t),n=gm(t),i=t.ownerDocument.body,r=Xi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Xi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+xm(t);const u=-n.scrollTop;return Yr(i).direction==="rtl"&&(l+=Xi(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:l,y:u}}const eA=25;function e3(t,e){const n=Qi(t),i=js(t),r=n.visualViewport;let s=i.clientWidth,l=i.clientHeight,u=0,d=0;if(r){s=r.width,l=r.height;const p=Jy();(!p||p&&e==="fixed")&&(u=r.offsetLeft,d=r.offsetTop)}const f=xm(i);if(f<=0){const p=i.ownerDocument,m=p.body,x=getComputedStyle(m),b=p.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-m.clientWidth-b);w<=eA&&(s-=w)}else f<=eA&&(s+=f);return{width:s,height:l,x:u,y:d}}const t3=new Set(["absolute","fixed"]);function n3(t,e){const n=el(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Cs(t)?Ec(t):ws(1),l=t.clientWidth*s.x,u=t.clientHeight*s.y,d=r*s.x,f=i*s.y;return{width:l,height:u,x:d,y:f}}function tA(t,e,n){let i;if(e==="viewport")i=e3(t,n);else if(e==="document")i=JI(js(t));else if(Wr(e))i=n3(e,n);else{const r=FN(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Rp(i)}function UN(t,e){const n=oo(t);return n===e||!Wr(n)||Pc(n)?!1:Yr(n).position==="fixed"||UN(n,e)}function i3(t,e){const n=e.get(t);if(n)return n;let i=Pd(t,[],!1).filter(u=>Wr(u)&&Gc(u)!=="body"),r=null;const s=Yr(t).position==="fixed";let l=s?oo(t):t;for(;Wr(l)&&!Pc(l);){const u=Yr(l),d=Zy(l);!d&&u.position==="fixed"&&(r=null),(s?!d&&!r:!d&&u.position==="static"&&!!r&&t3.has(r.position)||Yd(l)&&!d&&UN(t,l))?i=i.filter(p=>p!==l):r=u,l=oo(l)}return e.set(t,i),i}function r3(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const l=[...n==="clippingAncestors"?mm(e)?[]:i3(e,this._c):[].concat(n),i],u=l[0],d=l.reduce((f,p)=>{const m=tA(e,p,r);return f.top=Xi(m.top,f.top),f.right=lo(m.right,f.right),f.bottom=lo(m.bottom,f.bottom),f.left=Xi(m.left,f.left),f},tA(e,u,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function s3(t){const{width:e,height:n}=zN(t);return{width:e,height:n}}function a3(t,e,n){const i=Cs(e),r=js(e),s=n==="fixed",l=el(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const d=ws(0);function f(){d.x=xm(r)}if(i||!i&&!s)if((Gc(e)!=="body"||Yd(r))&&(u=gm(e)),i){const b=el(e,!0,s,e);d.x=b.x+e.clientLeft,d.y=b.y+e.clientTop}else r&&f();s&&!i&&r&&f();const p=r&&!i&&!s?$N(r,u):ws(0),m=l.left+u.scrollLeft-d.x-p.x,x=l.top+u.scrollTop-d.y-p.y;return{x:m,y:x,width:l.width,height:l.height}}function jv(t){return Yr(t).position==="static"}function nA(t,e){if(!Cs(t)||Yr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return js(t)===n&&(n=n.ownerDocument.body),n}function BN(t,e){const n=Qi(t);
vendor: 4,206 bytes, line 96
96if(mm(t))return n;if(!Cs(t)){let r=oo(t);for(;r&&!Pc(r);){if(Wr(r)&&!jv(r))return r;r=oo(r)}return n}let i=nA(t,e);for(;i&&SI(i)&&jv(i);)i=nA(i,e);return i&&Pc(i)&&jv(i)&&!Zy(i)?n:i||NI(t)||n}const o3=async function(t){const e=this.getOffsetParent||BN,n=this.getDimensions,i=await n(t.floating);return{reference:a3(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function l3(t){return Yr(t).direction==="rtl"}const c3={convertOffsetParentRelativeRectToViewportRelativeRect:QI,getDocumentElement:js,getClippingRect:r3,getOffsetParent:BN,getElementRects:o3,getClientRects:ZI,getDimensions:s3,getScale:Ec,isElement:Wr,isRTL:l3};function HN(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function u3(t,e){let n=null,i;const r=js(t);function s(){var u;clearTimeout(i),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const f=t.getBoundingClientRect(),{left:p,top:m,width:x,height:b}=f;if(u||e(),!x||!b)return;const w=If(m),C=If(r.clientWidth-(p+x)),A=If(r.clientHeight-(m+b)),E=If(p),N={rootMargin:-w+"px "+-C+"px "+-A+"px "+-E+"px",threshold:Xi(0,lo(1,d))||1};let _=!0;function R(T){const L=T[0].intersectionRatio;if(L!==d){if(!_)return l();L?l(!1,L):i=setTimeout(()=>{l(!1,1e-7)},1e3)}L===1&&!HN(f,t.getBoundingClientRect())&&l(),_=!1}try{n=new IntersectionObserver(R,{...N,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,N)}n.observe(t)}return l(!0),s}function d3(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=i,f=iw(t),p=r||s?[...f?Pd(f):[],...Pd(e)]:[];p.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const m=f&&u?u3(f,n):null;let x=-1,b=null;l&&(b=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&b&&(b.unobserve(e),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(e)})),n()}),f&&!d&&b.observe(f),b.observe(e));let w,C=d?el(t):null;d&&A();function A(){const E=el(t);C&&!HN(C,E)&&n(),C=E,w=requestAnimationFrame(A)}return n(),()=>{var E;p.forEach(k=>{r&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),m?.(),(E=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(w)}}const h3=VI,f3=qI,p3=BI,m3=WI,g3=HI,iA=UI,x3=KI,v3=(t,e,n)=>{const i=new Map,r={platform:c3,...n},s={...r.platform,_c:i};return $I(t,e,{...r,platform:s})};var b3=typeof document<"u",y3=function(){},mp=b3?v.useLayoutEffect:y3;function Pp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!Pp(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&t.$$typeof)&&!Pp(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function GN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function rA(t,e){const n=GN(t);return Math.round(e*n)/n}function _v(t){const e=v.useRef(t);return mp(()=>{e.current=t}),e}function w3(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=t,[p,m]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[x,b]=v.useState(i);Pp(x,i)||b(i);const[w,C]=v.useState(null),[A,E]=v.useState(null),k=v.useCallback(O=>{O!==T.current&&(T.current=O,C(O))},[]),N=v.useCallback(O=>{O!==L.current&&(L.current=O,E(O))},[]),_=s||w,R=l||A,T=v.useRef(null),L=v.useRef(null),M=v.useRef(p),U=d!=null,D=_v(d),G=_v(r),Z=_v(f),Q=v.useCallback(()=>{if(!T.current||!L.current)return;const O={placement:e,strategy:n,middleware:x};G.current&&(O.platform=G.current),v3(T.current,L.current,O).then(X=>{const $={...X,isPositioned:Z.current!==!1};K.current&&!Pp(M.current,$)&&(M.current=$,Wd.flushSync(()=>{m($)}))})},[x,e,n,G,Z]);mp(()=>
96{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,m(O=>({...O,isPositioned:!1})))},[f]);const K=v.useRef(!1);mp(()=>(K.current=!0,()=>{K.current=!1}),[]),mp(()=>{if(_&&(T.current=_),R&&(L.current=R),_&&R){if(D.current)return D.current(_,R,Q);Q()}},[_,R,Q,D,U]);const q=v.useMemo(()=>({reference:T,floating:L,setReference:k,setFloating:N}),[k,N]),F=v.useMemo(()=>({reference:_,floating:R}),[_,R]),V=v.useMemo(()=>{const O={position:n,left:0,top:0};if(!F.floating)return O;const X=rA(F.floating,p.x),$=rA(F.floating,p.y);return u?{...O,transform:"translate("+X+"px, "+$+"px)",...GN(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:$}},[n,u,F.floating,p.x,p.y]);return v.useMemo(()=>({...p,update:Q,refs:q,elements:F,floatingStyles:V}),[p,Q,q,F,V])}const S3=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?iA({element:i.current,padding:r}).fn(n):{}:i?iA({element:i,padding:r}).fn(n):{}}}},C3=(t,e)=>({...h3(t),options:[t,e]}),E3=(t,e)=>({...f3(t),options:[t,e]}),A3=(t,e)=>({...x3(t),options:[t,e]}),k3=(t,e)=>({...p3(t),options:[t,e]}),N3=(t,e)=>({...m3(t),options:[t,e]}),j3=(t,e)=>({...g3(t),options:[t,e]}),_3=(t,e)=>({...S3(t),options:[t,e]});/**
97 * react-router v7.9.4
98 *
99 * Copyright (c) Remix Software Inc.
100 *
101 * This source code is licensed under the MIT license found in the
102 * LICENSE.md file in the root directory of this source tree.
103 *
104 * @license MIT
105 */var sA="popstate";function T3(t={}){function e(i,r){let{pathname:s,search:l,hash:u}=i.location;return Ob("",{pathname:s,search:l,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(i,r){return typeof r=="string"?r:Ld(r)}return P3(e,n,null,t)}function on(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Sr(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function R3(){return Math.random().toString(36).substring(2,10)}function aA(t,e){return{usr:t.state,key:t.key,idx:e}}function Ob(t,e,n=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?qc(e):e,state:n,key:e&&e.key||i||R3()}}function Ld({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function qc(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function P3(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,u="POP",d=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function m(){u="POP";let A=p(),E=A==null?null:A-f;f=A,d&&d({action:u,location:C.location,delta:E})}function x(A,E){u="PUSH";let k=Ob(C.location,A,E);f=p()+1;let N=aA(k,f),_=C.createHref(k);try{l.pushState(N,"",_)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;r.location.assign(_)}s&&d&&d({action:u,location:C.location,delta:1})}function b(A,E){u="REPLACE";let k=Ob(C.location,A,E);f=p();let N=aA(k,f),_=C.createHref(k);l.replaceState(N,"",_),s&&d&&d({action:u,location:C.location,delta:0})}function w(A){return D3(A)}let C={get action(){return u},get location(){return t(r,l)},listen(A){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(sA,m),d=A,()=>{r.removeEventListener(sA,m),d=null}},createHref(A){return e(r,A)},createURL:w,encodeLocation(A){let E=w(A);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:b,go(A){return l.go(A)}};return C}function D3(t,e=!1){let n="http://localhost";
105typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),on(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Ld(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function VN(t,e,n="/"){return L3(t,e,n,!1)}function L3(t,e,n,i){let r=typeof e=="string"?qc(e):e,s=ga(r.pathname||"/",n);if(s==null)return null;let l=qN(t);O3(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=q3(s);u=G3(l[d],f,i)}return u}function qN(t,e=[],n=[],i="",r=!1){let s=(l,u,d=r,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(i)&&d)return;on(p.relativePath.startsWith(i),`Absolute route path "${p.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(i.length)}let m=ha([i,p.relativePath]),x=n.concat(p);l.children&&l.children.length>0&&(on(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),qN(l.children,e,x,m,d)),!(l.path==null&&!l.index)&&e.push({path:m,score:B3(m,l.index),routesMeta:x})};return t.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))s(l,u);else for(let d of KN(l.path))s(l,u,!0,d)}),e}function KN(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=KN(i.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),r&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function O3(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:H3(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var M3=/^:[\w-]+$/,I3=3,z3=2,F3=1,$3=10,U3=-2,oA=t=>t==="*";function B3(t,e){let n=t.split("/"),i=n.length;return n.some(oA)&&(i+=U3),e&&(i+=z3),n.filter(r=>!oA(r)).reduce((r,s)=>r+(M3.test(s)?I3:s===""?F3:$3),i)}function H3(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function G3(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",l=[];for(let u=0;u<i.length;++u){let d=i[u],f=u===i.length-1,p=s==="/"?e:e.slice(s.length)||"/",m=Dp({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),x=d.route;if(!m&&f&&n&&!i[i.length-1].route.index&&(m=Dp({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;
105Object.assign(r,m.params),l.push({params:r,pathname:ha([s,m.pathname]),pathnameBase:X3(ha([s,m.pathnameBase])),route:x}),m.pathnameBase!=="/"&&(s=ha([s,m.pathnameBase]))}return l}function Dp(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=V3(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),u=r.slice(1);return{params:i.reduce((f,{paramName:p,isOptional:m},x)=>{if(p==="*"){let w=u[x]||"";l=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[x];return m&&!b?f[p]=void 0:f[p]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:l,pattern:t}}function V3(t,e=!1,n=!0){Sr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(i.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function q3(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Sr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ga(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function K3(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?qc(t):t;return{pathname:n?n.startsWith("/")?n:W3(n,e):e,search:Q3(i),hash:Z3(r)}}function W3(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Tv(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Y3(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function rw(t){let e=Y3(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function sw(t,e,n,i=!1){let r;typeof t=="string"?r=qc(t):(r={...t},on(!r.pathname||!r.pathname.includes("?"),Tv("?","pathname","search",r)),on(!r.pathname||!r.pathname.includes("#"),Tv("#","pathname","hash",r)),on(!r.search||!r.search.includes("#"),Tv("#","search","hash",r)));let s=t===""||r.pathname==="",l=s?"/":r.pathname,u;if(l==null)u=n;else{let m=e.length-1;if(!i&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),m-=1;r.pathname=x.join("/")}u=m>=0?e[m]:"/"}let d=K3(r,u),f=l&&l!=="/"&&l.endsWith("/"),p=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var ha=t=>t.join("/").replace(/\/\/+/g,"/"),X3=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Q3=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Z3=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function J3(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var WN=["POST","PUT","PATCH","DELETE"];new Set(WN);var ez=["GET",...WN];new Set(ez);var Kc=v.createContext(null);Kc.displayName="DataRouter";var vm=v.createContext(null);vm.displayName="DataRouterState";v.createContext(!1);var YN=v.createContext({isTransitioning:!1});YN.displayName="ViewTransition";var tz=v.createContext(new Map);tz.displayName="Fetchers";var nz=v.createContext(null);nz.displayName="Await";var Zr=v.createContext(null);Zr.displayName="Navigation";var Xd=v.createContext(null);Xd.displayName="Location";var Cr=v.createContext({outlet:null,matches:[],isDataRoute:!1});Cr.displayName="Route";var aw=v.createContext(null);aw.displayName="RouteError";function iz(t,{relative:e}={}){on(Wc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=v.useContext(Zr),{hash:r,pathname:s,search:l}=Qd(t,{relative:e}),u=s;return n!=="/"&&(u=s==="/"?n:ha([n,s])),i.createHref({pathname:u,search:l,hash:r})}function Wc(){return v.useContext(Xd)!=null}function Jr(){return on(Wc(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Xd).location}var XN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function QN(t){v.useContext(Zr).static||v.useLayoutEffect(t)}function Kn(){let{isDataRoute:t}=v.useContext(Cr);return t?vz():rz()}function rz(){on(Wc(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(Kc),{basename:e,navigator:n}=v.useContext(Zr),{matches:i}=v.useContext(Cr),{pathname:r}=Jr(),s=JSON.stringify(rw(i)),l=v.useRef(!1);return QN(()=>{l.current=!0}),v.useCallback((d,f={})=>
105{if(Sr(l.current,XN),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=sw(d,JSON.parse(s),r,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:ha([e,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[e,n,s,r,t])}var sz=v.createContext(null);function az(t){let e=v.useContext(Cr).outlet;return v.useMemo(()=>e&&v.createElement(sz.Provider,{value:t},e),[e,t])}function ow(){let{matches:t}=v.useContext(Cr),e=t[t.length-1];return e?e.params:{}}function Qd(t,{relative:e}={}){let{matches:n}=v.useContext(Cr),{pathname:i}=Jr(),r=JSON.stringify(rw(n));return v.useMemo(()=>sw(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function oz(t,e){return ZN(t,e)}function ZN(t,e,n,i,r){on(Wc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Zr),{matches:l}=v.useContext(Cr),u=l[l.length-1],d=u?u.params:{},f=u?u.pathname:"/",p=u?u.pathnameBase:"/",m=u&&u.route;{let k=m&&m.path||"";JN(f,!m||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${k}">) 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.
106
107Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let x=Jr(),b;if(e){let k=typeof e=="string"?qc(e):e;on(p==="/"||k.pathname?.startsWith(p),`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 "${p}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=x;let w=b.pathname||"/",C=w;if(p!=="/"){let k=p.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let A=VN(t,{pathname:C});Sr(m||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Sr(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 E=hz(A&&A.map(k=>Object.assign({},k,{params:Object.assign({},d,k.params),pathname:ha([p,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:ha([p,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),l,n,i,r);return e&&E?v.createElement(Xd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function lz(){let t=xz(),e=J3(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:r},n):null,l)}var cz=v.createElement(lz,null),uz=class extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?v.createElement(Cr.Provider,{value:this.props.routeContext},v.createElement(aw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function dz({routeContext:t,match:e,children:n}){let i=v.useContext(Kc);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),v.createElement(Cr.Provider,{value:t},n)}function hz(t,e=[],n=null,i=null,r=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,l=n?.errors;if(l!=null){let f=s.findIndex(p=>p.route.id&&l?.[p.route.id]!==void 0);on(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let u=!1,d=-1;if(n)for(let f=0;f<s.length;f++){let p=s[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=f),p.route.id){let{loaderData:m,errors:x}
107=n,b=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||b){u=!0,d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}return s.reduceRight((f,p,m)=>{let x,b=!1,w=null,C=null;n&&(x=l&&p.route.id?l[p.route.id]:void 0,w=p.route.errorElement||cz,u&&(d<0&&m===0?(JN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):d===m&&(b=!0,C=p.route.hydrateFallbackElement||null)));let A=e.concat(s.slice(0,m+1)),E=()=>{let k;return x?k=w:b?k=C:p.route.Component?k=v.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=f,v.createElement(dz,{match:p,routeContext:{outlet:f,matches:A,isDataRoute:n!=null},children:k})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?v.createElement(uz,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:E(),routeContext:{outlet:null,matches:A,isDataRoute:!0},unstable_onError:i}):E()},null)}function lw(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function fz(t){let e=v.useContext(Kc);return on(e,lw(t)),e}function pz(t){let e=v.useContext(vm);return on(e,lw(t)),e}function mz(t){let e=v.useContext(Cr);return on(e,lw(t)),e}function cw(t){let e=mz(t),n=e.matches[e.matches.length-1];return on(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function gz(){return cw("useRouteId")}function xz(){let t=v.useContext(aw),e=pz("useRouteError"),n=cw("useRouteError");return t!==void 0?t:e.errors?.[n]}function vz(){let{router:t}=fz("useNavigate"),e=cw("useNavigate"),n=v.useRef(!1);return QN(()=>{n.current=!0}),v.useCallback(async(r,s={})=>{Sr(n.current,XN),n.current&&(typeof r=="number"?t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var lA={};function JN(t,e,n){!e&&!lA[t]&&(lA[t]=!0,Sr(!1,n))}v.memo(bz);function bz({routes:t,future:e,state:n,unstable_onError:i}){return ZN(t,void 0,n,i,e)}function Mb({to:t,replace:e,state:n,relative:i}){on(Wc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=v.useContext(Zr);Sr(!r,"<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:s}=v.useContext(Cr),{pathname:l}=Jr(),u=Kn(),d=sw(t,rw(s),l,i==="path"),f=JSON.stringify(d);return v.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:i})},[u,f,i,e,n]),null}function yz(t){return az(t.context)}function an(t){on(!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 wz({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1}){on(!Wc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:r,static:s,future:{}}),[l,r,s]);typeof n=="string"&&(n=qc(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:x="default"}=n,b=v.useMemo(()=>{let w=ga(d,l);return w==null?null:{location:{pathname:w,search:f,hash:p,state:m,key:x},navigationType:i}},[l,d,f,p,m,x,i]);return Sr(b!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(Zr.Provider,{value:u},v.createElement(Xd.Provider,{children:e,value:b}))}function Sz({children:t,location:e}){return oz(Ib(t),e)}function Ib(t,e=[]){let n=[];return v.Children.forEach(t,(i,r)=>{if(!v.isValidElement(i))return;let s=[...e,r];if(i.type===v.Fragment){n.push.apply(n,Ib(i.props.children,s));return}on(i.type===an,`[${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>`),on(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.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,
107shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Ib(i.props.children,s)),n.push(l)}),n}var gp="get",xp="application/x-www-form-urlencoded";function bm(t){return t!=null&&typeof t.tagName=="string"}function Cz(t){return bm(t)&&t.tagName.toLowerCase()==="button"}function Ez(t){return bm(t)&&t.tagName.toLowerCase()==="form"}function Az(t){return bm(t)&&t.tagName.toLowerCase()==="input"}function kz(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Nz(t,e){return t.button===0&&(!e||e==="_self")&&!kz(t)}function zb(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let i=t[n];return e.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function jz(t,e){let n=zb(t);return e&&e.forEach((i,r)=>{n.has(r)||e.getAll(r).forEach(s=>{n.append(r,s)})}),n}var zf=null;function _z(){if(zf===null)try{new FormData(document.createElement("form"),0),zf=!1}catch{zf=!0}return zf}var Tz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rv(t){return t!=null&&!Tz.has(t)?(Sr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xp}"`),null):t}function Rz(t,e){let n,i,r,s,l;if(Ez(t)){let u=t.getAttribute("action");i=u?ga(u,e):null,n=t.getAttribute("method")||gp,r=Rv(t.getAttribute("enctype"))||xp,s=new FormData(t)}else if(Cz(t)||Az(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||u.getAttribute("action");if(i=d?ga(d,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||gp,r=Rv(t.getAttribute("formenctype"))||Rv(u.getAttribute("enctype"))||xp,s=new FormData(u,t),!_z()){let{name:f,type:p,value:m}=t;if(p==="image"){let x=f?`${f}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else f&&s.append(f,m)}}else{if(bm(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=gp,i=null,r=xp,l=t}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Pz(t,e,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i.pathname==="/"?i.pathname=`_root.${n}`:e&&ga(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${n}`,i}async function Dz(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Lz(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Oz(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let l=await Dz(s,n);return l.links?l.links():[]}return[]}));return Fz(i.flat(1).filter(Lz).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function cA(t,e,n,i,r,s){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return s==="assets"?e.filter((d,f)=>l(d,f)||u(d,f)):s==="data"?e.filter((d,f)=>{let p=i.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Mz(t,e,{includeHydrateFallback:n}={}){return Iz(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Iz(t){return[...new Set(t)]}function zz(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function Fz(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(zz(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function ej(){let t=v.useContext(Kc);return uw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function $z(){let t=v.useContext(vm);return uw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var dw=v.createContext(void 0);dw.displayName="FrameworkContext";function tj(){let t=v.useContext(dw);return uw(t,"You must render this element inside a <HydratedRouter> element"),t}function Uz(t,e){let n=v.useContext(dw),[i,r]=v.useState(!1),[s,l]=v.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=e,x=v.useRef(null);v.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let C=E=>
107{E.forEach(k=>{l(k.isIntersecting)})},A=new IntersectionObserver(C,{threshold:.5});return x.current&&A.observe(x.current),()=>{A.disconnect()}}},[t]),v.useEffect(()=>{if(i){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[i]);let b=()=>{r(!0)},w=()=>{r(!1),l(!1)};return n?t!=="intent"?[s,x,{}]:[s,x,{onFocus:ad(u,b),onBlur:ad(d,w),onMouseEnter:ad(f,b),onMouseLeave:ad(p,w),onTouchStart:ad(m,b)}]:[!1,x,{}]}function ad(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Bz({page:t,...e}){let{router:n}=ej(),i=v.useMemo(()=>VN(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?v.createElement(Gz,{page:t,matches:i,...e}):null}function Hz(t){let{manifest:e,routeModules:n}=tj(),[i,r]=v.useState([]);return v.useEffect(()=>{let s=!1;return Oz(t,e,n).then(l=>{s||r(l)}),()=>{s=!0}},[t,e,n]),i}function Gz({page:t,matches:e,...n}){let i=Jr(),{manifest:r,routeModules:s}=tj(),{basename:l}=ej(),{loaderData:u,matches:d}=$z(),f=v.useMemo(()=>cA(t,e,d,r,i,"data"),[t,e,d,r,i]),p=v.useMemo(()=>cA(t,e,d,r,i,"assets"),[t,e,d,r,i]),m=v.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let w=new Set,C=!1;if(e.forEach(E=>{let k=r.routes[E.route.id];!k||!k.hasLoader||(!f.some(N=>N.route.id===E.route.id)&&E.route.id in u&&s[E.route.id]?.shouldRevalidate||k.hasClientLoader?C=!0:w.add(E.route.id))}),w.size===0)return[];let A=Pz(t,l,"data");return C&&w.size>0&&A.searchParams.set("_routes",e.filter(E=>w.has(E.route.id)).map(E=>E.route.id).join(",")),[A.pathname+A.search]},[l,u,i,r,f,e,t,s]),x=v.useMemo(()=>Mz(p,r),[p,r]),b=Hz(p);return v.createElement(v.Fragment,null,m.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:C})=>v.createElement("link",{key:w,nonce:n.nonce,...C})))}function Vz(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var nj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nj&&(window.__reactRouterVersion="7.9.4")}catch{}function qz({basename:t,children:e,window:n}){let i=v.useRef();i.current==null&&(i.current=T3({window:n,v5Compat:!0}));let r=i.current,[s,l]=v.useState({action:r.action,location:r.location}),u=v.useCallback(d=>{v.startTransition(()=>l(d))},[l]);return v.useLayoutEffect(()=>r.listen(u),[r,u]),v.createElement(wz,{basename:t,children:e,location:s.location,navigationType:s.action,navigator:r})}var ij=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fi=v.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,state:u,target:d,to:f,preventScrollReset:p,viewTransition:m,...x},b){let{basename:w}=v.useContext(Zr),C=typeof f=="string"&&ij.test(f),A,E=!1;if(typeof f=="string"&&C&&(A=f,nj))try{let U=new URL(window.location.href),D=f.startsWith("//")?new URL(U.protocol+f):new URL(f),G=ga(D.pathname,w);D.origin===U.origin&&G!=null?f=G+D.search+D.hash:E=!0}catch{Sr(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let k=iz(f,{relative:r}),[N,_,R]=Uz(i,x),T=Yz(f,{replace:l,state:u,target:d,preventScrollReset:p,relative:r,viewTransition:m});function L(U){e&&e(U),U.defaultPrevented||T(U)}let M=v.createElement("a",{...x,...R,href:A||k,onClick:E||s?e:L,ref:Vz(b,_),target:d,"data-discover":!C&&n==="render"?"true":void 0});return N&&!C?v.createElement(v.Fragment,null,M,v.createElement(Bz,{page:k})):M});Fi.displayName="Link";var bi=v.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:u,children:d,...f},p){let m=Qd(l,{relative:f.relative}),x=Jr(),b=v.useContext(vm),{navigator:w,basename:C}=v.useContext(Zr),A=b!=null&&e5(m)&&u===!0,E=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,k=x.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(k=k.toLowerCase(),N=N?N.toLowerCase():null,E=E.toLowerCase()),N&&C&&(N=ga(N,C)||N);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let R=k===E||!r&&k.startsWith(E)&&k.charAt(_)==="/",T=N!=null&&(N===E||!r&&N.startsWith(E)&&N.charAt(E.length)==="/"),L={isActive:R,isPending:T,isTransitioning:A},M=R?e:void 0,U;typeof i=="function"?U=i(L):U=[i,R?"active":null,T?"pending":null,A?"transitioning":null].filter(
107Boolean).join(" ");let D=typeof s=="function"?s(L):s;return v.createElement(Fi,{...f,"aria-current":M,className:U,ref:p,style:D,to:l,viewTransition:u},typeof d=="function"?d(L):d)});bi.displayName="NavLink";var Kz=v.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:l=gp,action:u,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:m,...x},b)=>{let w=Zz(),C=Jz(u,{relative:f}),A=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&ij.test(u),k=N=>{if(d&&d(N),N.defaultPrevented)return;N.preventDefault();let _=N.nativeEvent.submitter,R=_?.getAttribute("formmethod")||l;w(_||N.currentTarget,{fetcherKey:e,method:R,navigate:n,replace:r,state:s,relative:f,preventScrollReset:p,viewTransition:m})};return v.createElement("form",{ref:b,method:A,action:C,onSubmit:i?d:k,...x,"data-discover":!E&&t==="render"?"true":void 0})});Kz.displayName="Form";function Wz(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function rj(t){let e=v.useContext(Kc);return on(e,Wz(t)),e}function Yz(t,{target:e,replace:n,state:i,preventScrollReset:r,relative:s,viewTransition:l}={}){let u=Kn(),d=Jr(),f=Qd(t,{relative:s});return v.useCallback(p=>{if(Nz(p,e)){p.preventDefault();let m=n!==void 0?n:Ld(d)===Ld(f);u(t,{replace:m,state:i,preventScrollReset:r,relative:s,viewTransition:l})}},[d,u,f,n,i,e,t,r,s,l])}function ym(t){Sr(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=v.useRef(zb(t)),n=v.useRef(!1),i=Jr(),r=v.useMemo(()=>jz(i.search,n.current?null:e.current),[i.search]),s=Kn(),l=v.useCallback((u,d)=>{const f=zb(typeof u=="function"?u(new URLSearchParams(r)):u);n.current=!0,s("?"+f,d)},[s,r]);return[r,l]}var Xz=0,Qz=()=>`__${String(++Xz)}__`;function Zz(){let{router:t}=rj("useSubmit"),{basename:e}=v.useContext(Zr),n=gz();return v.useCallback(async(i,r={})=>{let{action:s,method:l,encType:u,formData:d,body:f}=Rz(i,e);if(r.navigate===!1){let p=r.fetcherKey||Qz();await t.fetch(p,n,r.action||s,{preventScrollReset:r.preventScrollReset,formData:d,body:f,formMethod:r.method||l,formEncType:r.encType||u,flushSync:r.flushSync})}else await t.navigate(r.action||s,{preventScrollReset:r.preventScrollReset,formData:d,body:f,formMethod:r.method||l,formEncType:r.encType||u,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[t,e,n])}function Jz(t,{relative:e}={}){let{basename:n}=v.useContext(Zr),i=v.useContext(Cr);on(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Qd(t||".",{relative:e})},l=Jr();if(t==null){s.search=l.search;let u=new URLSearchParams(s.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();s.search=p?`?${p}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ha([n,s.pathname])),Ld(s)}function e5(t,{relative:e}={}){let n=v.useContext(YN);on(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=rj("useViewTransitionState"),r=Qd(t,{relative:e});if(!n.isTransitioning)return!1;let s=ga(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=ga(n.nextLocation.pathname,i)||n.nextLocation.pathname;return Dp(r.pathname,l)!=null||Dp(r.pathname,s)!=null}let t5={data:""},n5=t=>{if(typeof window=="object"){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||t5},i5=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,r5=/\/\*[^]*?\*\/|  +/g,uA=/\n+/g,eo=(t,e)=>{let n="",i="",r="";for(let s in t){let l=t[s];s[0]=="@"?s[1]=="i"?n=s+" "+l+";":i+=s[1]=="f"?eo(l,s):s+"{"+eo(l,s[1]=="k"?"":e)+"}":typeof l=="object"?i+=eo(l,e?e.replace(/([^,])+/g,u=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,u):u?u+" "+d:d)):s):l!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=eo.p?eo.p(s,l):s+":"+l+";")}return n+(e&&r?e+"{"+r+"}":r)+i},ta={},sj=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+sj(t[n]);return e}return t},s5=(t,e,n,i,r)=>{let s=sj(t),l=ta[s]||(ta[s]=(d=>{let f=0,p=11;for(;f<d.length;
107)p=101*p+d.charCodeAt(f++)>>>0;return"go"+p})(s));if(!ta[l]){let d=s!==t?t:(f=>{let p,m,x=[{}];for(;p=i5.exec(f.replace(r5,""));)p[4]?x.shift():p[3]?(m=p[3].replace(uA," ").trim(),x.unshift(x[0][m]=x[0][m]||{})):x[0][p[1]]=p[2].replace(uA," ").trim();return x[0]})(t);ta[l]=eo(r?{["@keyframes "+l]:d}:d,n?"":"."+l)}let u=n&&ta.g?ta.g:null;return n&&(ta.g=ta[l]),((d,f,p,m)=>{m?f.data=f.data.replace(m,d):f.data.indexOf(d)===-1&&(f.data=p?d+f.data:f.data+d)})(ta[l],e,i,u),l},a5=(t,e,n)=>t.reduce((i,r,s)=>{let l=e[s];if(l&&l.call){let u=l(n),d=u&&u.props&&u.props.className||/^go/.test(u)&&u;l=d?"."+d:u&&typeof u=="object"?u.props?"":eo(u,""):u===!1?"":u}return i+r+(l??"")},"");function wm(t){let e=this||{},n=t.call?t(e.p):t;return s5(n.unshift?n.raw?a5(n,[].slice.call(arguments,1),e.p):n.reduce((i,r)=>Object.assign(i,r&&r.call?r(e.p):r),{}):n,n5(e.target),e.g,e.o,e.k)}let aj,Fb,$b;wm.bind({g:1});let xa=wm.bind({k:1});function o5(t,e,n,i){eo.p=e,aj=t,Fb=n,$b=i}function fo(t,e){let n=this||{};return function(){let i=arguments;function r(s,l){let u=Object.assign({},s),d=u.className||r.className;n.p=Object.assign({theme:Fb&&Fb()},u),n.o=/ *go\d+/.test(d),u.className=wm.apply(n,i)+(d?" "+d:"");let f=t;return t[0]&&(f=u.as||t,delete u.as),$b&&f[0]&&$b(u),aj(f,u)}return r}}var l5=t=>typeof t=="function",Lp=(t,e)=>l5(t)?t(e):t,c5=(()=>{let t=0;return()=>(++t).toString()})(),oj=(()=>{let t;return()=>{if(t===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");t=!e||e.matches}return t}})(),u5=20,hw="default",lj=(t,e)=>{let{toastLimit:n}=t.settings;switch(e.type){case 0:return{...t,toasts:[e.toast,...t.toasts].slice(0,n)};case 1:return{...t,toasts:t.toasts.map(l=>l.id===e.toast.id?{...l,...e.toast}:l)};case 2:let{toast:i}=e;return lj(t,{type:t.toasts.find(l=>l.id===i.id)?1:0,toast:i});case 3:let{toastId:r}=e;return{...t,toasts:t.toasts.map(l=>l.id===r||r===void 0?{...l,dismissed:!0,visible:!1}:l)};case 4:return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(l=>l.id!==e.toastId)};case 5:return{...t,pausedAt:e.time};case 6:let s=e.time-(t.pausedAt||0);return{...t,pausedAt:void 0,toasts:t.toasts.map(l=>({...l,pauseDuration:l.pauseDuration+s}))}}},vp=[],cj={toasts:[],pausedAt:void 0,settings:{toastLimit:u5}},ms={},uj=(t,e=hw)=>{ms[e]=lj(ms[e]||cj,t),vp.forEach(([n,i])=>{n===e&&i(ms[e])})},dj=t=>Object.keys(ms).forEach(e=>uj(t,e)),d5=t=>Object.keys(ms).find(e=>ms[e].toasts.some(n=>n.id===t)),Sm=(t=hw)=>e=>{uj(e,t)},h5={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},f5=(t={},e=hw)=>{let[n,i]=v.useState(ms[e]||cj),r=v.useRef(ms[e]);v.useEffect(()=>(r.current!==ms[e]&&i(ms[e]),vp.push([e,i]),()=>{let l=vp.findIndex(([u])=>u===e);l>-1&&vp.splice(l,1)}),[e]);let s=n.toasts.map(l=>{var u,d,f;return{...t,...t[l.type],...l,removeDelay:l.removeDelay||((u=t[l.type])==null?void 0:u.removeDelay)||t?.removeDelay,duration:l.duration||((d=t[l.type])==null?void 0:d.duration)||t?.duration||h5[l.type],style:{...t.style,...(f=t[l.type])==null?void 0:f.style,...l.style}}});return{...n,toasts:s}},p5=(t,e="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0,...n,id:n?.id||c5()}),Zd=t=>(e,n)=>{let i=p5(e,t,n);return Sm(i.toasterId||d5(i.id))({type:2,toast:i}),i.id},ee=(t,e)=>Zd("blank")(t,e);ee.error=Zd("error");ee.success=Zd("success");ee.loading=Zd("loading");ee.custom=Zd("custom");ee.dismiss=(t,e)=>{let n={type:3,toastId:t};e?Sm(e)(n):dj(n)};ee.dismissAll=t=>ee.dismiss(void 0,t);ee.remove=(t,e)=>{let n={type:4,toastId:t};e?Sm(e)(n):dj(n)};ee.removeAll=t=>ee.remove(void 0,t);ee.promise=(t,e,n)=>{let i=ee.loading(e.loading,{...n,...n?.loading});return typeof t=="function"&&(t=t()),t.then(r=>{let s=e.success?Lp(e.success,r):void 0;return s?ee.success(s,{id:i,...n,...n?.success}):ee.dismiss(i),r}).catch(r=>{let s=e.error?Lp(e.error,r):void 0;s?ee.error(s,{id:i,...n,...n?.error}):ee.dismiss(i)}),t};var m5=1e3,g5=(t,e="default")=>{let{toasts:n,pausedAt:i}=f5(t,e),r=v.useRef(new Map).current,s=v.useCallback((m,x=m5)=>{if(r.has(m))return;let b=setTimeout(()=>{r.delete(m),l({type:4,toastId:m})},x);r.set(m,b)},[]);v.useEffect(()=>{if(i)return;let m=Date.now(),x=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(m-b.createdAt);if(w<0){b.visible&&ee.dismiss(b.id);return}return setTimeout(()=>ee.dismiss(b.id,e),w)});return()=>{x.forEach(b=>b&&clearTimeout(b))}},[n,i,e]);let l=v.useCallback(Sm(e),[e]),u=v.useCallback(()=>
107{l({type:5,time:Date.now()})},[l]),d=v.useCallback((m,x)=>{l({type:1,toast:{id:m,height:x}})},[l]),f=v.useCallback(()=>{i&&l({type:6,time:Date.now()})},[i,l]),p=v.useCallback((m,x)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:C}=x||{},A=n.filter(N=>(N.position||C)===(m.position||C)&&N.height),E=A.findIndex(N=>N.id===m.id),k=A.filter((N,_)=>_<E&&N.visible).length;return A.filter(N=>N.visible).slice(...b?[k+1]:[0,k]).reduce((N,_)=>N+(_.height||0)+w,0)},[n]);return v.useEffect(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let x=r.get(m.id);x&&(clearTimeout(x),r.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:d,startPause:u,endPause:f,calculateOffset:p}}},x5=xa`
108from {
109  transform: scale(0) rotate(45deg);
110	opacity: 0;
111}
112to {
113 transform: scale(1) rotate(45deg);
114  opacity: 1;
115}`,v5=xa`
116from {
117  transform: scale(0);
118  opacity: 0;
119}
120to {
121  transform: scale(1);
122  opacity: 1;
123}`,b5=xa`
124from {
125  transform: scale(0) rotate(90deg);
126	opacity: 0;
127}
128to {
129  transform: scale(1) rotate(90deg);
130	opacity: 1;
131}`,y5=fo("div")`
132  width: 20px;
133  opacity: 0;
134  height: 20px;
135  border-radius: 10px;
136  background: ${t=>t.primary||"#ff4b4b"};
137  position: relative;
138  transform: rotate(45deg);
139
140  animation: ${x5} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
141    forwards;
142  animation-delay: 100ms;
143
144  &:after,
145  &:before {
146    content: '';
147    animation: ${v5} 0.15s ease-out forwards;
148    animation-delay: 150ms;
149    position: absolute;
150    border-radius: 3px;
151    opacity: 0;
152    background: ${t=>t.secondary||"#fff"};
153    bottom: 9px;
154    left: 4px;
155    height: 2px;
156    width: 12px;
157  }
158
159  &:before {
160    animation: ${b5} 0.15s ease-out forwards;
161    animation-delay: 180ms;
162    transform: rotate(90deg);
163  }
164`,w5=xa`
165  from {
166    transform: rotate(0deg);
167  }
168  to {
169    transform: rotate(360deg);
170  }
171`,S5=fo("div")`
172  width: 12px;
173  height: 12px;
174  box-sizing: border-box;
175  border: 2px solid;
176  border-radius: 100%;
177  border-color: ${t=>t.secondary||"#e0e0e0"};
178  border-right-color: ${t=>t.primary||"#616161"};
179  animation: ${w5} 1s linear infinite;
180`,C5=xa`
181from {
182  transform: scale(0) rotate(45deg);
183	opacity: 0;
184}
185to {
186  transform: scale(1) rotate(45deg);
187	opacity: 1;
188}`,E5=xa`
1890% {
190	height: 0;
191	width: 0;
192	opacity: 0;
193}
19440% {
195  height: 0;
196	width: 6px;
197	opacity: 1;
198}
199100% {
200  opacity: 1;
201  height: 10px;
202}`,A5=fo("div")`
203  width: 20px;
204  opacity: 0;
205  height: 20px;
206  border-radius: 10px;
207  background: ${t=>t.primary||"#61d345"};
208  position: relative;
209  transform: rotate(45deg);
210
211  animation: ${C5} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
212    forwards;
213  animation-delay: 100ms;
214  &:after {
215    content: '';
216    box-sizing: border-box;
217    animation: ${E5} 0.2s ease-out forwards;
218    opacity: 0;
219    animation-delay: 200ms;
220    position: absolute;
221    border-right: 2px solid;
222    border-bottom: 2px solid;
223    border-color: ${t=>t.secondary||"#fff"};
224    bottom: 6px;
225    left: 6px;
226    height: 10px;
227    width: 6px;
228  }
229`,k5=fo("div")`
230  position: absolute;
231`,N5=fo("div")`
232  position: relative;
233  display: flex;
234  justify-content: center;
235  align-items: center;
236  min-width: 20px;
237  min-height: 20px;
238`,j5=xa`
239from {
240  transform: scale(0.6);
241  opacity: 0.4;
242}
243to {
244  transform: scale(1);
245  opacity: 1;
246}`,_5=fo("div")`
247  position: relative;
248  transform: scale(0.6);
249  opacity: 0.4;
250  min-width: 20px;
251  animation: ${j5} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
252    forwards;
253`,T5=({toast:t})=>{let{icon:e,type:n,iconTheme:i}=t;return e!==void 0?typeof e=="string"?v.createElement(_5,null,e):e:n==="blank"?null:v.createElement(N5,null,v.createElement(S5,{...i}),n!=="loading"&&v.createElement(k5,null,n==="error"?v.createElement(y5,{...i}):v.createElement(A5,{...i})))},R5=t=>`
2540% {transform: translate3d(0,${t*-200}%,0) scale(.6); opacity:.5;}
255100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
256`,P5=t=>`
2570% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
258100% {transform: translate3d(0,${t*-150}%,-1px) scale(.6); opacity:0;}
259`,D5="0%{opacity:0;} 100%{opacity:1;}",L5="0%{opacity:1;} 100%{opacity:0;}",O5=fo("div")`
260  display: flex;
261  align-items: center;
262  background: #fff;
263  color: #363636;
264  line-height: 1.3;
265  will-change: transform;
266  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
267  max-width: 350px;
268  pointer-events: auto;
269  padding: 8px 10px;
270  border-radius: 8px;
271`,M5=fo("div")`
272  display: flex;
273  justify-content: center;
274  margin: 4px 10px;
275  color: inherit;
276  flex: 1 1 auto;
277  white-space: pre-line;
278`,I5=(t,e)=>{let n=t.includes("top")?1:-1,[i,r]=oj()?[D5,L5]:[R5(n),P5(n)];return{animation:e?`${xa(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${xa(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},z5=v.memo(({toast:t,position:e,style:n,children:i})=>{let r=t.height?I5(t.position||e||"top-center",t.visible):{opacity:0}
278,s=v.createElement(T5,{toast:t}),l=v.createElement(M5,{...t.ariaProps},Lp(t.message,t));return v.createElement(O5,{className:t.className,style:{...r,...n,...t.style}},typeof i=="function"?i({icon:s,message:l}):v.createElement(v.Fragment,null,s,l))});o5(v.createElement);var F5=({id:t,className:e,style:n,onHeightUpdate:i,children:r})=>{let s=v.useCallback(l=>{if(l){let u=()=>{let d=l.getBoundingClientRect().height;i(t,d)};u(),new MutationObserver(u).observe(l,{subtree:!0,childList:!0,characterData:!0})}},[t,i]);return v.createElement("div",{ref:s,className:e,style:n},r)},$5=(t,e)=>{let n=t.includes("top"),i=n?{top:0}:{bottom:0},r=t.includes("center")?{justifyContent:"center"}:t.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:oj()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(n?1:-1)}px)`,...i,...r}},U5=wm`
279  z-index: 9999;
280  > * {
281    pointer-events: auto;
282  }
283`,Ff=16,B5=({reverseOrder:t,position:e="top-center",toastOptions:n,gutter:i,children:r,toasterId:s,containerStyle:l,containerClassName:u})=>{let{toasts:d,handlers:f}=g5(n,s);return v.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Ff,left:Ff,right:Ff,bottom:Ff,pointerEvents:"none",...l},className:u,onMouseEnter:f.startPause,onMouseLeave:f.endPause},d.map(p=>{let m=p.position||e,x=f.calculateOffset(p,{reverseOrder:t,gutter:i,defaultPosition:e}),b=$5(m,x);return v.createElement(F5,{id:p.id,key:p.id,onHeightUpdate:f.updateHeight,className:p.visible?U5:"",style:b},p.type==="custom"?Lp(p.message,p):r?r(p):v.createElement(z5,{toast:p,position:m}))}))},dA=ee;const it=t=>typeof t=="string",od=()=>{let t,e;const n=new Promise((i,r)=>{t=i,e=r});return n.resolve=t,n.reject=e,n},Pv=t=>t==null?"":String(t),H5=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},G5=/###/g,hA=t=>t&&t.includes("###")?t.replace(G5,"."):t,fA=t=>!t||it(t),Ed=(t,e,n)=>{const i=it(e)?e.split("."):e;let r=0;for(;r<i.length-1;){if(fA(t))return{};const s=hA(i[r]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++r}return fA(t)?{}:{obj:t,k:hA(i[r])}},pA=(t,e,n)=>{const{obj:i,k:r}=Ed(t,e,Object);if(i!==void 0||e.length===1){i[r]=n;return}let s=e[e.length-1],l=e.slice(0,e.length-1),u=Ed(t,l,Object);for(;u.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),u=Ed(t,l,Object),u?.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},V5=(t,e,n,i)=>{const{obj:r,k:s}=Ed(t,e,Object);r[s]=r[s]||[],r[s].push(n)},Op=(t,e)=>{const{obj:n,k:i}=Ed(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},q5=(t,e,n)=>{const i=Op(t,n);return i!==void 0?i:Op(e,n)},hj=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,i)?it(t[i])||t[i]instanceof String||it(e[i])||e[i]instanceof String?n&&(t[i]=e[i]):hj(t[i],e[i],n):t[i]=e[i]);return t},na=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),K5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},W5=t=>it(t)?t.replace(/[&<>"'\/]/g,e=>K5[e]):t;class Y5{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;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 X5=[" ",",","?","!",";"],Q5=new Y5(20),Z5=(t,e,n)=>{e=e||"",n=n||"";const i=X5.filter(l=>!e.includes(l)&&!n.includes(l));if(i.length===0)return!0;const r=Q5.getRegExp(`(${i.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!r.test(t);if(!s){const l=t.indexOf(n);l>0&&!r.test(t.substring(0,l))&&(s=!0)}return s},Ub=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const i=e.split(n);let r=t;for(let s=0;s<i.length;){if(!r||typeof r!="object")return;let l,u="";for(let d=s;d<i.length;++d)if(d!==s&&(u+=n),u+=i[d],l=r[u],l!==void 0){if(["string","number","boolean"].includes(typeof l)&&d<i.length-1)continue;s+=d-s+1;break}r=l}return r},Od=t=>t?.replace(/_/g,"-"),J5={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Mp{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||J5,this.options=n,this.debug=n.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,n,i,r){return r&&!this.debug?null:(e=e.map(s=>it(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),it(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Mp(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Mp(this.logger,e)}}var gs=new Mp;class Cm{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(i=>
vendor: 3,497 bytes, line 283
283{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}once(e,n){const i=(...r)=>{n(...r),this.off(e,i)};return this.on(e,i),this}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([r,s])=>{for(let l=0;l<s;l++)r(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,s])=>{for(let l=0;l<s;l++)r(e,...n)})}}class mA extends Cm{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i,r={}){const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,l=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.includes(".")?u=e.split("."):(u=[e,n],i&&(Array.isArray(i)?u.push(...i):it(i)&&s?u.push(...i.split(s)):u.push(i)));const d=Op(this.data,u);return!d&&!n&&!i&&e.includes(".")&&(e=u[0],n=u[1],i=u.slice(2).join(".")),d||!l||!it(i)?d:Ub(this.data?.[e]?.[n],i,s)}addResource(e,n,i,r,s={silent:!1}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[e,n];i&&(u=u.concat(l?i.split(l):i)),e.includes(".")&&(u=e.split("."),r=n,n=u[1]),this.addNamespaces(n),pA(this.data,u,r),s.silent||this.emit("added",e,n,i,r)}addResources(e,n,i,r={silent:!1}){for(const s in i)(it(i[s])||Array.isArray(i[s]))&&this.addResource(e,n,s,i[s],{silent:!0});r.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,r,s,l={silent:!1,skipCopy:!1}){let u=[e,n];e.includes(".")&&(u=e.split("."),r=i,i=n,n=u[1]),this.addNamespaces(n);let d=Op(this.data,u)||{};l.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?hj(d,i,s):d={...d,...i},pA(this.data,u,d),l.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var fj={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,r){return t.forEach(s=>{e=this.processors[s]?.process(e,n,i,r)??e}),e}};const pj=Symbol("i18next/PATH_KEY");function eF(){const t=[],e=Object.create(null);let n;return e.get=(i,r)=>(n?.revoke?.(),r===pj?t:(t.push(r),n=Proxy.revocable(i,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Zo(t,e){const{[pj]:n}=t(eF()),i=e?.keySeparator??".",r=e?.nsSeparator??":",s=e?.enableSelector==="strict";if(n.length>1&&r){const l=e?.ns,u=s?Array.isArray(l)?l:l?[l]:null:Array.isArray(l)?l:null;if(u&&(s?u:u.length>1?u.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const Dv=t=>!it(t)&&typeof t!="boolean"&&typeof t!="number";class Ip extends Cm{constructor(e,n={}){super(),H5(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
283i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=gs.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const i={...n};if(e==null)return!1;const r=this.resolve(e,i);if(r?.res===void 0)return!1;const s=Dv(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=i&&e.includes(i),u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Z5(e,i,r);if(l&&!u){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:it(s)?[s]:s};const f=e.split(i);(i!==r||i===r&&this.options.ns.includes(f[0]))&&(s=f.shift()),e=f.join(r)}return{key:e,namespaces:it(s)?[s]:s}}translate(e,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";typeof e=="function"&&(e=Zo(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(Q=>typeof Q=="function"?Zo(Q,{...this.options,...r}):String(Q));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,l=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:u,namespaces:d}=this.extractFromKey(e[e.length-1],r),f=d[d.length-1];let p=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const m=r.lng||this.language,x=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m?.toLowerCase()==="cimode")return x?s?{res:`${f}${p}${u}`,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(r)}:`${f}${p}${u}`:s?{res:u,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(r)}:u;const b=this.resolve(e,r);let w=b?.res;const C=b?.usedKey||u,A=b?.exactUsedKey||u,E=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,_=r.count!==void 0&&!it(r.count),R=Ip.hasDefaultValue(r),T=_?this.pluralResolver.getSuffix(m,r.count,r):"",L=r.ordinal&&_?this.pluralResolver.getSuffix(m,r.count,{ordinal:!1}):"",M=_&&!r.ordinal&&r.count===0,U=M&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${T}`]||r[`defaultValue${L}`]||r.defaultValue;let D=w;N&&!w&&R&&(D=U);const G=Dv(D),Z=Object.prototype.toString.apply(D);if(N&&D&&G&&!E.includes(Z)&&!(it(k)&&Array.isArray(D))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,D,{...r,ns:d}):`key '${u} (${this.language})' returned an object instead of string.`;return s?(b.res=Q,b.usedParams=this.getUsedParamsDetails(r),b):Q}if(l){const Q=Array.isArray(D),K=Q?[]:{},q=Q?A:C;for(const F in D)if(Object.prototype.hasOwnProperty.call(D,F)){const V=`${q}${l}${F}`;R&&!w?K[F]=this.translate(V,{...r,defaultValue:Dv(U)?U[F]:void 0,joinArrays:!1,ns:d}):K[F]=this.translate(V,{...r,joinArrays:!1,ns:d}),K[F]===V&&(K[F]=D[F])}w=K}}else if(N&&it(k)&&Array.isArray(w))w=w.join(k),w&&(w=this.extendTranslation(w,e,r,i));else{let Q=!1,K=!1;!this.isValidLookup(w)&&R&&(Q=!0,w=U),this.isValidLookup(w)||(K=!0,w=u);const F=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:w,V=R&&U!==w&&this.options.updateMissing;if(K||Q||V){if(this.logger.log(V?"updateKey":"missingKey",m,f,_&&!V?`${u}${this.pluralResolver.getSuffix(m,r.count,r)}`:u,V?U:w),l){const B=this.resolve(u,{...r,keySeparator:!1});B&&B.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 O=[];const X=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);
vendor: 8,980 bytes, line 283
283if(this.options.saveMissingTo==="fallback"&&X&&X[0])for(let B=0;B<X.length;B++)O.push(X[B]);else this.options.saveMissingTo==="all"?O=this.languageUtils.toResolveHierarchy(r.lng||this.language):O.push(r.lng||this.language);const $=(B,H,P)=>{const J=R&&P!==w?P:F;this.options.missingKeyHandler?this.options.missingKeyHandler(B,f,H,J,V,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(B,f,H,J,V,r),this.emit("missingKey",B,f,H,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?O.forEach(B=>{const H=this.pluralResolver.getSuffixes(B,r);M&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!H.includes(`${this.options.pluralSeparator}zero`)&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(P=>{$([B],u+P,r[`defaultValue${P}`]||U)})}):$(O,u,U))}w=this.extendTranslation(w,e,r,b,i),K&&w===u&&this.options.appendNamespaceToMissingKey&&(w=`${f}${p}${u}`),(K||Q)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${p}${u}`:u,Q?w:void 0,r))}return s?(b.res=w,b.usedParams=this.getUsedParamsDetails(r),b):w}extendTranslation(e,n,i,r,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=it(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=e.match(this.interpolator.nestingRegexp);f=m&&m.length}let p=i.replace&&!it(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,i.lng||this.language||r.usedLng,i),d){const m=e.match(this.interpolator.nestingRegexp),x=m&&m.length;f<x&&(i.nest=!1)}!i.lng&&r&&r.res&&(i.lng=this.language||r.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>s?.[0]===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const l=i.postProcess||this.options.postProcess,u=it(l)?[l]:l;return e!=null&&u?.length&&i.applyPostProcessor!==!1&&(e=fj.handle(u,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,n={}){let i,r,s,l,u;return it(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(d=>typeof d=="function"?Zo(d,{...this.options,...n}):d)),e.forEach(d=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(d,n),p=f.key;r=p;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const x=n.count!==void 0&&!it(n.count),b=x&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(it(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(A=>{this.isValidLookup(i)||(u=A,!this.checkedLoadedFor[`${C[0]}-${A}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(this.checkedLoadedFor[`${C[0]}-${A}`]=!0,this.logger.warn(`key "${r}" for languages "${C.join(", ")}" won't get resolved as namespace "${u}" 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!!!")),C.forEach(E=>{if(this.isValidLookup(i))return;l=E;const k=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,p,E,A,n);else{let _;x&&(_=this.pluralResolver.getSuffix(E,n.count,n));const R=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(n.ordinal&&_.startsWith(T)&&k.push(p+_.replace(T,this.options.pluralSeparator)),k.push(p+_),b&&k.push(p+R)),w){const L=`${p}${this.options.contextSeparator||"_"}${n.context}`;k.push(L),x&&(n.ordinal&&_.startsWith(T)&&k.push(L+_.replace(T,this.options.pluralSeparator)),k.push(L+_),b&&k.push(L+R))}}let N;for(;N=k.pop();)this.isValidLookup(i)||(s=N,i=this.getResource(E,A,N,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:l,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,i,r):this.resourceStore.getResource(e,n,i,r)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!it(e.replace);let r=i?e.replace:e;if(i&&typeof e.count<"u"&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&i.startsWith(n)&&e[i]!==void 0)return!0;return!1}}class gA{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gs.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=Od(e),!e||!e.includes("-"))return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Od(e),!e||!e.includes("-"))return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(it(e)&&e.includes("-")){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(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.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(l=>l===s?!0:!l.includes("-")&&!s.includes("-")?!1:!!(l.includes("-")&&!s.includes("-")&&l.slice(0,l.indexOf("-"))===s||l.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),it(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||it(n),l=n===void 0&&typeof this.options.fallbackLng=="function",u=it(e)&&s&&!l;let d=null;if(u){let x;n===void 0?x="undefined":n===!1?x="boolean:false":x=`string:${n}`,d=`${e.length}:${e}|${x}`}if(d!==null){const x=this.resolveHierarchyCache[d];if(x!==void 0)return x.slice()}const f=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),p=[],m=x=>{x&&(this.isSupportedCode(x)?p.push(x):this.logger.warn(`rejecting language code not found in supportedLngs: ${x}`))};return it(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&m(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&m(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&m(this.getLanguagePartFromCode(e))):it(e)&&m(this.formatLanguageCode(e)),f.forEach(x=>{p.includes(x)||m(this.formatLanguageCode(x))}),d!==null?(this.resolveHierarchyCache[d]=p,p.slice()):p}}const xA={zero:0,one:1,two:2,few:3,many:4,other:5},vA={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class tF{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=gs.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const i=Od(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let l;try{l=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl pol
283yfill!"),vA;if(!e.match(/-|_/))return vA;const d=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(d,n)}return this.pluralRulesCache[s]=l,l}needsPlural(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,i={}){return this.getSuffixes(e,i).map(r=>`${n}${r}`)}getSuffixes(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>xA[r]-xA[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(e,n,i={}){const r=this.getRule(e,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,i))}}const bA=(t,e,n,i=".",r=!0)=>{let s=q5(t,e,n);return!s&&r&&it(n)&&(s=Ub(t,n,i),s===void 0&&(s=Ub(e,n,i))),s},yA=t=>t.replace(/\$/g,"$$$$");class wA{constructor(e={}){this.logger=gs.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:l,suffix:u,suffixEscaped:d,formatSeparator:f,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:x,nestingPrefixEscaped:b,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:A,maxReplaces:E,alwaysFormat:k}=e.interpolation;this.escape=n!==void 0?n:W5,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?na(s):l||"{{",this.suffix=u?na(u):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":m?na(m):"-",this.unescapeSuffix=this.unescapePrefix?"":p?na(p):"",this.nestingPrefix=x?na(x):b||na("$t("),this.nestingSuffix=w?na(w):C||na(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=E||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n?.source===i?(n.lastIndex=0,n):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,n,i,r){let s,l,u;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=b=>{if(!b.includes(this.formatSeparator)){const E=bA(n,d,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,i,{...r,...n,interpolationkey:b}):E}const w=b.split(this.formatSeparator),C=w.shift().trim(),A=w.join(this.formatSeparator).trim();return this.format(bA(n,d,C,this.options.keySeparator,this.options.ignoreJSONStructure),A,i,{...r,...n,interpolationkey:C})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const p=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,m=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>b},{regex:this.regexp,safeValue:b=>this.escapeValue?this.escape(b):b}].forEach(b=>{for(u=0;s=b.regex.exec(e);){const w=s[1].trim();if(l=f(w),l===void 0)if(typeof p=="function"){const A=p(e,s,r);l=it(A)?A:""}else if(r&&Object.prototype.hasOwnProperty.call(r,w))l="";else if(m){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`),l="";else!it(l)&&!this.useRawValueToEscape&&(l=Pv(l));const C=b.safeValue(l);if(e=e.replace(s[0],yA(C)),m?(b.regex.lastIndex+=C.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n,i={}){let r,s,l;const u=(d,f)=>{const p=this.nestingOptionsSeparator;if(!d.includes(p))return d;const m=d.split(new RegExp(`${na(p)}[ ]*{`));let x=`{${m[1]}`;d=m[0],x=this.interpolate(x,l);const b=x.match(/'/g),w=x.match(/"/g);((b?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(x=x.replace(/'/g,'"'));try{l=JSON.parse(x),f&&(l={...f,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,C),`${d}${p}${x}`}return l.defaultValue&&l.defaultValue.includes(this.prefix)&&delete l.defaultValue,d};for(;r=this.nestingRegexp.exec(e);){let d=[];l={...i},l=l.replace&&!it(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const f=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(f!==-1&&(d=r[1].slice(f).split(this.formatSeparator).map(p=>
vendor: 14,047 bytes, line 283
283p.trim()).filter(Boolean),r[1]=r[1].slice(0,f)),s=n(u.call(this,r[1].trim(),l),l),s&&r[0]===e&&!it(s))return s;it(s)||(s=Pv(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),s=""),d.length&&(s=d.reduce((p,m)=>this.format(p,m,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),e=e.replace(r[0],yA(Pv(s))),this.regexp.lastIndex=0}return e}}const nF=t=>{let e=t.toLowerCase().trim();const n={};if(t.includes("(")){const i=t.split("(");e=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);e==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):e==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(l=>{if(l){const[u,...d]=l.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),p=u.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},SA=t=>{const e={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const l=i+JSON.stringify(s);let u=e[l];return u||(u=t(Od(i),r),e[l]=u),u(n)}},iF=t=>(e,n,i)=>t(Od(n),i)(e);class rF{constructor(e={}){this.logger=gs.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?SA:iF;this.formats={number:i((r,s)=>{const l=new Intl.NumberFormat(r,{...s});return u=>l.format(u)}),currency:i((r,s)=>{const l=new Intl.NumberFormat(r,{...s,style:"currency"});return u=>l.format(u)}),datetime:i((r,s)=>{const l=new Intl.DateTimeFormat(r,{...s});return u=>l.format(u)}),relativetime:i((r,s)=>{const l=new Intl.RelativeTimeFormat(r,{...s});return u=>l.format(u,s.range||"day")}),list:i((r,s)=>{const l=new Intl.ListFormat(r,{...s});return u=>l.format(u)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=SA(n)}format(e,n,i,r={}){if(!n||e==null)return e;const s=n.split(this.formatSeparator),l=[];for(let d=0;d<s.length;d++){let f=s[d];for(;f.indexOf("(")>-1&&!f.includes(")")&&d+1<s.length;)f=`${f}${this.formatSeparator}${s[++d]}`;l.push(f)}return l.reduce((d,f)=>{const{formatName:p,formatOptions:m}=nF(f);if(this.formats[p]){let x=d;try{const b=r?.formatParams?.[r.interpolationkey]||{},w=b.locale||b.lng||r.locale||r.lng||i;x=this.formats[p](d,w,{...m,...r,...b})}catch(b){this.logger.warn(b)}return x}else this.logger.warn(`there was no format function for ${p}`);return d},e)}}const sF=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class aF extends Cm{constructor(e,n,i,r={}){super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=gs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,r.backend,r)}queueLoad(e,n,i,r){const s={},l={},u={},d={};return e.forEach(f=>{let p=!0;n.forEach(m=>{const x=`${f}|${m}`;!i.reload&&this.store.hasResourceBundle(f,m)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?l[x]===void 0&&(l[x]=!0):(this.state[x]=1,p=!1,l[x]===void 0&&(l[x]=!0),s[x]===void 0&&(s[x]=!0),d[m]===void 0&&(d[m]=!0)))}),p||(u[f]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(d)}}loaded(e,n,i){const r=e.split("|"),s=r[0],l=r[1];n&&this.emit("failedLoading",s,l,n),!n&&i&&this.store.addResourceBundle(s,l,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const u={};this.queue.forEach(d=>{V5(d.loaded,[s],l),sF(d,e),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{u[f]||(u[f]={});const p=d.loaded[f];p.length&&p.forEach(m=>{u[f][m]===void 0&&(u[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(d=>!d.done)}read(e,n,i,r=0,s=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:r,wait:s,callback:l});return}this.readingCalls++;const u=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&p&&r<this.maxRetries){setTimeout(()=>{this.read(e,n,i,r+1,s*2,l)},s);return}l(f,p)},d=this.backend[i].bind(this.backend);if(d.length===2){try{const f=d(e,n);f&&typeof f.then=="function"?f.then(p=>u(null,p)).catch(u):u(null,f)}catch(f){u(f)}return}return d(e,n,u)}prepareLoading(e,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();it(e)&&(e=this.languageUtils.toResolveHierarchy(e)),it(n)&&(n=[n]);const s=this.queueLoad(e,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e,n=""){const i=e.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,u),this.loaded(e,l,u)})}saveMissing(e,n,i,r,s,l={},u=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" 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(this.backend?.create){const d={...l,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(e,n,i,r,d):p=f(e,n,i,r),p&&typeof p.then=="function"?p.then(m=>u(null,m)).catch(u):u(null,p)}catch(p){u(p)}else f(e,n,i,r,u,d)}!e||!e[0]||this.store.addResource(e[0],n,i,r)}}}const Lv=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),it(t[1])&&(e.defaultValue=t[1]),it(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),CA=t=>(it(t.ns)&&(t.ns=[t.ns]),it(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),it(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),$f=()=>{},oF=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Ad extends Cm{constructor(e={},n){if(super(),this.options=CA(e),this.services={},this.logger=gs,this.modules={external:[]},oF(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(it(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const i=Lv();this.options={...i,...this.options,...CA(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),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?gs.init(r(this.modules.logger),this.options):gs.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=rF;const p=new gA(this.options);this.store=new mA(this.options.resources,this.options);const m=this.services;m.logger=gs,m.resourceStore=this.store,m.languageUtils=p,m.pluralResolver=new tF(p,{prepend:this.options.pluralSeparator}),f&&(m.formatter=r(f),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new wA(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new aF(r(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.languageDetector&&(m.languageDetector=r(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=r(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Ip(this.services,this.options),this.translator.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,n||(n=$f),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]=(...p)=>this.store[f](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...p)=>(this.store[f](...p),this)});const u=od(),d=()=>{const f=(p,m)=>{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),u.resolve(m),n(p,m)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),u}loadResources(e,n=$f){let i=n;const r=it(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(s.includes(f)||s.push(f))})};r?l(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),this.options.preload?.forEach?.(u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(e,n,i){const r=od();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=$f),this.services.backendConnector.reload(e,n,s=>{r.resolve(),i(s)}),r}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"&&fj.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"].includes(e)){for(let n=0;n<this.languages.length;n++){const i=this.languages[n];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const i=od();this.emit("languageChanging",e);const r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},s=(u,d)=>{d?this.isLanguageChangingTo===e&&(r(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),n&&n(u,(...f)=>this.t(...f))},l=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);const d=it(u)?u:u&&u[0],f=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(it(u)?[u]:u);f&&(this.language||r(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,p=>
283{s(p,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),i}getFixedT(e,n,i,r){const s=r?.scopeNs,l=(u,d,...f)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([u,d].concat(f)):p={...d},p.lng=p.lng||l.lng,p.lngs=p.lngs||l.lngs;const m=p.ns!==void 0&&p.ns!==null;p.ns=p.ns||l.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||i||l.keyPrefix);const x={...this.options,...p};Array.isArray(s)&&!m&&(x.ns=s),typeof p.keyPrefix=="function"&&(p.keyPrefix=Zo(p.keyPrefix,x));const b=this.options.keySeparator||".";let w;return p.keyPrefix&&Array.isArray(u)?w=u.map(C=>(typeof C=="function"&&(C=Zo(C,x)),`${p.keyPrefix}${b}${C}`)):(typeof u=="function"&&(u=Zo(u,x)),w=p.keyPrefix?`${p.keyPrefix}${b}${u}`:u),this.t(w,p)};return it(e)?l.lng=e:l.lngs=e,l.ns=n,l.keyPrefix=i,l}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
283if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const l=(u,d)=>{const f=this.services.backendConnector.state[`${u}|${d}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(i,e)&&(!r||l(s,e)))}loadNamespaces(e,n){const i=od();return this.options.ns?(it(e)&&(e=[e]),e.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=od();it(e)&&(e=[e]);const r=this.options.preload||[],s=e.filter(l=>!r.includes(l)&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=r.concat(s),this.loadResources(l=>{i.resolve(),n&&n(l)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const r=new Intl.Locale(e);if(r&&r.getTextInfo){const s=r.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["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=this.services?.languageUtils||new gA(Lv());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const i=new Ad(e,n);return i.createInstance=Ad.createInstance,i}cloneInstance(e={},n=$f){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},s=new Ad(r);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const u=Object.keys(this.store.data).reduce((d,f)=>(d[f]={...this.store.data[f]},d[f]=Object.keys(d[f]).reduce((p,m)=>(p[m]={...d[f][m]},p),d[f]),d),{});s.store=new mA(u,r),s.services.resourceStore=s.store}if(e.interpolation){const d={...Lv().interpolation,...this.options.interpolation,...e.interpolation},f={...r,interpolation:d};s.services.interpolator=new wA(f)}return s.translator=new Ip(s.services,r),s.translator.on("*",(u,...d)=>{s.emit(u,...d)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Jt=Ad.createInstance();Jt.createInstance;Jt.dir;Jt.init;Jt.loadResources;Jt.reloadResources;Jt.use;Jt.changeLanguage;Jt.getFixedT;Jt.t;Jt.exists;Jt.setDefaultNamespace;Jt.hasLoadedNamespace;Jt.loadNamespaces;Jt.loadLanguages;const lF={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},cF=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function EA(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(lF[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const s=t.indexOf("-->");return{type:"comment",comment:s!==-1?t.slice(4,s):""}}const i=new RegExp(cF);let r=null;for(;r=i.exec(t),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let l=[s,null];const u=s.indexOf("=");u>-1&&(l=[s.slice(0,u),s.slice(u+1)]),e.attrs[l[0]]=l[1],i.lastIndex--}else r[2]&&(e.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return e}const Uf=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,uF=/<\/?([^\s]+?)[/\s>]/,dF=/^\s*$/,hF=/^(script|style)$/i,xd="\0",fF=Object.create(null);function mj(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(xd).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(xd).join("<");return}for(const n in e.attrs){const i=e.attrs[n];typeof i=="string"&&i.indexOf(xd)>-1&&(e.attrs[n]=i.split(xd).join("<"))}e.children.length&&mj(e.children)})}function pF(t,e){const n=e&&e.components||fF,i=e&&e.allowedTags;let r=!1;if(i){const w=typeof i=="function"?i:function(k){return i.indexOf(k)>-1};let C="",A=0;Uf.lastIndex=0;let E;for(;E=Uf.exec(t);){const k=E[0];C+=t.slice(A,E.index);const N=k.match(uF);k.startsWith("<!--")||N&&w(N[1])?(C+=k,A=E.index+k.length):(r=!0,C+=xd,A=E.index+1,Uf.lastIndex=A)}t=C+t.slice(A)}const s=[],l=[];let u,d=-1,f=!1,p=0,m;if(t.indexOf("<")!==0){const w=t.indexOf("<");s.push({type:"text",content:w===-1?t:t.substring(0,w)})}const x=[];let b;for(;b=Uf.exec(t);)x.push(b);return x.forEach(function(w,C){const A=w[0];if(!A||A.startsWith("<!--"))return;let E=0,k=0,N=-1,_=null;for(let T=0;T<A.length;T++){const L=A.charAt(T);_?L===_&&(_=null):L==='"'||L==="'"?_=L:L==="<"?(E++,E===2&&(N=T)):L===">"&&k++}const R=N>-1&&/[a-zA-Z0-9\-!/]/.test(A.charAt(N+1));if(E>k&&R){const T=A.substring(0,N),L=A.substring(T.length);x[C][0]=L,x[C].index+=T.length}}),x.forEach(function(w,C){const A=w[0];if(!A)return;const E=w.index;if(E<p)return;if(f){if(A!=="</"+u.name+">")return;f=!1}const k=A.charAt(1)!=="/",N=A.startsWith("<!--"),_=E+A.length,R=t.charAt(_),T=x[C+1];let L;if(R==="<"&&T){const U=t.substring(_,T.index);L=U.split("<").length>U.split(">").length}let M;if(N){const U=EA(A);
283if(d<0)return s.push(U),s;M=l[d],M.children.push(U);const D=t.slice(_,T?T.index:void 0);return D.length>0&&M.children.push({type:"text",content:D}),s}if(k){d++,u=EA(A),u.type==="tag"&&n[u.name]&&(u.type="component",f=!0);let U=!1;if(!f&&!u.voidElement&&hF.test(u.name)){U=!0,m||(m=t.toLowerCase());const D=m.indexOf("</"+u.name.toLowerCase()+">",_),G=D===-1?t.length:D,Z=t.slice(_,G);Z&&u.children.push({type:"text",content:Z}),p=G}!u.voidElement&&!f&&!U&&R&&R!=="<"&&u.children.push({type:"text",content:t.slice(_,T?T.index:void 0)}),d===0&&s.push(u),M=l[d-1],M&&M.children.push(u),l[d]=u}if((!k||u.voidElement)&&(d>-1&&(u.voidElement||u.name===A.slice(2,-1))&&(d--,u=d===-1?s:l[d]),!f&&(R!=="<"||L)&&R)){M=d===-1?s:l[d].children;const U=T?T.index:-1;let D=t.slice(_,U===-1?void 0:U);dF.test(D)&&(D=" "),(U>-1&&d+M.length>=0||D!==" ")&&M.push({type:"text",content:D})}}),r&&mj(s),s}function mF(t){const e=[];for(const n in t)t[n]===null?e.push(n):e.push(n+'="'+String(t[n]).replace(/"/g,"&quot;")+'"');return e.length?" "+e.join(" "):""}function gj(t,e){switch(e.type){case"text":return t+e.content;case"tag":{const n=e.voidElement&&e.name.toLowerCase()!=="!doctype"?"/>":">";return t+="<"+e.name+(e.attrs?mF(e.attrs):"")+n,e.voidElement?t:t+e.children.reduce(gj,"")+"</"+e.name+">"}case"comment":return t+="<!--"+e.comment+"-->",t}}function gF(t){return t.reduce(function(e,n){return e+gj("",n)},"")}var xF={parse:pF,stringify:gF};const bp=(t,e,n,i)=>{const r=[n,{code:e,...i||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(r,"warn","react-i18next::",!0);Ii(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...r):console?.warn&&console.warn(...r)},AA={},Ac=(t,e,n,i)=>{Ii(n)&&AA[n]||(Ii(n)&&(AA[n]=new Date),bp(t,e,n,i))},xj=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Bb=(t,e,n)=>{t.loadNamespaces(e,xj(t,n))},kA=(t,e,n,i)=>{if(Ii(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Bb(t,n,i);n.forEach(r=>{t.options.ns.indexOf(r)<0&&t.options.ns.push(r)}),t.loadLanguages(e,xj(t,i))},vF=(t,e,n={})=>!e.languages||!e.languages.length?(Ac(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,t))return!1}}),Ii=t=>typeof t=="string",da=t=>typeof t=="object"&&t!==null,bF=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yF={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},wF=t=>yF[t],vj=t=>t.replace(bF,wF);let Hb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:vj,transDefaultProps:void 0};const SF=(t={})=>{Hb={...Hb,...t}},fw=()=>Hb;let bj;const CF=t=>{bj=t},pw=()=>bj,yp=(t,e)=>{if(!t)return!1;const n=t.props?.children??t.children;return e?n.length>0:!!n},vd=t=>{if(!t)return[];const e=t.props?.children??t.children;return t.props?.i18nIsDynamicList?to(e):e},EF=t=>Array.isArray(t)&&t.every(v.isValidElement),to=t=>Array.isArray(t)?t:[t],AF=(t,e)=>{const n={...e};return n.props={...e.props,...t.props},n},kF=t=>{const e={};if(!t)return e;const n=i=>{to(i).forEach(s=>{Ii(s)||(yp(s)?n(vd(s)):da(s)&&!v.isValidElement(s)&&Object.assign(e,s))})};return n(t),e},Gb=(t,e,n,i)=>{if(!t)return"";let r="";const s=to(t),l=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((u,d)=>{if(Ii(u)){r+=`${u}`;return}if(v.isValidElement(u)){const{props:f,type:p}=u,m=Object.keys(f).length,x=l.indexOf(p)>-1,b=f.children;if(!b&&x&&!m){r+=`<${p}/>`;return}if(!b&&(!x||m)||f.i18nIsDynamicList){r+=`<${d}></${d}
283>`;return}if(x&&m<=1){const C=Ii(b)?b:Gb(b,e,n,i);r+=`<${p}>${C}</${p}>`;return}const w=Gb(b,e,n,i);r+=`<${d}>${w}</${d}>`;return}if(u===null){bp(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(da(u)){const{format:f,...p}=u,m=Object.keys(p);if(m.length===1){const x=f?`${m[0]}, ${f}`:m[0];r+=`{{${x}}}`;return}bp(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:u});return}bp(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:u})}),r},NF=(t,e,n,i,r,s,l)=>{if(n==="")return[];const u=r.transKeepBasicHtmlNodesFor||[],d=n&&new RegExp(u.map(N=>`<${N}`).join("|")).test(n);if(!t&&!e&&!d&&!l)return[n];const f=e??{},p=N=>{to(N).forEach(R=>{Ii(R)||(yp(R)?p(vd(R)):da(R)&&!v.isValidElement(R)&&Object.assign(f,R))})};p(t);const m=Object.keys(f),x=N=>/^\d+$/.test(N)||u.indexOf(N)>-1||m.indexOf(N)>-1,b=xF.parse(`<0>${n}</0>`,{allowedTags:x}),w={...f,...s},C=(N,_,R)=>{const T=vd(N),L=E(T,_.children,R);return EF(T)&&L.length===0||N.props?.i18nIsDynamicList?T:L},A=(N,_,R,T,L)=>{N.dummy?(N.children=_,R.push(v.cloneElement(N,{key:T},L?void 0:_))):R.push(...v.Children.map([N],M=>{if(M.type===v.Fragment||M.props?.i18nIsDynamicList!==void 0){const D={key:T};return M&&M.props&&Object.keys(M.props).forEach(G=>{G==="children"||G==="i18nIsDynamicList"||(D[G]=M.props[G])}),v.createElement(M.type,D,L?null:_)}const U={key:T};return M&&M.props&&Object.keys(M.props).forEach(D=>{D==="ref"||D==="children"||(U[D]=M.props[D])}),v.cloneElement(M,U,L?null:_)}))},E=(N,_,R)=>{const T=to(N),L=to(_),M={};return L.reduce((U,D,G)=>{const Z=D.children?.[0]?.content&&i.services.interpolator.interpolate(D.children[0].content,w,i.language);if(D.type==="tag"){let Q=T[parseInt(D.name,10)];!Q&&e&&(Q=e[D.name]),R.length===1&&!Q&&(Q=R[0][D.name]),Q||(Q={});const K={...D.attrs};l&&Object.keys(K).forEach($=>{const B=K[$];Ii(B)&&(K[$]=vj(B))});const q=Object.keys(K).length!==0?AF({props:K},Q):Q,F=v.isValidElement(q),V=F&&yp(D,!0)&&!D.voidElement,O=d&&da(q)&&q.dummy&&!F,X=da(e)&&Object.hasOwnProperty.call(e,D.name);if(Ii(q)){const $=i.services.interpolator.interpolate(q,w,i.language);U.push($)}else if(yp(q)||V){const $=C(q,D,R);A(q,$,U,G)}else if(O){const $=E(T,D.children,R);A(q,$,U,G)}else if(Number.isNaN(parseFloat(D.name)))if(X){const $=C(q,D,R);A(q,$,U,G,D.voidElement)}else if(r.transSupportBasicHtmlNodes&&u.indexOf(D.name)>-1)if(D.voidElement)U.push(v.createElement(D.name,{key:`${D.name}-${G}`}));else{const $=M[D.name]||0;M[D.name]=$+1;let B,H=0;for(let he=0;he<T.length;he+=1){const ue=T[he];if(v.isValidElement(ue)&&ue.type===D.name){if(H===$){B=ue;break}H+=1}}const P=B?to(vd(B)):T,J=E(P,D.children,R);U.push(v.createElement(D.name,{key:`${D.name}-${G}`},J))}else if(D.voidElement)U.push(`<${D.name} />`);else{const $=E(T,D.children,R);U.push(`<${D.name}>${$}</${D.name}>`)}else if(da(q)&&!F){const $=D.children[0]?Z:null;$&&U.push($)}else A(q,Z,U,G,D.children.length!==1||!Z)}else if(D.type==="text"){const Q=r.transWrapTextNodes,K=typeof r.unescape=="function"?r.unescape:fw().unescape,q=l?K(i.services.interpolator.interpolate(D.content,w,i.language)):i.services.interpolator.interpolate(D.content,w,i.language);Q?U.push(v.createElement(Q,{key:`${D.name}-${G}`},q)):U.push(q)}return U},[])},k=E([{dummy:!0,children:t||[]}],b,to(t||[]));return vd(k[0])},yj=(t,e,n)=>{const i=t.key||e,r=v.cloneElement(t,{key:i});if(!r.props||!r.props.children||n.indexOf(`${e}/>`)<0&&n.indexOf(`${e} />`)<0)return r;function s(){return v.createElement(v.Fragment,null,r)}return v.createElement(s,{key:i})},jF=(t,e)=>t.map((n,i)=>yj(n,i,e)),_F=(t,e)=>{const n={};return Object.keys(t).forEach(i=>{Object.assign(n,{[i]:yj(t[i],i,e)})}),n},TF=(t,e,n,i)=>t?Array.isArray(t)?jF(t,e):da(t)?_F(t,e):(Ac(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:i}),null):null,RF=t=>!da(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,n)=>e&&Number.isNaN(Number.parseFloat(n)),!0);function PF({children:t,count:e,parent:n,i18nKey:i,context:r,tOptions:s={}
283,values:l,defaults:u,components:d,ns:f,i18n:p,t:m,shouldUnescape:x,...b}){const w=p||pw();if(!w)return Ac(w,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),t;const C=m||w.t.bind(w)||($=>$),A={...fw(),...w.options?.react};let E=f||C.ns||w.options?.defaultNS;E=Ii(E)?[E]:E||["translation"];const{transDefaultProps:k}=A,N=k?.tOptions?{...k.tOptions,...s}:s,_=x??k?.shouldUnescape,R=k?.values?{...k.values,...l}:l,T=k?.components?{...k.components,...d}:d,L=Gb(t,A,w,i),M=u||N?.defaultValue||L||A.transEmptyNodeValue||(typeof i=="function"?Zo(i):i),{hashTransKey:U}=A,D=i||(U?U(L||M):L||M);w.options?.interpolation?.defaultVariables?l=R&&Object.keys(R).length>0?{...R,...w.options.interpolation.defaultVariables}:{...w.options.interpolation.defaultVariables}:l=R;const G=kF(t);G&&typeof G.count=="number"&&e===void 0&&(e=G.count);const Z=l||e!==void 0&&!w.options?.interpolation?.alwaysFormat||!t?N.interpolation:{interpolation:{...N.interpolation,prefix:"#$?",suffix:"?$#"}},Q={...N,context:r||N.context,count:e,...l,...Z,defaultValue:M,ns:E};let K=D?C(D,Q):M;K===D&&M&&(K=M);const q=TF(T,K,w,i);let F=q||t,V=null;RF(q)&&(V=q,F=t);const O=NF(F,V,K,w,A,Q,_),X=n??A.defaultTransParent;return X?v.createElement(X,b,O):O}const DF={type:"3rdParty",init(t){SF(t.options.react),CF(t)}},wj=v.createContext();class LF{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Em({children:t,count:e,parent:n,i18nKey:i,context:r,tOptions:s={},values:l,defaults:u,components:d,ns:f,i18n:p,t:m,shouldUnescape:x,...b}){const{i18n:w,defaultNS:C}=v.useContext(wj)||{},A=p||w||pw(),E=m||A?.t.bind(A);return PF({children:t,count:e,parent:n,i18nKey:i,context:r,tOptions:s,values:l,defaults:u,components:d,ns:f||E?.ns||C||A?.options?.defaultNS,i18n:A,t:m,shouldUnescape:x,...b})}var Ov={exports:{}},Mv={};/**
284 * @license React
285 * use-sync-external-store-shim.production.js
286 *
287 * Copyright (c) Meta Platforms, Inc. and affiliates.
288 *
289 * This source code is licensed under the MIT license found in the
290 * LICENSE file in the root directory of this source tree.
291 */var NA;function OF(){if(NA)return Mv;NA=1;var t=hm();function e(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,r=t.useEffect,s=t.useLayoutEffect,l=t.useDebugValue;function u(m,x){var b=x(),w=i({inst:{value:b,getSnapshot:x}}),C=w[0].inst,A=w[1];return s(function(){C.value=b,C.getSnapshot=x,d(C)&&A({inst:C})},[m,b,x]),r(function(){return d(C)&&A({inst:C}),m(function(){d(C)&&A({inst:C})})},[m]),l(b),b}function d(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!n(m,b)}catch{return!0}}function f(m,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Mv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,Mv}var jA;function MF(){return jA||(jA=1,Ov.exports=OF()),Ov.exports}var Sj=MF();const IF=(t,e)=>{if(Ii(e))return e;if(da(e)&&Ii(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},zF={t:IF,ready:!1},FF=()=>()=>{},Ye=(t,e={})=>{const{i18n:n}=e,{i18n:i,defaultNS:r}=v.useContext(wj)||{},s=n||i||pw();s&&!s.reportNamespaces&&(s.reportNamespaces=new LF),s||Ac(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const l=v.useMemo(()=>({...fw(),...s?.options?.react,...e}),[s,e]),{useSuspense:u,keyPrefix:d}=l,f=t||r||s?.options?.defaultNS,p=Ii(f)?[f]:f||["translation"],m=v.useMemo(()=>p,p);s?.reportNamespaces?.addUsedNamespaces?.(m);const x=v.useRef(0),b=v.useCallback(U=>{if(!s)return FF;const{bindI18n:D,bindI18nStore:G}=l,Z=()=>{x.current+=1,U()};return D&&s.on(D,Z),G&&s.store.on(G,Z),()=>{D&&D.split(" ").forEach(Q=>s.off(Q,Z)),G&&G.split(" ").forEach(Q=>s.store.off(Q,Z))}},[s,l]),w=v.useRef(),C=v.useCallback(()=>
291{if(!s)return zF;const U=!!(s.isInitialized||s.initializedStoreOnce)&&m.every(q=>vF(q,s,l)),D=e.lng||s.language,G=x.current,Z=w.current;if(Z&&Z.ready===U&&Z.lng===D&&Z.keyPrefix===d&&Z.revision===G)return Z;const K={t:s.getFixedT(D,l.nsMode==="fallback"?m:m[0],d,{scopeNs:m}),ready:U,lng:D,keyPrefix:d,revision:G};return w.current=K,K},[s,m,d,l,e.lng]),[A,E]=v.useState(0),{t:k,ready:N}=Sj.useSyncExternalStore(b,C,C);v.useEffect(()=>{if(s&&!N&&!u){const U=()=>E(D=>D+1);e.lng?kA(s,e.lng,m,U):Bb(s,m,U)}},[s,e.lng,m,N,u,A]);const _=s||{},R=v.useRef(null),T=v.useRef(),L=U=>{const D=Object.getOwnPropertyDescriptors(U);D.__original&&delete D.__original;const G=Object.create(Object.getPrototypeOf(U),D);if(!Object.prototype.hasOwnProperty.call(G,"__original"))try{Object.defineProperty(G,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return G},M=v.useMemo(()=>{const U=_,D=U?.language;let G=U;U&&(R.current&&R.current.__original===U?T.current!==D?(G=L(U),R.current=G,T.current=D):G=R.current:(G=L(U),R.current=G,T.current=D));const Z=!N&&!u?(...K)=>(Ac(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),k(...K)):k,Q=[Z,G,N];return Q.t=Z,Q.i18n=G,Q.ready=N,Q},[k,_,N,_.resolvedLanguage,_.language,_.languages]);if(s&&u&&!N){let U=!1;try{U=!1}catch{}throw U&&Ac(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(D=>{const G=()=>D();e.lng?kA(s,e.lng,m,G):Bb(s,m,G)})}return M};function Pe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t?.(r),n===!1||!r.defaultPrevented)return e?.(r)}}function _A(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function _s(...t){return e=>{let n=!1;const i=t.map(r=>{const s=_A(r,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<i.length;r++){const s=i[r];typeof s=="function"?s():_A(t[r],null)}}}}function Et(...t){return v.useCallback(_s(...t),t)}function $F(t,e){const n=v.createContext(e),i=s=>{const{children:l,...u}=s,d=v.useMemo(()=>u,Object.values(u));return o.jsx(n.Provider,{value:d,children:l})};i.displayName=t+"Provider";function r(s){const l=v.useContext(n);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[i,r]}function Er(t,e=[]){let n=[];function i(s,l){const u=v.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:x,children:b,...w}=m,C=x?.[t]?.[d]||u,A=v.useMemo(()=>w,Object.values(w));return o.jsx(C.Provider,{value:A,children:b})};f.displayName=s+"Provider";function p(m,x){const b=x?.[t]?.[d]||u,w=v.useContext(b);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[f,p]}const r=()=>{const s=n.map(l=>v.createContext(l));return function(u){const d=u?.[t]||s;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:d}}),[u,d])}};return r.scopeName=t,[i,UF(r,...e)]}function UF(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const l=i.reduce((u,{useScope:d,scopeName:f})=>{const m=d(s)[`__scope${f}`];return{...u,...m}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}var zn=globalThis?.document?v.useLayoutEffect:()=>{},BF=qy[" useId ".trim().toString()]||(()=>{}),HF=0;function qr(t){const[e,n]=v.useState(BF());return zn(()=>{n(i=>i??String(HF++))},[t]),t||(e?`radix-${e}`:"")}var GF=qy[" useInsertionEffect ".trim().toString()]||zn;function co({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[r,s,l]=VF({defaultProp:e,onChange:n}),u=t!==void 0,d=u?t:r;{const p=v.useRef(t!==void 0);v.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${i} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,i])}const f=v.useCallback(p=>{if(u){const m=qF(p)?p(t):p;m!==t&&l.current?.(m)}else s(p)},[u,t,s,l]);return[d,f]}function VF({defaultProp:t,onChange:e}){const[n,i]=v.useState(t),r=v.useRef(n),s=v.useRef(e);return GF(()=>{s.current=e},[e]),v.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,i,s]}function qF(t){return typeof t=="function"}function KF(t){const e=WF(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(XF);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function WF(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;
vendor: 23,493 bytes, lines 291-360
291if(v.isValidElement(r)){const l=ZF(r),u=QF(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var YF=Symbol("radix.slottable");function XF(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===YF}function QF(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function ZF(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var JF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=JF.reduce((t,e)=>{const n=KF(`Primitive.${e}`),i=v.forwardRef((r,s)=>{const{asChild:l,...u}=r,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...u,ref:s})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function Cj(t,e){t&&Wd.flushSync(()=>t.dispatchEvent(e))}function Zn(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>e.current?.(...n),[])}function e6(t,e=globalThis?.document){const n=Zn(t);v.useEffect(()=>{const i=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}var t6="DismissableLayer",Vb="dismissableLayer.update",n6="dismissableLayer.pointerDownOutside",i6="dismissableLayer.focusOutside",TA,Ej=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jd=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...d}=t,f=v.useContext(Ej),[p,m]=v.useState(null),x=p?.ownerDocument??globalThis?.document,[,b]=v.useState({}),w=Et(e,L=>m(L)),C=Array.from(f.layers),[A]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=C.indexOf(A),k=p?C.indexOf(p):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,_=k>=E,R=a6(L=>{const M=L.target,U=[...f.branches].some(D=>D.contains(M));!_||U||(r?.(L),l?.(L),L.defaultPrevented||u?.())},x),T=o6(L=>{const M=L.target;[...f.branches].some(D=>D.contains(M))||(s?.(L),l?.(L),L.defaultPrevented||u?.())},x);return e6(L=>{k===f.layers.size-1&&(i?.(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))},x),v.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(TA=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),RA(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=TA)}},[p,x,n,f]),v.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),RA())},[p,f]),v.useEffect(()=>{const L=()=>b({});return document.addEventListener(Vb,L),()=>document.removeEventListener(Vb,L)},[]),o.jsx(Je.div,{...d,ref:w,style:{pointerEvents:N?_?"auto":"none":void 0,...t.style},onFocusCapture:Pe(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Pe(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pe(t.onPointerDownCapture,R.onPointerDownCapture)})});Jd.displayName=t6;var r6="DismissableLayerBranch",s6=v.forwardRef((t,e)=>{const n=v.useContext(Ej),i=v.useRef(null),r=Et(e,i);return v.useEffect(()=>{const s=i.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),o.jsx(Je.div,{...t,ref:r})});s6.displayName=r6;function a6(t,e=globalThis?.document){const n=Zn(t),i=v.useRef(!1),r=v.useRef(()=>{});return v.useEffect(()=>{const s=u=>{if(u.target&&!i.current){let d=function(){Aj(n6,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=d,e.addEventListener("click",r.current,{once:!0})):d()}else e.removeEventListener("click",r.current);i.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",s),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}function o6(t,e=globalThis?.document){const n=Zn(t),i=v.useRef(!1);return v.useEffect(()=>{const r=s=>{s.target&&!i.current&&Aj(i6,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function RA(){const t=new CustomEvent(Vb);document.dispatchEvent(t)}function Aj(t,e,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?Cj(r,s):r.dispatchEvent(s)}var Iv="focusScope.autoFocusOnMount",zv="focusScope.autoFocusOnUnmount",PA={bubbles:!1,cancelable:!0},l6="FocusScope",eh=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...l}=t,[u,d]=v.useState(null),f=Zn(r),p=Zn(s),m=v.useRef(null),x=Et(e,C=>d(C)),b=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(i){let C=function(N){if(b.paused||!u)return;const _=N.target;u.contains(_)?m.current=_:Za(m.current,{select:!0})},A=function(N){if(b.paused||!u)return;const _=N.relatedTarget;_!==null&&(u.contains(_)||Za(m.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const R of N)R.removedNodes.length>0&&Za(u)};document.addEventListener("focusin",C),document.addEventListener("focusout",A);const k=new MutationObserver(E);return u&&k.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",A),k.disconnect()}}},[i,u,b.paused]),v.useEffect(()=>{if(u){LA.add(b);const C=document.activeElement;if(!u.contains(C)){const E=new CustomEvent(Iv,PA);u.addEventListener(Iv,f),u.dispatchEvent(E),E.defaultPrevented||(c6(p6(kj(u)),{select:!0}),document.activeElement===C&&Za(u))}return()=>{u.removeEventListener(Iv,f),setTimeout(()=>{const E=new CustomEvent(zv,PA);u.addEventListener(zv,p),u.dispatchEvent(E),E.defaultPrevented||Za(C??document.body,{select:!0}),u.removeEventListener(zv,p),LA.remove(b)},0)}}},[u,f,p,b]);const w=v.useCallback(C=>{if(!n&&!i||b.paused)return;const A=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,E=document.activeElement;if(A&&E){const k=C.currentTarget,[N,_]=u6(k);N&&_?!C.shiftKey&&E===_?(C.preventDefault(),n&&Za(N,{select:!0})):C.shiftKey&&E===N&&(C.preventDefault(),n&&Za(_,{select:!0})):E===k&&C.preventDefault()}},[n,i,b.paused]);return o.jsx(Je.div,{tabIndex:-1,...l,ref:x,onKeyDown:w})});eh.displayName=l6;function c6(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(Za(i,{select:e}),document.activeElement!==n)return}function u6(t){const e=kj(t),n=DA(e,t),i=DA(e.reverse(),t);return[n,i]}function kj(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function DA(t,e){for(const n of t)if(!d6(n,{upTo:e}))return n}function d6(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function h6(t){return t instanceof HTMLInputElement&&"select"in t}function Za(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&h6(t)&&e&&t.select()}}var LA=f6();function f6(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=OA(t,e),t.unshift(e)},remove(e){t=OA(t,e),t[0]?.resume()}}}function OA(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function p6(t){return t.filter(e=>e.tagName!=="A")}var m6="Portal",th=v.forwardRef((t,e)=>{const{container:n,...i}=t,[r,s]=v.useState(!1);zn(()=>s(!0),[]);const l=n||r&&globalThis?.document?.body;return l?bI.createPortal(o.jsx(Je.div,{...i,ref:e}),l):null});th.displayName=m6;function g6(t,e){return v.useReducer((n,i)=>e[n][i]??n,t)}var mi=t=>{const{present:e,children:n}=t,i=x6(e),r=typeof n=="function"?n({present:i.isPresent}):v.Children.only(n),s=Et(i.ref,v6(r));return typeof n=="function"||i.isPresent?v.cloneElement(r,{ref:s}):null};mi.displayName="Presence";function x6(t){const[e,n]=v.useState(),i=v.useRef(null),r=v.useRef(t),s=v.useRef("none"),l=t?"mounted":"unmounted",[u,d]=g6(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Bf(i.current);s.current=u==="mounted"?f:"none"},[u]),zn(()=>{const f=i.current,p=r.current;if(p!==t){const x=s.current,b=Bf(f);t?d("MOUNT"):b==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,d]),zn(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,m=b=>{const C=Bf(i.current).includes(CSS.escape(b.animationName));if(b.target===e&&C&&(d("ANIMATION_END"),!r.current)){const A=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=A)})}},x=b=>{b.target===e&&(s.current=Bf(i.current))};return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(f=>{i.current=f?getComputedStyle(f):null,n(f)},[])}}function Bf(t){return t?.animationName||"none"}function v6(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Fv=0;function Am(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??MA()),document.body.insertAdjacentElement("beforeend",t[1]??MA()),Fv++,()=>{Fv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Fv--}},[])}function MA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var b6=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},pc=new WeakMap,Hf=new WeakMap,Gf={},$v=0,Nj=function(t){return t&&(t.host||Nj(t.parentNode))},y6=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=Nj(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},w6=function(t,e,n,i){var r=y6(e,Array.isArray(t)?t:[t]);Gf[n]||(Gf[n]=new WeakMap);var s=Gf[n],l=[],u=new Set,d=new Set(r),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};r.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(x){if(u.has(x))p(x);else try{var b=x.getAttribute(i),w=b!==null&&b!=="false",C=(pc.get(x)||0)+1,A=(s.get(x)||0)+1;pc.set(x,C),s.set(x,A),l.push(x),C===1&&w&&Hf.set(x,!0),A===1&&x.setAttribute(n,"true"),w||x.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",x,E)}})};return p(e),u.clear(),$v++,function(){l.forEach(function(m){var x=pc.get(m)-1,b=s.get(m)-1;pc.set(m,x),s.set(m,b),x||(Hf.has(m)||m.removeAttribute(i),Hf.delete(m)),b||m.removeAttribute(n)}),$v--,$v||(pc=new WeakMap,pc=new WeakMap,Hf=new WeakMap,Gf={})}},km=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=b6(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),w6(i,r,n,"aria-hidden")):function(){return null}};function S6(t){const e=C6(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(A6);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function C6(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;if(v.isValidElement(r)){const l=N6(r),u=k6(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var E6=Symbol("radix.slottable");function A6(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===E6}function k6(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function N6(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Nm="Dialog",[jj]=Er(Nm),[j6,es]=jj(Nm),_j=t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:l=!0}=t,u=v.useRef(null),d=v.useRef(null),[f,p]=co({prop:i,defaultProp:r??!1,onChange:s,caller:Nm});return o.jsx(j6,{scope:e,triggerRef:u,contentRef:d,contentId:qr(),titleId:qr(),descriptionId:qr(),open:f,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};_j.displayName=Nm;var Tj="DialogTrigger",Rj=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=es(Tj,n),s=Et(e,r.triggerRef);return o.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":xw(r.open),...i,ref:s,onClick:Pe(t.onClick,r.onOpenToggle)})});Rj.displayName=Tj;var mw="DialogPortal",[_6,Pj]=jj(mw,{forceMount:void 0}),Dj=t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,s=es(mw,e);return o.jsx(_6,{scope:e,forceMount:n,children:v.Children.map(i,l=>o.jsx(mi,{present:n||s.open,children:o.jsx(th,{asChild:!0,container:r,children:l})}))})};Dj.displayName=mw;var zp="DialogOverlay",Lj=v.forwardRef((t,e)=>{const n=Pj(zp,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=es(zp,t.__scopeDialog);return s.modal?o.jsx(mi,{present:i||s.open,children:o.jsx(R6,{...r,ref:e})}):null});Lj.displayName=zp;var T6=S6("DialogOverlay.RemoveScroll"),R6=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=es(zp,n);return o.jsx(Kd,{as:T6,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(Je.div,{"data-state":xw(r.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),tl="DialogContent",Oj=v.forwardRef((t,e)=>{const n=Pj(tl,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=es(tl,t.__scopeDialog);return o.jsx(mi,{present:i||s.open,children:s.modal?o.jsx(P6,{...r,ref:e}):o.jsx(D6,{...r,ref:e})})});Oj.displayName=tl;var P6=v.forwardRef((t,e)=>{const n=es(tl,t.__scopeDialog),i=v.useRef(null),r=Et(e,n.contentRef,i);return v.useEffect(()=>{const s=i.current;if(s)return km(s)},[]),o.jsx(Mj,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(t.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&s.preventDefault()}),onFocusOutside:Pe(t.onFocusOutside,s=>s.preventDefault())})}),D6=v.forwardRef((t,e)=>{const n=es(tl,t.__scopeDialog),i=v.useRef(!1),r=v.useRef(!1);return o.jsx(Mj,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||n.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Mj=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:s,...l}=t,u=es(tl,n),d=v.useRef(null),f=Et(e,d);return Am(),o.jsxs(o.Fragment,{children:[o.jsx(eh,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(Jd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":xw(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(L6,{titleId:u.titleId}),o.jsx(M6,{contentRef:d,descriptionId:u.descriptionId})]})]})}),gw="DialogTitle",Ij=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=es(gw,n);return o.jsx(Je.h2,{id:r.titleId,...i,ref:e})});Ij.displayName=gw;var zj="DialogDescription",Fj=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=es(zj,n);return o.jsx(Je.p,{id:r.descriptionId,...i,ref:e})});Fj.displayName=zj;var $j="DialogClose",Uj=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=es($j,n);return o.jsx(Je.button,{type:"button",...i,ref:e,onClick:Pe(t.onClick,()=>r.onOpenChange(!1))})});Uj.displayName=$j;function xw(t){return t?"open":"closed"}var Bj="DialogTitleWarning",[Xoe,Hj]=$F(Bj,{contentName:tl,titleName:gw,docsSlug:"dialog"}),L6=({titleId:t})=>{const e=Hj(Bj),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
292
293If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
294
295For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},O6="DialogDescriptionWarning",M6=({contentRef:t,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hj(O6).contentName}}.`;return v.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,t,e]),null},Gj=_j,I6=Rj,Vj=Dj,qj=Lj,Kj=Oj,Wj=Ij,Yj=Fj,Xj=Uj;/**
296 * @license lucide-react v0.548.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const z6=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F6=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase()),IA=t=>{const e=F6(t);return e.charAt(0).toUpperCase()+e.slice(1)},Qj=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim(),$6=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
301 * @license lucide-react v0.548.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */var U6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
306 * @license lucide-react v0.548.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const B6=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:l,...u},d)=>v.createElement("svg",{ref:d,...U6,width:e,height:e,stroke:t,strokeWidth:i?Number(n)*24/Number(e):n,className:Qj("lucide",r),...!s&&!$6(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,p])=>v.createElement(f,p)),...Array.isArray(s)?s:[s]]));/**
311 * @license lucide-react v0.548.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const Le=(t,e)=>{const n=v.forwardRef(({className:i,...r},s)=>v.createElement(B6,{ref:s,iconNode:e,className:Qj(`lucide-${z6(IA(t))}`,`lucide-${t}`,i),...r}));return n.displayName=IA(t),n};/**
316 * @license lucide-react v0.548.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const H6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],fr=Le("arrow-down",H6);/**
321 * @license lucide-react v0.548.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const G6=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],V6=Le("arrow-left-right",G6);/**
326 * @license lucide-react v0.548.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const q6=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Es=Le("arrow-left",q6);/**
331 * @license lucide-react v0.548.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const K6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],W6=Le("arrow-right",K6);/**
336 * @license lucide-react v0.548.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const Y6=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],pr=Le("arrow-up",Y6);/**
341 * @license lucide-react v0.548.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const X6=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Q6=Le("bell",X6);/**
346 * @license lucide-react v0.548.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const Z6=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],J6=Le("book-open",Z6);/**
351 * @license lucide-react v0.548.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const e8=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],vw=Le("braces",e8);/**
356 * @license lucide-react v0.548.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const t8=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}
360],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],n8=Le("building-2",t8);/**
361 * @license lucide-react v0.548.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const i8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],r8=Le("calendar",i8);/**
366 * @license lucide-react v0.548.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const s8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zi=Le("check",s8);/**
371 * @license lucide-react v0.548.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const a8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xs=Le("chevron-down",a8);/**
376 * @license lucide-react v0.548.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const o8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Zj=Le("chevron-left",o8);/**
381 * @license lucide-react v0.548.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const l8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ro=Le("chevron-right",l8);/**
386 * @license lucide-react v0.548.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const c8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],u8=Le("chevron-up",c8);/**
391 * @license lucide-react v0.548.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const d8=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],h8=Le("chevrons-left",d8);/**
396 * @license lucide-react v0.548.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const f8=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],p8=Le("chevrons-right",f8);/**
401 * @license lucide-react v0.548.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const m8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],g8=Le("circle-alert",m8);/**
406 * @license lucide-react v0.548.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const x8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Jj=Le("circle-check",x8);/**
411 * @license lucide-react v0.548.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const v8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],b8=Le("circle-plus",v8);/**
416 * @license lucide-react v0.548.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const y8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],e_=Le("circle-x",y8);/**
421 * @license lucide-react v0.548.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const w8=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t_=Le("clock",w8);/**
426 * @license lucide-react v0.548.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const S8=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],n_=Le("code-xml",S8);/**
431 * @license lucide-react v0.548.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const C8=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Fp=Le("copy",C8);/**
436 * @license lucide-react v0.548.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const E8=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],$p=Le("credit-card",E8);/**
441 * @license lucide-react v0.548.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const A8=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],k8=Le("database",A8);/**
446 * @license lucide-react v0.548.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const N8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],j8=Le("download",N8);/**
451 * @license lucide-react v0.548.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const _8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],zA=Le("ellipsis-vertical",_8);
455/**
456 * @license lucide-react v0.548.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const T8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],kc=Le("ellipsis",T8);/**
461 * @license lucide-react v0.548.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const R8=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],nl=Le("external-link",R8);/**
466 * @license lucide-react v0.548.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const P8=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],D8=Le("eye-off",P8);/**
471 * @license lucide-react v0.548.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const L8=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wo=Le("eye",L8);/**
476 * @license lucide-react v0.548.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const O8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],bw=Le("file-text",O8);/**
481 * @license lucide-react v0.548.0 - ISC
482 *
483 * This source code is licensed under the ISC license.
484 * See the LICENSE file in the root directory of this source tree.
485 */const M8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]],I8=Le("file-type",M8);/**
486 * @license lucide-react v0.548.0 - ISC
487 *
488 * This source code is licensed under the ISC license.
489 * See the LICENSE file in the root directory of this source tree.
490 */const z8=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Vf=Le("folder-input",z8);/**
491 * @license lucide-react v0.548.0 - ISC
492 *
493 * This source code is licensed under the ISC license.
494 * See the LICENSE file in the root directory of this source tree.
495 */const F8=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$8=Le("folder",F8);/**
496 * @license lucide-react v0.548.0 - ISC
497 *
498 * This source code is licensed under the ISC license.
499 * See the LICENSE file in the root directory of this source tree.
500 */const U8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],B8=Le("globe",U8);/**
501 * @license lucide-react v0.548.0 - ISC
502 *
503 * This source code is licensed under the ISC license.
504 * See the LICENSE file in the root directory of this source tree.
505 */const H8=[["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],G8=Le("grid-3x2",H8);/**
506 * @license lucide-react v0.548.0 - ISC
507 *
508 * This source code is licensed under the ISC license.
509 * See the LICENSE file in the root directory of this source tree.
510 */const V8=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
510]],yw=Le("hard-drive",V8);/**
511 * @license lucide-react v0.548.0 - ISC
512 *
513 * This source code is licensed under the ISC license.
514 * See the LICENSE file in the root directory of this source tree.
515 */const q8=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Up=Le("key-round",q8);/**
516 * @license lucide-react v0.548.0 - ISC
517 *
518 * This source code is licensed under the ISC license.
519 * See the LICENSE file in the root directory of this source tree.
520 */const K8=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],W8=Le("layout-grid",K8);/**
521 * @license lucide-react v0.548.0 - ISC
522 *
523 * This source code is licensed under the ISC license.
524 * See the LICENSE file in the root directory of this source tree.
525 */const Y8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],i_=Le("life-buoy",Y8);/**
526 * @license lucide-react v0.548.0 - ISC
527 *
528 * This source code is licensed under the ISC license.
529 * See the LICENSE file in the root directory of this source tree.
530 */const X8=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Q8=Le("link-2",X8);/**
531 * @license lucide-react v0.548.0 - ISC
532 *
533 * This source code is licensed under the ISC license.
534 * See the LICENSE file in the root directory of this source tree.
535 */const Z8=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],J8=Le("link",Z8);/**
536 * @license lucide-react v0.548.0 - ISC
537 *
538 * This source code is licensed under the ISC license.
539 * See the LICENSE file in the root directory of this source tree.
540 */const e7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Vn=Le("loader-circle",e7);/**
541 * @license lucide-react v0.548.0 - ISC
542 *
543 * This source code is licensed under the ISC license.
544 * See the LICENSE file in the root directory of this source tree.
545 */const t7=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],r_=Le("log-out",t7);/**
546 * @license lucide-react v0.548.0 - ISC
547 *
548 * This source code is licensed under the ISC license.
549 * See the LICENSE file in the root directory of this source tree.
550 */const n7=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],i7=Le("mail",n7);/**
551 * @license lucide-react v0.548.0 - ISC
552 *
553 * This source code is licensed under the ISC license.
554 * See the LICENSE file in the root directory of this source tree.
555 */const r7=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],FA=Le("maximize-2",r7);/**
556 * @license lucide-react v0.548.0 - ISC
557 *
558 * This source code is licensed under the ISC license.
559 * See the LICENSE file in the root directory of this source tree.
560 */const s7=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],a7=Le("monitor",s7);/**
561 * @license lucide-react v0.548.0 - ISC
562 *
563 * This source code is licensed under the ISC license.
564 * See the LICENSE file in the root directory of this source tree.
565 */const o7=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],s_=Le("moon",o7);/**
566 * @license lucide-react v0.548.0 - ISC
567 *
568 * This source code is licensed under the ISC license.
569 * See the LICENSE file in the root directory of this source tree.
570 */const l7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],a_=Le("panel-right",l7);/**
571 * @license lucide-react v0.548.0 - ISC
572 *
573 * This source code is licensed under the ISC license.
574 * See the LICENSE file in the root directory of this source tree.
575 */const c7=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],qf=Le("pencil",c7);/**
576 * @license lucide-react v0.548.0 - ISC
577 *
578 * This source code is licensed under the ISC license.
579 * See the LICENSE file in the root directory of this source tree.
580 */const u7=[["path",{d:"M12 22v-5",key:"1ega77"}
580],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],ww=Le("plug",u7);/**
581 * @license lucide-react v0.548.0 - ISC
582 *
583 * This source code is licensed under the ISC license.
584 * See the LICENSE file in the root directory of this source tree.
585 */const d7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bp=Le("plus",d7);/**
586 * @license lucide-react v0.548.0 - ISC
587 *
588 * This source code is licensed under the ISC license.
589 * See the LICENSE file in the root directory of this source tree.
590 */const h7=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],o_=Le("radio",h7);/**
591 * @license lucide-react v0.548.0 - ISC
592 *
593 * This source code is licensed under the ISC license.
594 * See the LICENSE file in the root directory of this source tree.
595 */const f7=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Dc=Le("refresh-cw",f7);/**
596 * @license lucide-react v0.548.0 - ISC
597 *
598 * This source code is licensed under the ISC license.
599 * See the LICENSE file in the root directory of this source tree.
600 */const p7=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Yc=Le("search",p7);/**
601 * @license lucide-react v0.548.0 - ISC
602 *
603 * This source code is licensed under the ISC license.
604 * See the LICENSE file in the root directory of this source tree.
605 */const m7=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],g7=Le("send",m7);/**
606 * @license lucide-react v0.548.0 - ISC
607 *
608 * This source code is licensed under the ISC license.
609 * See the LICENSE file in the root directory of this source tree.
610 */const x7=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],il=Le("settings-2",x7);/**
611 * @license lucide-react v0.548.0 - ISC
612 *
613 * This source code is licensed under the ISC license.
614 * See the LICENSE file in the root directory of this source tree.
615 */const v7=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],gr=Le("share-2",v7);/**
616 * @license lucide-react v0.548.0 - ISC
617 *
618 * This source code is licensed under the ISC license.
619 * See the LICENSE file in the root directory of this source tree.
620 */const b7=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],$A=Le("star",b7);/**
621 * @license lucide-react v0.548.0 - ISC
622 *
623 * This source code is licensed under the ISC license.
624 * See the LICENSE file in the root directory of this source tree.
625 */const y7=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],qb=Le("sun",y7);/**
626 * @license lucide-react v0.548.0 - ISC
627 *
628 * This source code is licensed under the ISC license.
629 * See the LICENSE file in the root directory of this source tree.
630 */const w7=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],l_=Le("terminal",w7);/**
631 * @license lucide-react v0.548.0 - ISC
632 *
633 * This source code is licensed under the ISC license.
634 * See the LICENSE file in the root directory of this source tree.
635 */const S7=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],UA=Le("toggle-left",S7);/**
636 * @license lucide-react v0.548.0 - ISC
637 *
638 * This source code is licensed under the ISC license.
639 * See the LICENSE file in the root directory of this source tree.
640 */const C7=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],BA=Le("toggle-right",C7);/**
641 * @license lucide-react v0.548.0 - ISC
642 *
643 * This source code is licensed under the ISC license.
644 * See the LICENSE file in the root directory of this source tree.
645 */const E7=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],yi=Le("trash-2",E7);/**
646 * @license lucide-react v0.548.0 - ISC
647 *
648 * This source code is licensed under the ISC license.
649 * See the LICENSE file in the root directory of this source tree.
650 */const A7=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],k7=Le("triangle-alert",A7);/**
651 * @license lucide-react v0.548.0 - ISC
652 *
653 * This source code is licensed under the ISC license.
654 * See the LICENSE file in the root directory of this source tree.
vendor: 7,827 bytes, lines 655-675
655 */const N7=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],c_=Le("upload",N7);/**
656 * @license lucide-react v0.548.0 - ISC
657 *
658 * This source code is licensed under the ISC license.
659 * See the LICENSE file in the root directory of this source tree.
660 */const j7=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],u_=Le("user-plus",j7);/**
661 * @license lucide-react v0.548.0 - ISC
662 *
663 * This source code is licensed under the ISC license.
664 * See the LICENSE file in the root directory of this source tree.
665 */const _7=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],T7=Le("user",_7);/**
666 * @license lucide-react v0.548.0 - ISC
667 *
668 * This source code is licensed under the ISC license.
669 * See the LICENSE file in the root directory of this source tree.
670 */const R7=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Md=Le("users",R7);/**
671 * @license lucide-react v0.548.0 - ISC
672 *
673 * This source code is licensed under the ISC license.
674 * See the LICENSE file in the root directory of this source tree.
675 */const P7=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yr=Le("x",P7),Sw="-",D7=t=>{const e=O7(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:l=>{const u=l.split(Sw);return u[0]===""&&u.length!==1&&u.shift(),d_(u,e)||L7(l)},getConflictingClassGroupIds:(l,u)=>{const d=n[l]||[];return u&&i[l]?[...d,...i[l]]:d}}},d_=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],i=e.nextPart.get(n),r=i?d_(t.slice(1),i):void 0;if(r)return r;if(e.validators.length===0)return;const s=t.join(Sw);return e.validators.find(({validator:l})=>l(s))?.classGroupId},HA=/^\[(.+)\]$/,L7=t=>{if(HA.test(t)){const e=HA.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},O7=t=>{const{theme:e,classGroups:n}=t,i={nextPart:new Map,validators:[]};for(const r in n)Kb(n[r],i,r,e);return i},Kb=(t,e,n,i)=>{t.forEach(r=>{if(typeof r=="string"){const s=r===""?e:GA(e,r);s.classGroupId=n;return}if(typeof r=="function"){if(M7(r)){Kb(r(i),e,n,i);return}e.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([s,l])=>{Kb(l,GA(e,s),n,i)})})},GA=(t,e)=>{let n=t;return e.split(Sw).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},M7=t=>t.isThemeGetter,I7=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,i=new Map;const r=(s,l)=>{n.set(s,l),e++,e>t&&(e=0,i=n,n=new Map)};return{get(s){let l=n.get(s);if(l!==void 0)return l;if((l=i.get(s))!==void 0)return r(s,l),l},set(s,l){n.has(s)?n.set(s,l):r(s,l)}}},Wb="!",Yb=":",z7=Yb.length,F7=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let l=0,u=0,d=0,f;for(let w=0;w<r.length;w++){let C=r[w];if(l===0&&u===0){if(C===Yb){s.push(r.slice(d,w)),d=w+z7;continue}if(C==="/"){f=w;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const p=s.length===0?r:r.substring(d),m=$7(p),x=m!==p,b=f&&f>d?f-d:void 0;return{modifiers:s,hasImportantModifier:x,baseClassName:m,maybePostfixModifierPosition:b}};if(e){const r=e+Yb,s=i;i=l=>l.startsWith(r)?s(l.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},$7=t=>t.endsWith(Wb)?t.substring(0,t.length-1):t.startsWith(Wb)?t.substring(1):t,U7=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const r=[];let s=[];return i.forEach(l=>{l[0]==="["||e[l]?(r.push(...s.sort(),l),s=[]):s.push(l)}),r.push(...s.sort()),r}},B7=t=>({cache:I7(t.cacheSize),parseClassName:F7(t),sortModifiers:U7(t),...D7(t)}),H7=/\s+/,G7=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,l=[],u=t.trim().split(H7);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let A=!!C,E=i(A?w.substring(0,C):w);if(!E){if(!A){d=p+(d.length>0?" "+d:d);continue}if(E=i(w),!E){d=p+(d.length>0?" "+d:d);continue}A=!1}const k=s(x).join(":"),N=b?k+Wb:k,_=N+E;if(l.includes(_))continue;l.push(_);const R=r(E,A);for(let T=0;T<R.length;++T){const L=R[T];l.push(N+L)}d=p+(d.length>0?" "+d:d)}return d};function V7(){let t=0,e,n,i="";for(;t<arguments.length;)(e=arguments[t++])&&(n=h_(e))&&(i&&(i+=" "),i+=n);return i}const h_=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=h_(t[i]))&&(n&&(n+=" "),n+=e);return n};function q7(t,...e){let n,i,r,s=l;function l(d){const f=e.reduce((p,m)=>m(p),t());return n=B7(f),i=n.cache.get,r=n.cache.set,s=u,u(d)}function u(d){const f=i(d);if(f)return f;const p=G7(d,n);return r(d,p),p}return function(){return s(V7.apply(null,arguments))}}const Un=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},f_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,K7=/^\d+\/\d+$/,W7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y7=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,X7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mc=t=>K7.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),Ka=t=>!!t&&Number.isInteger(Number(t)),Uv=t=>t.endsWith("%")&&vt(t.slice(0,-1)),ia=t=>W7.test(t),J7=()=>!0,e$=t=>Y7.test(t)&&!X7.test(t),m_=()=>!1,t$=t=>Q7.test(t),n$=t=>Z7.test(t),i$=t=>!Be(t)&&!He(t),r$=t=>Xc(t,v_,m_),Be=t=>f_.test(t),Go=t=>Xc(t,b_,e$),Bv=t=>Xc(t,c$,vt),VA=t=>Xc(t,g_,m_),s$=t=>Xc(t,x_,n$),Kf=t=>Xc(t,y_,t$),He=t=>p_.test(t),ld=t=>Qc(t,b_),a$=t=>Qc(t,u$),qA=t=>Qc(t,g_),o$=t=>Qc(t,v_),l$=t=>Qc(t,x_),Wf=t=>Qc(t,y_,!0),Xc=(t,e,n)=>{const i=f_.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},Qc=(t,e,n=!1)=>{const i=p_.exec(t);return i?i[1]?e(i[1]):n:!1},g_=t=>t==="position"||t==="percentage",x_=t=>t==="image"||t==="url",v_=t=>t==="length"||t==="size"||t==="bg-size",b_=t=>t==="length",c$=t=>t==="number",u$=t=>t==="family-name",y_=t=>t==="shadow",d$=()=>{const t=Un("color"),e=Un("font"),n=Un("text"),i=Un("font-weight"),r=Un("tracking"),s=Un("leading"),l=Un("breakpoint"),u=Un("container"),d=Un("spacing"),f=Un("radius"),p=Un("shadow"),m=Un("inset-shadow"),x=Un("text-shadow"),b=Un("drop-shadow"),w=Un("blur"),C=Un("perspective"),A=Un("aspect"),E=Un("ease"),k=Un("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[..._(),He,Be],T=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],M=()=>[He,Be,d],U=()=>[mc,"full","auto",...M()],D=()=>[Ka,"none","subgrid",He,Be],G=()=>["auto",{span:["full",Ka,He,Be]},Ka,He,Be],Z=()=>[Ka,"auto",He,Be],Q=()=>["auto","min","max","fr",He,Be],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...M()],V=()=>[mc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],O=()=>
vendor: 4,246 bytes, line 675
675[t,He,Be],X=()=>[..._(),qA,VA,{position:[He,Be]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",o$,r$,{size:[He,Be]}],H=()=>[Uv,ld,Go],P=()=>["","none","full",f,He,Be],J=()=>["",vt,ld,Go],he=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[vt,Uv,qA,VA],fe=()=>["","none",w,He,Be],se=()=>["none",vt,He,Be],pe=()=>["none",vt,He,Be],Ee=()=>[vt,He,Be],Ce=()=>[mc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ia],breakpoint:[ia],color:[J7],container:[ia],"drop-shadow":[ia],ease:["in","out","in-out"],font:[i$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ia],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ia],shadow:[ia],spacing:["px",vt],text:[ia],"text-shadow":[ia],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",mc,Be,He,A]}],container:["container"],columns:[{columns:[vt,Be,He,u]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Ka,"auto",He,Be]}],basis:[{basis:[mc,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,mc,"auto","initial","none",Be]}],grow:[{grow:["",vt,He,Be]}],shrink:[{shrink:["",vt,He,Be]}],order:[{order:[Ka,"first","last","none",He,Be]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}
vendor: 9,816 bytes, line 675
675],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,ld,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,He,Bv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Uv,Be]}],"font-family":[{font:[a$,Be,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,He,Be]}],"line-clamp":[{"line-clamp":[vt,"none",He,Bv]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",He,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",He,Go]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[vt,"auto",He,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ka,He,Be],radial:["",He,Be],conic:[Ka,He,Be]},l$,s$]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,He,Be]}],"outline-w":[{outline:["",vt,ld,Go]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",p,Wf,Kf]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",m,Wf,Kf]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[vt,Go]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",x,Wf,Kf]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[vt,He,Be]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[He,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,Be]}],filter:[{filter:["","none",He,Be]}],blur:[{blur:fe()}],brightness:[{brightness:[vt,He,Be]}],contrast:[{contrast:[vt,He,Be]}],"drop-shadow":[{"drop-shadow":["","none",b,Wf,Kf]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",vt,He,Be]}],"hue-rotate":[{"hue-rotate":[vt,He,Be]}],invert:[{invert:["",vt,He,Be]}],saturate:[{saturate:[vt,He,Be]}],sepia:[{sepia:["",vt,He,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",He,Be]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[vt,He,Be]}],"backdrop-contrast":[{"backdrop-contrast":[vt,He,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,He,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,He,Be]}],"backdrop-invert":[{"backdrop-invert":["",vt,He,Be]}],"backdrop-opacity":[{"backdrop-opacity":[vt,He,Be]}],"backdrop-saturate":[{"backdrop-saturate":[vt,He,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,He,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",He,Be]}],ease:[{ease:["linear","initial",E,He,Be]}],delay:[{delay:[vt,He,Be]}],animate:[{animate:["none",k,He,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,He,Be]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[He,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}
vendor: 5,432 bytes, line 675
675],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He,Be]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[vt,ld,Go,Bv]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},h$=q7(d$);function Fe(...t){return h$(Hc(t))}function yn({...t}){return o.jsx(Gj,{"data-slot":"dialog",...t})}function f$({...t}){return o.jsx(I6,{"data-slot":"dialog-trigger",...t})}function p$({...t}){return o.jsx(Vj,{"data-slot":"dialog-portal",...t})}function m$({className:t,...e}){return o.jsx(qj,{"data-slot":"dialog-overlay",className:Fe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function wn({className:t,children:e,showCloseButton:n=!0,...i}){return o.jsxs(p$,{"data-slot":"dialog-portal",children:[o.jsx(m$,{}),o.jsxs(Kj,{"data-slot":"dialog-content",className:Fe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 roun
675ded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...i,children:[e,n&&o.jsxs(Xj,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-muted-foreground hover:text-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(yr,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function An({className:t,...e}){return o.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2 text-center sm:text-left",t),...e})}function qn({className:t,...e}){return o.jsx("div",{"data-slot":"dialog-footer",className:Fe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function Sn({className:t,...e}){return o.jsx(Wj,{"data-slot":"dialog-title",className:Fe("text-foreground text-lg leading-none font-semibold",t),...e})}function In({className:t,...e}){return o.jsx(Yj,{"data-slot":"dialog-description",className:Fe("text-muted-foreground text-sm",t),...e})}var g$=Symbol.for("react.lazy"),Hp=qy[" use ".trim().toString()];function x$(t){return typeof t=="object"&&t!==null&&"then"in t}function w_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===g$&&"_payload"in t&&x$(t._payload)}function v$(t){const e=b$(t),n=v.forwardRef((i,r)=>{let{children:s,...l}=i;w_(s)&&typeof Hp=="function"&&(s=Hp(s._payload));const u=v.Children.toArray(s),d=u.find(w$);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}var Cw=v$("Slot");function b$(t){const e=v.forwardRef((n,i)=>{let{children:r,...s}=n;if(w_(r)&&typeof Hp=="function"&&(r=Hp(r._payload)),v.isValidElement(r)){const l=C$(r),u=S$(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var y$=Symbol("radix.slottable");function w$(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===y$}function S$(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function C$(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const KA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,WA=Hc,S_=(t,e)=>n=>{var i;if(e?.variants==null)return WA(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,l=Object.keys(r).map(f=>{const p=n?.[f],m=s?.[f];if(p===null)return null;const x=KA(p)||KA(m);return r[f][x]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,x]=p;return x===void 0||(f[m]=x),f},{}),d=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((f,p)=>{let{class:m,className:x,...b}=p;return Object.entries(b).every(w=>{let[C,A]=w;return Array.isArray(A)?A.includes({...s,...u}[C]):{...s,...u}[C]===A})?[...f,m,x]:f},[]);return WA(t,l,d,n?.class,n?.className)},E$=S_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground border-input text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ie({className:t,variant:e,size:n,asChild:i=!1,...r}){const s=i?Cw:"button";return o.jsx(s,{"data-slot":"button",className:Fe(E$({variant:e,size:n,className:t})),...r})}function Qe({className:t,type:e,...n}){return o.jsx("input",{type:e,"data-slot":"input",className:Fe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-input border-input h-9 w-full min-w-0 rounded-md border text-foreground px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 aria-invalid:border-destructive",t),...n})}var A$="Label",C_=v.forwardRef((t,e)=>o.jsx(Je.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));C_.displayName=A$;var k$=C_;function Xe({className:t,...e}){return o.jsx(k$,{"data-slot":"label",className:Fe("flex items-center gap-2 text-sm leading-none font-medium text-foreground select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 mb-1",t),...e})}const Re="https://dapi.archiveye.ai".replace(/\/+$/,"")||"http://localhost:3000",Or="https://dapi.archiveye.ai".replace(/\/+$/,"")||"http://localhost:8080",_e={AUTH_LOGIN:`${Re}
675/api/v1/auth/login`,AUTH_REGISTER:`${Re}/api/v1/auth/register`,AUTH_ME:`${Re}/api/v1/auth/me`,AUTH_REFRESH:`${Re}/api/v1/auth/refresh`,AUTH_FORGOT_PASSWORD:`${Re}/api/v1/auth/forgot-password`,AUTH_CHANGE_PASSWORD:`${Re}/api/v1/auth/change-password`,EMPLOYEE_REGENERATE_API_KEY:`${Re}/api/v1/employees/me/api-key/regenerate`,EMPLOYEE_UPDATE_PROFILE:`${Re}/api/v1/employees/me`,EMPLOYEE_STORAGE_USAGE:`${Re}/api/v1/employees/me/storage-usage`,PLANS_LIST:`${Re}/api/v1/subscriptions/plans`,SUBSCRIPTIONS_CHECKOUT:`${Re}/api/v1/subscriptions/checkout`,SUBSCRIPTIONS_CONFIRM_SESSION:`${Re}/api/v1/subscriptions/confirm-session`,SUBSCRIPTIONS_ME:`${Re}/api/v1/subscriptions/me`,SUBSCRIPTIONS_CANCEL:t=>`${Re}/api/v1/subscriptions/${t}`,SUBSCRIPTIONS_PORTAL:`${Re}/api/v1/subscriptions/portal`,FOLDERS:`${Re}/api/v1/folders`,FOLDERS_GENERAL:`${Re}/api/v1/folders/general`,FOLDERS_ONE:t=>`${Re}/api/v1/folders/${t}`,FOLDERS_DOCUMENT:(t,e)=>`${Re}/api/v1/folders/${t}/documents/${e}`,DOCUMENTS:`${Re}/api/v1/documents`,DOCUMENTS_SHARED_WITH_ME:`${Re}/api/v1/documents/shared-with-me`,DOCUMENTS_ONE:t=>`${Re}/api/v1/documents/${t}`,DOCUMENTS_DOWNLOAD:t=>`${Re}/api/v1/documents/${t}/download`,DOCUMENTS_CONTENT:t=>`${Re}/api/v1/documents/${t}/content`,DOCUMENTS_MEDIA:t=>`${Re}/api/v1/documents/${t}/media`,DOCUMENTS_UPLOAD:`${Re}/api/v1/documents/upload`,DOCUMENTS_UPLOAD_WEB:`${Re}/api/v1/documents/upload-web`,DOCUMENTS_REPROCESS:t=>`${Re}/api/v1/documents/${t}/reprocess`,WEB_CRAWL_MARKDOWN:`${Re}/api/v1/web/crawl/markdown`,TASKS:`${Re}/api/v1/tasks`,TASKS_SUMMARY:`${Re}/api/v1/tasks/summary`,TASKS_ONE:t=>`${Re}/api/v1/tasks/${t}`,TASKS_CANCEL:t=>`${Re}/api/v1/tasks/${t}/cancel`,TASKS_WEB_INGESTION:`${Re}/api/v1/tasks/web-ingestion`,TASKS_AUDIO_INGESTION:`${Re}/api/v1/tasks/audio`,TASKS_CLOUD_INGESTION:`${Re}/api/v1/tasks/cloud-ingestion`,OAUTH_CONFIG:`${Re}/api/v1/oauth/config`,OAUTH_GOOGLE_START:`${Re}/api/v1/oauth/google/start`,OAUTH_MICROSOFT_START:`${Re}/api/v1/oauth/microsoft/start`,OAUTH_CONNECTORS:`${Re}/api/v1/oauth/connectors`,OAUTH_DISCONNECT:t=>`${Re}/api/v1/oauth/connectors/${t}`,OAUTH_PICKER_TOKEN:t=>`${Re}/api/v1/oauth/connectors/${t}/picker-token`,OAUTH_SHAREPOINT_TOKEN:t=>`${Re}/api/v1/oauth/connectors/${t}/sharepoint-token`,COLLECTIONS:`${Re}/api/v1/collections`,COLLECTIONS_ONE:t=>`${Re}/api/v1/collections/${t}`,COLLECTIONS_SUSPEND:t=>`${Re}/api/v1/collections/${t}/suspend`,COLLECTIONS_ACTIVATE:t=>`${Re}/api/v1/collections/${t}/activate`,COLLECTIONS_DOCUMENTS:t=>`${Re}/api/v1/collections/${t}/documents`,COLLECTIONS_DOCUMENT_ONE:(t,e)=>`${Re}/api/v1/collections/${t}/documents/${e}`,COLLECTIONS_DOCUMENT_REPLACE:(t,e)=>`${Re}/api/v1/collections/${t}/documents/${e}/replace`,COLLECTIONS_REGENERATE_API_KEY:t=>`${Re}/api/v1/collections/${t}/regenerate-api-key`,PROCESSING_DOCUMENT:t=>`${Re}/api/v1/processing/documents/${t}`,PROCESSING_INDEX:`${Re}/api/v1/processing/index`,LOGIN:`${Or}/api/auth/signin`,REGISTER:"/api/auth/register",GOOGLE_AUTH:"/api/auth/google",APPLE_AUTH:"/api/auth/apple",RESET_PASSWORD:`${Or}/api/auth/reset_password`,AI_LIST:`${Or}/api/ai/list`,AI_LIST_PAGING:`${Or}/api/ai/list_paging`,AI_GET_FILES:t=>`${Or}/api/ai/get_files/${t}`,AI_ADD:`${Or}/api/ai/add`,AI_UPDATE:`${Or}/api/ai/update`,AI_GET_GENERAL_BY_EMPLOYEE:t=>`${Or}/api/ai/get_general_by_employee/${t}`,AI_UPLOAD_FILES:`${Or}/api/ai/uploadfiles`,AI_UPLOAD_ZIP:`${Or}/api/ai/uploadzip`,ORGANIZATION_GET:t=>`${Or}/api/organization/get/${t}`,EMPLOYEE_LIST:`${Re}/api/v1/employees`,EMPLOYEE_COLLEAGUES:`${Re}/api/v1/employees/colleagues`,EMPLOYEE_INVITE:`${Re}/api/v1/employees/invite`,SHARING_GROUPS:`${Re}/api/v1/sharing/groups`,SHARING_GROUP_MEMBERS:t=>`${Re}/api/v1/sharing/groups/${t}/members`,SHARING_GROUP_MEMBER:(t,e)=>`${Re}/api/v1/sharing/groups/${t}/members/${e}`,SHARING_DOCUMENT_SHARE_DIRECT:t=>`${Re}/api/v1/sharing/documents/${t}/share/direct`,SHARING_DOCUMENT_SHARE_GROUP:t=>`${Re}/api/v1/sharing/documents/${t}/share/group`,SHARING_DOCUMENT_REVOKE_DIRECT:(t,e)=>`${Re}/api/v1/sharing/documents/${t}/share/direct/${e}`,SHARING_DOCUMENT_REVOKE_GROUP:(t,e)=>`${Re}/api/v1/sharing/documents/${t}/share/group/${e}`,SHARING_DOCUMENT_ACCESS:t=>`${Re}/api/v1/sharing/documents/${t}/access`,SHARING_FOLDER_SHARE_DIRECT:t=>`${Re}/api/v1/sharing/folders/${t}/share/direct`,SHARING_FOLDER_SHARE_GROUP:t=>`${Re}/api/v1/sharing/folders/${t}/share/group`,SHARING_FOLDER_REVOKE_DIRECT:(t,e)=>`${Re}/api/v1/sharing/folders/${t}/share/direct/${e}`,SHARING_FOLDER_REVOKE_GROUP:(t,e)=>`${Re}/api/v1/sharing/folders/${t}/share/group/${e}`,SHARING_FOLDER_ACCESS:t=>`${Re}/api/v1/sharing/folders/${t}/access`,SHARING_COLLECTION_SHARE_DIRECT:t=>`${Re}/api/v1/sharing/collections/${t}/share/direct`,SHARING_COLLECTION_SHARE_GROUP:t=>`${Re}/api/v1/sharing/collections/${t}/share/group`,SHARING_COLLECTION_REVOKE_DIRECT:(t,e)=>`${Re}/api/v1/sharing/collections/${t}/share/direct/${e}`,SHARING_COLLECTION_REVOKE_GROUP:(t,e)=>`${Re}/api/v1/sharing/collections/${t}/share/group/${e}`,SHARING_COLLECTION_ACCESS:t=>`${Re}/api/v1/sharing/collections/${t}/access`};
675class jm extends Error{status;code;constructor(e,n,i){super(e),this.name="ApiError",this.status=n,this.code=i}}function E_(t){return t instanceof jm&&(t.status===401||t.status===403)}let Yf=null;async function N$(){const t=localStorage.getItem("user.refreshToken");return t?(Yf||(Yf=(async()=>{const e=await fetch(_e.AUTH_REFRESH,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!e.ok)return localStorage.removeItem("user.token"),localStorage.removeItem("user.refreshToken"),null;const n=await e.json();return n.accessToken?(localStorage.setItem("user.token",n.accessToken),n.refreshToken&&localStorage.setItem("user.refreshToken",n.refreshToken),n.accessToken):null})().finally(()=>{Yf=null})),Yf):null}async function YA(t,e){const{method:n="GET",jsonBody:i,formBody:r,formData:s,headers:l={}}=e||{},u={...l},d=localStorage.getItem("user.token");d&&(u.Authorization=`Bearer ${d}`);let f;return s?f=s:r?f=r:i&&(u["Content-Type"]="application/json",f=JSON.stringify(i)),fetch(t,{method:n,headers:u,body:f})}async function De(t,e){try{let n=await YA(t,e);if(n.status===401&&t!==_e.AUTH_LOGIN&&t!==_e.AUTH_REFRESH&&(await N$()?n=await YA(t,e):localStorage.removeItem("user.token")),!n.ok){const l=await n.json().catch(()=>({detail:`Errore HTTP ${n.status}: ${n.statusText}`})),u=l.message,d=Array.isArray(u)?u.join(", "):typeof u=="string"?u:void 0,f=typeof l.detail=="string"?l.detail:void 0,p=typeof l.code=="string"?l.code:void 0,m=[d,f].filter(Boolean).join(" — ");throw new jm(m||`Errore HTTP ${n.status}`,n.status,p)}const r=await n.text();return r?JSON.parse(r):null}catch(n){throw console.error("API Client Error:",n),n}}async function A_(t,e){return De(_e.AUTH_LOGIN,{method:"POST",jsonBody:{email:t,password:e}})}async function j$(t){return De(_e.AUTH_REGISTER,{method:"POST",jsonBody:t})}async function Id(){return De(_e.AUTH_ME,{method:"GET"})}async function _$(t){return De(_e.AUTH_FORGOT_PASSWORD,{method:"POST",jsonBody:{email:t}})}async function k_(t,e){await De(_e.AUTH_CHANGE_PASSWORD,{method:"POST",jsonBody:{oldPassword:t,newPassword:e}})}async function T$(t){return De(_e.EMPLOYEE_REGENERATE_API_KEY,{method:"POST",jsonBody:{currentPassword:t}})}async function N_(){return De(_e.EMPLOYEE_STORAGE_USAGE,{method:"GET"})}var j_={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},XA=ui.createContext&&ui.createContext(j_),R$=["attr","size","title"];function P$(t,e){if(t==null)return{};var n=D$(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function D$(t,e){if(t==null)return{};var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e.indexOf(i)>=0)continue;n[i]=t[i]}return n}function Gp(){return Gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Gp.apply(this,arguments)}function QA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Vp(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?QA(Object(n),!0).forEach(function(i){L$(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):QA(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function L$(t,e,n){return e=O$(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O$(t){var e=M$(t,"string");return typeof e=="symbol"?e:e+""}function M$(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function __(t){return t&&t.map((e,n)=>ui.createElement(e.tag,Vp({key:n},e.attr),__(e.child)))}function xl(t){return e=>ui.createElement(I$,Gp({attr:Vp({},t.attr)},e),__(t.child))}function I$(t){var e=n=>{var{attr:i,size:r,title:s}=t,l=P$(t,R$),u=r||n.size||"1em",d;
675return n.className&&(d=n.className),t.className&&(d=(d?d+" ":"")+t.className),ui.createElement("svg",Gp({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,l,{className:d,style:Vp(Vp({color:t.color||n.color},n.style),t.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&ui.createElement("title",null,s),t.children)};return XA!==void 0?ui.createElement(XA.Consumer,null,n=>e(n)):e(j_)}function z$(t){return xl({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(t)}function F$(t){return xl({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M436 480h-20V24c0-13.255-10.745-24-24-24H56C42.745 0 32 10.745 32 24v456H12c-6.627 0-12 5.373-12 12v20h448v-20c0-6.627-5.373-12-12-12zM128 76c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12h-40c-6.627 0-12-5.373-12-12V76zm0 96c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12h-40c-6.627 0-12-5.373-12-12v-40zm52 148h-40c-6.627 0-12-5.373-12-12v-40c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12zm76 160h-64v-84c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v84zm64-172c0 6.627-5.373 12-12 12h-40c-6.627 0-12-5.373-12-12v-40c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40zm0-96c0 6.627-5.373 12-12 12h-40c-6.627 0-12-5.373-12-12v-40c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40zm0-96c0 6.627-5.373 12-12 12h-40c-6.627 0-12-5.373-12-12V76c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v40z"},child:[]}]})(t)}function zd(t){return xl({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"},child:[]}]})(t)}function Fd(t){return xl({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(t)}function ZA(t){return xl({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(t)}function $$(){const{t}=Ye("auth"),{updateUser:e}=Ar(),[n,i]=v.useState(""),[r,s]=v.useState(""),[l,u]=v.useState(""),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[x,b]=v.useState(!1),w=async C=>{if(C.preventDefault(),r!==l){ee.error(t("changePassword.toast.mismatch"));return}if(r.length<8){ee.error(t("changePassword.toast.minLength"));return}if(n===r){ee.error(t("changePassword.toast.sameAsOld"));return}b(!0);try{await k_(n,r),e({changePassword:!1}),ee.success(t("changePassword.toast.success"))}catch(A){const E=A instanceof Error?A.message:t("changePassword.toast.error");ee.error(E)}finally{b(!1)}};return o.jsx(yn,{open:!0,children:o.jsxs(wn,{showCloseButton:!1,className:"sm:max-w-md",onPointerDownOutside:C=>C.preventDefault(),onEscapeKeyDown:C=>C.preventDefault(),children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("changePassword.title")}),o.jsx(In,{children:t("changePassword.description")})]}),o.jsxs("form",{onSubmit:w,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"old-password",children:t("changePassword.fields.oldPassword")}),o.jsxs("div",{className:"flex items-center border border-border rounded-md px-3 py-2 bg-background focus-within:ring-2 focus-within:ring-primary",children:[o.jsx(Qe,{id:"old-password",type:d?"text":"password",value:n,onChange:C=>i(C.target.value),placeholder:t("changePassword.placeholders.oldPassword"),className:"border-none bg-transparent shadow-none focus-visible:ring-0",required:!0,autoComplete:"current-password"}),o.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground p-1",onClick:()=>f(C=>!C),"aria-label":t(d?"changePassword.aria.hidePassword":"changePassword.aria.showPassword"),children:d?o.jsx(zd,{}):o.jsx(Fd,{})})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"new-password",children:t("changePassword.fields.newPassword")}),o.jsxs("div",{className:"flex items-center border border-border rounded-md px-3 py-2 bg-background focus-within:ring-2 focus-within:ring-primary",children:[o.jsx(Qe,{id:"new-password",type:p?"text":"password",value:r,onChange:C=>s(C.target.value),placeholder:t("changePassword.placeholders.newPassword"),className:"border-none bg-transparent shadow-none focus-visible:ring-0",required:!0,minLength:8,autoComplete:"new-password"}),o.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground p-1",onClick:()=>m(C=>!C),"aria-label":t(p?"changePassword.aria.hidePassword":"changePassword.aria.showPassword"),children:p?o.jsx(zd,{}):o.jsx(Fd,{})})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"confirm-password",children:t("changePassword.fields.confirmPassword")}
675),o.jsx(Qe,{id:"confirm-password",type:"password",value:l,onChange:C=>u(C.target.value),placeholder:t("changePassword.placeholders.confirmPassword"),className:"border border-border rounded-md",required:!0,minLength:8,autoComplete:"new-password"})]}),o.jsx(qn,{children:o.jsx(ie,{type:"submit",disabled:x,className:"w-full sm:w-auto",children:t(x?"changePassword.submit.loading":"changePassword.submit.default")})})]})]})})}const T_=v.createContext(void 0);function Ar(){const t=v.useContext(T_);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}function U$({children:t}){const[e,n]=v.useState(null),[i,r]=v.useState(!0);v.useEffect(()=>{const f=localStorage.getItem("user"),p=localStorage.getItem("user.token");if(f)try{const m=JSON.parse(f);p&&n(m)}catch(m){console.error("Error parsing stored user:",m),localStorage.removeItem("user")}r(!1)},[]);const s=f=>{n(f),localStorage.setItem("user",JSON.stringify(f))},l=f=>{n(p=>{if(!p)return p;const m={...p,...f};return localStorage.setItem("user",JSON.stringify(m)),m})},u=()=>{n(null),localStorage.removeItem("user"),localStorage.removeItem("user.token"),localStorage.removeItem("user.refreshToken"),localStorage.removeItem("user.name"),localStorage.removeItem("user.firstname"),localStorage.removeItem("user.surname"),localStorage.removeItem("user.email"),localStorage.removeItem("user.id"),localStorage.removeItem("user.phone"),localStorage.removeItem("user.role"),localStorage.removeItem("user.organizationId"),localStorage.removeItem("user.organizationName"),localStorage.removeItem("user.organizationType"),localStorage.removeItem("user.avatar")},d=!!e&&!!localStorage.getItem("user.token");return i?o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontSize:"1.2rem",color:"#666"},children:"Caricamento..."}):o.jsxs(T_.Provider,{value:{user:e,login:s,updateUser:l,logout:u,isAuthenticated:d},children:[t,e?.changePassword&&o.jsx($$,{})]})}function R_(t){return t!=null&&t.subscriberType==="ORGANIZATION"&&t.plan?.tier==="ENTERPRISE"}async function B$(){return De(_e.PLANS_LIST,{method:"GET"})}async function H$(t,e,n="year"){const i={planId:t,billingInterval:n};return e!=null&&(i.seatCount=e),De(_e.SUBSCRIPTIONS_CHECKOUT,{method:"POST",jsonBody:i})}async function G$(t){return De(_e.SUBSCRIPTIONS_CONFIRM_SESSION,{method:"POST",jsonBody:{sessionId:t}})}async function As(){return De(_e.SUBSCRIPTIONS_ME,{method:"GET"})}async function Ew(){return De(_e.SUBSCRIPTIONS_PORTAL,{method:"GET"})}async function V$(t){return De(_e.SUBSCRIPTIONS_CANCEL(t),{method:"DELETE"})}const q$=["/pricing","/billing/success","/billing/cancel"];function os({children:t}){const{t:e}=Ye("common"),{isAuthenticated:n,logout:i}=Ar(),s=Jr().pathname,l=q$.some(m=>s===m||s.startsWith(m+"/")),[u,d]=v.useState(!1),[f,p]=v.useState(null);return v.useEffect(()=>{if(!n)return;if(l){d(!0),p(!0);return}let m=!1;return As().then(x=>{m||(p(x!=null),d(!0))}).catch(x=>
675{if(!m){if(E_(x)){i(),d(!0);return}p(!1),d(!0)}}),()=>{m=!0}},[n,l,s]),n?l?o.jsx(o.Fragment,{children:t}):u?f?o.jsx(o.Fragment,{children:t}):o.jsx(Mb,{to:"/pricing",replace:!0}):o.jsx("div",{className:"flex justify-center items-center min-h-screen",children:o.jsx("p",{className:"text-muted-foreground animate-pulse",children:e("protectedRoute.loading")})}):o.jsx(Mb,{to:"/login",replace:!0})}function _m(t){return xl({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(t)}function Aw(t){return xl({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16ZM11 14V16H13V14H11ZM7 14V16H9V14H7ZM15 14V16H17V14H15Z"},child:[]}]})(t)}function ln({className:t,...e}){return o.jsx("div",{"data-slot":"card",className:Fe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function hn({className:t,...e}){return o.jsx("div",{"data-slot":"card-header",className:Fe("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...e})}function fn({className:t,...e}){return o.jsx("div",{"data-slot":"card-title",className:Fe("leading-none font-semibold text-foreground",t),...e})}function uo({className:t,...e}){return o.jsx("div",{"data-slot":"card-description",className:Fe("text-muted-foreground text-sm",t),...e})}function pn({className:t,...e}){return o.jsx("div",{"data-slot":"card-content",className:Fe("px-6",t),...e})}function rl({className:t,...e}){return o.jsx("div",{"data-slot":"card-footer",className:Fe("flex items-center px-6 [.border-t]:pt-6",t),...e})}const K$={theme:"system",setTheme:()=>null},P_=v.createContext(K$),nh=()=>{const t=v.useContext(P_);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};function si(){const{theme:t,setTheme:e}=nh(),[n,i]=v.useState(!1);if(v.useEffect(()=>{i(!0)},[]),!n)return o.jsxs(ie,{variant:"outline",size:"icon",children:[o.jsx(qb,{className:"h-[1.2rem] w-[1.2rem]"}),o.jsx("span",{className:"sr-only",children:"Toggle theme"})]});const r=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,s=()=>{e(r==="light"?"dark":"light")};return o.jsxs(ie,{variant:"outline",size:"icon",onClick:s,children:[o.jsx(qb,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx(s_,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function D_(t){const e=(t.organization?.email??"").trim().toLowerCase(),n=t.email.trim().toLowerCase();return!!(t.organization?.organizationType==="BUSINESS"&&e&&n===e)}function W$(t){return D_(t)}function JA(t,e){return e?D_(t)?"/choose-role":"/dashboard":"/pricing"}function Y$(){const{t}=Ye(["auth","common"]),e=Kn(),{isAuthenticated:n,login:i,logout:r}=Ar(),[s,l]=v.useState({email:"",password:""}),[u,d]=v.useState(!1),[f,p]=v.useState(!1),m=v.useRef(!1);v.useEffect(()=>{if(m.current)return;const C=localStorage.getItem("user.token");(n||C)&&(async()=>{try{const E=await Id(),k=await As().catch(()=>null);e(JA(E,k!=null),{replace:!0})}catch{r()}})()},[n,e]);const x=C=>{const{name:A,value:E}=C.target;l(k=>({...k,[A]:E}))},b=async C=>{if(C.preventDefault(),!s.email||!s.password){ee.error(t("login.toast.credentialsRequired"));return}p(!0);const A=A_(s.email,s.password).then(async E=>{m.current=!0,localStorage.setItem("user.token",E.accessToken),localStorage.setItem("user.refreshToken",E.refreshToken);const k=await Id();localStorage.setItem("user.id",k.id.toString()),localStorage.setItem("user.email",k.email),localStorage.setItem("user.n
675ame",`${k.firstname} ${k.surname}`),localStorage.setItem("user.firstname",k.firstname),localStorage.setItem("user.surname",k.surname),localStorage.setItem("user.role",k.role?.description??""),localStorage.setItem("user.organizationId",k.organizationId.toString()),k.organization?.name&&localStorage.setItem("user.organizationName",k.organization.name),k.organization?.organizationType&&localStorage.setItem("user.organizationType",k.organization.organizationType),k.avatar&&localStorage.setItem("user.avatar",k.avatar),i({id:k.id.toString(),email:k.email,fullName:`${k.firstname} ${k.surname}`,changePassword:E.changePassword??k.changePassword??!1});const N=await As().catch(()=>null);return e(JA(k,N!=null),{replace:!0}),E});ee.promise(A,{loading:t("login.toast.loading"),success:o.jsx("b",{children:t("login.toast.success")}),error:E=>{let k=t("login.toast.invalidCredentials");return E&&typeof E=="object"&&"message"in E&&typeof E.message=="string"&&(k=E.message),console.error("Login failed:",E),o.jsx("b",{children:k})}},{success:{duration:2500},error:{duration:5e3}}).finally(()=>{p(!1)})},w=s.email!==""&&s.password!=="";return o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsx("div",{className:"absolute top-0 right-0 w-[1000px] h-[600px] translate-x-1/4 -translate-y-1/4 rounded-full pointer-events-none"}),o.jsxs(ln,{className:"w-[560px] min-h-[580px] relative z-10",children:[o.jsxs(hn,{className:"text-center pb-6",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-[1.5625rem] font-semibold text-foreground",children:t("login.welcomeTitle")})]}),o.jsxs(pn,{children:[o.jsxs("form",{onSubmit:b,className:"flex flex-col gap-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"email",className:"block text-left text-[1.09375rem] font-medium text-foreground",children:t("login.emailLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.78125rem] py-[0.78125rem] bg-background focus-within:border-[#460B5D] focus-within:outline focus-within:outline-2 focus-within:outline-blue-100",children:[o.jsx("span",{className:"text-xl text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(_m,{})}),o.jsx(Qe,{id:"email",type:"email",name:"email",placeholder:t("login.emailPlaceholder"),value:s.email,onChange:x,className:"border-none outline-none flex-1 text-[1.09375rem] pl-[0.46875rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground",autoCapitalize:"none"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"password",className:"block text-left text-[1.09375rem] font-medium text-foreground",children:t("login.passwordLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.78125rem] py-[0.78125rem] bg-background focus-within:border-[#460B5D] focus-within:outline focus-within:outline-2 focus-within:outline-blue-100",children:[o.jsx("span",{className:"text-xl text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(Aw,{})}),o.jsx(Qe,{id:"password",type:u?"text":"password",name:"password",placeholder:t("login.passwordPlaceholder"),value:s.password,onChange:x,className:"border-none outline-none flex-1 text-[1.09375rem] pl-[0.46875rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground",autoCapitalize:"none"}),o.jsx("span",{className:"cursor-pointer text-xl ml-[0.46875rem] text-muted-foreground select-none transition-opacity hover:opacity-70 flex items-center",onClick:()=>d(C=>!C),children:u?o.jsx(zd,{}):o.jsx(Fd,{})})]})]}),o.jsx(ie,{type:"submit",disabled:!w||f,className:"w-full",children:t(f?"login.submitLoading":"login.submit")})]}),o.jsxs("p",{className:"mt-[1.875rem] text-[1.09375rem] text-muted-foreground text-center",children:[t("login.noAccount")," ",o.jsx(bi,{to:"/register",className:"text-primary font-semibold no-underline hover:underline",children:t("login.registerLink")})]}),o.jsx("p",{className:"mt-2 text-[1.09375rem] text-muted-foreground text-center",children:o.jsx(bi,{to:"/forgot-password",className:"text-link no-underline hover:underline",children:t("login.forgotPassword")})}),o.jsxs("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:[o.jsx(bi,{to:"/terms",className:"hover:underline",children:t("login.termsLink")})," · ",o.jsx(bi,{to:"/privacy",className:"hover:underline",children:t("login.privacyLink")})]})]})]})]})}function L_(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function O_(t){const[e,n]=v.useState(void 0);return zn(()=>
vendor: 4,273 bytes, line 675
675{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let l,u;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else n(void 0)},[t]),e}var Tm="Checkbox",[X$]=Er(Tm),[Q$,kw]=X$(Tm);function Z$(t){const{__scopeCheckbox:e,checked:n,children:i,defaultChecked:r,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:p="on",internal_do_not_use_render:m}=t,[x,b]=co({prop:n,defaultProp:r??!1,onChange:d,caller:Tm}),[w,C]=v.useState(null),[A,E]=v.useState(null),k=v.useRef(!1),N=w?!!l||!!w.closest("form"):!0,_={checked:x,disabled:s,setChecked:b,control:w,setControl:C,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:k,required:f,defaultChecked:so(r)?!1:r,isFormControl:N,bubbleInput:A,setBubbleInput:E};return o.jsx(Q$,{scope:e,..._,children:J$(m)?m(_):i})}var M_="CheckboxTrigger",I_=v.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...i},r)=>{const{control:s,value:l,disabled:u,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:w}=kw(M_,t),C=Et(r,p),A=v.useRef(d);return v.useEffect(()=>{const E=s?.form;if(E){const k=()=>m(A.current);return E.addEventListener("reset",k),()=>E.removeEventListener("reset",k)}},[s,m]),o.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":so(d)?"mixed":d,"aria-required":f,"data-state":H_(d),"data-disabled":u?"":void 0,disabled:u,value:l,...i,ref:C,onKeyDown:Pe(e,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Pe(n,E=>{m(k=>so(k)?!0:!k),w&&b&&(x.current=E.isPropagationStopped(),x.current||E.stopPropagation())})})});I_.displayName=M_;var z_=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:i,checked:r,defaultChecked:s,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=t;return o.jsx(Z$,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:u,required:l,onCheckedChange:f,name:i,form:p,value:d,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(I_,{...m,ref:e,__scopeCheckbox:n}),x&&o.jsx(B_,{__scopeCheckbox:n})]})})});z_.displayName=Tm;var F_="CheckboxIndicator",$_=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:i,...r}=t,s=kw(F_,n);return o.jsx(mi,{present:i||so(s.checked)||s.checked===!0,children:o.jsx(Je.span,{"data-state":H_(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e,style:{pointerEvents:"none",...t.style}})})});$_.displayName=F_;var U_="CheckboxBubbleInput",B_=v.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:i,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:x,setBubbleInput:b}=kw(U_,t),w=Et(n,b),C=L_(s),A=O_(i);v.useEffect(()=>{const k=x;if(!k)return;const N=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(N,"checked").set,T=!r.current;if(C!==s&&R){const L=new Event("click",{bubbles:T});k.indeterminate=so(s),R.call(k,so(s)?!1:s),k.dispatchEvent(L)}},[x,C,s,r]);const E=v.useRef(so(s)?!1:s);return o.jsx(Je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??E.current,required:u,disabled:d,name:f,value:p,form:m,...e,tabIndex:-1,ref:w,style:{...e.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});B_.displayName=U_;function J$(t){return typeof t=="function"}function so(t){return t==="indeterminate"}function H_(t){return so(t)?"indeterminate":t?"checked":"unchecked"}function On({className:t,...e}){return o.jsx(z_,{"data-slot":"checkbox",className:Fe("peer border-[#532B61] data-[state=checked]:bg-[#532B61] data-[state=checked]:text-primary-foreground data-[state=checked]:border-[#532B61] focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive w-4 h-4 shrink-0 rounded border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:o.jsx($_,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:o.jsx(Zi,{className:"w-[14.67px] h-[14.67px]"})})})}
675const G_={name:"Pura Digital S.r.l.",address:"Via Ponte dei Granili 24, 80146 Napoli, Italia",vat:"09624921210",email:"[email protected]",court:"Tribunale di Napoli"},Lc="2026-06-04",V_="https://data.archiveye.ai",ur=G_,eU={terms:{title:"Termini di Servizio — ArchivEye Data",lastUpdated:`Ultimo aggiornamento: ${Lc}`,intro:`I presenti Termini di Servizio ("Termini") regolano l'accesso e l'utilizzo della piattaforma ArchivEye Data ("Servizio"), erogata da ${ur.name}. Utilizzando il Servizio accetti integralmente questi Termini. Per il trattamento dei dati personali si applica la Privacy Policy del Servizio.`,backToRegister:"Torna alla registrazione",languageLabel:"Lingua",switchLanguage:"English",sections:[{id:"definitions",title:"1. Definizioni",body:`"Servizio" indica la piattaforma ArchivEye Data accessibile via web e API. "Account" è il profilo dell'utente registrato. "Organizzazione" è l'entità (personale o business) a cui è associato l'Account. "Contenuti utente" sono file, testi, metadati e URL che carichi o importi. "Collection" (knowledge base) è un insieme indicizzato di documenti per ricerca semantica o full-text. "Connettore" è un'integrazione (es. Google Drive, Microsoft SharePoint) che importa Contenuti utente. "Piano" è l'abbonamento con limiti di storage e funzionalità.`},{id:"provider",title:"2. Titolare del servizio e contatti",body:`Il Servizio è erogato da ${ur.name}, con sede in ${ur.address}, P.IVA ${ur.vat}. Per informazioni contrattuali e assistenza: ${ur.email}. Sito del Servizio: ${V_} (o l'URL equivalente indicato al momento dell'accesso).`},{id:"acceptance",title:"3. Accettazione e capacità",body:"Devi avere almeno 18 anni e la capacità giuridica di contrarre. Se registri un Account Business, dichiari di avere poteri per vincolare l'organizzazione. L'uso del Servizio dopo modifiche ai Termini costituisce accettazione delle modifiche pubblicate."},{id:"service",title:"4. Descrizione del Servizio",body:"ArchivEye Data consente di caricare o importare documenti, organizzarli in cartelle e collection, indicizzarli per ricerca semantica e full-text, arricchire metadati con strumenti AI, condividere risorse nell'ambito dell'organizzazione, collegare connettori cloud (Google Drive, SharePoint), effettuare crawl di siti web autorizzati, trascrivere file audio/video, e accedere alle funzionalità via API e server MCP per client compatibili (es. integrazioni ChatGPT). Le funzionalità disponibili dipendono dal Piano sottoscritto."},{id:"accounts",title:"5. Tipi di account",body:"Account Personal: workspace individuale senza obbligo di dati aziendali estesi. Account Business: organizzazione con più utenti (posti), ruoli e dati di fatturazione. L'amministratore dell'organizzazione può invitare o gestire dipendenti secondo le funzionalità del Piano Enterprise."},{id:"registration",title:"6. Registrazione e sicurezza",body:"Devi fornire informazioni veritiere e mantenere riservate le credenziali. Sei responsabile di ogni attività svolta tramite il tuo Account. Notifica immediatamente accessi non autorizzati a [email protected]."},{id:"plans",title:"7. Piani, limiti e abbonamenti",body:"I limiti di storage, utenti e funzionalità sono definiti dal Piano attivo. Gli abbonamenti a pagamento sono gestiti tramite Stripe (checkout, rinnovi, Customer Portal). In caso di mancato pagamento o superamento dei limiti, possiamo sospendere l'accesso o bloccare nuovi caricamenti fino alla regolarizzazione."},{id:"billing",title:"8. Prezzi, IVA e fatturazione",body:"I prezzi sono indicati sul sito o nel flusso di acquisto. Per i clienti UE possono applicarsi regole di IVA (incluso reverse charge B2B ove previsto); la gestione fiscale può avvenire tramite Stripe Tax. Le fatture sono emesse secondo i dati di fatturazione forniti e disponibili tramite Stripe ove configurato."},{id:"user-content",title:"9. Contenuti dell'utente",body:"Conservi tutti i diritti sui Contenuti utente. Concedi a Pura Digital una licenza non esclusiva, limitata al territorio UE e alla durata del contratto, per ospitare, elaborare, indicizzare, trascrivere e rendere disponibili i Contenuti al solo fine di erogare il Servizio. Sei l'unico responsabile della liceità dei Contenuti e del rispetto di diritti di terzi (copyright, privacy, segreti commerciali)."},{id:"acceptable-use",title:"10. Uso accettabile",body:"È vietato usare il Servizio per attività illecite, malware, spam, reverse engineering non consentito, aggiramento di quote o controlli di sicurezza, scraping non autorizzato di terzi, o caricamento di dati senza base giuridica. Possiamo rimuovere Contenuti manifestamente illeciti e sospendere Account in caso di violazione grave."},{id:"connectors",title:"11. Connettori OAuth (Google, Microsoft)",body:"Attivando un Connettore autorizzi l'accesso ai file selezionati secondo gli scope richiesti. I token OAuth sono conservati cifrati e revocabili dall'area connettori o dalle impostazioni del provider cloud. Pura Digital accede ai file cloud solo per importazione e sincronizzazione da te richiesta."},{id:"ai-services",title:"12. Servizi di intelligenza artificiale",body:"Il Servizio utilizza embedding self
675-hosted e pipeline di arricchimento metadati. Alcune operazioni possono invocare modelli linguistici tramite gateway interni (es. Pura LLM) quando configurato in infrastruttura: in tal caso si applicano anche i termini del servizio LLM per quanto riguarda l'inferenza. Gli output AI sono generati automaticamente e non costituiscono consulenza professionale."},{id:"sharing",title:"13. Condivisione interna",body:"Puoi condividere documenti e cartelle con altri utenti della stessa Organizzazione o gruppi configurati. Sei responsabile delle autorizzazioni concesse e dei dati personali di terzi presenti nei documenti condivisi."},{id:"availability",title:"14. Disponibilità e limitazione di responsabilità",body:`Il Servizio è fornito "così com'è", salvo diversa pattuizione scritta per clienti Enterprise. Non garantiamo disponibilità ininterrotta. Nei limiti consentiti dalla legge, Pura Digital non risponde di danni indiretti, perdita di profitto o inaccuratezza dei risultati di ricerca/AI. La responsabilità complessiva è limitata all'importo pagato per il Servizio nei 12 mesi precedenti l'evento, salvo dolo o colpa grave.`},{id:"termination",title:"15. Sospensione e risoluzione",body:"Puoi chiudere l'Account secondo le funzioni disponibili o contattando il supporto. Possiamo sospendere o risolvere il contratto per violazioni, insoluti o richieste delle autorità. Alla cessazione si applicano gli effetti di cui alla sezione successiva e la Privacy Policy."},{id:"effects",title:"16. Effetti della cessazione",body:"Alla chiusura dell'Account i Contenuti utente saranno eliminati entro i termini tecnici indicati nella Privacy Policy, salvo obblighi di conservazione legale (es. fatturazione). È tua cura esportare i dati prima della chiusura ove la funzione sia disponibile nel Piano."},{id:"changes",title:"17. Modifiche ai Termini",body:"Possiamo aggiornare i Termini pubblicando la nuova versione sul Servizio con data di efficacia. Per modifiche sostanziali daremo preavviso ragionevole (es. 30 giorni) ove possibile. L'uso continuato dopo la data di efficacia implica accettazione."},{id:"law",title:"18. Legge applicabile e foro",body:`I Termini sono regolati dalla legge italiana. Per ogni controversia relativa ai presenti Termini tra professionisti è competente in via esclusiva il ${ur.court}. Per i consumatori si applicano le norme inderogabili del paese di residenza ove previste.`},{id:"consumer",title:"19. Clienti consumatori e servizi digitali",body:"Per Account Personal con qualifica di consumatore, ove applicabile il Codice del Consumo: il recesso può essere escluso o limitato per contenuti digitali forniti su supporto non materiale se l'esecuzione è iniziata con consenso espresso e rinuncia al recesso, secondo art. 59 lett. o) e art. 63 del D.Lgs. 206/2005. Informazioni precontrattuali sono disponibili prima della sottoscrizione del Piano a pagamento."},{id:"communications",title:"20. Comunicazioni e reclami",body:`Comunicazioni contrattuali all'indirizzo email dell'Account o a ${ur.email}. Reclami: entro 30 giorni dall'evento, via email con descrizione e riferimenti Account.`}]},privacy:{title:"Privacy Policy — ArchivEye Data",lastUpdated:`Ultimo aggiornamento: ${Lc}`,intro:`La presente informativa descrive come ${ur.name} tratta i dati personali in relazione ad ArchivEye Data, ai sensi del Regolamento (UE) 2016/679 ("GDPR") e del D.Lgs. 196/2003 come modificato. Per i Termini di utilizzo del Servizio si rimanda ai Termini di Servizio.`,backToRegister:"Torna alla registrazione",languageLabel:"Lingua",switchLanguage:"English",sections:[{id:"controller",title:"1. Titolare del trattamento",body:`Titolare: ${ur.name}, ${ur.address}, P.IVA ${ur.vat}. Contatto privacy e diritti dell'interessato: ${ur.email}.`},{id:"roles",title:"2. Ruoli GDPR",body:"Per i dati dell'Account e dell'organizzazione Pura Digital agisce come titolare del trattamento. Se un cliente Business carica documenti contenenti dati personali di dipendenti o clienti terzi, il cliente può agire come titolare autonomo e Pura Digital come responsabile del trattamento: per tali casi è disponibile un Data Processing Agreement (DPA) su richiesta a [email protected]."}
675,{id:"categories",title:"3. Categorie di dati trattati",body:"Dati identificativi e di contatto (nome, cognome, email, ruolo); dati organizzazione (ragione sociale, P.IVA, indirizzo); credenziali e identificatori tecnici (JWT, ID Keycloak); Contenuti utente (file, testo estratto, chunk, embedding vettoriali in Qdrant, metadati); log di elaborazione e accesso; token OAuth cifrati per connettori cloud; dati di pagamento e fatturazione gestiti da Stripe (metadati cliente, non numeri di carta completi sul nostro DB)."},{id:"purposes",title:"4. Finalità e basi giuridiche",body:"Erogazione del Servizio e gestione Account (art. 6.1.b GDPR — contratto). Sicurezza, prevenzione abusi, log tecnici (art. 6.1.f — legittimo interesse). Fatturazione e obblighi fiscali (art. 6.1.c). Connettori cloud e funzioni opzionali: esecuzione su tua richiesta (contratto) o consenso revocabile tramite revoca OAuth. Non vendiamo dati personali."},{id:"recipients",title:"5. Destinatari e responsabili del trattamento",body:"Sub-responsabili e fornitori: Stripe (pagamenti); infrastruttura cloud AWS in regioni UE (hosting applicativo); Google LLC / Microsoft Corporation (solo se attivi connettori Drive o SharePoint); fornitori di modelli LLM per arricchimento metadati se abilitati in pipeline. Elenco aggiornato disponibile su richiesta. Personale autorizzato di Pura Digital con accesso limitato al minimo necessario."},{id:"transfers",title:"6. Trasferimenti extra-UE",body:"I dati principali del Servizio sono ospitati nell'UE. L'attivazione di connettori Google/Microsoft o l'uso di servizi AI con sede extra-UE può comportare trasferimenti verso Paesi terzi: tali fornitori applicano Clausole Contrattuali Standard o equivalenti previsti dal GDPR. Puoi limitare i trasferimenti non attivando tali integrazioni."},{id:"retention",title:"7. Periodi di conservazione",body:"Dati Account: per la durata del contratto e fino a 24 mesi dopo la chiusura per obblighi o contestazioni, salvo periodi maggiori di legge. Contenuti utente: fino a cancellazione da parte dell'utente o chiusura Account, poi eliminazione da storage e indici entro 90 giorni salvo backup di disaster recovery sovrascritti ciclicamente. Log tecnici: tipicamente 12 mesi. Dati fatturazione Stripe: secondo policy Stripe e obblighi fiscali (fino a 10 anni ove richiesto)."},{id:"security",title:"8. Misure di sicurezza",body:"Cifratura dei token OAuth a riposo; segregazione logica per organizzazione; comunicazioni HTTPS; controllo accessi su API e MCP con autenticazione OIDC/JWT; backup crittografati su infrastruttura EU. Nessuna misura è infallibile: segnala incidenti a [email protected]."},{id:"rights",title:"9. Diritti dell'interessato",body:"Hai diritto di accesso, rettifica, cancellazione, limitazione, portabilità (ove applicabile), opposizione per trattamenti basati su legittimo interesse, e revoca del consenso senza pregiudicare la liceità precedente. Puoi proporre reclamo al Garante per la protezione dei dati personali (www.garanteprivacy.it). Richieste: [email protected] con prova di identità."},{id:"cookies",title:"10. Cookie e storage locale",body:"Utilizziamo cookie tecnici e storage locale (es. token di sessione) necessari al funzionamento. Non utilizziamo cookie di profilazione o analytics di terze parti nell'applicazione web al momento della presente policy. Puoi gestire i cookie dal browser."},{id:"minors",title:"11. Minori",body:"Il Servizio non è destinato a minori di 16 anni. Non raccogliamo consapevolmente dati di minori: contattaci per la cancellazione se ritieni che ciò sia avvenuto."},{id:"mcp",title:"12. Integrazioni MCP e app terze",body:"L'accesso via MCP (es. client ChatGPT) avviene solo dopo autenticazione OAuth con i tuoi permessi. I tool esposti operano sulle tue collection e non pubblicano su internet. I dati trattati restano nel perimetro del tuo Account."},{id:"whisper",title:"13. Trascrizione audio (Whisper)",body:"I file audio/video inviati per trascrizione sono elaborati temporaneamente dal servizio Whisper interno; il testo trascritto può essere conservato come Contenuto utente se confermi il salvataggio. Non utilizziamo le registrazioni per addestrare modelli pubblici di terzi."},{id:"crawl",title:"14. Web crawl e ricerca web",body:"Se utilizzi l'ingestion da URL o metasearch (SearXNG), i contenuti recuperati s
675ono associati al tuo Account e trattati come Contenuti utente. Sei responsabile di avere titolo a indicizzare tali URL."},{id:"updates",title:"15. Aggiornamenti",body:"Possiamo aggiornare questa informativa pubblicando la nuova versione con data di revisione. Ti invitiamo a consultarla periodicamente."}]}},dr=G_,tU={terms:{title:"Terms of Service — ArchivEye Data",lastUpdated:`Last updated: ${Lc}`,intro:`These Terms of Service ("Terms") govern access to and use of the ArchivEye Data platform ("Service"), provided by ${dr.name}. By using the Service you agree to these Terms in full. Personal data processing is described in the Service Privacy Policy.`,backToRegister:"Back to registration",languageLabel:"Language",switchLanguage:"Italiano",sections:[{id:"definitions",title:"1. Definitions",body:'"Service" means the ArchivEye Data platform available via web and APIs. "Account" is your registered user profile. "Organization" is the entity (personal or business) linked to the Account. "User Content" means files, text, metadata and URLs you upload or import. "Collection" (knowledge base) is an indexed set of documents for semantic or full-text search. "Connector" is an integration (e.g. Google Drive, Microsoft SharePoint) that imports User Content. "Plan" is the subscription with storage limits and features.'},{id:"provider",title:"2. Service provider and contacts",body:`The Service is provided by ${dr.name}, ${dr.address}, VAT ${dr.vat}. Contract and support: ${dr.email}. Service website: ${V_} (or the equivalent URL shown at access time).`},{id:"acceptance",title:"3. Acceptance and capacity",body:"You must be at least 18 and legally able to contract. If you register a Business Account, you represent that you have authority to bind the organization. Continued use after Terms changes constitutes acceptance of the published version."},{id:"service",title:"4. Service description",body:"ArchivEye Data lets you upload or import documents, organize them in folders and collections, index them for semantic and full-text search, enrich metadata with AI tools, share resources within your organization, connect cloud connectors (Google Drive, SharePoint), crawl authorized websites, transcribe audio/video, and access features via API and MCP servers for compatible clients (e.g. ChatGPT integrations). Available features depend on your subscribed Plan."},{id:"accounts",title:"5. Account types",body:"Personal Account: individual workspace without extended company data. Business Account: organization with multiple users (seats), roles and billing data. Organization administrators may invite or manage employees per Enterprise Plan features."},{id:"registration",title:"6. Registration and security",body:"You must provide accurate information and keep credentials confidential. You are responsible for activity under your Account. Report unauthorized access promptly to [email protected]."},{id:"plans",title:"7. Plans, limits and subscriptions",body:"Storage, user and feature limits are defined by the active Plan. Paid subscriptions are managed via Stripe (checkout, renewals, Customer Portal). On non-payment or limit exceedance we may suspend access or block new uploads until resolved."},{id:"billing",title:"8. Pricing, VAT and invoicing",body:"Prices are shown on the site or checkout flow. EU VAT rules may apply (including B2B reverse charge where applicable); tax handling may use Stripe Tax. Invoices are issued per billing details provided and available via Stripe where configured."},{id:"user-content",title:"9. User Content",body:"You retain all rights in User Content. You grant Pura Digital a non-exclusive licence limited to the EU and contract duration to host, process, index, transcribe and make Content available solely to provide the Service. You are solely responsible for lawfulness of Content and third-party rights (copyright, privacy, trade secrets)."},{id:"acceptable-use",title:"10. Acceptable use",body:"You must not use the Service for unlawful activity, malware, spam, unauthorized reverse engineering, circumventing quotas or security, unauthorized third-party scraping, or uploading data without legal basis. We may remove manifestly unlawful Content and suspend Accounts for serious breaches."},{id:"connectors",title:"11. OAuth connectors (Google, Microsoft)",body:"Enabling a Connector authorizes access to selected files per requested scopes. OAuth tokens are stored encrypted and revocable from the connector area or cloud provider settings. Pura Digital accesses cloud files only for import/sync you request."},{id:"ai-services",title:"12. Artificial intelligence services",body:"The Service uses self-hosted embeddings and metadata enrichment pipelines. Some operations may call language models via internal gateways (e.g. Pura LLM) when configured in infrastru
675cture; LLM service terms apply to inference in that case. AI outputs are automated and not professional advice."},{id:"sharing",title:"13. Internal sharing",body:"You may share documents and folders with other users in the same Organization or configured groups. You are responsible for permissions granted and personal data of third parties in shared documents."},{id:"availability",title:"14. Availability and limitation of liability",body:'The Service is provided "as is" unless otherwise agreed in writing for Enterprise customers. We do not guarantee uninterrupted availability. To the extent permitted by law, Pura Digital is not liable for indirect damages, lost profits or inaccuracy of search/AI results. Aggregate liability is capped at fees paid for the Service in the 12 months before the event, except fraud or gross negligence.'},{id:"termination",title:"15. Suspension and termination",body:"You may close your Account via available features or support contact. We may suspend or terminate for breaches, non-payment or authority requests. Effects below and the Privacy Policy apply on termination."},{id:"effects",title:"16. Effects of termination",body:"On Account closure User Content will be deleted within technical timelines in the Privacy Policy, except legal retention (e.g. billing). Export data before closure where your Plan provides export."},{id:"changes",title:"17. Changes to Terms",body:"We may update Terms by publishing a new version on the Service with effective date. For material changes we will give reasonable notice (e.g. 30 days) where possible. Continued use after the effective date implies acceptance."},{id:"law",title:"18. Governing law and jurisdiction",body:`These Terms are governed by Italian law. For disputes between professionals, the exclusive court is ${dr.court}. For consumers, mandatory rules of the country of residence apply where provided by law.`},{id:"consumer",title:"19. Consumers and digital services",body:"For Personal Accounts qualifying as consumers, where applicable under Italian Consumer Code: withdrawal may be excluded or limited for digital content not on a tangible medium if performance started with express consent and waiver of withdrawal under Arts. 59(o) and 63 of Legislative Decree 206/2005. Pre-contractual information is available before subscribing to a paid Plan."},{id:"communications",title:"20. Communications and complaints",body:`Contract notices to Account email or ${dr.email}. Complaints: within 30 days of the event, by email with Account references.`}]},privacy:{title:"Privacy Policy — ArchivEye Data",lastUpdated:`Last updated: ${Lc}`,intro:`This notice describes how ${dr.name} processes personal data in connection with ArchivEye Data under Regulation (EU) 2016/679 ("GDPR") and Italian Privacy Code as amended. For Service use terms see the Terms of Service.`,backToRegister:"Back to registration",languageLabel:"Language",switchLanguage:"Italiano",sections:[{id:"controller",title:"1. Data controller",body:`Controller: ${dr.name}, ${dr.address}, VAT ${dr.vat}. Privacy and data subject requests: ${dr.email}.`},{id:"roles",title:"2. GDPR roles",body:"For Account and organization data Pura Digital is controller. If a Business customer uploads documents with employees' or clients' personal data, the customer may be an independent controller and Pura Digital a processor — a Data Processing Agreement (DPA) is available on request at [email protected]."},{id:"categories",title:"3. Categories of data",body:"Identity and contact data (name, surname, email, role); organization data (company name, VAT, address); credentials and technical IDs (JWT, Keycloak ID); User Content (files, extracted text, chunks, vector embeddings in Qdrant, metadata); processing and access logs; encrypted OAuth tokens for cloud connectors; payment and billing metadata via Stripe (customer metadata, not full card numbers on our DB)."},{id:"purposes",title:"4. Purposes and legal bases",body:"Service delivery and Account management (Art. 6(1)(b) GDPR — contract). Security, abuse prevention, technical logs (Art. 6(1)(f) — legitimate interest). Billing and legal obligations (Art. 6(1)(c)). Cloud connectors and optional features: on your request (contract) or revocable consent via OAuth revocation. We do not sell personal data."},{id:"recipients",title:"5. Recipients and processors",body:"Sub-processors and suppliers: Stripe (payments);
675 AWS cloud infrastructure in EU regions (application hosting); Google LLC / Microsoft Corporation (only if you enable Drive or SharePoint connectors); LLM providers for metadata enrichment if enabled in pipeline. Updated list on request. Authorized Pura Digital staff with minimum necessary access."},{id:"transfers",title:"6. Transfers outside the EU",body:"Core Service data is hosted in the EU. Enabling Google/Microsoft connectors or non-EU AI services may involve transfers to third countries; those providers use Standard Contractual Clauses or equivalent GDPR mechanisms. You can limit transfers by not enabling such integrations."},{id:"retention",title:"7. Retention periods",body:"Account data: for contract duration and up to 24 months after closure for obligations or disputes, unless longer required by law. User Content: until you delete or close Account, then removal from storage and indexes within 90 days except disaster-recovery backups overwritten cyclically. Technical logs: typically 12 months. Stripe billing data: per Stripe policy and tax law (up to 10 years where required)."},{id:"security",title:"8. Security measures",body:"Encryption of OAuth tokens at rest; logical segregation per organization; HTTPS; API/MCP access control with OIDC/JWT; encrypted backups on EU infrastructure. No measure is perfect — report incidents to [email protected]."},{id:"rights",title:"9. Data subject rights",body:"You have rights of access, rectification, erasure, restriction, portability (where applicable), objection to legitimate-interest processing, and withdrawal of consent without affecting prior lawful processing. You may lodge a complaint with the Italian Data Protection Authority (www.garanteprivacy.it). Requests: [email protected] with identity proof."},{id:"cookies",title:"10. Cookies and local storage",body:"We use technical cookies and local storage (e.g. session tokens) required for operation. We do not use profiling or third-party analytics cookies in the web app at the time of this policy. You may manage cookies in your browser."},{id:"minors",title:"11. Minors",body:"The Service is not directed at under-16s. We do not knowingly collect minors' data — contact us for deletion if you believe this occurred."},{id:"mcp",title:"12. MCP and third-party apps",body:"MCP access (e.g. ChatGPT clients) requires OAuth authentication with your permissions. Exposed tools operate on your collections and do not publish to the public internet. Data remains within your Account perimeter."},{id:"whisper",title:"13. Audio transcription (Whisper)",body:"Audio/video files sent for transcription are processed temporarily by the internal Whisper service; transcribed text may be stored as User Content if you confirm save. We do not use recordings to train public third-party models."},{id:"crawl",title:"14. Web crawl and web search",body:"If you use URL ingestion or metasearch (SearXNG), retrieved content is linked to your Account and treated as User Content. You must have legal right to index those URLs."},{id:"updates",title:"15. Updates",body:"We may update this notice by publishing a new version with revision date. Please review it periodically."}]}},nU={it:eU,en:tU};function iU(t,e){return nU[t][e]}const q_={email:"",password:"",firstname:"",surname:""},rU={...q_,organizationName:"",organizationEmail:"",organizationVat:"",organizationAddress:"",organizationZipCode:"",organizationCity:"",organizationProvince:"",organizationCountry:""};function sU(){const{t}=Ye(["auth","common"]),e=Kn(),[n]=ym(),{login:i}=Ar(),r=n.get("type")==="business",[s,l]=v.useState(()=>r?"form":"choose"),[u,d]=v.useState(()=>r?"business":null),[f,p]=v.useState(q_),[m,x]=v.useState(rU),[b,w]=v.useState(!1),[C,A]=v.useState(!1),[E,k]=v.useState(!1),[N,_]=v.useState(!1),R=u==="business"?m:f,T=K=>{const{name:q,value:F}=K.target;if(u==="business"){x(V=>({...V,[q]:F}));return}p(V=>({...V,[q]:F}))},L=K=>{d(K),l("form")},M=()=>{l("choose"),d(null)},U=async(K,q)=>{localStorage.setItem("user.token",K),localStorage.setItem("user.refreshToken",q);const F=await Id();localStorage.setItem("user.id",F.id.toString()),localStorage.setItem("user.email",F.email),localStorage.setItem("user.n
675ame",`${F.firstname} ${F.surname}`),localStorage.setItem("user.firstname",F.firstname),localStorage.setItem("user.surname",F.surname),localStorage.setItem("user.role",F.role?.description??""),localStorage.setItem("user.organizationId",F.organizationId.toString()),F.organization?.name&&localStorage.setItem("user.organizationName",F.organization.name),F.organization?.organizationType&&localStorage.setItem("user.organizationType",F.organization.organizationType),F.avatar&&localStorage.setItem("user.avatar",F.avatar),i({id:F.id.toString(),email:F.email,fullName:`${F.firstname} ${F.surname}`}),ee.success(t("register.toast.success")),e("/pricing",{replace:!0,state:{from:"registration"}})},D=()=>{if(u==="business"){const q=m;return{accountType:"business",email:q.email,password:q.password,firstname:q.firstname,surname:q.surname,acceptTerms:!0,acceptPrivacy:!0,legalConsentVersion:Lc,registeredApplicationId:1,organizationName:q.organizationName,organizationEmail:q.organizationEmail||void 0,organizationVat:q.organizationVat||void 0,organizationAddress:q.organizationAddress||void 0,organizationZipCode:q.organizationZipCode||void 0,organizationCity:q.organizationCity||void 0,organizationProvince:q.organizationProvince||void 0,organizationCountry:q.organizationCountry||void 0}}return{accountType:"personal",email:f.email,password:f.password,firstname:f.firstname,surname:f.surname,acceptTerms:!0,acceptPrivacy:!0,legalConsentVersion:Lc,registeredApplicationId:1}},G=async K=>{if(K.preventDefault(),u==="business"&&!m.organizationName.trim()){ee.error(t("register.toast.organizationNameRequired"));return}if(!E){ee.error(t("register.toast.acceptTermsRequired"));return}if(!N){ee.error(t("register.toast.acceptPrivacyRequired"));return}if(!R.email||!R.password||!R.firstname||!R.surname){ee.error(t("register.toast.requiredFields"));return}A(!0);const q=j$(D()).then(async F=>(await U(F.accessToken,F.refreshToken),F));ee.promise(q,{loading:t("register.toast.creating"),success:o.jsx("b",{children:t("register.toast.accountCreated")}),error:F=>{const V=F&&typeof F=="object"&&"message"in F&&typeof F.message=="string"?F.message:t("register.toast.error");return console.error("Registration failed:",F),o.jsx("b",{children:V})}}).finally(()=>A(!1))},Z=R.email!==""&&R.password!==""&&R.firstname!==""&&R.surname!==""&&E&&N&&(u!=="business"||m.organizationName.trim()!=="");if(s==="choose")return o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden py-10",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto mb-3"}),o.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t("register.choose.title")}),o.jsx("p",{className:"text-muted-foreground mt-1",children:t("register.choose.subtitle")})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs(ln,{className:"cursor-pointer transition-all hover:border-primary hover:shadow-md",onClick:()=>L("personal"),children:[o.jsx(hn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:o.jsx(T7,{className:"h-8 w-8 text-primary"})}),o.jsx(fn,{className:"text-lg",children:t("register.choose.personal.title")})]})}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("register.choose.personal.description")}),o.jsx(ie,{className:"mt-4 w-full",variant:"outline",children:t("register.choose.personal.cta")})]})]}),o.jsxs(ln,{className:"cursor-pointer transition-all hover:border-primary hover:shadow-md",onClick:()=>L("business"),children:[o.jsx(hn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:o.jsx(n8,{className:"h-8 w-8 text-primary"})}),o.jsx(fn,{className:"text-lg",children:t("register.choose.business.title")})]})}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("register.choose.business.description")}),o.jsx(ie,{className:"mt-4 w-full",variant:"outline",children:t("register.choose.business.cta")})]})]})]}),o.jsxs("p",{className:"text-center text-muted-foreground",children:[t("register.choose.hasAccount")," ",o.jsx(bi,{to:"/login",className:"text-primary font-semibold no-underline hover:underline",children:t("register.choose.loginLink")})]})]})]});const Q=u==="business";return o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden py-10",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs(ln,{className:"w-[560px] max-w-full relative z-10",children:[o.jsxs(hn,{className:"text-center pb-6",children:[o.jsxs(ie,{variant:"ghost",size:"sm",className:"absolute left-6 top-6 text-muted-foreground",onClick:M,type:"button",children:[o.jsx(z$,{className:"mr-1"})," ",t("register.form.back")]}),o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-[1.5625rem] font-semibold text-foreground",children:t(Q?"register.form.titleBusiness":"register.form.titlePersonal")}),o.jsx("p",{className:"text-muted-foreground",children:t(Q?"register.form.subtitleBusiness":"register.form.subtitlePersonal")})]}),o.jsxs(pn,{children:[o.jsxs("form",{onSubmit:G,className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"firstname",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.firstname")}
675),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.7rem] py-[0.6rem] bg-background focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",children:[o.jsx("span",{className:"text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(ZA,{})}),o.jsx(Qe,{id:"firstname",name:"firstname",placeholder:t("register.form.placeholders.firstname"),value:R.firstname,onChange:T,className:"border-none outline-none flex-1 text-[1rem] pl-[0.4rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"surname",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.surname")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.7rem] py-[0.6rem] bg-background focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",children:[o.jsx("span",{className:"text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(ZA,{})}),o.jsx(Qe,{id:"surname",name:"surname",placeholder:t("register.form.placeholders.surname"),value:R.surname,onChange:T,className:"border-none outline-none flex-1 text-[1rem] pl-[0.4rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground"})]})]})]}),Q&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"border-t border-border pt-4 mt-2",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[o.jsx(F$,{})," ",t("register.form.fields.companyData")]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationName",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.organizationName")}),o.jsx(Qe,{id:"organizationName",name:"organizationName",placeholder:t("register.form.placeholders.organizationName"),value:m.organizationName,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationEmail",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.organizationEmail")}),o.jsx(Qe,{id:"organizationEmail",name:"organizationEmail",type:"email",placeholder:t("register.form.placeholders.organizationEmail"),value:m.organizationEmail,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationVat",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.organizationVat")}),o.jsx(Qe,{id:"organizationVat",name:"organizationVat",placeholder:t("register.form.placeholders.organizationVat"),value:m.organizationVat,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationCity",className:"block text-left text-[0.9rem] font-medium text-foreground",children:t("register.form.fields.city")}),o.jsx(Qe,{id:"organizationCity",name:"organizationCity",placeholder:t("register.form.placeholders.city"),value:m.organizationCity,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationZipCode",className:"block text-left text-[0.9rem] font-medium text-foreground",children:t("register.form.fields.zipCode")}),o.jsx(Qe,{id:"organizationZipCode",name:"organizationZipCode",placeholder:t("register.form.placeholders.zipCode"),value:m.organizationZipCode,onChange:T,className:"border border-border rounded-[0.625rem]"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationAddress",className:"block text-left text-[0.9rem] font-medium text-foreground",children:t("register.form.fields.address")}),o.jsx(Qe,{id:"organizationAddress",name:"organizationAddress",placeholder:t("register.form.placeholders.address"),value:m.organizationAddress,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationProvince",className:"block text-left text-[0.9rem] font-medium text-foreground",children:t("register.form.fields.province")}),o.jsx(Qe,{id:"organizationProvince",name:"organizationProvince",placeholder:t("register.form.placeholders.province"),value:m.organizationProvince,onChange:T,className:"border border-border rounded-[0.625rem]"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"organizationCountry",className:"block text-left text-[0.9rem] font-medium text-foreground",children:t("register.form.fields.country")}),o.jsx(Qe,{id:"organizationCountry",name:"organizationCountry",placeholder:t("register.form.placeholders.country"),value:m.organizationCountry,onChange:T,className:"border border-border rounded-[0.625rem]"})]})]})]})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"email",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.email")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.7rem] py-[0.6rem] bg-background focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",children:[o.jsx("span",{className:"text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(_m,{})}),o.jsx(Qe,{id:"email",type:"email",name:"email",placeholder:t("register.form.placeholders.email"),value:R.email,onChange:T,className:"border-none outline-none flex-1 text-[1rem] pl-[0.4rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground",autoCapitalize:"none"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"password",className:"block text-left text-[0.95rem] font-medium text-foreground",children:t("register.form.fields.password")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.7rem] py-[0.6rem] bg-background focus-within:border-primary focus-within:ring-1 focus-within:ring-primary",children:[o.jsx("span",{className:"text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(Aw,{})}),o.jsx(Qe,{id:"password",type:b?"text":"password",name:"password",placeholder:t("register.form.placeholders.password"),value:R.password,onChange:T,className:"border-none outline-none flex-1 text-[1rem] pl-[0.4rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground",autoCapitalize:"none"}),o.jsx("span",{className:"cursor-pointer text-xl ml-[0.4rem] text-muted-foreground select-none transition-opacity hover:opacity-70 flex items-center",onClick:()=>w(K=>!K),children:b?o.jsx(zd,{}):o.jsx(Fd,{})})]})]}),o.jsxs("div",{className:"space-y-3 pt-1",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(On,{id:"acceptTerms",checked:E,onCheckedChange:K=>k(K===!0)}),o.jsxs(Xe,{htmlFor:"acceptTerms",className:"text-sm font-normal leading-snug cursor-pointer",children:[t("register.legal.acceptTermsPrefix")," ",o.jsx(bi,{to:"/terms",className:"text-primary font-semibold hover:underline",target:"_blank",children:t("register.legal.termsLink")})]})]}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(On,{id:"acceptPrivacy",checked:N,onCheckedChange:K=>_(K===!0)}),o.jsxs(Xe,{htmlFor:"acceptPrivacy",className:"text-sm font-normal leading-snug cursor-pointer",children:[t("register.legal.acceptPrivacyPrefix")," ",o.jsx(bi,{to:"/privacy",className:"text-primary font-semibold hover:underline",target:"_blank",children:t("register.legal.privacyLink")})]})]})]}),o.jsx(ie,{type:"submit",disabled:!Z||C,className:"w-full mt-2 py-6 text-lg",children:t(C?"register.form.submit.loading":"register.form.submit.default")})]}),o.jsxs("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:[o.jsx(bi,{to:"/terms",className:"hover:underline",children:t("register.legal.legalFooter")})," · ",o.jsx(bi,{to:"/privacy",className:"hover:underline",children:t("register.legal.legalFooterPrivacy")})]}),o.jsxs("p",{className:"mt-6 text-[1rem] text-muted-foreground text-center",children:[t("register.choose.hasAccount")," ",o.jsx(bi,{to:"/login",className:"text-primary font-semibold no-underline hover:underline",children:t("register.choose.loginLink")})]})]})]})]})}function K_(t){return typeof t=="object"&&t!==null&&"from"in t&&t.from==="profile"}function aU(t){if(!K_(t))return null;const e=t.returnTo;return typeof e=="string"?e:null}const oU=S_("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-green-100 text-green-800 [a&]:hover:bg-green-200",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ci({className:t,variant:e,asChild:n=!1,...i}){const r=n?Cw:"span";return o.jsx(r,{"data-slot":"badge",className:Fe(oU({variant:e}),t),...i})}function ek(t){const e=lU(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(uU);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function lU(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;
vendor: 4,514 bytes, line 675
675if(v.isValidElement(r)){const l=hU(r),u=dU(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var cU=Symbol("radix.slottable");function uU(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===cU}function dU(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function hU(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Nw(t){const e=t+"CollectionProvider",[n,i]=Er(e),[r,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=C=>{const{scope:A,children:E}=C,k=ui.useRef(null),N=ui.useRef(new Map).current;return o.jsx(r,{scope:A,itemMap:N,collectionRef:k,children:E})};l.displayName=e;const u=t+"CollectionSlot",d=ek(u),f=ui.forwardRef((C,A)=>{const{scope:E,children:k}=C,N=s(u,E),_=Et(A,N.collectionRef);return o.jsx(d,{ref:_,children:k})});f.displayName=u;const p=t+"CollectionItemSlot",m="data-radix-collection-item",x=ek(p),b=ui.forwardRef((C,A)=>{const{scope:E,children:k,...N}=C,_=ui.useRef(null),R=Et(A,_),T=s(p,E);return ui.useEffect(()=>(T.itemMap.set(_,{ref:_,...N}),()=>void T.itemMap.delete(_))),o.jsx(x,{[m]:"",ref:R,children:k})});b.displayName=p;function w(C){const A=s(t+"CollectionConsumer",C);return ui.useCallback(()=>{const k=A.collectionRef.current;if(!k)return[];const N=Array.from(k.querySelectorAll(`[${m}]`));return Array.from(A.itemMap.values()).sort((T,L)=>N.indexOf(T.ref.current)-N.indexOf(L.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:l,Slot:f,ItemSlot:b},w,i]}var fU=v.createContext(void 0);function ih(t){const e=v.useContext(fU);return t||e||"ltr"}var Hv="rovingFocusGroup.onEntryFocus",pU={bubbles:!1,cancelable:!0},rh="RovingFocusGroup",[Xb,W_,mU]=Nw(rh),[gU,Rm]=Er(rh,[mU]),[xU,vU]=gU(rh),Y_=v.forwardRef((t,e)=>o.jsx(Xb.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(Xb.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(bU,{...t,ref:e})})}));Y_.displayName=rh;var bU=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:r=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...m}=t,x=v.useRef(null),b=Et(e,x),w=ih(s),[C,A]=co({prop:l,defaultProp:u??null,onChange:d,caller:rh}),[E,k]=v.useState(!1),N=Zn(f),_=W_(n),R=v.useRef(!1),[T,L]=v.useState(0);return v.useEffect(()=>{const M=x.current;if(M)return M.addEventListener(Hv,N),()=>M.removeEventListener(Hv,N)},[N]),o.jsx(xU,{scope:n,orientation:i,dir:w,loop:r,currentTabStopId:C,onItemFocus:v.useCallback(M=>A(M),[A]),onItemShiftTab:v.useCallback(()=>k(!0),[]),onFocusableItemAdd:v.useCallback(()=>L(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>L(M=>M-1),[]),children:o.jsx(Je.div,{tabIndex:E||T===0?-1:0,"data-orientation":i,...m,ref:b,style:{outline:"none",...t.style},onMouseDown:Pe(t.onMouseDown,()=>{R.current=!0}),onFocus:Pe(t.onFocus,M=>{const U=!R.current;if(M.target===M.currentTarget&&U&&!E){const D=new CustomEvent(Hv,pU);if(M.currentTarget.dispatchEvent(D),!D.defaultPrevented){const G=_().filter(F=>F.focusable),Z=G.find(F=>F.active),Q=G.find(F=>F.id===C),q=[Z,Q,...G].filter(Boolean).map(F=>F.ref.current);Z_(q,p)}}R.current=!1}),onBlur:Pe(t.onBlur,()=>k(!1))})})}),X_="RovingFocusGroupItem",Q_=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:r=!1,tabStopId:s,children:l,...u}=t,d=qr(),f=s||d,p=vU(X_,n),m=p.currentTabStopId===f,x=W_(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:C}=p;return v.useEffect(()=>{if(i)return b(),()=>w()},[i,b,w]),o.jsx(Xb.ItemSlot,{scope:n,id:f,focusable:i,active:r,children:o.jsx(Je.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:e,onMouseDown:Pe(t.onMouseDown,A=>{i?p.onItemFocus(f):A.preventDefault()}),onFocus:Pe(t.onFocus,()=>p.onItemFocus(f)),onKeyDown:Pe(t.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){p.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const E=SU(A,p.orientation,p.dir);if(E!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let N=x().filter(_=>
675_.focusable).map(_=>_.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const _=N.indexOf(A.currentTarget);N=p.loop?CU(N,_+1):N.slice(_+1)}setTimeout(()=>Z_(N))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:C!=null}):l})})});Q_.displayName=X_;var yU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wU(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function SU(t,e,n){const i=wU(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return yU[i]}function Z_(t,e=!1){const n=document.activeElement;for(const i of t)if(i===n||(i.focus({preventScroll:e}),document.activeElement!==n))return}function CU(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var J_=Y_,eT=Q_,Pm="Tabs",[EU]=Er(Pm,[Rm]),tT=Rm(),[AU,jw]=EU(Pm),nT=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:r,defaultValue:s,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=t,p=ih(u),[m,x]=co({prop:i,onChange:r,defaultProp:s??"",caller:Pm});return o.jsx(AU,{scope:n,baseId:qr(),value:m,onValueChange:x,orientation:l,dir:p,activationMode:d,children:o.jsx(Je.div,{dir:p,"data-orientation":l,...f,ref:e})})});nT.displayName=Pm;var iT="TabsList",rT=v.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...r}=t,s=jw(iT,n),l=tT(n);return o.jsx(J_,{asChild:!0,...l,orientation:s.orientation,dir:s.dir,loop:i,children:o.jsx(Je.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});rT.displayName=iT;var sT="TabsTrigger",aT=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:r=!1,...s}=t,l=jw(sT,n),u=tT(n),d=cT(l.baseId,i),f=uT(l.baseId,i),p=i===l.value;return o.jsx(eT,{asChild:!0,...u,focusable:!r,active:p,children:o.jsx(Je.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:d,...s,ref:e,onMouseDown:Pe(t.onMouseDown,m=>{!r&&m.button===0&&m.ctrlKey===!1?l.onValueChange(i):m.preventDefault()}),onKeyDown:Pe(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(i)}),onFocus:Pe(t.onFocus,()=>{const m=l.activationMode!=="manual";!p&&!r&&m&&l.onValueChange(i)})})})});aT.displayName=sT;var oT="TabsContent",lT=v.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:r,children:s,...l}=t,u=jw(oT,n),d=cT(u.baseId,i),f=uT(u.baseId,i),p=i===u.value,m=v.useRef(p);return v.useEffect(()=>{const x=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(x)},[]),o.jsx(mi,{present:r||p,children:({present:x})=>o.jsx(Je.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:f,tabIndex:0,...l,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:x&&s})})});lT.displayName=oT;function cT(t,e){return`${t}-trigger-${e}`}function uT(t,e){return`${t}-content-${e}`}var kU=nT,NU=rT,jU=aT,_U=lT;function Zc({className:t,...e}){return o.jsx(kU,{"data-slot":"tabs",className:Fe("flex flex-col gap-2",t),...e})}function Jc({className:t,...e}){return o.jsx(NU,{"data-slot":"tabs-list",className:Fe("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...e})}function Xr({className:t,...e}){return o.jsx(jU,{"data-slot":"tabs-trigger",className:Fe("data-[state=active]:bg-background focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function sl({className:t,...e}){return o.jsx(_U,{"data-slot":"tabs-content",className:Fe("flex-1 outline-none",t),...e})}const dT=10;function TU(t){return t.price??0}function RU(t){return Math.max(0,Math.floor(t)-1)}function hT(t,e){return(t.price??0)+(t.pricePerSeat??0)*RU(e)}function Qb(t,e){return e==="month"?t:t*dT/12}function PU(t){return t*dT}function qp(t){return new Intl.NumberFormat("it-IT",{minimumFractionDigits:t%1===0?0:2,maximumFractionDigits:2}).format(t)}function DU(t){return[t("pricing.defaultFeatures.dataSources"),t("pricing.defaultFeatures.aiAnalysis"),t("pricing.defaultFeatures.prioritySupport"),t("pricing.defaultFeatures.realtimeUpdates")]}function LU(t,e){const n=t.features;return Array.isArray(n)?n:n&&typeof n=="object"&&"includes"in n&&Array.isArray(n.includes)?n.includes:DU(e)}function fT(t){const e=t.features;if(e&&typeof e=="object"&&"limits"in e){const n=e.limits;if(typeof n?.minSeats=="number"&&n.minSeats>=1)return n.minSeats}
675return t.tier==="ENTERPRISE"?3:1}function Gv({plan:t,billingInterval:e,isProcessing:n,onSelect:i,highlighted:r,isCurrentPlan:s,t:l}){const u=t.tier==="FREE"||t.price===0&&(t.pricePerSeat??0)===0,d=LU(t,l),f=fT(t),p=t.tier==="ENTERPRISE"?hT(t,1):TU(t),m=Qb(p,e),x=t.tier==="ENTERPRISE"?Qb(t.pricePerSeat??0,e):0;return o.jsxs(ln,{className:`flex flex-col relative ${r?"border-primary ring-1 ring-primary":""} ${s?"ring-2 ring-green-500":""}`,children:[s&&o.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:o.jsx(Ci,{className:"bg-green-600 text-white px-3 py-1",children:l("pricing.badges.currentPlan")})}),r&&!s&&o.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:o.jsx(Ci,{className:"bg-primary text-primary-foreground px-3 py-1",children:l("pricing.badges.mostPopular")})}),o.jsxs(hn,{children:[o.jsx(fn,{className:"text-2xl font-bold",children:t.name??t.description}),o.jsx(uo,{className:"text-base h-12",children:t.description})]}),o.jsxs(pn,{className:"flex-1",children:[o.jsxs("div",{className:"mb-6",children:[o.jsxs("span",{className:"text-4xl font-bold",children:["€",qp(m)]}),o.jsx("span",{className:"text-muted-foreground",children:l("pricing.perMonth")}),t.tier==="ENTERPRISE"&&o.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[l("pricing.planCard.enterpriseBase"),x>0&&l("pricing.planCard.enterpriseExtraSeat",{price:qp(x)}),l("pricing.planCard.enterpriseMinSeats",{count:f})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"font-medium",children:l("pricing.planCard.includes")}),d.map((b,w)=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Zi,{className:"w-5 h-5 text-green-500 mt-0.5 shrink-0"}),o.jsx("span",{className:"text-sm",children:b})]},w))]})]}),o.jsx(rl,{children:o.jsx(ie,{onClick:()=>i(t.id),className:"w-full py-6 text-lg",variant:r&&!s?"default":"outline",disabled:n!==null||s,children:s?l("pricing.planCard.buttons.currentPlan"):n===t.id?l("pricing.planCard.buttons.redirecting"):l(u?"pricing.planCard.buttons.activateTrial":"pricing.planCard.buttons.upgrade")})})]})}function OU(){const{t}=Ye("billing"),e=Kn(),n=Jr(),{logout:i}=Ar(),[r,s]=v.useState([]),[l,u]=v.useState(null),[d,f]=v.useState(!0),[p,m]=v.useState(null),[x,b]=v.useState(!1),[w,C]=v.useState(null),[A,E]=v.useState(3),[k,N]=v.useState(3),[_,R]=v.useState("year"),T=localStorage.getItem("user.organizationType")??"PERSONAL",L=l?.planId??null;v.useEffect(()=>{async function O(){try{const[X,$]=await Promise.all([B$(),As().catch(()=>null)]);s(X.slice().sort((B,H)=>(B.price??0)-(H.price??0))),u($)}catch(X){console.error("Failed to load plans:",X),ee.error(t("pricing.toast.loadError"))}finally{f(!1)}}O()},[t]);const M=r.filter(O=>O.tier==="PERSONAL"),U=r.filter(O=>O.tier==="ENTERPRISE"),D=async(O,X)=>{const $=r.find(H=>H.id===O),B=$&&($.tier==="FREE"||$.price===0&&($.pricePerSeat??0)===0);m(O);try{const H=await H$(O,X,_);if(H.checkoutUrl)B&&ee.success(t("pricing.toast.trialCard")),b(!1),C(null),window.location.href=H.checkoutUrl;else throw new Error("Checkout URL missing")}catch(H){console.error("Checkout failed:",H),ee.error(t("pricing.toast.checkoutError")),m(null)}},G=async O=>{const X=r.find($=>$.id===O);if(X){if(X.tier==="ENTERPRISE"){const $=fT(X);C(O),N($),E($),b(!0);return}await D(O)}},Z=()=>{if(w==null)return;const O=Math.floor(A);if(!Number.isFinite(O)||O<k){ee.error(t("pricing.toast.minSeats",{count:k}));return}const X=Math.min(500,O);E(X),D(w,X)},Q=w!=null?r.find(O=>O.id===w):null,K=Q!=null?hT(Q,Math.max(k,Math.floor(A)||k)):0,q=Math.max(k,Math.floor(A)||k),F=Q!=null?t("pricing.seatDialog.planSuffix",{planName:Q.name??Q.description}):"",V=()=>{if(K_(n.state)){const O=aU(n.state);e(O||-1);return}i(),e("/login",{replace:!0})};return d?o.jsx("div",{className:"flex justify-center items-center min-h-screen",children:o.jsx("p",{className:"text-xl font-medium animate-pulse",children:t("pricing.loading")})}):o.jsxs("div",{className:"relative min-h-screen bg-background py-16 px-5",children:[o.jsxs("div",{className:"absolute top-4 left-4 flex items-center gap-2",children:[o.jsxs(ie,{variant:"ghost",size:"sm",onClick:V,className:"text-foreground",children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),t("pricing.back")]}),o.jsx("img",{src:"/logo.svg",alt:"ArchivEye Logo",className:"w-8 h-auto object-contain"})]}),o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs("div",{className:"max-w-6xl mx-auto",children:[o.jsxs("div",{className:"text-center mb-16",children:[o.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:t("pricing.title")}),o.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:t("pricing.subtitle")}),o.jsx("div",{className:"flex justify-center mt-8",children:o.jsx(Zc,{value:_,onValueChange:O=>R(O),className:"w-full max-w-[240px]",children:o.jsxs(Jc,{className:"bg-muted/50 flex h-auto min-h-10 w-full gap-1 rounded-lg border border-border/50 p-1 shadow-inner backdrop-blur-sm sm:h-11",children:[o.jsx(Xr,{value:"year",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:t("pricing.interval.yearly")}),o.jsx(Xr,{value:"month",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:t("pricing.interval.monthly")})]})})}),o.jsx("p",{className:"text-sm text-muted-foreground mt-4 max-w-md mx-auto",children:t("pricing.interval.yearlyNote")})]}),T==="BUSINESS"?o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:U.map(O=>o.jsx(Gv,{plan:O,billingInterval:_,isProcessing:p,onSelect:G,isCurrentPlan:L===O.i
675d,t},O.id))}):o.jsxs(o.Fragment,{children:[M.length>0&&o.jsxs("section",{className:"mb-12",children:[o.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-6",children:t("pricing.sections.personal")}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:M.map((O,X)=>o.jsx(Gv,{plan:O,billingInterval:_,isProcessing:p,onSelect:G,highlighted:X===1,isCurrentPlan:L===O.id,t},O.id))})]}),U.length>0&&o.jsxs("section",{className:"relative",children:[o.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-6",children:t("pricing.sections.business")}),o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 pointer-events-none select-none blur-sm",children:U.map(O=>o.jsx(Gv,{plan:O,billingInterval:_,isProcessing:null,onSelect:()=>{},isCurrentPlan:L===O.id,t},O.id))}),o.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/40 rounded-lg",children:o.jsx(ie,{size:"lg",className:"text-lg px-8 py-6",onClick:()=>e("/register?type=business"),children:t("pricing.upgradeToBusiness")})})]})]})]}),o.jsx(yn,{open:x,onOpenChange:b,children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("pricing.seatDialog.title")}),o.jsx(In,{children:t("pricing.seatDialog.description",{min:k,planSuffix:F})})]}),o.jsxs("div",{className:"grid gap-2 py-2",children:[o.jsx(Xe,{htmlFor:"seats",children:t("pricing.seatDialog.licensesLabel")}),o.jsx(Qe,{id:"seats",type:"number",min:k,max:500,value:A,onChange:O=>E(Number(O.target.value)||k)}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:t("pricing.seatDialog.estimatedTotal",{amount:qp(Qb(K,_))})}),_==="year"&&K>0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:t("pricing.seatDialog.annualBilling",{amount:qp(PU(K))})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t("pricing.seatDialog.licenseBreakdown",{count:q})})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>b(!1),children:t("pricing.seatDialog.cancel")}),o.jsx(ie,{onClick:Z,disabled:p!==null||!Number.isFinite(A)||Math.floor(A)<k,children:t(p!==null?"pricing.seatDialog.redirecting":"pricing.seatDialog.continueToStripe")})]})]})})]})]})}function MU(){const{t}=Ye("billing"),e=Kn(),[n,i]=v.useState(null),[r,s]=v.useState(!0);v.useEffect(()=>{As().then(i).catch(()=>i(null)).finally(()=>s(!1))},[]);const l=async()=>{try{const{portalUrl:u}=await Ew();window.location.href=u}catch{e("/settings",{replace:!0})}};return o.jsxs("div",{className:"relative min-h-screen bg-background flex flex-col",children:[o.jsxs("header",{className:"border-b border-border py-6 px-8 flex items-center justify-between",children:[o.jsxs(ie,{variant:"ghost",onClick:()=>e("/dashboard",{replace:!0}),className:"text-foreground",children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),t("billing.back")]}),o.jsx(si,{})]}),o.jsx("main",{className:"flex-1 flex justify-center items-center px-5 py-12",children:o.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("img",{src:"/logo.svg",alt:"ArchivEye",className:"w-16 h-auto mx-auto mb-3"}),o.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t("billing.title")}),o.jsx("p",{className:"text-muted-foreground mt-1",children:t("billing.subtitle")})]}),r?o.jsx(ln,{children:o.jsx(pn,{className:"py-10 text-center text-muted-foreground animate-pulse",children:t("billing.loading")})}):n?o.jsxs(ln,{className:"border-primary/20",children:[o.jsxs(hn,{children:[o.jsxs(fn,{className:"flex items-center gap-2",children:[o.jsx($p,{className:"h-5 w-5"}),t("billing.active.planTitle",{planName:n.plan.description})]}),o.jsx(uo,{children:t("billing.active.status",{status:n.status})})]}),o.jsx(pn,{children:o.jsx("p",{className:"text-sm text-muted-foreground",children:t("billing.active.description")})}),o.jsxs(rl,{className:"flex flex-col gap-2",children:[o.jsxs(ie,{onClick:l,className:"w-full",variant:"default",children:[t("billing.active.manageBilling"),o.jsx(nl,{className:"ml-2 h-4 w-4"})]}),o.jsx(ie,{onClick:()=>e("/pricing",{replace:!0}),variant:"outline",className:"w-full",children:t("billing.active.viewPlans")})]})]}):o.jsxs(ln,{children:[o.jsxs(hn,{children:[o.jsx(fn,{children:t("billing.empty.title")}),o.jsx(uo,{children:t("billing.empty.description")})]}),o.jsx(rl,{children:o.jsx(ie,{onClick:()=>e("/pricing",{replace:!0}),className:"w-full",children:t("billing.empty.choosePlan")})})]}),o.jsx("div",{className:"text-center",children:o.jsx(ie,{variant:"link",onClick:()=>e("/dashboard",{replace:!0}),className:"text-muted-foreground",children:t("billing.backToDashboard")})})]})})]})}function IU(){const{t}=Ye("billing"),e=Kn(),[n]=ym(),i=n.get("session_id"),r=v.useRef(!1),[s,l]=v.useState(!i);return v.useEffect(()=>{!i||r.current||(r.current=!0,ee.success(t("success.toast.activated")),G$(i).then(()=>l(!0)).catch(u=>{console.error("Confirm checkout session failed:",u),ee.error(t("success.toast.confirmError")),l(!0)}))},[i,t]),o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs(ln,{className:"max-w-[480px] w-full text-center relative z-10",children:[o.jsxs(hn,{className:"pt-10 pb-4",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:"ArchivEye Logo",className:"w-16 h-auto object-contain mx-auto"})}),o.jsx("div",{className:"mx-auto mb-4 bg-green-100 dark:bg-green-900/30 w-16 h-16 rounded-full flex items-center justify-center",children:o.jsx(Jj,{className:"w-10 h-10 text-green-600 dark:text-green-400"})}),o.jsx(fn,{className:"text-3xl font-bold text-foreground",children:t("success.title")})]}),o.jsxs(pn,{className:"pb-8",children:[o.jsx("p",{className:"text-muted-foreground text-lg mb-4",children:t("success.description1")}),o.jsx("p",{className:"text-muted-foreground text-base",children:t("success.description2")})]}),o.jsxs(rl,{className:"pb-10 flex flex-col gap-3",children:[o.jsx(ie,{onClick:()=>e("/dashboard",{replace:!0}),className:"w-full py-6 text-lg",disabled:!s,children:s?t("success.goToDashboard"):o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"mr-2 h-5 w-5 animate-spin"}),t("success.waiting")]})}),o.jsx(ie,{onClick:()=>e("/billing",{replace:!0}),variant:"outline",className:"w-full",children:t("success.manageBilling")})]})]})]})}function zU(){const{t}=Ye("billing"),e=Kn();return v.useEffect(()=>{ee.error(t("cancel.toast"))},[t]),o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs(ln,{className:"max-w-[480px] w-full text-center border-red-200 dark:border-red-900/50 relative z-10",children:[o.jsxs(hn,{className:"pt-10 pb-4",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:"ArchivEye Logo",className:"w-16 h-auto object-contain mx-auto"})}),o.jsx("div",{className:"mx-auto mb-4 bg-red-100 dark:bg-red-900/30 w-16 h-16 rounded-full flex items-center justify-center",children:o.jsx(e_,{className:"w-10 h-10 text-red-600 dark:text-red-400"})}),o.jsx(fn,{className:"text-3xl font-bold text-foreground",children:t("cancel.title")})]}),o.jsxs(pn,{className:"pb-8",children:[o.jsx("p",{className:"text-muted-foreground text-lg mb-4",children:t("cancel.description1")}),o.jsx("p",{className:"text-muted-foreground text-base",children:t("cancel.description2")})]}),o.jsxs(rl,{className:"pb-10 flex flex-col gap-3",children:[o.jsx(ie,{onClick:()=>e("/pricing",{replace:!0}),className:"w-full py-6 text-lg",children:t("cancel.backToPricing")}),o.jsx(ie,{onClick:()=>e("/dashboard",{replace:!0}),variant:"ghost",className:"w-full",children:t("cancel.goToDashboard")})]})]})]})}function FU(){const{t}=Ye(["auth","common"]),[e,n]=v.useState({email:"",password:""}),[i,r]=v.useState(!1),[s,l]=v.useState(!1),{setTheme:u}=nh();v.useEffect(()=>{const b=new URLSearchParams(window.location.search).get("theme");if(b==="dark"||b==="light")u(b);else{const C=window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
675k":"light";u(C)}},[u]);const d=x=>{const{name:b,value:w}=x.target;n(C=>({...C,[b]:w}))},f=(x,b,w)=>{const C={access_token:x,refresh_token:b,user:{id:w.id,email:w.email,firstname:w.firstname,surname:w.surname,phone:"",role:w.role?.description??"",organization_id:w.organizationId,avatar:w.avatar??void 0}};if(window.opener)window.opener.postMessage({type:"auth-success",data:C},"*"),setTimeout(()=>window.close(),1e3);else{const A=`archiveye://auth/callback?token=${encodeURIComponent(x)}&refresh=${encodeURIComponent(b)}&user=${encodeURIComponent(JSON.stringify(C.user))}`;window.location.href=A,setTimeout(()=>{ee.success(t("loginChat.toast.returnToChat")),setTimeout(()=>window.close(),2e3)},1e3)}},p=async x=>{if(x.preventDefault(),!e.email||!e.password){ee.error(t("loginChat.toast.credentialsRequired"));return}l(!0);const b=A_(e.email,e.password).then(async w=>{localStorage.setItem("user.token",w.accessToken),localStorage.setItem("user.refreshToken",w.refreshToken);const C=await Id();f(w.accessToken,w.refreshToken,C)});ee.promise(b,{loading:t("loginChat.toast.loading"),success:o.jsx("b",{children:t("loginChat.toast.success")}),error:w=>{let C=t("loginChat.toast.invalidCredentials");return w&&typeof w=="object"&&"message"in w&&typeof w.message=="string"&&(C=w.message),console.error("Login failed:",w),o.jsx("b",{children:C})}},{success:{duration:2500},error:{duration:5e3}}).finally(()=>{l(!1)})},m=e.email!==""&&e.password!=="";return o.jsx("div",{className:"relative flex justify-center items-center h-screen bg-background px-4 overflow-hidden",children:o.jsxs(ln,{className:"w-full max-w-[480px] relative z-10 shadow-lg",children:[o.jsxs(hn,{className:"text-center pb-4 pt-6",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-xl font-semibold text-foreground",children:t("loginChat.title")}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1 font-normal",children:t("loginChat.subtitle")})]}),o.jsx(pn,{className:"pb-6",children:o.jsxs("form",{onSubmit:p,className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Xe,{htmlFor:"email",className:"block text-left text-sm font-medium text-foreground",children:t("loginChat.emailLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-lg px-3 py-2.5 bg-background focus-within:border-[#460B5D] focus-within:outline focus-within:outline-2 focus-within:outline-blue-100",children:[o.jsx("span",{className:"text-lg text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(_m,{})}),o.jsx(Qe,{id:"email",type:"email",name:"email",placeholder:t("loginChat.emailPlaceholder"),value:e.email,onChange:d,disabled:s,className:"border-none outline-none flex-1 text-sm pl-2 bg-transparent text-foreground shadow-none placeholder:text-muted-foreground disabled:opacity-60 disabled:cursor-not-allowed",autoCapitalize:"none",autoComplete:"email"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Xe,{htmlFor:"password",className:"block text-left text-sm font-medium text-foreground",children:t("loginChat.passwordLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-lg px-3 py-2.5 bg-background focus-within:border-[#460B5D] focus-within:outline focus-within:outline-2 focus-within:outline-blue-100",children:[o.jsx("span",{className:"text-lg text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(Aw,{})}),o.jsx(Qe,{id:"password",type:i?"text":"password",name:"password",placeholder:t("loginChat.passwordPlaceholder"),value:e.password,onChange:d,disabled:s,className:"border-none outline-none flex-1 text-sm pl-2 bg-transparent text-foreground shadow-none placeholder:text-muted-foreground disabled:opacity-60 disabled:cursor-not-allowed",autoCapitalize:"none",autoComplete:"current-password"}),o.jsx("span",{className:"cursor-pointer text-lg ml-2 text-muted-foreground select-none transition-opacity hover:opacity-70 flex items-center",onClick:()=>r(x=>!x),children:i?o.jsx(zd,{}):o.jsx(Fd,{})})]})]}),o.jsx(ie,{type:"submit",disabled:!m||s,className:"w-full mt-2",children:t(s?"loginChat.submit.loading":"loginChat.submit.default")})]})})]})})}function $U(){const{t}=Ye(["auth","common"]),e=Kn(),[n]=ym(),[i,r]=v.useState("processing"),[s,l]=v.useState(()=>t("callback.processing"));return v.useEffect(()=>{const u=window.setTimeout(()=>{const d=localStorage.getItem("user.token"),f=n.get("error");
675if(d){r("success"),l(t("callback.success.message")),e("/dashboard",{replace:!0});return}if(r("error"),!f){l(t("callback.error.default"));return}switch(f){case"login_required":l(t("callback.error.loginRequired"));break;case"access_denied":l(t("callback.error.accessDenied"));break;default:l(t("callback.error.generic"))}},350);return()=>window.clearTimeout(u)},[e,n,t]),o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs(ln,{className:"w-[560px] max-w-full relative z-10",children:[o.jsxs(hn,{className:"text-center pb-4",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-[1.5625rem] font-semibold text-foreground",children:t("callback.title")}),o.jsx("p",{className:"text-muted-foreground",children:t("callback.subtitle")})]}),o.jsx(pn,{className:"py-8",children:o.jsxs("div",{className:"flex flex-col items-center gap-5 text-center",children:[i==="processing"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-12 h-12 border-4 border-border border-t-primary rounded-full animate-spin"}),o.jsx("p",{className:"text-base font-medium text-foreground",children:s})]}),i==="success"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-14 h-14 rounded-full bg-green-500 text-white flex items-center justify-center text-[2rem] font-bold",children:"✓"}),o.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t("callback.success.redirect")})]}),i==="error"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-14 h-14 rounded-full bg-destructive text-white flex items-center justify-center text-[2rem] font-bold",children:"!"}),o.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t("callback.error.hint")}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx(ie,{onClick:()=>e("/login",{replace:!0}),children:t("callback.error.backToLogin")}),o.jsx(ie,{variant:"outline",asChild:!0,children:o.jsx(bi,{to:"/register",children:t("callback.error.createAccount")})})]})]})]})})]})]})}function UU(){const{t}=Ye(["auth","common"]),e=Kn(),n=()=>{localStorage.setItem("user.mode","org_admin"),e("/admin",{replace:!0})},i=()=>{localStorage.setItem("user.mode","data_platform"),e("/dashboard",{replace:!0})};return o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden",children:[o.jsx("div",{className:"absolute top-4 right-4",children:o.jsx(si,{})}),o.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[o.jsxs("div",{className:"text-center mb-8",children:[o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto mb-3"}),o.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t("chooseRole.title")}),o.jsx("p",{className:"text-muted-foreground mt-1",children:t("chooseRole.subtitle")})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs(ln,{className:"cursor-pointer transition-all hover:border-[#460B5D] hover:shadow-md",onClick:n,children:[o.jsx(hn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:o.jsx(Md,{className:"h-8 w-8 text-primary"})}),o.jsx(fn,{className:"text-lg",children:t("chooseRole.orgAdmin.title")})]})}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("chooseRole.orgAdmin.description")}),o.jsx(ie,{className:"mt-4 w-full",variant:"outline",children:t("chooseRole.orgAdmin.cta")})]})]}),o.jsxs(ln,{className:"cursor-pointer transition-all hover:border-[#460B5D] hover:shadow-md",onClick:i,children:[o.jsx(hn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:o.jsx(k8,{className:"h-8 w-8 text-primary"})}),o.jsx(fn,{className:"text-lg",children:t("chooseRole.dataPlatform.t
675itle")})]})}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("chooseRole.dataPlatform.description")}),o.jsx(ie,{className:"mt-4 w-full",variant:"outline",children:t("chooseRole.dataPlatform.cta")})]})]})]})]})]})}async function BU(){return De(_e.EMPLOYEE_LIST,{method:"GET"})}async function pT(){return De(_e.EMPLOYEE_COLLEAGUES,{method:"GET"})}async function tk(t){return De(_e.EMPLOYEE_INVITE,{method:"POST",jsonBody:t})}async function HU(t){return De(_e.EMPLOYEE_UPDATE_PROFILE,{method:"PATCH",jsonBody:t})}function GU(){const{t}=Ye("admin"),e=Kn(),[n,i]=v.useState([]),[r,s]=v.useState(!0),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState({email:"",firstname:"",surname:""}),[x,b]=v.useState(null),[w,C]=v.useState(!0),A=async()=>{s(!0);try{const L=await BU();i(Array.isArray(L)?L:[])}catch(L){console.error(L),ee.error(L instanceof Error?L.message:t("organizationAdmin.toast.loadError")),i([])}finally{s(!1)}};v.useEffect(()=>{A()},[]),v.useEffect(()=>{let L=!1;return C(!0),As().then(M=>{L||b(M)}).catch(()=>{L||b(null)}).finally(()=>{L||C(!1)}),()=>{L=!0}},[]);const E=x?.subscriberType==="ORGANIZATION"&&x?.plan?.tier==="ENTERPRISE",k=async()=>{try{const{portalUrl:L}=await Ew();window.location.href=L}catch{ee.error(t("organizationAdmin.billing.portalError"))}},N=async L=>{if(L.preventDefault(),!p.email.trim()){ee.error(t("organizationAdmin.toast.emailRequired"));return}f(!0);try{const M=await tk({email:p.email.trim(),firstname:p.firstname.trim()||void 0,surname:p.surname.trim()||void 0});M.status?(ee.success(M.message||t("organizationAdmin.toast.inviteSuccess")),m({email:"",firstname:"",surname:""}),u(!1),A()):ee.error(M.message||t("organizationAdmin.toast.inviteFailed"))}catch(M){const U=M&&typeof M=="object"&&"message"in M?String(M.message):t("organizationAdmin.toast.networkError");ee.error(U)}finally{f(!1)}},_=async L=>{try{const M=await tk({email:L.email,firstname:L.firstname||void 0,surname:L.surname||void 0});M.status?ee.success(M.message||t("organizationAdmin.toast.resetSuccess")):ee.error(M.message||t("organizationAdmin.toast.resetFailed"))}catch(M){ee.error(M instanceof Error?M.message:t("organizationAdmin.toast.resetError"))}},R=()=>{e("/settings")},T=t("organizationAdmin.employees.table.emptyValue");return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx("div",{className:"border-b border-border bg-card",children:o.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-4 flex items-center justify-between",children:[o.jsxs(ie,{variant:"ghost",size:"sm",onClick:R,children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),t("organizationAdmin.back")]}),o.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("organizationAdmin.title")}),o.jsx("div",{className:"w-24"})]})}),o.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-6 space-y-6",children:[E&&o.jsxs(ln,{children:[o.jsx(hn,{children:o.jsxs(fn,{className:"flex items-center gap-2 text-lg",children:[o.jsx($p,{className:"h-5 w-5"}),t("organizationAdmin.billing.title")]})}),o.jsx(pn,{className:"space-y-3",children:w?o.jsx("p",{className:"text-sm text-muted-foreground",children:t("organizationAdmin.billing.loading")}):x?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("organizationAdmin.billing.summary",{planName:x.plan.description,employeeCount:n.length,seatSuffix:x.seatCount!=null?t("organizationAdmin.billing.seatSuffix",{seatCount:x.seatCount}):""})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t("organizationAdmin.billing.hint")}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(ie,{type:"button",variant:"default",onClick:k,children:[t("organizationAdmin.billing.manageBilling"),o.jsx(nl,{className:"ml-2 h-4 w-4"})]}),o.jsx(ie,{type:"button",variant:"outline",onClick:()=>e("/pricing",{state:{from:"profile",returnTo:"/admin"}}),children:t("organizationAdmin.billing.increaseSeats")})]})]}):o.jsx("p",{className:"text-sm text-muted-foreground",children:t("organizationAdmin.billing.noEnterprise")})})]}),o.jsxs(ln,{children:[o.jsxs(hn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(fn,{className:"text-xl",children:t("organizationAdmin.employees.title")}),o.jsxs(yn,{open:l,onOpenChange:u,children:[o.jsx(f$,{asChild:!0,children:o.jsxs(ie,{children:[o.jsx(u_,{className:"h-4 w-4 mr-2"}),t("organizationAdmin.employees.invite")]})}),o.jsxs(wn,{children:[o.jsx(An,{children:o.jsx(Sn,{children:t("organizationAdmin.inviteDialog.title")})}
675),o.jsxs("form",{onSubmit:N,className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"invite-email",children:t("organizationAdmin.inviteDialog.emailLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-md px-3 py-2 focus-within:ring-2 focus-within:ring-primary",children:[o.jsx(i7,{className:"h-4 w-4 text-muted-foreground mr-2"}),o.jsx(Qe,{id:"invite-email",type:"email",placeholder:t("organizationAdmin.inviteDialog.emailPlaceholder"),value:p.email,onChange:L=>m(M=>({...M,email:L.target.value})),className:"border-0 p-0 focus-visible:ring-0",required:!0})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"invite-firstname",children:t("organizationAdmin.inviteDialog.firstnameLabel")}),o.jsx(Qe,{id:"invite-firstname",placeholder:t("organizationAdmin.inviteDialog.firstnamePlaceholder"),value:p.firstname,onChange:L=>m(M=>({...M,firstname:L.target.value}))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"invite-surname",children:t("organizationAdmin.inviteDialog.surnameLabel")}),o.jsx(Qe,{id:"invite-surname",placeholder:t("organizationAdmin.inviteDialog.surnamePlaceholder"),value:p.surname,onChange:L=>m(M=>({...M,surname:L.target.value}))})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t("organizationAdmin.inviteDialog.hint")}),o.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>u(!1),children:t("organizationAdmin.inviteDialog.cancel")}),o.jsx(ie,{type:"submit",disabled:d,children:t(d?"organizationAdmin.inviteDialog.submit.loading":"organizationAdmin.inviteDialog.submit.default")})]})]})]})]})]}),o.jsx(pn,{children:r?o.jsx("p",{className:"text-muted-foreground py-8 text-center",children:t("organizationAdmin.employees.loading")}):n.length===0?o.jsx("p",{className:"text-muted-foreground py-8 text-center",children:t("organizationAdmin.employees.empty")}):o.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{className:"bg-muted/50",children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left p-3 font-medium",children:t("organizationAdmin.employees.table.email")}),o.jsx("th",{className:"text-left p-3 font-medium",children:t("organizationAdmin.employees.table.firstname")}),o.jsx("th",{className:"text-left p-3 font-medium",children:t("organizationAdmin.employees.table.surname")}),o.jsx("th",{className:"text-left p-3 font-medium",children:t("organizationAdmin.employees.table.role")}),o.jsx("th",{className:"text-left p-3 font-medium",children:t("organizationAdmin.employees.table.actions")})]})}),o.jsx("tbody",{children:n.map(L=>o.jsxs("tr",{className:"border-t border-border",children:[o.jsx("td",{className:"p-3",children:L.email??T}),o.jsx("td",{className:"p-3",children:L.firstname??T}),o.jsx("td",{className:"p-3",children:L.surname??T}),o.jsx("td",{className:"p-3",children:L.role?.description??T}),o.jsx("td",{className:"p-3",children:o.jsx(ie,{type:"button",variant:"outline",size:"sm",onClick:()=>void _(L),children:t("organizationAdmin.employees.table.resendPassword")})})]},L.id))})]})})})]})]})]})}const Zb="it",mT="archiveye-data-locale",VU="archiveye-data-legal-locale";function Jb(t){return t==="it"||t==="en"}function qU(){if(typeof localStorage>"u")return Zb;const t=localStorage.getItem(mT);if(Jb(t))return t;const e=localStorage.getItem(VU);return Jb(e)?e:Zb}function _w(t){typeof localStorage>"u"||localStorage.setItem(mT,t)}function KU(t){return t==="it"?"it-IT":"en-US"}const WU={alt:"ArchivEye Logo",altShort:"ArchivEye"},YU={back:"Indietro",cancel:"Annulla",loading:"Caricamento...",logout:"Logout",settings:"Impostazioni"},XU={storage:{title:"Spazio di archiviazione",remaining:"{{amount}} GB rimanenti"}},QU={loading:"Caricamento..."},ZU={inProgress:{label:"In elaborazione",title:"Elaborazione in corso"},completed:{label:"Pronto",title:"Pronto"},failed:{label:"Errore",title:"Elaborazione fallita"}
675,pending:{label:"In attesa",title:"In attesa di elaborazione"}},JU={knowledgeBase:"Knowledge Base",documentPreview:"Anteprima documento",editMarkdown:"Modifica markdown",content:"Contenuto",size:"Dimensione",lastUpdated:"Ultimo aggiornamento",editHint:"Modifica il testo qui; chiudi il pannello quando hai finito.",previewReadOnly:"Anteprima del documento in sola lettura.",previewMarkdownReadOnly:"Anteprima markdown in sola lettura.",audioSource:"Audio sorgente",videoSource:"Video sorgente",officePreview:"Anteprima documento Office",imagePreviewAlt:"Anteprima immagine",readFileError:"Lettura file non riuscita",textReadError:"Errore lettura testo",openFileError:"Impossibile aprire il file",downloadFailed:"Download non riuscito",loadingDocument:"Caricamento documento…",loadingContent:"Caricamento contenuto…",noDocumentToView:"Nessun documento da visualizzare.",useSidebarPlayer:"Usa il player nella barra laterale per ascoltare o guardare il file mentre controlli il contenuto.",loadingPdf:"Caricamento PDF…",pdfViewError:"Impossibile visualizzare il PDF.",loadingText:"Caricamento testo…",previewUnavailable:"Anteprima non disponibile per {{format}}.",thisFormat:"questo formato",openOrDownload:"Apri o scarica il file",download:"Scarica",downloading:"Scaricamento…",youtubeUrl:"URL YouTube",sourceUrl:"URL sorgente"},eB={logo:WU,actions:YU,userProfile:XU,protectedRoute:QU,documentStatus:ZU,markdown:JU},tB={welcomeTitle:"Bentornato su Archiveye",emailLabel:"E-mail",emailPlaceholder:"La tua E-mail",passwordLabel:"Password",passwordPlaceholder:"La tua Password",submit:"Accedi",submitLoading:"Accesso in corso...",noAccount:"Non hai un account?",registerLink:"Registrati",forgotPassword:"Hai dimenticato la password?",termsLink:"Termini di Servizio",privacyLink:"Privacy Policy",toast:{credentialsRequired:"Per favore, inserisci email e password.",loading:"Accesso in corso...",success:"Accesso effettuato!",invalidCredentials:"Credenziali non valide o errore del server."}},nB={choose:{title:"Come vuoi usare ArchivEye?",subtitle:"Scegli il tipo di account per continuare con la registrazione.",personal:{title:"Personal",description:"Per uso personale. Creeremo un workspace dedicato a te senza richiedere dati aziendali.",cta:"Registrati come Personal"},business:{title:"Business",description:"Per aziende e team. Inserisci i dati della tua organizzazione e gestisci più utenti.",cta:"Registrati come Business"},hasAccount:"Hai già un account?",loginLink:"Accedi"},form:{back:"Indietro",titlePersonal:"Crea account Personal",titleBusiness:"Passa a Business",subtitlePersonal:"Compila i campi per registrarti",subtitleBusiness:"Crea un account Business e inserisci i dati della tua organizzazione.",fields:{firstname:"Nome",surname:"Cognome",companyData:"Dati azienda",organizationName:"Nome azienda *",organizationEmail:"Email azienda (opzionale)",organizationVat:"Partita IVA (opzionale)",city:"Città",zipCode:"CAP",address:"Indirizzo",province:"Provincia",country:"Paese",email:"E-mail",password:"Password"},placeholders:{firstname:"Nome",surname:"Cognome",organizationName:"Nome della tua azienda",organizationEmail:"[email protected]",organizationVat:"IT12345678901",city:"Milano",zipCode:"20100",address:"Via Example 1",province:"MI",country:"Italia",email:"La tua E-mail",password:"Minimo 6 caratteri"},submit:{loading:"Creazione in corso...",default:"Registrati e Scegli Piano"}},legal:{acceptTermsPrefix:"Accetto i",acceptPrivacyPrefix:"Accetto la",termsLink:"Termini di Servizio",privacyLink:"Privacy Policy",legalFooter:"Termini di Servizio",legalFooterPrivacy:"Privacy Policy"},toast:{success:"Registrazione completata!",organizationNameRequired:"Inserisci il nome dell'azienda.",acceptTermsRequired:"Devi accettare i Termini di Servizio",acceptPrivacyRequired:"Devi accettare la Privacy Policy",requiredFields:"Per favore, compila tutti i campi obbligatori.",creating:"Creazione account in corso...",accountCreated:"Account creato!",error:"Errore durante la registrazione."}},iB={title:"Recupera la tua password",titleHighlight:"password",description:"Inserisci la tua email e ti invieremo un'email con il link per reimpostare la password.",emailLabel:"E-mail",emailPlaceholder:"La tua E-mail",submit:{loading:"Invio in corso...",default:"Invia email di reset"},rememberPassword:"Ricordi la password?",loginLink:"Accedi",success:{title:"Email inviata con successo",titleHighlight:"successo",description:"Controlla la tua casella di posta per il link di reset password. Se non la trovi subito, verifica anche spam o posta indesiderata.",backToLogin:"Torna al Login",notReceived:"Non hai ricevuto l'email?",retry:"Riprova"},toast:{emailRequired:"Per favore, inserisci la tua email.",sending:"Invio email di reset in corso...",success:"Email di reset inviata con successo.",error:"Errore durante l'invio dell'email."}},rB={title:"Accedi ad Archiveye",subtitle:"Questa finestra si chiuderà automaticamente dopo il login",emailLabel:"E-mail",emailPlaceholder:"La tua E-mail",passwordLabel:"Password",passwordPlaceholder:"La tua Password",submit:{loading:"Accesso in corso...",default:"Accedi"},toast:{credentialsRequired:"Per favore, inserisci email e password.",loading:"Accesso in corso...",success:"Accesso effettuato!",invali
675dCredentials:"Credenziali non valide o errore del server.",returnToChat:"Puoi tornare alla chat!"}},sB={title:"Verifica accesso",subtitle:"Completiamo gli ultimi controlli prima di riportarti nella piattaforma.",processing:"Stiamo verificando la sessione...",success:{message:"Sessione ripristinata correttamente.",redirect:"Ti riportiamo subito alla dashboard."},error:{hint:"Puoi tornare al login e riprovare senza perdere il contesto della piattaforma.",backToLogin:"Torna al login",createAccount:"Crea account",default:"Non siamo riusciti a completare l'autenticazione.",loginRequired:"La sessione e' scaduta. Effettua di nuovo l'accesso.",accessDenied:"Accesso annullato. Riprova quando vuoi.",generic:"Autenticazione non completata. Riprova tra pochi istanti."}},aB={title:"Come vuoi accedere?",subtitle:"La tua email coincide con quella del tenant. Scegli un'opzione.",orgAdmin:{title:"Organization Admin",description:"Gestisci gli employee dell'organizzazione e attiva nuovi utenti tramite email (redeem).",cta:"Entra come Admin"},dataPlatform:{title:"Data Platform",description:"Accedi alla piattaforma dati: AI, documenti e chat.",cta:"Entra nella piattaforma"}},oB={title:"Cambia password",description:"La tua password è stata reimpostata. Inserisci la password temporanea ricevuta via email e scegli una nuova password per continuare.",fields:{oldPassword:"Password attuale (temporanea)",newPassword:"Nuova password",confirmPassword:"Conferma nuova password"},placeholders:{oldPassword:"Password temporanea",newPassword:"Almeno 8 caratteri",confirmPassword:"Ripeti la nuova password"},aria:{hidePassword:"Nascondi password",showPassword:"Mostra password"},submit:{loading:"Salvataggio...",default:"Salva nuova password"},toast:{mismatch:"La nuova password e la conferma non coincidono.",minLength:"La nuova password deve avere almeno 8 caratteri.",sameAsOld:"La nuova password deve essere diversa dalla password attuale.",success:"Password aggiornata. Puoi continuare ad usare l'app.",error:"Errore durante il cambio password."}},lB={login:tB,register:nB,forgotPassword:iB,loginChat:rB,callback:sB,chooseRole:aB,changePassword:oB},cB={back:"Indietro",no:"No",yes:"Sì",cancel:"Annulla",save:"Salvataggio...",confirm:"Conferma",logout:"Logout",organizationAdmin:"Organization Admin",forDevs:"For Devs"},uB={title:"Impostazioni",subtitle:"Gestire le impostazioni dell'account",backAria:"Indietro",logoAria:"ArchivEye"},dB={ariaLabel:"Sezioni impostazioni",account:"Account",subscription:"Abbonamento",helpIntegrations:"Help & Integrazioni"},hB={label:"Aspetto",ariaLabel:"Tema dell'applicazione",light:"Light",dark:"Dark",system:"System"},fB={label:"Lingua",ariaLabel:"Lingua dell'applicazione",italian:"Ital
675iano",english:"English"},pB={title:"Account",subtitle:"Profilo, spazio di archiviazione e impostazioni dell'account",storage:{title:"Spazio di archiviazione",description:"Spazio disponibile sul tuo account per i documenti indicizzati.",loading:"Caricamento spazio di archiviazione...",noLimit:"Piano senza limite di archiviazione configurato.",loadError:"Impossibile caricare le informazioni sullo spazio di archiviazione.",used:"Utilizzato",available:"Disponibile",gbRemaining:"Giga rimanenti",ariaLabel:"Spazio di archiviazione: {{remainingGb}} GB rimanenti",legendHint:"Passa il mouse sul grafico o sulla legenda per i dettagli."},profile:{title:"Profilo",company:"Azienda",role:"Ruolo",name:"Name",email:"Email",emailHint:"L'email è gestita dal tuo account di accesso e non può essere modificata qui.",save:"Modifica",saving:"Salvataggio..."},apiKey:{title:"API Key",description:"Tratta questa chiave come una password: non condividerla e non inserirla in repository pubblici.",regenerateWarning:"Se rigeneri la chiave, la precedente smette immediatamente di funzionare.",regenerate:"Rigenera API key",generate:"Genera la tua API key"},changePassword:{title:"Cambia password",description:"Inserisci la password attuale e la nuova password. Il cambio viene applicato direttamente al tuo account Keycloak. Se non ricordi la password attuale, usa il reset dalla pagina di login.",current:"Password attuale",new:"Nuova password",confirm:"Conferma nuova password",newPlaceholder:"Almeno 8 caratteri",confirmPlaceholder:"Ripeti la nuova password",submit:"Cambia password",submitting:"Salvataggio..."}},mB={title:"Account collegati",description:"Collega Google Drive o SharePoint/OneDrive per importare documenti direttamente in ArchivEye.",empty:"Nessun account cloud collegato.",disconnect:"Scollega",connectGoogle:"Collega Google Drive",connectMicrosoft:"Collega SharePoint / OneDrive",noProvider:"Nessun provider cloud configurato dall'amministratore.",providers:{google:"Google Drive",microsoft:"SharePoint / OneDrive"},confirmDisconnect:"Scollegare {{provider}}? I documenti già importati restano in ArchivEye."},gB={title:"Abbonamento",subtitle:"Gestisci il tuo piano di abbonamento e le impostazioni di fatturazione",loading:"Caricamento informazioni abbonamento...",autoRenewOff:"Rinnovo automatico disattivato",autoRenewOffUntilDate:"L'abbonamento non si rinnoverà automaticamente e resterà attivo fino al {{date}}.",autoRenewOffUntilPeriod:"L'abbonamento non si rinnoverà automaticamente fino alla fine del periodo corrente.",plan:"Piano {{name}}",perSeatMonth:"per utente / mese",perMonth:"al mese",subscriberType:"Tipo sottoscrittore",organization:"Aziendale",personal:"Personale",seats:"Posti inclusi",renewal:"Scadenza/Rinnovo",manageBilling:"Gestisci Fatturazione e Pagamenti",cancelAutoRenew:"Annulla rinnovo automatico",upgradeTitle:"Hai bisogno di più funzionalità?",upgradeDescription:"Puoi cambiare piano in qualsiasi momento per adattare ArchivEye alle tue esigenze crescenti.",viewPlans:"Vedi tutti i piani",emptyTitle:"Nessun abbonamento attivo",emptyDescription:"Attualmente stai utilizzando la versione gratuita di ArchivEye. Scegli un piano per sbloccare più funzioni.",choosePlan:"Scegli un Piano"},xB={title:"Help & Integrazioni",subtitle:"Scopri come integrare ArchivEye nei tuoi agenti AI tramite MCP, gestire la API key e trovare risposte alle domande più comuni.",singleConnector:"Singolo connettore",singleConnectorHint:"Collega un agente a una connettore specifico. Copia l'URL MCP dalla pagina di dettaglio del connettore nella dashboard.",allConnectors:"Tutti i connettori",allConnectorsHint:"Accedi a tutti i connettori del tuo profilo con la API key utente nell'endpoint /user/{api_key}/mcp.",docsLink:"Documentazione completa per MCP, SDK e CLI nella <docsLink>Developer Platform docs</docsLink>.",contactSupport:"Contatta supporto",faqTitle:"Domande frequenti"},vB={scopeCollection:"questo connettore",scopeUser:"tutti i connettori del tuo account",urlHintCollection:"l'URL MCP del connettore (visibile nella pagina di dettaglio del connettore)",urlHintUser:"l'URL MCP del tuo account (formato /user/{api_key}
675/mcp, usando la API key utente)",authHintCollection:"L'URL del connettore include già l'autenticazione.",authHintUser:"Usa la tua API key utente nell'URL o negli header, come indicato dal client.",clients:{aiden:"Aiden",claude:"Claude",chatgpt:"GPT",cursor:"Cursor",others:"Altri"},cursor:{title:"Configurazione in Cursor IDE",description:"Cursor supporta nativamente MCP per estendere le capacità dell'AI con i dati di {{scope}}.",steps:{1:"Apri le impostazioni di Cursor (<kbd>Cmd+,</kbd> su Mac o <kbd>Ctrl+,</kbd> su Windows).",2:"Vai alla sezione <strong>Tools</strong> e seleziona <strong>MCP</strong>.",3:"Clicca su <strong>+ Add new MCP server</strong>.",4:'Inserisci un nome (es. "ArchivEye") e seleziona il tipo <strong>http</strong>.',5:"Inserisci {{urlHint}}.",6:"Clicca su <strong>Save</strong>. Cursor caricherà automaticamente i tool disponibili."}},chatgpt:{title:"Configurazione in ChatGPT",description:"Integra ArchivEye direttamente nelle chat di ChatGPT per {{scope}}.",steps:{1:"Accedi alle impostazioni di ChatGPT.",2:"Assicurati di avere la <strong>Developer Mode</strong> o l'accesso alle <strong>Connected Apps</strong> abilitato.",3:"Cerca la sezione <strong>MCP / Third-party tool connections</strong>.",4:"Aggiungi una nuova connessione inserendo {{urlHint}}.",5:"Configura eventuali header di autenticazione se richiesti.",6:"Una volta connesso, ChatGPT potrà interrogare i tuoi documenti durante la conversazione."}},claude:{title:"Configurazione in Claude Desktop",description:"Usa i tuoi dati ArchivEye all'interno dell'app desktop di Claude.",scopeWordCollection:"del connettore",scopeWordUser:"account",configCollection:`{
676  "mcpServers": {
677    "archiveye": {
678      "url": "https://<host-mcp>/collection/<api_key_connettore>/mcp"
679    }
680  }
681}`,configUser:`{
682  "mcpServers": {
683    "archiveye": {
684      "url": "https://<host-mcp>/user/<api_key_utente>/mcp"
685    }
686  }
687}`,steps:{1:"Apri <strong>Claude Desktop</strong>.",2:"Vai in <strong>Settings</strong> > <strong>Developer</strong> e clicca su <strong>Edit Config</strong>.",3:"Nel file JSON, aggiungi il server MCP sotto <code>mcpServers</code>. Per client HTTP Streamable usa l'URL {{scopeWord}}:",4:"Salva il file e riavvia completamente Claude Desktop.",5:"L'icona del martello in basso a destra confermerà che il connector è attivo."}},aiden:{title:"Configurazione in Aiden",description:"Collega ArchivEye ad Aiden per interrogare {{scope}} tramite MCP.",steps:{1:"Apri <strong>Aiden</strong> e vai alle impostazioni di integrazione o connettori esterni.",2:"Seleziona <strong>Aggiungi server MCP</strong> (o equivalente) e scegli il trasporto <strong>HTTP / Streamable HTTP</strong>.",3:'Assegna un nome al connettore (es. "ArchivEye") e incolla {{urlHint}}.',4:"Se Aiden richiede autenticazione aggiuntiva, usa la stessa API key configurata in ArchivEye o gli header indicati dalla documentazione del client.",5:"Salva e verifica che i tool MCP (ricerca, elenco documenti, ecc.) risultino disponibili nella sessione."}},others:{title:"Altri client compatibili MCP",description:"Qualsiasi agente o IDE che supporti MCP su HTTP Streamable può usare ArchivEye per {{scope}}.",steps:{1:"Individua nella documentazione del client la sezione <strong>MCP servers</strong> o <strong>tool connections</strong>.",2:"Crea un nuovo server di tipo <strong>HTTP</strong> (Streamable HTTP, spec 2025-03-26).",3:"Imposta come endpoint {{urlHint}}.",5:"Dopo la connessione, prova una ricerca semantica sui documenti per confermare che i tool rispondano correttamente.","4Collection":"Per un singolo connettore, copia l'URL dalla pagina di dettaglio del connettore nella dashboard.","4User":"Per l'accesso a tutti i connettori, usa l'URL /user/{api_key}/mcp con la API key utente dalle impostazioni."}}},bB={connectorMcp:{q:"Cos'è un connettore MCP?",a:"Un connettore espone i documenti collegati tramite il protocollo MCP (Model Context Protocol). Agenti come Cursor, ChatGPT o Aiden possono cercare e leggere i documenti indicizzati senza caricarli manualmente in chat."},collectionVsUser:{q:"Qual è la differenza tra connettore singolo e account utente?",a:"Il connettore espone solo i documenti collegati (URL /collection/{api_key}/mcp). L'endpoint account utente (/user/{api_key}/mcp) consente di accedere a tutte i connettori del tuo profilo e di scegliere su quale lavorare durante la conversazione."},apiKey:{q:"A cosa serve la API key utente?",a:"La API key utente autentica le integrazioni esterne verso l'endpoint MCP account e altri servizi compatibili. Conservala in modo sicuro: se la rigeneri, le integrazioni esistenti dovranno essere aggiornate."},indexing:{q:"Perché un documento non risulta ricercabile?",a:"I documenti devono completare l'indicizzazione (stato Pronto) prima di essere interrogabili via MCP. Controlla lo stato nella dashboard e, se necessario, avvia un nuovo processamento dal dettaglio del file."},regenerate:{q:"Cosa succede se rigenero la API key?",a:"La chiave precedente viene invalidata immediatamente. Tutte le connessioni MCP o client esterni che la usano smetteranno di funzionare finché non aggiornerai l'URL o le credenziali configurati."}},yB={logout:{title:"Conferma Logout",description:"Sei sicuro di voler uscire?"},regenerateApiKey:{titleRegenerate:"Conferma rigenerazione API key",titleGenerate:"Conferma generazione API key",descRegenerate1:"Rigenerando la API key, la chiave precedente verrà invalidata immediatamente.",descRegenerate2:"Le integrazioni già configurate dovranno essere aggiornate e potrebbero interrompersi sessioni o connessioni attive in cui la chiave attuale è stata usata.",descGenerate:"Inserisci la password attuale per creare la tua API key e usarla nelle integrazioni esterne.",passwordLabel:"Password attuale",passwordPlaceholder:"Inserisci la password per confermare",confirmRegenerate:"Conferma e rigenera",confirmGenerate:"Conferma e genera",regenerating:"Rigenerazione...",generating:"Generazione..."},cancelSubscription:{title:"Annulla rinnovo automatico",intro:"Stai per disattivare il rinnovo automatico del piano {{planName}}. L'abbonamento resterà utilizzabile fino alla scadenza del periodo già pagato; non verranno effettuati ulteriori addebiti.",accessUntil:"Accesso garantito fino al {{date}}.",confirmInstruction:"Per confermare, digita {{word}} nel campo sottostante.",confirmLabel:'Digita "{{word}}" per confermare',confirmWord:"Annulla",back:"Indietro",submit:"Annulla abbonamento",submitting:"Annullamento in corso..."}},wB={portalError:"Impossibile accedere al portale di gestione pagamenti.",passwordMismatch:"La nuova password e la conferma non coincidono.",passwordMinLength:"La nuova password deve avere almeno 8 caratteri.",passwordSame:"La nuova password deve essere diversa dalla password attuale.",passwordUpdated:"Password aggiornata con successo.",passwordError:"Errore durante il cambio password.",settingsUpdated:"Impostazioni aggiornate con successo!",settingsError:"Errore durante l'aggiornamento delle impostazioni",apiKeyUnavailable:"API key non disponibile.",apiKeyCopied:"API key copiata.",apiKeyCopyError:"Impossibile copiare la API key.",passwordRequired:"Inserisci la password attuale per confermare.",apiKeyRegenerated:"API key rigenerata con successo.",apiKeyGenerated:"API key generata con successo.",apiKeyRegenerateError:"Errore durante la rigenerazione della API key.",connectedAccountsLoadError:"Errore caricamento account",connectedSuccess:"Account {{provider}} collegato",connectError:"Errore connessione",disconnected:"Account scollegato",disconnectError:"Errore durante la disconnessione",cancelSuccessWithDate:"Autorinnovo disattivato. L'abbonamento resta attivo fino al {{date}}.",cancelSuccess:"Autorinnovo disattivato. L'abbonamento resta attivo fino alla fine del periodo corrente.",cancelError:"Impossibile annullare l'abbonamento."},SB={common:cB,header:uB,nav:dB,appearance:hB,language:fB,account:pB,connectedAccounts:mB,subscription:gB,help:xB,integrations:vB,faq:bB,dialogs:yB,toasts:wB},CB={loading:"Caricamento piani...",back:"Indietro",title:"Scegli il piano giusto per te",subtitle:"Sblocca tutto il potenziale di ArchivEye con le nostre opzioni di abbonamento flessibili.",interval:{yearly:"Annuale",monthly:"Mensile",yearlyNote:"Con il piano annuale paghi 10 mesi su 12; il prezzo mostrato è sempre espresso al mese."},sections:{personal:"Piani Personal",business:"Piani Business"},upgradeToBusiness:"Passa a business",perMonth:"/mese",badges:{currentPlan:"IL TUO PIANO",mostPopular:"PIÙ POPOLARE"},planCard:{includes:"Cosa include:",enterpriseBase:"Canone base (1 postazione admin).",enterpriseExtraSeat:" + €{{price}}/mese per licenza aggiuntiva.",enterpriseMinSeats:" Minimo {{count}} licenze.",buttons:{currentPlan:"Piano attuale",redirecting:"Reindirizzamento...",activateTrial:"Attiva trial – Inserisci carta",upgrade:"Upgrade"}},defaultFeatures:{dataSources:"Accesso a tutte le fonti dati",aiAnalysis:"Analisi documenti AI illimitata",prioritySupport:"Supporto prioritario",realtimeUpdates:"Aggiornamenti in tempo reale"},seatDialog:{title:"Numero di licenze",description:"Inserisci quante licenze (seat) desideri per il piano Business. Minimo {{min}} licenze{{planSuffix}}. Potrai modificare il numero in seguito dal portale fatturazione.",planSuffix:" per {{planName}}",licensesLabel:"Licenze",estimatedTotal:"Totale stimato: €{{amount}}/mese",annualBilling:"Fatturato €{{amount}} all'anno",licenseBreakdown:"Per {{count}} licenze (canone base + postazioni aggiuntive).",cancel:"Annulla",continueToStripe:"C
687ontinua a Stripe",redirecting:"Reindirizzamento..."},toast:{loadError:"Impossibile caricare i piani di abbonamento.",trialCard:"Inserisci i dati della carta per attivare il periodo di prova.",checkoutError:"Errore durante la creazione della sessione di pagamento.",minSeats:"Inserisci almeno {{count}} licenze per questo piano."}},EB={back:"Indietro",title:"Fatturazione",subtitle:"Gestisci il tuo abbonamento e i metodi di pagamento",loading:"Caricamento...",active:{planTitle:"Piano {{planName}}",status:"Stato: {{status}}",description:"Puoi aggiornare il metodo di pagamento, scaricare le fatture o cambiare piano dal portale Stripe.",manageBilling:"Gestisci fatturazione e pagamenti",viewPlans:"Vedi tutti i piani"},empty:{title:"Nessun abbonamento attivo",description:"Scegli un piano per sbloccare le funzionalità e gestire la fatturazione.",choosePlan:"Scegli un piano"},backToDashboard:"Torna alla Dashboard"},AB={title:"Pagamento riuscito!",description1:"Grazie per aver completato la configurazione del tuo piano ArchivEye.",description2:"Il tuo account è stato aggiornato. Puoi accedere alla dashboard o gestire la fatturazione dalla pagina dedicata.",goToDashboard:"Vai alla Dashboard",waiting:"Attendere...",manageBilling:"Gestisci fatturazione",toast:{activated:"Abbonamento attivato con successo!",confirmError:"Impossibile confermare l'abbonamento. Riprova dalla pagina fatturazione."}},kB={title:"Pagamento annullato",description1:"Hai annullato la sessione. Nessun addebito è stato effettuato.",description2:"Puoi riprovare quando vuoi dalla pagina dei piani o tornare alla dashboard.",backToPricing:"Torna alla scelta del piano",goToDashboard:"Vai alla Dashboard",toast:"La configurazione del pagamento è stata annullata."},NB={pricing:CB,billing:EB,success:AB,cancel:kB},jB={title:"ArchivEye Docs",subtitle:"Developer Platform",login:"Accedi",navAria:"Documentazione",overview:"Panoramica"},_B={badge:"Developer Platform",title:"Integra ArchivEye nel tuo stack",subtitle:"Collega agenti AI, script e backend ai tuoi knowledge base con MCP (connettore Claude, plugin ChatGPT, Cursor, OAuth), il SDK TypeScript e la CLI. Upload, ricerca, ingest e webhook con la stessa piattaforma.",startMcp:"Inizia con MCP",auth:"Autenticazione",howItWorks:"Come funziona",howItWorksDesc:"Un flusso tipico: autenticazione, ingest di documenti, indicizzazione automatica e consumo via ricerca o webhook.",step1Title:"Autentica",step1Desc:"Genera una API key employee (aek-…) da Impostazioni → API key. Usala come Bearer token REST o nell'URL MCP.",step2Title:"Carica e indicizza",step2Desc:"Upload via SDK, CLI o ingest job. Il pipeline di processing estrae testo, genera embedding e indicizza in Qdrant.",step3Title:"Cerca e integra",step3Desc:"Agenti MCP o searchSemantic nel SDK interrogano i collection. Webhook notificano completamento ingest.",readGuide:"Leggi la guida",baseUrlTitle:"Base URL e ambienti",restApi:"REST API (BFF)",mcpStreamable:"MCP (Streamable HTTP)",mcpOAuthHint:"OAuth: /user/mcp · API key: /user/{api_key}/mcp"},TB={integrations:{label:"Integrazioni",description:"Collega IDE e agenti AI ai tuoi dati."},tools:{label:"Strumenti",description:"SDK e CLI per automazioni e backend."},reference:{label:"Reference",description:"Autenticazione, eventi e dettagli operativi."}},RB={mcp:{title:"MCP",description:"MCP per Claude (connettore), ChatGPT (plugin), Cursor e OAuth spec."},sdk:{title:"TypeScript SDK",description:"Client REST, MCP e verifica webhook per Node.js e TypeScript."},cli:{title:"CLI",description:"Comandi da terminale per upload, ingest, ricerca e webhook."},auth:{title:"Autenticazione",description:"API key employee, Bearer token, scope account vs collection."},webhooks:{title:"Webhooks",description:"Endpoint, firma HMAC, eventi ingest e retry delle delivery."}},PB={notFoundTitle:"Pagina non trovata",notFoundDesc:"La guida richiesta non esiste. Torna alla panoramica della documentazione.",backToDocs:"Torna alla documentazione",badge:"Developer Platform"},DB={title:"In questa pagina",ariaLabel:"On this page"},LB={layout:jB,overview:_B,navGroups:TB,routes:RB,page:PB,toc:DB},OB={title:"Organization Admin",back:"Indietro",billing:{title:"Piano e posti",loading:"Caricamento…",summary:"{{planName}} · Dipendenti: {{employeeCount}}{{seatSuffix}}",seatSuffix:" · Posti acquistati (Stripe): {{seatCount}}
687",hint:"Aggiungendo dipendenti, i posti su Stripe aumentano solo quando superi quelli gia acquistati con il contratto Enterprise. Per modificare manualmente quantità o pagamenti usa il portale cliente.",manageBilling:"Gestisci fatturazione",increaseSeats:"Aumenta posti / piani",noEnterprise:"Nessun abbonamento Enterprise attivo per questa organizzazione.",portalError:"Impossibile aprire il portale di fatturazione."},employees:{title:"Employee",invite:"Invita dipendente",loading:"Caricamento...",empty:'Nessun employee in elenco oppure non hai permessi Admin. Usa "Invita dipendente" per aggiungere un utente.',table:{email:"Email",firstname:"Nome",surname:"Cognome",role:"Ruolo",actions:"Azioni",emptyValue:"—",resendPassword:"Reinvia password temporanea"}},inviteDialog:{title:"Invita dipendente via email",emailLabel:"Email *",emailPlaceholder:"[email protected]",firstnameLabel:"Nome",firstnamePlaceholder:"Mario",surnameLabel:"Cognome",surnamePlaceholder:"Rossi",hint:"Se l'email non esiste ancora verrà creato un utente Member. Se esiste già, verrà reimpostata una password temporanea e inviata via email.",cancel:"Annulla",submit:{loading:"Invio in corso...",default:"Invita"}},toast:{loadError:"Errore nel caricamento degli employee (serve ruolo Admin).",emailRequired:"Inserisci l'email.",inviteSuccess:"Invito inviato: è stata inviata una password temporanea all'email indicata.",inviteFailed:"Invito non riuscito.",networkError:"Errore di rete",resetSuccess:"Password temporanea inviata via email. L'employee dovrà cambiarla al prossimo accesso.",resetFailed:"Reset password non riuscito.",resetError:"Errore durante il reset password."}},MB={organizationAdmin:OB},IB={back:"Indietro",title:"Supporto",description:"Segnala un problema o richiedi assistenza. Compileremo un'email con i dettagli da inviare al team. Per integrazioni MCP, API, SDK e CLI consulta la documentazione Developer Platform.",docsLink:"documentazione Developer Platform"},zB={title:"Segnalazione problema",intro:"Descrivi il più possibile cosa è successo. Riceverai risposta all'indirizzo associato al tuo account{{emailSuffix}}.",emailSuffix:" ({{email}})",issueType:{label:"Tipo di problema",placeholder:"Seleziona una categoria",options:{bug:"Bug / malfunzionamento",integration:"Integrazione MCP / API",indexing:"Indicizzazione documenti",account:"Account e accesso",billing:"Abbonamento e fatturazione",other:"Altro"}},subject:{label:"Oggetto",placeholder:"Es. Errore connessione MCP in Cursor"},description:{label:"Descrizione",placeholder:"Cosa stavi facendo? Quale messaggio di errore hai visto?"},steps:{label:"Passi per riprodurre (opzionale)",placeholder:"1. Apro il connettore… 2. Copio l'URL MCP…"},submit:{loading:"Preparazione…",default:"Invia segnalazione"},footer:"Cliccando invio si aprirà il tuo client email con destinatario {{email}}."},FB={subjectPrefix:"[ArchivEye]",type:"Tipo: {{type}}",user:"Utente: {{name}}",email:"Email: {{email}}",descriptionHeader:"Descrizione:",stepsHeader:"Passi per riprodurre:",footer:"Inviato da ArchivEye — {{timestamp}}"},$B={requiredFields:"Compila tipo problema, oggetto e descrizione.",mailClientOpened:"Si aprirà il client email con il messaggio precompilato. Invia l'email per completare la segnalazione.",mailClientError:"Impossibile aprire il client email. Scrivi a {{email}}"},UB={header:IB,form:zB,email:FB,toast:$B},BB={sort:"Ordina",searchDocuments:"Cerca documenti",title:"Titolo",type:"Tipo",size:"Dimensione",modified:"Modificato",status:"Stato",folder:"Cartella",files:"File",name:"Nome",open:"Apri",view:"Visualizza",edit:"Modifica",delete:"Elimina",move:"Sposta",share:"Condividi...",requeue:"Rimetti in coda",cancel:"Annulla",confirm:"Conferma",close:"Chiudi",retry:"Riprova",now:"Ora",no:"No",yes:"Sì",filter:"Filtra",filtered:"Filtrato",deploy:"Deploy",deploying:"Deploy in corso...",loading:"Caricamento…",unnamed:"Senza nome",folderDefault:"Cartella"},HB={active:"Attivo",inactive:"Disattivato",inProgress:"In Progress",empty:"Vuoto",archived:"Archiviato"},GB={secondsAgo:"Pochi secondi fa",minutesAgo:"{{count}} minuti fa",hoursAgo:"{{count}} ore fa",daysAgo:"{{count}} giorni fa",weeksAgo:"{{count}} settimane fa"}
687,VB={documents:"Documenti",connectors:"Connettori"},qB={addResources:"Aggiungi Risorse",newConnector:"Nuovo Connettore",resourceManagement:"Gestione Risorse",connectorsTitle:"Connettori",yourFolders:"Le tue cartelle",createFolder:"Crea nuova cartella",folderNamePlaceholder:"Nome cartella",unclassifiedFiles:"File non classificati",sharedWithYou:"File condivisi con te",noDocuments:"Nessun documento trovato",noConnectors:"Nessun connettore trovato",noFilesSelected:"Nessun file selezionato",filesSelected:"File selezionati ({{count}})",connectorsSelected:"Connettori selezionati ({{count}})",noConnectorsSelected:"Nessun connettore selezionato",deleteSelected:"Elimina selezionati ({{count}})",rowsSelected:"{{selected}} di {{total}} righe selezionate.",rowsPerPage:"Righe per pagina",rows:"Righe",pageOf:"Pag. {{current}} / {{total}}",sortNameAZ:"Nome A-Z",sortWeightGb:"Peso GB",sortCreated:"Data Creazione",sortModified:"Data Modifica",gridViewAria:"Vista griglia",tableViewAria:"Vista tabella",openCollabAria:"Apri collaborazione",openDetail:"Apri dettaglio",disable:"Disattiva",disableCount:"Disattiva ({{count}})",activate:"Attiva",activateCount:"Attiva ({{count}})",sharedConnectorAria:"Connettore condiviso",sharedBadgeTitle:"Condivisa",sharedBadgeAria:"Mostra condivisioni",sharedWith:"Condivisa con",sharedLoading:"Caricamento...",sharedLoadError:"Impossibile caricare le condivisioni",noActiveShares:"Nessuna condivisione attiva.",directAccess:"Accessi diretti",groups:"Gruppi"},KB={shareFolder:"Condividi cartella",breadcrumbMain:"Home",emptyFolder:"Cartella vuota",noFilesFound:"Nessun file trovato",addFavorite:"Aggiungi a preferiti",removeFavorite:"Rimuovi preferito"},WB={title:"Nuovo Connettore",back:"Indietro",stepBase:"Informazioni base",stepResources:"Seleziona risorse",titleLabel:"Titolo",titlePlaceholder:"Nome Connettore",descriptionLabel:"Descrizione (facoltativa)",descriptionPlaceholder:"Se vuoi, aggiungi una nota per uso interno. La descrizione e i segnali per l'LLM (topic, parole chiave) vengono costruiti in automatico dall'indexing a partire dai metadati dei documenti selezionati.",descriptionHint:"Se lasci vuoto, al termine dell'indexing verrà generata una descrizione dai metadati di processing (riassunti, tag, keyword, entità) dei documenti della collection.",next:"Avanti",noFilesFound:"Nessun file trovato"},YB={backDashboard:"Dashboard",defaultName:"Connettore",invalid:"Connettore non valido.",notFound:"Non troviamo questo connettore. Torna alla dashboard e riprova.",readOnlyBanner:"Connettore condiviso con te in sola lettura. Non puoi aggiungere, rimuovere o modificare i documenti collegati.",linkedDocuments:"Documenti collegati",addDocuments:"Aggiungi documenti",searchLinked:"Cerca documenti collegati",noSearchResults:"Nessun documento corrisponde alla ricerca.",noLinkedDocuments:"Nessun documento collegato a questo connettore.",replace:"Sostituisci",removeFromConnector:"Rimuovi dal connettore",removeHint:"Rimuovere un documento dal connettore non elimina il file originale.",description:"Descrizione",noDescription:"Nessuna descrizione impostata per questo connettore.",howItWorks:"Come funziona",howItWorksDesc:"I documenti collegati vengono indicizzati e resi ricercabili dagli agenti AI collegati via MCP. Quando un documento risulta Pronto, è disponibile per le ricerche semantiche e full-text.",howItWorksOwnerExtra:" Puoi aggiungere o rimuovere documenti in qualsiasi momento.",connectorAccess:"Accesso al connettore",share:"Condividi",regenerateApiKey:"Rigenera API key",mcpInstructions:"Copia l'URL qui sotto e incollalo nella configurazione MCP del tuo agente (Cursor, ChatGPT, Claude, Aiden o altri client compatibili). Il connettore espone solo i documenti collegati.",linkUnavailable:"Link non disponibile al momento. Ricarica la pagina e riprova.",helpHint:"Per istruzioni dettagliate per client specifici, consulta la sezione Help & Integrazioni nelle Impostazioni.",documentsSelected:"Documenti selezionati ({{count}})",removeDialogTitle:"Rimuovi dal connettore",removeDialogSingle:"Il documento verrà scollegato da questo connettore ma resterà disponibile nelle tue cartelle.",removeDialogMultiple:"{{count}} documenti verranno scollegati da questo connettore ma resteranno disponibili nelle tue cartelle.",removing:"Rimozione…",remove:"Rimuovi",regenerateDialogTitle:"Rigenera API key del connettore",regenerateDialogDesc:"L'URL MCP cambierà immediatamente e smetterà di funzionare nei client già configurati. I vettori verranno ricostruiti sulla nuova chiave: l'indicizzazione riparte in automatico.",regenerating:"Rigenerazione…"},XB={logout:{title:"Conferma Logout",description:"Sei sicuro di voler uscire?"},moveFiles:{title:"Sposta file in cartella",description:"Seleziona la cartella di destinazione per {{count}} file.",destinationLabel:"Cartella di destinazione",destinationPlaceholder:"Seleziona una cartella",moving:"Spostamento..."},editFolder:{title:"Modifica {{name}}",description:"Modifica nome e colore della cartella",namePlaceholder:"Nome cartella",selectColorAria:"Seleziona colore {{color}}",saving:"Salvataggio..."},folderFilter:{title:"Filtra per Cartella",description:"Seleziona una cartella per filtrare i file",unclassifiedHint:"File senza cartella",fileCount:"{{count}} File"},addDocumentsToConnector:{title:"Aggiungi documenti al connettore",description:"Seleziona i documenti da collegare. Verranno indicizzati automaticamente per le ricerche MCP.",loading:"Caricamento documenti…",noMoreDocuments:"Nessun altro documento disponibile da aggiungere.",noDocuments:"Nessun documento trovato.",selectedCount:"{{count}} documento/i selezionato/i",adding:"Aggiunta in corso…",addCount:"Aggiungi ({{count}})"},replaceDocument:{title:"Sostituisci documento",description:"Sostituisci {{name}} con un altro documento. I chunk del documento attuale verranno rimossi dalla collection e verranno indicizzati quelli del sostituto.",noDocuments:"Nessun documento disponibile per la sostituzione.",replacing:"Sostituzione in corso…",replace:"Sostituisci"},folderBrowser:{title:"Esplora Cartella",empty:"Cartella vuota",foldersCount:"Cartelle ({{count}})",filesCount:"File ({{count}})"},collaboration:{title:"Collaborazione Enterprise",description:"Gestisci gruppi e accessi.",noResource:"Seleziona una risorsa per condividere.",noResourceSelected:"Nessuna risorsa selezionata",resourceFolder:"Cartella: {{name}}",resourceConnector:"Connettore: {{name}}",resourceDocument:"Documento: {{name}}",tabGroups:"Gruppi",tabSharing:"Condivisioni risorsa",newGroupPlaceholder:"Nome nuovo gruppo",create:"Crea",addMemberLabel:"Aggiungi membro a gruppo",selectGroup:"Seleziona gruppo",selectColleague:"Seleziona collega",add:"Aggiungi",membersCount:"{{count}} membri",noGroups:"Nessun gruppo creato.",shareHint:'Seleziona un documento o cartella dal menu "Condividi...".',shareDirectLabel:"Condividi con collega",shareDirect:"Condividi direct",shareGroupLabel:"Condividi con gruppo",shareGroup:"Condividi gruppo",directAccess:"Accessi diretti",noDirectAccess:"Nessun accesso diretto.",groupAccess:"Accessi gruppo",noGroupAccess:"Nessun accesso gruppo."}},QB={deleteFiles:"Eliminare {{count}} file selezionati? Questa azione non può essere annullata.",deleteFolder:'Eliminare la cartella "{{name}}"? Questa azione non può essere annullata.'},ZB={loadDocumentsError:"Errore nel caricamento dei documenti",fileDeleted:'"{{name}}" eliminato',deleteError:"Errore eliminazione",requeued:"Documento rimesso in coda",requeueError:"Errore nel rimettere in coda",generalFolderUnavailable:"Cartella generale non disponibile",movePartialSuccess:"{{succeeded}} file spostati, {{failed}} non riusciti",moveSuccess:"{{count}} file spostati con successo",moveFailed:"Impossibile spostare i file selezionati",moveError:"Errore durante lo spostamento dei file",selectDestinationFolder:"Seleziona una cartella di destinazione",deletePartialSuccess:"{{succeeded}} file eliminati, {{failed}} non riusciti",deleteBulkSuccess:"{{count}} file eliminati con successo",deleteBulkFailed:"Impossibile eliminare i file selezionati",deleteBulkError:"Errore durante l'eliminazione dei file selezionati",filesSelected:"{{count}} file selezionato/i: {{names}}",notAuthenticated:"Utente non autenticato",noFilesToUpload:"Nessun file da caricare",uploadedUnclassified:"File caricati nei documenti senza cartella",uploadMixed:"{{uploaded}} file caricati. {{transcription}} trascrizione audio/video avviata: segui il Task Manager in alto.",transcriptionStarted:"{{count}} trascrizione audio/video avviata. Segui l'avanzamento nel Task Manager in alto.",folderCreatedWithMixed:'Cartella "{{name}}" con {{uploaded}} file. {{transcription}} trascrizione avviata (Task Manager in alto).',folderCreatedWithTranscription:'Cartella "{{name}}" creata. {{count}} trascrizione avviata (Task Manager in alto).',folderCreatedWithFiles:'Cartella "{{name}}" creata con {{count}} file',folderCreated:'Cartella "{{name}}
687" creata',invalidFolderId:"ID cartella non valido",uploadToFolderMixed:"{{uploaded}} file caricati. {{transcription}} trascrizione audio/video avviata (Task Manager in alto).",uploadToFolderTranscription:"{{count}} trascrizione audio/video avviata (Task Manager in alto).",uploadToFolder:"{{count}} file caricato/i nella cartella",operationError:"Errore durante l'operazione",createFolderError:"Errore nella creazione della cartella",connectorDisabled:'Connettore "{{name}}" disattivato',disableConnectorError:"Errore disattivazione connettore",connectorActivated:'Connettore "{{name}}" attivato',activateConnectorError:"Errore attivazione connettore",connectorDeleted:'Connettore "{{name}}" eliminato',deleteConnectorError:"Errore eliminazione connettore",connectorsDeleted:"{{count}} connettori eliminati",deleteConnectorsError:"Errore eliminazione connettori",connectorsDisabled:"{{count}} connettori disattivati",disableConnectorsError:"Errore disattivazione connettori",connectorsActivated:"{{count}} connettori attivati",activateConnectorsError:"Errore attivazione connettori",folderUpdated:'Cartella "{{name}}" aggiornata',updateFolderError:"Errore nell'aggiornamento",folderDeleted:'Cartella "{{name}}" eliminata',deleteFolderError:"Errore eliminazione cartella",documentDeleted:"Documento eliminato",documentsDeleted:"{{count}} documenti eliminati",uploadFolderMixed:"{{uploaded}} file caricati. {{transcription}} trascrizione avviata (Task Manager in alto).",uploadFolderTranscription:"{{count}} trascrizione audio/video avviata (Task Manager in alto).",loadFoldersError:"Errore nel caricamento delle cartelle",loadFilesError:"Errore nel caricamento dei file",nameRequired:"Imposta prima un nome per procedere",selectAtLeastOneFile:"Seleziona almeno un file",noValidDocuments:"Nessun documento valido selezionato",connectorCreatedWithTask:'Connettore "{{name}}" creato. Indexing in coda (task {{taskId}}).',connectorCreated:'Connettore "{{name}}" creato. Indexing in coda.',createConnectorError:"Errore durante la creazione del connettore",loadConnectorError:"Impossibile caricare il connettore",urlCopied:"URL copiato",copyFailed:"Copia non riuscita",apiKeyRegenerated:"API key rigenerata. L'indicizzazione è ripartita: aggiorna l'URL MCP nel tuo client.",regenerateApiKeyError:"Errore durante la rigenerazione della API key",documentRemoved:"Documento rimosso dal connettore",documentsRemoved:"{{count}} documenti rimossi dal connettore",removeDocumentsError:"Errore durante la rimozione dei documenti",selectAtLeastOneDocument:"Seleziona almeno un documento",documentsAddedWithTask:"{{count}} documento/i aggiunti. Indexing in coda (task {{taskId}}).",documentsAdded:"{{count}} documento/i aggiunti. Indexing in coda.",addDocumentsError:"Errore durante l'aggiunta dei documenti",selectReplacement:"Seleziona un documento sostitutivo",documentReplacedWithTask:"Documento sostituito. Indexing in coda (task {{taskId}}).",documentReplaced:"Documento sostituito. Indexing in coda.",replaceDocumentError:"Errore durante la sostituzione del documento",collaborationLoadError:"Errore caricamento collaborazione",groupCreated:"Gruppo creato",groupCreateError:"Errore creazione gruppo",memberAdded:"Membro aggiunto",memberAddError:"Errore aggiunta membro",memberRemoved:"Membro rimosso",memberRemoveError:"Errore rimozione membro",shareUpdated:"Condivisione aggiornata",shareError:"Errore condivisione",groupShareUpdated:"Condivisione gruppo aggiornata",groupShareError:"Errore condivisione gruppo",accessRevoked:"Accesso revocato",revokeError:"Errore revoca",groupAccessRevoked:"Accesso gruppo revocato",groupRevokeError:"Errore revoca gruppo"},JB={loading:"Caricamento...",error:"Errore",folderLabel:"Cartella {{id}}",item:"elemento",items:"elementi",empty:"Nessun file o cartella presente",source:"Sorgente",unknownError:"Errore sconosciuto"},e9={root:"Root"},t9={title:"Task Center",polling:"Polling",documents:"Documenti",processingTotal:"Documenti in elaborazione: {{count}}",pendingInProgress:"{{pending}} in attesa — {{inProgress}} in corso",tabs:{tasks:"Task",notifications:"Notifiche"},loadingTasks:"Caricamento task...",noTasks:"Nessuna task recente",loadingNotifications:"Caricamento notifiche...",noNotifications:"Nessuna notifica disponibile",status:{QUEUED:"In coda",RUNNING:"In esecuzione",PARTIAL_SUCCESS:"Parziale",COMPLETED:"Completata",FAILED:"Fallita",CANCELLED:"Annullata"},notificationStatus:{QUEUED:"Task messa in coda",RUNNING:"Task in esecuzione",PARTIAL_SUCCESS:"Task completata parzialmente",COMPLETED:"Task completata",FAILED:"Task fallita",CANCELLED:"Task annullata"},cloudImportStats:"{{ok}}/{{total}} importati{{failedSuffix}}{{skippedSuffix}}",cloudImportFailed:", {{count}} falliti",cloudImportSkipped:", {{count}} saltati"},n9={connectAccount:"Collega account",connecting:"Connessione…",popupBlocked:"Impossibile aprire la finestra di login. Controlla il blocco popup.",oauthStartError:"Impossibile avviare OAuth",folderLoadError:"Errore caricamento cartella",onedriveAccessError:"Impossibile accedere a OneDrive/SharePoint",refresh:"Aggiorna",emptyFolder:"Cartella vuota",filesSelectedTotal:"{{count}} file selezionati in totale",selectFilesHint:"Seleziona uno o più file da importare. Le cartelle si aprono con un click.",googleNotConfigured:"Google Drive non configurato",googleNotConfiguredDesc:"Imposta GOOGLE_OAUTH_CLIENT_ID, GOOGLE_PICKER_API_KEY e GOOGLE_CLOUD_PROJECT_NUMBER nel BFF per abilitare l'integrazione.",googlePickerIncomplete:"Google Picker incompleto",googlePickerIncompleteDesc:"Imposta GOOGLE_CLOUD_PROJECT_NUMBER (solo cifre, es. 689764940009) nel .env del BFF — non il Project ID testuale.",connectGoogleTitle:"Collega il tuo account Google",connectGoogleExpired:"La connessione Google Drive è scaduta. Ricollega il tuo account per importare nuovi file.",connectGoogleDesc:"Per importare file da Google Drive, collega il tuo account. Verranno usati solo i file che selezioni dal picker.",connectedAs:"Collegato come",googleDefault:"Google",openingPicker:"Apertura picker…",importing:"Importazione…",chooseFromGoogleDrive:"Scegli file da Google Drive",googlePickerConfigError:"Configurazione Google Picker incompleta (client ID, API key o project number)",googlePickerOpenError:"Errore apertura Google Picker",fileImported:'"{{name}}" importato in Archiveye',filesImported:"{{count}} file importati in Archiveye",sharepointNotConfigured:"SharePoint non configurato",sharepointNotConfiguredDesc:"Imposta MS_OAUTH_CLIENT_ID e MS_OAUTH_CLIENT_SECRET nel BFF per abilitare l'integrazione.",connectMicrosoftTitle:"Collega il tuo account Microsoft",connectMicrosoftExpired:"La connessione Microsoft è scaduta. Ricollega il tuo account per importare nuovi file.",connectMicrosoftDesc:"Per importare file da SharePoint/OneDrive, collega il tuo account Microsoft. Verranno usati solo i file che selezioni.",microsoftDefault:"Microsoft",filesSelected:"File selezionati ({{count}})",importToArchiveye:"Importa in Archiveye",selectAtLeastOneFile:"Seleziona almeno un file",importError:"Errore importazione",googleDrive:"Google Drive",sharepointOneDrive:"SharePoint / OneDrive",chooseProvider:"Scegli il provider da cui importare"},i9={singleLink:"Singolo link",siteCrawl:"Crawl sito",selectFolderToContinue:"Seleziona una cartella per continuare.",urlLabel:"URL",urlPlaceholder:"https://esempio.com/pagina o file .pdf",loading:"Caricamento...",continue:"Continua",optionalFileName:"Nome file (opzionale)",fileNamePlaceholder:"es. documento.md",editHint:"Il testo estratto si modifica nel pannello laterale: apri l'anteprima prima di caricare in Archiveye.",previewAndEdit:"Anteprima e modifica",back:"Indietro",uploadToArchiveye:"Carica in Archiveye",crawlSeedLabel:"URL di partenza",crawlSeedPlaceholder:"https://esempio.com",depth:"Profondità",maxPages:"Max pagine",maxFiles:"Max file",sameDomainOnly:"Solo stesso dominio",includePatterns:"Includi pattern (opzionale, uno per riga o virgola)",includePatternsPlaceholder:`Esempio (sottostringhe nell'URL):
688/blog/
689/docs/api
690/it/guide`,excludePatterns:"Escludi pattern (opzionale)",excludePatternsPlaceholder:`Esempio:
691/_next/
692/static/
693/admin
694?download=
695.xml`,starting:"Avvio...",startCrawl:"Avvia crawl",youtubeNotSupported:"URL YouTube temporaneamente non supportato.",youtubeCrawlN
695otSupported:"URL YouTube temporaneamente non supportato nel crawl sito.",unsupportedFormat:"Formato file non supportato",noMarkdownExtracted:"Nessun markdown estratto da questa pagina",extractError:"Errore durante l'estrazione",uploadError:"Errore durante il caricamento",crawlStartError:"Errore durante l'avvio del crawl",webPageTitle:"Pagina web",knowledgeBase:"Knowledge Base",webResourceSaved:"Risorsa web salvata nella cartella",webIngestionStarted:"Task di ingestion web avviata"},r9={youtubeUrl:"YouTube URL",urlPlaceholder:"https://www.youtube.com/watch?v=...",hint:"Incolla un link YouTube. Il contenuto viene trascritto e salvato come documento nella cartella selezionata.",processing:"Elaborazione...",transcribeAndSave:"Trascrivi e salva",invalidYoutubeUrl:"Inserisci un URL YouTube valido (youtube.com o youtu.be).",transcriptionStarted:"Trascrizione YouTube avviata in background. Il documento apparirà quando sarà pronto.",ingestionError:"Errore durante ingestion YouTube",youtubeResourceSaved:"Risorsa YouTube salvata nella cartella"},s9={title:"Aggiungi risorse",selectSourceDesc:"Seleziona da dove vuoi caricare la tua risorsa",source:"Sorgente",selectOption:"Seleziona un opzione",fromPc:"Aggiungi file da PC",externalDrive:"External Drive",webUrl:"Web URL",next:"Avanti",selectFolder:"Seleziona una cartella",unclassifiedTitle:"Documenti senza cartella",unclassifiedHint:"Agg
695iungi senza assegnare a una cartella",noFolder:"Senza cartella",uploadToFolder:"Inserisci risorse nella cartella",uploadFiles:"Carica i file",dragOrUpload:"Trascina o carica",webFolderRequired:"Per le risorse web è obbligatoria una cartella dedicata.",externalDriveFolderRequired:"Per External Drive è obbligatoria una cartella dedicata.",shareNow:"Condividi ora",withColleague:"Con collega",withGroup:"Con gruppo",folderCreatedShareFailed:"Cartella creata, ma condivisione fallita: {{message}}",folderCreatedShareFailedGeneric:"Cartella creata, ma la condivisione non e' riuscita",createFolderError:"Errore creazione cartella"},a9={common:BB,status:HB,time:GB,tabs:VB,dashboard:qB,folderView:KB,newMcp:WB,connectorDetail:YB,dialogs:XB,confirms:QB,toasts:ZB,folderFilesViewer:JB,folderBrowser:e9,taskCenter:t9,cloud:n9,webIngestion:i9,audioIngestion:r9,addResourceFlow:s9},o9={alt:"ArchivEye Logo",altShort:"ArchivEye"},l9={back:"Back",cancel:"Cancel",loading:"Loading...",logout:"Log out",settings:"Settings"},c9={storage:{title:"Storage space",remaining:"{{amount}} GB remaining"}},u9={loading:"Loading..."},d9={inProgress:{label:"Processing",title:"Processing in progress"},completed:{label:"Ready",title:"Ready"},failed:{label:"Error",title:"Processing failed"},pending:{label:"Pending",title:"Waiting to be processed"}},h9={knowledgeBase:"Knowledge Base",documentPreview:"Document preview",editMarkdown:"Edit markdown",content:"Content",size:"Size",lastUpdated:"Last updated",editHint:"Edit the text here; close the panel when you're done.",previewReadOnly:"Read-only document preview.",previewMarkdownReadOnly:"Read-only markdown preview.",audioSource:"Source audio",videoSource:"Source video",officePreview:"Office document preview",imagePreviewAlt:"Image preview",readFileError:"Failed to read file",textReadError:"Error reading text",openFileError:"Unable to open file",downloadFailed:"Download failed",loadingDocument:"Loading document…",loadingContent:"Loading content…",noDocumentToView:"No document to display.",useSidebarPlayer:"Use the sidebar player to listen or watch the file while reviewing the content.",loadingPdf:"Loading PDF…",pdfViewError:"Unable to display the PDF.",loadingText:"Loading text…",previewUnavailable:"Preview not available for {{format}}.",thisFormat:"this format",openOrDownload:"Open or download file",download:"Download",downloading:"Downloading…",youtubeUrl:"YouTube URL",sourceUrl:"Source URL"},f9={logo:o9,actions:l9,userProfile:c9,protectedRoute:u9,documentStatus:d9,markdown:h9},p9={welcomeTitle:"Welcome back to ArchivEye",emailLabel:"Email",emailPlaceholder:"Your email",passwordLabel:"Password",passwordPlaceholder:"Your password",submit:"Sign in",submitLoading:"Signing in...",noAccount:"Don't have an account?",registerLink:"Register",forgotPassword:"Forgot your password?",termsLink:"Terms of Service",privacyLink:"Privacy Policy",toast:{credentialsRequired:"Please enter email and password.",loading:"Signing in...",success:"Signed in successfully!",invalidCredentials:"Invalid credentials or server error."}},m9={choose:{title:"How do you want to use ArchivEye?",subtitle:"Choose an account type to continue with registration.",personal:{title:"Personal",description:"For personal use. We'll create a dedicated workspace for you without requiring company details.",cta:"Register as Personal"},business:{title:"Business",description:"For companies and teams. Enter your organization details and manage multiple users.",cta:"Register as Business"},hasAccount:"Already have an account?",loginLink:"Sign in"},form:{back:"Back",titlePersonal:"Create Personal account",titleBusiness:"Switch to Business",subtitlePersonal:"Fill in the fields to register",subtitleBusiness:"Create a Business account and enter your organization details.",fields:{firstname:"First name",surname:"Last name",companyData:"Company details",organizationName:"Company name *",organizationEmail:"Company email (optional)",organizationVat:"VAT number (optional)",city:"City",zipCode:"ZIP code",address:"Address",province:"Province",country:"Country",email:"Email",password:"Password"},placeholders:{firstname:"First name",surname:"Last name",organizationName:"Your company name",organizationEmail
695:"[email protected]",organizationVat:"IT12345678901",city:"Milan",zipCode:"20100",address:"123 Example St",province:"MI",country:"Italy",email:"Your email",password:"At least 6 characters"},submit:{loading:"Creating account...",default:"Register and Choose Plan"}},legal:{acceptTermsPrefix:"I accept the",acceptPrivacyPrefix:"I accept the",termsLink:"Terms of Service",privacyLink:"Privacy Policy",legalFooter:"Terms of Service",legalFooterPrivacy:"Privacy Policy"},toast:{success:"Registration complete!",organizationNameRequired:"Enter the company name.",acceptTermsRequired:"You must accept the Terms of Service",acceptPrivacyRequired:"You must accept the Privacy Policy",requiredFields:"Please fill in all required fields.",creating:"Creating account...",accountCreated:"Account created!",error:"Error during registration."}},g9={title:"Recover your password",titleHighlight:"password",description:"Enter your email and we'll send you a link to reset your password.",emailLabel:"Email",emailPlaceholder:"Your email",submit:{loading:"Sending...",default:"Send reset email"},rememberPassword:"Remember your password?",loginLink:"Sign in",success:{title:"Email sent successfully",titleHighlight:"success",description:"Check your inbox for the password reset link. If you don't see it right away, check spam or junk mail.",backToLogin:"Back to Login",notReceived:"Didn't receive the email?",retry:"Try again"},toast:{emailRequired:"Please enter your email.",sending:"Sending reset email...",success:"Reset email sent successfully.",error:"Error sending email."}},x9={title:"Sign in to ArchivEye",subtitle:"This window will close automatically after login",emailLabel:"Email",emailPlaceholder:"Your email",passwordLabel:"Password",passwordPlaceholder:"Your password",submit:{loading:"Signing in...",default:"Sign in"},toast:{credentialsRequired:"Please enter email and password.",loading:"Signing in...",success:"Signed in successfully!",invalidCredentials:"Invalid credentials or server error.",returnToChat:"You can return to the chat!"}},v9={title:"Verifying sign-in",subtitle:"We're completing final checks before bringing you back to the platform.",processing:"Verifying your session...",success:{message:"Session restored successfully.",redirect:"Taking you to the dashboard now."},error:{hint:"You can return to login and try again without losing your platform context.",backToLogin:"Back to login",createAccount:"Create account",default:"We couldn't complete authentication.",loginRequired:"Your session has expired. Please sign in again.",accessDenied:"Sign-in cancelled. Try again whenever you like.",generic:"Authentication not completed. Try again in a moment."}},b9={title:"How do you want to sign in?",subtitle:"Your email matches the tenant email. Choose an option.",orgAdmin:{title:"Organization Admin",description:"Manage organization employees and activate new users via email (redeem).",cta:"Enter as Admin"},dataPlatform:{title:"Data Platform",description:"Access the data platform: AI, documents, and chat.",cta:"Enter the platform"}},y9={title:"Change password",description:"Your password has been reset. Enter the temporary password received by email and choose a new password to continue.",fields:{oldPassword:"Current password (temporary)",newPassword:"New password",confirmPassword:"Confirm new password"},placeholders:{oldPassword:"Temporary password",newPassword:"At least 8 characters",confirmPassword:"Repeat new password"},aria:{hidePassword:"Hide password",showPassword:"Show password"},submit:{loading:"Saving...",default:"Save new password"},toast:{mismatch:"New password and confirmation do not match.",minLength:"New password must be at least 8 characters.",sameAsOld:"New password must be different from the current password.",success:"Password updated. You can continue using the app.",error:"Error changing password."}},w9={login:p9,register:m9,forgotPassword:g9,loginChat:x9,callback:v9,chooseRole:b9,changePassword:y9},S9={back:"Back",no:"No",yes:"Yes",cancel:"Cancel",save:"Saving...",confirm:"Confirm",logout:"Log out",organizationAdmin:"Organization Admin",forDevs:"For Devs"},C9={title:"Settings",subtitle:"Manage your account settings",backAria:"Back",logoAria:"ArchivEye"},E9={ariaLabel:"Settings sections",account:"Account",subscription:"Subscription",helpIntegrations:"Help & Integrations"}
695,A9={label:"Appearance",ariaLabel:"Application theme",light:"Light",dark:"Dark",system:"System"},k9={label:"Language",ariaLabel:"Application language",italian:"Italian",english:"English"},N9={title:"Account",subtitle:"Profile, storage space, and account settings",storage:{title:"Storage space",description:"Storage available on your account for indexed documents.",loading:"Loading storage space...",noLimit:"Plan with no storage limit configured.",loadError:"Unable to load storage information.",used:"Used",available:"Available",gbRemaining:"GB remaining",ariaLabel:"Storage space: {{remainingGb}} GB remaining",legendHint:"Hover over the chart or legend for details."},profile:{title:"Profile",company:"Company",role:"Role",name:"Name",email:"Email",emailHint:"Email is managed by your login account and cannot be changed here.",save:"Save changes",saving:"Saving..."},apiKey:{title:"API Key",description:"Treat this key like a password: do not share it or commit it to public repositories.",regenerateWarning:"If you regenerate the key, the previous one stops working immediately.",regenerate:"Regenerate API key",generate:"Generate your API key"},changePassword:{title:"Change password",description:"Enter your current and new password. The change is applied directly to your Keycloak account. If you forgot your current password, use reset from the login page.",current:"Current password",new:"New password",confirm:"Confirm new password",newPlaceholder:"At least 8 characters",confirmPlaceholder:"Repeat new password",submit:"Change password",submitting:"Saving..."}},j9={title:"Connected accounts",description:"Connect Google Drive or SharePoint/OneDrive to import documents directly into ArchivEye.",empty:"No cloud account connected.",disconnect:"Disconnect",connectGoogle:"Connect Google Drive",connectMicrosoft:"Connect SharePoint / OneDrive",noProvider:"No cloud provider configured by the administrator.",providers:{google:"Google Drive",microsoft:"SharePoint / OneDrive"},confirmDisconnect:"Disconnect {{provider}}? Already imported documents remain in ArchivEye."},_9={title:"Subscription",subtitle:"Manage your subscription plan and billing settings",loading:"Loading subscription information...",autoRenewOff:"Automatic renewal disabled",autoRenewOffUntilDate:"The subscription will not renew automatically and will remain active until {{date}}.",autoRenewOffUntilPeriod:"The subscription will not renew automatically until the end of the current period.",plan:"Plan {{name}}",perSeatMonth:"per user / month",perMonth:"per month",subscriberType:"Subscriber type",organization:"Organization",personal:"Personal",seats:"Included seats",renewal:"Expiry/Renewal",manageBilling:"Manage Billing and Payments",cancelAutoRenew:"Cancel automatic renewal",upgradeTitle:"Need more features?",upgradeDescription:"You can change plans anytime to adapt ArchivEye to your growing needs.",viewPlans:"View all plans",emptyTitle:"No active subscription",emptyDescription:"You are currently using the free version of ArchivEye. Choose a plan to unlock more features.",choosePlan:"Choose a Plan"},T9={title:"Help & Integrations",subtitle:"Learn how to integrate ArchivEye into your AI agents via MCP, manage your API key, and find answers to common questions.",singleConnector:"Single connector",singleConnectorHint:"Connect an agent to a specific connector. Copy the MCP URL from the connector detail page in the dashboard.",allConnectors:"All connectors",allConnectorsHint:"Access all connectors in your profile with your user API key at endpoint /user/{api_key}/mcp.",docsLink:"Full documentation for MCP, SDK, and CLI in the <docsLink>Developer Platform docs</docsLink>.",contactSupport:"Contact support",faqTitle:"Frequently asked questions"},R9={scopeCollection:"this connector",scopeUser:"all connectors in your account",urlHintCollection:"the connector MCP URL (visible on the connector detail page)",urlHintUser:"your account MCP URL (format /user/{api_key}/mcp, using your user API key)",authHintCollection:"The connector URL already includes authentication.",authHintUser:"Use your user API key in the URL or headers, as indicated by the client.",clients:{aiden:"Aiden",claude:"Claude",chatgpt:"GPT",curs
695or:"Cursor",others:"Others"},cursor:{title:"Configuration in Cursor IDE",description:"Cursor natively supports MCP to extend AI capabilities with data from {{scope}}.",steps:{1:"Open Cursor settings (<kbd>Cmd+,</kbd> on Mac or <kbd>Ctrl+,</kbd> on Windows).",2:"Go to the <strong>Tools</strong> section and select <strong>MCP</strong>.",3:"Click <strong>+ Add new MCP server</strong>.",4:'Enter a name (e.g. "ArchivEye") and select type <strong>http</strong>.',5:"Enter {{urlHint}}.",6:"Click <strong>Save</strong>. Cursor will automatically load the available tools."}},chatgpt:{title:"Configuration in ChatGPT",description:"Integrate ArchivEye directly into ChatGPT chats for {{scope}}.",steps:{1:"Open ChatGPT settings.",2:"Make sure <strong>Developer Mode</strong> or access to <strong>Connected Apps</strong> is enabled.",3:"Find the <strong>MCP / Third-party tool connections</strong> section.",4:"Add a new connection using {{urlHint}}.",5:"Configure any authentication headers if required.",6:"Once connected, ChatGPT can query your documents during the conversation."}},claude:{title:"Configuration in Claude Desktop",description:"Use your ArchivEye data within the Claude desktop app.",scopeWordCollection:"of the connector",scopeWordUser:"account",configCollection:`{
696  "mcpServers": {
697    "archiveye": {
698      "url": "https://<host-mcp>/collection/<api_key_connettore>/mcp"
699    }
700  }
701}`,configUser:`{
702  "mcpServers": {
703    "archiveye": {
704      "url": "https://<host-mcp>/user/<api_key_utente>/mcp"
705    }
706  }
707}`,steps:{1:"Open <strong>Claude Desktop</strong>.",2:"Go to <strong>Settings</strong> > <strong>Developer</strong> and click <strong>Edit Config</strong>.",3:"In the JSON file, add the MCP server under <code>mcpServers</code>. For HTTP Streamable clients use the {{scopeWord}} URL:",4:"Save the file and fully restart Claude Desktop.",5:"The hammer icon in the bottom-right corner confirms that the connector is active."}},aiden:{title:"Configuration in Aiden",description:"Connect ArchivEye to Aiden to query {{scope}} via MCP.",steps:{1:"Open <strong>Aiden</strong> and go to integration or external connector settings.",2:"Select <strong>Add MCP server</strong> (or equivalent) and choose the <strong>HTTP / Streamable HTTP</strong> transport.",3:'Give the connector a name (e.g. "ArchivEye") and paste {{urlHint}}.',4:"If Aiden requires additional authentication, use the same API key configured in ArchivEye or the headers indicated in the client documentation.",5:"Save and verify that MCP tools (search, document listing, etc.) are available in the session."}},others:{title:"Other MCP-compatible clients",description:"Any agent or IDE supporting MCP over HTTP Streamable can use ArchivEye for {{scope}}.",steps:{1:"In the client documentation, find the <strong>MCP servers</strong> or <strong>tool connections</strong> section.",2:"Create a new <strong>HTTP</strong> server (Streamable HTTP, spec 2025-03-26).",3:"Set the endpoint to {{urlHint}}.",5:"After connecting, try a semantic search on the documents to confirm the tools respond correctly.","4Collection":"For a single connector, copy the URL from the connector detail page in the dashboard.","4User":"For access to all connectors, use the /user/{api_key}/mcp URL with the user API key from settings."}}},P9={connectorMcp:{q:"What is an MCP connector?",a:"A connector exposes linked documents via MCP (Model Context Protocol). Agents like Cursor, ChatGPT, or Aiden can search and read indexed documents without manually uploading them to chat."},collectionVsUser:{q:"What is the difference between a single connector and user account?",a:"The connector exposes only linked documents (URL /collection/{api_key}/mcp). The user account endpoint (/user/{api_key}/mcp) lets you access all connectors in your profile and choose which to work with during conversation."},apiKey:{q:"What is the user API key for?",a:"The user API key authenticates external integrations to the account MCP endpoint and other compatible services. Keep it secure: if you regenerate it, existing integrations must be updated."},indexing:{q:"Why is a document not searchable?",a:"Documents must complete indexing (Ready status) before they can be queried via MCP. Check status in the dashboard and, if needed, start reprocessing from the file detail."},regenerate:{q:"What happens if I regenerate the API key?",a:"The previous key is invali
707dated immediately. All MCP connections or external clients using it will stop working until you update the configured URL or credentials."}},D9={logout:{title:"Confirm log out",description:"Are you sure you want to log out?"},regenerateApiKey:{titleRegenerate:"Confirm API key regeneration",titleGenerate:"Confirm API key generation",descRegenerate1:"Regenerating the API key will invalidate the previous key immediately.",descRegenerate2:"Already configured integrations must be updated and active sessions or connections using the current key may be interrupted.",descGenerate:"Enter your current password to create your API key and use it in external integrations.",passwordLabel:"Current password",passwordPlaceholder:"Enter password to confirm",confirmRegenerate:"Confirm and regenerate",confirmGenerate:"Confirm and generate",regenerating:"Regenerating...",generating:"Generating..."},cancelSubscription:{title:"Cancel automatic renewal",intro:"You are about to disable automatic renewal for plan {{planName}}. The subscription will remain usable until the already paid period expires; no further charges will be made.",accessUntil:"Access guaranteed until {{date}}.",confirmInstruction:"To confirm, type {{word}} in the field below.",confirmLabel:'Type "{{word}}" to confirm',confirmWord:"Cancel",back:"Back",submit:"Cancel subscription",submitting:"Cancelling..."}},L9={portalError:"Unable to access the payment management portal.",passwordMismatch:"New password and confirmation do not match.",passwordMinLength:"New password must be at least 8 characters.",passwordSame:"New password must differ from the current password.",passwordUpdated:"Password updated successfully.",passwordError:"Error changing password.",settingsUpdated:"Settings updated successfully!",settingsError:"Error updating settings",apiKeyUnavailable:"API key unavailable.",apiKeyCopied:"API key copied.",apiKeyCopyError:"Unable to copy API key.",passwordRequired:"Enter your current password to confirm.",apiKeyRegenerated:"API key regenerated successfully.",apiKeyGenerated:"API key generated successfully.",apiKeyRegenerateError:"Error regenerating API key.",connectedAccountsLoadError:"Error loading accounts",connectedSuccess:"{{provider}} account connected",connectError:"Connection error",disconnected:"Account disconnected",disconnectError:"Error during disconnection",cancelSuccessWithDate:"Auto-renewal disabled. Subscription remains active until {{date}}.",cancelSuccess:"Auto-renewal disabled. Subscription remains active until the end of the current period.",cancelError:"Unable to cancel subscription."},O9={common:S9,header:C9,nav:E9,appearance:A9,language:k9,account:N9,connectedAccounts:j9,subscription:_9,help:T9,integrations:R9,faq:P9,dialogs:D9,toasts:L9},M9={loading:"Loading plans...",back:"Back",title:"Choose the right plan for you",subtitle:"Unlock ArchivEye's full potential with our flexible subscription options.",interval:{yearly:"Annual",monthly:"Monthly",yearlyNote:"With the annual plan you pay for 10 months out of 12; the price shown is always per month."},sections:{personal:"Personal Plans",business:"Business Plans"},upgradeToBusiness:"Switch to Business",perMonth:"/month",badges:{currentPlan:"YOUR PLAN",mostPopular:"MOST POPULAR"},planCard:{includes:"What's included:",enterpriseBase:"Base fee (1 admin seat).",enterpriseExtraSeat:" + €{{price}}/month per additional license.",enterpriseMinSeats:" Minimum {{count}} licenses.",buttons:{currentPlan:"Current plan",redirecting:"Redirecting...",activateTrial:"Start trial – Enter card",upgrade:"Upgrade"}},defaultFeatures:{dataSources:"Access to all data sources",aiAnalysis:"Unlimited AI document analysis",prioritySupport:"Priority support",realtimeUpdates:"Real-time updates"},seatDialog:{title:"Number of licenses",description:"Enter how many licenses (seats) you want for the Business plan. Minimum {{min}} licenses{{planSuffix}}. You can change the number later from the billing portal.",planSuffix:" for {{planName}}",licensesLabel:"Licenses",estimatedTotal:"Estimated total: €{{amount}}/month",annualBilling:"Billed €{{amount}} per year",licenseBreakdown:"For {{count}} licenses (base fee + additional seats).",cancel:"Cancel",continueToStripe:"C
707ontinue to Stripe",redirecting:"Redirecting..."},toast:{loadError:"Unable to load subscription plans.",trialCard:"Enter your card details to activate the trial period.",checkoutError:"Error creating payment session.",minSeats:"Enter at least {{count}} licenses for this plan."}},I9={back:"Back",title:"Billing",subtitle:"Manage your subscription and payment methods",loading:"Loading...",active:{planTitle:"Plan {{planName}}",status:"Status: {{status}}",description:"You can update your payment method, download invoices, or change plans from the Stripe portal.",manageBilling:"Manage billing and payments",viewPlans:"View all plans"},empty:{title:"No active subscription",description:"Choose a plan to unlock features and manage billing.",choosePlan:"Choose a plan"},backToDashboard:"Back to Dashboard"},z9={title:"Payment successful!",description1:"Thank you for completing your ArchivEye plan setup.",description2:"Your account has been updated. You can go to the dashboard or manage billing from the dedicated page.",goToDashboard:"Go to Dashboard",waiting:"Please wait...",manageBilling:"Manage billing",toast:{activated:"Subscription activated successfully!",confirmError:"Unable to confirm subscription. Try again from the billing page."}},F9={title:"Payment cancelled",description1:"You cancelled the session. No charge was made.",description2:"You can try again anytime from the plans page or return to the dashboard.",backToPricing:"Back to plan selection",goToDashboard:"Go to Dashboard",toast:"Payment setup was cancelled."},$9={pricing:M9,billing:I9,success:z9,cancel:F9},U9={title:"ArchivEye Docs",subtitle:"Developer Platform",login:"Sign in",navAria:"Documentation",overview:"Overview"},B9={badge:"Developer Platform",title:"Integrate ArchivEye into your stack",subtitle:"Connect AI agents, scripts, and backends to your knowledge bases with MCP (Claude connector, ChatGPT plugin, Cursor, OAuth), the TypeScript SDK, and CLI. Upload, search, ingest, and webhooks on the same platform.",startMcp:"Get started with MCP",auth:"Authentication",howItWorks:"How it works",howItWorksDesc:"A typical flow: authentication, document ingest, automatic indexing, and consumption via search or webhooks.",step1Title:"Authenticate",step1Desc:"Generate an employee API key (aek-…) from Settings → API key. Use it as REST Bearer token or in the MCP URL.",step2Title:"Upload and index",step2Desc:"Upload via SDK, CLI, or ingest job. The processing pipeline extracts text, generates embeddings, and indexes in Qdrant.",step3Title:"Search and integrate",step3Desc:"MCP agents or searchSemantic in the SDK query collections. Webhooks notify ingest completion.",readGuide:"Read the guide",baseUrlTitle:"Base URL and environments",restApi:"REST API (BFF)",mcpStreamable:"MCP (Streamable HTTP)",mcpOAuthHint:"OAuth: /user/mcp · API key: /user/{api_key}/mcp"},H9={integrations:{label:"Integrations",description:"Connect IDEs and AI agents to your data."},tools:{label:"Tools",description:"SDK and CLI for automations and backends."},reference:{label:"Reference",description:"Authentication, events, and operational details."}},G9={mcp:{title:"MCP",description:"MCP for Claude (connector), ChatGPT (plugin), Cursor, and OAuth spec."},sdk:{title:"TypeScript SDK",description:"REST client, MCP, and webhook verification for Node.js and TypeScript."},cli:{title:"CLI",description:"Terminal commands for upload, ingest, search, and webhooks."},auth:{title:"Authentication",description:"Employee API key, Bearer token, account vs collection scope."},webhooks:{title:"Webhooks",description:"Endpoints, HMAC signature, ingest events, and delivery retries."}},V9={notFoundTitle:"Page not found",notFoundDesc:"The requested guide does not exist. Return to the documentation overview.",backToDocs:"Back to documentation",badge:"Developer Platform"},q9={title:"On this page",ariaLabel:"On this page"},K9={layout:U9,overview:B9,navGroups:H9,routes:G9,page:V9,toc:q9},W9={title:"Organization Admin",back:"Back",billing:{title:"Plan and seats",loading:"Loading…",summary:"{{planName}} · Employees: {{employeeCount}}{{seatSuffix}}
707",seatSuffix:" · Purchased seats (Stripe): {{seatCount}}",hint:"When adding employees, Stripe seats increase only when you exceed those already purchased with the Enterprise contract. To manually change quantity or payments, use the customer portal.",manageBilling:"Manage billing",increaseSeats:"Increase seats / plans",noEnterprise:"No active Enterprise subscription for this organization.",portalError:"Unable to open billing portal."},employees:{title:"Employees",invite:"Invite employee",loading:"Loading...",empty:`No employees listed or you don't have Admin permissions. Use "Invite employee" to add a user.`,table:{email:"Email",firstname:"First name",surname:"Last name",role:"Role",actions:"Actions",emptyValue:"—",resendPassword:"Resend temporary password"}},inviteDialog:{title:"Invite employee by email",emailLabel:"Email *",emailPlaceholder:"[email protected]",firstnameLabel:"First name",firstnamePlaceholder:"John",surnameLabel:"Last name",surnamePlaceholder:"Doe",hint:"If the email doesn't exist yet, a Member user will be created. If it already exists, a temporary password will be reset and sent by email.",cancel:"Cancel",submit:{loading:"Sending...",default:"Invite"}},toast:{loadError:"Error loading employees (Admin role required).",emailRequired:"Enter the email.",inviteSuccess:"Invitation sent: a temporary password was sent to the specified email.",inviteFailed:"Invitation failed.",networkError:"Network error",resetSuccess:"Temporary password sent by email. The employee must change it on next login.",resetFailed:"Password reset failed.",resetError:"Error during password reset."}},Y9={organizationAdmin:W9},X9={back:"Back",title:"Support",description:"Report an issue or request assistance. We'll prepare an email with the details to send to the team. For MCP, API, SDK, and CLI integrations, see the Developer Platform documentation.",docsLink:"Developer Platform documentation"},Q9={title:"Report an issue",intro:"Describe what happened in as much detail as possible. You'll receive a reply at the address associated with your account{{emailSuffix}}.",emailSuffix:" ({{email}})",issueType:{label:"Issue type",placeholder:"Select a category",options:{bug:"Bug / malfunction",integration:"MCP / API integration",indexing:"Document indexing",account:"Account and access",billing:"Subscription and billing",other:"Other"}},subject:{label:"Subject",placeholder:"E.g. MCP connection error in Cursor"},description:{label:"Description",placeholder:"What were you doing? What error message did you see?"},steps:{label:"Steps to reproduce (optional)",placeholder:"1. Open the connector… 2. Copy the MCP URL…"},submit:{loading:"Preparing…",default:"Send report"},footer:"Clicking send will open your email client with recipient {{email}}."},Z9={subjectPrefix:"[ArchivEye]",type:"Type: {{type}}",user:"User: {{name}}",email:"Email: {{email}}",descriptionHeader:"Description:",stepsHeader:"Steps to reproduce:",footer:"Sent from ArchivEye — {{timestamp}}"},J9={requiredFields:"Fill in issue type, subject, and description.",mailClientOpened:"Your email client will open with a pre-filled message. Send the email to complete the report.",mailClientError:"Unable to open email client. Write to {{email}}"},eH={header:X9,form:Q9,email:Z9,toast:J9},tH={sort:"Sort",searchDocuments:"Search documents",title:"Title",type:"Type",size:"Size",modified:"Modified",status:"Status",folder:"Folder",files:"Files",name:"Name",open:"Open",view:"View",edit:"Edit",delete:"Delete",move:"Move",share:"Share...",requeue:"Requeue",cancel:"Cancel",confirm:"Confirm",close:"Close",retry:"Retry",now:"Now",no:"No",yes:"Yes",filter:"Filter",filtered:"Filtered",deploy:"Deploy",deploying:"Deploying...",loading:"Loading…",unnamed:"Unnamed",folderDefault:"Folder"},nH={active:"Active",inactive:"Disabled",inProgress:"In progress",empty:"Empty",archived:"Archived"},iH={secondsAgo:"A few seconds ago",minutesAgo:"{{count}} minutes ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",weeksAgo:"{{count}} weeks ago"},rH={documents:"Documents",connectors:"Connectors"},sH={addResources:"Add resources",newConnector:"New connector",resourceManagement:"Resource management",connectorsTitle:"Connectors",yourFolders:"Your folders",createFolder:"Create new folder",folderNamePlaceholder:"Folder name",unclassifiedFiles:"Unclassified files",sharedWithYou:"Files shared with you",noDocuments:"No documents found",noConnectors:"No connectors found",noFilesSelected:"No files selected",filesSelected:"Selected files ({{count}})",connectorsSelected:"Selected connectors ({{count}})",noConnectorsSelected:"No connectors selected",deleteSelected:"Delete selected ({{count}})",rowsSelected:"{{selected}} of {{total}} rows selected.",rowsPerPage:"Rows per page",rows:"Rows",pageOf:"Page {{current}} / {{total}}",sortNameAZ:"Name A-Z",sortWeightGb:"Size GB",sortCreated:"Created date",sortModified:"Modified date",gridViewAria:"Grid view",tableViewAria:"Table view",o
707penCollabAria:"Open collaboration",openDetail:"Open detail",disable:"Disable",disableCount:"Disable ({{count}})",activate:"Enable",activateCount:"Enable ({{count}})",sharedConnectorAria:"Shared connector",sharedBadgeTitle:"Shared",sharedBadgeAria:"Show shares",sharedWith:"Shared with",sharedLoading:"Loading...",sharedLoadError:"Unable to load shares",noActiveShares:"No active shares.",directAccess:"Direct access",groups:"Groups"},aH={shareFolder:"Share folder",breadcrumbMain:"Home",emptyFolder:"Empty folder",noFilesFound:"No files found",addFavorite:"Add to favorites",removeFavorite:"Remove favorite"},oH={title:"New connector",back:"Back",stepBase:"Basic information",stepResources:"Select resources",titleLabel:"Title",titlePlaceholder:"Connector name",descriptionLabel:"Description (optional)",descriptionPlaceholder:"Optionally add an internal note. The description and LLM signals (topics, keywords) are built automatically during indexing from the metadata of the selected documents.",descriptionHint:"If left empty, a description will be generated after indexing from processing metadata (summaries, tags, keywords, entities) of the collection documents.",next:"Next",noFilesFound:"No files found"},lH={backDashboard:"Dashboard",defaultName:"Connector",invalid:"Invalid connector.",notFound:"We could not find this connector. Go back to the dashboard and try again.",readOnlyBanner:"This connector was shared with you as read-only. You cannot add, remove, or edit linked documents.",linkedDocuments:"Linked documents",addDocuments:"Add documents",searchLinked:"Search linked documents",noSearchResults:"No documents match your search.",noLinkedDocuments:"No documents linked to this connector.",replace:"Replace",removeFromConnector:"Remove from connector",removeHint:"Removing a document from the connector does not delete the original file.",description:"Description",noDescription:"No description set for this connector.",howItWorks:"How it works",howItWorksDesc:"Linked documents are indexed and made searchable by AI agents connected via MCP. When a document is Ready, it is available for semantic and full-text search.",howItWorksOwnerExtra:" You can add or remove documents at any time.",connectorAccess:"Connector access",share:"Share",regenerateApiKey:"Regenerate API key",mcpInstructions:"Copy the URL below and paste it into your agent MCP configuration (Cursor, ChatGPT, Claude, Aiden, or other compatible clients). The connector exposes only linked documents.",linkUnavailable:"Link unavailable at the moment. Reload the page and try again.",helpHint:"For detailed instructions for specific clients, see Help & Integrations in Settings.",documentsSelected:"Selected documents ({{count}})",removeDialogTitle:"Remove from connector",removeDialogSingle:"The document will be unlinked from this connector but will remain available in your folders.",removeDialogMultiple:"{{count}} documents will be unlinked from this connector but will remain available in your folders.",removing:"Removing…",remove:"Remove",regenerateDialogTitle:"Regenerate connector API key",regenerateDialogDesc:"The MCP URL will change immediately and stop working in already configured clients. Vectors will be rebuilt on the new key: indexing restarts automatically.",regenerating:"Regenerating…"},cH={logout:{title:"Confirm log out",description:"Are you sure you want to log out?"},moveFiles:{title:"Move files to folder",description:"Select the destination folder for {{count}} file(s).",destinationLabel:"Destination folder",destinationPlaceholder:"Select a folder",moving:"Moving..."},editFolder:{title:"Edit {{name}}",description:"Edit folder name and color",namePlaceholder:"Folder name",selectColorAria:"Select color {{color}}",saving:"Saving..."},folderFilter:{title:"Filter by folder",description:"Select a folder to filter files",unclassifiedHint:"Files without folder",fileCount:"{{count}} files"},addDocumentsToConnector:{title:"Add documents to connector",description:"Select documents to link. They will be indexed automatically for MCP search.",loading:"Loading documents…",noMoreDocuments:"No more documents available to add.",noDocuments:"No documents found.",selectedCount:"{{count}} document(s) selected",adding:"Adding…",addCount:"Add ({{count}})"},replaceDocument:{title:"Replace document",description:"Replace {{name}} with another document. Chunks from the current document will be removed from the collection and those from the replacement will be indexed.",noDocuments:"No documents available for replacement.",replacing:"Replacing…",replace:"Replace"},folderBrowser:{title:"Browse folder",empty:"Empty folder",foldersCount:"Folders ({{count}})",filesCount:"Files ({{count}})"},collaboration:{title:"Enterprise collaboration",description:"Manage groups and access.",noResource:"Select a resource to share.",noResourceSelected:"No resource selected",resourceFolder:"Folder: {{name}}",resourceConnector:"Connector: {{name}}",resourceDocument:"Document: {{name}}",tabGroups:"Groups",tabSharing:"Resource sharing",newGroupPlaceholder:"New group name",create:"Create",addMemberLabel:"Add member to group",selectGroup:"Select group",selectColleague:"Select colleague",add:"Add",membersCount:"{{count}} members",noGroups:"No groups created.",shareHint:'Select a document or folder from the "Share..." menu.',shareDirectLabel:"Share with colleague",shareDirect:"Share direct",shareGroupLabel:"Share with group",shareGroup:"Share group",directAccess:"Direct access",noDirectAccess:"No direct access.",groupAccess:"Group access",noGroupAccess:"No group access."}},uH={deleteFiles:"Delete {{count}} selected file(s)? This action cannot be undone.",deleteFolder:'Delete folder "{{name}}"? This action cannot be undone.'},dH={loadDocumentsError:"Error loading documents",fileDeleted:'"{{name}}" deleted',deleteError:"Delete error",requeued:"Document requeued",requeueError:"Error requeuing document",generalFolderUnavailable:"General folder unavailable",movePartialSuccess:"{{succeeded}} files moved, {{failed}} failed",moveSuccess:"{{count}} files moved successfully",moveFailed:"Unable to move selected files",moveError:"Error moving files",selectDestinationFolder:"Select a destination folder",deletePartialSuccess:"{{succeeded}} files deleted, {{failed}} failed",deleteBulkSuccess:"{{count}} files deleted successfully",deleteBulkFailed:"Unable to delete selected files",deleteBulkError:"Error deleting selected files",filesSelected:"{{count}} file(s) selected: {{names}}",notAuthenticated:"User not authenticated",noFilesToUpload:"No files to upload",uploadedUnclassified:"Files uploaded to unclassified documents",uploadMixed:"{{uploaded}} files uploaded. {{transcription}} audio/video transcription started: follow the Task Manager at the top.",transcriptionStarted:"{{count}} audio/video transcription started. Follow progress in the Task Manager at the top.",folderCreatedWithMixed:'Folder "{{name}}" with {{uploaded}} files. {{transcription}} transcription started (Task Manager at the top).',folderCreatedWithTranscription:'Folder "{{name}}" created. {{count}} transcription started (Task Manager at the top).',folderCreatedWithFiles:'Folder "{{name}}" created with {{count}} files',folderCreated:'Folder "{{name}}
707" created',invalidFolderId:"Invalid folder ID",uploadToFolderMixed:"{{uploaded}} files uploaded. {{transcription}} audio/video transcription started (Task Manager at the top).",uploadToFolderTranscription:"{{count}} audio/video transcription started (Task Manager at the top).",uploadToFolder:"{{count}} file(s) uploaded to folder",operationError:"Error during operation",createFolderError:"Error creating folder",connectorDisabled:'Connector "{{name}}" disabled',disableConnectorError:"Error disabling connector",connectorActivated:'Connector "{{name}}" enabled',activateConnectorError:"Error enabling connector",connectorDeleted:'Connector "{{name}}" deleted',deleteConnectorError:"Error deleting connector",connectorsDeleted:"{{count}} connectors deleted",deleteConnectorsError:"Error deleting connectors",connectorsDisabled:"{{count}} connectors disabled",disableConnectorsError:"Error disabling connectors",connectorsActivated:"{{count}} connectors enabled",activateConnectorsError:"Error enabling connectors",folderUpdated:'Folder "{{name}}" updated',updateFolderError:"Error updating folder",folderDeleted:'Folder "{{name}}" deleted',deleteFolderError:"Error deleting folder",documentDeleted:"Document deleted",documentsDeleted:"{{count}} documents deleted",uploadFolderMixed:"{{uploaded}} files uploaded. {{transcription}} transcription started (Task Manager at the top).",uploadFolderTranscription:"{{count}} audio/video transcription started (Task Manager at the top).",loadFoldersError:"Error loading folders",loadFilesError:"Error loading files",nameRequired:"Set a name before continuing",selectAtLeastOneFile:"Select at least one file",noValidDocuments:"No valid documents selected",connectorCreatedWithTask:'Connector "{{name}}" created. Indexing queued (task {{taskId}}).',connectorCreated:'Connector "{{name}}" created. Indexing queued.',createConnectorError:"Error creating connector",loadConnectorError:"Unable to load connector",urlCopied:"URL copied",copyFailed:"Copy failed",apiKeyRegenerated:"API key regenerated. Indexing has restarted: update the MCP URL in your client.",regenerateApiKeyError:"Error regenerating API key",documentRemoved:"Document removed from connector",documentsRemoved:"{{count}} documents removed from connector",removeDocumentsError:"Error removing documents",selectAtLeastOneDocument:"Select at least one document",documentsAddedWithTask:"{{count}} document(s) added. Indexing queued (task {{taskId}}).",documentsAdded:"{{count}} document(s) added. Indexing queued.",addDocumentsError:"Error adding documents",selectReplacement:"Select a replacement document",documentReplacedWithTask:"Document replaced. Indexing queued (task {{taskId}}).",documentReplaced:"Document replaced. Indexing queued.",replaceDocumentError:"Error replacing document",collaborationLoadError:"Error loading collaboration",groupCreated:"Group created",groupCreateError:"Error creating group",memberAdded:"Member added",memberAddError:"Error adding member",memberRemoved:"Member removed",memberRemoveError:"Error removing member",shareUpdated:"Share updated",shareError:"Share error",groupShareUpdated:"Group share updated",groupShareError:"Group share error",accessRevoked:"Access revoked",revokeError:"Error revoking access",groupAccessRevoked:"Group access revoked",groupRevokeError:"Error revoking group access"},hH={loading:"Loading...",error:"Error",folderLabel:"Folder {{id}}",item:"item",items:"items",empty:"No files or folders present",source:"Source",unknownError:"Unknown error"},fH={root:"Root"},pH={title:"Task center",polling:"Polling",documents:"Documents",processingTotal:"Documents processing: {{count}}",pendingInProgress:"{{pending}} pending — {{inProgress}} in progress",tabs:{tasks:"Tasks",notifications:"Notifications"},loadingTasks:"Loading tasks...",noTasks:"No recent tasks",loadingNotifications:"Loading notifications...",noNotifications:"No notifications available",status:{QUEUED:"Queued",RUNNING:"Running",PARTIAL_SUCCESS:"Partial",COMPLETED:"Completed",FAILED:"Failed",CANCELLED:"Cancelled"},notificationStatus:{QUEUED:"Task queued",RUNNING:"Task running",PARTIAL_SUCCESS:"Task partially completed",COMPLETED:"Task completed",FAILED:"Task failed",CANCELLED:"Task cancelled"},cloudImportStats:"{{ok}}/{{total}} imported{{failedSuffix}}{{skippedSuffix}}",cloudImportFailed:", {{count}} failed",cloudImportSkipped:", {{count}} skipped"},mH={connectAccount:"Connect account",connecting:"Connecting…",popupBlocked:"Unable to open the login window. Check your popup blocker.",oauthStartError:"Unable to start OAuth",folderLoadError:"Error loading folder",onedriveAccessError:"Unable to access OneDrive/SharePoint",refresh:"Refresh",emptyFolder:"Empty folder",filesSelectedTotal:"{{count}} files selected in total",selectFilesHint:"Select one or more files to import. Open folders with a click.",googleNotConfigured:"Google Drive not configured",googleNotConfiguredDesc:"Set GOOGLE_OAUTH_CLIENT_ID, GOOGLE_PICKER_API_KEY, and GOOGLE_CLOUD_PROJECT_NUMBER in the BFF to enable the integration.",googlePickerIncomplete:"Google Picker incomplete",googlePickerIncompleteDesc:"Set GOOGLE_CLOUD_PROJECT_NUMBER (digits only, e.g. 689764940009) in the BFF .env — not the textual Project ID.",connectGoogleTitle:"Connect your Google account",connectGoogleExpired:"The Google Drive connection has expired. Reconnect your account to import new files.",connectGoogleDesc:"To import files from Google Drive, connect your account. Only files you select in the picker will be used.",connectedAs:"Connected as",googleDefault:"Google",openingPicker:"Opening picker…",importing:"Importing…",chooseFromGoogleDrive:"Choose files from Google Drive",googlePickerConfigError:"Incomplete Google Picker configuration (client ID, API key, or project number)",googlePickerOpenError:"Error opening Google Picker",fileImported:'"{{name}}" imported to Archiveye',filesImported:"{{count}} files imported to Archiveye",sharepointNotConfigured:"SharePoint not configured",
707sharepointNotConfiguredDesc:"Set MS_OAUTH_CLIENT_ID and MS_OAUTH_CLIENT_SECRET in the BFF to enable the integration.",connectMicrosoftTitle:"Connect your Microsoft account",connectMicrosoftExpired:"The Microsoft connection has expired. Reconnect your account to import new files.",connectMicrosoftDesc:"To import files from SharePoint/OneDrive, connect your Microsoft account. Only files you select will be used.",microsoftDefault:"Microsoft",filesSelected:"Selected files ({{count}})",importToArchiveye:"Import to Archiveye",selectAtLeastOneFile:"Select at least one file",importError:"Import error",googleDrive:"Google Drive",sharepointOneDrive:"SharePoint / OneDrive",chooseProvider:"Choose the provider to import from"},gH={singleLink:"Single link",siteCrawl:"Site crawl",selectFolderToContinue:"Select a folder to continue.",urlLabel:"URL",urlPlaceholder:"https://example.com/page or .pdf file",loading:"Loading...",continue:"Continue",optionalFileName:"File name (optional)",fileNamePlaceholder:"e.g. document.md",editHint:"Extracted text can be edited in the side panel: open the preview before uploading to Archiveye.",previewAndEdit:"Preview and edit",back:"Back",uploadToArchiveye:"Upload to Archiveye",crawlSeedLabel:"Start URL",crawlSeedPlaceholder:"https://example.com",depth:"Depth",maxPages:"Max pages",maxFiles:"Max files",sameDomainOnly:"Same domain only",includePatterns:"Include patterns (optional, one per line or comma-separated)",includePatternsPlaceholder:`Example (URL substrings):
708/blog/
709/docs/api
710/en/guide`,excludePatterns:"Exclude patterns (optional)",excludePatternsPlaceholder:`Example:
711/_next/
712/static/
713/admin
714?download=
715.xml`,starting:"Starting...",startCrawl:"Start crawl",youtubeNotSupported:"YouTube URLs are temporarily not supported.",youtubeCrawlNotSupported:"YouTube URLs are temporarily not supported in site crawl.",unsupportedFormat:"Unsupported file format",noMarkdownExtracted:"No markdown extracted from this page",extractError:"Error during extraction",uploadError:"Error during upload",crawlStartError:"Error starting crawl",webPageTitle:"Web page",knowledgeBase:"Knowledge base",webResourceSaved:"Web resource saved to folder",webIngestionStarted:"Web ingestion task started"},xH={youtubeUrl:"YouTube URL",urlPlaceholder:"https://www.youtube.com/watch?v=...",hint:"Paste a YouTube link. Content is transcribed and saved as a document in the selected folder.",processing:"Processing...",transcribeAndSave:"Transcribe and save",invalidYoutubeUrl:"Enter a valid YouTube URL (youtube.com or youtu.be).",transcriptionStarted:"YouTube transcription started in the background. The document will appear when ready.",ingestionError:"Error during YouTube ingestion",youtubeResourceSaved:"YouTube resource saved to folder"},vH={title:"Add resources",selectSourceDesc:"Select where you want to upload your resource from",source:"Source",selectOption:"Select an option",fromPc:"Add files from PC",externalDrive:"External drive",webUrl:"Web URL",next:"Next",selectFolder:"Select a folder",unclassifiedTitle:"Documents without folder",unclassifiedHint:"Add without assigning to a folder",noFolder:"No folder",uploadToFolder:"Add resources to folder",uploadFiles:"Upload files",dragOrUpload:"Drag or upload",webFolderRequired:"A dedicated folder is required for web resources.",externalDriveFolderRequired:"A dedicated folder is required for External Drive.",shareNow:"Share now",withColleague:"With colleague",withGroup:"With group",folderCreatedShareFailed:"Folder created, but sharing failed: {{message}}",folderCreatedShareFailedGeneric:"Folder created, but sharing was not successful",createFolderError:"Error creating folder"},bH={common:tH,status:nH,time:iH,tabs:rH,dashboard:sH,folderView:aH,newMcp:oH,connectorDetail:lH,dialogs:cH,confirms:uH,toasts:dH,folderFilesViewer:hH,folderBrowser:fH,taskCenter:pH,cloud:mH,webIngestion:gH,audioIngestion:xH,addResourceFlow:vH},yH={it:"ArchivEye Data Console per gestire risorse, collezioni e connettori con indicizzazione documentale.",en:"ArchivEye Data Console to manage resources, collections, and connectors with document indexing."};function gT(t){if(typeof document>"u")return;document.documentElement.lang=t;const e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content",yH[t])}const Tw=qU();_w(Tw);Jt.use(DF).init({lng:Tw,fallbackLng:Zb,supportedLngs:["it","en"],ns:["common","auth","settings","billing","docs","admin","support","dashboard"],defaultNS:"common",interpolation:{escapeValue:!1},resources:{it:{common:eB,auth:lB,settings:SB,billing:NB,docs:LB,admin:MB,support:UB,dashboard:a9},en:{common:f9,auth:w9,settings:O9,billing:$9,docs:K9,admin:Y9,supp
715ort:eH,dashboard:bH}}});Jt.on("languageChanged",t=>{(t==="it"||t==="en")&&(_w(t),gT(t))});gT(Tw);function wH(t){const e=Jt.language;return KU(e==="en"?"en":"it")}function Kp(t,e,n){return(t instanceof Date?t:new Date(t)).toLocaleDateString(wH(),e)}function Zt(t,e,n){const i=Jt.language;return t.localeCompare(e,i==="en"?"en":"it")}function sh(t){const e=t instanceof Date?t:new Date(t),i=new Date().getTime()-e.getTime(),r=Math.floor(i/6e4),s=Math.floor(i/36e5),l=Math.floor(i/864e5);return r<1?Jt.t("time.secondsAgo",{ns:"dashboard"}):r<60?Jt.t("time.minutesAgo",{ns:"dashboard",count:r}):s<24?Jt.t("time.hoursAgo",{ns:"dashboard",count:s}):Jt.t("time.daysAgo",{ns:"dashboard",count:l})}var Vv={exports:{}},qv,nk;function SH(){if(nk)return qv;nk=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qv=t,qv}var Kv,ik;function CH(){if(ik)return Kv;ik=1;var t=SH();function e(){}function n(){}return n.resetWarningCache=e,Kv=function(){function i(l,u,d,f,p,m){if(m!==t){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},Kv}var rk;function EH(){return rk||(rk=1,Vv.exports=CH()()),Vv.exports}var AH=EH();const Gt=ml(AH),kH
vendor: 41,168 bytes, line 715
715=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function 
vendor: 15,389 bytes, lines 715-719
715Oc(t,e,n){const i=NH(t),{webkitRelativePath:r}=t,s=typeof e=="string"?e:typeof r=="string"&&r.length>0?r:`./${t.name}`;return typeof i.path!="string"&&sk(i,"path",s),sk(i,"relativePath",s),i}function NH(t){const{name:e}=t;if(e&&e.lastIndexOf(".")!==-1&&!t.type){const i=e.split(".").pop().toLowerCase(),r=kH.get(i);r&&Object.defineProperty(t,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t}function sk(t,e,n){Object.defineProperty(t,e,{value:n,writable:!1,configurable:!1,enumerable:!0})}const jH=[".DS_Store","Thumbs.db"];function _H(t){return gl(this,void 0,void 0,function*(){return Wp(t)&&TH(t.dataTransfer)?LH(t.dataTransfer,t.type):RH(t)?PH(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?DH(t):[]})}function TH(t){return Wp(t)}function RH(t){return Wp(t)&&Wp(t.target)}function Wp(t){return typeof t=="object"&&t!==null}function PH(t){return ey(t.target.files).map(e=>Oc(e))}function DH(t){return gl(this,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>n.getFile()))).map(n=>Oc(n))})}function LH(t,e){return gl(this,void 0,void 0,function*(){if(t.items){const n=ey(t.items).filter(r=>r.kind==="file");if(e!=="drop")return n;const i=yield Promise.all(n.map(OH));return ak(xT(i))}return ak(ey(t.files).map(n=>Oc(n)))})}function ak(t){return t.filter(e=>jH.indexOf(e.name)===-1)}function ey(t){if(t===null)return[];const e=[];for(let n=0;n<t.length;n++){const i=t[n];e.push(i)}return e}function OH(t){if(typeof t.webkitGetAsEntry!="function")return ok(t);const e=t.webkitGetAsEntry();return e&&e.isDirectory?vT(e):ok(t,e)}function xT(t){return t.reduce((e,n)=>[...e,...Array.isArray(n)?xT(n):[n]],[])}function ok(t,e){return gl(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof t.getAsFileSystemHandle=="function"){const s=yield t.getAsFileSystemHandle();if(s===null)throw new Error(`${t} is not a File`);if(s!==void 0){const l=yield s.getFile();return l.handle=s,Oc(l)}}const i=t.getAsFile();if(!i)throw new Error(`${t} is not a File`);return Oc(i,(n=e?.fullPath)!==null&&n!==void 0?n:void 0)})}function MH(t){return gl(this,void 0,void 0,function*(){return t.isDirectory?vT(t):IH(t)})}function vT(t){const e=t.createReader();return new Promise((n,i)=>{const r=[];function s(){e.readEntries(l=>gl(this,void 0,void 0,function*(){if(l.length){const u=Promise.all(l.map(MH));r.push(u),s()}else try{const u=yield Promise.all(r);n(u)}catch(u){i(u)}}),l=>{i(l)})}s()})}function IH(t){return gl(this,void 0,void 0,function*(){return new Promise((e,n)=>{t.file(i=>{const r=Oc(i,t.fullPath);e(r)},i=>{n(i)})})})}var Xf={},lk;function zH(){return lk||(lk=1,Xf.__esModule=!0,Xf.default=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(",");if(n.length===0)return!0;var i=t.name||"",r=(t.type||"").toLowerCase(),s=r.replace(/\/.*$/,"");return n.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?i.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):r===u})}return!0}),Xf}var FH=zH();const Wv=ml(FH);function ck(t){return BH(t)||UH(t)||yT(t)||$H()}function $H(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
716In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UH(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function BH(t){if(Array.isArray(t))return ty(t)}function uk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function dk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?uk(Object(n),!0).forEach(function(i){bT(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uk(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function bT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $d(t,e){return VH(t)||GH(t,e)||yT(t,e)||HH()}function HH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
717In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yT(t,e){if(t){if(typeof t=="string")return ty(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ty(t,e)}}function ty(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function GH(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i=[],r=!0,s=!1,l,u;try{for(n=n.call(t);!(r=(l=n.next()).done)&&(i.push(l.value),!(e&&i.length===e));r=!0);}catch(d){s=!0,u=d}finally{try{!r&&n.return!=null&&n.return()}finally{if(s)throw u}}return i}}function VH(t){if(Array.isArray(t))return t}var qH=typeof Wv=="function"?Wv:Wv.default,KH="file-invalid-type",WH="file-too-large",YH="file-too-small",XH="too-many-files",QH=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=e.split(","),i=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:KH,message:"File type must be ".concat(i)}},hk=function(e){return{code:WH,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},fk=function(e){return{code:YH,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},ZH={code:XH,message:"Too many files"};function wT(t,e){var n=t.type==="application/x-moz-file"||qH(t,e);return[n,n?null:QH(e)]}function ST(t,e,n){if(Ko(t.size))if(Ko(e)&&Ko(n)){if(t.size>n)return[!1,hk(n)];if(t.size<e)return[!1,fk(e)]}else{if(Ko(e)&&t.size<e)return[!1,fk(e)];if(Ko(n)&&t.size>n)return[!1,hk(n)]}return[!0,null]}function Ko(t){return t!=null}function JH(t){var e=t.files,n=t.accept,i=t.minSize,r=t.maxSize,s=t.multiple,l=t.maxFiles,u=t.validator;return!s&&e.length>1||s&&l>=1&&e.length>l?!1:e.every(function(d){var f=wT(d,n),p=$d(f,1),m=p[0],x=ST(d,i,r),b=$d(x,1),w=b[0],C=u?u(d):null;return m&&w&&!C})}function Yp(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function Qf(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function pk(t){t.preventDefault()}function eG(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function tG(t){return t.indexOf("Edge/")!==-1}function nG(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return eG(t)||tG(t)}function ls(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return e.some(function(u){return!Yp(i)&&u&&u.apply(void 0,[i].concat(s)),Yp(i)})}}function iG(){return"showOpenFilePicker"in window}function rG(t){if(Ko(t)){var e=Object.entries(t).filter(function(n){var i=$d(n,2),r=i[0],s=i[1],l=!0;return CT(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),l=!1),(!Array.isArray(s)||!s.every(ET))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,i){var r=$d(i,2),s=r[0],l=r[1];return dk(dk({},n),{},bT({},s,l))},{});return[{description:"Files",accept:e}]}return t}function sG(t){if(Ko(t))return Object.entries(t).reduce(function(e,n){var i=$d(n,2),r=i[0],s=i[1];return[].concat(ck(e),[r],ck(s))},[]).filter(function(e){return CT(e)||ET(e)}).join(",")}function aG(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function oG(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function CT(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function ET(t){return/^.*\.[\w]+$/.test(t)}var lG=["children"],cG=["open"],uG=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],dG=["refKey","onChange","onClick"];function hG(t){return mG(t)||pG(t)||AT(t)||fG()}function fG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
718In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pG(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function mG(t){if(Array.isArray(t))return ny(t)}function Yv(t,e){return vG(t)||xG(t,e)||AT(t,e)||gG()}function gG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
719In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AT(t,e){if(t){if(typeof t=="string")return ny(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ny(t,e)}}function ny(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function xG(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i=[],r=!0,s=!1,l,u;try{for(n=n.call(t);!(r=(l=n.next()).done)&&(i.push(l.value),!(e&&i.length===e));r=!0);}catch(d){s=!0,u=d}finally{try{!r&&n.return!=null&&n.return()}finally{if(s)throw u}}return i}}function vG(t){if(Array.isArray(t))return t}function mk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function dn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mk(Object(n),!0).forEach(function(i){iy(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function iy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xp(t,e){if(t==null)return{};var n=bG(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function bG(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Rw=v.forwardRef(function(t,e){var n=t.children,i=Xp(t,lG),r=Pw(i),s=r.open,l=Xp(r,cG);return v.useImperativeHandle(e,function(){return{open:s}},[s]),ui.createElement(v.Fragment,null,n(dn(dn({},l),{},{open:s})))});Rw.displayName="Dropzone";var kT={disabled:!1,getFilesFromEvent:_H,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Rw.defaultProps=kT;Rw.propTypes={children:Gt.func,accept:Gt.objectOf(Gt.arrayOf(Gt.string)),multiple:Gt.bool,preventDropOnDocument:Gt.bool,noClick:Gt.bool,noKeyboard:Gt.bool,noDrag:Gt.bool,noDragEventsBubbling:Gt.bool,minSize:Gt.number,maxSize:Gt.number,maxFiles:Gt.number,disabled:Gt.bool,getFilesFromEvent:Gt.func,onFileDialogCancel:Gt.func,onFileDialogOpen:Gt.func,useFsAccessApi:Gt.bool,autoFocus:Gt.bool,onDragEnter:Gt.func,onDragLeave:Gt.func,onDragOver:Gt.func,onDrop:Gt.func,onDropAccepted:Gt.func,onDropRejected:Gt.func,onError:Gt.func,validator:Gt.func};var ry={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Pw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=dn(dn({},kT),t),n=e.accept,i=e.disabled,r=e.getFilesFromEvent,s=e.maxSize,l=e.minSize,u=e.multiple,d=e.maxFiles,f=e.onDragEnter,p=e.onDragLeave,m=e.onDragOver,x=e.onDrop,b=e.onDropAccepted,w=e.onDropRejected,C=e.onFileDialogCancel,A=e.onFileDialogOpen,E=e.useFsAccessApi,k=e.autoFocus,N=e.preventDropOnDocument,_=e.noClick,R=e.noKeyboard,T=e.noDrag,L=e.noDragEventsBubbling,M=e.onError,U=e.validator,D=v.useMemo(function(){return sG(n)},[n]),G=v.useMemo(function(){return rG(n)},[n]),Z=v.useMemo(function(){return typeof A=="function"?A:gk},[A]),Q=v.useMemo(function(){return typeof C=="function"?C:gk},[C]),K=v.useRef(null),q=v.useRef(null),F=v.useReducer(yG,ry),V=Yv(F,2),O=V[0],X=V[1],$=O.isFocused,B=O.isFileDialogActive,H=v.useRef(typeof window<"u"&&window.isSecureContext&&E&&iG()),P=function(){!H.current&&B&&setTimeout(function(){if(q.current){var Me=q.current.files;Me.length||(X({type:"closeDialog"}),Q())}},300)};v.useEffect(function(){return window.addEventListener("focus",P,!1),function(){window.removeEventListener("focus",P,!1)}},[q,B,Q,H]);var J=v.useRef([]),he=function(Me){K.current&&K.current.contains(Me.target)||(Me.preventDefault(),J.current=[])};v.useEffect(function(){return N&&(document.addEventListener("dragover",pk,!1),document.addEventListener("drop",he,!1)),function(){N&&(document.removeEventListener("dragover",pk),document.removeEventListener("drop",he))}},[K,N]),v.useEffect(function(){return!i&&k&&K.current&&K.current.focus(),function(){}},[K,k,i]);var ue=v.useCallback(function(ve){M?M(ve):console.error(ve)},[M]),W=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),at(ve),J.current=[].concat(hG(J.current),[ve.target]),Qf(ve)&&Promise.resolve(r(ve)).then(function(Me){if(!(Yp(ve)&&!L)){var le=Me.length,ye=le>0&&JH({files:Me,accept:D,minSize:l,maxSize:s,multiple:u,maxFiles:d,validator:U}),Ie=le>0&&!ye;X({isDragAccept:ye,isDragReject:Ie,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ve)}}).catch(function(Me){return ue(Me)})},[r,f,ue,L,D,l,s,u,d,U]),fe=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),at(ve);var Me=Qf(ve);if(Me&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Me&&m&&m(ve),!1},[m,L]),se=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),at(ve);var Me=J.current.filter(function(ye){return K.current&&K.current.contains(ye)}),le=Me.indexOf(ve.target);le!==-1&&Me.splice(le,1),J.current=Me,!(Me.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Qf(ve)&&p&&p(ve))},[K,p,L]),pe=v.useCallback(function(ve,Me){var le=[],ye=[];ve.forEach(function(Ie){var et=wT(Ie,D),nt=Yv(et,2),en=nt[0],tn=nt[1],cn=ST(Ie,l,s),zt=Yv(cn,2),mn=zt[0],yt=zt[1],Ai=U?U(Ie):null;if(en&&mn&&!Ai)le.push(Ie);else{var Fn=[tn,yt];Ai&&(Fn=Fn.concat(Ai)),ye.push({file:Ie,errors:Fn.filter(function(su){return su})})}}),(!u&&le.length>1||u&&d>=1&&le.length>d)&&(le.forEach(function(Ie){ye.push({file:Ie,errors:[ZH]})}),le.splice(0)),X({acceptedFiles:le,fileRejections:ye,isDragReject:ye.length>0,type:"setFiles"}),x&&x(le,ye,Me),ye.length>0&&w&&w(ye,Me),le.length>0&&b&&b(le,Me)},[X,u,D,l,s,d,x,b,w,U]),Ee=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),at(ve),J.current=[],Qf(ve)&&Promise.resolve(r(ve)).then(function(Me){Yp(ve)&&!L||pe(Me,ve)}
719).catch(function(Me){return ue(Me)}),X({type:"reset"})},[r,pe,ue,L]),Ce=v.useCallback(function(){if(H.current){X({type:"openDialog"}),Z();var ve={multiple:u,types:G};window.showOpenFilePicker(ve).then(function(Me){return r(Me)}).then(function(Me){pe(Me,null),X({type:"closeDialog"})}).catch(function(Me){aG(Me)?(Q(Me),X({type:"closeDialog"})):oG(Me)?(H.current=!1,q.current?(q.current.value=null,q.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(Me)});return}q.current&&(X({type:"openDialog"}),Z(),q.current.value=null,q.current.click())},[X,Z,Q,E,pe,ue,G,u]),Ne=v.useCallback(function(ve){!K.current||!K.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),Ce())},[K,Ce]),qe=v.useCallback(function(){X({type:"focus"})},[]),pt=v.useCallback(function(){X({type:"blur"})},[]),$e=v.useCallback(function(){_||(nG()?setTimeout(Ce,0):Ce())},[_,Ce]),je=function(Me){return i?null:Me},xt=function(Me){return R?null:je(Me)},Ae=function(Me){return T?null:je(Me)},at=function(Me){L&&Me.stopPropagation()},xe=v.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Me=ve.refKey,le=Me===void 0?"ref":Me,ye=ve.role,Ie=ve.onKeyDown,et=ve.onFocus,nt=ve.onBlur,en=ve.onClick,tn=ve.onDragEnter,cn=ve.onDragOver,zt=ve.onDragLeave,mn=ve.onDrop,yt=Xp(ve,uG);return dn(dn(iy({onKeyDown:xt(ls(Ie,Ne)),onFocus:xt(ls(et,qe)),onBlur:xt(ls(nt,pt)),onClick:je(ls(en,$e)),onDragEnter:Ae(ls(tn,W)),onDragOver:Ae(ls(cn,fe)),onDragLeave:Ae(ls(zt,se)),onDrop:Ae(ls(mn,Ee)),role:typeof ye=="string"&&ye!==""?ye:"presentation"},le,K),!i&&!R?{tabIndex:0}:{}),yt)}},[K,Ne,qe,pt,$e,W,fe,se,Ee,R,T,i]),me=v.useCallback(function(ve){ve.stopPropagation()},[]),rt=v.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Me=ve.refKey,le=Me===void 0?"ref":Me,ye=ve.onChange,Ie=ve.onClick,et=Xp(ve,dG),nt=iy({accept:D,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:je(ls(ye,Ee)),onClick:je(ls(Ie,me)),tabIndex:-1},le,q);return dn(dn({},nt),et)}},[q,n,u,Ee,i]);return dn(dn({},O),{},{isFocused:$&&!i,getRootProps:xe,getInputProps:rt,rootRef:K,inputRef:q,open:je(Ce)})}function yG(t,e){switch(e.type){case"focus":return dn(dn({},t),{},{isFocused:!0});case"blur":return dn(dn({},t),{},{isFocused:!1});case"openDialog":return dn(dn({},ry),{},{isFileDialogActive:!0});case"closeDialog":return dn(dn({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return dn(dn({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return dn(dn({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return dn({},ry);default:return t}}function gk(){}function sy(t,[e,n]){return Math.min(n,Math.max(e,t))}var wG="Arrow",NT=v.forwardRef((t,e)=>{const{children:n,width:i=10,height:r=5,...s}=t;return o.jsx(Je.svg,{...s,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});NT.displayName=wG;var SG=NT,Dw="Popper",[jT,eu]=Er(Dw),[CG,_T]=jT(Dw),TT=t=>{const{__scopePopper:e,children:n}=t,[i,r]=v.useState(null);return o.jsx(CG,{scope:e,anchor:i,onAnchorChange:r,children:n})};TT.displayName=Dw;var RT="PopperAnchor",PT=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...r}=t,s=_T(RT,n),l=v.useRef(null),u=Et(e,l),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=i?.current||l.current,f!==d.current&&s.onAnchorChange(d.current)}),i?null:o.jsx(Je.div,{...r,ref:u})});PT.displayName=RT;var Lw="PopperContent",[EG,AG]=jT(Lw),DT=v.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:s="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:w,...C}=t,A=_T(Lw,n),[E,k]=v.useState(null),N=Et(e,W=>k(W)),[_,R]=v.useState(null),T=O_(_),L=T?.width??0,M=T?.height??0,U=i+(s!=="center"?"-"+s:""),D=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},G=Array.isArray(f)?f:[f],Z=G.length>0,Q={padding:D,boundary:G.filter(NG),altBoundary:Z},{refs:K,floatingStyles:q,placement:F,isPositioned:V,middlewareData:O}=w3({strategy:"fixed",placement:U,whileElementsMounted:(...W)=>d3(...W,{animationFrame:b==="always"}),elements:{reference:A.anchor},middleware:[C3({mainAxis:r+M,alignmentAxis:l}),d&&E3({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?A3():void 0,...Q}),d&&k3({...Q}),N3({...Q,apply:({elements:W,rects:fe,availableWidth:se,availableHeight:pe})=>{const{width:Ee,height:Ce}=fe.reference,Ne=W.floating.style;Ne.setProperty("--radix-popper-available-width",`${se}px`),Ne.setProperty("--radix-popper-available-height",`${pe}px`),Ne.setProperty("--radix-popper-anchor-width",`${Ee}px`),Ne.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),_&&_3({element:_,padding:u}),jG({arrowWidth:L,arrowHeight:M}),x&&j3({strategy:"referenceHidden",...Q})]}),[X,$]=MT(F),B=Zn(w);zn(()=>{V&&B?.()},[V,B]);const H=O.arrow?.x,P=O.arrow?.y,J=O.arrow?.centerOffset!==0,[he,ue]=v.useState();return zn(()=>{E&&ue(window.getComputedStyle(E).zIndex)},[E]),o.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(" "),...O.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(EG,{scope:n,placedSide:X,onArrowChange:R,arrowX:H,arrowY:P,shouldHideArrow:J,children:o.jsx(Je.div,{"data-side":X,"data-align":$,...C,ref:N,style:{...C.style,animation:V?void 0:"none"}})})})});DT.displayName=Lw;var LT="PopperArrow",kG={top:"bottom",right:"left",bottom:"top",left:"r
719ight"},OT=v.forwardRef(function(e,n){const{__scopePopper:i,...r}=e,s=AG(LT,i),l=kG[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(SG,{...r,ref:n,style:{...r.style,display:"block"}})})});OT.displayName=LT;function NG(t){return t!==null}var jG=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,l=r.arrow?.centerOffset!==0,u=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,p]=MT(n),m={start:"0%",center:"50%",end:"100%"}[p],x=(r.arrow?.x??0)+u/2,b=(r.arrow?.y??0)+d/2;let w="",C="";return f==="bottom"?(w=l?m:`${x}px`,C=`${-d}px`):f==="top"?(w=l?m:`${x}px`,C=`${i.floating.height+d}px`):f==="right"?(w=`${-d}px`,C=l?m:`${b}px`):f==="left"&&(w=`${i.floating.width+d}px`,C=l?m:`${b}px`),{data:{x:w,y:C}}}});function MT(t){const[e,n="center"]=t.split("-");return[e,n]}var Ow=TT,Dm=PT,Mw=DT,Iw=OT;function _G(t){const e=TG(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(PG);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function TG(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;if(v.isValidElement(r)){const l=LG(r),u=DG(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var RG=Symbol("radix.slottable");function PG(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===RG}function DG(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function LG(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var IT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),OG="VisuallyHidden",MG=v.forwardRef((t,e)=>o.jsx(Je.span,{...t,ref:e,style:{...IT,...t.style}}));MG.displayName=OG;var IG=[" ","Enter","ArrowUp","ArrowDown"],zG=[" ","Enter"],al="Select",[Lm,Om,FG]=Nw(al),[tu]=Er(al,[FG,eu]),Mm=eu(),[$G,po]=tu(al),[UG,BG]=tu(al),zT=t=>{const{__scopeSelect:e,children:n,open:i,defaultOpen:r,onOpenChange:s,value:l,defaultValue:u,onValueChange:d,dir:f,name:p,autoComplete:m,disabled:x,required:b,form:w}=t,C=Mm(e),[A,E]=v.useState(null),[k,N]=v.useState(null),[_,R]=v.useState(!1),T=ih(f),[L,M]=co({prop:i,defaultProp:r??!1,onChange:s,caller:al}),[U,D]=co({prop:l,defaultProp:u,onChange:d,caller:al}),G=v.useRef(null),Z=A?w||!!A.closest("form"):!0,[Q,K]=v.useState(new Set),q=Array.from(Q).map(F=>F.props.value).join(";");return o.jsx(Ow,{...C,children:o.jsxs($G,{required:b,scope:e,trigger:A,onTriggerChange:E,valueNode:k,onValueNodeChange:N,valueNodeHasChildren:_,onValueNodeHasChildrenChange:R,contentId:qr(),value:U,onValueChange:D,open:L,onOpenChange:M,dir:T,triggerPointerDownPosRef:G,disabled:x,children:[o.jsx(Lm.Provider,{scope:e,children:o.jsx(UG,{scope:t.__scopeSelect,onNativeOptionAdd:v.useCallback(F=>{K(V=>new Set(V).add(F))},[]),onNativeOptionRemove:v.useCallback(F=>{K(V=>{const O=new Set(V);return O.delete(F),O})},[]),children:n})}),Z?o.jsxs(aR,{"aria-hidden":!0,required:b,tabIndex:-1,name:p,autoComplete:m,value:U,onChange:F=>D(F.target.value),disabled:x,form:w,children:[U===void 0?o.jsx("option",{value:""}):null,Array.from(Q)]},q):null]})})};zT.displayName=al;var FT="SelectTrigger",$T=v.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:i=!1,...r}=t,s=Mm(n),l=po(FT,n),u=l.disabled||i,d=Et(e,l.onTriggerChange),f=Om(n),p=v.useRef("touch"),[m,x,b]=lR(C=>{const A=f().filter(N=>!N.disabled),E=A.find(N=>N.value===l.value),k=cR(A,C,E);k!==void 0&&l.onValueChange(k.value)}),w=C=>{u||(l.onOpenChange(!0),b()),C&&(l.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return o.jsx(Dm,{asChild:!0,...s,children:o.jsx(Je.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":oR(l.value)?"":void 0,...r,ref:d,onClick:Pe(r.onClick,C=>
vendor: 17,150 bytes, line 719
719{C.currentTarget.focus(),p.current!=="mouse"&&w(C)}),onPointerDown:Pe(r.onPointerDown,C=>{p.current=C.pointerType;const A=C.target;A.hasPointerCapture(C.pointerId)&&A.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:Pe(r.onKeyDown,C=>{const A=m.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(A&&C.key===" ")&&IG.includes(C.key)&&(w(),C.preventDefault())})})})});$T.displayName=FT;var UT="SelectValue",BT=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:l="",...u}=t,d=po(UT,n),{onValueNodeHasChildrenChange:f}=d,p=s!==void 0,m=Et(e,d.onValueNodeChange);return zn(()=>{f(p)},[f,p]),o.jsx(Je.span,{...u,ref:m,style:{pointerEvents:"none"},children:oR(d.value)?o.jsx(o.Fragment,{children:l}):s})});BT.displayName=UT;var HG="SelectIcon",HT=v.forwardRef((t,e)=>{const{__scopeSelect:n,children:i,...r}=t;return o.jsx(Je.span,{"aria-hidden":!0,...r,ref:e,children:i||"▼"})});HT.displayName=HG;var GG="SelectPortal",GT=t=>o.jsx(th,{asChild:!0,...t});GT.displayName=GG;var ol="SelectContent",VT=v.forwardRef((t,e)=>{const n=po(ol,t.__scopeSelect),[i,r]=v.useState();if(zn(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?Wd.createPortal(o.jsx(qT,{scope:t.__scopeSelect,children:o.jsx(Lm.Slot,{scope:t.__scopeSelect,children:o.jsx("div",{children:t.children})})}),s):null}return o.jsx(KT,{...t,ref:e})});VT.displayName=ol;var Mr=10,[qT,mo]=tu(ol),VG="SelectContentImpl",qG=_G("SelectContent.RemoveScroll"),KT=v.forwardRef((t,e)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:A,...E}=t,k=po(ol,n),[N,_]=v.useState(null),[R,T]=v.useState(null),L=Et(e,W=>_(W)),[M,U]=v.useState(null),[D,G]=v.useState(null),Z=Om(n),[Q,K]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(N)return km(N)},[N]),Am();const F=v.useCallback(W=>{const[fe,...se]=Z().map(Ce=>Ce.ref.current),[pe]=se.slice(-1),Ee=document.activeElement;for(const Ce of W)if(Ce===Ee||(Ce?.scrollIntoView({block:"nearest"}),Ce===fe&&R&&(R.scrollTop=0),Ce===pe&&R&&(R.scrollTop=R.scrollHeight),Ce?.focus(),document.activeElement!==Ee))return},[Z,R]),V=v.useCallback(()=>F([M,N]),[F,M,N]);v.useEffect(()=>{Q&&V()},[Q,V]);const{onOpenChange:O,triggerPointerDownPosRef:X}=k;v.useEffect(()=>{if(N){let W={x:0,y:0};const fe=pe=>{W={x:Math.abs(Math.round(pe.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(X.current?.y??0))}},se=pe=>{W.x<=10&&W.y<=10?pe.preventDefault():N.contains(pe.target)||O(!1),document.removeEventListener("pointermove",fe),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",se,{capture:!0})}}},[N,O,X]),v.useEffect(()=>{const W=()=>O(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[O]);const[$,B]=lR(W=>{const fe=Z().filter(Ee=>!Ee.disabled),se=fe.find(Ee=>Ee.ref.current===document.activeElement),pe=cR(fe,W,se);pe&&setTimeout(()=>pe.ref.current.focus())}),H=v.useCallback((W,fe,se)=>{const pe=!q.current&&!se;(k.value!==void 0&&k.value===fe||pe)&&(U(W),pe&&(q.current=!0))},[k.value]),P=v.useCallback(()=>N?.focus(),[N]),J=v.useCallback((W,fe,se)=>{const pe=!q.current&&!se;(k.value!==void 0&&k.value===fe||pe)&&G(W)},[k.value]),he=i==="popper"?ay:WT,ue=he===ay?{side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:A}:{};return o.jsx(qT,{scope:n,content:N,viewport:R,onViewportChange:T,itemRefCallback:H,selectedItem:M,onItemLeave:P,itemTextRefCallback:J,focusSelectedItem:V,selectedItemText:D,position:i,isPositioned:Q,searchRef:$,children:o.jsx(Kd,{as:qG,allowPinchZoom:!0,children:o.jsx(eh,{asChild:!0,trapped:k.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Pe(r,W=>{k.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:o.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:o.jsx(he,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:W=>W.preventDefault(),...E,...ue,onPlaced:()=>K(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Pe(E.onKeyDown,W=>{const fe=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!fe&&W.key.length===1&&B(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let pe=Z().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(W.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Ee=W.target,Ce=pe.indexOf(Ee);pe=pe.slice(Ce+1)}setTimeout(()=>F(pe)),W.preventDefault()}})})})})})})});KT.displayName=VG;var KG="SelectItemAlignedPosition",WT=v.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:i,...r}=t,s=po(ol,n),l=mo(ol,n),[u,d]=v.useState(null),[f,p]=v.useState(null),m=Et(e,L=>p(L)),x=Om(n),b=v.useRef(!1),w=v.useRef(!0),{viewport:C,selectedItem:A,selectedItemText:E,focusSelectedItem:k}=l,N=v.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&f&&C&&A&&E){const L=s.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),U=s.valueNode.getBoundingClientRect(),D=E.getBoundingClientRect();if(s.dir!=="rtl"){const Ee=D.left-M.left,Ce=U.left-Ee,Ne=L.left-Ce,qe=L.width+Ne,pt=Math.max(qe,M.width),$e=window.innerWidth-Mr,je=sy(Ce,[Mr,Math.max(Mr,$e-pt)]);u.style.minWidth=qe+"px",u.style.left=je+"px"}else{const Ee=M.right-D.right,Ce=window.innerWidth-U.right-Ee,Ne=window.innerWidth-L.right-Ce,qe=L.width+Ne,pt=Math.max(qe,M.width),$e=window.innerWidth-Mr,je=sy(Ce,[Mr,Math.max(Mr,$e-pt)]);u.style.minWidth=qe+"px",u.style.right=je+"px"}const G=x(),Z=window.innerHeight-Mr*2,Q=C.scrollHeight,K=window.getComputedStyle(f),q=parseInt(K.borderTopWidth,10),F=parseInt(K.paddingTop,10),V=parseInt(K.borderBottomWidth,10),O=parseInt(K.paddingBottom,10),X=q+F+Q+O+V,$=Math.min(A.offsetHeight*5,X),B=window.getComputedStyle(C),H=parseInt(B.paddingTop,10),P=parseInt(B.paddingBottom,10),J=L.top+L.height/2-Mr,he=Z-J,ue=A.offsetHeight/2,W=A.offsetTop+ue,fe=q+F+W,se=X-fe;if(fe<=J){const Ee=G.length>0&&A===G[G.length-1].ref.current;u.style.bottom="0px";const Ce=f.clientHeight-C.offsetTop-C.offsetHeight,Ne=Math.max(he,ue+(Ee?P:0)+Ce+V),qe=fe+Ne;u.style.height=qe+"px"}else{const Ee=G.length>0&&A===G[0].ref.current;u.style.top="0px";const Ne=Math.max(J,q+C.offsetTop+(Ee?H:0)+ue)+se;u.style.height=Ne+"px",C.scrollTop=fe-J+C.offsetTop}u.style.margin=`${Mr}px 0`,u.style.minHeight=$+"px",u.style.maxHeight=Z+"px",i?.(),requestAnimationFrame(()=>b.current=!0)}},[x,s.trigger,s.valueNode,u,f,C,A,E,s.dir,i]);zn(()=>N(),[N]);const[_,R]=v.useState();zn(()=>{f&&R(window.getComputedStyle(f).zIndex)},[f]);const T=v.useCallback(L=>{L&&w.current===!0&&(N(),k?.(),w.current=!1)},[N,k]);return o.jsx(YG,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:T,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:o.jsx(Je.div,{...r,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});WT.displayName=KG;var WG="SelectPopperPosition",ay=v.forwardRef((t,e)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=Mr,...s}=t,l=Mm(n);return o.jsx(Mw,{...l,...s,ref:e,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ay.displayName=WG;var[YG,zw]=tu(ol,{}),oy="SelectViewport",YT=v.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:i,...r}=t,s=mo(oy,n),l=zw(oy,n),u=Et(e,s.onViewportChange),d=v.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),o.jsx(Lm.Slot,{scope:n,children:o.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:Pe(r.onScroll,f=>{const p=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:x}=l;if(x?.current&&m){const b=Math.abs(d.current-p.scrollTop);if(b>0){const w=window.innerHeight-Mr*2,C=parseFloat(m.style.minHeight),A=parseFloat(m.style.height),E=Math.max(C,A);if(E<w){const k=E+b,N=Math.min(w,k),_=k-N;m.style.height=N+"px",m.style.bottom==="0px"&&(p.scrollTop=_>0?_:0,m.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});YT.displayName=oy;var XT="SelectGroup",[XG,QG]=tu(XT),ZG=v.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=qr();return o.jsx(XG,{scope:n,id:r,children:o.jsx(Je.div,{role:"group","aria-labelledby":r,...i,ref:e})})});ZG.displayName=XT;var QT="SelectLabel",JG=v.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=QG(QT,n);return o.jsx(Je.div,{id:r.id,...i,ref:e})});JG.displayName=QT;var Qp="SelectItem",[eV,ZT]=tu(Qp),JT=v.forwardRef((t,e)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...l}=t,u=po(Qp,n),d=mo(Qp,n),f=u.value===i,[p,m]=v.useState(s??""),[x,b]=v.useState(!1),w=Et(e,k=>d.itemRefCallback?.(k,i,r)),C=qr(),A=v.useRef("touch"),E=()=>{r||(u.onValueChange(i),u.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(eV,{scope:n,value:i,disabled:r,textId:C,isSelected:f,onItemTextChange:v.useCallback(k=>{m(N=>N||(k?.textContent??"").trim())},[]),children:o.jsx(Lm.ItemSlot,{scope:n,value:i,disabled:r,textValue:p,children:o.jsx(Je.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:w,onFocus:Pe(l.onFocus,()=>b(!0)),onBlur:Pe(l.onBlur,()=>b(!1)),onClick:Pe(l.onClick,()=>{A.current!=="mouse"&&E()}),onPointerUp:Pe(l.onPointerUp,()=>{A.current==="mouse"&&E()}),onPointerDown:Pe(l.onPointerDown,k=>{A.current=k.pointerType}),onPointerMove:Pe(l.onPointerMove,k=>{A.current=k.pointerType,r?d.onItemLeave?.():A.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(l.onPointerLeave,k=>{k.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Pe(l.onKeyDown,k=>{d.searchRef?.current!==""&&k.key===" "||(zG.includes(k.key)&&E(),k.key===" "&&k.preventDefault())})})})})});JT.displayName=Qp;var bd="SelectItemText",eR=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,...s}=t,l=po(bd,n),u=mo(bd,n),d=ZT(bd,n),f=BG(bd,n),[p,m]=v.useState(null),x=Et(e,E=>m(E),d.onItemTextChange,E=>u.itemTextRefCallback?.(E,d.value,d.disabled)),b=p?.textContent,w=v.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:C,onNativeOptionRemove:A}=f;return zn(()=>(C(w),()=>A(w)),[C,A,w]),o.jsxs(o.Fragment,{children:[o.jsx(Je.span,{id:d.textId,...s,ref:x}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Wd.createPortal(s.children,l.valueNode):null]})});eR.displayName=bd;var tR="SelectItemIndicator",nR=v.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return ZT(tR,n).isSelected?o.jsx(Je.span,{"aria-hidden":!0,...i,ref:e}):null});nR.displayName=tR;var ly="SelectScrollUpButton",iR=v.forwardRef((t,e)=>{const n=mo(ly,t.__scopeSelect),i=zw(ly,t.__scopeSelect),[r,s]=v.useState(!1),l=Et(e,i.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;s(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),r?o.jsx(sR,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});iR.displayName=ly;var cy="SelectScrollDownButton",rR=v.forwardRef((t,e)=>{const n=mo(cy,t.__scopeSelect),i=zw(cy,t.__scopeSelect),[r,s]=v.useState(!1),l=Et(e,i.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<f;s(p)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),r?o.jsx(sR,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});rR.displayName=cy;var sR=v.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=t,s=mo("SelectScrollButton",n),l=v.useRef(null),u=Om(n),d=v.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),zn(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),o.jsx(Je.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:Pe(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(i,50))}),onPointerMove:Pe(r.onPointerMove,()=>{s.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(i,50))}),onPointerLeave:Pe(r.onPointerLeave,()=>{d()})})}),tV="SelectSeparator",nV=v.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return o.jsx(Je.div,{"aria-hidden":!0,...i,ref:e})});nV.displayName=tV;var uy="SelectArrow",iV=v.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=Mm(n),s=po(uy,n),l=mo(uy,n);return s.open&&l.position==="popper"?o.jsx(Iw,{...r,...i,ref:e}):null});iV.displayName=uy;var rV="SelectBubbleInput",aR=v.forwardRef(({__scopeSelect:t,value:e,...n},i)=>{const r=v.useRef(null),s=Et(i,r),l=L_(e);return v.useEffect(()=>{const u=r.current;if(!u)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==e&&p){const m=new Event("change",{bubbles:!0});p.call(u,e),u.dispatchEvent(m)}},[l,e]),o.jsx(Je.select,{...n,style:{...IT,...n.style},ref:s,defaultValue:e})});aR.displayName=rV;function oR(t){return t===""||t===void 0}function lR(t){const e=Zn(t),n=v.useRef(""),i=v.useRef(0),r=v.useCallback(l=>{const u=n.current+l;e(u),(function d(f){n.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>d(""),1e3))})(u)},[e]),s=v.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function cR(t,e,n){const r=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let l=sV(t,Math.max(s,0));r.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function sV(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var aV=zT,oV=$T,lV=BT,cV=HT,uV=GT,dV=VT,hV=YT,fV=JT,pV=eR,mV=nR,gV=iR,xV=rR;function Br({...t}){return o.jsx(aV,{"data-slot":"select",...t})}function Hr({...t}){return o.jsx(lV,{"data-slot":"select-value",...t})}function Gr({className:t,size:e="default",children:n,...i}){return o.jsxs(oV,{"data-slot":"select-trigger","data-size":e,className:Fe("text-foreground border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,o.jsx(cV,{asChild:!0,children:o.jsx(xs,{className:"size-4 opacity-50"})})]})}function Vr({className:t,children:e,position:n="popper",align:i="center",...r}){return o.jsx(uV,{children:o.jsxs(dV,{"data-slot":"select-content",className:Fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
719de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,align:i,...r,children:[o.jsx(vV,{}),o.jsx(hV,{className:Fe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),o.jsx(bV,{})]})})}function di({className:t,children:e,...n}){return o.jsxs(fV,{"data-slot":"select-item",className:Fe("text-foreground focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(mV,{children:o.jsx(Zi,{className:"size-4"})})}),o.jsx(pV,{children:e})]})}function vV({className:t,...e}){return o.jsx(gV,{"data-slot":"select-scroll-up-button",className:Fe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(u8,{className:"size-4"})})}function bV({className:t,...e}){return o.jsx(xV,{"data-slot":"select-scroll-down-button",className:Fe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(xs,{className:"size-4"})})}async function ca(){const t=await De(_e.FOLDERS,{method:"GET"});return Array.isArray(t)?t:[]}async function no(){return De(_e.FOLDERS_GENERAL,{method:"GET"})}async function xk(t){return De(_e.FOLDERS_ONE(t),{method:"GET"})}async function dy(t){return De(_e.FOLDERS,{method:"POST",jsonBody:t})}async function yV(t,e){return De(_e.FOLDERS_ONE(t),{method:"PATCH",jsonBody:e})}async function wV(t){await De(_e.FOLDERS_ONE(t),{method:"DELETE"})}async function SV(t,e){await De(_e.FOLDERS_DOCUMENT(t,e),{method:"POST"})}async function CV(t,e){await De(_e.FOLDERS_DOCUMENT(t,e),{method:"DELETE"})}function EV(t){const e=t.options??[],n=e.find(i=>(i.optionName??i.name)==="color")??e.find(i=>(i.optionName??i.name)==="colour");return(n?.optionValue??n?.value)||"purple"}async function AV(t){return De(_e.SHARING_GROUPS,{method:"POST",jsonBody:{name:t}})}async function uR(){return De(_e.SHARING_GROUPS,{method:"GET"})}async function kV(t,e){return De(_e.SHARING_GROUP_MEMBERS(t),{method:"POST",jsonBody:{employeeId:e}})}async function NV(t,e){return De(_e.SHARING_GROUP_MEMBER(t,e),{method:"DELETE"})}async function jV(t,e){return De(_e.SHARING_DOCUMENT_SHARE_DIRECT(t),{method:"POST",jsonBody:{employeeId:e}})}async function _V(t,e){return De(_e.SHARING_DOCUMENT_SHARE_GROUP(t),{method:"POST",jsonBody:{groupId:e}})}async function TV(t,e){return De(_e.SHARING_DOCUMENT_REVOKE_DIRECT(t,e),{method:"DELETE"})}async function RV(t,e){return De(_e.SHARING_DOCUMENT_REVOKE_GROUP(t,e),{method:"DELETE"})}async function PV(t){return De(_e.SHARING_DOCUMENT_ACCESS(t),{method:"GET"})}async function dR(t,e){return De(_e.SHARING_FOLDER_SHARE_DIRECT(t),{method:"POST",jsonBody:{employeeId:e}})}async function hR(t,e){return De(_e.SHARING_FOLDER_SHARE_GROUP(t),{method:"POST",jsonBody:{groupId:e}})}async function DV(t,e){return De(_e.SHARING_FOLDER_REVOKE_DIRECT(t,e),{method:"DELETE"})}async function LV(t,e){return De(_e.SHARING_FOLDER_REVOKE_GROUP(t,e),{method:"DELETE"})}async function fR(t){return De(_e.SHARING_FOLDER_ACCESS(t),{method:"GET"})}async function OV(t,e){return De(_e.SHARING_COLLECTION_SHARE_DIRECT(t),{method:"POST",jsonBody:{employeeId:e}})}async function MV(t,e){return De(_e.SHARING_COLLECTION_SHARE_GROUP(t),{method:"POST",jsonBody:{groupId:e}})}async function IV(t,e){return De(_e.SHARING_COLLECTION_REVOKE_DIRECT(t,e),{method:"DELETE"})}async function zV(t,e){return De(_e.SHARING_COLLECTION_REVOKE_GROUP(t,e),{method:"DELETE"})}async function pR(t){return De(_e.SHARING_COLLECTION_ACCESS(t),{method:"GET"})}function Mc({className:t,...e}){return o.jsx("textarea",{"data-slot":"textarea",className:Fe("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-input border-input min-h-[80px] w-full min-w-0 rounded-md border text-foreground px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 aria-invalid:border-destructive",t),...e})}const mR=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv","rtf","odt","ods","odp","zip","epub"];function gR(t){try{const n=new URL(t).pathname.split("/").filter(
719Boolean).pop()??"";return n.includes(".")?n.split(".").pop()?.toLowerCase()??"":""}catch{return""}}function FV(t){const e=gR(t);return e!==""&&mR.includes(e)}function $V(t){const e=gR(t);return e===""?!1:!mR.includes(e)}function vk(t){try{const e=new URL(t).hostname.toLowerCase();return e==="youtube.com"||e==="www.youtube.com"||e.endsWith(".youtube.com")||e==="youtu.be"||e==="www.youtu.be"}catch{return!1}}function UV(t,e){if(typeof t=="string")return{markdown:t,sourceUrl:e};if(t&&typeof t=="object"){const n=t,i=typeof n.markdown=="string"?n.markdown:n.result?.markdown??"",r=typeof n.last_modified=="string"?n.last_modified:n.lastModified;return{markdown:typeof i=="string"?i:"",lastModified:r,sourceUrl:e}}return{markdown:"",sourceUrl:e}}async function BV(t){const e=await De(_e.WEB_CRAWL_MARKDOWN,{method:"POST",jsonBody:{url:t}});return UV(e,t)}async function HV(t){const e=await fetch(t,{mode:"cors"});if(!e.ok)throw new Error(`Download failed: ${e.status} ${e.statusText}`);const n=await e.blob();let i=t.split("/").pop()?.split("?")[0]??"document";const r=e.headers.get("Content-Disposition");if(r){const s=/filename\*?=(?:UTF-8'')?["']?([^"'\s;]+)["']?/i.exec(r);s?.[1]&&(i=decodeURIComponent(s[1]))}return new File([n],i,{type:n.type||"application/octet-stream"})}function Fw(){const t=localStorage.getItem("user.token"),e={};return t&&(e.Authorization=`Bearer ${t}`),e}async function $w(t){const e=await t.json().catch(()=>({})),n=Array.isArray(e.message)?e.message.join(", "):e.message??e.detail??`Errore HTTP ${t.status}`;throw new Error(n)}async function bk(t){const e=await fetch(_e.DOCUMENTS_CONTENT(t),{method:"GET",headers:Fw()});e.ok||await $w(e);const n=e.headers.get("content-type")??"application/octet-stream";return{blob:await e.blob(),contentType:n}}async function GV(t){const e=await fetch(_e.DOCUMENTS_MEDIA(t),{method:"GET",headers:Fw()});e.ok||await $w(e);const n=e.headers.get("content-type")??"application/octet-stream";return{blob:await e.blob(),contentType:n}}async function VV(t){const e=await fetch(_e.DOCUMENTS_CONTENT(t),{method:"GET",headers:Fw()});return e.ok||await $w(e),e.text()}async function qV(t){const e=new URLSearchParams;t?.page!=null&&e.set("page",String(t.page)),e.set("pageSize",String(t.pageSize));const n=e.toString(),i=n?`${_e.DOCUMENTS_SHARED_WITH_ME}?${n}`:_e.DOCUMENTS_SHARED_WITH_ME;return De(i,{method:"GET"})}async function Ic(t){const e=new URLSearchParams;t?.folderId!=null&&e.set("folderId",String(t.folderId)),t?.status&&e.set("status",t.status),t?.page!=null&&e.set("page",String(t.page)),t?.pageSize!=null&&e.set("pageSize",String(t.pageSize));const n=e.toString(),i=n?`${_e.DOCUMENTS}?${n}`:_e.DOCUMENTS,r=await De(i,{method:"GET"});return Array.isArray(r)?{data:r}:r}async function xR(t,e,n){const i=new FormData;i.append("file",t),e!=null&&i.append("folderId",String(e)),n&&i.append("source",n);const r=new URLSearchParams;e!=null&&r.set("folderId",String(e)),n&&r.set("source",n);const s=r.toString(),l=s?`${_e.DOCUMENTS_UPLOAD}?${s}`:_e.DOCUMENTS_UPLOAD;return De(l,{method:"POST",formData:i})}async function KV(t){return De(_e.DOCUMENTS_UPLOAD_WEB,{method:"POST",jsonBody:t})}async function Nc(t,e){const n=[];for(const i of t){const r=await xR(i,e);n.push(r)}return n}async function Zp(t){await De(_e.DOCUMENTS_ONE(t),{method:"DELETE"})}async function yk(t){return De(_e.DOCUMENTS_DOWNLOAD(t),{method:"GET"})}function WV(t){return{object_id:t.id,file_name:t.name,file_extension:t.type??"",file_size:t.size??0,last_updated_time:t.createdAt??new Date().toISOString(),is_folder:!1,employeeId:t.employeeId,source:t.source,uri:t.uri,processingStatus:t.processingStatus,processingError:null}}async function Uw(t){await De(_e.DOCUMENTS_REPROCESS(t),{method:"POST"})}async function Xv(t){return De(`${_e.TASKS}?limit=20`,{method:"GET"})}async function YV(){return De(_e.TASKS_SUMMARY,{method:"GET"})}async function XV(t){return De(_e.TASKS_WEB_INGESTION,{method:"POST",jsonBody:t})}async function QV(t){const e=new FormData;return e.append("file",t.file),t.folderId!=null&&e.append("folderId",String(t.folderId)),De(_e.TASKS_AUDIO_INGESTION,{method:"POST",formData:e})}async function ZV(t){return De(_e.TASKS_CANCEL(t),{method:"POST"})}function JV(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nq={};function wk(t,e){return(nq.jsx?tq:eq).test(t)}const iq=/[ \t\n\f\r]/g;function rq(t){return typeof t=="object"?t.type==="text"?Sk(t.value):!1:Sk(t)}function Sk(t){return t.replace(iq,"")===""}class ah{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function vR(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new ah(n,i,e)}function hy(t){return t.toLowerCase()}class $i{constructor(e,n){this.attribute=n,this.property=e}}$i.prototype.attribute="";$i.prototype.booleanish=!1;$i.prototype.boolean=!1;$i.prototype.commaOrSpaceSeparated=!1;$i.prototype.commaSeparated=!1;$i.prototype.defined=!1;$i.prototype.mustUseProperty=!1;$i.prototype.number=!1;$i.prototype.overloadedBoolean=!1;$i.prototype.property="";$i.prototype.spaceSeparated=!1;$i.prototype.space=void 0;let sq=0;const ut=vl(),Ln=vl(),fy=vl(),ke=vl(),Vt=vl(),Jo=vl(),Yi=vl();function vl(){return 2**++sq}const py=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Ln,commaOrSpaceSeparated:Yi,commaSeparated:Jo,number:ke,overloadedBoolean:fy,spaceSeparated:Vt},Symbol.toStringTag,{value:"Module"})),Qv=Object.keys(py);class Bw extends $i{constructor(e,n,i,r){let s=-1;if(super(e,n),Ck(this,"space",r),typeof i=="number")for(;++s<Qv.length;){const l=Qv[s];Ck(this,Qv[s],(i&py[l])===py[l])}}}Bw.prototype.defined=!0;function Ck(t,e,n){n&&(t[e]=n)}function nu(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new Bw(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[hy(i)]=i,n[hy(s.attribute)]=i}return new ah(e,n,t.space)}const bR=nu({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControl
vendor: 4,132 bytes, line 719
719s:Vt,ariaCurrent:null,ariaDescribedBy:Vt,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:Vt,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:Vt,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Vt,ariaLevel:ke,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:Vt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:Vt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Ln,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function yR(t,e){return e in t?t[e]:e}function wR(t,e){return yR(t,e.toLowerCase())}const aq=nu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jo,acceptCharset:Vt,accessKey:Vt,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alpha:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:Vt,autoFocus:ut,autoPlay:ut,blocking:Vt,capture:null,charSet:null,checked:ut,cite:null,className:Vt,closedBy:null,colorSpace:null,cols:ke,colSpan:ke,command:null,commandFor:null,content:null,contentEditable:Ln,controls:ut,controlsList:Vt,coords:ke|Jo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:fy,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:Vt,height:ke,hidden:fy,high:ke,href:null,hrefLang:null,htmlFor:Vt,httpEquiv:Vt,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:Vt,itemRef:Vt,itemScope:ut,itemType:Vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ut,optimum:ke,pattern:null,ping:Vt,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:Vt,required:ut,reversed:ut,rows:ke,rowSpan:ke,sandbox:Vt,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootClonable:ut,shadowRootCustomElementRegistry:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shadowRootSerializable:ut,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Ln,src:null,
719srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:Ln,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Vt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Ln,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ut,disablePictureInPicture:ut,disableRemotePlayback:ut,exportParts:Jo,part:Vt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:wR}),oq=nu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
719-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Yi,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jo,g2:Jo,glyphName:Jo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Yi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 5,261 bytes, lines 719-720
719Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yi,rev:Yi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yi,requiredFeatures:Yi,requiredFonts:Yi,requiredFormats:Yi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Yi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yi,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yR}),SR=nu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),CR=nu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wR}),ER=nu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),lq={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},cq=/[A-Z]/g,Ek=/-[a-z]/g,uq=/^data[-\w.:]+$/i;function dq(t,e){const n=hy(e);let i=e,r=$i;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&uq.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Ek,fq);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Ek.test(s)){let l=s.replace(cq,hq);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}r=Bw}return new r(i,e)}function hq(t){return"-"+t.toLowerCase()}function fq(t){return t.charAt(1).toUpperCase()}const pq=vR([bR,aq,SR,CR,ER],"html"),Hw=vR([bR,oq,SR,CR,ER],"svg");function mq(t){return t.join(" ").trim()}var gc={},Zv,Ak;function gq(){if(Ak)return Zv;Ak=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
720`,f="/",p="*",m="",x="comment",b="declaration";function w(A,E){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];E=E||{};var k=1,N=1;function _(K){var q=K.match(e);q&&(k+=q.length);var F=K.lastIndexOf(d);N=~F?K.length-F:N+K.length}function R(){var K={line:k,column:N};return function(q){return q.position=new T(K),U(),q}}function T(K){this.start=K,this.end={line:k,column:N},this.source=E.source}T.prototype.content=A;function L(K){var q=new Error(E.source+":"+k+":"+N+": "+K);if(q.reason=K,q.filename=E.source,q.line=k,q.column=N,q.source=A,!E.silent)throw q}function M(K){var q=K.exec(A);if(q){var F=q[0];return _(F),A=A.slice(F.length),q}}function U(){M(n)}function D(K){var q;for(K=K||[];q=G();)q!==!1&&K.push(q);return K}function G(){var K=R();if(!(f!=A.charAt(0)||p!=A.charAt(1))){for(var q=2;m!=A.charAt(q)&&(p!=A.charAt(q)||f!=A.charAt(q+1));)++q;if(q+=2,m===A.charAt(q-1))return L("End of comment missing");var F=A.slice(2,q-2);return N+=2,_(F),A=A.slice(q),N+=2,K({type:x,comment:F})}}function Z(){var K=R(),q=M(i);if(q){if(G(),!M(r))return L("property missing ':'");var F=M(s),V=K({type:b,property:C(q[0].replace(t,m)),value:F?C(F[0].replace(t,m)):m});return M(l),V}}function Q(){var K=[];D(K);for(var q;q=Z();)q!==!1&&(K.push(q),D(K));return K}return U(),Q()}function C(A){return A?A.replace(u,m):m}return Zv=w,Zv}var kk;
vendor: 3,829 bytes, line 720
720function xq(){if(kk)return gc;kk=1;var t=gc&&gc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(gc,"__esModule",{value:!0}),gc.default=n;const e=t(gq());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const l=(0,e.default)(i),u=typeof r=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?r(f,p,d):p&&(s=s||{},s[f]=p)}),s}return gc}var cd={},Nk;function vq(){if(Nk)return cd;Nk=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(f){return!f||n.test(f)||t.test(f)},l=function(f,p){return p.toUpperCase()},u=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),s(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(r,u):f=f.replace(i,u),f.replace(e,l))};return cd.camelCase=d,cd}var ud,jk;function bq(){if(jk)return ud;jk=1;var t=ud&&ud.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(xq()),n=vq();function i(r,s){var l={};return!r||typeof r!="string"||(0,e.default)(r,function(u,d){u&&d&&(l[(0,n.camelCase)(u,s)]=d)}),l}return i.default=i,ud=i,ud}var yq=bq();const wq=ml(yq),AR=kR("end"),Gw=kR("start");function kR(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Sq(t){const e=Gw(t),n=AR(t);if(e&&n)return{start:e,end:n}}function kd(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?_k(t.position):"start"in t||"end"in t?_k(t):"line"in t||"column"in t?my(t):""}function my(t){return Tk(t&&t.line)+":"+Tk(t&&t.column)}function _k(t){return my(t&&t.start)+"-"+my(t&&t.end)}function Tk(t){return t&&typeof t=="number"?t:1}class gi extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(l=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=u?u.line:void 0,this.name=kd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}gi.prototype.file="";gi.prototype.name="";gi.prototype.reason="";gi.prototype.message="";gi.prototype.stack="";gi.prototype.column=void 0;gi.prototype.line=void 0;gi.prototype.ancestors=void 0;gi.prototype.cause=void 0;gi.prototype.fatal=void 0;gi.prototype.place=void 0;gi.prototype.ruleId=void 0;gi.prototype.source=void 0;const Vw={}.hasOwnProperty,Cq=new Map,Eq=/[A-Z]/g,Aq=new Set(["table","tbody","thead","tfoot","tr"]),kq=new Set(["td","th"]),NR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Nq(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Oq(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,302 bytes, line 720
720if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Lq(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Hw:pq,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=jR(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function jR(t,e,n){if(e.type==="element")return jq(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return _q(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Rq(t,e,n);if(e.type==="mdxjsEsm")return Tq(t,e);if(e.type==="root")return Pq(t,e,n);if(e.type==="text")return Dq(t,e)}function jq(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Hw,t.schema=r),t.ancestors.push(e);const s=TR(t,e.tagName,!1),l=Mq(t,e);let u=Kw(t,e);return Aq.has(e.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!rq(d):!0})),_R(t,l,s,e),qw(l,u),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function _q(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}Ud(t,e.position)}function Tq(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Ud(t,e.position)}function Rq(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=Hw,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:TR(t,e.name,!0),l=Iq(t,e),u=Kw(t,e);return _R(t,l,s,e),qw(l,u),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function Pq(t,e,n){const i={};return qw(i,Kw(t,e)),t.create(e,t.Fragment,i,n)}function Dq(t,e){return e.value}function _R(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function qw(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Lq(t,e,n){return i;function i(r,s,l,u){const f=Array.isArray(l.children)?n:e;return u?f(s,l,u):f(s,l)}}function Oq(t,e){return n;function n(i,r,s,l){const u=Array.isArray(s.children),d=Gw(i);return e(r,s,l,u,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function Mq(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&Vw.call(e.properties,r)){const s=zq(t,r,e.properties[r]);if(s){const[l,u]=s;t.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&kq.has(e.tagName)?i=u:n[l]=u}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Iq(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else Ud(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const u=i.value.data.estree.body[0];u.type,s=t.evaluater.evaluateExpression(u.expression)}else Ud(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function Kw(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:Cq;for(;++i<e.children.length;){const s=e.children[i];let l;if(t.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const f=r.get(d)||0;l=d+"-"+f,r.set(d,f+1)}}const u=jR(t,s,l);u!==void 0&&n.push(u)}return n}function zq(t,e,n){const i=dq(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?JV(n):mq(n)),i.property==="style"){let r=typeof n=="object"?n:Fq(t,String(n));return t.stylePropertyNameCase==="css"&&(r=$q(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&i.space?lq[i.property]||i.property:i.attribute,n]}}function Fq(t,e){try{return wq(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,r=new gi("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=NR+"#cannot-parse-style-attribute",r}}function TR(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,l;for(;++s<r.length;){const u=wk(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(s&&u.type==="Literal"),optional:!1}:u}i=l}else i=wk(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return Vw.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(i);Ud(t)}function Ud(t,e){const n=new gi("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=NR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $q(t){const e={};let n;for(n in t)Vw.call(t,n)&&(e[Uq(n)]=t[n]);return e}function Uq(t){let e=t.replace(Eq,Bq);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Bq(t){return"-"+t.toLowerCase()}const Jv={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Hq={};function Ww(t,e){const n=Hq,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return RR(t,i,r)}function RR(t,e,n){if(Gq(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Rk(t.children,e,n)}return Array.isArray(t)?Rk(t,e,n):""}function Rk(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=RR(t[r],e,n);return i.join("")}function Gq(t){return!!(t&&typeof t=="object")}const Pk=document.createElement("i");function Yw(t){const e="&"+t+";";Pk.innerHTML=e;const n=Pk.textContent;
vendor: 14,479 bytes, line 720
720return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ji(t,e,n,i){const r=t.length;let s=0,l;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(e,0),t.splice(...l),s+=1e4,e+=1e4}function vr(t,e){return t.length>0?(Ji(t,t.length,0,e),t):e}const Dk={}.hasOwnProperty;function PR(t){const e={};let n=-1;for(;++n<t.length;)Vq(e,t[n]);return e}function Vq(t,e){let n;for(n in e){const r=(Dk.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let l;if(s)for(l in s){Dk.call(r,l)||(r[l]=[]);const u=s[l];qq(r[l],Array.isArray(u)?u:u?[u]:[])}}}function qq(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Ji(t,0,0,i)}function DR(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Kr(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Si=go(/[A-Za-z]/),fi=go(/[\dA-Za-z]/),Kq=go(/[#-'*+\--9=?A-Z^-~]/);function Jp(t){return t!==null&&(t<32||t===127)}const gy=go(/\d/),Wq=go(/[\dA-Fa-f]/),Yq=go(/[!-/:-@[-`{-~]/);function Ze(t){return t!==null&&t<-2}function Wt(t){return t!==null&&(t<0||t===32)}function Ct(t){return t===-2||t===-1||t===32}const Im=go(new RegExp("\\p{P}|\\p{S}","u")),ll=go(/\s/);function go(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function iu(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let l="";if(s===37&&fi(t.charCodeAt(n+1))&&fi(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const u=t.charCodeAt(n+1);s<56320&&u>56319&&u<57344?(l=String.fromCharCode(s,u),r=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(t.slice(i,n),encodeURIComponent(l)),i=n+r+1,l=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function _t(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return Ct(d)?(t.enter(n),u(d)):e(d)}function u(d){return Ct(d)&&s++<r?(t.consume(d),u):(t.exit(n),e(d))}}const Xq={tokenize:Qq};function Qq(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),_t(t,e,"linePrefix")}function r(u){return t.enter("paragraph"),s(u)}function s(u){const d=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return Ze(u)?(t.consume(u),t.exit("chunkText"),s):(t.consume(u),l)}}const Zq={tokenize:Jq},Lk={tokenize:eK};function Jq(t){const e=this,n=[];let i=0,r,s,l;return u;function u(N){if(i<n.length){const _=n[i];return e.containerState=_[1],t.attempt(_[0].continuation,d,f)(N)}return f(N)}function d(N){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&k();const _=e.events.length;let R=_,T;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){T=e.events[R][1].end;break}E(i);let L=_;for(;L<e.events.length;)e.events[L][1].end={...T},L++;return Ji(e.events,R+1,0,e.events.slice(_)),e.events.length=L,f(N)}return u(N)}function f(N){if(i===n.length){if(!r)return x(N);if(r.currentConstruct&&r.currentConstruct.concrete)return w(N);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Lk,p,m)(N)}function p(N){return r&&k(),E(i),x(N)}function m(N){return e.parser.lazy[e.now().line]=i!==n.length,l=e.now().offset,w(N)}function x(N){return e.containerState={},t.attempt(Lk,b,w)(N)}function b(N){return i++,n.push([e.currentConstruct,e.containerState]),x(N)}function w(N){if(N===null){r&&k(),E(0),t.consume(N);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),C(N)}function C(N){if(N===null){A(t.exit("chunkFlow"),!0),E(0),t.consume(N);return}return Ze(N)?(t.consume(N),A(t.exit("chunkFlow")),i=0,e.interrupt=void 0,u):(t.consume(N),C)}function A(N,_){const R=e.sliceStream(N);if(_&&R.push(null),N.previous=s,s&&(s.next=N),s=N,r.defineSkip(N.start),r.write(R),e.parser.lazy[N.start.line]){let T=r.events.length;for(;T--;)if(r.events[T][1].start.offset<l&&(!r.events[T][1].end||r.events[T][1].end.offset>l))return;const L=e.events.length;let M=L,U,D;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(U){D=e.events[M][1].end;break}U=!0}for(E(i),T=L;T<e.events.length;)e.events[T][1].end={...D},T++;Ji(e.events,M+1,0,e.events.slice(L)),e.events.length=T}}function E(N){let _=n.length;for(;_-- >N;){const R=n[_];e.containerState=R[1],R[0].exit.call(e,t)}n.length=N}function k(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function eK(t,e,n){return _t(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zc(t){if(t===null||Wt(t)||ll(t))return 1;if(Im(t))return 2}function zm(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}const xy={name:"attention",resolveAll:tK,tokenize:nK};function tK(t,e){let n=-1,i,r,s,l,u,d,f,p;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;d=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[i][1].end},x={...t[n][1].start};Ok(m,-d),Ok(x,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...t[i][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:x},s={type:d>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},t[i][1].end={...l.start},t[n][1].start={...u.end},f=[],t[i][1].end.offset-t[i][1].start.offset&&(f=vr(f,[["enter",t[i][1],e],["exit",t[i][1],e]])),f=vr(f,[["enter",r,e],["enter",l,e],["exit",l,e],["enter",s,e]]),f=vr(f,zm(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),f=vr(f,[["exit",s,e],["enter",u,e],["exit",u,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(p=2,f=vr(f,[["enter",t[n][1],e],["exit",t[n][1],e]])):p=0,Ji(t,i-1,n-i+3,f),n=i+f.length-p-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function nK(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=zc(i);let s;return l;function l(d){return s=d,t.enter("attentionSequence"),u(d)}function u(d){if(d===s)return t.consume(d),u;const f=t.exit("attentionSequence"),p=zc(d),m=!p||p===2&&r||n.includes(d),x=!r||r===2&&p||n.includes(i);return f._open=!!(s===42?m:m&&(r||!x)),f._close=!!(s===42?x:x&&(p||!m)),e(d)}}function Ok(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const iK={name:"autolink",tokenize:rK};function rK(t,e,n){let i=0;return r;function r(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(b){return Si(b)?(t.consume(b),l):b===64?n(b):f(b)}function l(b){return b===43||b===45||b===46||fi(b)?(i=1,u(b)):f(b)}function u(b){return b===58?(t.consume(b),i=0,d):(b===43||b===45||b===46||fi(b))&&i++<32?(t.consume(b),u):(i=0,f(b))}function d(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||Jp(b)?n(b):(t.consume(b),d)}function f(b){return b===64?(t.consume(b),p):Kq(b)?(t.consume(b),f):n(b)}function p(b){return fi(b)?m(b):n(b)}function m(b){return b===46?(t.consume(b),i=0,p):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):x(b)}function x(b){if((b===45||fi(b))&&i++<63){const w=b===45?x:m;return t.consume(b),w}return n(b)}}const oh={partial:!0,tokenize:sK};function sK(t,e,n){return i;function i(s){return Ct(s)?_t(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||Ze(s)?e(s):n(s)}}const LR={continuation:{tokenize:oK},exit:lK,name:"blockQuote",tokenize:aK};function aK(t,e,n){const i=this;return r;function r(l){if(l===62){const u=i.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Ct(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function oK(t,e,n){const i=this;return r;function r(l){return Ct(l)?_t(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return t.attempt(LR,e,n)(l)}}function lK(t){t.exit("blockQuote")}const OR={name:"characterEscape",tokenize:cK};function cK(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return Yq(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const MR={name:"characterReference",tokenize:uK};function uK(t,e,n){const i=this;let r=0,s,l;return u;function u(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),d}function d(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),f):(t.enter("characterReferenceValue"),s=31,l=fi,p(m))}function f(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,l=Wq,p):(t.enter("characterReferenceValue"),s=7,l=gy,p(m))}function p(m){if(m===59&&r){const x=t.exit("characterReferenceValue");return l===fi&&!Yw(i.sliceSerialize(x))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(m)&&r++<s?(t.consume(m),p):n(m)}}const Mk={partial:!0,tokenize:hK},Ik={concrete:!0,name:"codeFenced",tokenize:dK};function dK(t,e,n){const i=this,r={partial:!0,tokenize:R};let s=0,l=0,u;return d;function d(T){return f(T)}function f(T){const L=i.events[i.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,u=T,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===u?(l++,t.consume(T),p):l<3?n(T):(t.exit("codeFencedFenceSequence"),Ct(T)?_t(t,m,"whitespace")(T):m(T))}function m(T){return T===null||Ze(T)?(t.exit("codeFencedFence"),i.interrupt?e(T):t.check(Mk,C,_)(T)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Ze(T)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(T)):Ct(T)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),_t(t,b,"whitespace")(T)):T===96&&T===u?n(T):(t.consume(T),x)}function b(T){return T===null||Ze(T)?m(T):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===null||Ze(T)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(T)):T===96&&T===u?n(T):(t.consume(T),w)}function C(T){return t.attempt(r,_,A)(T)}function A(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),E}function E(T){return s>0&&Ct(T)?_t(t,k,"linePrefix",s+1)(T):k(T)}function k(T){return T===null||Ze(T)?t.check(Mk,C,_)(T):(t.enter("codeFlowValue"),N(T))}function N(T){return T===null||Ze(T)?(t.exit("codeFlowValue"),k(T)):(t.consume(T),N)}function _(T){return t.exit("codeFenced"),e(T)}function R(T,L,M){let U=0;return D;function D(q){return T.enter("lineEnding"),T.consume(q),T.exit("lineEnding"),G}function G(q){return T.enter("codeFencedFence"),Ct(q)?_t(T,Z,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):Z(q)}function Z(q){return q===u?(T.enter("codeFencedFenceSequence"),Q(q)):M(q)}function Q(q){return q===u?(U++,T.consume(q),Q):U>=l?(T.exit("codeFencedFenceSequence"),Ct(q)?_t(T,K,"whitespace")(q):K(q)):M(q)}function K(q){return q===null||Ze(q)?(T.exit("codeFencedFence"),L(q)):M(q)}}}function hK(t,e,n){const i=this;return r;function r(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}const eb={name:"codeIndented",tokenize:pK},fK={partial:!0,tokenize:mK};function pK(t,e,n){const i=this;return r;function r(f){return t.enter("codeIndented"),_t(t,s,"linePrefix",5)(f)}function s(f){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ze(f)?t.attempt(fK,l,d)(f):(t.enter("codeFlowValue"),u(f))}function u(f){return f===null||Ze(f)?(t.exit("codeFlowValue"),l(f)):(t.consume(f),u)}function d(f){return t.exit("codeIndented"),e(f)}}function mK(t,e,n){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?n(l):Ze(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),r):_t(t,s,"linePrefix",5)(l)}function s(l){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(l):Ze(l)?r(l):n(l)}}const gK={name:"codeText",previous:vK,resolve:xK,tokenize:bK};function xK(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function vK(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bK(t,e,n){let i=0,r,s;return l;
vendor: 5,334 bytes, line 720
720function l(m){return t.enter("codeText"),t.enter("codeTextSequence"),u(m)}function u(m){return m===96?(t.consume(m),i++,u):(t.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),d):m===96?(s=t.enter("codeTextSequence"),r=0,p(m)):Ze(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ze(m)?(t.exit("codeTextData"),d(m)):(t.consume(m),f)}function p(m){return m===96?(t.consume(m),r++,p):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",f(m))}}class yK{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&dd(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),dd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),dd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);dd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);dd(this.left,n.reverse())}}}function dd(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function IR(t){const e={};let n=-1,i,r,s,l,u,d,f;const p=new yK(t);for(;++n<p.length;){for(;n in e;)n=e[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,wK(p,n)),n=e[n],f=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(l=p.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(p.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...p.get(r)[1].start},u=p.slice(r,n),u.unshift(i),p.splice(r,n-r+1,u))}}return Ji(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function wK(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let p,m,x=-1,b=n,w=0,C=0;const A=[C];for(;b;){for(;t.get(++r)[1]!==b;);s.push(r),b._tokenizer||(p=i.sliceStream(b),b.next||p.push(null),m&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++x<u.length;)u[x][0]==="exit"&&u[x-1][0]==="enter"&&u[x][1].type===u[x-1][1].type&&u[x][1].start.line!==u[x][1].end.line&&(C=x+1,A.push(C),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):A.pop(),x=A.length;x--;){const E=u.slice(A[x],A[x+1]),k=s.pop();d.push([k,k+E.length-1]),t.splice(k,2,E)}for(d.reverse(),x=-1;++x<d.length;)f[w+d[x][0]]=w+d[x][1],w+=d[x][1]-d[x][0]-1;return f}const SK={resolve:EK,tokenize:AK},CK={partial:!0,tokenize:kK};function EK(t){return IR(t),t}function AK(t,e){let n;return i;function i(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(u)}function r(u){return u===null?s(u):Ze(u)?t.check(CK,l,s)(u):(t.consume(u),r)}function s(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function l(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function kK(t,e,n){const i=this;return r;function r(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),_t(t,s,"linePrefix")}function s(l){if(l===null||Ze(l))return n(l);const u=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(l):t.interrupt(i.parser.constructs.flow,n,e)(l)}}function zR(t,e,n,i,r,s,l,u,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(E){return E===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(E),t.exit(s),x):E===null||E===32||E===4
vendor: 21,076 bytes, line 720
7201||Jp(E)?n(E):(t.enter(i),t.enter(l),t.enter(u),t.enter("chunkString",{contentType:"string"}),C(E))}function x(E){return E===62?(t.enter(s),t.consume(E),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(t.exit("chunkString"),t.exit(u),x(E)):E===null||E===60||Ze(E)?n(E):(t.consume(E),E===92?w:b)}function w(E){return E===60||E===62||E===92?(t.consume(E),b):b(E)}function C(E){return!p&&(E===null||E===41||Wt(E))?(t.exit("chunkString"),t.exit(u),t.exit(l),t.exit(i),e(E)):p<f&&E===40?(t.consume(E),p++,C):E===41?(t.consume(E),p--,C):E===null||E===32||E===40||Jp(E)?n(E):(t.consume(E),E===92?A:C)}function A(E){return E===40||E===41||E===92?(t.consume(E),C):C(E)}}function FR(t,e,n,i,r,s){const l=this;let u=0,d;return f;function f(b){return t.enter(i),t.enter(r),t.consume(b),t.exit(r),t.enter(s),p}function p(b){return u>999||b===null||b===91||b===93&&!d||b===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(t.exit(s),t.enter(r),t.consume(b),t.exit(r),t.exit(i),e):Ze(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Ze(b)||u++>999?(t.exit("chunkString"),p(b)):(t.consume(b),d||(d=!Ct(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(t.consume(b),u++,m):m(b)}}function $R(t,e,n,i,r,s){let l;return u;function u(x){return x===34||x===39||x===40?(t.enter(i),t.enter(r),t.consume(x),t.exit(r),l=x===40?41:x,d):n(x)}function d(x){return x===l?(t.enter(r),t.consume(x),t.exit(r),t.exit(i),e):(t.enter(s),f(x))}function f(x){return x===l?(t.exit(s),d(l)):x===null?n(x):Ze(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_t(t,f,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===l||x===null||Ze(x)?(t.exit("chunkString"),f(x)):(t.consume(x),x===92?m:p)}function m(x){return x===l||x===92?(t.consume(x),p):p(x)}}function Nd(t,e){let n;return i;function i(r){return Ze(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):Ct(r)?_t(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const NK={name:"definition",tokenize:_K},jK={partial:!0,tokenize:TK};function _K(t,e,n){const i=this;let r;return s;function s(b){return t.enter("definition"),l(b)}function l(b){return FR.call(i,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return r=Kr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),d):n(b)}function d(b){return Wt(b)?Nd(t,f)(b):f(b)}function f(b){return zR(t,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return t.attempt(jK,m,m)(b)}function m(b){return Ct(b)?_t(t,x,"whitespace")(b):x(b)}function x(b){return b===null||Ze(b)?(t.exit("definition"),i.parser.defined.push(r),e(b)):n(b)}}function TK(t,e,n){return i;function i(u){return Wt(u)?Nd(t,r)(u):n(u)}function r(u){return $R(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return Ct(u)?_t(t,l,"whitespace")(u):l(u)}function l(u){return u===null||Ze(u)?e(u):n(u)}}const RK={name:"hardBreakEscape",tokenize:PK};function PK(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return Ze(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const DK={name:"headingAtx",resolve:LK,tokenize:OK};function LK(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},Ji(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function OK(t,e,n){let i=0;return r;function r(p){return t.enter("atxHeading"),s(p)}function s(p){return t.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(t.consume(p),l):p===null||Wt(p)?(t.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(t.enter("atxHeadingSequence"),d(p)):p===null||Ze(p)?(t.exit("atxHeading"),e(p)):Ct(p)?_t(t,u,"whitespace")(p):(t.enter("atxHeadingText"),f(p))}function d(p){return p===35?(t.consume(p),d):(t.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Wt(p)?(t.exit("atxHeadingText"),u(p)):(t.consume(p),f)}}const MK=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zk=["pre","script","style","textarea"],IK={concrete:!0,name:"htmlFlow",resolveTo:$K,tokenize:UK},zK={partial:!0,tokenize:HK},FK={partial:!0,tokenize:BK};function $K(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function UK(t,e,n){const i=this;let r,s,l,u,d;return f;function f(P){return p(P)}function p(P){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(P),m}function m(P){return P===33?(t.consume(P),x):P===47?(t.consume(P),s=!0,C):P===63?(t.consume(P),r=3,i.interrupt?e:$):Si(P)?(t.consume(P),l=String.fromCharCode(P),A):n(P)}function x(P){return P===45?(t.consume(P),r=2,b):P===91?(t.consume(P),r=5,u=0,w):Si(P)?(t.consume(P),r=4,i.interrupt?e:$):n(P)}function b(P){return P===45?(t.consume(P),i.interrupt?e:$):n(P)}function w(P){const J="CDATA[";return P===J.charCodeAt(u++)?(t.consume(P),u===J.length?i.interrupt?e:Z:w):n(P)}function C(P){return Si(P)?(t.consume(P),l=String.fromCharCode(P),A):n(P)}function A(P){if(P===null||P===47||P===62||Wt(P)){const J=P===47,he=l.toLowerCase();return!J&&!s&&zk.includes(he)?(r=1,i.interrupt?e(P):Z(P)):MK.includes(l.toLowerCase())?(r=6,J?(t.consume(P),E):i.interrupt?e(P):Z(P)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(P):s?k(P):N(P))}return P===45||fi(P)?(t.consume(P),l+=String.fromCharCode(P),A):n(P)}function E(P){return P===62?(t.consume(P),i.interrupt?e:Z):n(P)}function k(P){return Ct(P)?(t.consume(P),k):D(P)}function N(P){return P===47?(t.consume(P),D):P===58||P===95||Si(P)?(t.consume(P),_):Ct(P)?(t.consume(P),N):D(P)}function _(P){return P===45||P===46||P===58||P===95||fi(P)?(t.consume(P),_):R(P)}function R(P){return P===61?(t.consume(P),T):Ct(P)?(t.consume(P),R):N(P)}function T(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),d=P,L):Ct(P)?(t.consume(P),T):M(P)}function L(P){return P===d?(t.consume(P),d=null,U):P===null||Ze(P)?n(P):(t.consume(P),L)}function M(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Wt(P)?R(P):(t.consume(P),M)}function U(P){return P===47||P===62||Ct(P)?N(P):n(P)}function D(P){return P===62?(t.consume(P),G):n(P)}function G(P){return P===null||Ze(P)?Z(P):Ct(P)?(t.consume(P),G):n(P)}function Z(P){return P===45&&r===2?(t.consume(P),F):P===60&&r===1?(t.consume(P),V):P===62&&r===4?(t.consume(P),B):P===63&&r===3?(t.consume(P),$):P===93&&r===5?(t.consume(P),X):Ze(P)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(zK,H,Q)(P)):P===null||Ze(P)?(t.exit("htmlFlowData"),Q(P)):(t.consume(P),Z)}function Q(P){return t.check(FK,K,H)(P)}function K(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),q}function q(P){return P===null||Ze(P)?Q(P):(t.enter("htmlFlowData"),Z(P))}function F(P){return P===45?(t.consume(P),$):Z(P)}function V(P){return P===47?(t.consume(P),l="",O):Z(P)}function O(P){if(P===62){const J=l.toLowerCase();return zk.includes(J)?(t.consume(P),B):Z(P)}return Si(P)&&l.length<8?(t.consume(P),l+=String.fromCharCode(P),O):Z(P)}function X(P){return P===93?(t.consume(P),$):Z(P)}function $(P){return P===62?(t.consume(P),B):P===45&&r===2?(t.consume(P),$):Z(P)}function B(P){return P===null||Ze(P)?(t.exit("htmlFlowData"),H(P)):(t.consume(P),B)}function H(P){return t.exit("htmlFlow"),e(P)}}function BK(t,e,n){const i=this;return r;function r(l){return Ze(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}function HK(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(oh,e,n)}}const GK={name:"htmlText",tokenize:VK};function VK(t,e,n){const i=this;let r,s,l;return u;function u($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),d}function d($){return $===33?(t.consume($),f):$===47?(t.consume($),R):$===63?(t.consume($),N):Si($)?(t.consume($),M):n($)}function f($){return $===45?(t.consume($),p):$===91?(t.consume($),s=0,w):Si($)?(t.consume($),k):n($)}function p($){return $===45?(t.consume($),b):n($)}function m($){return $===null?n($):$===45?(t.consume($),x):Ze($)?(l=m,V($)):(t.consume($),m)}function x($){return $===45?(t.consume($),b):m($)}function b($){return $===62?F($):$===45?x($):m($)}function w($){const B="CDATA[";return $===B.charCodeAt(s++)?(t.consume($),s===B.length?C:w):n($)}function C($){return $===null?n($):$===93?(t.consume($),A):Ze($)?(l=C,V($)):(t.consume($),C)}function A($){return $===93?(t.consume($),E):C($)}function E($){return $===62?F($):$===93?(t.consume($),E):C($)}function k($){return $===null||$===62?F($):Ze($)?(l=k,V($)):(t.consume($),k)}function N($){return $===null?n($):$===63?(t.consume($),_):Ze($)?(l=N,V($)):(t.consume($),N)}function _($){return $===62?F($):N($)}function R($){return Si($)?(t.consume($),T):n($)}function T($){return $===45||fi($)?(t.consume($),T):L($)}function L($){return Ze($)?(l=L,V($)):Ct($)?(t.consume($),L):F($)}function M($){return $===45||fi($)?(t.consume($),M):$===47||$===62||Wt($)?U($):n($)}function U($){return $===47?(t.consume($),F):$===58||$===95||Si($)?(t.consume($),D):Ze($)?(l=U,V($)):Ct($)?(t.consume($),U):F($)}function D($){return $===45||$===46||$===58||$===95||fi($)?(t.consume($),D):G($)}function G($){return $===61?(t.consume($),Z):Ze($)?(l=G,V($)):Ct($)?(t.consume($),G):U($)}function Z($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),r=$,Q):Ze($)?(l=Z,V($)):Ct($)?(t.consume($),Z):(t.consume($),K)}function Q($){return $===r?(t.consume($),r=void 0,q):$===null?n($):Ze($)?(l=Q,V($)):(t.consume($),Q)}function K($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Wt($)?U($):(t.consume($),K)}function q($){return $===47||$===62||Wt($)?U($):n($)}function F($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function V($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),O}function O($){return Ct($)?_t(t,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):X($)}function X($){return t.enter("htmlTextData"),l($)}}const Xw={name:"labelEnd",resolveAll:YK,resolveTo:XK,tokenize:QK},qK={tokenize:ZK},KK={tokenize:JK},WK={tokenize:eW};function YK(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&Ji(t,0,t.length,n),t}function XK(t,e){let n=t.length,i=0,r,s,l,u;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=n);const d={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},f={type:"label",start:{...t[s][1].start},end:{...t[l][1].end}},p={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[l-2][1].start}};return u=[["enter",d,e],["enter",f,e]],u=vr(u,t.slice(s+1,s+i+3)),u=vr(u,[["enter",p,e]]),u=vr(u,zm(e.parser.constructs.insideSpan.null,t.slice(s+i+4,l-3),e)),u=vr(u,[["exit",p,e],t[l-2],t[l-1],["exit",f,e]]),u=vr(u,t.slice(l+1)),u=vr(u,[["exit",d,e]]),Ji(t,s,t.length,u),t}function QK(t,e,n){const i=this;let r=i.events.length,s,l;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return u;function u(x){return s?s._inactive?m(x):(l=i.parser.defined.includes(Kr(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(x),t.exit("labelMarker"),t.exit("labelEnd"),d):n(x)}function d(x){return x===40?t.attempt(qK,p,l?p:m)(x):x===91?t.attempt(KK,p,l?f:m)(x):l?p(x):m(x)}function f(x){return t.attempt(WK,p,m)(x)}function p(x){return e(x)}function m(x){return s._balanced=!0,n(x)}}function ZK(t,e,n){return i;function i(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),r}function r(m){return Wt(m)?Nd(t,s)(m):s(m)}function s(m){return m===41?p(m):zR(t,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Wt(m)?Nd(t,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?$R(t,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Wt(m)?Nd(t,p)(m):p(m)}function p(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function JK(t,e,n){const i=this;return r;function r(u){return FR.call(i,t,s,l,"reference","referenceMarker","referenceString")(u)}function s(u){return i.parser.defined.includes(Kr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function l(u){return n(u)}}function eW(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const tW={name:"labelStartImage",resolveAll:Xw.resolveAll,tokenize:nW};function nW(t,e,n){const i=this;return r;function r(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),s}function s(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):e(u)}}const iW={name:"labelStartLink",resolveAll:Xw.resolveAll,tokenize:rW};function rW(t,e,n){const i=this;return r;function r(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):e(l)}}const tb={name:"lineEnding",tokenize:sW};function sW(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),_t(t,e,"linePrefix")}}const wp={name:"thematicBreak",tokenize:aW};function aW(t,e,n){let i=0,r;return s;function s(f){return t.enter("thematicBreak"),l(f)}function l(f){return r=f,u(f)}function u(f){return f===r?(t.enter("thematicBreakSequence"),d(f)):i>=3&&(f===null||Ze(f))?(t.exit("thematicBreak"),e(f)):n(f)}function d(f){return f===r?(t.consume(f),i++,d):(t.exit("thematicBreakSequence"),Ct(f)?_t(t,u,"whitespace")(f):u(f))}}const Li={continuation:{tokenize:uW},exit:hW,name:"list",tokenize:cW},oW={partial:!0,tokenize:fW},lW={partial:!0,tokenize:dW};function cW(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return u;function u(b){const w=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:gy(b)){if(i.containerState.type||(i.containerState.type=w,t.enter(w,{_container:!0})),w==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(wp,n,f)(b):f(b);if(!i.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(b)}return n(b)}function d(b){return gy(b)&&++l<10?(t.consume(b),d):(!i.interrupt||l<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),f(b)):n(b)}function f(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,t.check(oh,i.interrupt?n:p,t.attempt(oW,x,m))}function p(b){return i.containerState.initialBlankLine=!0,s++,x(b)}function m(b){return Ct(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function uW(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(oh,r,s);function r(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,_t(t,e,"listItemIndent",i.containerState.size+1)(u)}function s(u){return i.containerState.furtherBlankLines||!Ct(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(lW,e,l)(u))}function l(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,_t(t,t.attempt(Li,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function dW(t,e,n){const i=this;return _t(t,r,"listItemIndent",i.containerState.size+1);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?e(s):n(s)}}function hW(t){t.exit(this.containerState.type)}function fW(t,e,n){const i=this;return _t(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const l=i.events[i.events.length-1];return!Ct(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const Fk={name:"setextUnderline",resolveTo:pW,tokenize:mW};function pW(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",l,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=l,t.push(["exit",l,e]),t}function mW(t,e,n){const i=this;let r;return s;function s(f){let p=i.events.length,m;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){m=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(t.enter("setextHeadingLine"),r=f,l(f)):n(f)}function l(f){return t.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===r?(t.consume(f),u):(t.exit("setextHeadingLineSequence"),Ct(f)?_t(t,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ze(f)?(t.exit("setextHeadingLine"),e(f)):n(f)}}const gW={tokenize:xW};function xW(t){const e=this,n=t.attempt(oh,i,t.attempt(this.parser.constructs.flowInitial,r,_t(t,t.attempt(this.parser.constructs.flow,r,t.attempt(SK,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const vW={resolveAll:BR()},bW=UR("string"),yW=UR("text");function UR(t){return{resolveAll:BR(t==="text"?wW:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,l,u);return l;function l(p){return f(p)?s(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),s(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=r[p];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function BR(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function wW(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let s=r.length,l=-1,u=0,d;for(;s--;){const f=r[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}
vendor: 5,619 bytes, lines 720-722
720else if(f===-2)d=!0,u++;else if(f!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const f={type:n===t.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...f.start},i.start.offset===i.end.offset?Object.assign(i,f):(t.splice(n,0,["enter",f,e],["exit",f,e]),n+=2)}n++}return t}const SW={42:Li,43:Li,45:Li,48:Li,49:Li,50:Li,51:Li,52:Li,53:Li,54:Li,55:Li,56:Li,57:Li,62:LR},CW={91:NK},EW={[-2]:eb,[-1]:eb,32:eb},AW={35:DK,42:wp,45:[Fk,wp],60:IK,61:Fk,95:wp,96:Ik,126:Ik},kW={38:MR,92:OR},NW={[-5]:tb,[-4]:tb,[-3]:tb,33:tW,38:MR,42:xy,60:[iK,GK],91:iW,92:[RK,OR],93:Xw,95:xy,96:gK},jW={null:[xy,vW]},_W={null:[42,95]},TW={null:[]},RW=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_W,contentInitial:CW,disable:TW,document:SW,flow:AW,flowInitial:EW,insideSpan:jW,string:kW,text:NW},Symbol.toStringTag,{value:"Module"}));function PW(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let l=[],u=[];const d={attempt:L(R),check:L(T),consume:k,enter:N,exit:_,interrupt:L(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:t,previous:null,sliceSerialize:x,sliceStream:b,write:m};let p=e.tokenize.call(f,d);return e.resolveAll&&s.push(e),f;function m(G){return l=vr(l,G),A(),l[l.length-1]!==null?[]:(M(e,0),f.events=zm(s,f.events,f),f.events)}function x(G,Z){return LW(b(G),Z)}function b(G){return DW(l,G)}function w(){const{_bufferIndex:G,_index:Z,line:Q,column:K,offset:q}=i;return{_bufferIndex:G,_index:Z,line:Q,column:K,offset:q}}function C(G){r[G.line]=G.column,D()}function A(){let G;for(;i._index<l.length;){const Z=l[i._index];if(typeof Z=="string")for(G=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===G&&i._bufferIndex<Z.length;)E(Z.charCodeAt(i._bufferIndex));else E(Z)}}function E(G){p=p(G)}function k(G){Ze(G)?(i.line++,i.column=1,i.offset+=G===-3?2:1,D()):G!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),f.previous=G}function N(G,Z){const Q=Z||{};return Q.type=G,Q.start=w(),f.events.push(["enter",Q,f]),u.push(Q),Q}function _(G){const Z=u.pop();return Z.end=w(),f.events.push(["exit",Z,f]),Z}function R(G,Z){M(G,Z.from)}function T(G,Z){Z.restore()}function L(G,Z){return Q;function Q(K,q,F){let V,O,X,$;return Array.isArray(K)?H(K):"tokenize"in K?H([K]):B(K);function B(ue){return W;function W(fe){const se=fe!==null&&ue[fe],pe=fe!==null&&ue.null,Ee=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return H(Ee)(fe)}}function H(ue){return V=ue,O=0,ue.length===0?F:P(ue[O])}function P(ue){return W;function W(fe){return $=U(),X=ue,ue.partial||(f.currentConstruct=ue),ue.name&&f.parser.constructs.disable.null.includes(ue.name)?he():ue.tokenize.call(Z?Object.assign(Object.create(f),Z):f,d,J,he)(fe)}}function J(ue){return G(X,$),q}function he(ue){return $.restore(),++O<V.length?P(V[O]):F}}}function M(G,Z){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&Ji(f.events,Z,f.events.length-Z,G.resolve(f.events.slice(Z),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function U(){const G=w(),Z=f.previous,Q=f.currentConstruct,K=f.events.length,q=Array.from(u);return{from:K,restore:F};function F(){i=G,f.previous=Z,f.currentConstruct=Q,f.events.length=K,u=q,D()}}function D(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function DW(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let l;if(n===r)l=[t[n].slice(i,s)];else{if(l=t.slice(n,r),i>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(i):l.shift()}s>0&&l.push(t[r].slice(0,s))}return l}function LW(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const s=t[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
721`;break}case-3:{l=`\r
722`;break}case-2:{l=e?" ":"	";break}case-1:{if(!e&&r)continue;l=" ";break}default:l=String.fromCharCode(s)}r=s===-2,i.push(l)}return i.join("")}function OW(t){const i={constructs:PR([RW,...(t||{}).extensions||[]]),content:r(Xq),defined:[],document:r(Zq),flow:r(gW),lazy:{},string:r(bW),text:r(yW)};return i;function r(s){return l;function l(u){return PW(i,s,u)}}}function MW(t){for(;!IR(t););return t}const $k=/[\0\t\n\r]/g;function IW(){let t=1,e="",n=!0,i;return r;function r(s,l,u){const d=[];let f,p,m,x,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if($k.lastIndex=m,f=$k.exec(s),x=f&&f.index!==void 0?f.index:s.length,b=s.charCodeAt(x),!f){e=s.slice(m);break}if(b===10&&m===x&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),m<x&&(d.push(s.slice(m,x)),t+=x-m),b){case 0:{d.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,d.push(-2);t++<p;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:i=!0,t=1}m=x+1}return u&&(i&&d.push(-5),e&&d.push(e),d.push(null)),d}}const zW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FW(t){return t.replace(zW,$W)}function $W(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return DR(n.slice(s?2:1),s?16:10)}return Yw(n)||t}const HR={}.hasOwnProperty;function UW(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),BW(n)(MW(OW(n).document().write(IW()(t,e,!0))))}function BW(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter
vendor: 7,050 bytes, line 722
722:{autolink:s(Ae),autolinkProtocol:U,autolinkEmail:U,atxHeading:s(pt),blockQuote:s(pe),characterEscape:U,characterReference:U,codeFenced:s(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ee,l),codeText:s(Ce,l),codeTextData:U,data:U,codeFlowValue:U,definition:s(Ne),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(qe),hardBreakEscape:s($e),hardBreakTrailing:s($e),htmlFlow:s(je,l),htmlFlowData:U,htmlText:s(je,l),htmlTextData:U,image:s(xt),label:l,link:s(Ae),listItem:s(xe),listItemValue:x,listOrdered:s(at,m),listUnordered:s(at),paragraph:s(me),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(pt),strong:s(rt),thematicBreak:s(Me)},exit:{atxHeading:d(),atxHeadingSequence:R,autolink:d(),autolinkEmail:se,autolinkProtocol:fe,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ue,characterReference:W,codeFenced:d(A),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:D,codeIndented:d(E),codeText:d(q),codeTextData:D,data:D,definition:d(),definitionDestinationString:_,definitionLabelString:k,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(Z),hardBreakTrailing:d(Z),htmlFlow:d(Q),htmlFlowData:D,htmlText:d(K),htmlTextData:D,image:d(V),label:X,labelText:O,lineEnding:G,link:d(F),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:J,resourceDestinationString:$,resourceTitleString:B,resource:H,setextHeading:d(M),setextHeadingLineSequence:L,setextHeadingText:T,strong:d(),thematicBreak:d()}};GR(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(le){let ye={type:"root",children:[]};const Ie={stack:[ye],tokenStack:[],config:e,enter:u,exit:f,buffer:l,resume:p,data:n},et=[];let nt=-1;for(;++nt<le.length;)if(le[nt][1].type==="listOrdered"||le[nt][1].type==="listUnordered")if(le[nt][0]==="enter")et.push(nt);else{const en=et.pop();nt=r(le,en,nt)}for(nt=-1;++nt<le.length;){const en=e[le[nt][0]];HR.call(en,le[nt][1].type)&&en[le[nt][1].type].call(Object.assign({sliceSerialize:le[nt][2].sliceSerialize},Ie),le[nt][1])}if(Ie.tokenStack.length>0){const en=Ie.tokenStack[Ie.tokenStack.length-1];(en[1]||Uk).call(Ie,void 0,en[0])}for(ye.position={start:Wa(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Wa(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<e.transforms.length;)ye=e.transforms[nt](ye)||ye;return ye}function r(le,ye,Ie){let et=ye-1,nt=-1,en=!1,tn,cn,zt,mn;for(;++et<=Ie;){const yt=le[et];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?nt++:nt--,mn=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(tn&&!mn&&!nt&&!zt&&(zt=et),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!nt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||nt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(tn){let Ai=et;for(cn=void 0;Ai--;){const Fn=le[Ai];if(Fn[1].type==="lineEnding"||Fn[1].type==="lineEndingBlank"){if(Fn[0]==="exit")continue;cn&&(le[cn][1].type="lineEndingBlank",en=!0),Fn[1].type="lineEnding",cn=Ai}else if(!(Fn[1].type==="linePrefix"||Fn[1].type==="blockQuotePrefix"||Fn[1].type==="blockQuotePrefixWhitespace"||Fn[1].type==="blockQuoteMarker"||Fn[1].type==="listItemIndent"))break}zt&&(!cn||zt<cn)&&(tn._spread=!0),tn.end=Object.assign({},cn?le[cn][1].start:yt[1].end),le.splice(cn||et,0,["exit",tn,yt[2]]),et++,Ie++}if(yt[1].type==="listItemPrefix"){const Ai={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};tn=Ai,le.splice(et,0,["enter",Ai,yt[2]]),et++,Ie++,zt=void 0,mn=!0}}}return le[ye][1]._spread=en,Ie}function s(le,ye){return Ie;function Ie(et){u.call(this,le(et),et),ye&&ye.call(this,et)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(le,ye,Ie){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Ie||void 0]),le.position={start:Wa(ye.start),end:void 0}}function d(le){return ye;function ye(Ie){le&&le.call(this,Ie),f.call(this,Ie)}}function f(le,ye){const Ie=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==le.type&&(ye?ye.call(this,le,et[0]):(et[1]||Uk).call(this,le,et[0]));else throw new Error("Cannot close `"+le.type+"` ("+kd({start:le.start,end:le.end})+"): it’s not open");Ie.position.end=Wa(le.end)}function p(){return Ww(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function b(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function w(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function k(le){const ye=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=ye,Ie.identifier=Kr(this.sliceSerialize(le)).toLowerCase()}function N(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function _(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function R(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ie=this.sliceSerialize(le).length;ye.depth=Ie}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function L(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function U(le){const Ie=this.stack[this.stack.length-1].children;let et=Ie[Ie.length-1];(!et||et.type!=="text")&&(et=ve(),et.position={start:Wa(le.start),end:void 0},Ie.push(et)),this.stack.push(et)}function D(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=Wa(le.end)}function G(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=ye.children[ye.children.length-1];Ie.position.end=Wa(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ye.type)&&(U.call(this,le),D.call(this,le))}function Z(){this.data.atHardBreak=!0}function Q(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function K(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function q(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function F(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.t
vendor: 6,988 bytes, lines 722-724
722itle}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function V(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function O(le){const ye=this.sliceSerialize(le),Ie=this.stack[this.stack.length-2];Ie.label=FW(ye),Ie.identifier=Kr(ye).toLowerCase()}function X(){const le=this.stack[this.stack.length-1],ye=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const et=le.children;Ie.children=et}else Ie.alt=ye}function $(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function B(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function H(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function J(le){const ye=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=ye,Ie.identifier=Kr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function he(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Ie=this.data.characterReferenceType;let et;Ie?(et=DR(ye,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=Yw(ye);const nt=this.stack[this.stack.length-1];nt.value+=et}function W(le){const ye=this.stack.pop();ye.position.end=Wa(le.end)}function fe(le){D.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function se(le){D.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function pe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function je(){return{type:"html",value:""}}function xt(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function at(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function xe(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function me(){return{type:"paragraph",children:[]}}function rt(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Me(){return{type:"thematicBreak"}}}function Wa(t){return{line:t.line,column:t.column,offset:t.offset}}function GR(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?GR(t,i):HW(t,i)}}function HW(t,e){let n;for(n in e)if(HR.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function Uk(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+kd({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+kd({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+kd({start:e.start,end:e.end})+") is still open")}function GW(t){const e=this;e.parser=n;function n(i){return UW(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function VW(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function qW(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
723`}]}function KW(t,e){const n=e.value?e.value+`
724`:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function WW(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function YW(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function XW(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=iu(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let l,u=t.footnoteCounts.get(i);u===void 0?(u=0,t.footnoteOrder.push(i),l=t.footnoteOrder.length):l=s+1,u+=1,t.footnoteCounts.set(i,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};t.patch(e,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(e,f),t.applyData(e,f)}function QW(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ZW(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function VR(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function JW(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return VR(t,e);const r={src:iu(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function eY(t,e){const n={src:iu(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function tY(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function nY(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return VR(t,e);const r={href:iu(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function iY(t,e){const n={href:iu(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function rY(t,e,n){const i=t.all(e),r=n?sY(n):qR(e),s={},l=[];
vendor: 4,109 bytes, lines 724-726
724if(typeof e.checked=="boolean"){const p=i[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let u=-1;for(;++u<i.length;){const p=i[u];(r||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
725`}),p.type==="element"&&p.tagName==="p"&&!r?l.push(...p.children):l.push(p)}const d=i[i.length-1];d&&(r||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
726`});const f={type:"element",tagName:"li",properties:s,children:l};return t.patch(e,f),t.applyData(e,f)}function sY(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=qR(n[i])}return e}function qR(t){const e=t.spread;return e??t.children.length>1}function aY(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function oY(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function lY(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function cY(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function uY(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],l),r.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=Gw(e.children[1]),d=AR(e.children[e.children.length-1]);u&&d&&(l.position={start:u,end:d}),r.push(l)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function dY(t,e,n){const i=n?n.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:e.children.length;let d=-1;const f=[];for(;++d<u;){const m=e.children[d],x={},b=l?l[d]:void 0;b&&(x.align=b);let w={type:"element",tagName:s,properties:x,children:[]};m&&(w.children=t.all(m),t.patch(m,w),w=t.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:t.wrap(f,!0)};return t.patch(e,p),t.applyData(e,p)}function hY(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Bk=9,Hk=32;function fY(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const s=[];for(;i;)s.push(Gk(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return s.push(Gk(e.slice(r),r>0,!1)),s.join("")}function Gk(t,e,n){let i=0,r=t.length;if(e){let s=t.codePointAt(i);for(;s===Bk||s===Hk;)i++,s=t.codePointAt(i)}if(n){let s=t.codePointAt(r-1);for(;s===Bk||s===Hk;)r--,s=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function pY(t,e){const n={type:"text",value:fY(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function mY(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const gY={blockquote:VW,break:qW,code:KW,delete:WW,emphasis:YW,footnoteReference:XW,heading:QW,html:ZW,imageReference:JW,image:eY,inlineCode:tY,linkReference:nY,link:iY,listItem:rY,list:aY,paragraph:oY,root:lY,strong:cY,table:uY,tableCell:hY,tableRow:dY,text:pY,thematicBreak:mY,toml:Zf,yaml:Zf,definition:Zf,footnoteDefinition:Zf};function Zf(){}const KR=-1,Fm=0,jd=1,em=2,Qw=3,Zw=4,Jw=5,e0=6,WR=7,YR=8,xY=typeof self=="object"?self:globalThis,Vk=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to de
726serialize "+t)}return new xY[t](e)},vY=(t,e)=>{const n=(r,s)=>(t.set(s,r),r),i=r=>{if(t.has(r))return t.get(r);const[s,l]=e[r];switch(s){case Fm:case KR:return n(l,r);case jd:{const u=n([],r);for(const d of l)u.push(i(d));return u}case em:{const u=n({},r);for(const[d,f]of l)u[i(d)]=i(f);return u}case Qw:return n(new Date(l),r);case Zw:{const{source:u,flags:d}=l;return n(new RegExp(u,d),r)}case Jw:{const u=n(new Map,r);for(const[d,f]of l)u.set(i(d),i(f));return u}case e0:{const u=n(new Set,r);for(const d of l)u.add(i(d));return u}case WR:{const{name:u,message:d}=l;return n(Vk(u,d),r)}case YR:return n(BigInt(l),r);case"BigInt":return n(Object(BigInt(l)),r);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(Vk(s,l),r)};return i},qk=t=>vY(new Map,t)(0),xc="",{toString:bY}={},{keys:yY}=Object,hd=t=>{const e=typeof t;if(e!=="object"||!t)return[Fm,e];const n=bY.call(t).slice(8,-1);switch(n){case"Array":return[jd,xc];case"Object":return[em,xc];case"Date":return[Qw,xc];case"RegExp":return[Zw,xc];case"Map":return[Jw,xc];case"Set":return[e0,xc];case"DataView":return[jd,n]}return n.includes("Array")?[jd,n]:n.includes("Error")?[WR,n]:[em,n]},Jf=([t,e])=>t===Fm&&(e==="function"||e==="symbol"),wY=(t,e,n,i)=>{const r=(l,u)=>{const d=i.push(l)-1;return n.set(u,d),d},s=l=>{if(n.has(l))return n.get(l);let[u,d]=hd(l);switch(u){case Fm:{let p=l;switch(d){case"bigint":u=YR,p=l.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return r([KR],l)}return r([u,p],l)}case jd:{if(d){let x=l;return d==="DataView"?x=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(l)),r([d,[...x]],l)}const p=[],m=r([u,p],l);for(const x of l)p.push(s(x));return m}case em:{if(d)switch(d){case"BigInt":return r([d,l.toString()],l);case"Boolean":case"Number":case"String":return r([d,l.valueOf()],l)}if(e&&"toJSON"in l)return s(l.toJSON());const p=[],m=r([u,p],l);for(const x of yY(l))(t||!Jf(hd(l[x])))&&p.push([s(x),s(l[x])]);return m}case Qw:return r([u,l.toISOString()],l);case Zw:{const{source:p,flags:m}=l;return r([u,{source:p,flags:m}],l)}case Jw:{const p=[],m=r([u,p],l);for(const[x,b]of l)(t||!(Jf(hd(x))||Jf(hd(b))))&&p.push([s(x),s(b)]);return m}case e0:{const p=[],m=r([u,p],l);for(const x of l)(t||!Jf(hd(x)))&&p.push(s(x));return m}}const{message:f}=l;return r([u,{name:d,message:f}],l)};return s},Kk=(t,{json:e,lossy:n}={})=>{const i=[];return wY(!(e||n),!!e,new Map,i)(t),i},tm=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?qk(Kk(t,e)):structuredClone(t):(t,e)=>qk(Kk(t,e));function SY(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function CY(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function EY(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||SY,i=t.options.footnoteBackLabel||CY,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",l=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<t.footnoteOrder.length;){const f=t.footnoteById.get(t.footnoteOrder[d]);if(!f)continue;const p=t.all(f),m=String(f.identifier).toUpperCase(),x=iu(m.toLowerCase());let b=0;const w=[],C=t.footnoteCounts.get(m);for(;C!==void 0&&++b<=C;){w.length>0&&w.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,b);typeof k=="string"&&(k={type:"text",value:k}),w.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,b),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const A=p[p.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const k=A.children[A.children.length-1];k&&k.type==="text"?k.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...w)}else p.push(...w);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+x},children:t.wrap(p,!0)};t.patch(f,E),u.push(E)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...tm(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
727`},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
728`}]}}const $m=(function(t){if(t==null)return jY;if(typeof t=="function")return Um(t);if(typeof t=="object")return Array.isArray(t)?AY(t):kY(t);if(typeof t=="string")return NY(t);throw new Error("Expected function, string, or object as test")});function AY(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=$m(t[n]);return Um(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function kY(t){const e=t;return Um(n);function n(i){const r=i;let s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function NY(t){return Um(e);function e(n){return n&&n.type===t}}function Um(t){return e;function e(n,i,r){return!!(_Y(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function jY(){return!0}function _Y(t){return t!==null&&typeof t=="object"&&"type"in t}const XR=[],TY=!0,vy=!1,RY="skip";function QR(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const s=$m(r),l=i?-1:1;u(t,void 0,[])();function u(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=XR,w,C,A;if((!e||s(d,f,p[p.length-1]||void 0))&&(b=PY(n(d,p)),b[0]===vy))return b;if("children"in d&&d.children){const E=d;if(E.children&&b[0]!==RY)for(C=(i?E.children.length:-1)+l,A=p.concat(E);C>-1&&C<E.children.length;){const k=E.children[C];if(w=u(k,C,A)(),w[0]===vy)return w;C=typeof w[1]=="number"?w[1]:C+l}}return b}}}function PY(t){return Array.isArray(t)?t:typeof t=="number"?[TY,t]:t==null?XR:[t]}function t0(t,e,n,i){let r,s,l;typeof e=="function"&&typeof n!="function"?(s=void 0,l=e,r=n):(s=e,l=n,r=i),QR(t,s,u,r);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}
vendor: 11,547 bytes, lines 728-732
728const by={}.hasOwnProperty,DY={};function LY(t,e){const n=e||DY,i=new Map,r=new Map,s=new Map,l={...gY,...n.handlers},u={all:f,applyData:MY,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:OY,wrap:zY};return t0(t,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?i:r,x=String(p.identifier).toUpperCase();m.has(x)||m.set(x,p)}}),u;function d(p,m){const x=p.type,b=u.handlers[x];if(by.call(u.handlers,x)&&b)return b(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(x)){if("children"in p){const{children:C,...A}=p,E=tm(A);return E.children=u.all(p),E}return tm(p)}return(u.options.unknownHandler||IY)(u,p,m)}function f(p){const m=[];if("children"in p){const x=p.children;let b=-1;for(;++b<x.length;){const w=u.one(x[b],p);if(w){if(b&&x[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Wk(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=Wk(C.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function OY(t,e){t.position&&(e.position=Sq(t))}function MY(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,tm(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function IY(t,e){const n=e.data||{},i="value"in e&&!(by.call(n,"hProperties")||by.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function zY(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
729`});++i<t.length;)i&&n.push({type:"text",value:`
730`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
731`}),n}function Wk(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Yk(t,e){const n=LY(t,e),i=n.one(t,void 0),r=EY(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
732`},r),s}function FY(t,e){return t&&"run"in t?async function(n,i){const r=Yk(n,{file:i,...e});await t.run(r,i)}:function(n,i){return Yk(n,{file:i,...t||e})}}function Xk(t){if(t)throw t}var nb,Qk;function $Y(){if(Qk)return nb;Qk=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(f){return typeof Array.isArray=="function"?Array.isArray(f):e.call(f)==="[object Array]"},s=function(f){if(!f||e.call(f)!=="[object Object]")return!1;var p=t.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&t.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var x;for(x in f);return typeof x>"u"||t.call(f,x)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(t.call(f,p)){if(i)return i(f,p).value}else return;return f[p]};return nb=function d(){var f,p,m,x,b,w,C=arguments[0],A=1,E=arguments.length,k=!1;for(typeof C=="boolean"&&(k=C,C=arguments[1]||{},A=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});A<E;++A)if(f=arguments[A],f!=null)for(p in f)m=u(C,p),x=u(f,p),C!==x&&(k&&x&&(s(x)||(b=r(x)))?(b?(b=!1,w=m&&r(m)?m:[]):w=m&&s(m)?m:{},l(C,{name:p,newValue:d(k,w,x)})):typeof x<"u"&&l(C,{name:p,newValue:x}));return C},nb}var UY=$Y();const ib=ml(UY);function yy(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function BY(){const t=[],e={run:n,use:i};return e;function n(...r){let s=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...r);function u(d,...f){const p=t[++s];let m=-1;if(d){l(d);return}for(;++m<r.length;)(f[m]===null||f[m]===void 0)&&(f[m]=r[m]);r=f,p?HY(p,u)(...f):l(null,...f)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function HY(t,e){let n;return i;function i(...l){const u=t.length>l.length;let d;u&&l.push(r);try{d=t.apply(this,l)}catch(f){const p=f;if(u&&n)throw p;return r(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(s,r):d instanceof Error?r(d):s(d))}function r(l,...u){n||(n=!0,e(l,...u))}function s(l){r(null,l)}}const us={basename:GY,dirname:VY,extname:qY,join:KY,sep:"/"};function GY(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');lh(t);let n=0,i=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let l=-1,u=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else l<0&&(s=!0,l=r+1),u>-1&&(t.codePointAt(r)===e.codePointAt(u--)?u<0&&(i=r):(u=-1,i=l));return n===i?i=l:i<0&&(i=t.length),t.slice(n,i)}function VY(t){if(lh(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function qY(t){lh(t);let e=t.length,n=-1,i=0,r=-1,s=0,l;for(;e--;){const u=t.codePointAt(e);if(u===47){if(l){i=e+1;break}continue}n<0&&(l=!0,n=e+1),u===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function KY(...t){let e=-1,n;for(;++e<t.length;)lh(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":WY(n)}function WY(t){lh(t);const e=t.codePointAt(0)===47;let n=YY(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function YY(t,e){let n="",i=0,r=-1,s=0,l=-1,u,d;for(;++l<=t.length;){if(l<t.length)u=t.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(r===l-1||s===1))if(r!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=l,s=0;continue}}else if(n.length>0){n="",i=0,r=l,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,l):n=t.slice(r+1,l),i=l-r-1;r=l,s=0}else u===46&&s>-1?s++:s=-1}return n}function lh(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const XY={cwd:QY};function QY(){return"/"}function wy(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function ZY(t){if(typeof t=="string")t=new URL(t);else if(!wy(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return JY(t)}function JY(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const rb=["history","path","basename","stem","extname","dirname"];class ZR{constructor(e){let n;e?wy(e)?n={path:e}:typeof e=="string"||eX(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":XY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<rb.length;){const s=rb[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)rb.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?us.basename(this.path):void 0}set basename(e){ab(e,"basename"),sb(e,"basename"),this.path=us.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?us.dirname(this.path):void 0}set dirname(e){Zk(this.basename,"dirname"),this.path=us.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?us.extname(this.path):void 0}set extname(e){if(sb(e,"extname"),Zk(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=us.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){wy(e)&&(e=ZY(e)),ab(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?us.basename(this.path,this.extname):void 0}set stem(e){ab(e,"stem"),sb(e,"stem"),this.path=us.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new gi(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function sb(t,e){if(t&&t.includes(us.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+us.sep+"`")}function ab(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Zk(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function eX(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const tX=(function(t){const i=this.constructor.prototype,r=i[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),nX={}.hasOwnProperty;class n0 extends tX{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=BY()}copy(){const e=new n0;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(ib(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(cb("data",this.frozen),this.namespace[e]=n,this):nX.call(this.namespace,e)&&this.namespace[e]||void 0:e?(cb("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=ep(e),i=this.parser||this.Parser;return ob("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),ob("process",this.parser||this.Parser),lb("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,l){const u=ep(e),d=i.parse(u);i.run(d,u,function(p,m,x){if(p||!m||!x)return f(p);const b=m,w=i.stringify(b,x);sX(w)?x.value=w:x.result=w,f(p,x)});function f(p,m){p||!m?l(p):s?s(m):n(void 0,m)}}}processSync(e){let n=!1,i;return this.freeze(),ob("processSync",this.parser||this.Parser),lb("processSync",this.compiler||this.Compiler),this.process(e,r),e2("processSync","process",n),i;
vendor: 6,369 bytes, line 732
732function r(s,l){n=!0,Xk(s),i=l}}run(e,n,i){Jk(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,u){const d=ep(n);r.run(e,d,f);function f(p,m,x){const b=m||e;p?u(p):l?l(b):i(void 0,b,x)}}}runSync(e,n){let i=!1,r;return this.run(e,n,s),e2("runSync","run",i),r;function s(l,u){Xk(l),r=u,i=!0}}stringify(e,n){this.freeze();const i=ep(n),r=this.compiler||this.Compiler;return lb("stringify",r),Jk(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(cb("use",this.frozen),e!=null)if(typeof e=="function")d(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(r.settings=ib(!0,r.settings,f.settings))}function u(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,x=-1;for(;++m<i.length;)if(i[m][0]===f){x=m;break}if(x===-1)i.push([f,...p]);else if(p.length>0){let[b,...w]=p;const C=i[x][1];yy(C)&&yy(b)&&(b=ib(!0,C,b)),i[x]=[f,b,...w]}}}}const iX=new n0().freeze();function ob(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function lb(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function cb(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Jk(t){if(!yy(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function e2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ep(t){return rX(t)?t:new ZR(t)}function rX(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function sX(t){return typeof t=="string"||aX(t)}function aX(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const oX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",t2=[],n2={allowDangerousHtml:!0},lX=/^(https?|ircs?|mailto|xmpp)$/i,cX=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function JR(t){const e=uX(t),n=dX(t);return hX(e.runSync(e.parse(n),n),t)}function uX(t){const e=t.rehypePlugins||t2,n=t.remarkPlugins||t2,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...n2}:n2;return iX().use(GW).use(n).use(FY,i).use(e)}function dX(t){const e=t.children||"",n=new ZR;return typeof e=="string"&&(n.value=e),n}function hX(t,e){const n=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,l=e.skipHtml,u=e.unwrapDisallowed,d=e.urlTransform||fX;for(const p of cX)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+oX+p.id,void 0);return t0(t,f),Nq(t,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function f(p,m,x){if(p.type==="raw"&&x&&typeof m=="number")return l?x.children.splice(m,1):x.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let b;for(b in Jv)if(Object.hasOwn(Jv,b)&&Object.hasOwn(p.properties,b)){const w=p.properties[b],C=Jv[b];(C===null||C.includes(p.tagName))&&(p.properties[b]=d(String(w||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!b&&i&&typeof m=="number"&&(b=!i(p,m,x)),b&&x&&typeof m=="number")return u&&p.children?x.children.splice(m,1,...p.children):x.children.splice(m,1),m}}}function fX(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||i!==-1&&e>i||lX.test(t.slice(0,e))?t:""}function i2(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}function pX(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mX(t,e,n){const r=$m((n||{}).ignore||[]),s=gX(e);let l=-1;for(;++l<s.length;)QR(t,"text",u);function u(f,p){let m=-1,x;for(;++m<p.length;){const b=p[m],w=x?x.children:void 0;if(r(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return d(f,p)}function d(f,p){const m=p[p.length-1],x=s[l][0],b=s[l][1];let w=0;const A=m.children.indexOf(f);let E=!1,k=[];x.lastIndex=0;let N=x.exec(f.value);for(;N;){const _=N.index,R={index:N.index,input:N.input,stack:[...p,f]};let T=b(...N,R);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?x.lastIndex=_+1:(w!==_&&k.push({type:"text",value:f.value.slice(w,_)}),Array.isArray(T)?k.push(...T):T&&k.push(T),w=_+N[0].length,E=!0),!x.global)break;N=x.exec(f.value)}return E?(w<f.value.length&&k.push({type:"text",value:f.value.slice(w)}),m.children.splice(A,1,...k)):k=[f],A+k.length}}function gX(t){const e=[];
vendor: 4,277 bytes, lines 732-733
732if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([xX(r[0]),vX(r[1])])}return e}function xX(t){return typeof t=="string"?new RegExp(pX(t),"g"):t}function vX(t){return typeof t=="function"?t:function(){return t}}const ub="phrasing",db=["autolink","link","image","label"];function bX(){return{transforms:[kX],enter:{literalAutolink:wX,literalAutolinkEmail:hb,literalAutolinkHttp:hb,literalAutolinkWww:hb},exit:{literalAutolink:AX,literalAutolinkEmail:EX,literalAutolinkHttp:SX,literalAutolinkWww:CX}}}function yX(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ub,notInConstruct:db},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ub,notInConstruct:db},{character:":",before:"[ps]",after:"\\/",inConstruct:ub,notInConstruct:db}]}}function wX(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function hb(t){this.config.enter.autolinkProtocol.call(this,t)}function SX(t){this.config.exit.autolinkProtocol.call(this,t)}function CX(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function EX(t){this.config.exit.autolinkEmail.call(this,t)}function AX(t){this.exit(t)}function kX(t){mX(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,NX],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),jX]],{ignore:["link","linkReference"]})}function NX(t,e,n,i,r){let s="";if(!eP(r)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!_X(n)))return!1;const l=TX(n+i);if(!l[0])return!1;const u={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function jX(t,e,n,i){return!eP(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function _X(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function TX(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=i2(t,"(");let s=i2(t,")");for(;i!==-1&&r>s;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[t,n]}function eP(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||ll(n)||Im(n))&&(!e||n!==47)}tP.peek=FX;function RX(){this.buffer()}function PX(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function DX(){this.buffer()}function LX(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function OX(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Kr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function MX(t){this.exit(t)}function IX(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Kr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function zX(t){this.exit(t)}function FX(){return"["}function tP(t,e,n,i){const r=n.createTracker(i);let s=r.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return s+=r.move(n.safe(n.associationId(t),{after:"]",before:s})),u(),l(),s+=r.move("]"),s}function $X(){return{enter:{gfmFootnoteCallString:RX,gfmFootnoteCall:PX,gfmFootnoteDefinitionLabelString:DX,gfmFootnoteDefinition:LX},exit:{gfmFootnoteCallString:OX,gfmFootnoteCall:MX,gfmFootnoteDefinitionLabelString:IX,gfmFootnoteDefinition:zX}}}function UX(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:tP},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,l){const u=s.createTracker(l);let d=u.move("[^");const f=s.enter("footnoteDefinition"),p=s.enter("label");return d+=u.move(s.safe(s.associationId(i),{before:d,after:"]"})),p(),d+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),d+=u.move((e?`
733`:" ")+s.indentLines(s.containerFlow(i,u.current()),e?nP:BX))),f(),d}}function BX(t,e,n){return e===0?t:nP(t,e,n)}function nP(t,e,n){return(n?"":"    ")+t}const HX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iP.peek=WX;
vendor: 13,296 bytes, lines 733-745
733function GX(){return{canContainEols:["delete"],enter:{strikethrough:qX},exit:{strikethrough:KX}}}function VX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HX}],handlers:{delete:iP}}}function qX(t){this.enter({type:"delete",children:[]},t)}function KX(t){this.exit(t)}function iP(t,e,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let l=r.move("~~");return l+=n.containerPhrasing(t,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),s(),l}function WX(){return"~"}function YX(t){return t.length}function XX(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||YX,s=[],l=[],u=[],d=[];let f=0,p=-1;for(;++p<t.length;){const C=[],A=[];let E=-1;for(t[p].length>f&&(f=t[p].length);++E<t[p].length;){const k=QX(t[p][E]);if(n.alignDelimiters!==!1){const N=r(k);A[E]=N,(d[E]===void 0||N>d[E])&&(d[E]=N)}C.push(k)}l[p]=C,u[p]=A}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<f;)s[m]=r2(i[m]);else{const C=r2(i);for(;++m<f;)s[m]=C}m=-1;const x=[],b=[];for(;++m<f;){const C=s[m];let A="",E="";C===99?(A=":",E=":"):C===108?A=":":C===114&&(E=":");let k=n.alignDelimiters===!1?1:Math.max(1,d[m]-A.length-E.length);const N=A+"-".repeat(k)+E;n.alignDelimiters!==!1&&(k=A.length+k+E.length,k>d[m]&&(d[m]=k),b[m]=k),x[m]=N}l.splice(1,0,x),u.splice(1,0,b),p=-1;const w=[];for(;++p<l.length;){const C=l[p],A=u[p];m=-1;const E=[];for(;++m<f;){const k=C[m]||"";let N="",_="";if(n.alignDelimiters!==!1){const R=d[m]-(A[m]||0),T=s[m];T===114?N=" ".repeat(R):T===99?R%2?(N=" ".repeat(R/2+.5),_=" ".repeat(R/2-.5)):(N=" ".repeat(R/2),_=N):_=" ".repeat(R)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(N),E.push(k),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&E.push("|")}w.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return w.join(`
734`)}function QX(t){return t==null?"":String(t)}function r2(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function ZX(t,e,n,i){const r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(t,s.current()),JX);return r(),l}function JX(t,e,n){return">"+(n?"":" ")+t}function eQ(t,e){return s2(t,e.inConstruct,!0)&&!s2(t,e.notInConstruct,!1)}function s2(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function a2(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
735`&&eQ(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
736`}function tQ(t,e){const n=String(t);let i=n.indexOf(e),r=i,s=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>l&&(l=s):s=1,r=i+e.length,i=n.indexOf(e,r);return l}function nQ(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function iQ(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function rQ(t,e,n,i){const r=iQ(n),s=t.value||"",l=r==="`"?"GraveAccent":"Tilde";if(nQ(t,n)){const m=n.enter("codeIndented"),x=n.indentLines(s,sQ);return m(),x}const u=n.createTracker(i),d=r.repeat(Math.max(tQ(s,r)+1,3)),f=n.enter("codeFenced");let p=u.move(d);if(t.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(t.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(t.meta,{before:p,after:`
737`,encode:["`"],...u.current()})),m()}return p+=u.move(`
738`),s&&(p+=u.move(s+`
739`)),p+=u.move(d),f(),p}function sQ(t,e,n){return(n?"":"    ")+t}function i0(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function aQ(t,e,n,i){const r=i0(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(i);let f=d.move("[");return f+=d.move(n.safe(n.associationId(t),{before:f,after:"]",...d.current()})),f+=d.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(t.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(u=n.enter("destinationRaw"),f+=d.move(n.safe(t.url,{before:f,after:t.title?" ":`
740`,...d.current()}))),u(),t.title&&(u=n.enter(`title${s}`),f+=d.move(" "+r),f+=d.move(n.safe(t.title,{before:f,after:r,...d.current()})),f+=d.move(r),u()),l(),f}function oQ(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Bd(t){return"&#x"+t.toString(16).toUpperCase()+";"}function nm(t,e,n){const i=zc(t),r=zc(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rP.peek=lQ;function rP(t,e,n,i){const r=oQ(n),s=n.enter("emphasis"),l=n.createTracker(i),u=l.move(r);let d=l.move(n.containerPhrasing(t,{after:r,before:u,...l.current()}));const f=d.charCodeAt(0),p=nm(i.before.charCodeAt(i.before.length-1),f,r);p.inside&&(d=Bd(f)+d.slice(1));const m=d.charCodeAt(d.length-1),x=nm(i.after.charCodeAt(0),m,r);x.inside&&(d=d.slice(0,-1)+Bd(m));const b=l.move(r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},u+d+b}function lQ(t,e,n){return n.options.emphasis||"*"}function cQ(t,e){let n=!1;return t0(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,vy}),!!((!t.depth||t.depth<3)&&Ww(t)&&(e.options.setext||n))}function uQ(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(cQ(t,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),x=n.containerPhrasing(t,{...s.current(),before:`
741`,after:`
742`});return m(),p(),x+`
743`+(r===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
744`))+1))}const l="#".repeat(r),u=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let f=n.containerPhrasing(t,{before:"# ",after:`
745`,...s.current()});return/^[\t ]/.test(f)&&(f=Bd(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),u(),f}sP.peek=dQ;function sP(t){return t.value||""}function dQ(){return"<"}aP.peek=hQ;function aP(t,e,n,i){const r=i0(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(i);let f=d.move("![");return f+=d.move(n.safe(t.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(t.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(u=n.enter("destinationRaw"),f+=d.move(n.safe(t.url,{before:f,after:t.title?" ":")",...d.current()}))),u(),t.title&&(u=n.enter(`title${s}`),f+=d.move(" "+r),f+=d.move(n.safe(t.title,{before:f,after:r,...d.current()})),f+=d.move(r),u()),f+=d.move(")"),l(),f}function hQ(){return"!"}oP.peek=fQ;function oP(t,e,n,i){const r=t.referenceType,s=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(i);let d=u.move("![");const f=n.safe(t.alt,{before:d,after:"]",...u.current()});d+=u.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(t),{before:d,after:"]",...u.current()});return l(),n.stack=p,s(),r==="full"||!f||f!==m?d+=u.move(m+"]"):r==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function fQ(){return"!"}lP.peek=pQ;function lP(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(i);){let f=d.index;i.charCodeAt(f)===10&&i.charCodeAt(f-1)===13&&f--,i=i.slice(0,f)+" "+i.slice(d.index+1)}}return r+i+r}function pQ(){return"`"}function cP(t,e){const n=Ww(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}uP.peek=mQ;function uP(t,e,n,i){const r=i0(n),s=r==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let u,d;if(cP(t,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(t,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(t,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(t.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(t.url,{before:f,after:t.title?" ":")",...l.current()}))),d(),t.title&&(d=n.enter(`title${s}`),f+=l.move(" "+r),f+=l.move(n.safe(t.title,{before:f,after:r,...l.current()})),f+=l.move(r),d()),f+=l.move(")"),u(),f}function mQ(t,e,n){return cP(t,n)?"<":"["}dP.peek=gQ;function dP(t,e,n,i){const r=t.referenceType,s=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(i);let d=u.move("[");const f=n.containerPhrasing(t,{before:d,after:"]",...u.current()});d+=u.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(t),{before:d,after:"]",...u.current()});return l(),n.stack=p,s(),r==="full"||!f||f!==m?d+=u.move(m+"]"):r==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function gQ(){return"["}function r0(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function xQ(t){const e=r0(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vQ(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function hP(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function bQ(t,e,n,i){const r=n.enter("list"),s=n.bulletCurrent;let l=t.ordered?vQ(n):r0(n);const u=t.ordered?l==="."?")":".":xQ(n);let d=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),hP(n)===l&&p){let m=-1;for(;++m<t.children.length;){const x=t.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const f=n.containerFlow(t,i);return n.bulletLastUsed=l,n.bulletCurrent=s,r(),f}function yQ(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function wQ(t,e,n,i){const r=yQ(n);let s=n.bulletCurrent||r0(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let l=s.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(i);u.move(s+" ".repeat(l-s.length)),u.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(t,u.current()),p);return d(),f;function p(m,x,b){return x?(b?"":" ".repeat(l))+m:(b?s:s+" ".repeat(l-s.length))+m}}function SQ(t,e,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(t,i);return s(),r(),l}const CQ=$m(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EQ(t,e,n,i){return(t.children.some(function(l){return CQ(l)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function AQ(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}fP.peek=kQ;function fP(t,e,n,i){const r=AQ(n),s=n.enter("strong"),l=n.createTracker(i),u=l.move(r+r);let d=l.move(n.containerPhrasing(t,{after:r,before:u,...l.current()}));
vendor: 4,179 bytes, lines 745-747
745const f=d.charCodeAt(0),p=nm(i.before.charCodeAt(i.before.length-1),f,r);p.inside&&(d=Bd(f)+d.slice(1));const m=d.charCodeAt(d.length-1),x=nm(i.after.charCodeAt(0),m,r);x.inside&&(d=d.slice(0,-1)+Bd(m));const b=l.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},u+d+b}function kQ(t,e,n){return n.options.strong||"*"}function NQ(t,e,n,i){return n.safe(t.value,i)}function jQ(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function _Q(t,e,n){const i=(hP(n)+(n.options.ruleSpaces?" ":"")).repeat(jQ(n));return n.options.ruleSpaces?i.slice(0,-1):i}const pP={blockquote:ZX,break:a2,code:rQ,definition:aQ,emphasis:rP,hardBreak:a2,heading:uQ,html:sP,image:aP,imageReference:oP,inlineCode:lP,link:uP,linkReference:dP,list:bQ,listItem:wQ,paragraph:SQ,root:EQ,strong:fP,text:NQ,thematicBreak:_Q};function TQ(){return{enter:{table:RQ,tableData:o2,tableHeader:o2,tableRow:DQ},exit:{codeText:LQ,table:PQ,tableData:fb,tableHeader:fb,tableRow:fb}}}function RQ(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function PQ(t){this.exit(t),this.data.inTable=void 0}function DQ(t){this.enter({type:"tableRow",children:[]},t)}function fb(t){this.exit(t)}function o2(t){this.enter({type:"tableCell",children:[]},t)}function LQ(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,OQ));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function OQ(t,e){return e==="|"?e:t}function MQ(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
746`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:d,tableRow:u}};function l(b,w,C,A){return f(p(b,C,A),b.align)}function u(b,w,C,A){const E=m(b,C,A),k=f([E]);return k.slice(0,k.indexOf(`
747`))}function d(b,w,C,A){const E=C.enter("tableCell"),k=C.enter("phrasing"),N=C.containerPhrasing(b,{...A,before:s,after:s});return k(),E(),N}function f(b,w){return XX(b,{align:w,alignDelimiters:i,padding:n,stringLength:r})}function p(b,w,C){const A=b.children;let E=-1;const k=[],N=w.enter("table");for(;++E<A.length;)k[E]=m(A[E],w,C);return N(),k}function m(b,w,C){const A=b.children;let E=-1;const k=[],N=w.enter("tableRow");for(;++E<A.length;)k[E]=d(A[E],b,w,C);return N(),k}function x(b,w,C){let A=pP.inlineCode(b,w,C);return C.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function IQ(){return{exit:{taskListCheckValueChecked:l2,taskListCheckValueUnchecked:l2,paragraph:FQ}}}function zQ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$Q}}}function l2(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function FQ(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let s=-1,l;for(;++s<r.length;){const u=r[s];if(u.type==="paragraph"){l=u;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function $Q(t,e,n,i){const r=t.children[0],s=typeof t.checked=="boolean"&&r&&r.type==="paragraph",l="["+(t.checked?"x":" ")+"] ",u=n.createTracker(i);s&&u.move(l);let d=pP.listItem(t,e,n,{...i,...u.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function UQ(){return[bX(),$X(),GX(),TQ(),IQ()]}function BQ(t){return{extensions:[yX(),UX(t),VX(),MQ(t),zQ()]}}const HQ={tokenize:YQ,partial:!0},mP={tokenize:XQ,partial:!0},gP={tokenize:QQ,partial:!0},xP={tokenize:ZQ,partial:!0},GQ={tokenize:JQ,partial:!0}
vendor: 9,135 bytes, line 747
747,vP={name:"wwwAutolink",tokenize:KQ,previous:yP},bP={name:"protocolAutolink",tokenize:WQ,previous:wP},va={name:"emailAutolink",tokenize:qQ,previous:SP},Ts={};function VQ(){return{text:Ts}}let Vo=48;for(;Vo<123;)Ts[Vo]=va,Vo++,Vo===58?Vo=65:Vo===91&&(Vo=97);Ts[43]=va;Ts[45]=va;Ts[46]=va;Ts[95]=va;Ts[72]=[va,bP];Ts[104]=[va,bP];Ts[87]=[va,vP];Ts[119]=[va,vP];function qQ(t,e,n){const i=this;let r,s;return l;function l(m){return!Sy(m)||!SP.call(i,i.previous)||s0(i.events)?n(m):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(m))}function u(m){return Sy(m)?(t.consume(m),u):m===64?(t.consume(m),d):n(m)}function d(m){return m===46?t.check(GQ,p,f)(m):m===45||m===95||fi(m)?(s=!0,t.consume(m),d):p(m)}function f(m){return t.consume(m),r=!0,d}function p(m){return s&&r&&Si(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(m)):n(m)}}function KQ(t,e,n){const i=this;return r;function r(l){return l!==87&&l!==119||!yP.call(i,i.previous)||s0(i.events)?n(l):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(HQ,t.attempt(mP,t.attempt(gP,s),n),n)(l))}function s(l){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(l)}}function WQ(t,e,n){const i=this;let r="",s=!1;return l;function l(m){return(m===72||m===104)&&wP.call(i,i.previous)&&!s0(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(m),t.consume(m),u):n(m)}function u(m){if(Si(m)&&r.length<5)return r+=String.fromCodePoint(m),t.consume(m),u;if(m===58){const x=r.toLowerCase();if(x==="http"||x==="https")return t.consume(m),d}return n(m)}function d(m){return m===47?(t.consume(m),s?f:(s=!0,d)):n(m)}function f(m){return m===null||Jp(m)||Wt(m)||ll(m)||Im(m)?n(m):t.attempt(mP,t.attempt(gP,p),n)(m)}function p(m){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(m)}}function YQ(t,e,n){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,t.consume(l),r):l===46&&i===3?(t.consume(l),s):n(l)}function s(l){return l===null?n(l):e(l)}}function XQ(t,e,n){let i,r,s;return l;function l(f){return f===46||f===95?t.check(xP,d,u)(f):f===null||Wt(f)||ll(f)||f!==45&&Im(f)?d(f):(s=!0,t.consume(f),l)}function u(f){return f===95?i=!0:(r=i,i=void 0),t.consume(f),l}function d(f){return r||i||!s?n(f):e(f)}}function QQ(t,e){let n=0,i=0;return r;function r(l){return l===40?(n++,t.consume(l),r):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?t.check(xP,e,s)(l):l===null||Wt(l)||ll(l)?e(l):(t.consume(l),r)}function s(l){return l===41&&i++,t.consume(l),r}}function ZQ(t,e,n){return i;function i(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),i):u===38?(t.consume(u),s):u===93?(t.consume(u),r):u===60||u===null||Wt(u)||ll(u)?e(u):n(u)}function r(u){return u===null||u===40||u===91||Wt(u)||ll(u)?e(u):i(u)}function s(u){return Si(u)?l(u):n(u)}function l(u){return u===59?(t.consume(u),i):Si(u)?(t.consume(u),l):n(u)}}function JQ(t,e,n){return i;function i(s){return t.consume(s),r}function r(s){return fi(s)?n(s):e(s)}}function yP(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Wt(t)}function wP(t){return!Si(t)}function SP(t){return!(t===47||Sy(t))}function Sy(t){return t===43||t===45||t===46||t===95||fi(t)}function s0(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const eZ={tokenize:lZ,partial:!0};function tZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sZ,continuation:{tokenize:aZ},exit:oZ}},text:{91:{name:"gfmFootnoteCall",tokenize:rZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nZ,resolveTo:iZ}}}}function nZ(t,e,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const d=i.events[r][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const f=Kr(i.sliceSerialize({start:l.end,end:i.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),e(d))}}function iZ(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",s,e],["enter",l,e],["exit",l,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...u),t}function rZ(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return u;function u(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",f)}function f(m){if(s>999||m===93&&!l||m===null||m===91||Wt(m))return n(m);if(m===93){t.exit("chunkString");const x=t.exit("gfmFootnoteCallString");return r.includes(Kr(i.sliceSerialize(x)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return Wt(m)||(l=!0),s++,t.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(t.consume(m),s++,f):f(m)}}function sZ(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,u;return d;function d(w){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(w)}function p(w){if(l>999||w===93&&!u||w===null||w===91||Wt(w))return n(w);if(w===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return s=Kr(i.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(w),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),x}return Wt(w)||(u=!0),l++,t.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(t.consume(w),l++,p):p(w)}function x(w){return w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),r.includes(s)||r.push(s),_t(t,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return e(w)}}function aZ(t,e,n){return t.check(oh,e,t.attempt(eZ,e,n))}function oZ(t){t.exit("gfmFootnoteDefinition")}function lZ(t,e,n){const i=this;return _t(t,r,"gfmFootnoteDefinitionIndent",5);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(s):n(s)}}function cZ(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},x=[["enter",p,u],["enter",l[f][1],u],["exit",l[f][1],u],["enter",m,u]],b=u.parser.constructs.insideSpan.null;b&&Ji(x,x.length,0,zm(b,l.slice(f+1,d),u)),Ji(x,x.length,0,[["exit",m,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",p,u]]),Ji(l,f-1,d-f+3,x),d=f+x.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,u,d){const f=this.previous,p=this.events;let m=0;return x;function x(w){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(w):(l.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const C=zc(f);if(w===126)return m>1?d(w):(l.consume(w),m++,b);
vendor: 8,805 bytes, line 747
747if(m<2&&!n)return d(w);const A=l.exit("strikethroughSequenceTemporary"),E=zc(w);return A._open=!E||E===2&&!!C,A._close=!C||C===2&&!!E,u(w)}}}class uZ{constructor(){this.map=[]}add(e,n,i){dZ(this,e,n,i)}consume(e){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const s of r)e.push(s);r=i.pop()}this.map.length=0}}function dZ(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function hZ(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function fZ(){return{flow:{null:{name:"table",tokenize:pZ,resolveAll:mZ}}}}function pZ(t,e,n){const i=this;let r=0,s=0,l;return u;function u(D){let G=i.events.length-1;for(;G>-1;){const K=i.events[G][1].type;if(K==="lineEnding"||K==="linePrefix")G--;else break}const Z=G>-1?i.events[G][1].type:null,Q=Z==="tableHead"||Z==="tableRow"?T:d;return Q===T&&i.parser.lazy[i.now().line]?n(D):Q(D)}function d(D){return t.enter("tableHead"),t.enter("tableRow"),f(D)}function f(D){return D===124||(l=!0,s+=1),p(D)}function p(D){return D===null?n(D):Ze(D)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),b):n(D):Ct(D)?_t(t,p,"whitespace")(D):(s+=1,l&&(l=!1,r+=1),D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),l=!0,p):(t.enter("data"),m(D)))}function m(D){return D===null||D===124||Wt(D)?(t.exit("data"),p(D)):(t.consume(D),D===92?x:m)}function x(D){return D===92||D===124?(t.consume(D),m):m(D)}function b(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(t.enter("tableDelimiterRow"),l=!1,Ct(D)?_t(t,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?A(D):D===124?(l=!0,t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),C):R(D)}function C(D){return Ct(D)?_t(t,A,"whitespace")(D):A(D)}function A(D){return D===58?(s+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),E):D===45?(s+=1,E(D)):D===null||Ze(D)?_(D):R(D)}function E(D){return D===45?(t.enter("tableDelimiterFiller"),k(D)):R(D)}function k(D){return D===45?(t.consume(D),k):D===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(D))}function N(D){return Ct(D)?_t(t,_,"whitespace")(D):_(D)}function _(D){return D===124?w(D):D===null||Ze(D)?!l||r!==s?R(D):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(D)):R(D)}function R(D){return n(D)}function T(D){return t.enter("tableRow"),L(D)}function L(D){return D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),L):D===null||Ze(D)?(t.exit("tableRow"),e(D)):Ct(D)?_t(t,L,"whitespace")(D):(t.enter("data"),M(D))}function M(D){return D===null||D===124||Wt(D)?(t.exit("data"),L(D)):(t.consume(D),D===92?U:M)}function U(D){return D===92||D===124?(t.consume(D),M):M(D)}}function mZ(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,f,p,m;const x=new uZ;for(;++n<t.length;){const b=t[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(u=!1,d!==0&&(c2(x,e,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",f,e]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,m=void 0,s=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",p,e]])),r=w.type==="tableDelimiterRow"?2:p?3:1):r&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],m=tp(x,e,s,r,void 0,m),s=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],m=tp(x,e,s,r,void 0,m)),s=l,l=[s[1],n,0,0])):w.type==="tableHead"?(u=!0,d=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],m=tp(x,e,s,r,n,m)):l[1]!==0&&(m=tp(x,e,l,r,n,m)),r=0):r&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&c2(x,e,d,f,p),x.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=hZ(e.events,n))}return t}function tp(t,e,n,i,r,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},yc(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const d=yc(e.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const f=yc(e.events,n[2]),p=yc(e.events,n[3]),m={type:u,start:Object.assign({},f),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",m,e]]),i!==2){const x=e.events[n[2]],b=e.events[n[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;t.add(w,C,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return r!==void 0&&(s.end=Object.assign({},yc(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function c2(t,e,n,i,r){const s=[],l=yc(e.events,n);r&&(r.end=Object.assign({},l),s.push(["exit",r,e])),i.end=Object.assign({},l),s.push(["exit",i,e]),t.add(n+1,0,s)}function yc(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const gZ={name:"tasklistCheck",tokenize:vZ};function xZ(){return{text:{91:gZ}}}function vZ(t,e,n){const i=this;return r;function r(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),s)}function s(d){return Wt(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(d)}function u(d){return Ze(d)?e(d):Ct(d)?t.check({tokenize:bZ},e,n)(d):n(d)}}function bZ(t,e,n){return _t(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function yZ(t){return PR([VQ(),tZ(),cZ(t),fZ(),xZ()])}const wZ={};function CP(t){const e=this,n=t||wZ,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(yZ(n)),s.push(UQ()),l.push(BQ(n))}function SZ({...t}){return o.jsx(Gj,{"data-slot":"sheet",...t})}function CZ({...t}){return o.jsx(Vj,{"data-slot":"sheet-portal",...t})}function EZ({className:t,...e}){return o.jsx(qj,{"data-slot":"sheet-overlay",className:Fe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[100] bg-black/50",t),...e})}function AZ({className:t,children:e,side:n="right",showCloseButton:i=!0,...r}){return o.jsxs(CZ,{children:[o.jsx(EZ,{}),o.jsxs(Kj,{"data-slot":"sheet-content",className:Fe("bg-background fixed z-[100] flex flex-col shadow-lg transition ease-in-out","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:duration-300 data-[state=open]:duration-300",n==="right"&&"inset-y-0 right-0 h-full w-full max-w-full border-l transition-transform duration-300 ease-out data-[state=closed]:translate-x-full data-[state=open]:translate-x-0 sm:max-w-2xl md:max-w-4xl lg:max-w-[min(1240px,96vw)]",n==="left"&&"inset-y-0 left-0 h-full w-full max-w-full border-r transition-transform duration-300 ease-out data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0 sm:max-w-xl md:max-w-2xl",t),...r,children:[e,i&&o.jsxs(Xj,{"data-slot":"sheet-close-button",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent text-muted-foreground hover:text-foreground absolute top-4 right-4 z-10 rounded-md opacity-80 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:size-5",children:[o.jsx(yr,{}),o.jsx("span",{className:"sr-only",children:"Chiudi"})]})]})]})}function kZ({className:t,...e}){return o.jsx(Wj,{"data-slot":"sheet-title",className:Fe("text-foreground text-lg font-semibold",t),...e})}function NZ({className:t,...e}
747){return o.jsx(Yj,{"data-slot":"sheet-description",className:Fe("text-muted-foreground text-sm",t),...e})}const jZ="modulepreload",_Z=function(t){return"/"+t},u2={},np=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let f=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};var l=f;document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");r=f(n.map(p=>{if(p=_Z(p),p in u2)return;u2[p]=!0;const m=p.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":jZ,m||(b.as="script"),b.crossOrigin="",b.href=p,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((w,C)=>{b.addEventListener("load",w),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return r.then(u=>{for(const d of u||[])d.status==="rejected"&&s(d.reason);return e().catch(s)})};var _d={};_d.d=(t,e)=>{for(var n in e)_d.o(e,n)&&!_d.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})};_d.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var st=globalThis.pdfjsLib={};_d.d(st,{AbortException:()=>yl,AnnotationEditorLayer:()=>la,AnnotationEditorParamsType:()=>dt,AnnotationEditorType:()=>jt,AnnotationEditorUIManager:()=>ho,AnnotationLayer:()=>Nee,AnnotationMode:()=>io,CMapCompressionType:()=>Ey,ColorPicker:()=>ds,DOMSVGFactory:()=>l0,DrawLayer:()=>ci,FeatureTest:()=>Mi,GlobalWorkerOptions:()=>Hd,ImageKind:()=>Sp,InvalidPDFException:()=>AP,MissingPDFException:()=>bl,OPS:()=>Ir,Outliner:()=>Py,PDFDataRangeTransport:()=>BP,PDFDateString:()=>RP,PDFWorker:()=>xr,PasswordResponses:()=>DZ,PermissionFlag:()=>PZ,PixelsPerInch:()=>Fc,RenderingCancelledException:()=>c0,TextLayer:()=>sm,UnexpectedResponseException:()=>Vm,Util:()=>Ke,VerbosityLevel:()=>Bm,XfaLayer:()=>GP,build:()=>oee,createValidAbsoluteUrl:()=>IZ,fetchData:()=>Qm,getDocument:()=>ZJ,getFilenameFromUrl:()=>KZ,getPdfFilenameFromUrl:()=>WZ,getXfaPageViewport:()=>YZ,isDataScheme:()=>u0,isPdfFile:()=>d0,noContextMenu:()=>zi,normalizeUnicode:()=>HZ,renderTextLayer:()=>HJ,setLayerDimensions:()=>cl,shadow:()=>Rt,updateTextLayer:()=>GJ,version:()=>aee});const pi=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),EP=[1,0,0,1,0,0],Cy=[.001,0,0,.001,0,0],TZ=1e7,pb=1.35,mr={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},io={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},RZ="pdfjs_internal_editor_",jt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},dt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},PZ={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},li={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Sp={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Bn={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},fd={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Bm={ERRORS:0,WARNINGS:1,INFOS:5},Ey={NONE:0,BINARY:1},Ir={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},DZ={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Hm=Bm.WARNINGS;
747function LZ(t){Number.isInteger(t)&&(Hm=t)}function OZ(){return Hm}function Gm(t){Hm>=Bm.INFOS&&console.log(`Info: ${t}`)}function bt(t){Hm>=Bm.WARNINGS&&console.log(`Warning: ${t}`)}function Bt(t){throw new Error(t)}function Gn(t,e){t||Bt(e)}function MZ(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function IZ(t,e=null,n=null){if(!t)return null;try{if(n&&typeof t=="string"&&(n.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),n.tryConvertEncoding))try{t=BZ(t)}catch{}const i=e?new URL(t,e):new URL(t);if(MZ(i))return i}catch{}return null}function Rt(t,e,n,i=!1){return Object.defineProperty(t,e,{value:n,enumerable:!i,configurable:!0,writable:!1}),n}const xo=(function(){function e(n,i){this.constructor===e&&Bt("Cannot initialize BaseException."),this.message=n,this.name=i}return e.prototype=new Error,e.constructor=e,e})();class Ay extends xo{constructor(e,n){super(e,"PasswordException"),this.code=n}}class ky extends xo{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class AP extends xo{constructor(e){super(e,"InvalidPDFException")}}class bl extends xo{constructor(e){super(e,"MissingPDFException")}}class Vm extends xo{constructor(e,n){super(e,"UnexpectedResponseException"),this.status=n}}class zZ extends xo{constructor(e){super(e,"FormatError")}}class yl extends xo{constructor(e){super(e,"AbortException")}}function kP(t){(typeof t!="object"||t?.length===void 0)&&Bt("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const i=[];for(let r=0;r<e;r+=n){const s=Math.min(r+n,e),l=t.subarray(r,s);i.push(String.fromCharCode.apply(null,l))}return i.join("")}function qm(t){typeof t!="string"&&Bt("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let i=0;i<e;++i)n[i]=t.charCodeAt(i)&255;return n}function FZ(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function a0(t){const e=Object.create(null);for(const[n,i]of t)e[n]=i;return e}function $Z(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function UZ(){try{return new Function(""),!0}catch{return!1}}class Mi{static get isLittleEndian(){return Rt(this,"isLittleEndian",$Z())}static get isEvalSupported(){return Rt(this,"isEvalSupported",UZ())}static get isOffscreenCanvasSupported(){return Rt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?Rt(this,"platform",{isMac:navigator.platform.includes("Mac")}):Rt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return Rt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const mb=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class Ke{static makeHexColor(e,n,i){return`#${mb[e]}${mb[n]}${mb[i]}`}static scaleMinMax(e,n){let i;e[0]?(e[0]<0&&(i=n[0],n[0]=n[2],n[2]=i),n[0]*=e[0],n[2]*=e[0],e[3]<0&&(i=n[1],n[1]=n[3],n[3]=i),n[1]*=e[3],n[3]*=e[3]):(i=n[0],n[0]=n[1],n[1]=i,i=n[2],n[2]=n[3],n[3]=i,e[1]<0&&(i=n[1],n[1]=n[3],n[3]=i),n[1]*=e[1],n[3]*=e[1],e[2]<0&&(i=n[0],n[0]=n[2],n[2]=i),n[0]*=e[2],n[2]*=e[2]),n[0]+=e[4],n[1]+=e[5],n[2]+=e[4],n[3]+=e[5]}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static applyTransform(e,n){const i=e[0]*n[0]+e[1]*n[2]+n[4],r=e[0]*n[1]+e[1]*n[3]+n[5];return[i,r]}static applyInverseTransform(e,n){const i=n[0]*n[3]-n[1]*n[2],r=(e[0]*n[3]-e[1]*n[2]+n[2]*n[5]-n[4]*n[3])/i,s=(-e[0]*n[1]+e[1]*n[0]+n[4]*n[1]-n[5]*n[0])/i;return[r,s]}static getAxialAlignedBoundingBox(e,n){const i=this.applyTransform(e,n),r=this.applyTransform(e.slice(2,4),n),s=this.applyTransform([e[0],e[3]],n),l=this.applyTransform([e[2],e[1]],n);return[Math.min(i[0],r[0],s[0],l[0]),Math.min(i[1],r[1],s[1],l[1]),Math.max(i[0],r[0],s[0],l[0]),Math.max(i[1],r[1],s[1],l[1])]}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static singularValueDecompose2dScale(e){const n=[e[0],e[2],e[1],e[3]],i=e[0]*n[0]+e[1]*n[2],r=e[0]*n[1]+e[1]*n[3],s=e[2]*n[0]+e[3]*n[2],l=e[2]*n[1]+e[3]*n[3],u=(i+l)/2,d=Math.sqrt((i+l)**2-4*(i*l-s*r))/2,f=u+d||1,p=u-d||1;return[Math.sqrt(f),Math.sqrt(p)]}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){const i=Math.max(Math.min(e[0],e[2]),Math.min(n[0],n[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(n[0],n[2]));if(i>r)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(n[1],n[3])),l=Math.min(Math.max(e[1],e[3]),Math.max(n[1],n[3]));return s>l?null:[i,s,r,l]}static#e(e,n,i,r,s,l,u,d,f,p){if(f<=0||f>=1)return;const m=1-f,x=f*f,b=x*f,w=m*(m*(m*e+3*f*n)+3*x*i)+b*r,C=m*(m*(m*s+3*f*l)+3*x*u)+b*d;
747p[0]=Math.min(p[0],w),p[1]=Math.min(p[1],C),p[2]=Math.max(p[2],w),p[3]=Math.max(p[3],C)}static#t(e,n,i,r,s,l,u,d,f,p,m,x){if(Math.abs(f)<1e-12){Math.abs(p)>=1e-12&&this.#e(e,n,i,r,s,l,u,d,-m/p,x);return}const b=p**2-4*m*f;if(b<0)return;const w=Math.sqrt(b),C=2*f;this.#e(e,n,i,r,s,l,u,d,(-p+w)/C,x),this.#e(e,n,i,r,s,l,u,d,(-p-w)/C,x)}static bezierBoundingBox(e,n,i,r,s,l,u,d,f){return f?(f[0]=Math.min(f[0],e,u),f[1]=Math.min(f[1],n,d),f[2]=Math.max(f[2],e,u),f[3]=Math.max(f[3],n,d)):f=[Math.min(e,u),Math.min(n,d),Math.max(e,u),Math.max(n,d)],this.#t(e,i,s,u,n,r,l,d,3*(-e+3*(i-s)+u),6*(e-2*i+s),3*(i-e),f),this.#t(e,i,s,u,n,r,l,d,3*(-n+3*(r-l)+d),6*(n-2*r+l),3*(r-n),f),f}}function BZ(t){return decodeURIComponent(escape(t))}let gb=null,d2=null;function HZ(t){return gb||(gb=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,d2=new Map([["ſt","ſt"]])),t.replaceAll(gb,(e,n,i)=>n?n.normalize("NFKC"):d2.get(i))}function GZ(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(Math.random()*255);return kP(t)}const NP="pdfjs_internal_id_",ra={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};class Km{constructor(){this.constructor===Km&&Bt("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,i,r,s){return"none"}destroy(e=!1){}}class Wm{constructor(){this.constructor===Wm&&Bt("Cannot initialize BaseCanvasFactory.")}create(e,n){if(e<=0||n<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(e,n);return{canvas:i,context:i.getContext("2d")}}reset(e,n,i){if(!e.canvas)throw new Error("Canvas is not specified");if(n<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=n,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){Bt("Abstract method `_createCanvas` called.")}}class Ym{constructor({baseUrl:e=null,isCompressed:n=!0}){this.constructor===Ym&&Bt("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=n}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":""),i=this.isCompressed?Ey.BINARY:Ey.NONE;return this._fetchData(n,i).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(e,n){Bt("Abstract method `_fetchData` called.")}}class Xm{constructor({baseUrl:e=null}){this.constructor===Xm&&Bt("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetchData(n).catch(i=>{throw new Error(`Unable to load font data at: ${n}`)})}_fetchData(e){Bt("Abstract method `_fetchData` called.")}}class o0{constructor(){this.constructor===o0&&Bt("Cannot initialize BaseSVGFactory.")}create(e,n,i=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),i||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${n}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${n}`),r}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Bt("Abstract method `_createSVG` called.")}}const oa="http://www.w3.org/2000/svg";class Fc{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class VZ extends Km{#e;#t;#n;#r;#a;#i=0;constructor({docId:e,ownerDocument:n=globalThis.document}={}){super(),this.#n=e,this.#r=n}get#s(){return this.#e||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#t){const e=this.#r.createElement("div"),{style:n}=e;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const i=this.#r.createElementNS(oa,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#t=this.#r.createElementNS(oa,"defs"),e.append(i),i.append(this.#t),this.#r.body.append(e)}return this.#t}#d(e){if(e.length===1){const d=e[0],f=new Array(256);for(let m=0;m<256;m++)f[m]=d[m]/255;const p=f.join(",");return[p,p,p]}const[n,i,r]=e,s=new Array(256),l=new Array(256),u=new Array(256);for(let d=0;d<256;d++)s[d]=n[d]/255,l[d]=i[d]/255,u[d]=r[d]/255;return[s.join(","),l.join(","),u.join(",")]}addFilter(e){if(!e)return"none";let n=this.#s.get(e);if(n)return n;const[i,r,s]=this.#d(e),l=e.length===1?i:`${i}${r}${s}`;if(n=this.#s.get(l),n)return this.#s.set(e,n),n;const u=`g_${this.#n}_transfer_map_${this.#i++}`,d=`url(#${u})`;this.#s.set(e,d),this.#s.set(l,d);const f=this.#o(u);return this.#m(i,r,s,f),d}addHCMFilter(e,n){const i=`${e}-${n}`,r="base";let s=this.#c.get(r);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#c.set(r,s)),!e||!n))return s.url;const l=this.#v(e);e=Ke.makeHexColor(...l);const u=this.#v(n);if(n=Ke.makeHexColor(...u),this.#l.style.color="",e==="#000000"&&n==="#ffffff"||e===n)return s.url;const d=new Array(256);for(let b=0;b<=255;b++){const w=b/255;d[b]=w<=.03928?w/12.92:((w+.055)/1.055)**2.4}const f=d.join(","),p=`g_${this.#n}_hcm_filter`,m=s.filter=this.#o(p);this.#m(f,f,f,m),this.#u(m);const x=(b,w)=>{const C=l[b]/255,A=u[b]/255,E=new Array(w+1);for(let k=0;k<=w;k++)E[k]=C+k/w*(A-C);return E.join(",")};return this.#m(x(0,5),x(1,5),x(2,5),m),s.url=`url(#${p})`,s.url}addAlphaFilter(e){let n=this.#s.get(e);if(n)return n;const[i]=this.#d([e]),r=`alpha_${i}`;if(n=this.#s.get(r),n)return this.#s.set(e,n),n;const s=`g_${this.#n}_alpha_map_${this.#i++}`,l=`url(#${s})`;this.#s.set(e,l),this.#s.set(r,l);const u=this.#o(s);return this.#h(i,u),l}addLuminosityFilter(e){let n=this.#s.get(e||"luminosity");if(n)return n;let i,r;if(e?([i]=this.#d([e]),r=`luminosity_${i}`):r="luminosity",n=this.#s.get(r),n)return this.#s.set(e,n),n;const s=`g_${this.#n}_luminosity_map_${this.#i++}`,l=`url(#${s})`;this.#s.set(e,l),this.#s.set(r,l);const u=this.#o(s);return this.#f(u),e&&this.#h(i,u),l}addHighlightHCMFilter(e,n,i,r,s){const l=`${n}-${i}-${r}-${s}`;let u=this.#c.get(e);if(u?.key===l||(u?(u.filter?.remove(),u.key=l,u.url="none",u.filter=null):(u
747={key:l,url:"none",filter:null},this.#c.set(e,u)),!n||!i))return u.url;const[d,f]=[n,i].map(this.#v.bind(this));let p=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),m=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[x,b]=[r,s].map(this.#v.bind(this));m<p&&([p,m,x,b]=[m,p,b,x]),this.#l.style.color="";const w=(E,k,N)=>{const _=new Array(256),R=(m-p)/N,T=E/255,L=(k-E)/(255*N);let M=0;for(let U=0;U<=N;U++){const D=Math.round(p+U*R),G=T+U*L;for(let Z=M;Z<=D;Z++)_[Z]=G;M=D+1}for(let U=M;U<256;U++)_[U]=_[M-1];return _.join(",")},C=`g_${this.#n}_hcm_${e}_filter`,A=u.filter=this.#o(C);return this.#u(A),this.#m(w(x[0],b[0],5),w(x[1],b[1],5),w(x[2],b[2],5),A),u.url=`url(#${C})`,u.url}destroy(e=!1){e&&this.#c.size!==0||(this.#t&&(this.#t.parentNode.parentNode.remove(),this.#t=null),this.#e&&(this.#e.clear(),this.#e=null),this.#i=0)}#f(e){const n=this.#r.createElementNS(oa,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(n)}#u(e){const n=this.#r.createElementNS(oa,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(n)}#o(e){const n=this.#r.createElementNS(oa,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",e),this.#l.append(n),n}#p(e,n,i){const r=this.#r.createElementNS(oa,n);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),e.append(r)}#m(e,n,i,r){const s=this.#r.createElementNS(oa,"feComponentTransfer");r.append(s),this.#p(s,"feFuncR",e),this.#p(s,"feFuncG",n),this.#p(s,"feFuncB",i)}#h(e,n){const i=this.#r.createElementNS(oa,"feComponentTransfer");n.append(i),this.#p(i,"feFuncA",e)}#v(e){return this.#l.style.color=e,h0(getComputedStyle(this.#l).getPropertyValue("color"))}}class qZ extends Wm{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,n){const i=this._document.createElement("canvas");return i.width=e,i.height=n,i}}async function Qm(t,e="text"){if(yd(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,i)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType=e,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){switch(e){case"arraybuffer":case"blob":case"json":n(r.response);return}n(r.responseText);return}i(new Error(r.statusText))}},r.send(null)})}class jP extends Ym{_fetchData(e,n){return Qm(e,this.isCompressed?"arraybuffer":"text").then(i=>({cMapData:i instanceof ArrayBuffer?new Uint8Array(i):qm(i),compressionType:n}))}}class _P extends Xm{_fetchData(e){return Qm(e,"arraybuffer").then(n=>new Uint8Array(n))}}class l0 extends o0{_createSVG(e){return document.createElementNS(oa,e)}}class ch{constructor({viewBox:e,scale:n,rotation:i,offsetX:r=0,offsetY:s=0,dontFlip:l=!1}){this.viewBox=e,this.scale=n,this.rotation=i,this.offsetX=r,this.offsetY=s;const u=(e[2]+e[0])/2,d=(e[3]+e[1])/2;let f,p,m,x;switch(i%=360,i<0&&(i+=360),i){case 180:f=-1,p=0,m=0,x=1;break;case 90:f=0,p=1,m=1,x=0;break;case 270:f=0,p=-1,m=-1,x=0;break;case 0:f=1,p=0,m=0,x=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}l&&(m=-m,x=-x);let b,w,C,A;f===0?(b=Math.abs(d-e[1])*n+r,w=Math.abs(u-e[0])*n+s,C=(e[3]-e[1])*n,A=(e[2]-e[0])*n):(b=Math.abs(u-e[0])*n+r,w=Math.abs(d-e[1])*n+s,C=(e[2]-e[0])*n,A=(e[3]-e[1])*n),this.transform=[f*n,p*n,m*n,x*n,b-f*n*u-m*n*d,w-p*n*u-x*n*d],this.width=C,this.height=A}get rawDims(){const{viewBox:e}=this;return Rt(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}={}){return new ch({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(e,n){return Ke.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=Ke.applyTransform([e[0],e[1]],this.transform),i=Ke.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],i[0],i[1]]}convertToPdfPoint(e,n){return Ke.applyInverseTransform([e,n],this.transform)}}class c0 extends xo{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function u0(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function d0(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function KZ(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function WZ(t,e="document.pdf"){if(typeof t!="string")return e;if(u0(t))return bt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=n.exec(t);let s=i.exec(r[1])||i.exec(r[2])||i.exec(r[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class h2{started=Object.create(null);times=[];time(e){e in this.started&&bt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||bt(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const{name:i}of this.times)n=Math.max(i.length,n);for(const{name:i,start:r,end:s}of this.times)e.push(`${i.padEnd(n)} ${s-r}ms
748`);return e.join("")}}function yd(t,e){try{const{protocol:n}=e?new URL(t,e):new URL(t);return n==="http:"||n==="https:"}catch{return!1}}function zi(t){t.preventDefault()}function TP(t){console.log("Deprecated API usage: "+t)}let f2;class RP{static toDateObject(e){if(!e||typeof e!="string")return null;f2||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const n=f2.exec(e);if(!n)return null;const i=parseInt(n[1],10);let r=parseInt(n[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(n[3],10);s=s>=1&&s<=31?s:1;let l=parseInt(n[4],10);l=l>=0&&l<=23?l:0;let u=parseInt(n[5],10);u=u>=0&&u<=59?u:0;let d=parseInt(n[6],10);d=d>=0&&d<=59?d:0;const f=n[7]||"Z";let p=parseInt(n[8],10);p=p>=0&&p<=23?p:0;let m=parseInt(n[9],10)||0;return m=m>=0&&m<=59?m:0,f==="-"?(l+=p,u+=m):f==="+"&&(l-=p,u-=m),new Date(Date.UTC(i,r,s,l,u,d))}}function YZ(t,{scale:e=1,rotation:n=0}){const{width:i,height:r}=t.attributes.style,s=[0,0,parseInt(i),parseInt(r)];return new ch({viewBox:s,scale:e,rotation:n})}function h0(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(bt(`Not a valid color format: "${t}"`),[0,0,0])}function XZ(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const n of t.keys()){e.style.color=n;const i=window.getComputedStyle(e).color;t.set(n,h0(i))}e.remove()}function un(t){const{a:e,b:n,c:i,d:r,e:s,f:l}=t.getTransform();return[e,n,i,r,s,l]}function sa(t){const{a:e,b:n,c:i,d:r,e:s,f:l}=t.getTransform().invertSelf();return[e,n,i,r,s,l]}function cl(t,e,n=!1,i=!0){if(e instanceof ch){const{pageWidth:r,pageHeight:s}=e.rawDims,{style:l}=t,u=Mi.isCSSRoundSupported,d=`var(--scale-factor) * ${r}px`,f=`var(--scale-factor) * ${s}px`,p=u?`round(${d}, 1px)`:`calc(${d}
748)`,m=u?`round(${f}, 1px)`:`calc(${f})`;!n||e.rotation%180===0?(l.width=p,l.height=m):(l.width=m,l.height=p)}i&&t.setAttribute("data-main-rotation",e.rotation)}class f0{#e=null;#t=null;#n;#r=null;constructor(e){this.#n=e}render(){const e=this.#e=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",zi),e.addEventListener("pointerdown",f0.#a);const n=this.#r=document.createElement("div");n.className="buttons",e.append(n);const i=this.#n.toolbarPosition;if(i){const{style:r}=e,s=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];r.insetInlineEnd=`${100*s}%`,r.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#l(),e}static#a(e){e.stopPropagation()}#i(e){this.#n._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#s(e){this.#n._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#c(e){e.addEventListener("focusin",this.#i.bind(this),{capture:!0}),e.addEventListener("focusout",this.#s.bind(this),{capture:!0}),e.addEventListener("contextmenu",zi)}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden")}#l(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#n.editorType}-button`),this.#c(e),e.addEventListener("click",n=>{this.#n._uiManager.delete()}),this.#r.append(e)}get#d(){const e=document.createElement("div");return e.className="divider",e}addAltTextButton(e){this.#c(e),this.#r.prepend(e,this.#d)}addColorPicker(e){this.#t=e;const n=e.renderButton();this.#c(n),this.#r.prepend(n,this.#d)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class QZ{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",zi);const n=this.#e=document.createElement("div");return n.className="buttons",e.append(n),this.#i(),e}#a(e,n){let i=0,r=0;for(const s of e){const l=s.y+s.height;if(l<i)continue;const u=s.x+(n?s.width:0);if(l>i){r=u,i=l;continue}n?u>r&&(r=u):u<r&&(r=u)}return[n?1-r:r,i]}show(e,n,i){const[r,s]=this.#a(n,i),{style:l}=this.#t||=this.#r();e.append(this.#t),l.insetInlineEnd=`${100*r}%`,l.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#i(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const n=document.createElement("span");e.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label"),e.addEventListener("contextmenu",zi),e.addEventListener("click",()=>{this.#n.highlightSelection("floating_button")}),this.#e.append(e)}}function im(t,e,n){for(const i of n)e.addEventListener(i,t[i].bind(t))}function ZZ(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class JZ{#e=0;get id(){return`${RZ}${this.#e++}`}}class p0{#e=GZ();#t=0;#n=null;static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d"),r=new Image;r.src=e;const s=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return Rt(this,"_isSVGFittingCanvas",s)}async#r(e,n){this.#n||=new Map;let i=this.#n.get(e);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let r;if(typeof n=="string"?(i.url=n,r=await Qm(n,"blob")):r=i.file=n,r.type==="image/svg+xml"){const s=p0._isSVGFittingCanvas,l=new FileReader,u=new Image,d=new Promise((f,p)=>{u.onload=()=>{i.bitmap=u,i.isSvg=!0,f()},l.onload=async()=>{const m=i.svgUrl=l.result;u.src=await s?`${m}#svgView(preserveAspectRatio(none))`:m},u.onerror=l.onerror=p});l.readAsDataURL(r),await d}else i.bitmap=await createImageBitmap(r);i.refCounter=1}catch(r){console.error(r),i=null}return this.#n.set(e,i),i&&this.#n.set(i.id,i),i}async getFromFile(e){const{lastModified:n,name:i,size:r,type:s}=e;return this.#r(`${n}_${i}_${r}_${s}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromId(e){this.#n||=new Map;const n=this.#n.get(e);return n?n.bitmap?(n.refCounter+=1,n):n.file?this.getFromFile(n.file):this.getFromUrl(n.url):null}getSvgUrl(e){const n=this.#n.get(e);return n?.isSvg?n.svgUrl:null}deleteId(e){this.#n||=new Map;const n=this.#n.get(e);n&&(n.refCounter-=1,n.refCounter===0&&(n.bitmap=null))}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class eJ{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:n,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:l=!1,keepUndo:u=!1}){if(r&&e(),this.#t)return;const d={cmd:e,undo:n,post:i,type:s};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(d);return}if(l&&this.#e[this.#r].type===s){u&&(d.undo=this.#e[this.#r].undo),this.#e[this.#r]=d;return}const f=this.#r+1;f===this.#n?this.#e.splice(0,1):(this.#r=f,f<this.#e.length&&this.#e.splice(f)),this.#e.push(d)}undo(){if(this.#r===-1)return;this.#t=!0;const{undo:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1,this.#r-=1}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;const{cmd:e,post:n}=this.#e[this.#r];e(),n?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}destroy(){this.#e=null}}class uh{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=Mi.platform;for(const[i,r,s={}]of e)for(const l of i){const u=l.startsWith("mac+");n&&u?(this.callbacks.set(l.slice(4),{callback:r,options:s}),this.allKeys.add(l.split("+").at(-1))):!n&&!u&&(this.callbacks.set(l,{callback:r,options:s}),this.allKeys.add(l.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const n=this.buffer.join("+");return this.buffer.length=0,n}
748exec(e,n){if(!this.allKeys.has(n.key))return;const i=this.callbacks.get(this.#e(n));if(!i)return;const{callback:r,options:{bubbles:s=!1,args:l=[],checker:u=null}}=i;u&&!u(e,n)||(r.bind(e,...l,n)(),s||(n.stopPropagation(),n.preventDefault()))}}class m0{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return XZ(e),Rt(this,"_colors",e)}convert(e){const n=h0(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[i,r]of this._colors)if(r.every((s,l)=>s===n[l]))return m0._colorsMapping.get(i);return n}getHexCode(e){const n=this._colors.get(e);return n?Ke.makeHexColor(...n):e}}class ho{#e=null;#t=new Map;#n=new Map;#r=null;#a=null;#i=null;#s=new eJ;#c=0;#l=new Set;#d=null;#f=null;#u=new Set;#o=!1;#p=null;#m=null;#h=null;#v=!1;#g=null;#b=new JZ;#w=!1;#E=!1;#A=null;#j=null;#k=null;#y=jt.NONE;#x=new Set;#S=null;#C=null;#T=null;#_=this.blur.bind(this);#D=this.focus.bind(this);#R=this.copy.bind(this);#L=this.cut.bind(this);#P=this.paste.bind(this);#O=this.keydown.bind(this);#U=this.keyup.bind(this);#G=this.onEditingAction.bind(this);#V=this.onPageChanging.bind(this);#B=this.onScaleChanging.bind(this);#F=this.#se.bind(this);#M=this.onRotationChanging.bind(this);#Y={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#H=[0,0];#I=null;#$=null;#X=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=ho.prototype,n=l=>l.#$.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&l.hasSomethingToControl(),i=(l,{target:u})=>
748{if(u instanceof HTMLInputElement){const{type:d}=u;return d!=="text"&&d!=="number"}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Rt(this,"_keyboardManager",new uh([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],e.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:i}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(l,{target:u})=>!(u instanceof HTMLButtonElement)&&l.#$.contains(u)&&!l.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(l,{target:u})=>!(u instanceof HTMLButtonElement)&&l.#$.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:n}]]))}constructor(e,n,i,r,s,l,u,d,f){this.#$=e,this.#X=n,this.#r=i,this._eventBus=r,this._eventBus._on("editingaction",this.#G),this._eventBus._on("pagechanging",this.#V),this._eventBus._on("scalechanging",this.#B),this._eventBus._on("rotationchanging",this.#M),this.#ae(),this.#Z(),this.#a=s.annotationStorage,this.#p=s.filterFactory,this.#C=l,this.#h=u||null,this.#o=d,this.#k=f||null,this.viewParameters={realScale:Fc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#J(),this.#Q(),this._eventBus._off("editingaction",this.#G),this._eventBus._off("pagechanging",this.#V),this._eventBus._off("scalechanging",this.#B),this._eventBus._off("rotationchanging",this.#M);for(const e of this.#n.values())e.destroy();this.#n.clear(),this.#t.clear(),this.#u.clear(),this.#e=null,this.#x.clear(),this.#s.destroy(),this.#r?.destroy(),this.#g?.hide(),this.#g=null,this.#m&&(clearTimeout(this.#m),this.#m=null),this.#I&&(clearTimeout(this.#I),this.#I=null),this.#oe()}async mlGuess(e){return this.#k?.guess(e)||null}get hasMLManager(){return!!this.#k}get hcmFilter(){return Rt(this,"hcmFilter",this.#C?this.#p.addHCMFilter(this.#C.foreground,this.#C.background):"none")}get direction(){return Rt(this,"direction",getComputedStyle(this.#$).direction)}get highlightColors(){return Rt(this,"highlightColors",this.#h?new Map(this.#h.split(",").map(e=>e.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return Rt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){this.#j=e}editAltText(e){this.#r?.editAltText(this,e)}onPageChanging({pageNumber:e}){this.#c=e-1}focusMainContainer(){this.#$.focus()}findParent(e,n){for(const i of this.#n.values()){const{x:r,y:s,width:l,height:u}=i.div.getBoundingClientRect();if(e>=r&&e<=r+l&&n>=s&&n<=s+u)return i}return null}disableUserSelect(e=!1){this.#X.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#u.add(e)}removeShouldRescale(e){this.#u.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Fc.PDF_TO_CSS_UNITS;for(const n of this.#u)n.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#K({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}highlightSelection(e=""){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:i,anchorOffset:r,focusNode:s,focusOffset:l}=n,u=n.toString(),f=this.#K(n).closest(".textLayer"),p=this.getSelectionBoxes(f);if(p){n.empty(),this.#y===jt.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:jt.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const m of this.#n.values())if(m.hasTextLayer(f)){m.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:p,anchorNode:i,anchorOffset:r,focusNode:s,focusOffset:l,text:u});break}}}#re(){const e=document.getSelection();if(!e||e.isCollapsed)return;const i=this.#K(e).closest(".textLayer"),r=this.getSelectionBoxes(i);r&&(this.#g||=new QZ(this),this.#g.show(i,r,this.direction==="ltr"))}addToAnnotationStorage(e){!e.isEmpty()&&this.#a&&!this.#a.has(e.id)&&this.#a.setValue(e.id,e)}#se(){const e=document.getSelection();if(!e||e.isCollapsed){this.#S&&(this.#g?.hide(),this.#S=null,this.#N({hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===this.#S)return;if(!this.#K(e).closest(".textLayer")){this.#S&&(this.#g?.hide(),this.#S=null,this.#N({hasSelectedText:!1}));return}if(this.#g?.hide(),this.#S=n,this.#N({hasSelectedText:!0}),!(this.#y!==jt.HIGHLIGHT&&this.#y!==jt.NONE)&&(this.#y===jt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#v=this.isShiftKeyDown,!this.isShiftKeyDown)){const s=l=>{l.type==="pointerup"&&l.button!==0||(window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),l.type==="pointerup"&&this.#W("main_toolbar"))};window.addEventListener("pointerup",s),window.addEventListener("blur",s)}}#W(e=""){this.#y===jt.HIGHLIGHT?this.highlightSelection(e):this.#o&&this.#re()}#ae(){document.addEventListener("selectionchange",this.#F)}#oe(){document.removeEventListener("selectionchange",this.#F)}#le(){window.addEventListener("focus",this.#D),window.addEventListener("blur",this.#_)}#Q(){window.removeEventListener("focus",this.#D),window.removeEventListener("blur",this.#_)}blur(){if(this.isShiftKeyDown=!1,this.#v&&(this.#v=!1,this.#W("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of this.#x)if(n.div.contains(e)){this.#A=[n,e],n._focusEventsAllowed=!1;break}}focus(){if(!this.#A)return;const[e,n]=this.#A;this.#A=null,n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),n.focus()}#Z(){window.addEventListener("keydown",this.#O),window.addEventListener("keyup",this.#U)}
748#J(){window.removeEventListener("keydown",this.#O),window.removeEventListener("keyup",this.#U)}#ee(){document.addEventListener("copy",this.#R),document.addEventListener("cut",this.#L),document.addEventListener("paste",this.#P)}#te(){document.removeEventListener("copy",this.#R),document.removeEventListener("cut",this.#L),document.removeEventListener("paste",this.#P)}addEditListeners(){this.#Z(),this.#ee()}removeEditListeners(){this.#J(),this.#te()}copy(e){if(e.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const n=[];for(const i of this.#x){const r=i.serialize(!0);r&&n.push(r)}n.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:n}=e;for(const s of n.items)for(const l of this.#f)if(l.isHandlingMimeForPasting(s.type)){l.paste(s,this.currentLayer);return}let i=n.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){bt(`paste: "${s.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const r=this.currentLayer;try{const s=[];for(const d of i){const f=r.deserialize(d);if(!f)return;s.push(f)}const l=()=>{for(const d of s)this.#ne(d);this.#ie(s)},u=()=>{for(const d of s)d.remove()};this.addCommands({cmd:l,undo:u,mustExec:!0})}catch(s){bt(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#y!==jt.NONE&&!this.isEditorHandlingKeyboard&&ho._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#v&&(this.#v=!1,this.#W("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#N(e){Object.entries(e).some(([i,r])=>this.#Y[i]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Y,e)}),this.#y===jt.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#z([[dt.HIGHLIGHT_FREE,!0]]))}#z(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#le(),this.#ee(),this.#N({isEditing:this.#y!==jt.NONE,isEmpty:this.#q(),hasSomethingToUndo:this.#s.hasSomethingToUndo(),hasSomethingToRedo:this.#s.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Q(),this.#te(),this.#N({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#f){this.#f=e;for(const n of this.#f)this.#z(n.defaultPropertiesToUpdate)}}getId(){return this.#b.id}get currentLayer(){return this.#n.get(this.#c)}getLayer(e){return this.#n.get(e)}get currentPageIndex(){return this.#c}addLayer(e){this.#n.set(e.pageIndex,e),this.#w?e.enable():e.disable()}removeLayer(e){this.#n.delete(e.pageIndex)}updateMode(e,n=null,i=!1){if(this.#y!==e){if(this.#y=e,e===jt.NONE){this.setEditingState(!1),this.#ue();return}this.setEditingState(!0),this.#ce(),this.unselectAll();for(const r of this.#n.values())r.updateMode(e);if(!n&&i){this.addNewEditorFromKeyboard();return}if(n){for(const r of this.#t.values())if(r.annotationElementId===n){this.setSelected(r),r.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#y&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,n){if(this.#f){switch(e){case dt.CREATE:this.currentLayer.addNewEditor();return;case dt.HIGHLIGHT_DEFAULT_COLOR:this.#j?.updateColor(n);break;case dt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#T||=new Map).set(e,n),this.showAllEditors("highlight",n);break}for(const i of this.#x)i.updateParams(e,n);for(const i of this.#f)i.updateDefaultParams(e,n)}}showAllEditors(e,n,i=!1){for(const s of this.#t.values())s.editorType===e&&s.show(n);(this.#T?.get(dt.HIGHLIGHT_SHOW_ALL)??!0)!==n&&this.#z([[dt.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(this.#E!==e){this.#E=e;for(const n of this.#n.values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}#ce(){if(!this.#w){this.#w=!0;for(const e of this.#n.values())e.enable();for(const e of this.#t.values())e.enable()}}#ue(){if(this.unselectAll(),this.#w){this.#w=!1;for(const e of this.#n.values())e.disable();for(const e of this.#t.values())e.disable()}}getEditors(e){const n=[];for(const i of this.#t.values())i.pageIndex===e&&n.push(i);return n}getEditor(e){return this.#t.get(e)}addEditor(e){this.#t.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#m&&clearTimeout(this.#m),this.#m=setTimeout(()=>{this.focusMainContainer(),this.#m=null},0)),this.#t.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#l.has(e.annotationElementId))&&this.#a?.remove(e.id)}addDeletedAnnotationElement(e){this.#l.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}
748isDeletedAnnotationElement(e){return this.#l.has(e)}removeDeletedAnnotationElement(e){this.#l.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#ne(e){const n=this.#n.get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#e!==e&&(this.#e=e,e&&this.#z(e.propertiesToUpdate))}get#de(){let e=null;for(e of this.#x);return e}updateUI(e){this.#de===e&&this.#z(e.propertiesToUpdate)}toggleSelected(e){if(this.#x.has(e)){this.#x.delete(e),e.unselect(),this.#N({hasSelectedEditor:this.hasSelection});return}this.#x.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#N({hasSelectedEditor:!0})}setSelected(e){for(const n of this.#x)n!==e&&n.unselect();this.#x.clear(),this.#x.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#N({hasSelectedEditor:!0})}isSelected(e){return this.#x.has(e)}get firstSelectedEditor(){return this.#x.values().next().value}unselect(e){e.unselect(),this.#x.delete(e),this.#N({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#x.size!==0}get isEnterHandled(){return this.#x.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#s.undo(),this.#N({hasSomethingToUndo:this.#s.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#q()})}redo(){this.#s.redo(),this.#N({hasSomethingToUndo:!0,hasSomethingToRedo:this.#s.hasSomethingToRedo(),isEmpty:this.#q()})}addCommands(e){this.#s.add(e),this.#N({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#q()})}#q(){if(this.#t.size===0)return!0;if(this.#t.size===1)for(const e of this.#t.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#x],n=()=>{for(const r of e)r.remove()},i=()=>{for(const r of e)this.#ne(r)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#ie(e){for(const n of this.#x)n.unselect();this.#x.clear();for(const n of e)n.isEmpty()||(this.#x.add(n),n.select());this.#N({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#x)e.commit();this.#ie(this.#t.values())}unselectAll(){if(!(this.#e&&(this.#e.commitOrRemove(),this.#y!==jt.NONE))&&this.hasSelection){for(const e of this.#x)e.unselect();this.#x.clear(),this.#N({hasSelectedEditor:!1})}}translateSelectedEditors(e,n,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#H[0]+=e,this.#H[1]+=n;const[r,s]=this.#H,l=[...this.#x],u=1e3;this.#I&&clearTimeout(this.#I),this.#I=setTimeout(()=>{this.#I=null,this.#H[0]=this.#H[1]=0,this.addCommands({cmd:()=>{for(const d of l)this.#t.has(d.id)&&d.translateInPage(r,s)},undo:()=>{for(const d of l)this.#t.has(d.id)&&d.translateInPage(-r,-s)},mustExec:!1})},u);for(const d of l)d.translateInPage(e,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#d=new Map;for(const e of this.#x)this.#d.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#d)return!1;this.disableUserSelect(!1);const e=this.#d;this.#d=null;let n=!1;for(const[{x:r,y:s,pageIndex:l},u]of e)u.newX=r,u.newY=s,u.newPageIndex=l,n||=r!==u.savedX||s!==u.savedY||l!==u.savedPageIndex;if(!n)return!1;const i=(r,s,l,u)=>{if(this.#t.has(r.id)){const d=this.#n.get(u);d?r._setParentAndPosition(d,s,l):(r.pageIndex=u,r.x=s,r.y=l)}};return this.addCommands({cmd:()=>{for(const[r,{newX:s,newY:l,newPageIndex:u}]of e)i(r,s,l,u)},undo:()=>{for(const[r,{savedX:s,savedY:l,savedPageIndex:u}]of e)i(r,s,l,u)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(this.#d)for(const i of this.#d.keys())i.drag(e,n)}rebuild(e){if(e.parent===null){const n=this.getLayer(e.pageIndex);n?(n.changeParent(e),n.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#x.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#e===e}getActive(){return this.#e}getMode(){return this.#y}get imageManager(){return Rt(this,"imageManager",new p0)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let f=0,p=n.rangeCount;f<p;f++)if(!e.contains(n.getRangeAt(f).commonAncestorContainer))return null;const{x:i,y:r,width:s,height:l}=e.getBoundingClientRect();let u;switch(e.getAttribute("data-main-rotation")){case"90":u=(f,p,m,x)=>({x:(p-r)/l,y:1-(f+m-i)/s,width:x/l,height:m/s});break;case"180":u=(f,p,m,x)=>({x:1-(f+m-i)/s,y:1-(p+x-r)/l,width:m/s,height:x/l});break;case"270":u=(f,p,m,x)=>({x:1-(p+x-r)/l,y:(f-i)/s,width:x/l,height:m/s});break;default:u=(f,p,m,x)=>({x:(f-i)/s,y:(p-r)/l,width:m/s,height:x/l});break}const d=[];for(let f=0,p=n.rangeCount;f<p;f++){const m=n.getRangeAt(f);if(!m.collapsed)for(const{x,y:b,width:w,height:C}of m.getClientRects())w===0||C===0||d.push(u(x,b,w,C))}return d.length===0?null:d}addChangedExistingAnnotation({annotationElementId:e,id:n}){(this.#i||=new Map).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){this.#i?.delete(e)}renderAnnotationElement(e){const n=this.#i?.get(e.data.id);if(!n)return;const i=this.#a.getRawValue(n);i&&(this.#y===jt.NONE&&!i.hasBeenModified||i.renderAnnotationElement(e))}}class Yo{#e="";#t=!1;#n=null;#r=null;#a=null;#i=!1;#s=null;static _l10nPromise=null;constructor(e){this.#s=e}static initialize(e){Yo._l10nPromise||=e}async render(){const e=this.#n=document.createElement("button");e.className="altText";const n=await Yo._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=n,e.setAttribute("aria-label",n),e.tabIndex="0",e.addEventListener("contextmenu",zi),e.addEventListener("pointerdown",r=>r.stopPropagation());const i=r=>{r.preventDefault(),this.#s._uiManager.editAltText(this.#s)};return e.addEventListener("click",i,{capture:!0}),e.addEventListener("keydown",r=>{r.target===e&&r.key==="Enter"&&(this.#i=!0,i(r))}),await this.#c(),e}finish(){this.#n&&(this.#n.focus({focusVisible:this.#i}),this.#i=!1)}isEmpty(){return!this.#e&&!this.#t}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:n}){this.#e===e&&this.#t===n||(this.#e=e,this.#t=n,this.#c())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}destroy(){this.#n?.remove(),this.#n=null,this.#r=null}async#c(){const e=this.#n;if(!e)return;if(!this.#e&&!this.#t){e.classList.remove("done"),this.#r?.remove();return}e.classList.add("done"),Yo._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(r=>{e.setAttribute("aria-label",r)});let n=this.#r;if(!n){this.#r=n=document.createElement("span"),n.className="tooltip",n.setAttribute("role","tooltip");const r=n.id=`alt-text-tooltip-${this.#s.id}`;e.setAttribute("aria-describedby",r);const s=100;e.addEventListener("mouseenter",()=>{this.#a=setTimeout(()=>{this.#a=null,this.#r.classList.add("show"),this.#s._reportTelemetry({action:"alt_text_tooltip"})},s)}),e.addEventListener("mouseleave",()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.#r?.classList.remove("show")})}n.innerText=this.#t?await Yo._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#e,n.parentNode||e.append(n),this.#s.getImageForAltText()?.setAttribute("aria-describedby",n.id)}}class ct{#e=null;#t=null;#n=!1;#r=!1;#a=null;#i=null;#s=this.focusin.bind(this);#c=this.focusout.bind(this);#l=null;#d="";#f=!1;#u=null;#o=!1;#p=!1;#m=!1;#h=null;#v=0;#g=0;#b=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#w=!1;#E=ct._zIndex++;static _borderLineWidth=-1;static _colorManager=new m0;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=ct.prototype._resizeWithKeyboard,n=ho.TRANSLATE_SMALL,i=ho.TRANSLATE_BIG;return Rt(this,"_resizerKeyboardManager",new uh([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],ct.prototype._stopResizingWithKeyboard]]))}constructor(e){this.constructor===ct&&Bt("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:n,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:l}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,l];const[u,d]=this.parentDimensions;this.x=e.x/u,this.y=e.y/d,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Rt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new tJ({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n,i){if(ct._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(s=>[s,e.get(s.replaceAll(/([A-Z])/g,l=>`-${l.toLowerCase()}`))])),i?.strings)for(const s of i.strings)ct._l10nPromise.set(s,e.get(s));if(ct._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);ct._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Bt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(e*2),this.y+=this.width*e/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(e*2),this.y-=this.width*e/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}
748setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#E}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#O(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#f?this.#f=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,n,i,r){const[s,l]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(e+i)/s,this.y=(n+r)/l,this.fixAndSetPosition()}#A([e,n],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/e,this.y+=r/n,this.fixAndSetPosition()}translate(e,n){this.#A(this.parentDimensions,e,n)}translateInPage(e,n){this.#u||=[this.x,this.y],this.#A(this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}drag(e,n){this.#u||=[this.x,this.y];const[i,r]=this.parentDimensions;if(this.x+=e/i,this.y+=n/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:f,y:p}=this.div.getBoundingClientRect();this.parent.findNewParent(this,f,p)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:l}=this;const[u,d]=this.getBaseTranslation();s+=u,l+=d,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*l).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#u&&(this.#u[0]!==this.x||this.#u[1]!==this.y)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:i}=ct,r=i/e,s=i/n;switch(this.rotation){case 90:return[-r,s];case 180:return[r,s];case 270:return[r,-s];default:return[-r,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[n,i]=this.pageDimensions;let{x:r,y:s,width:l,height:u}=this;if(l*=n,u*=i,r*=n,s*=i,this._mustFixPosition)switch(e){case 0:r=Math.max(0,Math.min(n-l,r)),s=Math.max(0,Math.min(i-u,s));break;case 90:r=Math.max(0,Math.min(n-u,r)),s=Math.min(i,Math.max(l,s));break;case 180:r=Math.min(n,Math.max(l,r)),s=Math.min(i,Math.max(u,s));break;case 270:r=Math.min(n,Math.max(u,r)),s=Math.max(0,Math.min(i-l,s));break}this.x=r/=n,this.y=s/=i;const[d,f]=this.getBaseTranslation();r+=d,s+=f;const{style:p}=this.div;p.left=`${(100*r).toFixed(2)}%`,p.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#j(e,n,i){switch(i){case 90:return[n,-e];case 180:return[-e,-n];case 270:return[-n,e];default:return[e,n]}}screenToPageTranslation(e,n){return ct.#j(e,n,this.parentRotation)}pageTranslationToScreen(e,n){return ct.#j(e,n,360-this.parentRotation)}#k(e){switch(e){case 90:{const[n,i]=this.pageDimensions;return[0,-n/i,i/n,0]}case 180:return[-1,0,0,-1];case 270:{const[n,i]=this.pageDimensions;return[0,n/i,-i/n,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[n,i]}=this,r=n*e,s=i*e;return Mi.isCSSRoundSupported?[Math.round(r),Math.round(s)]:[r,s]}setDims(e,n){const[i,r]=this.parentDimensions;this.div.style.width=`${(100*e/i).toFixed(2)}%`,this.#r||(this.div.style.height=`${(100*n/r).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:n,width:i}=e,r=i.endsWith("%"),s=!this.#r&&n.endsWith("%");if(r&&s)return;const[l,u]=this.parentDimensions;r||(e.width=`${(100*parseFloat(i)/l).toFixed(2)}%`),!this.#r&&!s&&(e.height=`${(100*parseFloat(n)/u).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#y(){if(this.#a)return;this.#a=document.createElement("div"),this.#a.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];for(const n of e){const i=document.createElement("div");this.#a.append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",this.#x.bind(this,n)),i.addEventListener("contextmenu",zi),i.tabIndex=-1}this.div.prepend(this.#a)}
748#x(e,n){n.preventDefault();const{isMac:i}=Mi.platform;if(n.button!==0||n.ctrlKey&&i)return;this.#t?.toggle(!1);const r=this.#C.bind(this,e),s=this._isDraggable;this._isDraggable=!1;const l={passive:!0,capture:!0};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",r,l),window.addEventListener("contextmenu",zi);const u=this.x,d=this.y,f=this.width,p=this.height,m=this.parent.div.style.cursor,x=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const b=()=>{this.parent.togglePointerEvents(!0),this.#t?.toggle(!0),this._isDraggable=s,window.removeEventListener("pointerup",b),window.removeEventListener("blur",b),window.removeEventListener("pointermove",r,l),window.removeEventListener("contextmenu",zi),this.parent.div.style.cursor=m,this.div.style.cursor=x,this.#S(u,d,f,p)};window.addEventListener("pointerup",b),window.addEventListener("blur",b)}#S(e,n,i,r){const s=this.x,l=this.y,u=this.width,d=this.height;s===e&&l===n&&u===i&&d===r||this.addCommands({cmd:()=>{this.width=u,this.height=d,this.x=s,this.y=l;const[f,p]=this.parentDimensions;this.setDims(f*u,p*d),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=r,this.x=e,this.y=n;const[f,p]=this.parentDimensions;this.setDims(f*i,p*r),this.fixAndSetPosition()},mustExec:!0})}#C(e,n){const[i,r]=this.parentDimensions,s=this.x,l=this.y,u=this.width,d=this.height,f=ct.MIN_SIZE/i,p=ct.MIN_SIZE/r,m=V=>Math.round(V*1e4)/1e4,x=this.#k(this.rotation),b=(V,O)=>[x[0]*V+x[2]*O,x[1]*V+x[3]*O],w=this.#k(360-this.rotation),C=(V,O)=>[w[0]*V+w[2]*O,w[1]*V+w[3]*O];let A,E,k=!1,N=!1;switch(e){case"topLeft":k=!0,A=(V,O)=>[0,0],E=(V,O)=>[V,O];break;case"topMiddle":A=(V,O)=>[V/2,0],E=(V,O)=>[V/2,O];break;case"topRight":k=!0,A=(V,O)=>[V,0],E=(V,O)=>[0,O];break;case"middleRight":N=!0,A=(V,O)=>[V,O/2],E=(V,O)=>[0,O/2];break;case"bottomRight":k=!0,A=(V,O)=>[V,O],E=(V,O)=>[0,0];break;case"bottomMiddle":A=(V,O)=>[V/2,O],E=(V,O)=>[V/2,0];break;case"bottomLeft":k=!0,A=(V,O)=>[0,O],E=(V,O)=>[V,0];break;case"middleLeft":N=!0,A=(V,O)=>[0,O/2],E=(V,O)=>[V,O/2];break}const _=A(u,d),R=E(u,d);let T=b(...R);const L=m(s+T[0]),M=m(l+T[1]);let U=1,D=1,[G,Z]=this.screenToPageTranslation(n.movementX,n.movementY);if([G,Z]=C(G/i,Z/r),k){const V=Math.hypot(u,d);U=D=Math.max(Math.min(Math.hypot(R[0]-_[0]-G,R[1]-_[1]-Z)/V,1/u,1/d),f/u,p/d)}else N?U=Math.max(f,Math.min(1,Math.abs(R[0]-_[0]-G)))/u:D=Math.max(p,Math.min(1,Math.abs(R[1]-_[1]-Z)))/d;const Q=m(u*U),K=m(d*D);T=b(...E(Q,K));const q=L-T[0],F=M-T[1];this.width=Q,this.height=K,this.x=q,this.y=F,this.setDims(i*Q,r*K),this.fixAndSetPosition()}altTextFinish(){this.#t?.finish()}async addEditToolbar(){return this.#l||this.#p?this.#l:(this.#l=new f0(this),this.div.append(this.#l.render()),this.#t&&this.#l.addAltTextButton(await this.#t.render()),this.#l)}removeEditToolbar(){this.#l&&(this.#l.remove(),this.#l=null,this.#t?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#t||(Yo.initialize(ct._l10nPromise),this.#t=new Yo(this),await this.addEditToolbar())}get altTextData(){return this.#t?.data}set altTextData(e){this.#t&&(this.#t.data=e)}hasAltText(){return!this.#t?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#n?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.div.addEventListener("focusin",this.#s),this.div.addEventListener("focusout",this.#c);const[e,n]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*n/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/n).toFixed(2)}%`);const[i,r]=this.getInitialTranslation();return this.translate(i,r),im(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:n}=Mi.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if(this.#f=!0,this._isDraggable){this.#_(e);return}this.#T(e)}#T(e){const{isMac:n}=Mi.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}#_(e){const n=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,r;n&&(this.div.classList.add("moving"),i={passive:!0,capture:!0},this.#v=e.clientX,this.#g=e.clientY,r=l=>{const{clientX:u,clientY:d}=l,[f,p]=this.screenToPageTranslation(u-this.#v,d-this.#g);this.#v=u,this.#g=d,this._uiManager.dragSelectedEditors(f,p)},window.addEventListener("pointermove",r,i));const s=()=>{window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),n&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",r,i)),this.#f=!1,this._uiManager.endDragSession()||this.#T(e)};window.addEventListener("pointerup",s),window.addEventListener("blur",s)}moveInDOM(){this.#h&&clearTimeout(this.#h),this.#h=setTimeout(()=>{this.#h=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,n,i){e.changeParent(this),this.x=n,this.y=i,this.fixAndSetPosition()}getRect(e,n,i=this.rotation){const r=this.parentScale,[s,l]=this.pageDimensions,[u,d]=this.pageTranslation,f=e/r,p=n/r,m=this.x*s,x=this.y*l,b=this.width*s,w=this.height*l;switch(i){case 0:return[m+f+u,l-x-p-w+d,m+f+b+u,l-x-p+d];case 90:return[m+p+u,l-x+f+d,m+p+w+u,l-x+f+b+d];case 180:return[m-f-b+u,l-x+p+d,m-f+u,l-x+p+w+d];case 270:return[m-p-w+u,l-x-f-b+d,m-p+u,l-x-f+d];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[i,r,s,l]=e,u=s-i,d=l-r;switch(this.rotation){case 0:return[i,n-l,u,d];case 90:return[i,n-r,d,u];case 180:return[s,n-r,u,d];case 270:return[s,n-l,d,u];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#p=!0}disableEditMode(){this.#p=!1}isInEditMode(){return this.#p}shouldGetKeyboardEvents(){return this.#m}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#s),this.div?.addEventListener("focusout",this.#c)}rotate(e){}serialize(e=!1,n=null){Bt("An editor must be serializable")}static deserialize(e,n,i){const r=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:i});r.rotation=e.rotation;const[s,l]=r.pageDimensions,[u,d,f,p]=r.getRectInCurrentCoords(e.rect,l);return r.x=u/s,r.y=d/l,r.width=f/s,r.height=p/l,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",this.#s),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#h&&(clearTimeout(this.#h),this.#h=null),this.#O(),this.removeEditToolbar(),this.#b){for(const e of this.#b.values())clearTimeout(e);this.#b=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#y(),this.#a.classList.remove("hidden"),im(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#i={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const n=this.#a.children;if(!this.#e){this.#e=Array.from(n);const l=this.#D.bind(this),u=this.#R.bind(this);for(const d of this.#e){const f=d.getAttribute("data-resizer-name");d.setAttribute("role","spinbutton"),d.addEventListener("keydown",l),d.addEventListener("blur",u),d.addEventListener("focus",this.#L.bind(this,f)),ct._l10nPromise.get(`pdfjs-editor-resizer-label-${f}`).then(p=>d.setAttribute("aria-label",p))}}const i=this.#e[0];let r=0;for(const l of n){if(l===i)break;r++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(s!==r){if(s<r)for(let u=0;u<r-s;u++)this.#a.append(this.#a.firstChild);else if(s>r)for(let u=0;u<s-r;u++)this.#a.firstChild.before(this.#a.lastChild);let l=0;for(const u of n){const f=this.#e[l++].getAttribute("data-resizer-name");ct._l10nPromise.get(`pdfjs-editor-resizer-label-${f}`).then(p=>u.setAttribute("aria-label",p))}}this.#P(0),this.#m=!0,this.#a.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#D(e){ct._resizerKeyboardManager.exec(this,e)}#R(e){this.#m&&e.relatedTarget?.parentNode!==this.#a&&this.#O()}#L(e){this.#d=this.#m?e:""}#P(e){if(this.#e)for(const n of this.#e)n.tabIndex=e}_resizeWithKeyboard(e,n){this.#m&&this.#C(this.#d,{movementX:e,movementY:n})}
748#O(){if(this.#m=!1,this.#P(-1),this.#i){const{savedX:e,savedY:n,savedWidth:i,savedHeight:r}=this.#i;this.#S(e,n,i,r),this.#i=null}}_stopResizingWithKeyboard(){this.#O(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#l){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#l?.show()});return}this.#l?.show()}unselect(){this.#a?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#l?.hide()}updateParams(e,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#o}set isEditing(e){this.#o=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,n){this.#r=!0;const i=e/n,{style:r}=this.div;r.aspectRatio=i,r.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,n=!1){if(n){this.#b||=new Map;const{action:i}=e;let r=this.#b.get(i);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(e),this.#b.delete(i),this.#b.size===0&&(this.#b=null)},ct._telemetryTimeout),this.#b.set(i,r);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}renderAnnotationElement(e){let n=e.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),e.container.prepend(n);else if(n.nodeName==="CANVAS"){const i=n;n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),i.before(n)}return n}resetAnnotationElement(e){const{firstChild:n}=e.container;n.nodeName==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}}class tJ extends ct{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const p2=3285377520,hr=4294901760,cs=65535;class PP{constructor(e){this.h1=e?e&4294967295:p2,this.h2=e?e&4294967295:p2}update(e){let n,i;if(typeof e=="string"){n=new Uint8Array(e.length*2),i=0;for(let C=0,A=e.length;C<A;C++){const E=e.charCodeAt(C);E<=255?n[i++]=E:(n[i++]=E>>>8,n[i++]=E&255)}}else if(ArrayBuffer.isView(e))n=e.slice(),i=n.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,s=i-r*4,l=new Uint32Array(n.buffer,0,r);let u=0,d=0,f=this.h1,p=this.h2;const m=3432918353,x=461845907,b=m&cs,w=x&cs;for(let C=0;C<r;C++)C&1?(u=l[C],u=u*m&hr|u*b&cs,u=u<<15|u>>>17,u=u*x&hr|u*w&cs,f^=u,f=f<<13|f>>>19,f=f*5+3864292196):(d=l[C],d=d*m&hr|d*b&cs,d=d<<15|d>>>17,d=d*x&hr|d*w&cs,p^=d,p=p<<13|p>>>19,p=p*5+3864292196);switch(u=0,s){case 3:u^=n[r*4+2]<<16;case 2:u^=n[r*4+1]<<8;case 1:u^=n[r*4],u=u*m&hr|u*b&cs,u=u<<15|u>>>17,u=u*x&hr|u*w&cs,r&1?f^=u:p^=u}this.h1=f,this.h2=p}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&hr|e*36045&cs,n=n*4283543511&hr|((n<<16|e>>>16)*2950163797&hr)>>>16,e^=n>>>1,e=e*444984403&hr|e*60499&cs,n=n*3301882366&hr|((n<<16|e>>>16)*3120437893&hr)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const Ny=Object.freeze({map:null,hash:"",transfer:void 0});class g0{#e=!1;#t=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const i=this.#t.get(e);return i===void 0?n:Object.assign(n,i)}getRawValue(e){return this.#t.get(e)}remove(e){if(this.#t.delete(e),this.#t.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of this.#t.values())if(n instanceof ct)return;this.onAnnotationEditor(null)}}setValue(e,n){const i=this.#t.get(e);let r=!1;if(i!==void 0)for(const[s,l]of Object.entries(n))i[s]!==l&&(r=!0,i[s]=l);else r=!0,this.#t.set(e,n);r&&this.#n(),n instanceof ct&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(e){return this.#t.has(e)}getAll(){return this.#t.size>0?a0(this.#t):null}setAll(e){for(const[n,i]of Object.entries(e))this.setValue(n,i)}get size(){return this.#t.size}#n(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new DP(this)}get serializable(){if(this.#t.size===0)return Ny;const e=new Map,n=new PP,i=[],r=Object.create(null);let s=!1;for(const[l,u]of this.#t){const d=u instanceof ct?u.serialize(!1,r):u;d&&(e.set(l,d),n.update(`${l}:${JSON.stringify(d)}`),s||=!!d.bitmap)}if(s)for(const l of e.values())l.bitmap&&i.push(l.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:i}:Ny}get editorStats(){let e=null;const n=new Map;for(const i of this.#t.values()){if(!(i instanceof ct))continue;const r=i.telemetryFinalData;if(!r)continue;const{type:s}=r;n.has(s)||n.set(s,Object.getPrototypeOf(i).constructor),e||=Object.create(null);
748const l=e[s]||=new Map;for(const[u,d]of Object.entries(r)){if(u==="type")continue;let f=l.get(u);f||(f=new Map,l.set(u,f));const p=f.get(d)??0;f.set(d,p+1)}}for(const[i,r]of n)e[i]=r.computeTelemetryFinalData(e[i]);return e}}class DP extends g0{#e;constructor(e){super();const{map:n,hash:i,transfer:r}=e.serializable,s=structuredClone(n,r?{transfer:r}:null);this.#e={map:s,hash:i,transfer:r}}get print(){Bt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}}class nJ{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const n=this.styleElement.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(Gn(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:r,style:s}=e,l=new FontFace(i,r,s);this.addNativeFontFace(l);try{await l.load(),this.#e.add(i),n?.(e)}catch{bt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(l)}return}Bt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const i=e.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(r){throw bt(`Failed to load font '${i.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const r=this._queueLoadingCallback(i);this._prepareFontLoadEvent(e,r)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return Rt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(pi||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Rt(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for(Gn(!r.done,"completeRequest() cannot be called twice."),r.done=!0;i.length>0&&i[0].done;){const s=i.shift();setTimeout(s.callback,0)}}const{loadingRequests:i}=this,r={done:!1,complete:n,callback:e};return i.push(r),r}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Rt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function i(_,R){return _.charCodeAt(R)<<24|_.charCodeAt(R+1)<<16|_.charCodeAt(R+2)<<8|_.charCodeAt(R+3)&255}function r(_,R,T,L){const M=_.substring(0,R),U=_.substring(R+T);return M+L+U}let s,l;const u=this._document.createElement("canvas");u.width=1,u.height=1;const d=u.getContext("2d");let f=0;function p(_,R){if(++f>30){bt("Load test font never loaded."),R();return}if(d.font="30px "+_,d.fillText(".",0,20),d.getImageData(0,0,1,1).data[3]>0){R();return}setTimeout(p.bind(null,_,R))}const m=`lt${Date.now()}${this.loadTestFontId++}`;let x=this._loadTestFont;x=r(x,976,m.length,m);const w=16,C=1482184792;let A=i(x,w);for(s=0,l=m.length-3;s<l;s+=4)A=A-C+i(m,s)|0;s<m.length&&(A=A-C+i(m+"XXX",s)|0),x=r(x,w,4,FZ(A));const E=`url(data:font/opentype;base64,${btoa(x)});`,k=`@font-face {font-family:"${m}";src:${E}}`;this.insertRule(k);const N=this._document.createElement("div");N.style.visibility="hidden",N.style.width=N.style.height="10px",N.style.position="absolute",N.style.top=N.style.left="0px";for(const _ of[e.loadedName,m]){const R=this._document.createElement("span");R.textContent="Hi",R.style.fontFamily=_,N.append(R)}this._document.body.append(N),p(m,()=>{N.remove(),n.complete()})}}class iJ{constructor(e,{disableFontFace:n=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const r in e)this[r]=e[r];this.disableFontFace=n===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=kP(this.data),n=`url(data:${this.mimetype};base64,${btoa(e)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${n}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${n}}`}return this._inspectFont?.(this,n),i}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let i;try{i=e.get(this.loadedName+"_path_"+n)}catch(s){bt(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[n]=function(s,l){};const r=[];for(let s=0,l=i.length;s<l;)switch(i[s++]){case ra.BEZIER_CURVE_TO:{const[u,d,f,p,m,x]=i.slice(s,s+6);
748r.push(b=>b.bezierCurveTo(u,d,f,p,m,x)),s+=6}break;case ra.MOVE_TO:{const[u,d]=i.slice(s,s+2);r.push(f=>f.moveTo(u,d)),s+=2}break;case ra.LINE_TO:{const[u,d]=i.slice(s,s+2);r.push(f=>f.lineTo(u,d)),s+=2}break;case ra.QUADRATIC_CURVE_TO:{const[u,d,f,p]=i.slice(s,s+4);r.push(m=>m.quadraticCurveTo(u,d,f,p)),s+=4}break;case ra.RESTORE:r.push(u=>u.restore());break;case ra.SAVE:r.push(u=>u.save());break;case ra.SCALE:Gn(r.length===2,"Scale command is only valid at the third position.");break;case ra.TRANSFORM:{const[u,d,f,p,m,x]=i.slice(s,s+6);r.push(b=>b.transform(u,d,f,p,m,x)),s+=6}break;case ra.TRANSLATE:{const[u,d]=i.slice(s,s+2);r.push(f=>f.translate(u,d)),s+=2}break}return this.compiledGlyphs[n]=function(l,u){r[0](l),r[1](l),l.scale(u,-u);for(let d=2,f=r.length;d<f;d++)r[d](l)}}}if(pi){var jy=Promise.withResolvers(),_y=null;(async()=>{const e=await np(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),n=await np(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),i=await np(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),r=await np(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);let s,l;return new Map(Object.entries({fs:e,http:n,https:i,url:r,canvas:s,path2d:l}))})().then(e=>{_y=e,jy.resolve()},e=>{bt(`loadPackages: ${e}`),_y=new Map,jy.resolve()})}class ks{static get promise(){return jy.promise}static get(e){return _y?.get(e)}}const LP=function(t){return ks.get("fs").promises.readFile(t).then(n=>new Uint8Array(n))};class rJ extends Km{}class sJ extends Wm{_createCanvas(e,n){return ks.get("canvas").createCanvas(e,n)}}class aJ extends Ym{_fetchData(e,n){return LP(e).then(i=>({cMapData:i,compressionType:n}))}}class oJ extends Xm{_fetchData(e){return LP(e)}}const wi={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Ty(t,e){if(!e)return;const n=e[2]-e[0],i=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],n,i),t.clip(r)}class dh{constructor(){this.constructor===dh&&Bt("Cannot initialize BaseShadingPattern.")}getPattern(){Bt("Abstract method `getPattern` called.")}}class lJ extends dh{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)n.addColorStop(i[0],i[1]);return n}getPattern(e,n,i,r){let s;if(r===wi.STROKE||r===wi.FILL){const l=n.current.getClippedPathBoundingBox(r,un(e))||[0,0,0,0],u=Math.ceil(l[2]-l[0])||1,d=Math.ceil(l[3]-l[1])||1,f=n.cachedCanvases.getCanvas("pattern",u,d,!0),p=f.context;p.clearRect(0,0,p.canvas.width,p.canvas.height),p.beginPath(),p.rect(0,0,p.canvas.width,p.canvas.height),p.translate(-l[0],-l[1]),i=Ke.transform(i,[1,0,0,1,l[0],l[1]]),p.transform(...n.baseTransform),this.matrix&&p.transform(...this.matrix),Ty(p,this._bbox),p.fillStyle=this._createGradient(p),p.fill(),s=e.createPattern(f.canvas,"no-repeat");const m=new DOMMatrix(i);s.setTransform(m)}else Ty(e,this._bbox),s=this._createGradient(e);return s}}function xb(t,e,n,i,r,s,l,u){const d=e.coords,f=e.colors,p=t.data,m=t.width*4;let x;d[n+1]>d[i+1]&&(x=n,n=i,i=x,x=s,s=l,l=x),d[i+1]>d[r+1]&&(x=i,i=r,r=x,x=l,l=u,u=x),d[n+1]>d[i+1]&&(x=n,n=i,i=x,x=s,s=l,l=x);const b=(d[n]+e.offsetX)*e.scaleX,w=(d[n+1]+e.offsetY)*e.scaleY,C=(d[i]+e.offsetX)*e.scaleX,A=(d[i+1]+e.offsetY)*e.scaleY,E=(d[r]+e.offsetX)*e.scaleX,k=(d[r+1]+e.offsetY)*e.scaleY;if(w>=k)return;const N=f[s],_=f[s+1],R=f[s+2],T=f[l],L=f[l+1],M=f[l+2],U=f[u],D=f[u+1],G=f[u+2],Z=Math.round(w),Q=Math.round(k);let K,q,F,V,O,X,$,B;for(let H=Z;H<=Q;H++){if(H<A){const W=H<w?0:(w-H)/(w-A);K=b-(b-C)*W,q=N-(N-T)*W,F=_-(_-L)*W,V=R-(R-M)*W}else{let W;H>k?W=1:A===k?W=0:W=(A-H)/(A-k),K=C-(C-E)*W,q=T-(T-U)*W,F=L-(L-D)*W,V=M-(M-G)*W}let P;H<w?P=0:H>k?P=1:P=(w-H)/(w-k),O=b-(b-E)*P,X=N-(N-U)*P,$=_-(_-D)*P,B=R-(R-G)*P;const J=Math.round(Math.min(K,O)),he=Math.round(Math.max(K,O));let ue=m*H+J*4;for(let W=J;W<=he;W++)P=(K-W)/(K-O),P<0?P=0:P>1&&(P=1),p[ue++]=q-(q-X)*P|0,p[ue++]=F-(F-$)*P|0,p[ue++]=V-(V-B)*P|0,p[ue++]=255}}function cJ(t,e,n){const i=e.coords,r=e.colors;let s,l;switch(e.type){case"lattice":const u=e.verticesPerRow,d=Math.floor(i.length/u)-1,f=u-1;for(s=0;s<d;s++){let p=s*u;for(let m=0;m<f;m++,p++)xb(t,n,i[p],i[p+1],i[p+u],r[p],r[p+1],r[p+u]),xb(t,n,i[p+u+1],i[p+1],i[p+u],r[p+u+1],r[p+1],r[p+u])}break;case"triangles":for(s=0,l=i.length;s<l;s+=3)xb(t,n,i[s],i[s+1],i[s+2],r[s],r[s+1],r[s+2]);break;default:throw new Error("illegal figure")}}class uJ extends dh{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,n,i){const u=Math.floor(this._bounds[0]),d=Math.floor(this._bounds[1]),f=Math.ceil(this._bounds[2])-u,p=Math.ceil(this._bounds[3])-d,m=Math.min(Math.ceil(Math.abs(f*e[0]*1.1)),3e3),x=Math.min(Math.ceil(Math.abs(p*e[1]*1.1)),3e3),b=f/m,w=p/x,C={coords:this._coords,colors:this._colors,offsetX:-u,offsetY:-d,scaleX:1/b,scaleY:1/w},A=m+4,E=x+4,k=i.getCanvas("mesh",A,E,!1),N=k.context,_=N.createImageData(m,x);if(n){const T=_.data;for(let L=0,M=T.length;L<M;L+=4)T[L]=n[0],T[L+1]=n[1],T[L+2]=n[2],T[L+3]=255}for(const T of this._figures)cJ(_,T,C);return N.putImageData(_,2,2),{canvas:k.canvas,offsetX:u-2*b,offsetY:d-2*w,scaleX:b,scaleY:w}}getPattern(e,n,i,r){Ty(e,this._bbox);let s;if(r===wi.SHADING)s=Ke.singularValueDecompose2dScale(un(e));else if(s=Ke.singularValueDecompose2dScale(n.baseTransform),this.matrix
748){const u=Ke.singularValueDecompose2dScale(this.matrix);s=[s[0]*u[0],s[1]*u[1]]}const l=this._createMeshCanvas(s,r===wi.SHADING?null:this._background,n.cachedCanvases);return r!==wi.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(l.offsetX,l.offsetY),e.scale(l.scaleX,l.scaleY),e.createPattern(l.canvas,"no-repeat")}}class dJ extends dh{getPattern(){return"hotpink"}}function hJ(t){switch(t[0]){case"RadialAxial":return new lJ(t);case"Mesh":return new uJ(t);case"Dummy":return new dJ}throw new Error(`Unknown IR type: ${t[0]}`)}const m2={COLORED:1,UNCOLORED:2};class x0{static MAX_PATTERN_SIZE=3e3;constructor(e,n,i,r,s){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=n,this.ctx=i,this.canvasGraphicsFactory=r,this.baseTransform=s}createPatternCanvas(e){const n=this.operatorList,i=this.bbox,r=this.xstep,s=this.ystep,l=this.paintType,u=this.tilingType,d=this.color,f=this.canvasGraphicsFactory;Gm("TilingType: "+u);const p=i[0],m=i[1],x=i[2],b=i[3],w=Ke.singularValueDecompose2dScale(this.matrix),C=Ke.singularValueDecompose2dScale(this.baseTransform),A=[w[0]*C[0],w[1]*C[1]],E=this.getSizeAndScale(r,this.ctx.canvas.width,A[0]),k=this.getSizeAndScale(s,this.ctx.canvas.height,A[1]),N=e.cachedCanvases.getCanvas("pattern",E.size,k.size,!0),_=N.context,R=f.createCanvasGraphics(_);R.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(R,l,d);let T=p,L=m,M=x,U=b;return p<0&&(T=0,M+=Math.abs(p)),m<0&&(L=0,U+=Math.abs(m)),_.translate(-(E.scale*T),-(k.scale*L)),R.transform(E.scale,0,0,k.scale,0,0),_.save(),this.clipBbox(R,T,L,M,U),R.baseTransform=un(R.ctx),R.executeOperatorList(n),R.endDrawing(),{canvas:N.canvas,scaleX:E.scale,scaleY:k.scale,offsetX:T,offsetY:L}}getSizeAndScale(e,n,i){e=Math.abs(e);const r=Math.max(x0.MAX_PATTERN_SIZE,n);let s=Math.ceil(e*i);return s>=r?s=r:i=s/e,{scale:i,size:s}}clipBbox(e,n,i,r,s){const l=r-n,u=s-i;e.ctx.rect(n,i,l,u),e.current.updateRectMinMax(un(e.ctx),[n,i,r,s]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,i){const r=e.ctx,s=e.current;switch(n){case m2.COLORED:const l=this.ctx;r.fillStyle=l.fillStyle,r.strokeStyle=l.strokeStyle,s.fillColor=l.fillStyle,s.strokeColor=l.strokeStyle;break;case m2.UNCOLORED:const u=Ke.makeHexColor(i[0],i[1],i[2]);r.fillStyle=u,r.strokeStyle=u,s.fillColor=u,s.strokeColor=u;break;default:throw new zZ(`Unsupported paint type: ${n}`)}}getPattern(e,n,i,r){let s=i;r!==wi.SHADING&&(s=Ke.transform(s,n.baseTransform),this.matrix&&(s=Ke.transform(s,this.matrix)));const l=this.createPatternCanvas(n);let u=new DOMMatrix(s);u=u.translate(l.offsetX,l.offsetY),u=u.scale(1/l.scaleX,1/l.scaleY);const d=e.createPattern(l.canvas,"repeat");return d.setTransform(u),d}}function fJ({src:t,srcPos:e=0,dest:n,width:i,height:r,nonBlackColor:s=4294967295,inverseDecode:l=!1}){const u=Mi.isLittleEndian?4278190080:255,[d,f]=l?[s,u]:[u,s],p=i>>3,m=i&7,x=t.length;n=new Uint32Array(n.buffer);let b=0;for(let w=0;w<r;w++){for(const A=e+p;e<A;e++){const E=e<x?t[e]:255;n[b++]=E&128?f:d,n[b++]=E&64?f:d,n[b++]=E&32?f:d,n[b++]=E&16?f:d,n[b++]=E&8?f:d,n[b++]=E&4?f:d,n[b++]=E&2?f:d,n[b++]=E&1?f:d}if(m===0)continue;const C=e<x?t[e++]:255;for(let A=0;A<m;A++)n[b++]=C&1<<7-A?f:d}return{srcPos:e,destPos:b}}const g2=16,x2=100,pJ=15,v2=10,b2=1e3,Oi=16;function mJ(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()}
vendor: 6,848 bytes, line 748
748,t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},t.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},t.transform=function(i,r,s,l,u,d){e.transform(i,r,s,l,u,d),this.__originalTransform(i,r,s,l,u,d)},t.setTransform=function(i,r,s,l,u,d){e.setTransform(i,r,s,l,u,d),this.__originalSetTransform(i,r,s,l,u,d)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(i){e.rotate(i),this.__originalRotate(i)},t.clip=function(i){e.clip(i),this.__originalClip(i)},t.moveTo=function(n,i){e.moveTo(n,i),this.__originalMoveTo(n,i)},t.lineTo=function(n,i){e.lineTo(n,i),this.__originalLineTo(n,i)},t.bezierCurveTo=function(n,i,r,s,l,u){e.bezierCurveTo(n,i,r,s,l,u),this.__originalBezierCurveTo(n,i,r,s,l,u)},t.rect=function(n,i,r,s){e.rect(n,i,r,s),this.__originalRect(n,i,r,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class gJ{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,i){let r;return this.cache[e]!==void 0?(r=this.cache[e],this.canvasFactory.reset(r,n,i)):(r=this.canvasFactory.create(n,i),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function ip(t,e,n,i,r,s,l,u,d,f){const[p,m,x,b,w,C]=un(t);if(m===0&&x===0){const k=l*p+w,N=Math.round(k),_=u*b+C,R=Math.round(_),T=(l+d)*p+w,L=Math.abs(Math.round(T)-N)||1,M=(u+f)*b+C,U=Math.abs(Math.round(M)-R)||1;return t.setTransform(Math.sign(p),0,0,Math.sign(b),N,R),t.drawImage(e,n,i,r,s,0,0,L,U),t.setTransform(p,m,x,b,w,C),[L,U]}if(p===0&&b===0){const k=u*x+w,N=Math.round(k),_=l*m+C,R=Math.round(_),T=(u+f)*x+w,L=Math.abs(Math.round(T)-N)||1,M=(l+d)*m+C,U=Math.abs(Math.round(M)-R)||1;return t.setTransform(0,Math.sign(m),Math.sign(x),0,N,R),t.drawImage(e,n,i,r,s,0,0,U,L),t.setTransform(p,m,x,b,w,C),[U,L]}t.drawImage(e,n,i,r,s,l,u,d,f);const A=Math.hypot(p,m),E=Math.hypot(x,b);return[A*d,E*f]}function xJ(t){const{width:e,height:n}=t;if(e>b2||n>b2)return null;const i=1e3,r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let l=new Uint8Array(s*(n+1)),u,d,f;const p=e+7&-8;let m=new Uint8Array(p*n),x=0;for(const E of t.data){let k=128;for(;k>0;)m[x++]=E&k?0:255,k>>=1}let b=0;for(x=0,m[x]!==0&&(l[0]=1,++b),d=1;d<e;d++)m[x]!==m[x+1]&&(l[d]=m[x]?2:1,++b),x++;for(m[x]!==0&&(l[d]=2,++b),u=1;u<n;u++){x=u*p,f=u*s,m[x-p]!==m[x]&&(l[f]=m[x]?1:8,++b);let E=(m[x]?4:0)+(m[x-p]?8:0);for(d=1;d<e;d++)E=(E>>2)+(m[x+1]?4:0)+(m[x-p+1]?8:0),r[E]&&(l[f+d]=r[E],++b),x++;if(m[x-p]!==m[x]&&(l[f+d]=m[x]?2:4,++b),b>i)return null}for(x=p*(n-1),f=u*s,m[x]!==0&&(l[f]=8,++b),d=1;d<e;d++)m[x]!==m[x+1]&&(l[f+d]=m[x]?4:8,++b),x++;if(m[x]!==0&&(l[f+d]=4,++b),b>i)return null;const w=new Int32Array([0,s,-1,0,-s,0,0,0,1]),C=new Path2D;for(u=0;b&&u<=n;u++){let E=u*s;const k=E+e;for(;E<k&&!l[E];)E++;if(E===k)continue;C.moveTo(E%s,u);const N=E;let _=l[E];do{const R=w[_];do E+=R;while(!l[E]);const T=l[E];T!==5&&T!==10?(_=T,l[E]=0):(_=T&51*_>>4,l[E]&=_>>2|_<<2),C.lineTo(E%s,E/s|0),l[E]||--b}while(N!==E);--u}return m=null,l=null,function(E){E.save(),E.scale(1/e,-1/n),E.translate(0,-n),E.fill(C),E.beginPath(),E.restore()}}class y2{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=EP,this.textMatrixScale=1,this.fontMatrix=Cy,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=li.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,n])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,n){this.x=e,this.y=n}updatePathMinMax(e,n,i){[n,i]=Ke.applyTransform([n,i],e),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(e,n){const i=Ke.applyTransform(n,e),r=Ke.applyTransform(n.slice(2),e),s=Ke.applyTransform([n[0],n[3]],e),l=Ke.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,i[0],r[0],s[0],l[0]),this.minY=Math.min(this.minY,i[1],r[1],s[1],l[1]),this.maxX=Math.max(this.maxX,i[0],r[0],s[0],l[0]),this.maxY=Math.max(this.maxY,i[1],r[1],s[1],l[1])}updateScalingPathMinMax(e,n){Ke.scaleMinMax(e,n),this.minX=Math.min(this.minX,n[0]),this.minY=Math.min(this.minY,n[1]),this.maxX=Math.max(this.maxX,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(e,n,i,r,s,l,u,d,f,p){const m=Ke.bezierBoundingBox(n,i,r,s,l,u,d,f,p);p||this.updateRectMinMax(e,m)}getPathBoundingBox(e=wi.FILL,n=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(e===wi.STROKE){n||Bt("Stroke bounding box must include transform.");const r=Ke.singularValueDecompose2dScale(n),s=r[0]*this.lineWidth/2,l=r[1]*this.lineWidth/2;i[0]-=s,i[1]-=l,i[2]+=s,i[3]+=l}return i}updateClipFromPath(){const e=Ke.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=wi.FILL,n=null){return Ke.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function w2(t,e){if(typeof ImageData<"u"&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,i=e.width,r=n%Oi,s=(n-r)/Oi,l=r===0?s:s+1,u=t.createImageData(i,Oi);let d=0,f;const p=e.data,m=u.data;let x,b,w,C;if(e.kind===Sp.GRAYSCALE_1BPP){const A=p.byteLength,E=new Uint32Array(m.buffer,0,m.byteLength>>2),k=E.length,N=i+7>>3,_=4294967295,R=Mi.isLittleEndian?4278190080:255;for(x=0;x<l;x++){for(w=x<s?Oi:r,f=0,b=0;b<w;b++){const T=A-d;let L=0;const M=T>N?i:T*8-7,U=M&-8;let D=0,G=0;for(;L<U;L+=8)G=p[d++],E[f++]=G&128?_:R,E[f++]=G&64?_:R,E[f++]=G&32?_:R,E[f++]=G&16?_:R,E[f++]=G&8?_:R,E[f++]=G&4?_:R,E[f++]=G&2?_:R,E[f++]=G&1?_:R;for(;L<M;L++)D===0&&(G=p[d++],D=128),E[f++]=G&D?_:R,D>>=1}for(;f<k;)E[f++]=0;t.putImageData(u,0,x*Oi)}}else if(e.kind===Sp.RGBA_32BPP){for(b=0,C=i*Oi*4,x=0;x<s;x++)m.set(p.subarray(d,d+C)),d+=C,t.putImageData(u,0,b),b+=Oi;x<l&&(C=i*r*4,m.set(p.subarray(d,d+C)),t.putImageData(u,0,b))}else if(e.kind===Sp.RGB_24BPP)for(w=Oi,C=i*w,x=0;x<l;x++){for(x>=s&&(w=r,C=i*w),f=0,b=C;b--;)m[f++]=p[d++],m[f++]=p[d++],m[f++]=p[d++],m[f++]=255;t.putImageData(u,0,x*Oi)}else throw new Error(`bad image kind: ${e.kind}`)}function S2(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,i=e.width,r=n%Oi,s=(n-r)/Oi,l=r===0?s:s+1,u=t.createImageData(i,Oi);let d=0;const f=e.data,p=u.data;for(let m=0;m<l;m++){const x=m<s?Oi:r;({srcPos:d}
748=fJ({src:f,srcPos:d,dest:p,width:i,height:x,nonBlackColor:0})),t.putImageData(u,0,m*Oi)}}function pd(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of n)t[i]!==void 0&&(e[i]=t[i]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function rp(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!pi){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function C2(t,e){if(e)return!0;const n=Ke.singularValueDecompose2dScale(t);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*Fc.PDF_TO_CSS_UNITS);return n[0]<=i&&n[1]<=i}const vJ=["butt","round","square"],bJ=["miter","round","bevel"],yJ={},E2={};class jc{constructor(e,n,i,r,s,{optionalContentConfig:l,markedContentStack:u=null},d,f){this.ctx=e,this.current=new y2(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=i,this.canvasFactory=r,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=u||[],this.optionalContentConfig=l,this.cachedCanvases=new gJ(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=d,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=f,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,n=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):n}beginDrawing({transform:e,viewport:n,transparency:i=!1,background:r=null}){const s=this.ctx.canvas.width,l=this.ctx.canvas.height,u=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,s,l),this.ctx.fillStyle=u,i){const d=this.cachedCanvases.getCanvas("transparent",s,l);this.compositeCtx=this.ctx,this.transparentCanvas=d.canvas,this.ctx=d.context,this.ctx.save(),this.ctx.transform(...un(this.compositeCtx))}this.ctx.save(),rp(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=un(this.ctx)}executeOperatorList(e,n,i,r){const s=e.argsArray,l=e.fnArray;let u=n||0;const d=s.length;if(d===u)return u;const f=d-u>v2&&typeof i=="function",p=f?Date.now()+pJ:0;let m=0;const x=this.commonObjs,b=this.objs;let w;for(;;){if(r!==void 0&&u===r.nextBreakPoint)return r.breakIt(u,i),u;if(w=l[u],w!==Ir.dependency)this[w].apply(this,s[u]);else for(const C of s[u]){const A=C.startsWith("g_")?x:b;if(!A.has(C))return A.get(C,i),u}if(u++,u===d)return u;if(f&&++m>v2){if(Date.now()>p)return i(),u;m=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}}_scaleImage(e,n){const i=e.width,r=e.height;let s=Math.max(Math.hypot(n[0],n[1]),1),l=Math.max(Math.hypot(n[2],n[3]),1),u=i,d=r,f="prescale1",p,m;
vendor: 4,258 bytes, line 748
748for(;s>2&&u>1||l>2&&d>1;){let x=u,b=d;s>2&&u>1&&(x=u>=16384?Math.floor(u/2)-1||1:Math.ceil(u/2),s/=u/x),l>2&&d>1&&(b=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,l/=d/b),p=this.cachedCanvases.getCanvas(f,x,b),m=p.context,m.clearRect(0,0,x,b),m.drawImage(e,0,0,u,d,0,0,x,b),e=p.canvas,u=x,d=b,f=f==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:u,paintHeight:d}}_createMaskCanvas(e){const n=this.ctx,{width:i,height:r}=e,s=this.current.fillColor,l=this.current.patternFill,u=un(n);let d,f,p,m;if((e.bitmap||e.data)&&e.count>1){const M=e.bitmap||e.data.buffer;f=JSON.stringify(l?u:[u.slice(0,4),s]),d=this._cachedBitmapsMap.get(M),d||(d=new Map,this._cachedBitmapsMap.set(M,d));const U=d.get(f);if(U&&!l){const D=Math.round(Math.min(u[0],u[2])+u[4]),G=Math.round(Math.min(u[1],u[3])+u[5]);return{canvas:U,offsetX:D,offsetY:G}}p=U}p||(m=this.cachedCanvases.getCanvas("maskCanvas",i,r),S2(m.context,e));let x=Ke.transform(u,[1/i,0,0,-1/r,0,0]);x=Ke.transform(x,[1,0,0,1,0,-r]);const[b,w,C,A]=Ke.getAxialAlignedBoundingBox([0,0,i,r],x),E=Math.round(C-b)||1,k=Math.round(A-w)||1,N=this.cachedCanvases.getCanvas("fillCanvas",E,k),_=N.context,R=b,T=w;_.translate(-R,-T),_.transform(...x),p||(p=this._scaleImage(m.canvas,sa(_)),p=p.img,d&&l&&d.set(f,p)),_.imageSmoothingEnabled=C2(un(_),e.interpolate),ip(_,p,0,0,p.width,p.height,0,0,i,r),_.globalCompositeOperation="source-in";const L=Ke.transform(sa(_),[1,0,0,1,-R,-T]);return _.fillStyle=l?s.getPattern(n,this,L,wi.FILL):s,_.fillRect(0,0,i,r),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(f,N.canvas)),{canvas:N.canvas,offsetX:Math.round(R),offsetY:Math.round(T)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=vJ[e]}setLineJoin(e){this.ctx.lineJoin=bJ[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,i]of e)switch(n){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,e,n);this.suspendedCtx=this.ctx,this.ctx=r.context;const s=this.ctx;s.setTransform(...un(this.suspendedCtx)),pd(this.suspendedCtx,s),mJ(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),pd(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,n,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,n,i,r){const s=r[0],l=r[1],u=r[2]-s,d=r[3]-l;u===0||d===0||(this.genericComposeSMask(n.context,i,u,d,n.subtype,n.backdrop,n.transferMap,s,l,n.offsetX,n.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore(
748))}genericComposeSMask(e,n,i,r,s,l,u,d,f,p,m){let x=e.canvas,b=d-p,w=f-m;if(l){if(b<0||w<0||b+i>x.width||w+r>x.height){const A=this.cachedCanvases.getCanvas("maskExtension",i,r),E=A.context;E.drawImage(x,-b,-w),l.some(k=>k!==0)&&(E.globalCompositeOperation="destination-atop",E.fillStyle=Ke.makeHexColor(...l),E.fillRect(0,0,i,r),E.globalCompositeOperation="source-over"),x=A.canvas,b=w=0}else if(l.some(A=>A!==0)){e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const A=new Path2D;A.rect(b,w,i,r),e.clip(A),e.globalCompositeOperation="destination-atop",e.fillStyle=Ke.makeHexColor(...l),e.fillRect(b,w,i,r),e.restore()}}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),s==="Alpha"&&u?n.filter=this.filterFactory.addAlphaFilter(u):s==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(u));const C=new Path2D;C.rect(d,f,i,r),n.clip(C),n.globalCompositeOperation="destination-in",n.drawImage(x,b,w,i,r,d,f,i,r),n.restore()}save(){this.inSMaskMode?(pd(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),pd(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,i,r,s,l){this.ctx.transform(e,n,i,r,s,l),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,i){const r=this.ctx,s=this.current;let l=s.x,u=s.y,d,f;const p=un(r),m=p[0]===0&&p[3]===0||p[1]===0&&p[2]===0,x=m?i.slice(0):null;for(let b=0,w=0,C=e.length;b<C;b++)switch(e[b]|0){case Ir.rectangle:l=n[w++],u=n[w++];const A=n[w++],E=n[w++],k=l+A,N=u+E;r.moveTo(l,u),A===0||E===0?r.lineTo(k,N):(r.lineTo(k,u),r.lineTo(k,N),r.lineTo(l,N)),m||s.updateRectMinMax(p,[l,u,k,N]),r.closePath();break;case Ir.moveTo:l=n[w++],u=n[w++],r.moveTo(l,u),m||s.updatePathMinMax(p,l,u);break;case Ir.lineTo:l=n[w++],u=n[w++],r.lineTo(l,u),m||s.updatePathMinMax(p,l,u);break;case Ir.curveTo:d=l,f=u,l=n[w+4],u=n[w+5],r.bezierCurveTo(n[w],n[w+1],n[w+2],n[w+3],l,u),s.updateCurvePathMinMax(p,d,f,n[w],n[w+1],n[w+2],n[w+3],l,u,x),w+=6;break;case Ir.curveTo2:d=l,f=u,r.bezierCurveTo(l,u,n[w],n[w+1],n[w+2],n[w+3]),s.updateCurvePathMinMax(p,d,f,l,u,n[w],n[w+1],n[w+2],n[w+3],x),l=n[w+2],u=n[w+3],w+=4;break;case Ir.curveTo3:d=l,f=u,l=n[w+2],u=n[w+3],r.bezierCurveTo(n[w],n[w+1],l,u,l,u),s.updateCurvePathMinMax(p,d,f,n[w],n[w+1],l,u,l,u,x),w+=4;break;case Ir.closePath:r.closePath();break}m&&s.updateScalingPathMinMax(p,x),s.setCurrentPoint(l,u)}closePath(){this.ctx.closePath()}stroke(e=!0){const n=this.ctx,i=this.current.strokeColor;n.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&i?.getPattern?(n.save(),n.strokeStyle=i.getPattern(n,this,sa(n),wi.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const n=this.ctx,i=this.current.fillColor,r=this.current.patternFill;let s=!1;r&&(n.save(),n.fillStyle=i.getPattern(n,this,sa(n),wi.FILL),s=!0);const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(n.fill("evenodd"),this.pendingEOFill=!1):n.fill()),s&&n.restore(),e&&this.consumePath(l)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=yJ}eoClip(){this.pendingClip=E2}beginText(){this.current.textMatrix=EP,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,n=this.ctx;if(e===void 0){n.beginPath();return}n.save(),n.beginPath();for(const i of e)n.setTransform(...i.transform),n.translate(i.x,i.y),i.addToPath(n,i.fontSize);
748n.restore(),n.clip(),n.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,n){const i=this.commonObjs.get(e),r=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(r.fontMatrix=i.fontMatrix||Cy,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&bt("Invalid font matrix for font "+e),n<0?(n=-n,r.fontDirection=-1):r.fontDirection=1,this.current.font=i,this.current.fontSize=n,i.isType3Font)return;const s=i.loadedName||"sans-serif",l=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let u="normal";i.black?u="900":i.bold&&(u="bold");const d=i.italic?"italic":"normal";let f=n;n<g2?f=g2:n>x2&&(f=x2),this.current.fontSizeScale=n/f,this.ctx.font=`${d} ${u} ${f}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,n){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,n){this.setLeading(-n),this.moveText(e,n)}setTextMatrix(e,n,i,r,s,l){this.current.textMatrix=[e,n,i,r,s,l],this.current.textMatrixScale=Math.hypot(e,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,n,i,r){const s=this.ctx,l=this.current,u=l.font,d=l.textRenderingMode,f=l.fontSize/l.fontSizeScale,p=d&li.FILL_STROKE_MASK,m=!!(d&li.ADD_TO_PATH_FLAG),x=l.patternFill&&!u.missingFile;let b;(u.disableFontFace||m||x)&&(b=u.getPathGenerator(this.commonObjs,e)),u.disableFontFace||x?(s.save(),s.translate(n,i),s.beginPath(),b(s,f),r&&s.setTransform(...r),(p===li.FILL||p===li.FILL_STROKE)&&s.fill(),(p===li.STROKE||p===li.FILL_STROKE)&&s.stroke(),s.restore()):((p===li.FILL||p===li.FILL_STROKE)&&s.fillText(e,n,i),(p===li.STROKE||p===li.FILL_STROKE)&&s.strokeText(e,n,i)),m&&(this.pendingTextPaths||=[]).push({transform:un(s),x:n,y:i,fontSize:f,addToPath:b})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let i=!1;for(let r=3;r<n.length;r+=4)if(n[r]>0&&n[r]<255){i=!0;break}return Rt(this,"isFontSubpixelAAEnabled",i)}showText(e){const n=this.current,i=n.font;if(i.isType3Font)return this.showType3Text(e);const r=n.fontSize;if(r===0)return;const s=this.ctx,l=n.fontSizeScale,u=n.charSpacing,d=n.wordSpacing,f=n.fontDirection,p=n.textHScale*f,m=e.length,x=i.vertical,b=x?1:-1,w=i.defaultVMetrics,C=r*n.fontMatrix[0],A=n.textRenderingMode===li.FILL&&!i.disableFontFace&&!n.patternFill;s.save(),s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),f>0?s.scale(p,-1):s.scale(p,1);let E;if(n.patternFill){s.save();const T=n.fillColor.getPattern(s,this,sa(s),wi.FILL);E=un(s),s.restore(),s.fillStyle=T}let k=n.lineWidth;const N=n.textMatrixScale;if(N===0||k===0){const T=n.textRenderingMode&li.FILL_STROKE_MASK;(T===li.STROKE||T===li.FILL_STROKE)&&(k=this.getSinglePixelWidth())}else k/=N;if(l!==1&&(s.scale(l,l),k/=l),s.lineWidth=k,i.isInvalidPDFjsFont){const T=[];let L=0;for(const M of e)T.push(M.unicode),L+=M.width;s.fillText(T.join(""),0,0),n.x+=L*C*p,s.restore(),this.compose();return}let _=0,R;for(R=0;R<m;++R){const T=e[R];if(typeof T=="number"){_+=b*T*r/1e3;continue}let L=!1;const M=(T.isSpace?d:0)+u,U=T.fontChar,D=T.accent;let G,Z,Q=T.width;if(x){const q=T.vmetric||w,F=-(T.vmetric?q[1]:Q*.5)*C,V=q[2]*C;Q=q?-q[0]:Q,G=F/l,Z=(_+V)/l}else G=_/l,Z=0;if(i.remeasure&&Q>0){const q=s.measureText(U).width*1e3/r*l;if(Q<q&&this.isFontSubpixelAAEnabled){const F=Q/q;L=!0,s.save(),s.scale(F,1),G/=F}else Q!==q&&(G+=(Q-q)/2e3*r/l)}if(this.contentVisible&&(T.isInFont||i.missingFile)){if(A&&!D)s.fillText(U,G,Z);else if(this.paintChar(U,G,Z,E),D){const q=G+r*D.offset.x/l,F=Z-r*D.offset.y/l;this.paintChar(D.fontChar,q,F,E)}}const K=x?Q*C-M*f:Q*C+M*f;_+=K,L&&s.restore()}x?n.y-=_:n.x+=_*p,s.restore(),this.compose()}showType3Text(e){const n=this.ctx,i=this.current,r=i.font,s=i.fontSize,l=i.fontDirection,u=r.vertical?1:-1,d=i.charSpacing,f=i.wordSpacing,p=i.textHScale*l,m=i.fontMatrix||Cy,x=e.length,b=i.textRenderingMode===li.INVISIBLE;let w,C,A,E;if(!(b||s===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...i.textMatrix),n.translate(i.x,i.y),n.scale(p,l),w=0;w<x;++w){if(C=e[w],typeof C=="number"){E=u*C*s/1e3,this.ctx.translate(E,0),i.x+=E*p;continue}const k=(C.isSpace?f:0)+d,N=r.charProcOperatorList[C.operatorListId];if(!N){bt(`Type3 character "${C.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=C,this.save(),n.scale(s,s),n.transform(...m),this.executeOperatorList(N),this.restore(
748)),A=Ke.applyTransform([C.width,0],m)[0]*s+k,n.translate(A,0),i.x+=A*p}n.restore(),this.processingType3=null}}setCharWidth(e,n){}setCharWidthAndBounds(e,n,i,r,s,l){this.ctx.rect(i,r,s-i,l-r),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let n;if(e[0]==="TilingPattern"){const i=e[1],r=this.baseTransform||un(this.ctx),s={createCanvasGraphics:l=>new jc(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new x0(e,i,this.ctx,s,r)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,n,i){const r=Ke.makeHexColor(e,n,i);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,n,i){const r=Ke.makeHexColor(e,n,i);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e,n=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=hJ(this.getObject(e)),this.cachedPatterns.set(e,i)),n&&(i.matrix=n),i}shadingFill(e){if(!this.contentVisible)return;const n=this.ctx;this.save();const i=this._getPattern(e);n.fillStyle=i.getPattern(n,this,sa(n),wi.SHADING);const r=sa(n);if(r){const{width:s,height:l}=n.canvas,[u,d,f,p]=Ke.getAxialAlignedBoundingBox([0,0,s,l],r);this.ctx.fillRect(u,d,f-u,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Bt("Should not call beginInlineImage")}beginImageData(){Bt("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=un(this.ctx),n)){const i=n[2]-n[0],r=n[3]-n[1];this.ctx.rect(n[0],n[1],i,r),this.current.updateRectMinMax(un(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;
vendor: 4,107 bytes, line 748
748e.isolated||Gm("TODO: Support non-isolated groups."),e.knockout&&bt("Knockout groups not supported.");const i=un(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=Ke.getAxialAlignedBoundingBox(e.bbox,un(n));const s=[0,0,n.canvas.width,n.canvas.height];r=Ke.intersect(r,s)||[0,0,0,0];const l=Math.floor(r[0]),u=Math.floor(r[1]),d=Math.max(Math.ceil(r[2])-l,1),f=Math.max(Math.ceil(r[3])-u,1);this.current.startNewPathAndClipBox([0,0,d,f]);let p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(p,d,f),x=m.context;x.translate(-l,-u),x.transform(...i),e.smask?this.smaskStack.push({canvas:m.canvas,context:x,offsetX:l,offsetY:u,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(l,u),n.save()),pd(n,x),this.ctx=x,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const r=un(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...r);const s=Ke.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],r);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,n,i,r,s){if(this.#e(),rp(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const l=n[2]-n[0],u=n[3]-n[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=n[0],i[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=l,n[3]=u;const[d,f]=Ke.singularValueDecompose2dScale(un(this.ctx)),{viewportScale:p}=this,m=Math.ceil(l*this.outputScaleX*p),x=Math.ceil(u*this.outputScaleY*p);this.annotationCanvas=this.canvasFactory.create(m,x);const{canvas:b,context:w}=this.annotationCanvas;this.annotationCanvasMap.set(e,b),this.annotationCanvas.savedCtx=this.ctx,this.ctx=w,this.ctx.save(),this.ctx.setTransform(d,0,0,-f,0,u*f),rp(this.ctx)}else rp(this.ctx),this.ctx.rect(n[0],n[1],l,u),this.ctx.clip(),this.endPath()}this.current=new y2(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const n=e.count;e=this.getObject(e.data,e),e.count=n;const i=this.ctx,r=this.processingType3;if(r&&(r.compiled===void 0&&(r.compiled=xJ(e)),r.compiled)){r.compiled(i);return}const s=this._createMaskCanvas(e),l=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(l,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,i=0,r=0,s,l){if(!this.contentVisible)return;e=this.getObject(e.data,e);const u=this.ctx;u.save();const d=un(u);u.transform(n,i,r,s,0,0);const f=this._createMaskCanvas(e);u.setTransform(1,0,0,1,f.offsetX-d[4],f.offsetY-d[5]);for(let p=0,m=l.length;p<m;p+=2){const x=Ke.transform(d,[n,i,r,s,l[p],l[p+1]]),[b,w]=Ke.applyTransform([0,0],x);u.drawImage(f.canvas,b,w)}u.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const n=this.ctx,i=this.current.fillColor,r=this.current.patternFill;for(const s of e){const{data:l,width:u,height:d,transform:f}=s,p=this.cachedCanvases.getCanvas("maskCanvas",u,d),m=p.context;m.save();const x=this.getObject(l,s);S2(m,x),m.globalCompositeOperation="source-in",m.fillStyle=r?i.getPattern(m,this,sa(n),wi.FILL):i,m.fillRect(0,0,u,d),m.restore(),n.save(),n.transform(...f),n.scale(1,-1),ip(n,p.canvas,0,0,u,d,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){bt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(e,n,i,r){if(!this.contentVisible)return;const s=this.getObject(e);
748if(!s){bt("Dependent image isn't ready yet");return}const l=s.width,u=s.height,d=[];for(let f=0,p=r.length;f<p;f+=2)d.push({transform:[n,0,0,i,r[f],r[f+1]],x:0,y:0,w:l,h:u});this.paintInlineImageXObjectGroup(s,d)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:n,width:i,height:r}=e,s=this.cachedCanvases.getCanvas("inlineImage",i,r),l=s.context;return l.filter=this.current.transferMaps,l.drawImage(n,0,0),l.filter="none",s.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const n=e.width,i=e.height,r=this.ctx;if(this.save(),!pi){const{filter:u}=r;u!=="none"&&u!==""&&(r.filter="none")}r.scale(1/n,-1/i);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{const d=this.cachedCanvases.getCanvas("inlineImage",n,i).context;w2(d,e),s=this.applyTransferMapsToCanvas(d)}const l=this._scaleImage(s,sa(r));r.imageSmoothingEnabled=C2(un(r),e.interpolate),ip(r,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,n,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,n){if(!this.contentVisible)return;const i=this.ctx;let r;if(e.bitmap)r=e.bitmap;else{const s=e.width,l=e.height,d=this.cachedCanvases.getCanvas("inlineImage",s,l).context;w2(d,e),r=this.applyTransferMapsToCanvas(d)}for(const s of n)i.save(),i.transform(...s.transform),i.scale(1,-1),ip(i,r,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,n){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,n){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const i=this.ctx;this.pendingClip&&(n||(this.pendingClip===E2?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=un(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),i=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:i,c:r,d:s}=this.ctx.getTransform();let l,u;if(i===0&&r===0){const d=Math.abs(n),f=Math.abs(s);if(d===f)if(e===0)l=u=1/d;else{const p=d*e;l=u=p<1?1/p:1}else if(e===0)l=1/d,u=1/f;else{const p=d*e,m=f*e;l=p<1?1/p:1,u=m<1?1/m:1}}else{const d=Math.abs(n*s-i*r),f=Math.hypot(n,i),p=Math.hypot(r,s);if(e===0)l=p/d,u=f/d;else{const m=e*d;l=p>m?p/m:1,u=f>m?f/m:1}}this._cachedScaleForStroking[0]=l,this._cachedScaleForStroking[1]=u}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:n}=this,{lineWidth:i}=this.current,[r,s]=this.getScaleForStroking();if(n.lineWidth=i||1,r===1&&s===1){n.stroke();return}const l=n.getLineDash();if(e&&n.save(),n.scale(r,s),l.length>0){const u=Math.max(r,s);n.setLineDash(l.map(d=>d/u)),n.lineDashOffset/=u}n.stroke(),e&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in Ir)jc.prototype[t]!==void 0&&(jc.prototype[Ir[t]]=jc.prototype[t]);class Hd{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}const sp={DATA:1,ERROR:2},Pn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Wi(t){switch(t instanceof Error||typeof t=="object"&&t!==null||Bt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new yl(t.message);case"MissingPDFException":return new bl(t.message);case"PasswordException":return new Ay(t.message,t.code);case"UnexpectedResponseException":return new Vm(t.message,t.status);case"UnknownErrorException":return new ky(t.message,t.details);default:return new ky(t.message,t.toString())}}class wd{constructor(e,n,i){this.sourceName=e,this.targetName=n,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=r=>{const s=r.data;if(s.targetName!==this.sourceName)return;if(s.stream){this.#t(s);return}if(s.callback){const u=s.callbackId,d=this.callbackCapabilities[u];if(!d)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],s.callback===sp.DATA)d.resolve(s.data);else if(s.callback===sp.ERROR)d.reject(Wi(s.reason));else throw new Error("Unexpected callback case");return}const l=this.actionHandler[s.action];if(!l)throw new Error(`Unknown action from worker: ${s.action}`);if(s.callbackId){const u=this.sourceName,d=s.sourceName;new Promise(function(f){f(l(s.data))}).then(function(f){i.postMessage({sourceName:u,targetName:d,callback:sp.DATA,callbackId:s.callbackId,data:f})},function(f){i.postMessage({sourceName:u,targetName:d,callback:sp.ERROR,callbackId:s.callbackId,reason:Wi(f)})});return}if(s.streamId){this.#e(s);return}l(s.data)},i.addEventListener("message",this._onComObjOnMessage)}on(e,n){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);
748i[e]=n}send(e,n,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},i)}sendWithPromise(e,n,i){const r=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:n},i)}catch(l){s.reject(l)}return s.promise}sendWithStream(e,n,i,r){const s=this.streamId++,l=this.sourceName,u=this.targetName,d=this.comObj;return new ReadableStream({start:f=>{const p=Promise.withResolvers();return this.streamControllers[s]={controller:f,startCall:p,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:l,targetName:u,action:e,streamId:s,data:n,desiredSize:f.desiredSize},r),p.promise},pull:f=>{const p=Promise.withResolvers();return this.streamControllers[s].pullCall=p,d.postMessage({sourceName:l,targetName:u,stream:Pn.PULL,streamId:s,desiredSize:f.desiredSize}),p.promise},cancel:f=>{Gn(f instanceof Error,"cancel must have a valid reason");const p=Promise.withResolvers();return this.streamControllers[s].cancelCall=p,this.streamControllers[s].isClosed=!0,d.postMessage({sourceName:l,targetName:u,stream:Pn.CANCEL,streamId:s,reason:Wi(f)}),p.promise}},i)}#e(e){const n=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,l=this,u=this.actionHandler[e.action],d={enqueue(f,p=1,m){if(this.isCancelled)return;const x=this.desiredSize;this.desiredSize-=p,x>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:r,stream:Pn.ENQUEUE,streamId:n,chunk:f},m)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:Pn.CLOSE,streamId:n}),delete l.streamSinks[n])},error(f){Gn(f instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:Pn.ERROR,streamId:n,reason:Wi(f)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[n]=d,new Promise(function(f){f(u(e.data,d))}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Pn.START_COMPLETE,streamId:n,success:!0})},function(f){s.postMessage({sourceName:i,targetName:r,stream:Pn.START_COMPLETE,streamId:n,reason:Wi(f)})})}#t(e){const n=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,l=this.streamControllers[n],u=this.streamSinks[n];switch(e.stream){case Pn.START_COMPLETE:e.success?l.startCall.resolve():l.startCall.reject(Wi(e.reason));break;case Pn.PULL_COMPLETE:e.success?l.pullCall.resolve():l.pullCall.reject(Wi(e.reason));break;case Pn.PULL:if(!u){s.postMessage({sourceName:i,targetName:r,stream:Pn.PULL_COMPLETE,streamId:n,success:!0});break}u.desiredSize<=0&&e.desiredSize>0&&u.sinkCapability.resolve(),u.desiredSize=e.desiredSize,new Promise(function(d){d(u.onPull?.())}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Pn.PULL_COMPLETE,streamId:n,success:!0})},function(d){s.postMessage({sourceName:i,targetName:r,stream:Pn.PULL_COMPLETE,streamId:n,reason:Wi(d)})});break;case Pn.ENQUEUE:if(Gn(l,"enqueue should have stream controller"),l.isClosed)break;l.controller.enqueue(e.chunk);break;case Pn.CLOSE:if(Gn(l,"close should have stream controller"),l.isClosed)break;l.isClosed=!0,l.controller.close(),this.#n(l,n);break;case Pn.ERROR:Gn(l,"error should have stream controller"),l.controller.error(Wi(e.reason)),this.#n(l,n);break;case Pn.CANCEL_COMPLETE:e.success?l.cancelCall.resolve():l.cancelCall.reject(Wi(e.reason)),this.#n(l,n);break;case Pn.CANCEL:if(!u)break;new Promise(function(d){d(u.onCancel?.(Wi(e.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Pn.CANCEL_COMPLETE,streamId:n,success:!0})},function(d){s.postMessage({sourceName:i,targetName:r,stream:Pn.CANCEL_COMPLETE,streamId:n,reason:Wi(d)})}),u.sinkCapability.reject(Wi(e.reason)),u.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async#n(e,n){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[n]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}class wJ{#e;#t;constructor({parsedData:e,rawData:n}){this.#e=e,this.#t=n}
748getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return a0(this.#e)}has(e){return this.#e.has(e)}}const Ja=Symbol("INTERNAL");class SJ{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:n,intent:i,usage:r}){this.#e=!!(e&mr.DISPLAY),this.#t=!!(e&mr.PRINT),this.name=n,this.intent=i,this.usage=r}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:e,view:n}=this.usage;return this.#e?n?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,n,i=!1){e!==Ja&&Bt("Internal method `_setVisible` called."),this.#n=i,this.#r=n}}class CJ{#e=null;#t=new Map;#n=null;#r=null;constructor(e,n=mr.DISPLAY){if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(const i of e.groups)this.#t.set(i.id,new SJ(n,i));if(e.baseState==="OFF")for(const i of this.#t.values())i._setVisible(Ja,!1);for(const i of e.on)this.#t.get(i)._setVisible(Ja,!0);for(const i of e.off)this.#t.get(i)._setVisible(Ja,!1);this.#n=this.getHash()}}#a(e){const n=e.length;if(n<2)return!0;const i=e[0];for(let r=1;r<n;r++){const s=e[r];let l;if(Array.isArray(s))l=this.#a(s);else if(this.#t.has(s))l=this.#t.get(s).visible;else return bt(`Optional content group not found: ${s}`),!0;switch(i){case"And":if(!l)return!1;break;case"Or":if(l)return!0;break;case"Not":return!l;default:return!0}}return i==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return Gm("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(bt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#a(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!this.#t.has(n))return bt(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!this.#t.has(n))return bt(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!this.#t.has(n))return bt(`Optional content group not found: ${n}`),!0;if(!this.#t.get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!this.#t.has(n))return bt(`Optional content group not found: ${n}`),!0;if(this.#t.get(n).visible)return!1}return!0}return bt(`Unknown optional content policy ${e.policy}.`),!0}return bt(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0){const i=this.#t.get(e);if(!i){bt(`Optional content group not found: ${e}`);return}i._setVisible(Ja,!!n,!0),this.#e=null}setOCGState({state:e,preserveRB:n}){let i;for(const r of e){switch(r){case"ON":case"OFF":case"Toggle":i=r;continue}const s=this.#t.get(r);if(s)switch(i){case"ON":s._setVisible(Ja,!0);break;case"OFF":s._setVisible(Ja,!1);break;case"Toggle":s._setVisible(Ja,!s.visible);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?a0(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new PP;for(const[n,i]of this.#t)e.update(`${n}:${i.visible}`);return this.#e=e.hexdigest()}}class EJ{constructor(e,{disableRange:n=!1,disableStream:i=!1}){Gn(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:r,initialData:s,progressiveDone:l,contentDispositionFilename:u}=e;if(this._queuedChunks=[],this._progressiveDone=l,this._contentDispositionFilename=u,s?.length>0){const d=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(d)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!n,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((d,f)=>{this._onReceiveData({begin:d,chunk:f})}),e.addProgressListener((d,f)=>{this._onProgress({loaded:d,total:f})}),e.addProgressiveReadListener(d=>{this._onReceiveData({chunk:d})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:n}){const i=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const r=this._rangeReaders.some(function(s){return s._begin!==e?!1:(s._enqueue(i),!0)});Gn(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){Gn(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new AJ(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const i=new kJ(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}}class AJ{constructor(e,n,i=!1,r=null){this._stream=e,this._done=i||!1,this._filename=d0(r)?r:null,this._queuedChunks=n||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;
748this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class kJ{constructor(e,n,i){this._stream=e,this._begin=n,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function NJ(t){let e=!0,n=i("filename\\*","i").exec(t);if(n){n=n[1];let p=u(n);return p=unescape(p),p=d(p),p=f(p),s(p)}if(n=l(t),n){const p=f(n);return s(p)}if(n=i("filename","i").exec(t),n){n=n[1];let p=u(n);return p=f(p),s(p)}function i(p,m){return new RegExp("(?:^|;)\\s*"+p+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',m)}function r(p,m){if(p){if(!/^[\x00-\xFF]+$/.test(m))return m;try{const x=new TextDecoder(p,{fatal:!0}),b=qm(m);m=x.decode(b),e=!1}catch{}}return m}function s(p){return e&&/[\x80-\xff]/.test(p)&&(p=r("utf-8",p),e&&(p=r("iso-8859-1",p))),p}function l(p){const m=[];let x;const b=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(x=b.exec(p))!==null;){let[,C,A,E]=x;if(C=parseInt(C,10),C in m){if(C===0)break;continue}m[C]=[A,E]}const w=[];for(let C=0;C<m.length&&C in m;++C){let[A,E]=m[C];E=u(E),A&&(E=unescape(E),C===0&&(E=d(E))),w.push(E)}return w.join("")}function u(p){if(p.startsWith('"')){const m=p.slice(1).split('\\"');for(let x=0;x<m.length;++x){const b=m[x].indexOf('"');b!==-1&&(m[x]=m[x].slice(0,b),m.length=x+1),m[x]=m[x].replaceAll(/\\(.)/g,"$1")}p=m.join('"')}return p}function d(p){const m=p.indexOf("'");if(m===-1)return p;const x=p.slice(0,m),w=p.slice(m+1).replace(/^[^']*'/,"");return r(x,w)}function f(p){return!p.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(p)?p:p.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(m,x,b,w){if(b==="q"||b==="Q")return w=w.replaceAll("_"," "),w=w.replaceAll(/=([0-9a-fA-F]{2})/g,function(C,A){return String.fromCharCode(parseInt(A,16))}),r(x,w);try{w=atob(w)}catch{}return r(x,w)})}return""}function v0({getResponseHeader:t,isHttp:e,rangeChunkSize:n,disableRange:i}){const r={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return!Number.isInteger(s)||(r.suggestedLength=s,s<=2*n)||i||!e||t("Accept-Ranges")!=="bytes"||(t("Content-Encoding")||"identity")!=="identity"||(r.allowRangeRequests=!0),r}function b0(t){const e=t("Content-Disposition");if(e){let n=NJ(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(d0(n))return n}return null}function Zm(t,e){return t===404||t===0&&e.startsWith("file:")?new bl('Missing PDF "'+e+'".'):new Vm(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function OP(t){return t===200||t===206}function MP(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function IP(t){const e=new Headers;for(const n in t){const i=t[n];i!==void 0&&e.append(n,i)}return e}function zP(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(bt(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class A2{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Gn(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new jJ(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const i=new _J(this,e,n);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class jJ{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const n=e.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._headers=IP(this._stream.httpHeaders);const i=n.url;fetch(i,MP(this._headers,this._withCredentials,this._abortController)).then(r=>{if(!OP(r.status))throw Zm(r.status,i);this._reader=r.body.getReader(),this._headersCapability.resolve();const s=d=>r.headers.get(d),{allowRangeRequests:l,suggestedLength:u}=v0({getResponseHeader:s,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=l,this._contentLength=u||this._contentLength,this._filename=b0(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new yl("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:zP(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class _J{constructor(e,n,i){this._stream=e,this._reader=null,this._loaded=0;const r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController,this._headers=IP(this._stream.httpHeaders),this._headers.append("Range",`bytes=${n}-${i-1}`);const s=r.url;fetch(s,MP(this._headers,this._withCredentials,this._abortController)).then(l=>{if(!OP(l.status))throw Zm(l.status,s);this._readCapability.resolve(),this._reader=l.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:zP(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const vb=200,bb=206;function TJ(t){const e=t.response;return typeof e!="string"?e:qm(e).buffer}class RJ{constructor(e,n={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&n.httpHeaders||Object.create(null),this.withCredentials=n.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,n,i){const r={begin:e,end:n};for(const s in i)r[s]=i[s];return this.request(r)}requestFull(e){return this.request(e)}request(e){const n=new XMLHttpRequest,i=this.currXhrId++,r=this.pendingRequests[i]={xhr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const l=this.httpHeaders[s];l!==void 0&&n.setRequestHeader(s,l)}return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=bb):r.expectedStatus=vb,n.responseType="arraybuffer",e.onError&&(n.onerror=function(s){e.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,i),n.onprogress=this.onProgress.bind(this,i),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,n.send(null),i}onProgress(e,n){const i=this.pendingRequests[e];i&&i.onProgress?.(n)}onStateChange(e,n){const i=this.pendingRequests[e];if(!i)return;const r=i.xhr;if(r.readyState>
748=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),r.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],r.status===0&&this.isHttp){i.onError?.(r.status);return}const s=r.status||vb;if(!(s===vb&&i.expectedStatus===bb)&&s!==i.expectedStatus){i.onError?.(r.status);return}const u=TJ(r);if(s===bb){const d=r.getResponseHeader("Content-Range"),f=/bytes (\d+)-(\d+)\/(\d+)/.exec(d);i.onDone({begin:parseInt(f[1],10),chunk:u})}else u?i.onDone({begin:0,chunk:u}):i.onError?.(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const n=this.pendingRequests[e].xhr;delete this.pendingRequests[e],n.abort()}}class PJ{constructor(e){this._source=e,this._manager=new RJ(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const n=this._rangeRequestReaders.indexOf(e);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return Gn(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new DJ(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const i=new LJ(this._manager,e,n);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class DJ{constructor(e,n){this._manager=e;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=e.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,n=this._manager.getRequestXhr(e),i=l=>n.getResponseHeader(l),{allowRangeRequests:r,suggestedLength:s}=v0({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=b0(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Zm(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class LJ{constructor(e,n,i){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(n,i,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const n=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=Zm(e,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
748(this._requestId),this._close()}}const FP=/^file:\/\/\/[a-zA-Z]:\//;function OJ(t){const e=ks.get("url"),n=e.parse(t);return n.protocol==="file:"||n.host?n:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(n.host||(n.protocol="file:"),n)}class MJ{constructor(e){this.source=e,this.url=OJ(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Gn(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new FJ(this):new IJ(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const i=this.isFsUrl?new $J(this,e,n):new zJ(this,e,n);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class $P{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new yl("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class UP{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=e.source;this._isStreamingSupported=!n.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function rm(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class IJ extends $P{constructor(e){super(e);const n=i=>{if(i.statusCode===404){const u=new bl(`Missing PDF "${this._url}".`);this._storedError=u,this._headersCapability.reject(u);return}this._headersCapability.resolve(),this._setReadableStream(i);const r=u=>this._readableStream.headers[u.toLowerCase()],{allowRangeRequests:s,suggestedLength:l}=v0({getResponseHeader:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=l||this._contentLength,this._filename=b0(r)};if(this._request=null,this._url.protocol==="http:"){const i=ks.get("http");this._request=i.request(rm(this._url,e.httpHeaders),n)}else{const i=ks.get("https");this._request=i.request(rm(this._url,e.httpHeaders),n)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class zJ extends UP{constructor(e,n,i){super(e),this._httpHeaders={};for(const s in e.httpHeaders){const l=e.httpHeaders[s];l!==void 0&&(this._httpHeaders[s]=l)}this._httpHeaders.Range=`bytes=${n}-${i-1}`;const r=s=>{if(s.statusCode===404){const l=new bl(`Missing PDF "${this._url}".`);this._storedError=l;return}this._setReadableStream(s)};if(this._request=null,this._url.protocol==="http:"){const s=ks.get("http");this._request=s.request(rm(this._url,this._httpHeaders),r)}else{const s=ks.get("https");this._request=s.request(rm(this._url,this._httpHeaders),r)}this._request.on("error",s=>{this._storedError=s}),this._request.end()}}class FJ extends $P{constructor(e){super(e);let n=decodeURIComponent(this._url.path);FP.test(this._url.href)&&(n=n.replace(/^\//,""));const i=ks.get("fs");i.promises.lstat(n).then(r=>{this._contentLength=r.size,this._setReadableStream(i.createReadStream(n)),this._headersCapability.resolve()},r=>{r.code==="ENOENT"&&(r=new bl(`Missing PDF "${n}".`)),this._storedError=r,this._headersCapability.reject(r)})}}class $J extends UP{constructor(e,n,i){super(e);let r=decodeURIComponent(this._url.path);FP.test(this._url.href)&&(r=r.replace(/^\//,""));const s=ks.get("fs");this._setReadableStream(s.createReadStream(r,{start:n,end:i-1}))}}const UJ=1e5,Di=30,BJ=.8;let sm=class wc{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#a=null;#i=null;#s=0;#c=0;#l=null;#d=null;#f=0;#u=0;#o=Object.create(null);#p=[];#m=null;#h=[];#v=new WeakMap;#g=null;static#b=new Map;static#w=new Map;static#E=new Set;constructor({textContentSource:e,container:n,viewport:i}){if(e instanceof ReadableStream)this.#m=e;else if(typeof e=="object")this.#m=new ReadableStream({start(d){d.enqueue(e),d.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#d=n,this.#u=i.scale*(globalThis.devicePixelRatio||1),this.#f=i.rotation,this.#i={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null};const{pageWidth:r,pageHeight:s,pageX:l,pageY:u}=i.rawDims;this.#g=[1,0,0,-1,-l,u+s],this.#c=r,this.#s=s,cl(n,i),this.#e.promise.catch(()=>{}).then(()=>{wc.#E.delete(this),this.#i=null,this.#o=null})}render(){const e=()=>{this.#l.read().then(({value:n,done:i})=>{if(i){this.#e.resolve();return}this.#a??=n.lang,Object.assign(this.#o,n.styles),this.#A(n.items),e()},this.#e.reject)};return this.#l=this.#m.getReader(),wc.#E.add(this),e(),this.#e.promise}update({viewport:e,onBefore:n=null}){const i=e.scale*(globalThis.devicePixelRatio||1),r=e.rotation;if(r!==this.#f&&(n?.(),this.#f=r,cl(this.#d,{rotation:r})),i!==this.#u){n?.(),this.#u=i;const s={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:wc.#y(this.#a)};for(const l of this.#h)s.properties=this.#v.get(l),s.div=l,this.#k(s)}}cancel(){const e=new yl("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#h}get textContentItemsStr(){return this.#p}#A(e){if(this.#n)return;this.#i.ctx||=wc.#y(this.#a);const n=this.#h,i=this.#p;for(const r of e){if(n.length>UJ){bt("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(r.str===void 0){if(r.type==="beginMarkedContentProps"||r.type==="beginMarkedContent"){const s=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),r.id!==null&&this.#t.setAttribute("id",`${r.id}`),s.append(this.#t)}else r.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(r.str),this.#j(r)}}#j(e){const n=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#h.push(n);const r=Ke.transform(this.#g,e.transform);let s=Math.atan2(r[1],r[0]);const l=this.#o[e.fontName];l.vertical&&(s+=Math.PI/2);const u=this.#r&&l.fontSubstitution||l.fontFamily,d=Math.hypot(r[2],r[3]),f=d*wc.#x(u,this.#a);let p,m;s===0?(p=r[4],m=r[5]-f):(p=r[4]+f*Math.sin(s),m=r[5]-f*Math.cos(s));const x="calc(var(--scale-factor)*",b=n.style;this.#t===this.#d?(b.left=`${(100*p/this.#c).toFixed(2)}%`,b.top=`${(100*m/this.#s).toFixed(2)}%`):(b.left=`${x}${p.toFixed(2)}px)`,b.top=`${x}${m.toFixed(2)}px)`),b.fontSize=`${x}${d.toFixed(2)}px)`,b.fontFamily=u,i.fontSize=d,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,this.#r&&(n.dataset.fontName=l.fontSubstitutionLoadedName||e.fontName),s!==0&&(i.angle=s*(180/Math.PI));let w=!1;if(e.str.length>1)w=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const C=Math.abs(e.transform[0]),A=Math.abs(e.transform[3]);C!==A&&Math.max(C,A)/Math.min(C,A)>1.5&&(w=!0)}
748if(w&&(i.canvasWidth=l.vertical?e.height:e.width),this.#v.set(n,i),this.#i.div=n,this.#i.properties=i,this.#k(this.#i),i.hasText&&this.#t.append(n),i.hasEOL){const C=document.createElement("br");C.setAttribute("role","presentation"),this.#t.append(C)}}#k(e){const{div:n,properties:i,ctx:r,prevFontSize:s,prevFontFamily:l}=e,{style:u}=n;let d="";if(i.canvasWidth!==0&&i.hasText){const{fontFamily:f}=u,{canvasWidth:p,fontSize:m}=i;(s!==m||l!==f)&&(r.font=`${m*this.#u}px ${f}`,e.prevFontSize=m,e.prevFontFamily=f);const{width:x}=r.measureText(n.textContent);x>0&&(d=`scaleX(${p*this.#u/x})`)}i.angle!==0&&(d=`rotate(${i.angle}deg) ${d}`),d.length>0&&(u.transform=d)}static cleanup(){if(!(this.#E.size>0)){this.#b.clear();for(const{canvas:e}of this.#w.values())e.remove();this.#w.clear()}}static#y(e=null){let n=this.#w.get(e||="");if(!n){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),n=i.getContext("2d",{alpha:!1}),this.#w.set(e,n)}return n}static#x(e,n){const i=this.#b.get(e);if(i)return i;const r=this.#y(n),s=r.font;r.canvas.width=r.canvas.height=Di,r.font=`${Di}px ${e}`;const l=r.measureText("");let u=l.fontBoundingBoxAscent,d=Math.abs(l.fontBoundingBoxDescent);if(u){const m=u/(u+d);return this.#b.set(e,m),r.canvas.width=r.canvas.height=0,r.font=s,m}r.strokeStyle="red",r.clearRect(0,0,Di,Di),r.strokeText("g",0,0);let f=r.getImageData(0,0,Di,Di).data;d=0;for(let m=f.length-1-3;m>=0;m-=4)if(f[m]>0){d=Math.ceil(m/4/Di);break}r.clearRect(0,0,Di,Di),r.strokeText("A",0,Di),f=r.getImageData(0,0,Di,Di).data,u=0;for(let m=0,x=f.length;m<x;m+=4)if(f[m]>0){u=Di-Math.floor(m/4/Di);break}r.canvas.width=r.canvas.height=0,r.font=s;const p=u?u/(u+d):BJ;return this.#b.set(e,p),p}};function HJ(){TP("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:t,container:e,viewport:n,...i}=arguments[0],r=Object.keys(i);r.length>0&&bt("Ignoring `renderTextLayer` parameters: "+r.join(", "));const s=new sm({textContentSource:t,container:e,viewport:n}),{textDivs:l,textContentItemsStr:u}=s;return{promise:s.render(),textDivs:l,textContentItemsStr:u}}function GJ(){TP("`updateTextLayer`, please use `TextLayer` instead.")}class Gd{static textContent(e){const n=[],i={items:n,styles:Object.create(null)};function r(s){if(!s)return;let l=null;const u=s.name;if(u==="#text")l=s.value;else if(Gd.shouldBuildText(u))s?.attributes?.textContent?l=s.attributes.textContent:s.value&&(l=s.value);else return;if(l!==null&&n.push({str:l}),!!s.children)for(const d of s.children)r(d)}return r(e),i}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const VJ=65536,qJ=100,KJ=5e3,WJ=pi?sJ:qZ,YJ=pi?aJ:jP,XJ=pi?rJ:VZ,QJ=pi?oJ:_P;function ZJ(t){if(typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t}),typeof t!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new y0,{docId:n}=e,i=t.url?JJ(t.url):null,r=t.data?eee(t.data):null,s=t.httpHeaders||null,l=t.withCredentials===!0,u=t.password??null,d=t.range instanceof BP?t.range:null,f=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:VJ;let p=t.worker instanceof xr?t.worker:null;const m=t.verbosity,x=typeof t.docBaseUrl=="string"&&!u0(t.docBaseUrl)?t.docBaseUrl:null,b=typeof t.cMapUrl=="string"?t.cMapUrl:null,w=t.cMapPacked!==!1,C=t.CMapReaderFactory||YJ,A=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,E=t.StandardFontDataFactory||QJ,k=t.stopAtErrors!==!0,N=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=t.isEvalSupported!==!1,R=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!pi,T=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,L=typeof t.disableFontFace=="boolean"?t.disableFontFace:pi,M=t.fontExtraProperties===!0,U=t.enableXfa===!0,D=t.ownerDocument||globalThis.document,G=t.disableRange===!0,Z=t.disableStream===!0,Q=t.disableAutoFetch===!0,K=t.pdfBug
748===!0,q=d?d.length:t.length??NaN,F=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!pi&&!L,V=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:C===jP&&E===_P&&b&&A&&yd(b,document.baseURI)&&yd(A,document.baseURI),O=t.canvasFactory||new WJ({ownerDocument:D}),X=t.filterFactory||new XJ({docId:n,ownerDocument:D}),$=null;LZ(m);const B={canvasFactory:O,filterFactory:X};if(V||(B.cMapReaderFactory=new C({baseUrl:b,isCompressed:w}),B.standardFontDataFactory=new E({baseUrl:A})),!p){const J={verbosity:m,port:Hd.workerPort};p=J.port?xr.fromPort(J):new xr(J),e._worker=p}const H={docId:n,apiVersion:"4.3.136",data:r,password:u,disableAutoFetch:Q,rangeChunkSize:f,length:q,docBaseUrl:x,enableXfa:U,evaluatorOptions:{maxImageSize:N,disableFontFace:L,ignoreErrors:k,isEvalSupported:_,isOffscreenCanvasSupported:R,canvasMaxAreaInBytes:T,fontExtraProperties:M,useSystemFonts:F,cMapUrl:V?b:null,standardFontDataUrl:V?A:null}},P={disableFontFace:L,fontExtraProperties:M,ownerDocument:D,pdfBug:K,styleElement:$,loadingParams:{disableAutoFetch:Q,enableXfa:U}};return p.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(p.destroyed)throw new Error("Worker was destroyed");const J=p.messageHandler.sendWithPromise("GetDocRequest",H,r?[r.buffer]:null);let he;return d?he=new EJ(d,{disableRange:G,disableStream:Z}):r||(he=(W=>pi?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&yd(W.url)?new A2(W):new MJ(W):yd(W.url)?new A2(W):new PJ(W))({url:i,length:q,httpHeaders:s,withCredentials:l,rangeChunkSize:f,disableRange:G,disableStream:Z})),J.then(ue=>{if(e.destroyed)throw new Error("Loading aborted");if(p.destroyed)throw new Error("Worker was destroyed");const W=new wd(n,ue,p.port),fe=new ree(W,e,he,P,B);e._transport=fe,W.send("Ready",null)})}).catch(e._capability.reject),e}function JJ(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(pi&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function eee(t){if(pi&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return qm(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function k2(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class y0{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${y0.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}let BP=class{constructor(e,n,i=!1,r=null){this.length=e,this.initialData=n,this.progressiveDone=i,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const i of this._rangeListeners)i(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){Bt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class tee{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Rt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
748getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(n)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class nee{#e=null;#t=!1;constructor(e,n,i,r=!1){this._pageIndex=e,this._pageInfo=n,this._transport=i,this._stats=r?new h2:null,this._pdfBug=r,this.commonObjs=i.commonObjs,this.objs=new HP,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:n=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}={}){return new ch({viewBox:this.view,scale:e,rotation:n,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Rt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:n,intent:i="display",annotationMode:r=io.ENABLE,transform:s=null,background:l=null,optionalContentConfigPromise:u=null,annotationCanvasMap:d=null,pageColors:f=null,printAnnotationStorage:p=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,r,p),{renderingIntent:x,cacheKey:b}=m;this.#t=!1,this.#r(),u||=this._transport.getOptionalContentConfig(x);let w=this._intentStates.get(b);w||(w=Object.create(null),this._intentStates.set(b,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const C=!!(x&mr.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const A=N=>{w.renderTasks.delete(E),(this._maybeCleanupAfterRender||C)&&(this.#t=!0),this.#n(!C),N?(E.capability.reject(N),this._abortOperatorList({intentState:w,reason:N instanceof Error?N:new Error(N)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},E=new Sc({callback:A,params:{canvasContext:e,viewport:n,transform:s,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!C,pdfBug:this._pdfBug,page
748Colors:f});(w.renderTasks||=new Set).add(E);const k=E.task;return Promise.all([w.displayReadyCapability.promise,u]).then(([N,_])=>{if(this.destroyed){A();return}if(this._stats?.time("Rendering"),!(_.renderingIntent&x))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:N,optionalContentConfig:_}),E.operatorListChanged()}).catch(A),k}getOperatorList({intent:e="display",annotationMode:n=io.ENABLE,printAnnotationStorage:i=null}={}){function r(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(u))}const s=this._transport.getRenderingIntent(e,n,i,!0);let l=this._intentStates.get(s.cacheKey);l||(l=Object.create(null),this._intentStates.set(s.cacheKey,l));let u;return l.opListReadCapability||(u=Object.create(null),u.operatorListChanged=r,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||=new Set).add(u),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),l.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Gd.textContent(i));const n=this.streamTextContent(e);return new Promise(function(i,r){function s(){l.read().then(function({value:d,done:f}){if(f){i(u);return}u.lang??=d.lang,Object.assign(u.styles,d.styles),u.items.push(...d.items),s()},r)}const l=n.getReader(),u={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const n of this._intentStates.values())if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!n.opListReadCapability)for(const i of n.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#t=!0;const n=this.#n(!1);return e&&n&&(this._stats&&=new h2),n}#n(e=!1){if(this.#r(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#n(!1)},KJ),!1;for(const{renderTasks:n,operatorList:i}of this._intentStates.values())if(n.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#r(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(e,n){const i=this._intentStates.get(n);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(e))}_renderPageChunk(e,n){for(let i=0,r=e.length;i<r;i++)n.operatorList.fnArray.push(e.fnArray[i]),n.operatorList.argsArray.push(e.argsArray[i]);n.operatorList.lastChunk=e.lastChunk,n.operatorList.separateAnnots=e.separateAnnots;for(const i of n.renderTasks)i.operatorListChanged();e.lastChunk&&this.#n(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:i}){const{map:r,transfer:s}=i,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:r},s).getReader(),d=this._intentStates.get(n);d.streamReader=u;const f=()=>{u.read().then(({value:p,done:m})=>{if(m){d.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(p,d),f())},p=>{if(d.streamReader=null,!this._transport.destroyed){if(d.operatorList){d.operatorList.lastChunk=!0;for(const m of d.renderTasks)m.operatorListChanged();this.#n(!0)}if(d.displayReadyCapability)d.displayReadyCapability.reject(p);else if(d.opListReadCapability)d.opListReadCapability.reject(p);else throw p}})};f()}_abortOperatorList({intentState:e,reason:n,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(n instanceof c0){let r=qJ;n.extraDelay>0&&n.extraDelay<1e3&&(r+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},r);return}}if(e.streamReader.cancel(new yl(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[r,s]of this._intentStates)if(s===e){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}
748class iee{#e=new Set;#t=Promise.resolve();postMessage(e,n){const i={data:structuredClone(e,n?{transfer:n}:null)};this.#t.then(()=>{for(const r of this.#e)r.call(this,i)})}addEventListener(e,n){this.#e.add(n)}removeEventListener(e,n){this.#e.delete(n)}terminate(){this.#e.clear()}}const ua={isWorkerDisabled:!1,fakeWorkerId:0};pi&&(ua.isWorkerDisabled=!0,Hd.workerSrc||="./pdf.worker.mjs"),ua.isSameOrigin=function(t,e){let n;try{if(n=new URL(t),!n.origin||n.origin==="null")return!1}catch{return!1}const i=new URL(e,n);return n.origin===i.origin},ua.createCDNWrapper=function(t){const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};class xr{static#e;constructor({name:e=null,port:n=null,verbosity:i=OZ()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if(xr.#e?.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(xr.#e||=new WeakMap).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return pi?Promise.all([ks.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new wd("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!ua.isWorkerDisabled&&!xr.#t){let{workerSrc:e}=xr;try{ua.isSameOrigin(window.location.href,e)||(e=ua.createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),i=new wd("main","worker",n),r=()=>{n.removeEventListener("error",s),i.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||r()};n.addEventListener("error",s),i.on("test",u=>{if(n.removeEventListener("error",s),this.destroyed){r();return}u?(this._messageHandler=i,this._port=n,this._webWorker=n,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),n.terminate())}),i.on("ready",u=>{if(n.removeEventListener("error",s),this.destroyed){r();return}try{l()}catch{this._setupFakeWorker()}});const l=()=>{const u=new Uint8Array;i.send("test",u,[u.buffer])};l();return}catch{Gm("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){ua.isWorkerDisabled||(bt("Setting up fake worker."),ua.isWorkerDisabled=!0),xr._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new iee;this._port=n;const i=`fake${ua.fakeWorkerId++}`,r=new wd(i+"_worker",i,n);e.setup(r,n);const s=new wd(i,i+"_worker",n);this._messageHandler=s,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),xr.#e?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=this.#e?.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new xr(e)}static get workerSrc(){if(Hd.workerSrc)return Hd.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#t(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return Rt(this,"_setupFakeWorkerGlobal",(async()=>this.#t?this.#t:(await import(this.workerSrc)).WorkerMessageHandler)())}}class ree{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#a=null;constructor(e,n,i,r,s){this.messageHandler=e,this.loadingTask=n,this.commonObjs=new HP,this.fontLoader=new nJ({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#i(e,n=null){const i=this.#e.get(e);if(i)return i;
748const r=this.messageHandler.sendWithPromise(e,n);return this.#e.set(e,r),r}get annotationStorage(){return Rt(this,"annotationStorage",new g0)}getRenderingIntent(e,n=io.ENABLE,i=null,r=!1){let s=mr.DISPLAY,l=Ny;switch(e){case"any":s=mr.ANY;break;case"display":break;case"print":s=mr.PRINT;break;default:bt(`getRenderingIntent - invalid intent: ${e}`)}switch(n){case io.DISABLE:s+=mr.ANNOTATIONS_DISABLE;break;case io.ENABLE:break;case io.ENABLE_FORMS:s+=mr.ANNOTATIONS_FORMS;break;case io.ENABLE_STORAGE:s+=mr.ANNOTATIONS_STORAGE,l=(s&mr.PRINT&&i instanceof DP?i:this.annotationStorage).serializable;break;default:bt(`getRenderingIntent - invalid annotationMode: ${n}`)}return r&&(s+=mr.OPLIST),{renderingIntent:s,cacheKey:`${s}_${l.hash}`,annotationStorageSerializable:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#a?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const i of this.#t.values())e.push(i._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),sm.cleanup(),this._networkStream?.cancelAllRequests(new yl("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(i,r)=>{Gn(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},r.onPull=()=>{this._fullReader.read().then(function({value:s,done:l}){if(l){r.close();return}Gn(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{r.error(s)})},r.onCancel=s=>{this._fullReader.cancel(s),r.ready.catch(l=>{if(!this.destroyed)throw l})}}),e.on("ReaderHeadersReady",i=>{const r=Promise.withResolvers(),s=this._fullReader;return s.headersReady.then(()=>{(!s.isStreamingSupported||!s.isRangeSupported)&&(this._lastProgress&&n.onProgress?.(this._lastProgress),s.onProgress=l=>{n.onProgress?.({loaded:l.loaded,total:l.total})}),r.resolve({isStreamingSupported:s.isStreamingSupported,isRangeSupported:s.isRangeSupported,contentLength:s.contentLength})},r.reject),r.promise}),e.on("GetRangeReader",(i,r)=>{Gn(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(i.begin,i.end);if(!s){r.close();return}r.onPull=()=>{s.read().then(function({value:l,done:u}){if(u){r.close();return}Gn(l instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{r.error(l)})},r.onCancel=l=>{s.cancel(l),r.ready.catch(u=>{if(!this.destroyed)throw u})}}),e.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,n._capability.resolve(new tee(i,this))}),e.on("DocException",function(i){let r;switch(i.name){case"PasswordException":r=new Ay(i.message,i.code);break;case"InvalidPDFException":r=new AP(i.message);break;case"MissingPDFException":r=new bl(i.message);break;case"UnexpectedResponseException":r=new Vm(i.message,i.status);break;case"UnknownErrorException":r=new ky(i.message,i.details);break;default:Bt("DocException - expected a valid Error.")}n._capability.reject(r)}),e.on("PasswordRequest",i=>{if(this.#a=Promise.withResolvers(),n.onPassword){const r=s=>{s instanceof Error?this.#a.reject(s):this.#a.resolve({password:s})};try{n.onPassword(r,i.code)}catch(s){this.#a.reject(s)}}else this.#a.reject(new Ay(i.message,i.code));return this.#a.promise}),e.on("DataLoaded",i=>{n.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),e.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),e.on("commonobj",([i,r,s])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(r){case"Font":const{disableFontFace:l,fontExtraProperties:u,pdfBug:d}=this._params;if("error"in s){const x=s.error;bt(`Error during font loading: ${x}`),this.commonObjs.resolve(i,x);break}const f=d&&globalThis.FontInspector?.enabled?(x,b)=>globalThis.FontInspector.fontAdded(x,b):null,p=new iJ(s,{disableFontFace:l,inspectFont:f});this.fontLoader.bind(p).catch(()=>
748e.sendWithPromise("FontFallback",{id:i})).finally(()=>{!u&&p.data&&(p.data=null),this.commonObjs.resolve(i,p)});break;case"CopyLocalImage":const{imageRef:m}=s;Gn(m,"The imageRef must be defined.");for(const x of this.#t.values())for(const[,b]of x.objs)if(b?.ref===m)return b.dataLen?(this.commonObjs.resolve(i,structuredClone(b)),b.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),e.on("obj",([i,r,s,l])=>{if(this.destroyed)return;const u=this.#t.get(r);if(!u.objs.has(i)){if(u._intentStates.size===0){l?.bitmap?.close();return}switch(s){case"Image":u.objs.resolve(i,l),l?.dataLen>TZ&&(u._maybeCleanupAfterRender=!0);break;case"Pattern":u.objs.resolve(i,l);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",i=>{this.destroyed||n.onProgress?.({loaded:i.loaded,total:i.total})}),e.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&bt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=e-1,i=this.#n.get(n);if(i)return i;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&this.#r.set(s.refStr,e);const l=new nee(n,s,this,this._params.pdfBug);return this.#t.set(n,l),l});return this.#n.set(n,r),r}getPageIndex(e){return k2(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#i("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#i("GetOptionalContentConfig").then(n=>new CJ(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=this.#e.get(e);if(n)return n;
748const i=this.messageHandler.sendWithPromise(e,null).then(r=>({info:r[0],metadata:r[1]?new wJ(r[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of this.#t.values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),sm.cleanup()}}cachedPageNumber(e){if(!k2(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(n)??null}}const ap=Symbol("INITIAL_DATA");class HP{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:ap}}get(e,n=null){if(n){const r=this.#t(e);return r.promise.then(()=>n(r.data)),null}const i=this.#e[e];if(!i||i.data===ap)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const n=this.#e[e];return!!n&&n.data!==ap}resolve(e,n=null){const i=this.#t(e);i.data=n,i.resolve()}clear(){for(const e in this.#e){const{data:n}=this.#e[e];n?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:n}=this.#e[e];n!==ap&&(yield[e,n])}}}class see{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:n}=this.#e;return e.form||e.canvas&&n?.size>0}}class Sc{static#e=new WeakSet;constructor({callback:e,params:n,objs:i,commonObjs:r,annotationCanvasMap:s,operatorList:l,pageIndex:u,canvasFactory:d,filterFactory:f,useRequestAnimationFrame:p=!1,pdfBug:m=!1,pageColors:x=null}){this.callback=e,this.params=n,this.objs=i,this.commonObjs=r,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=l,this._pageIndex=u,this.canvasFactory=d,this.filterFactory=f,this._pdfBug=m,this.pageColors=x,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=p===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new see(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(Sc.#e.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Sc.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:r,transform:s,background:l}=this.params;this.gfx=new jc(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:r,transparency:e,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),Sc.#e.delete(this._canvas),this.callback(e||new c0(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}
748):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Sc.#e.delete(this._canvas),this.callback())))}}const aee="4.3.136",oee="0cec64437";function N2(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function md(t){return Math.max(0,Math.min(255,255*t))}class j2{static CMYK_G([e,n,i,r]){return["G",1-Math.min(1,.3*e+.59*i+.11*n+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=md(e),[e,e,e]}static G_HTML([e]){const n=N2(e);return`#${n}${n}${n}`}static RGB_G([e,n,i]){return["G",.3*e+.59*n+.11*i]}static RGB_rgb(e){return e.map(md)}static RGB_HTML(e){return`#${e.map(N2).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,i,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,i+r),1-Math.min(1,n+r)]}static CMYK_rgb([e,n,i,r]){return[md(1-Math.min(1,e+r)),md(1-Math.min(1,i+r)),md(1-Math.min(1,n+r))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,i]){const r=1-e,s=1-n,l=1-i,u=Math.min(r,s,l);return["CMYK",r,s,l,u]}}class GP{static setupStorage(e,n,i,r,s){const l=r.getValue(n,{value:null});switch(i.name){case"textarea":if(l.value!==null&&(e.textContent=l.value),s==="print")break;e.addEventListener("input",u=>{r.setValue(n,{value:u.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(l.value===i.attributes.xfaOn?e.setAttribute("checked",!0):l.value===i.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",u=>{r.setValue(n,{value:u.target.checked?u.target.getAttribute("xfaOn"):u.target.getAttribute("xfaOff")})})}else{if(l.value!==null&&e.setAttribute("value",l.value),s==="print")break;e.addEventListener("input",u=>{r.setValue(n,{value:u.target.value})})}break;case"select":if(l.value!==null){e.setAttribute("value",l.value);for(const u of i.children)u.attributes.value===l.value?u.attributes.selected=!0:u.attributes.hasOwnProperty("selected")&&delete u.attributes.selected}e.addEventListener("input",u=>{const d=u.target.options,f=d.selectedIndex===-1?"":d[d.selectedIndex].value;r.setValue(n,{value:f})});break}}static setAttributes({html:e,element:n,storage:i=null,intent:r,linkService:s}){const{attributes:l}=n,u=e instanceof HTMLAnchorElement;l.type==="radio"&&(l.name=`${l.name}-${r}`);for(const[d,f]of Object.entries(l))if(f!=null)switch(d){case"class":f.length&&e.setAttribute(d,f.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",f);break;case"style":Object.assign(e.style,f);break;case"textContent":e.textContent=f;break;default:(!u||d!=="href"&&d!=="newWindow")&&e.setAttribute(d,f)}u&&s.addLinkAttributes(e,l.href,l.newWindow),i&&l.dataId&&this.setupStorage(e,l.dataId,n,i)}static render(e){const n=e.annotationStorage,i=e.linkService,r=e.xfaHtml,s=e.intent||"display",l=document.createElement(r.name);r.attributes&&this.setAttributes({html:l,element:r,intent:s,linkService:i});const u=s!=="richText",d=e.div;if(d.append(l),e.viewport){const m=`matrix(${e.viewport.transform.join(",")})`;d.style.transform=m}u&&d.setAttribute("class","xfaLayer xfaFont");const f=[];if(r.children.length===0){if(r.value){const m=document.createTextNode(r.value);l.append(m),u&&Gd.shouldBuildText(r.name)&&f.push(m)}return{textDivs:f}}const p=[[r,-1,l]];for(;p.length>0;){const[m,x,b]=p.at(-1);if(x+1===m.children.length){p.pop();continue}const w=m.children[++p.at(-1)[1]];if(w===null)continue;const{name:C}=w;
748if(C==="#text"){const E=document.createTextNode(w.value);f.push(E),b.append(E);continue}const A=w?.attributes?.xmlns?document.createElementNS(w.attributes.xmlns,C):document.createElement(C);if(b.append(A),w.attributes&&this.setAttributes({html:A,element:w,storage:n,intent:s,linkService:i}),w.children?.length>0)p.push([w,-1,A]);else if(w.value){const E=document.createTextNode(w.value);u&&Gd.shouldBuildText(C)&&f.push(E),A.append(E)}}for(const m of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:f}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const hh=1e3,lee=9,ul=new WeakSet;function fa(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class cee{static create(e){switch(e.data.annotationType){case Bn.LINK:return new VP(e);case Bn.TEXT:return new uee(e);case Bn.WIDGET:switch(e.data.fieldType){case"Tx":return new dee(e);case"Btn":return e.data.radioButton?new qP(e):e.data.checkBox?new fee(e):new pee(e);case"Ch":return new mee(e);case"Sig":return new hee(e)}return new wl(e);case Bn.POPUP:return new Ry(e);case Bn.FREETEXT:return new KP(e);case Bn.LINE:return new xee(e);case Bn.SQUARE:return new vee(e);case Bn.CIRCLE:return new bee(e);case Bn.POLYLINE:return new WP(e);case Bn.CARET:return new wee(e);case Bn.INK:return new YP(e);case Bn.POLYGON:return new yee(e);case Bn.HIGHLIGHT:return new See(e);case Bn.UNDERLINE:return new Cee(e);case Bn.SQUIGGLY:return new Eee(e);case Bn.STRIKEOUT:return new Aee(e);case Bn.STAMP:return new XP(e);case Bn.FILEATTACHMENT:return new kee(e);default:return new kn(e)}}}class kn{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:n=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,n&&(this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:n,richText:i}){return!!(e?.str||n?.str||i?.str)}get hasPopupData(){return kn._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};const{rect:n}=e;n&&this.#r(n),this.#n?.popup.updateEdited(e)}resetEdited(){this.#e&&(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#r(e){const{container:{style:n},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:l,pageX:u,pageY:d}}}}=this;i?.splice(0,4,...e);const{width:f,height:p}=fa(e);n.left=`${100*(e[0]-u)/s}%`,n.top=`${100*(l-e[3]+d)/l}%`,r===0?(n.width=`${100*f/s}%`,n.height=`${100*p/l}%`):this.setRotation(r)}_createContainer(e){const{data:n,parent:{page:i,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",n.id),this instanceof wl||(s.tabIndex=hh);const{style:l}=s;if(l.zIndex=this.parent.zIndex++,n.popupRef&&s.setAttribute("aria-haspopup","dialog"),n.alternativeText&&(s.title=n.alternativeText),n.noRotate&&s.classList.add("norotate"),!n.rect||this instanceof Ry){const{rotation:C}=n;return!n.hasOwnCanvas&&C!==0&&this.setRotation(C,s),s}const{width:u,height:d}=fa(n.rect);if(!e&&n.borderStyle.width>0){l.borderWidth=`${n.borderStyle.width}px`;const C=n.borderStyle.horizontalCornerRadius,A=n.borderStyle.verticalCornerRadius;if(C>0||A>0){const k=`calc(${C}px * var(--scale-factor)) / calc(${A}px * var(--scale-factor))`;l.borderRadius=k}else if(this instanceof qP){const k=`calc(${u}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;l.borderRadius=k}switch(n.borderStyle.style){case fd.SOLID:l.borderStyle="solid";break;case fd.DASHED:l.borderStyle="dashed";break;case fd.BEVELED:bt("Unimplemented border style: beveled");break;case fd.INSET:bt("Unimplemented border style: inset");break;case fd.UNDERLINE:l.borderBottomStyle="solid";break}const E=n.borderColor||null;E?(this.#t=!0,l.borderColor=Ke.makeHexColor(E[0]|0,E[1]|0,E[2]|0)):l.borderWidth=0}const f=Ke.normalizeRect([n.rect[0],i.view[3]-n.rect[1]+i.view[1],n.rect[2],i.view[3]-n.rect[3]+i.view[1]]),{pageWidth:p,pageHeight:m,pageX:x,pageY:b}=r.rawDims;l.left=`${100*(f[0]-x)/p}%`,l.top=`${100*(f[1]-b)/m}%`;const{rotation:w}=n;return n.hasOwnCanvas||w===0?(l.width=`${100*u/p}%`,l.height=`${100*d/m}%`):this.setRotation(w,s),s}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:r}=this.parent.viewport.rawDims,{width:s,height:l}=fa(this.data.rect);let u,d;e%180===0?(u=100*s/i,d=100*l/r):(u=100*l/i,d=100*s/r),n.style.width=`${u}%`,n.style.height=`${d}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,i,r)=>{const s=r.detail[n],l=s[0],u=s.slice(1);r.target.style[i]=j2[`${l}_HTML`](u),this.annotationStorage.setValue(this.data.id,{[i]:j2[`${l}_rgb`](u)})};return Rt(this,"_commonActions",{display:n=>{const{display:i}=n.detail,r=i%2===1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:i===1||i===2})},print:n=>{this.annotationStorage.setValue(this.data.id,{noPrint:!n.detail.print})},hidden:n=>{const{hidden:i}=n.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:n=>{setTimeout(()=>
748n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.target.disabled=n.detail.readonly},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{e("bgColor","backgroundColor",n)},fillColor:n=>{e("fillColor","backgroundColor",n)},fgColor:n=>{e("fgColor","color",n)},textColor:n=>{e("textColor","color",n)},borderColor:n=>{e("borderColor","borderColor",n)},strokeColor:n=>{e("strokeColor","borderColor",n)},rotation:n=>{const i=n.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(e,n){const i=this._commonActions;for(const r of Object.keys(n.detail))(e[r]||i[r])?.(n)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const i=this._commonActions;for(const[r,s]of Object.entries(n)){const l=i[r];if(l){const u={detail:{[r]:s},target:e};l(u),delete n[r]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,i,r,s]=this.data.rect;if(e.length===1){const[,{x:C,y:A},{x:E,y:k}]=e[0];if(r===C&&s===A&&n===E&&i===k)return}const{style:l}=this.container;let u;if(this.#t){const{borderColor:C,borderWidth:A}=l;l.borderWidth=0,u=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${C}" stroke-width="${A}">`],this.container.classList.add("hasBorder")}const d=r-n,f=s-i,{svgFactory:p}=this,m=p.createElement("svg");m.classList.add("quadrilateralsContainer"),m.setAttribute("width",0),m.setAttribute("height",0);const x=p.createElement("defs");m.append(x);const b=p.createElement("clipPath"),w=`clippath_${this.data.id}`;b.setAttribute("id",w),b.setAttribute("clipPathUnits","objectBoundingBox"),x.append(b);for(const[,{x:C,y:A},{x:E,y:k}]of e){const N=p.createElement("rect"),_=(E-n)/d,R=(s-A)/f,T=(C-E)/d,L=(A-k)/f;N.setAttribute("x",_),N.setAttribute("y",R),N.setAttribute("width",T),N.setAttribute("height",L),b.append(N),u?.push(`<rect vector-effect="non-scaling-stroke" x="${_}" y="${R}" width="${T}" height="${L}"/>`)}this.#t&&(u.push("</g></svg>')"),l.backgroundImage=u.join("")),this.container.append(m),this.container.style.clipPath=`url(#${w})`}_createPopup(){const{container:e,data:n}=this;e.setAttribute("aria-haspopup","dialog");const i=this.#n=new Ry({data:{color:n.color,titleObj:n.titleObj,modificationDate:n.modificationDate,contentsObj:n.contentsObj,richText:n.richText,parentRect:n.rect,borderStyle:0,id:`popup_${n.id}`,rotation:n.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){Bt("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const i=[];if(this._fieldObjects){const r=this._fieldObjects[e];if(r)for(const{page:s,id:l,exportValues:u}of r){if(s===-1||l===n)continue;const d=typeof u=="string"?u:null,f=document.querySelector(`[data-element-id="${l}"]`);if(f&&!ul.has(f)){bt(`_getElementsByName - element not allowed: ${l}`);continue}i.push({id:l,exportValue:d,domElement:f})}return i}for(const r of document.getElementsByName(e)){const{exportValue:s}=r,l=r.getAttribute("data-element-id");l!==n&&ul.has(r)&&i.push({id:l,exportValue:s,domElement:r})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const n of e)n.classList.add("highlightArea");else e.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:n})})}}class VP extends kn{constructor(e,n=null){super(e,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:n}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let r=!1;return e.url?(n.addLinkAttributes(i,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(i,e.action),r=!0):e.attachment?(this.#t(i,e.attachment,e.attachmentDest),r=!0):e.setOCGState?(this.#n(i,e.setOCGState),r=!0):e.dest?(this._bindLink(i,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),r=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(i,""),r=!0)),this.container.classList.add("linkA
748nnotation"),r&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,n){e.href=this.linkService.getDestinationHash(n),e.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&this.#e()}_bindNamedAction(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(n),!1),this.#e()}#t(e,n,i=null){e.href=this.linkService.getAnchorUrl(""),n.description&&(e.title=n.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(n.content,n.filename,i),!1),this.#e()}#n(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(n),!1),this.#e()}_bindJSAction(e,n){e.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(n.actions)){const s=i.get(r);s&&(e[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,n){const i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){bt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1);return}e.onclick=()=>{i?.();const{fields:r,refs:s,include:l}=n,u=[];if(r.length!==0||s.length!==0){const p=new Set(s);for(const m of r){const x=this._fieldObjects[m]||[];for(const{id:b}of x)p.add(b)}for(const m of Object.values(this._fieldObjects))for(const x of m)p.has(x.id)===l&&u.push(x)}else for(const p of Object.values(this._fieldObjects))u.push(...p);const d=this.annotationStorage,f=[];for(const p of u){const{id:m}=p;switch(f.push(m),p.type){case"text":{const b=p.defaultValue||"";d.setValue(m,{value:b});break}case"checkbox":case"radiobutton":{const b=p.defaultValue===p.exportValues;d.setValue(m,{value:b});break}case"combobox":case"listbox":{const b=p.defaultValue||"";d.setValue(m,{value:b});break}default:continue}const x=document.querySelector(`[data-element-id="${m}"]`);if(x){if(!ul.has(x)){bt(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;x.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}}),!1}}}class uee extends kn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class wl extends kn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Mi.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,i,r,s){i.includes("mouse")?e.addEventListener(i,l=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(l),shift:l.shiftKey,modifier:this._getKeyModifier(l)}})}):e.addEventListener(i,l=>{if(i==="blur"){if(!n.focused||!l.relatedTarget)return;n.focused=!1}else if(i==="focus"){if(n.focused)return;n.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(l)}})})}_setEventListeners(e,n,i,r){for(const[s,l]of i)(l==="Action"||this.data.actions?.[l])&&((l==="Focus"||l==="Blur")&&(n||={focused:!1}),this._setEventListener(e,n,s,l,r),l==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,n,"blur","Blur",null):l==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":Ke.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||lee,s=e.style;let l;const u=2,d=f=>Math.round(10*f)/10;if(this.data.multiLine){const f=Math.abs(this.data.rect[3]-this.data.rect[1]-u),p=Math.round(f/(pb*r))||1,m=f/p;l=Math.min(r,d(m/pb))}else{const f=Math.abs(this.data.rect[3]-this.data.rect[1]-u);l=Math.min(r,d(f/pb))}s.fontSize=`calc(${l}px * var(--scale-factor))`,s.color=Ke.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(s.textAlign=n[this.data.textAlignment])}
vendor: 8,207 bytes, lines 748-749
748_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class dee extends wl{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,i,r){const s=this.annotationStorage;for(const l of this._getElementsByName(e.name,e.id))l.domElement&&(l.domElement[n]=i),s.setValue(l.id,{[r]:i})}render(){const e=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const r=e.getValue(n,{value:this.data.fieldValue});let s=r.value||"";const l=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;l&&s.length>l&&(s=s.slice(0,l));let u=r.formattedValue||this.data.textContent?.join(`
749`)||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const d={userValue:s,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=u??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",u??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),ul.add(i),i.setAttribute("data-element-id",n),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=hh,this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",p=>{e.setValue(n,{value:p.target.value}),this.setPropertyOnSiblings(i,"value",p.target.value,"value"),d.formattedValue=null}),i.addEventListener("resetform",p=>{const m=this.data.defaultFieldValue??"";i.value=d.userValue=m,d.formattedValue=null});let f=p=>{const{formattedValue:m}=d;m!=null&&(p.target.value=m),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",m=>{if(d.focused)return;const{target:x}=m;d.userValue&&(x.value=d.userValue),d.lastCommittedValue=x.value,d.commitKey=1,this.data.actions?.Focus||(d.focused=!0)}),i.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const x={value(b){d.userValue=b.detail.value??"",e.setValue(n,{value:d.userValue.toString()}),b.target.value=d.userValue},formattedValue(b){const{formattedValue:w}=b.detail;d.formattedValue=w,w!=null&&b.target!==document.activeElement&&(b.target.value=w),e.setValue(n,{formattedValue:w})},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{const{charLimit:w}=b.detail,{target:C}=b;if(w===0){C.removeAttribute("maxLength");return}C.setAttribute("maxLength",w);let A=d.userValue;!A||A.length<=w||(A=A.slice(0,w),C.value=d.userValue=A,e.setValue(n,{value:A}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:A,willCommit:!0,commitKey:1,selStart:C.selectionStart,selEnd:C.selectionEnd}}))}};this._dispatchEventFromSandbox(x,m)}),i.addEventListener("keydown",m=>{d.commitKey=1;let x=-1;if(m.key==="Escape"?x=0:m.key==="Enter"&&!this.data.multiLine?x=2:m.key==="Tab"&&(d.commitKey=3),x===-1)return;const{value:b}=m.target;d.lastCommittedValue!==b&&(d.lastCommittedValue=b,d.userValue=b,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:b,willCommit:!0,commitKey:x,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const p=f;f=null,i.addEventListener("blur",m=>{if(!d.focused||!m.relatedTarget)return;this.data.actions?.Blur||(d.focused=!1);const{value:x}=m.target;d.userValue=x,d.lastCommittedValue!==x&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:x,willCommit:!0,commitKey:d.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),p(m)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",m=>{d.lastCommittedValue=null;const{data:x,target:b}=m,{value:w,selectionStart:C,selectionEnd:A}=b;let E=C,k=A;switch(m.inputType){case"deleteWordBackward":{const N=w.substring(0,C).match(/\w*[^\w]*$/);N&&(E-=N[0].length);break}case"deleteWordForward":{const N=w.substring(C).match(/^[^\w]*\w*/);N&&(k+=N[0].length);break}case"deleteContentBackward":C===A&&(E-=1);break;case"deleteContentForward":C===A&&(k+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:w,change:x||"",willCommit:!1,selStart:E,selEnd:k}})}),this._setEventListeners(i,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(f&&i.addEventListener("blur",f),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing=`calc(${m}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class hee extends wl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class fee extends wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,n=this.data,i=n.id;let r=e.getValue(i,{value:n.exportValue===n.fieldValue}).value;typeof r=="string"&&(r=r!=="Off",e.setValue(i,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return ul.add(s),s.setAttribute("data-element-id",i),s.disabled=n.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=n.fieldName,r&&s.setAttribute("checked",!0),s.setAttribute("exportValue",n.exportValue),s.tabIndex=hh,s.addEventListener("change",l=>{const{name:u,checked:d}=l.target;for(const f of this._getElementsByName(u,i)){const p=d&&f.exportValue===n.exportValue;f.domElement&&(f.domElement.checked=p),e.setValue(f.id,{value:p})}e.setValue(i,{value:d})}),s.addEventListener("resetform",l=>{const u=n.defaultFieldValue||"Off";l.target.checked=u===n.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",l=>{const u={value(d){d.target.checked=d.detail.value!=="Off",e.setValue(i,{value:d.target.checked})}};this._dispatchEventFromSandbox(u,l)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],l=>l.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class qP extends wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,n=this.data,i=n.id;let r=e.getValue(i,{value:n.fieldValue===n.buttonValue}).value;if(typeof r=="string"&&(r=r!==n.buttonValue,e.setValue(i,{value:r})),r)for(const l of this._getElementsByName(n.fieldName,i))e.setValue(l.id,{value:!1});const s=document.createElement("input");if(ul.add(s),s.setAttribute("data-element-id",i),s.disabled=n.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=n.fieldName,r&&s.setAttribute("checked",!0),s.tabIndex=hh,s.addEventListener("change",l=>{const{name:u,checked:d}=l.target;for(const f of this._getElementsByName(u,i))e.setValue(f.id,{value:!1});e.setValue(i,{value:d})}),s.addEventListener("resetform",l=>{const u=n.defaultFieldValue;l.target.checked=u!=null&&u===n.buttonValue}),this.enableScripting&&this.hasJSActions){const l=n.buttonValue;s.addEventListener("updatefromsandbox",u=>{const d={value:f=>{const p=l===f.detail.value;for(const m of this._getElementsByName(f.target.name)){const x=p&&m.id===i;m.domElement&&(m.domElement.checked=x),e.setValue(m.id,{value:x})}}};this._dispatchEventFromSandbox(d,u)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],u=>u.target.checked)}
vendor: 4,671 bytes, line 749
749return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class pee extends VP{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const n=e.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),e}}class mee extends wl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,n=this.data.id,i=e.getValue(n,{value:this.data.fieldValue}),r=document.createElement("select");ul.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=hh;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",p=>{const m=this.data.defaultFieldValue;for(const x of r.options)x.selected=x.value===m});for(const p of this.data.options){const m=document.createElement("option");m.textContent=p.displayValue,m.value=p.exportValue,i.value.includes(p.exportValue)&&(m.setAttribute("selected",!0),s=!1),r.append(m)}let l=null;if(s){const p=document.createElement("option");p.value=" ",p.setAttribute("hidden",!0),p.setAttribute("selected",!0),r.prepend(p),l=()=>{p.remove(),r.removeEventListener("input",l),l=null},r.addEventListener("input",l)}const u=p=>{const m=p?"value":"textContent",{options:x,multiple:b}=r;return b?Array.prototype.filter.call(x,w=>w.selected).map(w=>w[m]):x.selectedIndex===-1?null:x[x.selectedIndex][m]};let d=u(!1);const f=p=>{const m=p.target.options;return Array.prototype.map.call(m,x=>({displayValue:x.textContent,exportValue:x.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",p=>{const m={value(x){l?.();const b=x.detail.value,w=new Set(Array.isArray(b)?b:[b]);for(const C of r.options)C.selected=w.has(C.value);e.setValue(n,{value:u(!0)}),d=u(!1)},multipleSelection(x){r.multiple=!0},remove(x){const b=r.options,w=x.detail.remove;b[w].selected=!1,r.remove(w),b.length>0&&Array.prototype.findIndex.call(b,A=>A.selected)===-1&&(b[0].selected=!0),e.setValue(n,{value:u(!0),items:f(x)}),d=u(!1)},clear(x){for(;r.length!==0;)r.remove(0);e.setValue(n,{value:null,items:[]}),d=u(!1)},insert(x){const{index:b,displayValue:w,exportValue:C}=x.detail.insert,A=r.children[b],E=document.createElement("option");E.textContent=w,E.value=C,A?A.before(E):r.append(E),e.setValue(n,{value:u(!0),items:f(x)}),d=u(!1)},items(x){const{items:b}=x.detail;for(;r.length!==0;)r.remove(0);for(const w of b){const{displayValue:C,exportValue:A}=w,E=document.createElement("option");E.textContent=C,E.value=A,r.append(E)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(n,{value:u(!0),items:f(x)}),d=u(!1)},indices(x){const b=new Set(x.detail.indices);for(const w of x.target.options)w.selected=b.has(w.index);e.setValue(n,{value:u(!0)}),d=u(!1)},editable(x){x.target.disabled=!x.detail.editable}};this._dispatchEventFromSandbox(m,p)}),r.addEventListener("input",p=>{const m=u(!0),x=u(!1);e.setValue(n,{value:m}),p.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:d,change:x,changeEx:m,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],p=>p.target.value)):r.addEventListener("input",function(p){e.setValue(n,{value:u(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Ry extends kn{constructor(e){const{data:n,elements:i}=e;super(e,{isRenderable:kn._hasPopupData(n)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new gee({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),n=[];for(const i of this.elements)i.popup=e,n.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(i=>`${NP}${i}`).join(",")),this.container}}
749class gee{#e=this.#k.bind(this);#t=this.#C.bind(this);#n=this.#S.bind(this);#r=this.#x.bind(this);#a=null;#i=null;#s=null;#c=null;#l=null;#d=null;#f=null;#u=!1;#o=null;#p=null;#m=null;#h=null;#v=null;#g=null;#b=!1;constructor({container:e,color:n,elements:i,titleObj:r,modificationDate:s,contentsObj:l,richText:u,parent:d,rect:f,parentRect:p,open:m}){this.#i=e,this.#v=r,this.#s=l,this.#h=u,this.#d=d,this.#a=n,this.#m=f,this.#f=p,this.#l=i,this.#c=RP.toDateObject(s),this.trigger=i.flatMap(x=>x.getElementsToTriggerPopup());for(const x of this.trigger)x.addEventListener("click",this.#r),x.addEventListener("mouseenter",this.#n),x.addEventListener("mouseleave",this.#t),x.classList.add("popupTriggerArea");for(const x of i)x.container?.addEventListener("keydown",this.#e);this.#i.hidden=!0,m&&this.#x()}render(){if(this.#o)return;const e=this.#o=document.createElement("div");if(e.className="popup",this.#a){const s=e.style.outlineColor=Ke.makeHexColor(...this.#a);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`:e.style.backgroundColor=Ke.makeHexColor(...this.#a.map(u=>Math.floor(.7*(255-u)+u)))}const n=document.createElement("span");n.className="header";const i=document.createElement("h1");if(n.append(i),{dir:i.dir,str:i.textContent}=this.#v,e.append(n),this.#c){const s=document.createElement("span");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),s.setAttribute("data-l10n-args",JSON.stringify({date:this.#c.toLocaleDateString(),time:this.#c.toLocaleTimeString()})),n.append(s)}const r=this.#w;if(r)GP.render({xfaHtml:r,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const s=this._formatContents(this.#s);e.append(s)}this.#i.append(e)}get#w(){const e=this.#h,n=this.#s;return e?.str&&(!n?.str||n.str===e.str)&&this.#h.html||null}get#E(){return this.#w?.attributes?.style?.fontSize||0}get#A(){return this.#w?.attributes?.style?.color||null}#j(e){const n=[],i={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},r={style:{color:this.#A,fontSize:this.#E?`calc(${this.#E}px * var(--scale-factor))`:""}};for(const s of e.split(`
750`))n.push({name:"span",value:s,attributes:r});return i}_formatContents({str:e,dir:n}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=n;const r=e.split(/(?:\r\n?|\n)/);for(let s=0,l=r.length;s<l;++s){const u=r[s];i.append(document.createTextNode(u)),s<l-1&&i.append(document.createElement("br"))}return i}#k(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&this.#u)&&this.#x()}updateEdited({rect:e,popupContent:n}){this.#g||={contentsObj:this.#s,richText:this.#h},e&&(this.#p=null),n&&(this.#h=this.#j(n),this.#s=null),this.#o?.remove(),this.#o=null}resetEdited(){this.#g&&({contentsObj:this.#s,richText:this.#h}=this.#g,this.#g=null,this.#o?.remove(),this.#o=null,this.#p=null)}#y(){if(this.#p!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:i,pageX:r,pageY:s}}}=this.#d;let l=!!this.#f,u=l?this.#f:this.#m;for(const w of this.#l)if(!u||Ke.intersect(w.data.rect,u)!==null){u=w.data.rect,l=!0;break}const d=Ke.normalizeRect([u[0],e[3]-u[1]+e[1],u[2],e[3]-u[3]+e[1]]),p=l?u[2]-u[0]+5:0,m=d[0]+p,x=d[1];this.#p=[100*(m-r)/n,100*(x-s)/i];const{style:b}=this.#i;b.left=`${this.#p[0]}%`,b.top=`${this.#p[1]}%`}#x(){this.#u=!this.#u,this.#u?(this.#S(),this.#i.addEventListener("click",this.#r),this.#i.addEventListener("keydown",this.#e)):(this.#C(),this.#i.removeEventListener("click",this.#r),this.#i.removeEventListener("keydown",this.#e))}#S(){this.#o||this.render(),this.isVisible?this.#u&&this.#i.classList.add("focused"):(this.#y(),this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#C(){this.#i.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#b=this.isVisible,this.#b&&(this.#i.hidden=!0)}maybeShow(){this.#b&&(this.#o||this.#S(),this.#b=!1,this.#i.hidden=!1)}get isVisible(){return this.#i.hidden===!1}}class KP extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=jt.FREETEXT}
750render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const n of this.textContent){const i=document.createElement("span");i.textContent=n,e.append(i)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class xee extends kn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:n,height:i}=fa(e.rect),r=this.svgFactory.create(n,i,!0),s=this.#e=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),s.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),s.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),s.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),r.append(s),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class vee extends kn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:n,height:i}=fa(e.rect),r=this.svgFactory.create(n,i,!0),s=e.borderStyle.width,l=this.#e=this.svgFactory.createElement("svg:rect");return l.setAttribute("x",s/2),l.setAttribute("y",s/2),l.setAttribute("width",n-s),l.setAttribute("height",i-s),l.setAttribute("stroke-width",s||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class bee extends kn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:n,height:i}=fa(e.rect),r=this.svgFactory.create(n,i,!0),s=e.borderStyle.width,l=this.#e=this.svgFactory.createElement("svg:ellipse");return l.setAttribute("cx",n/2),l.setAttribute("cy",i/2),l.setAttribute("rx",n/2-s/2),l.setAttribute("ry",i/2-s/2),l.setAttribute("stroke-width",s||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class WP extends kn{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:n,height:i}=fa(e.rect),r=this.svgFactory.create(n,i,!0);let s=[];for(const u of e.vertices){const d=u.x-e.rect[0],f=e.rect[3]-u.y;s.push(d+","+f)}s=s.join(" ");const l=this.#e=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",s),l.setAttribute("stroke-width",e.borderStyle.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class yee extends WP{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class wee extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class YP extends kn{#e=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=jt.INK}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:n,height:i}=fa(e.rect),r=this.svgFactory.create(n,i,!0);for(const s of e.inkLists){let l=[];for(const d of s){const f=d.x-e.rect[0],p=e.rect[3]-d.y;l.push(`${f},${p}`)}l=l.join(" ");const u=this.svgFactory.createElement(this.svgElementName);this.#e.push(u),u.setAttribute("points",l),u.setAttribute("stroke-width",e.borderStyle.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),!e.popupRef&&this.hasPopupData&&this._createPopup(),r.append(u)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class See extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}
750class Cee extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Eee extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Aee extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class XP extends kn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class kee extends kn{#e=null;constructor(e){super(e,{isRenderable:!0});const{file:n}=this.data;this.filename=n.filename,this.content=n.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...n})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:n}=this;let i;n.hasAppearance||n.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name)?"paperclip":"pushpin"}.svg`,n.fillAlpha&&n.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(n.fillAlpha*100)}%);`)),i.addEventListener("dblclick",this.#t.bind(this)),this.#e=i;const{isMac:r}=Mi.platform;return e.addEventListener("keydown",s=>{s.key==="Enter"&&(r?s.metaKey:s.ctrlKey)&&this.#t()}),!n.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}let Nee=class{#e=null;#t=null;#n=new Map;constructor({div:e,accessibilityManager:n,annotationCanvasMap:i,annotationEditorUIManager:r,page:s,viewport:l}){this.div=e,this.#e=n,this.#t=i,this.page=s,this.viewport=l,this.zIndex=0,this._annotationEditorUIManager=r}#r(e,n){const i=e.firstChild||e;i.id=`${NP}${n}`,this.div.append(e),this.#e?.moveElementInDOM(this.div,e,i,!1)}async render(e){const{annotations:n}=e,i=this.div;cl(i,this.viewport);const r=new Map,s={data:null,layer:i,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new l0,annotationStorage:e.annotationStorage||new g0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const l of n){if(l.noHTML)continue;const u=l.annotationType===Bn.POPUP;if(u){const p=r.get(l.id);if(!p)continue;s.elements=p}else{const{width:p,height:m}=fa(l.rect);if(p<=0||m<=0)continue}s.data=l;const d=cee.create(s);if(!d.isRenderable)continue;if(!u&&l.popupRef){const p=r.get(l.popupRef);p?p.push(d):r.set(l.popupRef,[d])}const f=d.render();l.hidden&&(f.style.visibility="hidden"),this.#r(f,l.id),d.annotationEditorType>0&&(this.#n.set(d.data.id,d),this._annotationEditorUIManager?.renderAnnotationElement(d))}this.#a()}update({viewport:e}){const n=this.div;this.viewport=e,cl(n,{rotation:e.rotation}),this.#a(),n.hidden=!1}#a(){if(!this.#t)return;const e=this.div;for(const[n,i]of this.#t){const r=e.querySelector(`[data-annotation-id="${n}"]`);if(!r)continue;i.className="annotationContent";const{firstChild:s}=r;s?s.nodeName==="CANVAS"?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):r.append(i)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(e){return this.#n.get(e)}};const op=/\r\n?|\n/g;class Hn extends ct{#e=this.editorDivBlur.bind(this);#t=this.editorDivFocus.bind(this);#n=this.editorDivInput.bind(this);#r=this.editorDivKeydown.bind(this);#a=this.editorDivPaste.bind(this);#i;#s="";#c=`${this.id}-editor`;#l;#d=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=Hn.prototype,n=s=>s.isEmpty(),i=ho.TRANSLATE_SMALL,r=ho.TRANSLATE_BIG;return Rt(this,"_keyboardManager",new uh([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:n}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:n}]]))}static _type="freetext";static _editorType=jt.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#i=e.color||Hn._defaultColor||ct._defaultLineColor,this.#l=e.fontSize||Hn._defaultFontSize}static initialize(e,n){ct.initialize(e,n,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}
750static updateDefaultParams(e,n){switch(e){case dt.FREETEXT_SIZE:Hn._defaultFontSize=n;break;case dt.FREETEXT_COLOR:Hn._defaultColor=n;break}}updateParams(e,n){switch(e){case dt.FREETEXT_SIZE:this.#f(n);break;case dt.FREETEXT_COLOR:this.#u(n);break}}static get defaultPropertiesToUpdate(){return[[dt.FREETEXT_SIZE,Hn._defaultFontSize],[dt.FREETEXT_COLOR,Hn._defaultColor||ct._defaultLineColor]]}get propertiesToUpdate(){return[[dt.FREETEXT_SIZE,this.#l],[dt.FREETEXT_COLOR,this.#i]]}#f(e){const n=r=>{this.editorDiv.style.fontSize=`calc(${r}px * var(--scale-factor))`,this.translate(0,-(r-this.#l)*this.parentScale),this.#l=r,this.#p()},i=this.#l;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#u(e){const n=r=>{this.#i=this.editorDiv.style.color=r},i=this.#i;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,n){this._uiManager.translateSelectedEditors(e,n,!0)}getInitialTranslation(){const e=this.parentScale;return[-Hn._internalPadding*e,-(Hn._internalPadding+this.#l)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(jt.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#r),this.editorDiv.addEventListener("focus",this.#t),this.editorDiv.addEventListener("blur",this.#e),this.editorDiv.addEventListener("input",this.#n),this.editorDiv.addEventListener("paste",this.#a))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#c),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#r),this.editorDiv.removeEventListener("focus",this.#t),this.editorDiv.removeEventListener("blur",this.#e),this.editorDiv.removeEventListener("input",this.#n),this.editorDiv.removeEventListener("paste",this.#a),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#o(){const e=[];this.editorDiv.normalize();for(const n of this.editorDiv.childNodes)e.push(Hn.#m(n));return e.join(`
751`)}#p(){const[e,n]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:r,div:s}=this,l=s.style.display,u=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",r.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=l,s.classList.toggle("hidden",u)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/n):(this.width=i.height/e,this.height=i.width/n),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#s,n=this.#s=this.#o().trimEnd();if(e===n)return;const i=r=>{if(this.#s=r,!r){this.remove();return}this.#h(),this._uiManager.rebuild(this),this.#p()};this.addCommands({cmd:()=>{i(n)},undo:()=>{i(e)},mustExec:!1}),this.#p()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){Hn._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}
751render(){if(this.div)return this.div;let e,n;this.width&&(e=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#c),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),ct._l10nPromise.get("pdfjs-free-text-default-content").then(r=>this.editorDiv?.setAttribute("default-content",r)),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#l}px * var(--scale-factor))`,i.color=this.#i,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),im(this,this.div,["dblclick","keydown"]),this.width){const[r,s]=this.parentDimensions;if(this.annotationElementId){const{position:l}=this.#d;let[u,d]=this.getInitialTranslation();[u,d]=this.pageTranslationToScreen(u,d);const[f,p]=this.pageDimensions,[m,x]=this.pageTranslation;let b,w;switch(this.rotation){case 0:b=e+(l[0]-m)/f,w=n+this.height-(l[1]-x)/p;break;case 90:b=e+(l[0]-m)/f,w=n-(l[1]-x)/p,[u,d]=[d,-u];break;case 180:b=e-this.width+(l[0]-m)/f,w=n-(l[1]-x)/p,[u,d]=[-u,-d];break;case 270:b=e+(l[0]-m-this.height*p)/f,w=n+(l[1]-x-this.width*f)/p,[u,d]=[-d,u];break}this.setAt(b*r,w*s,u,d)}else this.setAt(e*r,n*s,this.width*r,this.height*s);this.#h(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#m(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(op,"")}editorDivPaste(e){const n=e.clipboardData||window.clipboardData,{types:i}=n;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();const r=Hn.#g(n.getData("text")||"").replaceAll(op,`
752`);if(!r)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const l=s.getRangeAt(0);if(!r.includes(`
753`)){l.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),s.collapseToStart();return}const{startContainer:u,startOffset:d}=l,f=[],p=[];if(u.nodeType===Node.TEXT_NODE){const b=u.parentElement;if(p.push(u.nodeValue.slice(d).replaceAll(op,"")),b!==this.editorDiv){let w=f;for(const C of this.editorDiv.childNodes){if(C===b){w=p;continue}w.push(Hn.#m(C))}}f.push(u.nodeValue.slice(0,d).replaceAll(op,""))}else if(u===this.editorDiv){let b=f,w=0;for(const C of this.editorDiv.childNodes)w++===d&&(b=p),b.push(Hn.#m(C))}this.#s=`${f.join(`
754`)}${r}${p.join(`
755`)}`,this.#h();const m=new Range;let x=f.reduce((b,w)=>b+w.length,0);for(const{firstChild:b}of this.editorDiv.childNodes)if(b.nodeType===Node.TEXT_NODE){const w=b.nodeValue.length;if(x<=w){m.setStart(b,x),m.setEnd(b,x);break}x-=w}s.removeAllRanges(),s.addRange(m)}#h(){if(this.editorDiv.replaceChildren(),!!this.#s)for(const e of this.#s.split(`
756`)){const n=document.createElement("div");n.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(n)}}#v(){return this.#s.replaceAll(" "," ")}static#g(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static deserialize(e,n,i){let r=null;if(e instanceof KP){const{data:{defaultAppearanceData:{fontSize:l,fontColor:u},rect:d,rotation:f,id:p},textContent:m,textPosition:x,parent:{page:{pageNumber:b}}}=e;if(!m||m.length===0)return null;r=e={annotationType:jt.FREETEXT,color:Array.from(u),fontSize:l,value:m.join(`
757`),position:x,pageIndex:b-1,rect:d.slice(0),rotation:f,id:p,deleted:!1}}const s=super.deserialize(e,n,i);return s.#l=e.fontSize,s.#i=Ke.makeHexColor(...e.color),s.#s=Hn.#g(e.value),s.annotationElementId=e.id||null,s.#d=r,s}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const n=Hn._internalPadding*this.parentScale,i=this.getRect(n,n),r=ct._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#i),s={annotationType:jt.FREETEXT,color:r,fontSize:this.#l,value:this.#v(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!this.#b(s)?null:(s.id=this.annotationElementId,s)}#b(e){const{value:n,fontSize:i,color:r,pageIndex:s}=this.#d;return this._hasBeenMoved||e.value!==n||e.fontSize!==i||e.color.some((l,u)=>l!==r[u])||e.pageIndex!==s}renderAnnotationElement(e){const n=super.renderAnnotationElement(e);
vendor: 5,669 bytes, lines 757-758
757if(this.deleted)return n;const{style:i}=n;i.fontSize=`calc(${this.#l}px * var(--scale-factor))`,i.color=this.#i,n.replaceChildren();for(const s of this.#s.split(`
758`)){const l=document.createElement("div");l.append(s?document.createTextNode(s):document.createElement("br")),n.append(l)}const r=Hn._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(r,r),popupContent:this.#s}),n}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Py{#e;#t=[];#n=[];constructor(e,n=0,i=0,r=!0){let s=1/0,l=-1/0,u=1/0,d=-1/0;const f=10**-4;for(const{x:A,y:E,width:k,height:N}of e){const _=Math.floor((A-n)/f)*f,R=Math.ceil((A+k+n)/f)*f,T=Math.floor((E-n)/f)*f,L=Math.ceil((E+N+n)/f)*f,M=[_,T,L,!0],U=[R,T,L,!1];this.#t.push(M,U),s=Math.min(s,_),l=Math.max(l,R),u=Math.min(u,T),d=Math.max(d,L)}const p=l-s+2*i,m=d-u+2*i,x=s-i,b=u-i,w=this.#t.at(r?-1:-2),C=[w[0],w[2]];for(const A of this.#t){const[E,k,N]=A;A[0]=(E-x)/p,A[1]=(k-b)/m,A[2]=(N-b)/m}this.#e={x,y:b,width:p,height:m,lastPoint:C}}getOutlines(){this.#t.sort((n,i)=>n[0]-i[0]||n[1]-i[1]||n[2]-i[2]);const e=[];for(const n of this.#t)n[3]?(e.push(...this.#c(n)),this.#i(n)):(this.#s(n),e.push(...this.#c(n)));return this.#r(e)}#r(e){const n=[],i=new Set;for(const l of e){const[u,d,f]=l;n.push([u,d,l],[u,f,l])}n.sort((l,u)=>l[1]-u[1]||l[0]-u[0]);for(let l=0,u=n.length;l<u;l+=2){const d=n[l][2],f=n[l+1][2];d.push(f),f.push(d),i.add(d),i.add(f)}const r=[];let s;for(;i.size>0;){const l=i.values().next().value;let[u,d,f,p,m]=l;i.delete(l);let x=u,b=d;for(s=[u,f],r.push(s);;){let w;if(i.has(p))w=p;else if(i.has(m))w=m;else break;i.delete(w),[u,d,f,p,m]=w,x!==u&&(s.push(x,b,u,b===d?d:f),x=u),b=b===d?f:d}s.push(x,b)}return new jee(r,this.#e)}#a(e){const n=this.#n;let i=0,r=n.length-1;for(;i<=r;){const s=i+r>>1,l=n[s][0];if(l===e)return s;l<e?i=s+1:r=s-1}return r+1}#i([,e,n]){const i=this.#a(e);this.#n.splice(i,0,[e,n])}#s([,e,n]){const i=this.#a(e);for(let r=i;r<this.#n.length;r++){const[s,l]=this.#n[r];if(s!==e)break;if(s===e&&l===n){this.#n.splice(r,1);return}}for(let r=i-1;r>=0;r--){const[s,l]=this.#n[r];if(s!==e)break;if(s===e&&l===n){this.#n.splice(r,1);return}}}#c(e){const[n,i,r]=e,s=[[n,i,r]],l=this.#a(r);for(let u=0;u<l;u++){const[d,f]=this.#n[u];for(let p=0,m=s.length;p<m;p++){const[,x,b]=s[p];if(!(f<=x||b<=d)){if(x>=d){if(b>f)s[p][1]=f;else{if(m===1)return[];s.splice(p,1),p--,m--}continue}s[p][2]=d,b>f&&s.push([n,f,b])}}}return s}}class QP{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,n){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof Dy}}class jee extends QP{#e;#t;constructor(e,n){super(),this.#t=e,this.#e=n}toSVGPath(){const e=[];for(const n of this.#t){let[i,r]=n;e.push(`M${i} ${r}`);for(let s=2;s<n.length;s+=2){const l=n[s],u=n[s+1];l===i?(e.push(`V${u}`),r=u):u===r&&(e.push(`H${l}`),i=l)}e.push("Z")}return e.join(" ")}serialize([e,n,i,r],s){const l=[],u=i-e,d=r-n;for(const f of this.#t){const p=new Array(f.length);for(let m=0;m<f.length;m+=2)p[m]=e+f[m]*u,p[m+1]=r-f[m+1]*d;l.push(p)}return l}get box(){return this.#e}}class Xo{#e;#t=[];#n;#r;#a=[];#i=new Float64Array(18);#s;#c;#l;#d;#f;#u;#o=[];static#p=8;static#m=2;static#h=Xo.#p+Xo.#m;constructor({x:e,y:n},i,r,s,l,u=0){this.#e=i,this.#u=s*r,this.#r=l,this.#i.set([NaN,NaN,NaN,NaN,e,n],6),this.#n=u,this.#d=Xo.#p*r,this.#l=Xo.#h*r,this.#f=r,this.#o.push(e,n)}get free(){return!0}isEmpty(){return isNaN(this.#i[8])}#v(){const e=this.#i.subarray(4,6),n=this.#i.subarray(16,18),[i,r,s,l]=this.#e;return[(this.#s+(e[0]-n[0])/2-i)/s,(this.#c+(e[1]-n[1])/2-r)/l,(this.#s+(n[0]-e[0])/2-i)/s,(this.#c+(n[1]-e[1])/2-r)/l]}add({x:e,y:n}){this.#s=e,this.#c=n;const[i,r,s,l]=this.#e;let[u,d,f,p]=this.#i.subarray(8,12);const m=e-f,x=n-p,b=Math.hypot(m,x);if(b<this.#l)return!1;const w=b-this.#d,C=w/b,A=C*m,E=C*x;let k=u,N=d;u=f,d=p,f+=A,p+=E,this.#o?.push(e,n);const _=-E/w,R=A/w,T=_*this.#u,L=R*this.#u;return this.#i.set(this.#i.subarray(2,8),0),this.#i.set([f+T,p+L],4),this.#i.set(this.#i.subarray(14,18),12),this.#i.set([f-T,p-L],16),isNaN(this.#i[6])?(this.#a.length===0&&(this.#i.set([u+T,d+L],2),this.#a.push(NaN,NaN,NaN,NaN,(u+T-i)/s,(d+L-r)/l),this.#i.set([u-T,d-L],14),this.#t.push(NaN,NaN,NaN,NaN,(u-T-i)/s,(d-L-r)/l)),this.#i.set([k,N,u,d,f,p],6),!this.isEmpty()):(this.#i.set([k,N,u,d,f,p],6),Math.abs(Math.atan2(N-d,k-u)-Math.atan2(E,A))<Math.PI/2?([u,d,f,p]=this.#i.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((u+f)/2-i)/s,((d+p)/2-r)/l),[u,d,k,N]=this.#i.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((k+u)/2-i)/s,((N+d)/2-r)/l),!0):([k,N,u,d,f,p]=this.#i.subarray(0,6),this.#a.push(((k+5*u)/6-i)/s,((N+5*d)/6-r)/l,((5*u+f)/6-i)/s,((5*d+p)/6-r)/l,((u+f)/2-i)/s,((d+p)/2-r)/l),[f,p,u,d,k,N]=this.#i.subarray(12,18),this.#t.push(((k+5*u)/6-i)/s,((N+5*d)/6-r)/l,((5*u+f)/6-i)/s,((5*d+p)/6-r)/l,((u+f)/2-i)/s,((d+p)/2-r)/l),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#a,n=this.#t,i=this.#i.subarray(4,6),r=this.#i.subarray(16,18),[s,l,u,d]=this.#e,[f,p,m,x]=this.#v();if(isNaN(this.#i[6])&&!this.isEmpty())return`M${(this.#i[2]-s)/u} ${(this.#i[3]-l)/d} L${(this.#i[4]-s)/u} ${(this.#i[5]-l)/d} L${f} ${p} L${m} ${x} L${(this.#i[16]-s)/u} ${(this.#i[17]-l)/d} L${(this.#i[14]-s)/u} ${(this.#i[15]-l)/d} Z`;const b=[];b.push(`M${e[4]} ${e[5]}`);for(let w=6;w<e.length;w+=6)isNaN(e[w])?b.push(`L${e[w+4]} ${e[w+5]}`):b.push(`C${e[w]} ${e[w+1]} ${e[w+2]} ${e[w+3]} ${e[w+4]} ${e[w+5]}`);b.push(`L${(i[0]-s)/u} ${(i[1]-l)/d} L${f} ${p} L${m} ${x} L${(r[0]-s)/u} ${(r[1]-l)/d}`);for(let w=n.length-6;
758w>=6;w-=6)isNaN(n[w])?b.push(`L${n[w+4]} ${n[w+5]}`):b.push(`C${n[w]} ${n[w+1]} ${n[w+2]} ${n[w+3]} ${n[w+4]} ${n[w+5]}`);return b.push(`L${n[4]} ${n[5]} Z`),b.join(" ")}getOutlines(){const e=this.#a,n=this.#t,i=this.#i,r=i.subarray(4,6),s=i.subarray(16,18),[l,u,d,f]=this.#e,p=new Float64Array((this.#o?.length??0)+2);for(let E=0,k=p.length-2;E<k;E+=2)p[E]=(this.#o[E]-l)/d,p[E+1]=(this.#o[E+1]-u)/f;p[p.length-2]=(this.#s-l)/d,p[p.length-1]=(this.#c-u)/f;const[m,x,b,w]=this.#v();if(isNaN(i[6])&&!this.isEmpty()){const E=new Float64Array(36);return E.set([NaN,NaN,NaN,NaN,(i[2]-l)/d,(i[3]-u)/f,NaN,NaN,NaN,NaN,(i[4]-l)/d,(i[5]-u)/f,NaN,NaN,NaN,NaN,m,x,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,(i[16]-l)/d,(i[17]-u)/f,NaN,NaN,NaN,NaN,(i[14]-l)/d,(i[15]-u)/f],0),new Dy(E,p,this.#e,this.#f,this.#n,this.#r)}const C=new Float64Array(this.#a.length+24+this.#t.length);let A=e.length;for(let E=0;E<A;E+=2){if(isNaN(e[E])){C[E]=C[E+1]=NaN;continue}C[E]=e[E],C[E+1]=e[E+1]}C.set([NaN,NaN,NaN,NaN,(r[0]-l)/d,(r[1]-u)/f,NaN,NaN,NaN,NaN,m,x,NaN,NaN,NaN,NaN,b,w,NaN,NaN,NaN,NaN,(s[0]-l)/d,(s[1]-u)/f],A),A+=24;for(let E=n.length-6;E>=6;E-=6)for(let k=0;k<6;k+=2){if(isNaN(n[E+k])){C[A]=C[A+1]=NaN,A+=2;continue}C[A]=n[E+k],C[A+1]=n[E+k+1],A+=2}return C.set([NaN,NaN,NaN,NaN,n[4],n[5]],A),new Dy(C,p,this.#e,this.#f,this.#n,this.#r)}}class Dy extends QP{#e;#t=null;#n;#r;#a;#i;#s;constructor(e,n,i,r,s,l){super(),this.#s=e,this.#a=n,this.#e=i,this.#i=r,this.#n=s,this.#r=l,this.#d(l);const{x:u,y:d,width:f,height:p}=this.#t;for(let m=0,x=e.length;m<x;m+=2)e[m]=(e[m]-u)/f,e[m+1]=(e[m+1]-d)/p;for(let m=0,x=n.length;m<x;m+=2)n[m]=(n[m]-u)/f,n[m+1]=(n[m+1]-d)/p}toSVGPath(){const e=[`M${this.#s[4]} ${this.#s[5]}`];for(let n=6,i=this.#s.length;n<i;n+=6){if(isNaN(this.#s[n])){e.push(`L${this.#s[n+4]} ${this.#s[n+5]}`);continue}e.push(`C${this.#s[n]} ${this.#s[n+1]} ${this.#s[n+2]} ${this.#s[n+3]} ${this.#s[n+4]} ${this.#s[n+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,n,i,r],s){const l=i-e,u=r-n;let d,f;switch(s){case 0:d=this.#c(this.#s,e,r,l,-u),f=this.#c(this.#a,e,r,l,-u);break;case 90:d=this.#l(this.#s,e,n,l,u),f=this.#l(this.#a,e,n,l,u);break;case 180:d=this.#c(this.#s,i,n,-l,u),f=this.#c(this.#a,i,n,-l,u);break;case 270:d=this.#l(this.#s,i,r,-l,-u),f=this.#l(this.#a,i,r,-l,-u);break}return{outline:Array.from(d),points:[Array.from(f)]}}#c(e,n,i,r,s){const l=new Float64Array(e.length);for(let u=0,d=e.length;u<d;u+=2)l[u]=n+e[u]*r,l[u+1]=i+e[u+1]*s;return l}#l(e,n,i,r,s){const l=new Float64Array(e.length);for(let u=0,d=e.length;u<d;u+=2)l[u]=n+e[u+1]*r,l[u+1]=i+e[u]*s;return l}#d(e){const n=this.#s;let i=n[4],r=n[5],s=i,l=r,u=i,d=r,f=i,p=r;const m=e?Math.max:Math.min;for(let A=6,E=n.length;A<E;A+=6){if(isNaN(n[A]))s=Math.min(s,n[A+4]),l=Math.min(l,n[A+5]),u=Math.max(u,n[A+4]),d=Math.max(d,n[A+5]),p<n[A+5]?(f=n[A+4],p=n[A+5]):p===n[A+5]&&(f=m(f,n[A+4]));
758else{const k=Ke.bezierBoundingBox(i,r,...n.slice(A,A+6));s=Math.min(s,k[0]),l=Math.min(l,k[1]),u=Math.max(u,k[2]),d=Math.max(d,k[3]),p<k[3]?(f=k[2],p=k[3]):p===k[3]&&(f=m(f,k[2]))}i=n[A+4],r=n[A+5]}const x=s-this.#n,b=l-this.#n,w=u-s+2*this.#n,C=d-l+2*this.#n;this.#t={x,y:b,width:w,height:C,lastPoint:[f,p]}}get box(){return this.#t}getNewOutline(e,n){const{x:i,y:r,width:s,height:l}=this.#t,[u,d,f,p]=this.#e,m=s*f,x=l*p,b=i*f+u,w=r*p+d,C=new Xo({x:this.#a[0]*m+b,y:this.#a[1]*x+w},this.#e,this.#i,e,this.#r,n??this.#n);for(let A=2;A<this.#a.length;A+=2)C.add({x:this.#a[A]*m+b,y:this.#a[A+1]*x+w});return C.getOutlines()}}class ds{#e=this.#m.bind(this);#t=this.#v.bind(this);#n=null;#r=null;#a;#i=null;#s=!1;#c=!1;#l=null;#d;#f=null;#u;static get _keyboardManager(){return Rt(this,"_keyboardManager",new uh([[["Escape","mac+Escape"],ds.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ds.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ds.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ds.prototype._moveToPrevious],[["Home","mac+Home"],ds.prototype._moveToBeginning],[["End","mac+End"],ds.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:n=null}){e?(this.#c=!1,this.#u=dt.HIGHLIGHT_COLOR,this.#l=e):(this.#c=!0,this.#u=dt.HIGHLIGHT_DEFAULT_COLOR),this.#f=e?._uiManager||n,this.#d=this.#f._eventBus,this.#a=e?.color||this.#f?.highlightColors.values().next().value||"#FFFF98"}renderButton(){const e=this.#n=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0),e.addEventListener("click",this.#h.bind(this)),e.addEventListener("keydown",this.#e);const n=this.#r=document.createElement("span");return n.className="swatch",n.setAttribute("aria-hidden",!0),n.style.backgroundColor=this.#a,e.append(n),e}renderMainDropdown(){const e=this.#i=this.#o();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#o(){const e=document.createElement("div");e.addEventListener("contextmenu",zi),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[n,i]of this.#f.highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",i),r.title=n,r.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${n}`);const s=document.createElement("span");r.append(s),s.className="swatch",s.style.backgroundColor=i,r.setAttribute("aria-selected",i===this.#a),r.addEventListener("click",this.#p.bind(this,i)),e.append(r)}return e.addEventListener("keydown",this.#e),e}#p(e,n){n.stopPropagation(),this.#d.dispatch("switchannotationeditorparams",{source:this,type:this.#u,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#n){this.#h(e);return}const n=e.target.getAttribute("data-color");n&&this.#p(n,e)}_moveToNext(e){if(!this.#g){this.#h(e);return}if(e.target===this.#n){this.#i.firstChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#i?.firstChild||e.target===this.#n){this.#g&&this._hideDropdownFromKeyboard();return}this.#g||this.#h(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#g){this.#h(e);return}this.#i.firstChild?.focus()}_moveToEnd(e){if(!this.#g){this.#h(e);return}this.#i.lastChild?.focus()}#m(e){ds._keyboardManager.exec(this,e)}#h(e){if(this.#g){this.hideDropdown();return}if(this.#s=e.detail===0,window.addEventListener("pointerdown",this.#t),this.#i){this.#i.classList.remove("hidden");return}const n=this.#i=this.#o();this.#n.append(n)}#v(e){this.#i?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#i?.classList.add("hidden"),window.removeEventListener("pointerdown",this.#t)}get#g(){return this.#i&&!this.#i.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#c){if(!this.#g){this.#l?.unselect();return}this.hideDropdown(),this.#n.focus({preventScroll:!0,focusVisible:this.#s})}}updateColor(e){if(this.#r&&(this.#r.style.backgroundColor=e),!this.#i)return;const n=this.#f.highlightColors.values();for(const i of this.#i.children)i.setAttribute("aria-selected",n.next().value===e)}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i?.remove(),this.#i=null}}class Dn extends ct{#e=null;#t=0;#n;#r=null;#a=null;#i=null;#s=null;#c=0;#l=null;#d=null;#f=null;#u=!1;#o=this.#C.bind(this);#p=null;#m;#h=null;#v="";#g;#b="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _l10nPromise;static _type="highlight";static _editorType=jt.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=Dn.prototype;return Rt(this,"_keyboardManager",new uh([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||Dn._defaultColor,this.#g=e.thickness||Dn._defaultThickness,this.#m=e.opacity||Dn._defaultOpacity,this.#n=e.boxes||null,this.#b=e.methodOfCreation||"",this.#v=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#u=!0,this.#E(e),this.#x()):(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#s=e.focusNode,this.#c=e.focusOffset,this.#w(),this.#x(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#u?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#g,methodOfCreation:this.#b}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("
758color").size}}#w(){const e=new Py(this.#n,.001);this.#d=e.getOutlines(),{x:this.x,y:this.y,width:this.width,height:this.height}=this.#d.box;const n=new Py(this.#n,.0025,.001,this._uiManager.direction==="ltr");this.#i=n.getOutlines();const{lastPoint:i}=this.#i.box;this.#p=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#E({highlightOutlines:e,highlightId:n,clipPathId:i}){this.#d=e;const r=1.5;if(this.#i=e.getNewOutline(this.#g/2+r,.0025),n>=0)this.#f=n,this.#r=i,this.parent.drawLayer.finalizeLine(n,e),this.#h=this.parent.drawLayer.highlightOutline(this.#i);else if(this.parent){const p=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#f,e),this.parent.drawLayer.updateBox(this.#f,Dn.#S(this.#d.box,(p-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#h,this.#i),this.parent.drawLayer.updateBox(this.#h,Dn.#S(this.#i.box,p))}const{x:s,y:l,width:u,height:d}=e.box;switch(this.rotation){case 0:this.x=s,this.y=l,this.width=u,this.height=d;break;case 90:{const[p,m]=this.parentDimensions;this.x=l,this.y=1-s,this.width=u*m/p,this.height=d*p/m;break}case 180:this.x=1-s,this.y=1-l,this.width=u,this.height=d;break;case 270:{const[p,m]=this.parentDimensions;this.x=1-l,this.y=s,this.width=u*m/p,this.height=d*p/m;break}}const{lastPoint:f}=this.#i.box;this.#p=[(f[0]-s)/u,(f[1]-l)/d]}static initialize(e,n){ct.initialize(e,n),Dn._defaultColor||=n.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,n){switch(e){case dt.HIGHLIGHT_DEFAULT_COLOR:Dn._defaultColor=n;break;case dt.HIGHLIGHT_THICKNESS:Dn._defaultThickness=n;break}}translateInPage(e,n){}get toolbarPosition(){return this.#p}updateParams(e,n){switch(e){case dt.HIGHLIGHT_COLOR:this.#A(n);break;case dt.HIGHLIGHT_THICKNESS:this.#j(n);break}}static get defaultPropertiesToUpdate(){return[[dt.HIGHLIGHT_DEFAULT_COLOR,Dn._defaultColor],[dt.HIGHLIGHT_THICKNESS,Dn._defaultThickness]]}get propertiesToUpdate(){return[[dt.HIGHLIGHT_COLOR,this.color||Dn._defaultColor],[dt.HIGHLIGHT_THICKNESS,this.#g||Dn._defaultThickness],[dt.HIGHLIGHT_FREE,this.#u]]}#A(e){const n=r=>{this.color=r,this.parent?.drawLayer.changeColor(this.#f,r),this.#a?.updateColor(r)},i=this.color;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#j(e){const n=this.#g,i=r=>{this.#g=r,this.#k(r)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#a=new ds({editor:this}),e.addColorPicker(this.#a)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#_())}getBaseTranslation(){return[0,0]}getRect(e,n){return super.getRect(e,n,this.#_())}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#y(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#x(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let n=!1;this.parent&&!e?this.#y():e&&(this.#x(e),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),n&&this.select()}#k(e){if(!this.#u)return;this.#E({highlightOutlines:this.#d.getNewOutline(e/2)}),this.fixAndSetPosition();const[n,i]=this.parentDimensions;this.setDims(this.width*n,this.height*i)}#y(){this.#f===null||!this.parent||(this.parent.drawLayer.remove(this.#f),this.#f=null,this.parent.drawLayer.remove(this.#h),this.#h=null)}#x(e=this.parent){this.#f===null&&({id:this.#f,clipPathId:this.#r}=e.drawLayer.highlight(this.#d,this.color,this.#m),this.#h=e.drawLayer.highlightOutline(this.#i),this.#l&&(this.#l.
758style.clipPath=this.#r))}static#S({x:e,y:n,width:i,height:r},s){switch(s){case 90:return{x:1-n-r,y:e,width:r,height:i};case 180:return{x:1-e-i,y:1-n-r,width:i,height:r};case 270:return{x:n,y:1-e-i,width:r,height:i}}return{x:e,y:n,width:i,height:r}}rotate(e){const{drawLayer:n}=this.parent;let i;this.#u?(e=(e-this.rotation+360)%360,i=Dn.#S(this.#d.box,e)):i=Dn.#S(this,e),n.rotate(this.#f,e),n.rotate(this.#h,e),n.updateBox(this.#f,i),n.updateBox(this.#h,Dn.#S(this.#i.box,e))}render(){if(this.div)return this.div;const e=super.render();this.#v&&(e.setAttribute("aria-label",this.#v),e.setAttribute("role","mark")),this.#u?e.classList.add("free"):this.div.addEventListener("keydown",this.#o);const n=this.#l=document.createElement("div");e.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=this.#r;const[i,r]=this.parentDimensions;return this.setDims(this.width*i,this.height*r),im(this,this.#l,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.parent.drawLayer.addClass(this.#h,"hovered")}pointerleave(){this.parent.drawLayer.removeClass(this.#h,"hovered")}#C(e){Dn._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#T(!0);break;case 1:case 3:this.#T(!1);break}}#T(e){if(!this.#e)return;const n=window.getSelection();e?n.setPosition(this.#e,this.#t):n.setPosition(this.#s,this.#c)}select(){super.select(),this.#h&&(this.parent?.drawLayer.removeClass(this.#h,"hovered"),this.parent?.drawLayer.addClass(this.#h,"selected"))}unselect(){super.unselect(),this.#h&&(this.parent?.drawLayer.removeClass(this.#h,"selected"),this.#u||this.#T(!1))}get _mustFixPosition(){return!this.#u}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.show(this.#f,e),this.parent.drawLayer.show(this.#h,e))}#_(){return this.#u?this.rotation:0}#D(){if(this.#u)return null;const[e,n]=this.pageDimensions,i=this.#n,r=new Array(i.length*8);let s=0;for(const{x:l,y:u,width:d,height:f}of i){const p=l*e,m=(1-u-f)*n;r[s]=r[s+4]=p,r[s+1]=r[s+3]=m,r[s+2]=r[s+6]=p+d*e,r[s+5]=r[s+7]=m+f*n,s+=8}return r}#R(e){return this.#d.serialize(e,this.#_())}static startHighlighting(e,n,{target:i,x:r,y:s}){const{x:l,y:u,width:d,height:f}=i.getBoundingClientRect(),p=w=>{this.#L(e,w)},m={capture:!0,passive:!1},x=w=>{w.preventDefault(),w.stopPropagation()},b=w=>{i.removeEventListener("pointermove",p),window.removeEventListener("blur",b),window.removeEventListener("pointerup",b),window.removeEventListener("pointerdown",x,m),window.removeEventListener("contextmenu",zi),this.#P(e,w)};window.addEventListener("blur",b),window.addEventListener("pointerup",b),window.addEventListener("pointerdown",x,m),window.addEventListener("contextmenu",zi),i.addEventListener("pointermove",p),this._freeHighlight=new Xo({x:r,y:s},[l,u,d,f],e.scale,this._defaultThickness/2,n,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static#L(e,n){this._freeHighlight.add(n)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#P(e,n){this._freeHighlight.isEmpty()?e.drawLayer.removeFreeHighlight(this._freeHighlightId):e.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(e,n,i){const r=super.deserialize(e,n,i),{rect:[s,l,u,d],color:f,quadPoints:p}=e;r.color=Ke.makeHexColor(...f),r.#m=e.opacity;const[m,x]=r.pageDimensions;r.width=(u-s)/m,r.height=(d-l)/x;const b=r.#n=[];for(let w=0;w<p.length;w+=8)b.push({x:(p[4]-u)/m,y:(d-(1-p[w+5]))/x,width:(p[w+2]-p[w])/m,height:(p[w+5]-p[w+1])/x});return r.#w(),r}serialize(e=!1){if(this.isEmpty()||e)return null;const n=this.getRect(0,0),i=ct._colorManager.convert(this.color);return{annotationType:jt.HIGHLIGHT,color:i,opacity:this.#m,thickness:this.#g,quadPoints:this.#D(),outlines:this.#R(n),pageIndex:this.pageIndex,rect:n,rotation:this.#_(),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}class ri extends ct{#e=0;#t=0;#n=this.canvasPointermove.bind(this);#r=this.canvasPointerleave.bind(this);#a=this.canvasPointerup.bind(this);#i=this.canvasPointerdown.bind(this);#s=null;#c=new Path2D;#l=!1;#d=!1;#f=!1;#u=null;#o=0;#p=0;#m=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=jt.INK;constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e,n){ct.initialize(e,n)}static updateDefaultParams(e,n){switch(e){case dt.INK_THICKNESS:ri._defaultThickness=n;break;case dt.INK_COLOR:ri._defaultColor=n;break;case dt.INK_OPACITY:ri._defaultOpacity=n/100;break}}updateParams(e,n){switch(e){case dt.INK_THICKNESS:this.#h(n);break;case dt.INK_COLOR:this.#v(n);break;case dt.INK_OPACITY:this.#g(n);break}}static get defaultPropertiesToUpdate(){return[[dt.INK_THICKNESS,ri._defaultThickness],[dt.INK_COLOR,ri._defaultColor||ct._defaultLineColor],[dt.INK_OPACITY,Math.round(ri._defaultOpacity*100)]]}get propertiesToUpdate(){return[[dt.INK_THICKNESS,this.thickness||ri._defaultThickness],[dt.INK_COLOR,this.color||ri._defaultColor||ct._defaultLineColor],[dt.INK_OPACITY,Math.round(100*(this.opacity??ri._defaultOpacity))]]}#h(e){const n=r=>{this.thickness=r,this.#M()},i=this.thickness;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#v(e){const n=r=>{this.color=r,this.#C()},i=this.color;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#g(e){const n=r=>{this.opacity=r,this.#C()};e/=100;const i=this.opacity;this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:dt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(this.#_(),this.#D()),this.isAttachedToDOM||(this.parent.add(this),this.#R()),this.#M()))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#s&&(clearTimeout(this.#s),this.#s=null),this.#u.disconnect(),this.#u=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&e===null&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,n]=this.parentDimensions,i=this.width*e,r=this.height*n;this.setDimensions(i,r)}
758enableEditMode(){this.#l||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#i))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#i))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}#b(){const{parentRotation:e,parentDimensions:[n,i]}=this;switch(e){case 90:return[0,i,i,n];case 180:return[n,i,n,i];case 270:return[n,0,i,n];default:return[0,0,n,i]}}#w(){const{ctx:e,color:n,opacity:i,thickness:r,parentScale:s,scaleFactor:l}=this;e.lineWidth=r*s/l,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${n}${ZZ(i)}`}#E(e,n){this.canvas.addEventListener("contextmenu",zi),this.canvas.addEventListener("pointerleave",this.#r),this.canvas.addEventListener("pointermove",this.#n),this.canvas.addEventListener("pointerup",this.#a),this.canvas.removeEventListener("pointerdown",this.#i),this.isEditing=!0,this.#f||(this.#f=!0,this.#R(),this.thickness||=ri._defaultThickness,this.color||=ri._defaultColor||ct._defaultLineColor,this.opacity??=ri._defaultOpacity),this.currentPath.push([e,n]),this.#d=!1,this.#w(),this.#m=()=>{this.#y(),this.#m&&window.requestAnimationFrame(this.#m)},window.requestAnimationFrame(this.#m)}#A(e,n){const[i,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===i&&n===r)return;const s=this.currentPath;let l=this.#c;if(s.push([e,n]),this.#d=!0,s.length<=2){l.moveTo(...s[0]),l.lineTo(e,n);return}s.length===3&&(this.#c=l=new Path2D,l.moveTo(...s[0])),this.#x(l,...s.at(-3),...s.at(-2),e,n)}#j(){if(this.currentPath.length===0)return;const e=this.currentPath.at(-1);this.#c.lineTo(...e)}#k(e,n){this.#m=null,e=Math.min(Math.max(e,0),this.canvas.width),n=Math.min(Math.max(n,0),this.canvas.height),this.#A(e,n),this.#j();let i;if(this.currentPath.length!==1)i=this.#S();else{const d=[e,n];i=[[d,d.slice(),d.slice(),d]]}const r=this.#c,s=this.currentPath;this.currentPath=[],this.#c=new Path2D;const l=()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(r),this._uiManager.rebuild(this)},u=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(this.#_(),this.#D()),this.#M())};this.addCommands({cmd:l,undo:u,mustExec:!0})}#y(){if(!this.#d)return;this.#d=!1;const e=Math.ceil(this.thickness*this.parentScale),n=this.currentPath.slice(-3),i=n.map(l=>l[0]),r=n.map(l=>l[1]);Math.min(...i)-e,Math.max(...i)+e,Math.min(...r)-e,Math.max(...r)+e;const{ctx:s}=this;s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const l of this.bezierPath2D)s.stroke(l);s.stroke(this.#c),s.restore()}#x(e,n,i,r,s,l,u){const d=(n+r)/2,f=(i+s)/2,p=(r+l)/2,m=(s+u)/2;e.bezierCurveTo(d+2*(r-d)/3,f+2*(s-f)/3,p+2*(r-p)/3,m+2*(s-m)/3,p,m)}#S(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const n=[];let i,[r,s]=e[0];for(i=1;i<e.length-2;i++){const[x,b]=e[i],[w,C]=e[i+1],A=(x+w)/2,E=(b+C)/2,k=[r+2*(x-r)/3,s+2*(b-s)/3],N=[A+2*(x-A)/3,E+2*(b-E)/3];n.push([[r,s],k,N,[A,E]]),[r,s]=[A,E]}const[l,u]=e[i],[d,f]=e[i+1],p=[r+2*(l-r)/3,s+2*(u-s)/3],m=[d+2*(l-d)/3,f+2*(u-f)/3];return n.push([[r,s],p,m,[d,f]]),n}#C(){if(this.isEmpty()){this.#P();return}this.#w();const{canvas:e,ctx:n}=this;n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,e.width,e.height),this.#P();for(const i of this.bezierPath2D)n.stroke(i)}commit(){this.#l||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#l=!0,this.div.classList.add("disabled"),this.#M(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){e.button!==0||!this.isInEditMode()||this.#l||(this.setInForeground(),e.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#E(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#A(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#T(e)}canvasPointerleave(e){this.#T(e)}#T(e){this.canvas.removeEventListener("pointerleave",this.#r),this.canvas.removeEventListener("pointermove",this.#n),this.canvas.removeEventListener("pointerup",this.#a),this.canvas.addEventListener("pointerdown",this.#i),this.#s&&clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#s=null,this.canvas.removeEventListener("contextmenu",zi)},10),this.#k(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
758d()}#_(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#D(){this.#u=new ResizeObserver(e=>{const n=e[0].contentRect;n.width&&n.height&&this.setDimensions(n.width,n.height)}),this.#u.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#l}render(){if(this.div)return this.div;let e,n;this.width&&(e=this.x,n=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,r,s,l]=this.#b();if(this.setAt(i,r,0,0),this.setDims(s,l),this.#_(),this.width){const[u,d]=this.parentDimensions;this.setAspectRatio(this.width*u,this.height*d),this.setAt(e*u,n*d,this.width*u,this.height*d),this.#f=!0,this.#R(),this.setDims(this.width*u,this.height*d),this.#C(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#D(),this.div}#R(){if(!this.#f)return;const[e,n]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*n),this.#P()}setDimensions(e,n){const i=Math.round(e),r=Math.round(n);if(this.#o===i&&this.#p===r)return;this.#o=i,this.#p=r,this.canvas.style.visibility="hidden";const[s,l]=this.parentDimensions;this.width=e/s,this.height=n/l,this.fixAndSetPosition(),this.#l&&this.#L(e,n),this.#R(),this.#C(),this.canvas.style.visibility="visible",this.fixDims()}#L(e,n){const i=this.#F(),r=(e-i)/this.#t,s=(n-i)/this.#e;this.scaleFactor=Math.min(r,s)}#P(){const e=this.#F()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#O(e){const n=new Path2D;for(let i=0,r=e.length;i<r;i++){const[s,l,u,d]=e[i];i===0&&n.moveTo(...s),n.bezierCurveTo(l[0],l[1],u[0],u[1],d[0],d[1])}return n}static#U(e,n,i){const[r,s,l,u]=n;switch(i){case 0:for(let d=0,f=e.length;d<f;d+=2)e[d]+=r,e[d+1]=u-e[d+1];break;case 90:for(let d=0,f=e.length;d<f;d+=2){const p=e[d];e[d]=e[d+1]+r,e[d+1]=p+s}break;case 180:for(let d=0,f=e.length;d<f;d+=2)e[d]=l-e[d],e[d+1]+=s;break;case 270:for(let d=0,f=e.length;d<f;d+=2){const p=e[d];e[d]=l-e[d+1],e[d+1]=u-p}break;default:throw new Error("Invalid rotation")}return e}static#G(e,n,i){const[r,s,l,u]=n;switch(i){case 0:for(let d=0,f=e.length;d<f;d+=2)e[d]-=r,e[d+1]=u-e[d+1];break;case 90:for(let d=0,f=e.length;d<f;d+=2){const p=e[d];e[d]=e[d+1]-s,e[d+1]=p-r}break;case 180:for(let d=0,f=e.length;d<f;d+=2)e[d]=l-e[d],e[d+1]-=s;break;case 270:for(let d=0,f=e.length;d<f;d+=2){const p=e[d];e[d]=u-e[d+1],e[d+1]=l-p}break;default:throw new Error("Invalid rotation")}return e}#V(e,n,i,r){const s=[],l=this.thickness/2,u=e*n+l,d=e*i+l;for(const f of this.paths){const p=[],m=[];for(let x=0,b=f.length;x<b;x++){const[w,C,A,E]=f[x];if(w[0]===E[0]&&w[1]===E[1]&&b===1){const D=e*w[0]+u,G=e*w[1]+d;p.push(D,G),m.push(D,G);break}const k=e*w[0]+u,N=e*w[1]+d,_=e*C[0]+u,R=e*C[1]+d,T=e*A[0]+u,L=e*A[1]+d,M=e*E[0]+u,U=e*E[1]+d;x===0&&(p.push(k,N),m.push(k,N)),p.push(_,R,T,L,M,U),m.push(_,R),x===b-1&&m.push(M,U)}s.push({bezier:ri.#U(p,r,this.rotation),points:ri.#U(m,r,this.rotation)})}return s}#B(){let e=1/0,n=-1/0,i=1/0,r=-1/0;for(const s of this.paths)for(const[l,u,d,f]of s){const p=Ke.bezierBoundingBox(...l,...u,...d,...f);e=Math.min(e,p[0]),i=Math.min(i,p[1]),n=Math.max(n,p[2]),r=Math.max(r,p[3])}return[e,i,n,r]}#F(){return this.#l?Math.ceil(this.thickness*this.parentScale):0}#M(e=!1){if(this.isEmpty())return;if(!this.#l){this.#C();return}const n=this.#B(),i=this.#F();this.#t=Math.max(ct.MIN_SIZE,n[2]-n[0]),this.#e=Math.max(ct.MIN_SIZE,n[3]-n[1]);const r=Math.ceil(i+this.#t*this.scaleFactor),s=Math.ceil(i+this.#e*this.scaleFactor),[l,u]=this.parentDimensions;this.width=r/l,this.height=s/u,this.setAspectRatio(r,s);const d=this.translationX,f=this.translationY;this.translationX=-n[0],this.translationY=-n[1],this.#R(),this.#C(),this.#o=r,this.#p=s,this.setDims(r,s);const p=e?i/this.scaleFactor/2:0;this.translate(d-this.translationX-p,f-this.translationY-p)}static deserialize(e,n,i){if(e instanceof YP)return null;const r=super.deserialize(e,n,i);r.thickness=e.thickness,r.color=Ke.makeHexColor(...e.color),r.opacity=e.opacity;const[s,l]=r.pageDimensions,u=r.width*s,d=r.height*l,f=r.parentScale,p=e.thickness/2;r.#l=!0,r.#o=Math.round(u),r.#p=Math.round(d);const{paths:m,rect:x,rotation:b}=e;for(let{bezier:C}of m){C=ri.#G(C,x,b);const A=[];r.paths.push(A);let E=f*(C[0]-p),k=f*(C[1]-p);for(let _=2,R=C.length;
758_<R;_+=6){const T=f*(C[_]-p),L=f*(C[_+1]-p),M=f*(C[_+2]-p),U=f*(C[_+3]-p),D=f*(C[_+4]-p),G=f*(C[_+5]-p);A.push([[E,k],[T,L],[M,U],[D,G]]),E=D,k=G}const N=this.#O(A);r.bezierPath2D.push(N)}const w=r.#B();return r.#t=Math.max(ct.MIN_SIZE,w[2]-w[0]),r.#e=Math.max(ct.MIN_SIZE,w[3]-w[1]),r.#L(u,d),r}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),n=ct._colorManager.convert(this.ctx.strokeStyle);return{annotationType:jt.INK,color:n,thickness:this.thickness,opacity:this.opacity,paths:this.#V(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class w0 extends ct{#e=null;#t=null;#n=null;#r=null;#a=null;#i="";#s=null;#c=null;#l=null;#d=!1;#f=!1;static _type="stamp";static _editorType=jt.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#r=e.bitmapUrl,this.#a=e.bitmapFile}static initialize(e,n){ct.initialize(e,n)}static get supportedTypes(){return Rt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(n=>`image/${n}`))}static get supportedTypesStr(){return Rt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,n){n.pasteEditor(jt.STAMP,{bitmapFile:e.getAsFile()})}#u(e,n=!1){if(!e){this.remove();return}this.#e=e.bitmap,n||(this.#t=e.id,this.#d=e.isSvg),e.file&&(this.#i=e.file.name),this.#m()}#o(){this.#n=null,this._uiManager.enableWaiting(!1),this.#s&&this.div.focus()}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(n=>this.#u(n,!0)).finally(()=>this.#o());return}if(this.#r){const n=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(n).then(i=>this.#u(i)).finally(()=>this.#o());return}if(this.#a){const n=this.#a;this.#a=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(n).then(i=>this.#u(i)).finally(()=>this.#o());return}const e=document.createElement("input");e.type="file",e.accept=w0.supportedTypesStr,this.#n=new Promise(n=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(e.files[0]);this.#u(i)}n()}),e.addEventListener("cancel",()=>{this.remove(),n()})}).finally(()=>this.#o()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#s?.remove(),this.#s=null,this.#c?.disconnect(),this.#c=null,this.#l&&(clearTimeout(this.#l),this.#l=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#s===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#a||this.#t)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,n;if(this.width&&(e=this.x,n=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#e?this.#m():this.#p(),this.width){const[i,r]=this.parentDimensions;this.setAt(e*i,n*r,this.width*i,this.height*r)}return this.div}#m(){const{div:e}=this;let{width:n,height:i}=this.#e;const[r,s]=this.pageDimensions,l=.75;if(this.width)n=this.width*r,i=this.height*s;else if(n>l*r||i>l*s){const p=Math.min(l*r/n,l*s/i);n*=p,i*=p}const[u,d]=this.parentDimensions;this.setDims(n*u/r,i*d/s),this._uiManager.enableWaiting(!1);const f=this.#s=document.createElement("canvas");e.append(f),e.hidden=!1,this.#g(n,i),this.#w(),this.#f||(this.parent.addUndoableEditor(this),this.#f=!0),this._reportTelemetry({action:"inserted_image"}),this.#i&&f.setAttribute("aria-label",this.#i)}#h(e,n){const[i,r]=this.parentDimensions;this.width=e/i,this.height=n/r,this.setDims(e,n),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this.#l!==null&&clearTimeout(this.#l);const s=200;this.#l=setTimeout(()=>{this.#l=null,this.#g(e,n)},s)}#v(e,n){const{width:i,height:r}=this.#e;let s=i,l=r,u=this.#e;for(;s>2*e||l>2*n;){const d=s,f=l;s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),l>2*n&&(l=l>=16384?Math.floor(l/2)-1:Math.ceil(l/2));const p=new OffscreenCanvas(s,l);p.getContext("2d").drawImage(u,0,0,d,f,0,0,s,l),u=p.transferToImageBitmap()}return u}#g(e,n){e=Math.ceil(e),n=Math.ceil(n);const i=this.#s;if(!i||i.width===e&&i.height===n)return;i.width=e,i.height=n;const r=this.#d?this.#e:this.#v(e,n);if(this._uiManager.hasMLManager&&!this.hasAltText()){const u=new OffscreenCanvas(e,n).getContext("2d");u.drawImage(r,0,0,r.width,r.height,0,0,e,n),this._uiManager.mlGuess({service:"image-to-text",request:{data:u.getImageData(0,0,e,n).data,width:e,height:n,
758channels:4}}).then(d=>{const f=d?.output||"";this.parent&&f&&!this.hasAltText()&&(this.altTextData={altText:f,decorative:!1})})}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(r,0,0,r.width,r.height,0,0,e,n)}getImageForAltText(){return this.#s}#b(e){if(e){if(this.#d){const r=this._uiManager.imageManager.getSvgUrl(this.#t);if(r)return r}const n=document.createElement("canvas");return{width:n.width,height:n.height}=this.#e,n.getContext("2d").drawImage(this.#e,0,0),n.toDataURL()}if(this.#d){const[n,i]=this.pageDimensions,r=Math.round(this.width*n*Fc.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*Fc.PDF_TO_CSS_UNITS),l=new OffscreenCanvas(r,s);return l.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,r,s),l.transferToImageBitmap()}return structuredClone(this.#e)}#w(){this.#c=new ResizeObserver(e=>{const n=e[0].contentRect;n.width&&n.height&&this.#h(n.width,n.height)}),this.#c.observe(this.div)}static deserialize(e,n,i){if(e instanceof XP)return null;const r=super.deserialize(e,n,i),{rect:s,bitmapUrl:l,bitmapId:u,isSvg:d,accessibilityData:f}=e;u&&i.imageManager.isValidId(u)?r.#t=u:r.#r=l,r.#d=d;const[p,m]=r.pageDimensions;return r.width=(s[2]-s[0])/p,r.height=(s[3]-s[1])/m,f&&(r.altTextData=f),r}serialize(e=!1,n=null){if(this.isEmpty())return null;const i={annotationType:jt.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#d,structTreeParentId:this._structTreeParentId};if(e)return i.bitmapUrl=this.#b(!0),i.accessibilityData=this.altTextData,i;const{decorative:r,altText:s}=this.altTextData;if(!r&&s&&(i.accessibilityData={type:"Figure",alt:s}),n===null)return i;n.stamps||=new Map;const l=this.#d?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!n.stamps.has(this.#t))n.stamps.set(this.#t,{area:l,serialized:i}),i.bitmap=this.#b(!1);else if(this.#d){const u=n.stamps.get(this.#t);l>u.area&&(u.area=l,u.serialized.bitmap.close(),u.serialized.bitmap=this.#b(!1))}return i}}class la{#e;#t=!1;#n=null;#r=null;#a=null;#i=null;#s=null;#c=new Map;#l=!1;#d=!1;#f=!1;#u=null;#o;static _initialized=!1;static#p=new Map([Hn,ri,w0,Dn].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:n,div:i,accessibilityManager:r,annotationLayer:s,drawLayer:l,textLayer:u,viewport:d,l10n:f}){const p=[...la.#p.values()];if(!la._initialized){la._initialized=!0;for(const m of p)m.initialize(f,e)}e.registerEditorTypes(p),this.#o=e,this.pageIndex=n,this.div=i,this.#e=r,this.#n=s,this.viewport=d,this.#u=u,this.drawLayer=l,this.#o.addLayer(this)}get isEmpty(){return this.#c.size===0}get isInvisible(){return this.isEmpty&&this.#o.getMode()===jt.NONE}updateToolbar(e){this.#o.updateToolbar(e)}updateMode(e=this.#o.getMode()){switch(this.#b(),e){case jt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case jt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case jt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;for(const i of la.#p.values())n.toggle(`${i._type}Editing`,e===i._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#u?.div}addInkEditorIfNeeded(e){if(this.#o.getMode()!==jt.INK)return;if(!e){for(const i of this.#c.values())if(i.isEmpty()){i.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){this.#o.setEditingState(e)}addCommands(e){this.#o.addCommands(e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const i of this.#c.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#o.removeChangedExistingAnnotation(i),e.add(i.annotationElementId));if(!this.#n)return;const n=this.#n.getEditableAnnotations();for(const i of n){if(i.hide(),this.#o.isDeletedAnnotationElement(i.data.id)||e.has(i.data.id))continue;const r=this.deserialize(i);r&&(this.addOrRebuild(r),r.enableEditing())}}disable(){this.#f=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,n=new Map;for(const r of this.#c.values())if(r.disableEditing(),!!r.annotationElementId){if
758(r.serialize()!==null){e.set(r.annotationElementId,r);continue}else n.set(r.annotationElementId,r);this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()}if(this.#n){const r=this.#n.getEditableAnnotations();for(const s of r){const{id:l}=s.data;if(this.#o.isDeletedAnnotationElement(l))continue;let u=n.get(l);if(u){u.resetAnnotationElement(s),u.show(!1),s.show();continue}u=e.get(l),u&&(this.#o.addChangedExistingAnnotation(u),u.renderAnnotationElement(s),u.show(!1)),s.show()}}this.#b(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const r of la.#p.values())i.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#f=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#o.getActive()!==e&&this.#o.setActiveEditor(e)}enableTextSelection(){this.div.tabIndex=-1,this.#u?.div&&!this.#i&&(this.#i=this.#m.bind(this),this.#u.div.addEventListener("pointerdown",this.#i),this.#u.div.classList.add("highlighting"))}disableTextSelection(){this.div.tabIndex=0,this.#u?.div&&this.#i&&(this.#u.div.removeEventListener("pointerdown",this.#i),this.#i=null,this.#u.div.classList.remove("highlighting"))}#m(e){if(this.#o.unselectAll(),e.target===this.#u.div){const{isMac:n}=Mi.platform;if(e.button!==0||e.ctrlKey&&n)return;this.#o.showAllEditors("highlight",!0,!0),this.#u.div.classList.add("free"),Dn.startHighlighting(this,this.#o.direction==="ltr",e),this.#u.div.addEventListener("pointerup",()=>{this.#u.div.classList.remove("free")},{once:!0}),e.preventDefault()}}enableClick(){this.#a||(this.#a=this.pointerdown.bind(this),this.#r=this.pointerup.bind(this),this.div.addEventListener("pointerdown",this.#a),this.div.addEventListener("pointerup",this.#r))}disableClick(){this.#a&&(this.div.removeEventListener("pointerdown",this.#a),this.div.removeEventListener("pointerup",this.#r),this.#a=null,this.#r=null)}attach(e){this.#c.set(e.id,e);const{annotationElementId:n}=e;n&&this.#o.isDeletedAnnotationElement(n)&&this.#o.removeDeletedAnnotationElement(e)}detach(e){this.#c.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#f&&e.annotationElementId&&this.#o.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#o.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,this.#d||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#o.addDeletedAnnotationElement(e.annotationElementId),ct.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#o.addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),this.#o.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!this.#s&&(e._focusEventsAllowed=!1,this.#s=setTimeout(()=>{this.#s=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),n.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const n=()=>e._uiManager.rebuild(e),i=()=>{e.remove()};this.addCommands({cmd:n,undo:i,mustExec:!1})}getNextId(){return this.#o.getId()}get#h(){return la.#p.get(this.#o.getMode())}#v(e){const n=this.#h;return n?new n.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#h?.canCreateNewEmptyEditor()}pasteEditor(e,n){this.#o.updateToolbar(e),this.#o.updateMode(e);const{offsetX:i,offsetY:r}=this.#g(),s=this.getNextId(),l=this.#v({parent:this,id:s,x:i,y:r,uiManager:this.#o,isCentered:!0,...n});l&&this.add(l)}deserialize(e){return la.#p.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#o)||null}createAndAddNewEditor(e,n,i={}){const r=this.getNextId(),s=this.#v({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#o,isCentered:n,...i});return s&&this.add(s),s}#g(){const{x:e,y:n,width:i,height:r}=this.div.getBoundingClientRect(),s=Math.max(0,e),l=Math.max(0,n),u=Math.min(window.innerWidth,e+i),d=Math.min(window.innerHeight,n+r),f=(s+u)/2-e,p=(l+d)/2-n,[m,x]=this.viewport.rotation%180===0?[f,p]:[p,f];return{offsetX:m,offsetY:x}}addNewEditor(){this.createAndAddNewEditor(this.#g(),!0)}setSelected(e){this.#o.setSelected(e)}toggleSelected(e){this.#o.toggleSelected(e)}isSelected(e){return this.#o.isSelected(e)}unselect(e){this.#o.unselect(e)}pointerup(e){const{isMac:n}=Mi.platform;if(!(e.button!==0||e.ctrlKey&&n)&&e.target===this.div&&this.#l){if(this.#l=!1,!this.#t){this.#t=!0;return}if(this.#o.getMode()===jt.STAMP){this.#o.unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(this.#o.getMode()===jt.HIGHLIGHT&&this.enableTextSelection(),this.#l){this.#l=!1;return}const{isMac:n}=Mi.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;this.#l=!0;const i=this.#o.getActive();this.#t=!i||i.isEmpty()}findNewParent(e,n,i){const r=this.#o.findParent(n,i);return r===null||r===this?!1:(r.changeParent(e),!0)}destroy(){this.#o.getActive()?.parent===this&&(this.#o.commitOrRemove(),this.#o.setActiveEditor(null)),this.#s&&(clearTimeout(this.#s),this.#s=null);for(const e of this.#c.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#c.clear(),this.#o.removeLayer(this)}#b(){this.#d=!0;for(const e of this.#c.values())e.isEmpty()&&e.remove();this.#d=!1}render({viewport:e}){this.viewport=e,cl(this.div,e);for(const n of this.#o.getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){this.#o.commitOrRemove(),this.#b();const n=this.viewport.rotation,i=e.rotation;if(this.viewport=e,cl(this.div,{rotation:i}),n!==i)for(const r of this.#c.values())r.rotate(i);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return this.#o.viewParameters.realScale}}class ci{#e=null;#t=0;#n=new Map;#r=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#n.size>0)for(const n of this.#n.values())n.remove(),e.append(n);this.#e=e}}static get _svgFactory(){return Rt(this,"_svgFactory",new l0)}static#a(e,{x:n=0,y:i=0,width:r=1,height:s=1}={}){const{style:l}=e;l.top=`${100*i}%`,l.left=`${100*n}%`,l.width=`${100*r}%`,l.height=`${100*s}%`}#i(e){const n=ci._svgFactory.create(1,1,!0);return this.#e.append(n),n.setAttribute("aria-hidden",!0),ci.#a(n,e),n}#s(e,n){const i=ci._svgFactory.createElement("clipPath");e.append(i);const r=`clip_${n}`;i.setAttribute("id",r),i.setAttribute("clipPathUnits","objectBoundingBox");const s=ci._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${n}`),s.classList.add("clip"),r}highlight(e,n,i,r=!1){const s=this.#t++,l=this.#i(e.box);l.classList.add("highlight"),e.free&&l.classList.add("free");const u=ci._svgFactory.createElement("defs");l.append(u);const d=ci._svgFactory.createElement("path");u.append(d);const f=`path_p${this.pageIndex}_${s}`;d.setAttribute("id",f),d.setAttribute("d",e.toSVGPath()),r&&this.#r.set(s,d);const p=this.#s(u,f),m=ci._svgFactory.createElement("use");return l.append(m),l.setAttribute("fill",n),l.setAttribute("fill-opacity",i),m.setAttribute("href",`#${f}`),this.#n.set(s,l),{id:s,clipPathId:`url(#${p})`}}highlightOutline(e){const n=this.#t++,i=this.#i(e.box);i.classList.add("highlightOutline");const r=ci._svgFactory.createElement("defs");i.append(r);const s=ci._svgFactory.createElement("path");r.append(s);const l=`path_p${this.pageIndex}_${n}`;s.setAttribute("id",l),s.setAttribute("d",e.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke");let u;if(e.free){i.classList.add("free");const p=ci._svgFactory.createElement("mask");r.append(p),u=`mask_p${this.pageIndex}_${n}`,p.setAttribute("id",u),p.setAttribute("maskUnits","objectBoundingBox");const m=ci._svgFactory.createElement("rect");p.append(m),m.setAttribute("width","1"),m.setAttribute("height","1"),m.setAttribute("fill","white");const x=ci._svgFactory.createElement("use");p.append(x),x.setAttribute("href",`#${l}`),x.setAttribute("stroke","none"),x.setAttribute("fill","black"),x.setAttribute("fill-rule","nonzero"),x.classList.add("mask")}const d=ci._svgFactory.createElement("use");i.append(d),d.setAttribute("href",`#${l}`),u&&d.setAttribute("mask",`url(#${u})`);const f=d.cloneNode();return i.append(f),d.classList.add("mainOutline"),f.classList.add("secondaryOutline"),this.#n.set(n,i),n}finalizeLine(e,n){const i=this.#r.get(e);this.#r.delete(e),this.updateBox(e,n.box),i.setAttribute("d",n.toSVGPath())}updateLine(e,n){this.#n.get(e).firstChild.firstChild.setAttribute("d",n.toSVGPath())}removeFreeHighlight(e){this.remove(e),this.#r.delete(e)}updatePath(e,n){this.#r.get(e).setAttribute("d",n.toSVGPath())}updateBox(e,n){ci.#a(this.#n.get(e),n)}
758show(e,n){this.#n.get(e).classList.toggle("hidden",!n)}rotate(e,n){this.#n.get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){this.#n.get(e).setAttribute("fill",n)}changeOpacity(e,n){this.#n.get(e).setAttribute("fill-opacity",n)}addClass(e,n){this.#n.get(e).classList.add(n)}removeClass(e,n){this.#n.get(e).classList.remove(n)}remove(e){this.#e!==null&&(this.#n.get(e).remove(),this.#n.delete(e))}destroy(){this.#e=null;for(const e of this.#n.values())e.remove();this.#n.clear()}}var _ee=st.AbortException,Tee=st.AnnotationEditorLayer,Ree=st.AnnotationEditorParamsType,Pee=st.AnnotationEditorType,Dee=st.AnnotationEditorUIManager,ZP=st.AnnotationLayer,JP=st.AnnotationMode,Lee=st.CMapCompressionType,Oee=st.ColorPicker,Mee=st.DOMSVGFactory,Iee=st.DrawLayer,zee=st.FeatureTest,S0=st.GlobalWorkerOptions,Fee=st.ImageKind,$ee=st.InvalidPDFException,Uee=st.MissingPDFException,Bee=st.OPS,Hee=st.Outliner,Gee=st.PDFDataRangeTransport,Vee=st.PDFDateString,qee=st.PDFWorker,Kee=st.PasswordResponses,Wee=st.PermissionFlag,Yee=st.PixelsPerInch,Xee=st.RenderingCancelledException,eD=st.TextLayer,Qee=st.UnexpectedResponseException,Zee=st.Util,Jee=st.VerbosityLevel,ete=st.XfaLayer,tte=st.build,nte=st.createValidAbsoluteUrl,ite=st.fetchData,tD=st.getDocument,rte=st.getFilenameFromUrl,ste=st.getPdfFilenameFromUrl,ate=st.getXfaPageViewport,ote=st.isDataScheme,lte=st.isPdfFile,cte=st.noContextMenu,ute=st.normalizeUnicode,dte=st.renderTextLayer,hte=st.setLayerDimensions,fte=st.shadow,pte=st.updateTextLayer,mte=st.version;const gte=Object.freeze(Object.defineProperty({__proto__:null,AbortException:_ee,AnnotationEditorLayer:Tee,AnnotationEditorParamsType:Ree,AnnotationEditorType:Pee,AnnotationEditorUIManager:Dee,AnnotationLayer:ZP,AnnotationMode:JP,CMapCompressionType:Lee,ColorPicker:Oee,DOMSVGFactory:Mee,DrawLayer:Iee,FeatureTest:zee,GlobalWorkerOptions:S0,ImageKind:Fee,InvalidPDFException:$ee,MissingPDFException:Uee,OPS:Bee,Outliner:Hee,PDFDataRangeTransport:Gee,PDFDateString:Vee,PDFWorker:qee,PasswordResponses:Kee,PermissionFlag:Wee,PixelsPerInch:Yee,RenderingCancelledException:Xee,TextLayer:eD,UnexpectedResponseException:Qee,Util:Zee,VerbosityLevel:Jee,XfaLayer:ete,build:tte,createValidAbsoluteUrl:nte,fetchData:ite,getDocument:tD,getFilenameFromUrl:rte,getPdfFilenameFromUrl:ste,getXfaPageViewport:ate,isDataScheme:ote,isPdfFile:lte,noContextMenu:cte,normalizeUnicode:ute,renderTextLayer:dte,setLayerDimensions:hte,shadow:fte,updateTextLayer:pte,version:mte},Symbol.toStringTag,{value:"Module"}));var Qn=function(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},xte=["onCopy","onCut","onPaste"],vte=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],bte=["onFocus","onBlur"],yte=["onInput","onInvalid","onReset","onSubmit"],wte=["onLoad","onError"],Ste=["onKeyDown","onKeyPress","onKeyUp"],Cte=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],Ete=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],Ate=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],kte=["onSelect"],Nte=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],jte=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],_te=["onScroll"],Tte=["onWheel"],Rte=["onAnimationStart","onAnimationEnd","onAnimationIteration"],Pte=["onTransitionEnd"],Dte=["onToggle"],Lte=["onChange"],Ote=Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn(Qn([],xte,!0),vte,!0),bte,!0),yte,!0),wte,!0),Ste,!0),Cte,!0),Ete,!0),Ate,!0),kte,!0),Nte,!0),jte,!0),_te,!0),Tte,!0),Rte,!0),Pte,!0),Lte,!0),Dte,!0);function nD(t,e){var n={};return Ote.forEach(function(i){var r=t[i];r&&(e?n[i]=(function(s){return r(s,e(i))}):n[i]=r)}),n}function fh(t){var e=!1,n=new Promise(function(i,r){t.then(function(s){return!e&&i(s)}).catch(function(s){return!e&&r(s)})});return{promise:n,cancel:function(){e=!0}}}var Mte="Invariant failed";function Kt(t,e){if(!t)throw new Error(Mte)}var yb,_2;function Ite(){if(_2)return yb;_2=1;var t=function(){};return yb=t,yb}var zte=Ite();const hi=ml(zte);var T2=Object.prototype.hasOwnProperty;function R2(t,e,n){for(n of t.keys())if(_c(n,e))return n}function _c(t,e){var n,i,r;if(t===e)return!0;
758if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((i=t.length)===e.length)for(;i--&&_c(t[i],e[i]););return i===-1}if(n===Set){if(t.size!==e.size)return!1;for(i of t)if(r=i,r&&typeof r=="object"&&(r=R2(e,r),!r)||!e.has(r))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(i of t)if(r=i[0],r&&typeof r=="object"&&(r=R2(e,r),!r)||!_c(i[1],e.get(r)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((i=t.byteLength)===e.byteLength)for(;i--&&t.getInt8(i)===e.getInt8(i););return i===-1}if(ArrayBuffer.isView(t)){if((i=t.byteLength)===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}if(!n||typeof t=="object"){i=0;for(n in t)if(T2.call(t,n)&&++i&&!T2.call(e,n)||!(n in e)||!_c(t[n],e[n]))return!1;return Object.keys(e).length===i}}return t!==t&&e!==e}const iD=v.createContext(null);function Tc({children:t,type:e}){return o.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}const Fte="noopener noreferrer nofollow";class $te{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Kt(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){Kt(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(n=>{Kt(this.pdfDocument),Kt(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{Kt(Array.isArray(n));const i=n[0];new Promise(r=>{Kt(this.pdfDocument),i instanceof Object?this.pdfDocument.getPageIndex(i).then(s=>{r(s)}).catch(()=>{Kt(!1)}):typeof i=="number"?r(i):Kt(!1)}).then(r=>{const s=r+1;Kt(this.pdfViewer),Kt(s>=1&&s<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:r,pageNumber:s})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const n=e-1;Kt(this.pdfViewer),Kt(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,i){e.href=n,e.rel=this.externalLinkRel||Fte,e.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const P2={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Jm=typeof document<"u",rD=Jm&&window.location.protocol==="file:";function Ute(t){return typeof t<"u"}function qo(t){return Ute(t)&&t!==null}function Bte(t){return typeof t=="string"}function Hte(t){return t instanceof ArrayBuffer}function Gte(t){return Kt(Jm),t instanceof Blob}function Ly(t){return Bte(t)&&/^data:/.test(t)}function D2(t){Kt(Ly(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function Vte(){return Jm&&window.devicePixelRatio||1}const sD="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function L2(){hi(!rD,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${sD}`)}function qte(){hi(!rD,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${sD}`)}function dl(t){t&&t.cancel&&t.cancel()}function Oy(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function Kte(t){return t.name==="RenderingCancelledException"}function Wte(t){return new Promise((e,n)=>{const i=new FileReader;i.onload=()=>
758{if(!i.result)return n(new Error("Error while reading a file."));e(i.result)},i.onerror=r=>{if(!r.target)return n(new Error("Error while reading a file."));const{error:s}=r.target;if(!s)return n(new Error("Error while reading a file."));switch(s.code){case s.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case s.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case s.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},i.readAsArrayBuffer(t)})}function Yte(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function $c(){return v.useReducer(Yte,{value:void 0,error:void 0})}var Xte=function(t,e,n,i){function r(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function u(p){try{f(i.next(p))}catch(m){l(m)}}function d(p){try{f(i.throw(p))}catch(m){l(m)}}function f(p){p.done?s(p.value):r(p.value).then(u,d)}f((i=i.apply(t,e||[])).next())})},O2=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n};const{PDFDataRangeTransport:Qte}=gte,Zte=(t,e)=>{switch(e){case P2.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case P2.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function M2(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const Jte=v.forwardRef(function(e,n){var{children:i,className:r,error:s="Failed to load PDF file.",externalLinkRel:l,externalLinkTarget:u,file:d,inputRef:f,imageResourcesPath:p,loading:m="Loading PDF…",noData:x="No PDF file specified.",onItemClick:b,onLoadError:w,onLoadProgress:C,onLoadSuccess:A,onPassword:E=Zte,onSourceError:k,onSourceSuccess:N,options:_,renderMode:R,rotate:T}=e,L=O2(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[M,U]=$c(),{value:D,error:G}=M,[Z,Q]=$c(),{value:K,error:q}=Z,F=v.useRef(new $te),V=v.useRef([]),O=v.useRef(void 0),X=v.useRef(void 0);d&&d!==O.current&&M2(d)&&(hi(!_c(d,O.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),O.current=d),_&&_!==X.current&&(hi(!_c(_,X.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),X.current=_);const $=v.useRef({scrollPageIntoView:$e=>{const{dest:je,pageNumber:xt,pageIndex:Ae=xt-1}=$e;if(b){b({dest:je,pageIndex:Ae,pageNumber:xt});return}const at=V.current[Ae];if(at){at.scrollIntoView();return}hi(!1,`An internal link leading to page ${xt} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});v.useImperativeHandle(n,()=>({linkService:F,pages:V,viewer:$}),[]);function B(){N&&N()}function H(){G&&(hi(!1,G.toString()),k&&k(G))}function P(){U({type:"RESET"})}v.useEffect(P,[d,U]);const J=v.useCallback(()=>Xte(this,void 0,void 0,function*(){if(!d)return null;if(typeof d=="string")return Ly(d)?{data:D2(d)}:(L2(),{url:d});if(d instanceof Qte)return{range:d};if(Hte(d))return{data:d};if(Jm&&Gte(d))return{data:yield Wte(d)};
758if(Kt(typeof d=="object"),Kt(M2(d)),"url"in d&&typeof d.url=="string"){if(Ly(d.url)){const{url:$e}=d,je=O2(d,["url"]),xt=D2($e);return Object.assign({data:xt},je)}L2()}return d}),[d]);v.useEffect(()=>{const $e=fh(J());return $e.promise.then(je=>{U({type:"RESOLVE",value:je})}).catch(je=>{U({type:"REJECT",error:je})}),()=>{dl($e)}},[J,U]),v.useEffect(()=>{if(!(typeof D>"u")){if(D===!1){H();return}B()}},[D]);function he(){K&&(A&&A(K),V.current=new Array(K.numPages),F.current.setDocument(K))}function ue(){q&&(hi(!1,q.toString()),w&&w(q))}function W(){Q({type:"RESET"})}v.useEffect(W,[Q,D]);function fe(){if(!D)return;const $e=Object.assign(Object.assign({},D),_),je=tD($e);C&&(je.onProgress=C),E&&(je.onPassword=E);const xt=je;return xt.promise.then(Ae=>{Q({type:"RESOLVE",value:Ae})}).catch(Ae=>{xt.destroyed||Q({type:"REJECT",error:Ae})}),()=>{xt.destroy()}}v.useEffect(fe,[_,Q,D]),v.useEffect(()=>{if(!(typeof K>"u")){if(K===!1){ue();return}he()}},[K]);function se(){F.current.setViewer($.current),F.current.setExternalLinkRel(l),F.current.setExternalLinkTarget(u)}v.useEffect(se,[l,u]);function pe($e,je){V.current[$e]=je}function Ee($e){delete V.current[$e]}const Ce=v.useMemo(()=>({imageResourcesPath:p,linkService:F.current,onItemClick:b,pdf:K,registerPage:pe,renderMode:R,rotate:T,unregisterPage:Ee}),[p,b,K,R,T]),Ne=v.useMemo(()=>nD(L,()=>K),[L,K]);function qe(){return o.jsx(iD.Provider,{value:Ce,children:i})}function pt(){return d?K==null?o.jsx(Tc,{type:"loading",children:typeof m=="function"?m():m}):K===!1?o.jsx(Tc,{type:"error",children:typeof s=="function"?s():s}):qe():o.jsx(Tc,{type:"no-data",children:typeof x=="function"?x():x})}return o.jsx("div",Object.assign({className:Hc("react-pdf__Document",r),ref:f,style:{"--scale-factor":"1"}},Ne,{children:pt()}))});function aD(){return v.useContext(iD)}function oD(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean);if(n.length<=1){var i=n[0];return i||null}return function(s){n.forEach(function(l){typeof l=="function"?l(s):l&&(l.current=s)})}}const lD=v.createContext(null),cD={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},ene=/^H(\d+)$/;function tne(t){return t in cD}function eg(t){return"children"in t}function uD(t){return eg(t)?t.children.length===1&&0 in t.children&&"id"in t.children[0]:!1}function nne(t){const e={};if(eg(t)){const{role:n}=t,i=n.match(ene);if(i)e.role="heading",e["aria-level"]=Number(i[1]);else if(tne(n)){const r=cD[n];r&&(e.role=r)}}return e}function dD(t){const e={};if(eg(t)){if(t.alt!==void 0&&(e["aria-label"]=t.alt),t.lang!==void 0&&(e.lang=t.lang),uD(t)){const[n]=t.children;if(n){const i=dD(n);return Object.assign(Object.assign({},e),i)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function ine(t){return t?Object.assign(Object.assign({},nne(t)),dD(t)):null}function hD({className:t,node:e}){const n=v.useMemo(()=>ine(e),[e]),i=v.useMemo(()=>!eg(e)||uD(e)?null:e.children.map((r,s)=>o.jsx(hD,{node:r},s)),[e]);return o.jsx("span",Object.assign({className:t},n,{children:i}))}function tg(){return v.useContext(lD)}function rne(){const t=tg();Kt(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[i,r]=$c(),{value:s,error:l}=i,{customTextRenderer:u,page:d}=t;function f(){s&&n&&n(s)}function p(){l&&(hi(!1,l.toString()),e&&e(l))}function m(){r({type:"RESET"})}v.useEffect(m,[r,d]);function x(){if(u||!d)return;const b=fh(d.getStructTree()),w=b;return b.promise.then(C=>{r({type:"RESOLVE",value:C})}).catch(C=>{r({type:"REJECT",error:C})}),()=>dl(w)}return v.useEffect(x,[u,d,r]),v.useEffect(()=>{if(s!==void 0){if(s===!1){p();return}f()}},[s]),s?o.jsx(hD,{className:"react-pdf__Page__structTree structTree",node:s}):null}const I2=JP;function sne(t){const e=tg();Kt(e);const n=Object.assign(Object.assign({}
758,e),t),{_className:i,canvasBackground:r,devicePixelRatio:s=Vte(),onRenderError:l,onRenderSuccess:u,page:d,renderForms:f,renderTextLayer:p,rotate:m,scale:x}=n,{canvasRef:b}=t;Kt(d);const w=v.useRef(null);function C(){d&&u&&u(Oy(d,x))}function A(R){Kte(R)||(hi(!1,R.toString()),l&&l(R))}const E=v.useMemo(()=>d.getViewport({scale:x*s,rotation:m}),[s,d,m,x]),k=v.useMemo(()=>d.getViewport({scale:x,rotation:m}),[d,m,x]);function N(){if(!d)return;d.cleanup();const{current:R}=w;if(!R)return;R.width=E.width,R.height=E.height,R.style.width=`${Math.floor(k.width)}px`,R.style.height=`${Math.floor(k.height)}px`,R.style.visibility="hidden";const T={annotationMode:f?I2.ENABLE_FORMS:I2.ENABLE,canvasContext:R.getContext("2d",{alpha:!1}),viewport:E};r&&(T.background=r);const L=d.render(T),M=L;return L.promise.then(()=>{R.style.visibility="",C()}).catch(A),()=>dl(M)}v.useEffect(N,[r,w,s,d,f,E,k]);const _=v.useCallback(()=>{const{current:R}=w;R&&(R.width=0,R.height=0)},[w]);return v.useEffect(()=>_,[_]),o.jsx("canvas",{className:`${i}__canvas`,dir:"ltr",ref:oD(b,w),style:{display:"block",userSelect:"none"},children:p?o.jsx(rne,{}):null})}function ane(t){return"str"in t}function one(){const t=tg();Kt(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:i,onRenderTextLayerError:r,onRenderTextLayerSuccess:s,page:l,pageIndex:u,pageNumber:d,rotate:f,scale:p}=t;Kt(l);const[m,x]=$c(),{value:b,error:w}=m,C=v.useRef(null),A=v.useRef(void 0);hi(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function E(){b&&i&&i(b)}function k(){w&&(hi(!1,w.toString()),n&&n(w))}function N(){x({type:"RESET"})}v.useEffect(N,[l,x]);function _(){if(!l)return;const G=fh(l.getTextContent()),Z=G;return G.promise.then(Q=>{x({type:"RESOLVE",value:Q})}).catch(Q=>{x({type:"REJECT",error:Q})}),()=>dl(Z)}v.useEffect(_,[l,x]),v.useEffect(()=>{if(b!==void 0){if(b===!1){k();return}E()}},[b]);const R=v.useCallback(()=>{s&&s()},[s]),T=v.useCallback(G=>{hi(!1,G.toString()),r&&r(G)},[r]);function L(){const G=A.current;G&&G.classList.add("active")}function M(){const G=A.current;G&&G.classList.remove("active")}const U=v.useMemo(()=>l.getViewport({scale:p,rotation:f}),[l,f,p]);function D(){if(!l||!b)return;const{current:G}=C;if(!G)return;G.innerHTML="";const Z=l.streamTextContent({includeMarkedContent:!0}),Q={container:G,textContentSource:Z,viewport:U},K=new eD(Q),q=K;return K.render().then(()=>{const F=document.createElement("div");F.className="endOfContent",G.append(F),A.current=F;const V=G.querySelectorAll('[role="presentation"]');if(e){let O=0;b.items.forEach((X,$)=>{if(!ane(X))return;const B=V[O];if(!B)return;const H=e(Object.assign({pageIndex:u,pageNumber:d,itemIndex:$},X));B.innerHTML=H,O+=X.str&&X.hasEOL?2:1})}R()}).catch(T),()=>dl(q)}return v.useLayoutEffect(D,[e,T,R,l,u,d,b,U]),o.jsx("div",{className:Hc("react-pdf__Page__textContent","textLayer"),onMouseUp:M,onMouseDown:L,ref:C})}function lne(){const t=aD(),e=tg();Kt(e);const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:i,linkService:r,onGetAnnotationsError:s,onGetAnnotationsSuccess:l,onRenderAnnotationLayerError:u,onRenderAnnotationLayerSuccess:d,page:f,pdf:p,renderForms:m,rotate:x,scale:b=1}=n;Kt(p),Kt(f),Kt(r);const[w,C]=$c(),{value:A,error:E}=w,k=v.useRef(null);hi(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function N(){A&&l&&l(A)}function _(){E&&(hi(!1,E.toString()),s&&s(E))}function R(){C({type:"RESET"})}v.useEffect(R,[C,f]);function T(){if(!f)return;const G=fh(f.getAnnotations()),Z=G;return G.promise.then(Q=>{C({type:"RESOLVE",value:Q})}).catch(Q=>{C({type:"REJECT",error:Q})}),()=>{dl(Z)}}v.useEffect(T,[C,f,m]),v.useEffect(()=>{if(A!==void 0){if(A===!1){_();return}N()}},[A]);function L(){d&&d()}function M(G){hi(!1,`${G}`),u&&u(G)}const U=v.useMemo(()=>f.getViewport({scale:b,rotation:x}),[f,x,b]);function D(){if(!p||!f||!r||!A)return;const{current:G}=k;if(!G)return;const Z=U.clone({dontFlip:!0}),Q={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:G,l10n:null,page:f,viewport:Z},K={annotations:A,annotationStorage:p.annotationStorage,div:G,imageResourcesPath:i,linkService:r,page:f,renderForms:m,viewport:Z};G.innerHTML="";try{new ZP(Q).render(K),L()}catch(q){M(q)}return()=>{}}return v.useEffect(D,[A,i,r,f,m,U]),o.jsx("div",{className:Hc("react-pdf__Page__annotations","annotationLayer"),ref:k})}var cne=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n};const z2=1;function une(t){const e=aD(),n=Object.assign(Object.assign({},e),t),{_className:i="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackgroun
758d:s,canvasRef:l,children:u,className:d,customRenderer:f,customTextRenderer:p,devicePixelRatio:m,error:x="Failed to load the page.",height:b,inputRef:w,loading:C="Loading page…",noData:A="No page specified.",onGetAnnotationsError:E,onGetAnnotationsSuccess:k,onGetStructTreeError:N,onGetStructTreeSuccess:_,onGetTextError:R,onGetTextSuccess:T,onLoadError:L,onLoadSuccess:M,onRenderAnnotationLayerError:U,onRenderAnnotationLayerSuccess:D,onRenderError:G,onRenderSuccess:Z,onRenderTextLayerError:Q,onRenderTextLayerSuccess:K,pageIndex:q,pageNumber:F,pdf:V,registerPage:O,renderAnnotationLayer:X=!0,renderForms:$=!1,renderMode:B="canvas",renderTextLayer:H=!0,rotate:P,scale:J=z2,unregisterPage:he,width:ue}=n,W=cne(n,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[fe,se]=$c(),{value:pe,error:Ee}=fe,Ce=v.useRef(null);Kt(V);const Ne=qo(F)?F-1:q??null,qe=F??(qo(q)?q+1:null),pt=P??(pe?pe.rotate:null),$e=v.useMemo(()=>{if(!pe)return null;let nt=1;const en=J??z2;if(ue||b){const tn=pe.getViewport({scale:1,rotation:pt});ue?nt=ue/tn.width:b&&(nt=b/tn.height)}return en*nt},[b,pe,pt,J,ue]);function je(){return()=>{qo(Ne)&&r&&he&&he(Ne)}}v.useEffect(je,[r,V,Ne,he]);function xt(){if(M){if(!pe||!$e)return;M(Oy(pe,$e))}if(r&&O){if(!qo(Ne)||!Ce.current)return;O(Ne,Ce.current)}}function Ae(){Ee&&(hi(!1,Ee.toString()),L&&L(Ee))}function at(){se({type:"RESET"})}v.useEffect(at,[se,V,Ne]);function xe(){if(!V||!qe)return;const nt=fh(V.getPage(qe)),en=nt;return nt.promise.then(tn=>{se({type:"RESOLVE",value:tn})}).catch(tn=>{se({type:"REJECT",error:tn})}),()=>dl(en)}v.useEffect(xe,[se,V,Ne,qe,O]),v.useEffect(()=>{if(pe!==void 0){if(pe===!1){Ae();return}xt()}},[pe,$e]);const me=v.useMemo(()=>pe&&qo(Ne)&&qe&&qo(pt)&&qo($e)?{_className:i,canvasBackground:s,customTextRenderer:p,devicePixelRatio:m,onGetAnnotationsError:E,onGetAnnotationsSuccess:k,onGetStructTreeError:N,onGetStructTreeSuccess:_,onGetTextError:R,onGetTextSuccess:T,onRenderAnnotationLayerError:U,onRenderAnnotationLayerSuccess:D,onRenderError:G,onRenderSuccess:Z,onRenderTextLayerError:Q,onRenderTextLayerSuccess:K,page:pe,pageIndex:Ne,pageNumber:qe,renderForms:$,renderTextLayer:H,rotate:pt,scale:$e}:null,[i,s,p,m,E,k,N,_,R,T,U,D,G,Z,Q,K,pe,Ne,qe,$,H,pt,$e]),rt=v.useMemo(()=>nD(W,()=>pe&&($e?Oy(pe,$e):void 0)),[W,pe,$e]),ve=`${Ne}@${$e}/${pt}`;function Me(){switch(B){case"custom":return Kt(f),o.jsx(f,{},`${ve}_custom`);case"none":return null;case"canvas":default:return o.jsx(sne,{canvasRef:l},`${ve}_canvas`)}}function le(){return H?o.jsx(one,{},`${ve}_text`):null}function ye(){return X?o.jsx(lne,{},`${ve}_annotations`):null}function Ie(){return o.jsxs(lD.Provider,{value:me,children:[Me(),le(),ye(),u]})}function et(){return qe?V===null||pe===void 0||pe===null?o.jsx(Tc,{type:"loading",children:typeof C=="function"?C():C}):V===!1||pe===!1?o.jsx(Tc,{type:"error",children:typeof x=="function"?x():x}):Ie():o.jsx(Tc,{type:"no-data",children:typeof A=="function"?A():A})}return o.jsx("div",Object.assign({className:Hc(i,d),"data-page-number":qe,ref:oD(w,Ce),style:{"--scale-factor":`${$e}`,backgroundColor:s||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},rt,{children:et()}))}qte();S0.workerSrc="pdf.worker.mjs";S0.workerSrc="/pdf.worker.min.js";function dne(t,e){return v.useReducer((n,i)=>e[n][i]??n,t)}var C0="ScrollArea",[fD]=Er(C0),[hne,kr]=fD(C0),pD=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:i="hover",dir:r,scrollHideDelay:s=600,...l}=t,[u,d]=v.useState(null),[f,p]=v.useState(null),[m,x]=v.useState(null),[b,w]=v.useState(null),[C,A]=v.useState(null),[E,k]=v.useState(0),[N,_]=v.useState(0),[R,T]=v.useState(!1),[L,M]=v.useState(!1),U=Et(e,G=>
vendor: 13,271 bytes, line 758
758d(G)),D=ih(r);return o.jsx(hne,{scope:n,type:i,dir:D,scrollHideDelay:s,scrollArea:u,viewport:f,onViewportChange:p,content:m,onContentChange:x,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:R,onScrollbarXEnabledChange:T,scrollbarY:C,onScrollbarYChange:A,scrollbarYEnabled:L,onScrollbarYEnabledChange:M,onCornerWidthChange:k,onCornerHeightChange:_,children:o.jsx(Je.div,{dir:D,...l,ref:U,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});pD.displayName=C0;var mD="ScrollAreaViewport",gD=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:i,nonce:r,...s}=t,l=kr(mD,n),u=v.useRef(null),d=Et(e,u,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(Je.div,{"data-radix-scroll-area-viewport":"",...s,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});gD.displayName=mD;var Rs="ScrollAreaScrollbar",xD=v.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kr(Rs,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=r,u=t.orientation==="horizontal";return v.useEffect(()=>(u?s(!0):l(!0),()=>{u?s(!1):l(!1)}),[u,s,l]),r.type==="hover"?o.jsx(fne,{...i,ref:e,forceMount:n}):r.type==="scroll"?o.jsx(pne,{...i,ref:e,forceMount:n}):r.type==="auto"?o.jsx(vD,{...i,ref:e,forceMount:n}):r.type==="always"?o.jsx(E0,{...i,ref:e}):null});xD.displayName=Rs;var fne=v.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kr(Rs,t.__scopeScrollArea),[s,l]=v.useState(!1);return v.useEffect(()=>{const u=r.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},p=()=>{d=window.setTimeout(()=>l(!1),r.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",p)}}},[r.scrollArea,r.scrollHideDelay]),o.jsx(mi,{present:n||s,children:o.jsx(vD,{"data-state":s?"visible":"hidden",...i,ref:e})})}),pne=v.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kr(Rs,t.__scopeScrollArea),s=t.orientation==="horizontal",l=ig(()=>d("SCROLL_END"),100),[u,d]=dne("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,r.scrollHideDelay,d]),v.useEffect(()=>{const f=r.viewport,p=s?"scrollLeft":"scrollTop";if(f){let m=f[p];const x=()=>{const b=f[p];m!==b&&(d("SCROLL"),l()),m=b};return f.addEventListener("scroll",x),()=>f.removeEventListener("scroll",x)}},[r.viewport,s,d,l]),o.jsx(mi,{present:n||u!=="hidden",children:o.jsx(E0,{"data-state":u==="hidden"?"hidden":"visible",...i,ref:e,onPointerEnter:Pe(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Pe(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),vD=v.forwardRef((t,e)=>{const n=kr(Rs,t.__scopeScrollArea),{forceMount:i,...r}=t,[s,l]=v.useState(!1),u=t.orientation==="horizontal",d=ig(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?f:p)}},10);return Uc(n.viewport,d),Uc(n.content,d),o.jsx(mi,{present:i||s,children:o.jsx(E0,{"data-state":s?"visible":"hidden",...r,ref:e})})}),E0=v.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,r=kr(Rs,t.__scopeScrollArea),s=v.useRef(null),l=v.useRef(0),[u,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=CD(u.viewport,u.content),p={...i,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:x=>s.current=x,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:x=>l.current=x};function m(x,b){return yne(x,l.current,u,b)}return n==="horizontal"?o.jsx(mne,{...p,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const x=r.viewport.scrollLeft,b=F2(x,u,r.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{r.viewport&&(r.viewport.scrollLeft=x)},onDragScroll:x=>{r.viewport&&(r.viewport.scrollLeft=m(x,r.dir))}}):n==="vertical"?o.jsx(gne,{...p,ref:e,onThumbPositionChange:()=>{if(r.viewport&&s.current){const x=r.viewport.scrollTop,b=F2(x,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{r.viewport&&(r.viewport.scrollTop=x)},onDragScroll:x=>{r.viewport&&(r.viewport.scrollTop=m(x))}}):null}),mne=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...r}=t,s=kr(Rs,t.__scopeScrollArea),[l,u]=v.useState(),d=v.useRef(null),f=Et(e,d,s.onScrollbarXChange);return v.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),o.jsx(yD,{"data-orientation":"horizontal",...r,ref:f,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ng(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(s.viewport){const x=s.viewport.scrollLeft+p.deltaX;t.onWheelScroll(x),AD(x,m)&&p.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:om(l.paddingLeft),paddingEnd:om(l.paddingRight)}})}})}),gne=v.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,...r}=t,s=kr(Rs,t.__scopeScrollArea),[l,u]=v.useState(),d=v.useRef(null),f=Et(e,d,s.onScrollbarYChange);return v.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),o.jsx(yD,{"data-orientation":"vertical",...r,ref:f,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ng(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(s.viewport){const x=s.viewport.scrollTop+p.deltaY;t.onWheelScroll(x),AD(x,m)&&p.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:om(l.paddingTop),paddingEnd:om(l.paddingBottom)}})}})}),[xne,bD]=fD(Rs),yD=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:r,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...x}=t,b=kr(Rs,n),[w,C]=v.useState(null),A=Et(e,U=>C(U)),E=v.useRef(null),k=v.useRef(""),N=b.viewport,_=i.content-i.viewport,R=Zn(p),T=Zn(d),L=ig(m,10);function M(U){if(E.current){const D=U.clientX-E.current.left,G=U.clientY-E.current.top;f({x:D,y:G})}}return v.useEffect(()=>{const U=D=>{const G=D.target;w?.contains(G)&&R(D,_)};return document.addEventListener("wheel",U,{passive:!1}),()=>document.removeEventListener("wheel",U,{passive:!1})},[N,w,_,R]),v.useEffect(T,[i,T]),Uc(w,L),Uc(b.content,L),o.jsx(xne,{scope:n,scrollbar:w,hasThumb:r,onThumbChange:Zn(s),onThumbPointerUp:Zn(l),onThumbPositionChange:T,onThumbPointerDown:Zn(u),children:o.jsx(Je.div,{...x,ref:A,style:{position:"absolute",...x.style},onPointerDown:Pe(t.onPointerDown,U=>{U.button===0&&(U.target.setPointerCapture(U.pointerId),E.current=w.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),M(U))}),onPointerMove:Pe(t.onPointerMove,M),onPointerUp:Pe(t.onPointerUp,U=>{const D=U.target;D.hasPointerCapture(U.pointerId)&&D.releasePointerCapture(U.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),E.current=null})})})}),am="ScrollAreaThumb",wD=v.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=bD(am,t.__scopeScrollArea);return o.jsx(mi,{present:n||r.hasThumb,children:o.jsx(vne,{ref:e,...i})})}),vne=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:i,...r}=t,s=kr(am,n),l=bD(am,n),{onThumbPositionChange:u}=l,d=Et(e,m=>l.onThumbChange(m)),f=v.useRef(void 0),p=ig(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const m=s.viewport;if(m){const x=()=>{if(p(),!f.current){const b=wne(m,u);f.current=b,u()}};return u(),m.addEventListener("scroll",x),()=>m.removeEventListener("scroll",x)}},[s.viewport,p,u]),o.jsx(Je.div,{"data-state":l.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Pe(t.onPointerDownCapture,m=>{const b=m.target.getBoundingClientRect(),w=m.clientX-b.left,C=m.clientY-b.top;l.onThumbPointerDown({x:w,y:C})}),onPointerUp:Pe(t.onPointerUp,l.onThumbPointerUp)})});wD.displayName=am;var A0="ScrollAreaCorner",SD=v.forwardRef((t,e)=>{const n=kr(A0,t.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?o.jsx(bne,{...t,ref:e}):null});SD.displayName=A0;var bne=v.forwardRef((t,e)=>{const{__scopeScrollArea:n,...i}=t,r=kr(A0,n),[s,l]=v.useState(0),[u,d]=v.useState(0),f=!!(s&&u);return Uc(r.scrollbarX,()=>{const p=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(p),d(p)}),Uc(r.scrollbarY,()=>{const p=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(p),l(p)}),f?o.jsx(Je.div,{...i,ref:e,style:{width:s,height:u,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function om(t){return t?parseInt(t,10):0}function CD(t,e){const n=t/e;return isNaN(n)?0:n}function ng(t){const e=CD(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function yne(t,e,n,i="ltr"){const r=ng(n),s=r/2,l=e||s,u=r-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=i==="ltr"?[0,p]:[p*-1,0];return ED([d,f],m)(t)}function F2(t,e,n="ltr"){const i=ng(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,l=e.content-e.viewport,u=s-i,d=n==="ltr"?[0,l]:[l*-1,0],f=sy(t,d);return ED([0,l],[0,u])(f)}function ED(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function AD(t,e){return t>0&&t<e}var wne=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},i=0;return(function r(){const s={left:t.scrollLeft,top:t.scrollTop},l=n.left!==s.left,u=n.top!==s.top;(l||u)&&e(),n=s,i=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(i)};function ig(t,e){const n=Zn(t),i=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(i.current),[]),v.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,e)},[n,e])}function Uc(t,e){const n=Zn(e);zn(()=>{let i=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(i),r.unobserve(t)}}},[t,n])}var Sne=pD,Cne=gD,Ene=SD;function Qr({className:t,children:e,...n}){return o.jsxs(Sne,{"data-slot":"scroll-area",className:Fe("relative",t),...n,children:[o.jsx(Cne,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),o.jsx(Ane,{}),o.jsx(Ene,{})]})}function Ane({className:t,orientation:e="vertical",...n}){return o.jsx(xD,{"data-slot":"scroll-area-scrollbar",orientation:e,className:Fe("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...n,children:o.jsx(wD,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function ba(t){return t.toLowerCase().replace(/^\./,"")}function kne(t){const e=ba(t);return e==="md"||e==="markdown"}const Nne=new Set(["doc","docx","xls","xlsx","ppt","pptx"]),jne=new Set(["png","jpg","jpeg","gif","webp","bmp"]),_ne=new Set(["txt","csv","json"]);function kD(t){return Nne.has(ba(t))}function Tne(t){return ba(t)==="pdf"}function Rne(t){return jne.has(ba(t))}function Pne(t){return _ne.has(ba(t))}function Dne({uri:t}){const{t:e}=Ye("common"),n=`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(t)}`;return o.jsx("iframe",{title:e("markdown.officePreview"),src:n,className:"h-full min-h-[min(70vh,640px)] w-full border-0 bg-background"})}function Lne({uri:t}){const{t:e}=Ye("common"),[n,i]=v.useState(0);return o.jsx(Qr,{className:"h-full min-h-[min(70vh,640px)] w-full",children:o.jsx("div",{className:"flex flex-col items-center gap-4 p-4",children:o.jsx(Jte,{file:t,loading:o.jsx("p",{className:"text-sm text-muted-foreground",children:e("markdown.loadingPdf")}),error:o.jsx("p",{className:"text-sm text-destructive",children:e("markdown.pdfViewError")}),onLoadSuccess:({numPages:r})=>i(r),children:Array.from({length:n}
758,(r,s)=>o.jsx(une,{pageNumber:s+1,width:Math.min(900,window.innerWidth-80),className:"shadow-sm"},`page-${s+1}`))})})})}function One({uri:t,title:e}){const{t:n}=Ye("common");return o.jsx(Qr,{className:"h-full min-h-[min(70vh,640px)] w-full",children:o.jsx("div",{className:"flex min-h-[min(70vh,640px)] items-center justify-center p-4",children:o.jsx("img",{src:t,alt:e??n("markdown.imagePreviewAlt"),className:"max-h-[min(70vh,640px)] max-w-full object-contain"})})})}function Mne({uri:t}){const{t:e}=Ye("common"),[n,i]=v.useState(null),[r,s]=v.useState(null);return v.useEffect(()=>{let l=!1;return i(null),s(null),fetch(t).then(u=>{if(!u.ok)throw new Error(e("markdown.readFileError"));return u.text()}).then(u=>{l||i(u)}).catch(u=>{l||s(u instanceof Error?u.message:e("markdown.textReadError"))}),()=>{l=!0}},[t,e]),r?o.jsx("p",{className:"p-6 text-sm text-destructive",children:r}):n===null?o.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:e("markdown.loadingText")}):o.jsx(Qr,{className:"h-full min-h-[min(70vh,640px)] w-full",children:o.jsx("pre",{className:"p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",children:n})})}function Ine({fileType:t,downloadUrl:e}){const{t:n}=Ye("common"),i=t?`.${ba(t)}`:n("markdown.thisFormat");return o.jsxs("div",{className:"flex min-h-[min(70vh,320px)] flex-col items-center justify-center gap-3 p-8 text-center",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:n("markdown.previewUnavailable",{format:i})}),e&&o.jsx(ie,{variant:"outline",asChild:!0,children:o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(nl,{className:"mr-2 size-4"}),n("markdown.openOrDownload")]})})]})}function zne({uri:t,fileType:e,remoteUrl:n=!1,downloadUrl:i}){const r=ba(e||"");return n&&kD(r)?o.jsx(Dne,{uri:t}):Tne(r)?o.jsx(Lne,{uri:t}):Rne(r)?o.jsx(One,{uri:t}):Pne(r)?o.jsx(Mne,{uri:t}):o.jsx(Ine,{fileType:e,downloadUrl:i??t})}function Fne({uri:t}){return o.jsx("audio",{src:t,controls:!0,controlsList:"nodownload",className:"w-full max-w-full",preload:"metadata",children:"Il tuo browser non supporta la riproduzione audio."})}function $ne({uri:t,title:e}){const n=v.useRef(null),[i,r]=v.useState(!1),s=()=>{const l=n.current;l&&(l.requestFullscreen?.()??l.webkitRequestFullscreen?.())};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-black/90",children:o.jsx("video",{ref:n,src:t,controls:!0,controlsList:"nodownload",className:"aspect-video w-full max-h-40 object-contain",preload:"metadata",children:"Il tuo browser non supporta la riproduzione video."})}),o.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>r(!0),children:[o.jsx(FA,{className:"mr-2 size-4"}),"Schermo intero"]})]}),o.jsx(yn,{open:i,onOpenChange:r,children:o.jsxs(wn,{className:"flex max-h-[96vh] w-[min(96vw,1200px)] max-w-[96vw] flex-col gap-0 overflow-hidden p-0",showCloseButton:!0,children:[o.jsxs(Sn,{className:"sr-only",children:["Anteprima video — ",e]}),o.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate pr-4",children:e}),o.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:s,children:[o.jsx(FA,{className:"mr-2 size-4"}),"Fullscreen nativo"]})]}),o.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center bg-black p-2",children:o.jsx("video",{src:t,controls:!0,autoPlay:!0,className:"max-h-[calc(96vh-4rem)] w-full object-contain"})})]})})]})}function Une({media:t,title:e}){return o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:t.kind==="audio"?"Audio sorgente":"Video sorgente"}),t.kind==="audio"?o.jsx(Fne,{uri:t.uri}):o.jsx($ne,{uri:t.uri,title:e})]})}const Bne=new Set(["mp3","wav","m4a","aac","flac","ogg","oga","opus","wma","aiff","aif","amr"]),Hne=new Set(["mp4","m4v","mov","avi","mkv","webm"]);function ND(t){if(!t?.trim())return!1;try{const e=new URL(t).hostname.toLowerCase();return e==="youtube.com"||e==="www.youtube.com"||e.endsWith(".youtube.com")||e==="youtu.be"||e==="www.youtu.be"}catch{return!1}}function $2(t,e){const n=(t??"").toLowerCase();if(n.startsWith("audio/"))return"audio";if(n.startsWith("video/"))return"video";const i=ba(e??"");return Bne.has(i)?"audio":Hne.has(i)?"video":null}function Gne(t){return ND(t.sourceUrl)?!1:(t.documentSource??"").toUpperCase()==="AUDIO"}function Vne({mode:t,onModeChange:e,className:n}){return o.jsxs("div",{className:Fe("inline-flex items-center gap-0.5 rounded-lg bg-muted/80 p-1",n),role:"group","aria-label":"Modalità visualizzazione markdown",children:[o.jsxs("button",{type:"button",onClick:()=>e("preview"),"aria-pressed":t==="preview",title:"Anteprima formattata",className:Fe("inline-flex size-8 items-center justify-center rounded-md transition-colors",t==="preview"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx(Wo,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Anteprima"})]}),o.jsxs("button",{type:"button",onClick:()=>e("raw"),"aria-pressed":t==="raw",title:"Sorgente markdown",className:Fe("inline-flex size-8 items-center justify-center rounded-md transition-colors",t==="raw"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx(n_,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Sorgente"})]})]})}const qne={ul:({children:t,...e})=>o.jsx("ul",{className:"my-2 ml-6 list-disc [&>li]:mt-1",...e,children:t}),ol:({children:t,...e})=>o.jsx("ol",{className:"my-2 ml-6 list-decimal [&>li]:mt-1",...e,children:t}),p:({children:t,...e})=>o.jsx("p",{className:"leading-7 break-words [overflow-wrap:anywhere] [&:not(:first-child)]:mt-3",...e,children:t}),a:({children:t,...e})=>o.jsx("a",{className:"font-medium text-primary underline underline-offset-4 hover:no-underline",target:"_blank",rel:"noopener noreferrer",...e,children:t}),blockquote:({children:t,...e})=>o.jsx("blockquote",{className:"mt-3 border-l-2 border-border pl-6 italic text-muted-foreground",...e,children:t}),h1:({children:t,...e})=>
758o.jsx("h1",{className:"mt-4 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0",...e,children:t}),h2:({children:t,...e})=>o.jsx("h2",{className:"mt-4 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0",...e,children:t}),h3:({children:t,...e})=>o.jsx("h3",{className:"mt-3 scroll-m-20 text-lg font-semibold tracking-tight first:mt-0",...e,children:t}),pre:({children:t,...e})=>o.jsx("pre",{className:"my-3 overflow-x-auto rounded-md border border-border bg-muted/40 p-3 text-sm",...e,children:t}),code:({children:t,className:e,...n})=>e?.includes("language-")?o.jsx("code",{className:e,...n,children:t}):o.jsx("code",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-sm",...n,children:t}),table:({children:t,...e})=>o.jsx("div",{className:"my-3 w-full overflow-x-auto",children:o.jsx("table",{className:"w-full border-collapse text-sm",...e,children:t})}),tr:({children:t,...e})=>o.jsx("tr",{className:"m-0 border-t border-border p-0 even:bg-muted/30",...e,children:t}),th:({children:t,...e})=>o.jsx("th",{className:"border border-border px-4 py-2 text-left font-semibold",...e,children:t}),td:({children:t,...e})=>o.jsx("td",{className:"border border-border px-4 py-2 text-left",...e,children:t}),hr:t=>o.jsx("hr",{className:"my-6 border-border",...t})};function wb({icon:t,label:e,children:n}){return o.jsxs("div",{className:"flex gap-3",children:[o.jsx(t,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e}),o.jsx("div",{className:"text-sm text-foreground break-words",children:n})]})]})}function k0({open:t,onOpenChange:e,title:n,content:i,loading:r=!1,subtitle:s,sourceUrl:l,sizeLabel:u,updatedAtLabel:d,editable:f=!1,onContentChange:p,variant:m="markdown",docUri:x,fileType:b,docUriIsRemote:w=!1,downloadUrl:C,onDownload:A,downloading:E=!1,sidebarMedia:k}){const{t:N}=Ye("common"),_=s??N("markdown.knowledgeBase"),[R,T]=v.useState("preview");v.useEffect(()=>{t&&m==="markdown"&&!f&&T("preview")},[t,m,f,n]);const L=!!l,M=L||!!u||!!d,U=N(m==="document"?"markdown.documentPreview":f?"markdown.editMarkdown":"markdown.content");return o.jsx(SZ,{open:t,onOpenChange:e,children:o.jsxs(AZ,{showCloseButton:!0,className:"flex h-full w-full max-w-[min(1240px,96vw)] flex-col gap-0 overflow-hidden p-0 sm:max-w-[min(1240px,96vw)]","aria-describedby":void 0,children:[o.jsx(kZ,{className:"sr-only",children:n}),o.jsxs(NZ,{className:"sr-only",children:[N("markdown.documentPreview"),": ",_]}),o.jsx("div",{className:"shrink-0 border-b border-border bg-background px-6 pb-4 pt-6 pr-14",children:o.jsxs("div",{className:"flex gap-3",children:[o.jsx(B8,{className:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:_}),o.jsx("p",{className:"mt-1 line-clamp-2 text-xl font-semibold leading-tight text-foreground","aria-hidden":!0,children:n})]})]})}),o.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col md:flex-row",children:[o.jsx("aside",{className:Fe("shrink-0 border-border bg-muted/25 md:border-r",k?.kind==="video"?"md:w-[300px]":"md:w-[260px]","border-b md:border-b-0"),children:o.jsx("div",{className:"space-y-4 p-4",children:r?o.jsx("p",{className:"text-sm text-muted-foreground",children:N("actions.loading")}):o.jsxs(o.Fragment,{children:[k&&o.jsx(Une,{media:k,title:n}),M?o.jsxs(o.Fragment,{children:[L&&l&&o.jsx(wb,{icon:Q8,label:ND(l)?N("markdown.youtubeUrl"):N("markdown.sourceUrl"),children:o.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline break-all",children:l})}),u&&o.jsx(wb,{icon:bw,label:N("markdown.size"),children:u}),d&&o.jsx(wb,{icon:r8,label:N("markdown.lastUpdated"),children:d})]}):!k&&o.jsx("p",{className:"text-xs text-muted-foreground",children:N(f?"markdown.editHint":m==="document"?"markdown.previewReadOnly":"markdown.previewMarkdownReadOnly")})]})})}),o.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col bg-background",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(a_,{className:"size-4 shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:U})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[A&&!f&&o.jsxs(ie,{type:"button",variant:"outline",size:"sm",onClick:A,disabled:r||E,children:[o.jsx(j8,{className:"size-4"}),N(E?"markdown.downloading":"markdown.download")]}),m==="markdown"&&!f&&!r&&o.jsx(Vne,{mode:R,onModeChange:T})]})]}),f?o.jsx("div",{className:"min-h-0 flex-1 p-4 md:p-6",children:r?o.jsx("p",{className:"text-muted-foreground text-sm",children:N("markdown.loadingContent")}):o.jsx(Mc,{value:i,onChange:D=>p?.(D.target.value),className:"min-h-[min(70vh,640px)] w-full resize-y font-mono text-sm leading-relaxed",placeholder:"Markdown…"})}):m==="document"?o.jsx("div",{className:"relative min-h-0 min-w-0 flex-1 bg-muted/10",children:r?o.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:N("markdown.loadingDocument")}):x?o.jsx(zne,{uri:x,fileType:b,remoteUrl:w,downloadUrl:C}):k?o.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:N("markdown.useSidebarPlayer")}):o.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:N("markdown.noDocumentToView")})}):o.jsx(Qr,{className:"min-h-0 min-w-0 flex-1",children:o.jsx("div",{className:"min-w-0 
758w-full p-4 md:p-6",children:o.jsx("div",{className:"min-w-0 w-full overflow-hidden rounded-lg border border-border bg-muted/15 p-4 md:p-6",children:r?o.jsx("p",{className:"text-muted-foreground text-sm",children:N("markdown.loadingContent")}):R==="preview"?o.jsx("article",{className:"markdown-preview min-w-0 max-w-full break-words text-foreground text-sm leading-relaxed [overflow-wrap:anywhere]",children:o.jsx(JR,{remarkPlugins:[CP],components:qne,children:i})}):o.jsx("pre",{className:"text-foreground w-full max-w-full overflow-x-auto whitespace-pre-wrap break-all [overflow-wrap:anywhere] font-mono text-sm leading-relaxed",children:i})})})})]})]})]})})}function Kne(t){const e=new Blob([t]).size;return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function U2(t){return t.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean)}function jD({folderId:t,onSingleDocumentCreated:e,onCrawlStarted:n}){const{t:i}=Ye("dashboard"),[r,s]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(null),[p,m]=v.useState("input"),[x,b]=v.useState(""),[w,C]=v.useState(""),[A,E]=v.useState(""),[k,N]=v.useState(!1),[_,R]=v.useState(""),[T,L]=v.useState(2),[M,U]=v.useState(60),[D,G]=v.useState(100),[Z,Q]=v.useState(!0),[K,q]=v.useState(""),[F,V]=v.useState(""),[O,X]=v.useState(!1),[$,B]=v.useState(null),H=()=>{m("input"),b(""),C(""),E(""),N(!1)},P=async()=>{const W=r.trim();if(!(!W||t==null)){if(vk(W)){const fe=i("webIngestion.youtubeNotSupported");f(fe),ee.error(fe);return}if($V(W)){const fe=i("webIngestion.unsupportedFormat");f(fe),ee.error(fe);return}u(!0),f(null);try{if(FV(W)){const se=await HV(W),pe=await xR(se,t,"WEB");await e({id:pe.id,name:pe.name}),s("");return}const fe=await BV(W);if(!fe.markdown.trim()){const se=i("webIngestion.noMarkdownExtracted");f(se),ee.error(se);return}C(fe.sourceUrl),b(fe.markdown),E(""),m("edit")}catch(fe){const se=fe instanceof Error?fe.message:i("webIngestion.extractError");f(se),ee.error(se)}finally{u(!1)}}},J=async()=>{if(!(!w||t==null)){u(!0),f(null);try{const W=await KV({markdown:x,sourceUrl:w,name:A.trim()||void 0,folderId:t});await e({id:W.id,name:W.name}),s(""),H()}catch(W){const fe=W instanceof Error?W.message:i("webIngestion.uploadError");f(fe),ee.error(fe)}finally{u(!1)}}},he=async()=>{const W=_.trim();if(!(!W||t==null)){if(vk(W)){const fe=i("webIngestion.youtubeCrawlNotSupported");B(fe),ee.error(fe);return}X(!0),B(null);try{await XV({seedUrl:W,folderId:t,depth:T,maxPages:M,maxFiles:D,sameDomainOnly:Z,includePatterns:U2(K),excludePatterns:U2(F)}),await n?.(),R("")}catch(fe){const se=fe instanceof Error?fe.message:i("webIngestion.crawlStartError");B(se),ee.error(se)}finally{X(!1)}}},ue=t==null;return o.jsxs(o.Fragment,{children:[o.jsxs(Zc,{defaultValue:"single",className:"w-full min-w-0",children:[o.jsxs(Jc,{className:"bg-muted/50 flex h-auto min-h-10 w-full max-w-full gap-1 rounded-lg border border-border/50 p-1 shadow-inner backdrop-blur-sm sm:h-11 sm:max-w-md",children:[o.jsx(Xr,{value:"single",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:i("webIngestion.singleLink")}),o.jsx(Xr,{value:"crawl",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:i("webIngestion.siteCrawl")})]}),o.jsxs(sl,{value:"single",className:"mt-4 space-y-4",children:[ue&&o.jsx("p",{className:"text-sm text-destructive",children:i("webIngestion.selectFolderToContinue")}),p==="input"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"single-web-url",children:i("webIngestion.urlLabel")}),o.jsx(Qe,{id:"single-web-url",type:"url",placeholder:i("webIngestion.urlPlaceholder"),value:r,onChange:W=>{s(W.target.value),f(null)},disabled:l||ue})]}),d&&o.jsx("p",{className:"text-sm text-destructive",children:d}),o.jsx(ie,{type:"button",className:"w-full sm:w-auto",disabled:!r.trim()||l||ue,onClick:()=>void P(),children:l?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),i("webIngestion.loading")]}):i("webIngestion.continue")})]}),p==="edit"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground break-all",children:w}),o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"page-name",children:i("webIngestion.optionalFileName")}
758),o.jsx(Qe,{id:"page-name",value:A,onChange:W=>E(W.target.value),placeholder:i("webIngestion.fileNamePlaceholder"),disabled:l})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:i("webIngestion.editHint")}),o.jsxs(ie,{type:"button",className:"w-full",onClick:()=>N(!0),disabled:l||!x.trim(),children:[o.jsx(a_,{className:"mr-2 h-4 w-4"}),i("webIngestion.previewAndEdit")]}),d&&o.jsx("p",{className:"text-sm text-destructive",children:d}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(ie,{type:"button",variant:"outline",disabled:l,onClick:()=>{H(),f(null)},children:i("newMcp.back")}),o.jsx(ie,{type:"button",disabled:l||ue,onClick:()=>void J(),children:l?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),i("webIngestion.loading")]}):i("webIngestion.uploadToArchiveye")})]})]})]}),o.jsx(sl,{value:"crawl",className:"mt-4 space-y-3",children:ue?o.jsx("p",{className:"text-sm text-destructive",children:i("webIngestion.selectFolderToContinue")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-seed",children:i("webIngestion.crawlSeedLabel")}),o.jsx(Qe,{id:"crawl-seed",type:"url",placeholder:i("webIngestion.crawlSeedPlaceholder"),value:_,onChange:W=>{R(W.target.value),B(null)},disabled:O})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-depth",children:i("webIngestion.depth")}),o.jsx(Qe,{id:"crawl-depth",type:"number",min:0,max:5,value:T,onChange:W=>L(Number(W.target.value)),disabled:O})]}),o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-maxp",children:i("webIngestion.maxPages")}),o.jsx(Qe,{id:"crawl-maxp",type:"number",min:1,max:500,value:M,onChange:W=>U(Number(W.target.value)),disabled:O})]}),o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-maxf",children:i("webIngestion.maxFiles")}),o.jsx(Qe,{id:"crawl-maxf",type:"number",min:1,max:1e3,value:D,onChange:W=>G(Number(W.target.value)),disabled:O})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(On,{id:"crawl-same",checked:Z,onCheckedChange:W=>Q(W===!0),disabled:O}),o.jsx("label",{htmlFor:"crawl-same",className:"text-sm font-medium text-foreground",children:i("webIngestion.sameDomainOnly")})]}),o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-inc",children:i("webIngestion.includePatterns")}),o.jsx(Mc,{id:"crawl-inc",value:K,onChange:W=>
758q(W.target.value),className:"min-h-[60px] text-sm",disabled:O,placeholder:i("webIngestion.includePatternsPlaceholder")})]}),o.jsxs("div",{children:[o.jsx(Xe,{htmlFor:"crawl-exc",children:i("webIngestion.excludePatterns")}),o.jsx(Mc,{id:"crawl-exc",value:F,onChange:W=>V(W.target.value),className:"min-h-[60px] text-sm",disabled:O,placeholder:i("webIngestion.excludePatternsPlaceholder")})]}),$&&o.jsx("p",{className:"text-sm text-destructive",children:$}),o.jsx(ie,{type:"button",disabled:!_.trim()||O,onClick:()=>void he(),children:O?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),i("webIngestion.starting")]}):i("webIngestion.startCrawl")})]})})]}),o.jsx(k0,{open:k,onOpenChange:N,title:A.trim()||i("webIngestion.webPageTitle"),content:x,subtitle:i("webIngestion.knowledgeBase"),sourceUrl:w||void 0,sizeLabel:Kne(x),loading:!1,editable:!0,onContentChange:b})]})}async function N0(){return De(_e.OAUTH_CONFIG,{method:"GET"})}async function _D(t){const e=t==="google"?_e.OAUTH_GOOGLE_START:_e.OAUTH_MICROSOFT_START;return De(e,{method:"GET"})}async function j0(){return De(_e.OAUTH_CONNECTORS,{method:"GET"})}async function Wne(t){return De(_e.OAUTH_DISCONNECT(t),{method:"DELETE"})}async function _0(t){return De(_e.OAUTH_PICKER_TOKEN(t),{method:"POST"})}function TD({title:t,description:e,onConnected:n,provider:i}){const{t:r}=Ye("dashboard"),[s,l]=v.useState(!1),u=async()=>{if(!s){l(!0);try{const{url:d}=await _D(i),f=window.open(d,"oauth-popup","width=520,height=640");if(!f){ee.error(r("cloud.popupBlocked")),l(!1);return}const p=window.setInterval(()=>{f.closed&&(window.clearInterval(p),l(!1),n?.())},800)}catch(d){ee.error(d instanceof Error?d.message:r("cloud.oauthStartError")),l(!1)}}};return o.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-center space-y-3",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx(J8,{className:"h-10 w-10 text-muted-foreground"})}),o.jsx("h3",{className:"text-base font-semibold text-foreground",children:t}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:e}),o.jsx(ie,{onClick:()=>void u(),disabled:s,children:s?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),r("cloud.connecting")]}):r("cloud.connectAccount")})]})}const B2="https://www.googleapis.com/drive/v3/files",H2="supportsAllDrives=true&includeItemsFromAllDrives=true",Yne={"application/vnd.google-apps.document":{ext:"pdf",mime:"application/pdf"},"application/vnd.google-apps.spreadsheet":{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},"application/vnd.google-apps.presentation":{ext:"pdf",mime:"application/pdf"},"application/vnd.google-apps.drawing":{ext:"pdf",mime:"application/pdf"}};function Xne(t,e){return t.toLowerCase().endsWith(`.${e.toLowerCase()}`)?t:`${t}.${e}`}async function Qne(t){try{const e=await t.json(),n=e.error?.errors?.[0]?.reason,i=e.error?.message;if(n==="appNotAuthorizedToFile")return"App non autorizzata sul file: verifica GOOGLE_CLOUD_PROJECT_NUMBER e riconnetti Google.";if(n==="insufficientFilePermissions")return"Permessi insufficienti sul file selezionato.";if(i)return i}catch{}return t.status===403?"Permesso negato (403). Usa un file del tuo Drive e selezionalo dal picker.":`HTTP ${t.status}`}async function G2(t,e,n){const i=await fetch(e,{headers:{Authorization:`Bearer ${t}`}});if(!i.ok){const r=await Qne(i);throw new Error(`${n}: ${r}`)}return i}async function Zne(t,e){const n={name:e.name,mimeType:e.mimeType},i=Yne[n.mimeType];if(i){const u=Xne(e.name||n.name,i.ext),f=await(await G2(t,`${B2}/${encodeURIComponent(e.id)}/export?mimeType=${encodeURIComponent(i.mime)}&${H2}`,`Export "${u}"`)).blob();return new File([f],u,{type:i.mime})}const r=e.name||n.name,l=await(await G2(t,`${B2}/${encodeURIComponent(e.id)}?alt=media&${H2}`,`Download "${r}"`)).blob();return new File([l],r,{type:l.type||n.mimeType||"application/octet-stream"})}async function Jne(t,e,n){const i=[];for(const r of e)i.push(await Zne(t,r));return Nc(i,n)}function eie(t,e){return new Promise((n,i)=>{const r=document.getElementById(e);if(r&&r.tagName==="SCRIPT"){if(r.dataset.loaded==="true"){n();return}r.addEventListener("load",()=>n(),{once:!0}),r.addEventListener("error",()=>i(new Error(`Failed to load ${t}`)),{once:!0});return}const s=document.createElement("script");s.id=e,s.src=t,s.async=!0,s.defer=!0,s.onload=()=>{s.dataset.loaded="true",n()},s.onerror=()=>i(new Error(`Failed to load ${t}`)),document.head.appendChild(s)})}function RD({folderId:t,onImportComplete:e,onTaskStarted:n,onPickerOpenChange:i}){const{t:r}=Ye("dashboard"),[s,l]=v.useState(null),[u,d]=v.useState(null),[f,p]=v.useState(!1),[m,x]=v.useState(!1),[b,w]=v.useState(!1),C=v.useCallback(async()=>{const[N,_]=await Promise.all([N0(),j0()]);l(N),d(_)},[]);v.useEffect(()=>{C().catch(()=>{l({google:{enabled:!1,clientId:null,apiKey:null,appId:null},microsoft:{enabled:!1,clientId:null,tenant:"common"}}),d([])})},[C]);const A=v.useMemo(()=>u?.find(N=>N.provider==="google"&&!N.disabled),[u]),E=v.useMemo(()=>{const N=s?.google.appId?.trim();if(N&&/^\d+$/.test(N))return N;const R=(s?.google.clientId??"").split("-")[0]??"";return/^\d+$/.test(R)?R:N??""},[s?.google.appId,s?.google.clientId]),k=async()=>
758{if(A){if(!s?.google.enabled||!s.google.apiKey||!s.google.clientId||!E){ee.error(r("cloud.googlePickerConfigError"));return}p(!0),i?.(!0);try{await eie("https://apis.google.com/js/api.js","gapi-script"),await tie();const{accessToken:N}=await _0(A.id),_=await nie({accessToken:N,apiKey:s.google.apiKey,appId:E,origin:window.location.origin});if(i?.(!1),_.length===0)return;x(!0);const R=await Jne(N,_,t);ee.success(R.length===1?r("cloud.fileImported",{name:R[0]?.name??r("common.files")}):r("cloud.filesImported",{count:R.length})),e?.(),n?.()}catch(N){if(i?.(!1),N instanceof jm&&N.code==="OAUTH_RECONNECT_REQUIRED"){w(!0),ee.error(N.message);return}ee.error(N instanceof Error?N.message:r("cloud.googlePickerOpenError"))}finally{i?.(!1),p(!1),x(!1)}}};return!s||u===null?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Vn,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):s.google.enabled?E?!A||b?o.jsx(TD,{provider:"google",title:r("cloud.connectGoogleTitle"),description:r(b?"cloud.connectGoogleExpired":"cloud.connectGoogleDesc"),onConnected:()=>{w(!1),C()}}):o.jsxs("div",{className:"space-y-3 text-center py-6",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Collegato come"," ",o.jsx("span",{className:"font-medium text-foreground",children:A.providerAccountEmail??r("cloud.googleDefault")})]}),o.jsx(ie,{onClick:()=>void k(),disabled:f||m,children:f||m?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),r(m?"cloud.importing":"cloud.openingPicker")]}):r("cloud.chooseFromGoogleDrive")})]}):o.jsxs("div",{className:"rounded-lg border border-dashed border-amber-500/40 p-6 text-center space-y-2",children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:r("cloud.googlePickerIncomplete")}
758),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Imposta"," ",o.jsx("code",{className:"text-xs",children:"GOOGLE_CLOUD_PROJECT_NUMBER"})," (solo cifre, es. 689764940009) nel .env del BFF — non il Project ID testuale."]})]}):o.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-center space-y-2",children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:r("cloud.googleNotConfigured")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Imposta GOOGLE_OAUTH_CLIENT_ID, GOOGLE_PICKER_API_KEY e GOOGLE_CLOUD_PROJECT_NUMBER nel BFF per abilitare l'integrazione."})]})}function tie(){return new Promise((t,e)=>{if(!window.gapi){e(new Error("gapi not available"));return}window.gapi.load("picker",()=>{window.google?.picker?t():e(new Error("google.picker failed to load"))})})}function nie(t){return new Promise((e,n)=>{const i=window.google?.picker;if(!i){n(new Error("google.picker not loaded"));return}try{const r=new i.DocsView;r.setIncludeFolders(!1),r.setSelectFolderEnabled(!1),new i.PickerBuilder().addView(r).setOAuthToken(t.accessToken).setDeveloperKey(t.apiKey).setAppId(t.appId).setOrigin(t.origin).enableFeature(i.Feature.MULTISELECT_ENABLED).setCallback(l=>{const u=l[i.Response.ACTION];if(u===i.Action.PICKED){const d=l[i.Response.DOCUMENTS]??[];e(d.map(f=>({id:f[i.Document.ID],name:f[i.Document.NAME],mimeType:f[i.Document.MIME_TYPE]})))}else u===i.Action.CANCEL&&e([])}).build().setVisible(!0),iie()}catch(r){n(r instanceof Error?r:new Error(String(r)))}})}function iie(){const t=()=>{document.activeElement?.blur();const e=document.querySelector('iframe[src*="google.com"], iframe.picker-dialog-content');return e?(e.focus(),!0):!1};t()||(window.setTimeout(t,100),window.setTimeout(t,300))}const rie="https://graph.microsoft.com/v1.0";async function T0(t,e){const n=await fetch(`${rie}${e}`,{headers:{Authorization:`Bearer ${t}`}});if(!n.ok){const i=await n.text().catch(()=>"");throw new Error(`Microsoft Graph (${n.status})${i?`: ${i.slice(0,160)}`:""}`)}return n.json()}async function sie(t){const e=await T0(t,"/me/drive");return{id:e.id,name:e.name??"OneDrive",driveType:e.driveType}}async function aie(t){return(await T0(t,"/me/drives")).value??[]}async function oie(t,e,n){const i=n==="root"?`/drives/${encodeURIComponent(e)}/root/children`:`/drives/${encodeURIComponent(e)}/items/${encodeURIComponent(n)}/children`;return((await T0(t,i)).value??[]).filter(s=>s.id&&s.name).map(s=>({id:s.id,name:s.name,driveId:s.parentReference?.driveId??e,isFolder:!!s.folder,mimeType:s.file?.mimeType,size:s.size,modifiedTime:s.lastModifiedDateTime})).sort((s,l)=>s.isFolder!==l.isFolder?s.isFolder?-1:1:Zt(s.name,l.name))}function lie({connectorId:t,selected:e,onSelectedChange:n}){const{t:i}=Ye("dashboard"),[r,s]=v.useState(!0),[l,u]=v.useState(!1),[d,f]=v.useState(null),[p,m]=v.useState([]),[x,b]=v.useState(null),[w,C]=v.useState([]),[A,E]=v.useState([]),k=v.useMemo(()=>new Set(e.map(M=>`${M.driveId}:${M.id}`)),[e]),N=v.useCallback(async(M,U,D)=>{u(!0);try{const G=await oie(M,U,D);E(G)}catch(G){ee.error(G instanceof Error?G.message:i("cloud.folderLoadError")),E([])}finally{u(!1)}},[i]),_=v.useCallback(async()=>{s(!0);try{const{accessToken:M}=await _0(t);f(M);const[U,D]=await Promise.all([sie(M),aie(M).catch(()=>[])]),G=[U,...D.filter(Z=>Z.id!==U.id)];m(G),b(U.id),C([{driveId:U.id,itemId:"root",name:U.name}]),await N(M,U.id,"root")}catch(M){ee.error(M instanceof Error?M.message:i("cloud.onedriveAccessError"))}finally{s(!1)}},[t,N,i]);v.useEffect(()=>{_()},[_]);const R=async(M,U,D)=>{if(!d)return;const G=w.findIndex(Q=>Q.driveId===M&&Q.itemId===U),Z=G>=0?w.slice(0,G+1):[...w,{driveId:M,itemId:U,name:D}];C(Z),b(M),await N(d,M,U)},T=async M=>{d&&(b(M.id),C([{driveId:M.id,itemId:"root",name:M.name}]),await N(d,M.id,"root"))},L=M=>{const U=`${M.driveId}:${M.id}`;if(k.has(U)){n(e.filter(D=>!(D.driveId===M.driveId&&D.id===M.id)));return}n([...e,{id:M.id,driveId:M.driveId,name:M.name}])};return r?o.jsx("div",{className:"flex justify-center py-10",children:o.jsx(Vn,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.length>1?o.jsx("div",{className:"flex flex-wrap gap-1",children:p.map(M=>o.jsxs(ie,{type:"button",size:"sm",variant:x===M.id?"default":"outline",onClick:()=>
758void T(M),children:[o.jsx(yw,{className:"h-3.5 w-3.5 mr-1"}),M.name]},M.id))}):null,o.jsxs(ie,{type:"button",size:"sm",variant:"ghost",onClick:()=>void _(),disabled:l,children:[o.jsx(Dc,{className:`h-3.5 w-3.5 mr-1 ${l?"animate-spin":""}`}),i("cloud.refresh")]})]}),o.jsx("nav",{className:"flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:w.map((M,U)=>o.jsxs("span",{className:"flex items-center gap-1",children:[U>0?o.jsx(ro,{className:"h-3 w-3"}):null,o.jsx("button",{type:"button",className:"hover:text-foreground underline-offset-2 hover:underline",onClick:()=>void R(M.driveId,M.itemId,M.name),children:M.name})]},`${M.driveId}:${M.itemId}`))}),o.jsx("div",{className:"rounded-lg border max-h-[320px] overflow-y-auto",children:l?o.jsx("div",{className:"flex justify-center py-10",children:o.jsx(Vn,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):A.length===0?o.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:i("cloud.emptyFolder")}):o.jsx("ul",{className:"divide-y",children:A.map(M=>{const U=`${M.driveId}:${M.id}`;if(M.isFolder)return o.jsx("li",{children:o.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-muted/60 text-left",onClick:()=>void R(M.driveId,M.id,M.name),children:[o.jsx($8,{className:"h-4 w-4 shrink-0 text-amber-500"}),o.jsx("span",{className:"truncate flex-1",children:M.name}),o.jsx(ro,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})},U);const D=k.has(U);return o.jsx("li",{children:o.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 text-sm hover:bg-muted/60 cursor-pointer",children:[o.jsx(On,{checked:D,onCheckedChange:()=>L(M)}),o.jsx(bw,{className:"h-4 w-4 shrink-0 text-blue-500"}),o.jsx("span",{className:"truncate flex-1",children:M.name}),M.size!=null?o.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:cie(M.size)}):null]})},U)})})}),e.length>0?o.jsx("p",{className:"text-xs text-muted-foreground",children:i("cloud.filesSelectedTotal",{count:e.length})}):o.jsx("p",{className:"text-xs text-muted-foreground",children:i("cloud.selectFilesHint")})]})}function cie(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const uie="https://graph.microsoft.com/v1.0";async function die(t){try{const n=(await t.json()).error?.message;if(n)return n}catch{}return t.status===401||t.status===403?"Permesso negato. Ricollega l'account Microsoft dalle impostazioni.":`HTTP ${t.status}`}async function hie(t,e){const n=`${uie}/drives/${encodeURIComponent(e.driveId)}/items/${encodeURIComponent(e.id)}/content`,i=await fetch(n,{headers:{Authorization:`Bearer ${t}`}});if(!i.ok){const s=await die(i);throw new Error(`Download "${e.name}": ${s}`)}const r=await i.blob();return new File([r],e.name,{type:r.type||"application/octet-stream"})}async function fie(t,e,n){const i=[];for(const r of e)i.push(await hie(t,r));return Nc(i,n)}function PD({folderId:t,onImportComplete:e,onTaskStarted:n}){const{t:i}=Ye("dashboard"),[r,s]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState([]),[p,m]=v.useState(!1),[x,b]=v.useState(!1),w=v.useCallback(async()=>{const[k,N]=await Promise.all([N0(),j0()]);s(k),u(N)},[]);v.useEffect(()=>{w().catch(()=>{s({google:{enabled:!1,clientId:null,apiKey:null,appId:null},microsoft:{enabled:!1,clientId:null,tenant:"common"}}),u([])})},[w]);const C=v.useMemo(()=>l?.find(k=>k.provider==="microsoft"&&!k.disabled),[l]),A=k=>{f(N=>N.filter((_,R)=>R!==k))},E=async()=>{if(C){if(d.length===0){ee.error(i("toasts.selectAtLeastOneFile"));return}m(!0);try{const{accessToken:k}=await _0(C.id),N=await fie(k,d,t);ee.success(N.length===1?i("cloud.fileImported",{name:N[0]?.name??i("common.files")}):i("cloud.filesImported",{count:N.length})),f([]),e?.(),n?.()}catch(k){if(k instanceof jm&&k.code==="OAUTH_RECONNECT_REQUIRED"){b(!0),ee.error(k.message);return}ee.error(k instanceof Error?k.message:i("cloud.importError"))}finally{m(!1)}}};return!r||l===null?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Vn,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):r.microsoft.enabled?!C||x?o.jsx(TD,{provider:"microsoft",title:i("cloud.connectMicrosoftTitle"),description:i(x?"cloud.connectMicrosoftExpired":"cloud.connectMicrosoftDesc"),onConnected:()=>{b(!1),w()}}):o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["Collegato come"," ",o.jsx("span",{className:"font-medium text-foreground",children:C.providerAccountEmail??i("cloud.microsoftDefault")})]}),o.jsx(lie,{connectorId:C.id,selected:d,onSelectedChange:f}),d.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium",children:i("cloud.filesSelected",{count:d.length})}),o.jsx("div",{className:"space-y-1 max-h-[160px] overflow-y-auto",children:d.map((k,N)=>o.jsxs("div",{className:"flex items-center justify-between bg-muted rounded px-2 py-1 text-xs",children:[o.jsx("span",{className:"truncate flex-1",children:k.name}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>A(N),disabled:p,children:o.jsx(yi,{className:"h-3 w-3"})})]},`${k.driveId}:${k.id}:${N}`))})]}),o.jsx("div",{className:"flex justify-end",children:o.jsx(ie,{onClick:()=>void E(),disabled:p||d.length===0,children:p?o.jsxs(o.Fragment,{children:[o.jsx(Vn,{className:"h-4 w-4 mr-2 animate-spin"}),i("cloud.importing")]}):i("cloud.importToArchiveye")})})]}):o.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-center space-y-2",children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:i("cloud.sharepointNotConfigured")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Imposta MS_OAUTH_CLIENT_ID e MS_OAUTH_CLIENT_SECRET nel BFF per abilitare l'integrazione."})]})}function R0(){const[t,e]=v.useState(!1),[n,i]=v.useState(!0);return v.useEffect(()=>{let r=!1;return i(!0),As().then(s=>{r||e(R_(s))}).catch(()=>{r||e(!1)}).finally(()=>{r||i(!1)}),()=>{r=!0}},[]),{isEnterpriseSharing:t,isLoading:n}}const Rc="data:image/svg+xml,%3csvg%20width='129'%20height='83'%20viewBox='0%200%20129%2083'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.442%2016.6788C15.3479%2016.6788%207.4818%2028.4768%2012.8905%2038.5041L29.1596%2068.6658C31.9155%2073.775%2037.5489%2077.0023%2043.7112%2077.0023H101.461C113.555%2077.0023%20121.421%2065.2044%20116.012%2055.1771L99.7433%2025.0153C96.9875%2019.9062%2091.3541%2016.6788%2085.1918%2016.6788H27.442Z'%20fill='%23300041'/%3e%3cg%20filter='url(%23filter0_d_10_190)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.442%200C15.3479%200%207.4818%2011.798%2012.8905%2021.8253L29.1596%2051.987C31.9155%2057.0962%2037.5489%2060.3235%2043.7112%2060.3235H101.461C113.555%2060.3235%20121.421%2048.5256%20116.012%2038.4983L99.7433%208.33651C96.9875%203.22734%2091.3541%200%2085.1918%200H27.442Z'%20fill='%23460B5D'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_10_190'%20x='5.72205e-06'%20y='0'%20width='128.903'%20height='82.6274'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='Backgroun
758dImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='11.1519'/%3e%3cfeGaussianBlur%20stdDeviation='5.57596'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_10_190'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_10_190'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e";function pie({isOpen:t,onClose:e,existingFolders:n,generalFolderId:i,onConfirm:r}){const{t:s}=Ye("dashboard"),{isEnterpriseSharing:l}=R0(),[u,d]=v.useState(1),[f,p]=v.useState(""),[m,x]=v.useState(null),[b,w]=v.useState(!1),[C,A]=v.useState(""),[E,k]=v.useState([]),[N,_]=v.useState([]),[R,T]=v.useState(!1),[L,M]=v.useState(!1),[U,D]=v.useState(""),G=v.useRef(null),[Z,Q]=v.useState(!1),[K,q]=v.useState("direct"),[F,V]=v.useState(""),[O,X]=v.useState(""),[$,B]=v.useState([]),[H,P]=v.useState([]),{getRootProps:J,getInputProps:he,isDragActive:ue}=Pw({onDrop:Ae=>{k(Ae)},multiple:!0}),W=f==="weburl"||f==="external_drive";v.useEffect(()=>{W&&C==="general"&&A("")},[W,C]);const fe=()=>{d(1),p(""),x(null),w(!1),A(""),k([]),_([]),T(!1),D(""),Q(!1),V(""),X(""),q("direct"),e()},se=()=>{f&&(W&&C==="general"&&A(""),d(2))},pe=()=>{T(!0),l&&Promise.all([pT(),uR()]).then(([Ae,at])=>{B(Ae),P(at)}).catch(()=>{B([]),P([])}),setTimeout(()=>{G.current?.focus()},100)},Ee=async()=>{const Ae=U.trim();if(!(!Ae||L)){M(!0);try{const at=await dy({name:Ae}),xe={id:String(at.id),title:at.name,files:at._count?.documents??0,type:"Folder",size:"0 KB",modified:new Date().toISOString(),status:"Vuoto",categoryId:0};if(_(me=>[xe,...me].sort((ve,Me)=>Zt(ve.title,Me.title))),A(xe.id),D(""),T(!1),ee.success(s("toasts.folderCreated",{name:Ae})),l&&Z)try{K==="direct"&&F?await dR(at.id,Number(F)):K==="group"&&O&&await hR(at.id,Number(O))}catch(me){ee.error(me instanceof Error?s("addResourceFlow.folderCreatedShareFailed",{message:me.message}):s("addResourceFlow.folderCreatedShareFailedGeneric"))}}catch(at){ee.error(at instanceof Error?at.message:s("addResourceFlow.createFolderError"))}finally{M(!1)}}},Ce=()=>{D(""),T(!1)},Ne=Ae=>{A(C===Ae?"":Ae)},qe=()=>{C&&d(3)},pt=()=>{if(!C)return;if(C==="general")return i;const Ae=parseInt(C,10);return Number.isNaN(Ae)?void 0:Ae},$e=()=>{C&&(r(C,E,void 0),fe())},je=()=>{if(C==="general")return"Senza cartella";const Ae=N.find(xe=>xe.id===C);return Ae?Ae.title:n.find(xe=>xe.id===C)?.title||""},xt=[...N,...n].sort((Ae,at)=>Zt(Ae.title,at.title));return o.jsxs(o.Fragment,{children:[o.jsx(yn,{open:t&&u===1,onOpenChange:Ae=>!Ae&&fe(),children:o.jsxs(wn,{className:"sm:max-w-md",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("addResourceFlow.title")}),o.jsx(In,{children:s("addResourceFlow.selectSourceDesc")})]}),o.jsx("div",{className:"space-y-4 py-4",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Xe,{htmlFor:"source",className:"text-right font-medium",children:s("folderFilesViewer.source")}),o.jsxs(Br,{value:f,onValueChange:p,children:[o.jsx(Gr,{className:"flex-1",children:o.jsx(Hr,{placeholder:s("addResourceFlow.selectOption")})}),o.jsxs(Vr,{children:[o.jsx(di,{value:"pc",children:s("addResourceFlow.fromPc")}),o.jsx(di,{value:"external_drive",children:s("addResourceFlow.externalDrive")}),o.jsx(di,{value:"weburl",children:s("addResourceFlow.webUrl")})]})]})]})}),o.jsx(qn,{children:o.jsx(ie,{variant:"default",onClick:se,disabled:!f,className:"w-full sm:w-auto",children:s("newMcp.next")})})]})}),o.jsx(yn,{open:t&&u===2,onOpenChange:Ae=>!Ae&&fe(),children:o.jsxs(wn,{className:"sm:max-w-2xl",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("addResourceFlow.title")}),o.jsx(In,{children:s("dialogs.moveFiles.destinationPlaceholder")})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsx("div",{className:"flex justify-end",children:o.jsxs(ie,{variant:"outline",size:"sm",onClick:pe,disabled:R,children:[o.jsx(Bp,{className:"h-4 w-4 mr-2"}),s("dashboard.createFolder")]})}),o.jsx("div",{className:"max-h-[400px] overflow-y-auto border rounded-lg p-4",children:o.jsxs("div",{className:"grid grid-cols-3 gap-6 justify-items-center",children:[!W&&o.jsxs("div",{onClick:()=>Ne("general"),className:`bg-muted/50 border relative flex flex-col items-center justify-center cursor-pointer transition-all hover:shadow-md w-[158px] min-h-[120px] rounded-[5.62px] gap-2 p-4 ${C==="general"?"border-primary border-2":"border-border hover:border-primary/50"}`,children:[o.jsxs("div",{className:"text-center w-full",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:s("addResourceFlow.unclassifiedTitle")}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("addResourceFlow.unclassifiedHint")})]}),C==="general"&&o.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:o.jsx(Zi,{className:"h-4 w-4"})})]}),R&&o.jsxs("div",{className:"bg-background border-2 border-primary flex flex-col items-center cursor-pointer w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0",children:[o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:Rc,alt:"New Folder",className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3",children:[o.jsx("div",{className:"flex items-center gap-1 justify-center",children:o.jsx(Qe,{ref:G,value:U,onChange:Ae=>D(Ae.target.value),onKeyDown:Ae=>{Ae.key==="Enter"?Ee():Ae.key==="Escape"&&Ce()},placeholder:s("dashboard.folderNamePlaceholder"),className:"h-7 text-xs"})}),l&&o.jsxs("div",{className:"mt-2 text-left space-y-2",children:[o.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[o.jsx("input",{type:"checkbox",checked:Z,onChange:Ae=>Q(Ae.target.checked)}),s("addResourceFlow.shareNow")]}),Z&&o.jsxs(o.Fragment,{children:[o.jsxs(Br,{value:K,onValueChange:Ae=>q(Ae),children:[o.jsx(Gr,{className:"h-7 text-xs",children:o.jsx(Hr,{})}),o.jsxs(Vr,{children:[o.jsx(di,{value:"direct",children:s("addResourceFlow.withColleague")}),o.jsx(di,{value:"group",children:s("addResourceFlow.withGroup")})]})]}),K==="direct"?o.jsxs(Br,{value:F,onValueChange:V,children:[o.jsx(Gr,{className:"h-7 text-xs",children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectColleague")})}),o.jsx(Vr,{children:$.map(Ae=>o.jsxs(di,{value:String(Ae.id),children:[Ae.firstname," ",Ae.surname]},Ae.id))})]}):o.jsxs(Br,{value:O,onValueChange:X,children:[o.jsx(Gr,{className:"h-7 text-xs",children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectGroup")})}),o.jsx(Vr,{children:H.map(Ae=>o.jsx(di,{value:String(Ae.id),children:Ae.name},Ae.id))})]})]})]}),o.jsxs("div",{className:"flex gap-1 mt-2 justify-center",children:[o.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",disabled:L||l&&Z&&(K==="direct"&&!F||K==="group"&&!O),onClick:()=>void Ee(),children:L?o.jsx(Vn,{className:"h-4 w-4 animate-spin text-muted-foreground"}):o.jsx(Zi,{className:"h-4 w-4 text-green-500 dark:text-green-400"})}),o.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:Ce,children:o.jsx(yr,{className:"h-4 w-4 text-red-500 dark:text-red-400"})})]})]})]}),xt.map(Ae=>o.jsxs("div",{onClick:()=>Ne(Ae.id),className:`bg-background border relative flex flex-col items-center cursor-pointer transition-all hover:shadow-lg hover:scale-[1.02] w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0 ${C===Ae.id?"border-primary border-2":"border-border hover:border-primary"}`,children:[o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:Rc,alt:Ae.title,className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground truncate max-w-full px-1",children:Ae.title}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ae.files," File"]})]}),C===Ae.id&&o.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:o.jsx(Zi,{className:"h-4 w-4"})})]},Ae.id))]})})]}),W&&o.jsx("p",{className:"text-xs text-muted-foreground",children:s(f==="weburl"?"addResourceFlow.webFolderRequired":"addResourceFlow.externalDriveFolderRequired")}),o.jsxs(qn,{className:"flex-col sm:flex-row gap-2",children:[o.jsxs(ie,{variant:"ghost",onClick:()=>d(1),className:"w-full sm:w-auto",children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),s("newMcp.back")]}),o.jsx(ie,{variant:"default",onClick:qe,disabled:!C||W&&C==="general",className:"w-full sm:w-auto",children:s("newMcp.next")})]})]})}),o.jsx(yn,{open:t&&u===3,modal:!b,onOpenChange:Ae=>{!Ae&&b||Ae||fe()},children:o.jsxs(wn,{className:f==="weburl"||f==="external_drive"?"sm:max-w-2xl max-h-[90vh] overflow-y-auto":"sm:max-w-lg",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("addResourceFlow.title")}),o.jsxs(In,{children:["Inserisci risorse nella cartella"," ",o.jsx("span",{className:"text-foreground font-bold",children:je()})]})]}),o.jsxs("div",{className:"py-4",children:[f==="pc"&&o.jsxs("div",{...J(),className:`border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${ue?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[o.jsx("input",{...he()}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"text-lg font-semibold text-foreground",children:s("addResourceFlow.uploadFiles")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:s("addResourceFlow.dragOrUpload")})]})]}),E.length>0&&o.jsxs("div",{className:"mt-4 space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("dashboard.filesSelected",{count:E.length})}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:E.map((Ae,at)=>o.jsxs("div",{className:"flex items-center justify-between bg-muted p-2 rounded",children:[o.jsx("span",{className:"text-foreground text-sm truncate flex-1",children:Ae.name}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 ml-2",onClick:()=>k(xe=>xe.filter((me,rt)=>rt!==at)),children:o.jsx(yr,{className:"h-4 w-4"})})]},at))})]}),f==="weburl"&&o.jsx(jD,{folderId:pt(),onSingleDocumentCreated:async Ae=>{r(C,[],void 0,Ae),fe(),ee.success(s("webIngestion.webResourceSaved"))},onCrawlStarted:async()=>{fe(),ee.success(s("webIngestion.webIngestionStarted"))}},`${C}-${u}`),f==="external_drive"&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("cloud.chooseProvider")}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o.jsx(ie,{type:"button",variant:m==="google"?"default":"outline",onClick:()=>x("google"),className:"h-auto py-3",children:s("cloud.googleDrive")}
758),o.jsx(ie,{type:"button",variant:m==="sharepoint"?"default":"outline",onClick:()=>x("sharepoint"),className:"h-auto py-3",children:s("cloud.sharepointOneDrive")})]})]}),f==="external_drive"&&m==="google"&&pt()!=null&&o.jsx(RD,{folderId:pt(),onPickerOpenChange:w,onTaskStarted:()=>{fe()}},`drive-${C}`),f==="external_drive"&&m==="sharepoint"&&pt()!=null&&o.jsx(PD,{folderId:pt(),onImportComplete:()=>{fe()}},`sharepoint-${C}`)]}),o.jsxs(qn,{className:"flex-col sm:flex-row gap-2",children:[o.jsxs(ie,{variant:"ghost",onClick:()=>d(2),className:"w-full sm:w-auto",children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),s("newMcp.back")]}),f==="pc"&&o.jsx(ie,{variant:"default",onClick:$e,disabled:E.length===0,className:"w-full sm:w-auto",children:s("common.confirm")})]})]})})]})}const My=[{id:"red",name:"Rossa",dark:"#7F1D1D",light:"#DC2626"},{id:"orange",name:"Arancione",dark:"#7C2D12",light:"#EA580C"},{id:"yellow",name:"Giallo",dark:"#854D0E",light:"#EAB308"},{id:"green",name:"Verde",dark:"#14532D",light:"#16A34A"},{id:"purple",name:"Viola",dark:"#300041",light:"#460B5D"},{id:"gray",name:"Grigio",dark:"#374151",light:"#6B7280"}];function DD(t){const e=My.find(n=>n.id===t)||My[4];return`data:image/svg+xml,${encodeURIComponent(`
759    <svg width="129" height="83" viewBox="0 0 129 83" fill="none" xmlns="http://www.w3.org/2000/svg">
760      <path fill-rule="evenodd" clip-rule="evenodd" d="M27.442 16.6788C15.3479 16.6788 7.4818 28.4768 12.8905 38.5041L29.1596 68.6658C31.9155 73.775 37.5489 77.0023 43.7112 7
7607.0023H101.461C113.555 77.0023 121.421 65.2044 116.012 55.1771L99.7433 25.0153C96.9875 19.9062 91.3541 16.6788 85.1918 16.6788H27.442Z" fill="${e.dark}"/>
761      <g filter="url(#filter0_d_10_190)">
762        <path fill-rule="evenodd" clip-rule="evenodd" d="M27.442 0C15.3479 0 7.4818 11.798 12.8905 21.8253L29.1596 51.987C31.9155 57.0962 37.5489 60.3235 43.7112 60.3235H101.461C113.555 60.3235 121.421 48.5256 116.012 38.4983L99.7433 8.33651C96.9875 3.22734 91.3541 0 85.1918 0H27.442Z" fill="${e.light}"/>
763      </g>
764      <defs>
765        <filter id="filter0_d_10_190" x="5.72205e-06" y="0" width="128.903" height="82.6274" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
766          <feFlood flood-opacity="0" result="BackgroundImageFix"/>
767          <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
768          <feOffset dy="11.1519"/>
769          <feGaussianBlur stdDeviation="5.57596"/>
770          <feComposite in2="hardAlpha" operator="out"/>
771          <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
772          <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_10_190"/>
773          <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_10_190" result="shape"/>
774        </filter>
775      </defs>
776    </svg>
777  `)}`}function mie({isOpen:t,onClose:e,folderName:n,folderColor:i="purple",onConfirm:r}){const{t:s}=Ye("dashboard"),[l,u]=v.useState(n),[d,f]=v.useState(i),[p,m]=v.useState(!1);v.useEffect(()=>{t&&(u(n),f(i),m(!1))},[t,n,i]);const x=async()=>{if(!(!l.trim()||p)){m(!0);try{const w=r(l.trim(),d);w!=null&&typeof w.then=="function"&&await w,e()}finally{m(!1)}}},b=()=>{p||(u(n),f(i),e())};return o.jsx(yn,{open:t,onOpenChange:w=>!w&&b(),children:o.jsxs(wn,{className:"sm:max-w-md",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("dialogs.editFolder.title",{name:n})}),o.jsx(In,{children:s("dialogs.editFolder.description")})]}),o.jsxs("div",{className:"flex flex-col items-center gap-6 py-6",children:[o.jsx("div",{className:"bg-muted flex items-center justify-center w-[150px] h-[150px] rounded-lg p-4",children:o.jsx("img",{src:DD(d),alt:s("common.folderDefault"),className:"w-full h-full object-contain"})}),o.jsx("div",{className:"w-full max-w-[300px]",children:o.jsx(Qe,{value:l,onChange:w=>u(w.target.value),placeholder:s("dialogs.editFolder.namePlaceholder"),className:"text-center text-sm",disabled:p,onKeyDown:w=>{w.key==="Enter"&&x()}})}),o.jsx("div",{className:"flex items-center justify-center gap-3",children:My.map(w=>o.jsx("button",{type:"button",onClick:()=>!p&&f(w.id),disabled:p,className:`w-8 h-8 rounded-full transition-all border-2 ${p?"cursor-not-allowed opacity-70":"cursor-pointer hover:scale-105"} ${d===w.id?"border-foreground scale-110 shadow-lg":"border-transparent"}`,style:{backgroundColor:w.light},title:w.name,"aria-label":s("dialogs.editFolder.selectColorAria",{color:w.name})},w.id))})]}),o.jsx(qn,{children:o.jsx(ie,{onClick:x,disabled:p,className:"w-full max-w-[300px] mx-auto",children:s(p?"dialogs.editFolder.saving":"common.confirm")})})]})})}const Ns=Object.create(null);Ns.open="0";Ns.close="1";Ns.ping="2";Ns.pong="3";Ns.message="4";Ns.upgrade="5";Ns.noop="6";const Cp=Object.create(null);Object.keys(Ns).forEach(t=>{Cp[Ns[t]]=t});const Iy={type:"error",data:"parser error"},LD=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",OD=typeof ArrayBuffer=="function",MD=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,P0=({type:t,data:e},n,i)=>LD&&e instanceof Blob?n?i(e):V2(e,i):OD&&(e instanceof ArrayBuffer||MD(e))?n?i(e):V2(new Blob([e]),i):i(Ns[t]+(e||"")),V2=(t,e)=>{const n=new FileReader;return n.onload=function(){const i=n.result.split(",")[1];e("b"+(i||""))},n.readAsDataURL(t)};function q2(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Sb;function gie(t,e){if(LD&&t.data instanceof Blob)return t.data.arrayBuffer().then(q2).then(e);if(OD&&(t.data instanceof ArrayBuffer||MD(t.data)))return e(q2(t.data));P0(t,!1,n=>{Sb||(Sb=new TextEncoder),e(Sb.encode(n))})}const K2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
777+/",Sd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<K2.length;t++)Sd[K2.charCodeAt(t)]=t;const xie=t=>{let e=t.length*.75,n=t.length,i,r=0,s,l,u,d;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const f=new ArrayBuffer(e),p=new Uint8Array(f);for(i=0;i<n;i+=4)s=Sd[t.charCodeAt(i)],l=Sd[t.charCodeAt(i+1)],u=Sd[t.charCodeAt(i+2)],d=Sd[t.charCodeAt(i+3)],p[r++]=s<<2|l>>4,p[r++]=(l&15)<<4|u>>2,p[r++]=(u&3)<<6|d&63;return f},vie=typeof ArrayBuffer=="function",D0=(t,e)=>{if(typeof t!="string")return{type:"message",data:ID(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:bie(t.substring(1),e)}:Cp[n]?t.length>1?{type:Cp[n],data:t.substring(1)}:{type:Cp[n]}:Iy},bie=(t,e)=>{if(vie){const n=xie(t);return ID(n,e)}else return{base64:!0,data:t}},ID=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},zD="�",yie=(t,e)=>{const n=t.length,i=new Array(n);let r=0;t.forEach((s,l)=>{P0(s,!1,u=>{i[l]=u,++r===n&&e(i.join(zD))})})},wie=(t,e)=>{const n=t.split(zD),i=[];for(let r=0;r<n.length;r++){const s=D0(n[r],e);if(i.push(s),s.type==="error")break}return i};function Sie(){return new TransformStream({transform(t,e){gie(t,n=>{const i=n.length;let r;if(i<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,i);else if(i<65536){r=new Uint8Array(3);const s=new DataView(r.buffer);s.setUint8(0,126),s.setUint16(1,i)}else{r=new Uint8Array(9);const s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(i))}t.data&&typeof t.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(n)})}})}let Cb;function lp(t){return t.reduce((e,n)=>e+n.length,0)}function cp(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let i=0;for(let r=0;r<e;r++)n[r]=t[0][i++],i===t[0].length&&(t.shift(),i=0);return t.length&&i<t[0].length&&(t[0]=t[0].slice(i)),n}function Cie(t,e){Cb||(Cb=new TextDecoder);const n=[];let i=0,r=-1,s=!1;return new TransformStream({transform(l,u){for(n.push(l);;){if(i===0){if(lp(n)<1)break;const d=cp(n,1);s=(d[0]&128)===128,r=d[0]&127,r<126?i=3:r===126?i=1:i=2}else if(i===1){if(lp(n)<2)break;const d=cp(n,2);r=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),i=3}else if(i===2){if(lp(n)<8)break;const d=cp(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),p=f.getUint32(0);if(p>Math.pow(2,21)-1){u.enqueue(Iy);break}r=p*Math.pow(2,32)+f.getUint32(4),i=3}else{if(lp(n)<r)break;const d=cp(n,r);u.enqueue(D0(s?d:Cb.decode(d),e)),i=0}if(r===0||r>t){u.enqueue(Iy);break}}}})}const FD=4;function Mn(t){if(t)return Eie(t)}function Eie(t){for(var e in Mn.prototype)t[e]=Mn.prototype[e];return t}Mn.prototype.on=Mn.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Mn.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Mn.prototype.off=Mn.prototype.removeListener=Mn.prototype.removeAllListeners=Mn.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,r=0;r<n.length;r++)if(i=n[r],i===e||i.fn===e){n.splice(r,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Mn.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(n){n=n.slice(0);for(var i=0,r=n.length;i<r;++i)n[i].apply(this,e)}return this};Mn.prototype.emitReserved=Mn.prototype.emit;Mn.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Mn.prototype.hasListeners=function(t){return!!this.listeners(t).length};const rg=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),br=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Aie="arraybuffer";function $D(t,...e){return e.reduce((n,i)=>(t.hasOwnProperty(i)&&(n[i]=t[i]),n),{})}const kie=br.setTimeout,Nie=br.clearTimeout;function sg(t,e){e.useNativeTimers?(t.setTimeoutFn=kie.bind(br),t.clearTimeoutFn=Nie.bind(br)):(t.setTimeoutFn=br.setTimeout.bind(br),t.clearTimeoutFn=br.clearTimeout.bind(br))}const jie=1.33;function _ie(t){return typeof t=="string"?Tie(t):Math.ceil((t.byteLength||t.size)*jie)}function Tie(t){let e=0,n=0;for(let i=0,r=t.length;i<r;i++)e=t.charCodeAt(i),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(i++,n+=4);return n}function UD(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rie(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Pie(t){let e={},n=t.split("&");for(let i=0,r=n.length;i<r;i++){let s=n[i].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}
vendor: 6,216 bytes, line 777
777class Die extends Error{constructor(e,n,i){super(e),this.description=n,this.context=i,this.type="TransportError"}}class L0 extends Mn{constructor(e){super(),this.writable=!1,sg(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,i){return super.emitReserved("error",new Die(e,n,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=D0(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Rie(e);return n.length?"?"+n:""}}class Lie extends L0{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||n()})),this.writable||(i++,this.once("drain",function(){--i||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};wie(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,yie(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=UD()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let BD=!1;try{BD=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Oie=BD;function Mie(){}class Iie extends Lie{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let i=location.port;i||(i=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}}doWrite(e,n){const i=this.request({method:"POST",data:e});i.on("success",n),i.on("error",(r,s)=>{this.onError("xhr post error",r,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,i)=>{this.onError("xhr poll error",n,i)}),this.pollXhr=e}}class Ss extends Mn{constructor(e,n,i){super(),this.createRequest=e,sg(this,i),this._opts=i,this._method=i.method||"GET",this._uri=n,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var e;const n=$D(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const i=this._xhr=this.createRequest(n);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&i.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var r;i.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=Ss.requestsCount++,Ss.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Mie,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ss.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ss.requestsCount=0;Ss.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",W2);else if(typeof addEventListener=="function"){const t="onpagehide"in br?"pagehide":"unload";addEventListener(t,W2,!1)}}function W2(){for(let t in Ss.requests)Ss.requests.hasOwnProperty(t)&&Ss.requests[t].abort()}const zie=(function(){const t=HD({xdomain:!1});return t&&t.responseType!==null})();class Fie extends Iie{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=zie&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Ss(HD,this.uri(),e)}}function HD(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Oie))return new XMLHttpRequest}catch{}if(!e)try{return new br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const GD=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class $ie extends L0{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,i=GD?{}:$D(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,i)}catch(r){return this.emitReserved("error",r)}
vendor: 10,345 bytes, line 777
777this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const i=e[n],r=n===e.length-1;P0(i,this.supportsBinary,s=>{try{this.doWrite(i,s)}catch{}r&&rg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=UD()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Eb=br.WebSocket||br.MozWebSocket;class Uie extends $ie{createSocket(e,n,i){return GD?new Eb(e,n,i):n?new Eb(e,n):new Eb(e)}doWrite(e,n){this.ws.send(n)}}class Bie extends L0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=Cie(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=e.readable.pipeThrough(n).getReader(),r=Sie();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const s=()=>{i.read().then(({done:u,value:d})=>{u||(this.onPacket(d),s())}).catch(u=>{})};s();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const i=e[n],r=n===e.length-1;this._writer.write(i).then(()=>{r&&rg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Hie={websocket:Uie,webtransport:Bie,polling:Fie},Gie=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vie=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zy(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),i=t.indexOf("]");n!=-1&&i!=-1&&(t=t.substring(0,n)+t.substring(n,i).replace(/:/g,";")+t.substring(i,t.length));let r=Gie.exec(t||""),s={},l=14;for(;l--;)s[Vie[l]]=r[l]||"";return n!=-1&&i!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=qie(s,s.path),s.queryKey=Kie(s,s.query),s}function qie(t,e){const n=/\/{2,9}/g,i=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function Kie(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,r,s){r&&(n[r]=s)}),n}const Fy=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ep=[];Fy&&addEventListener("offline",()=>{Ep.forEach(t=>t())},!1);class ao extends Mn{constructor(e,n){if(super(),this.binaryType=Aie,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const i=zy(e);n.hostname=i.host,n.secure=i.protocol==="https"||i.protocol==="wss",n.port=i.port,i.query&&(n.query=i.query)}else n.host&&(n.hostname=zy(n.host).host);sg(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(i=>{const r=i.prototype.name;this.transports.push(r),this._transportsByName[r]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Pie(this.opts.query)),Fy&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ep.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=FD,n.transport=e,this.id&&(n.sid=this.id);const i=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&ao.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ao.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let i=0;i<this.writeBuffer.length;i++){const r=this.writeBuffer[i].data;if(r&&(n+=_ie(r)),i>0&&n>this._maxPayload)return this.writeBuffer.slice(0,i);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,rg(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,i){return this._sendPacket("message",e,n,i),this}send(e,n,i){return this._sendPacket("message",e,n,i),this}_sendPacket(e,n,i,r){if(typeof n=="function"&&(r=n,n=void 0),typeof i=="function"&&(r=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const s={type:e,data:n,options:i};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},i=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}_onError(e){if(ao.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Fy&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const i=Ep.indexOf(this._offlineEventListener);i!==-1&&Ep.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}ao.protocol=FD;class Wie extends ao{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),i=!1;ao.priorWebsocketSuccess=!1;const r=()=>{i||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!i)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ao.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}
vendor: 11,015 bytes, line 777
777]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function s(){i||(i=!0,p(),n.close(),n=null)}const l=m=>{const x=new Error("probe error: "+m);x.transport=n.name,s(),this.emitReserved("upgradeError",x)};function u(){l("transport closed")}function d(){l("socket closed")}function f(m){n&&m.name!==n.name&&s()}const p=()=>{n.removeListener("open",r),n.removeListener("error",l),n.removeListener("close",u),this.off("close",d),this.off("upgrading",f)};n.once("open",r),n.once("error",l),n.once("close",u),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{i||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let i=0;i<e.length;i++)~this.transports.indexOf(e[i])&&n.push(e[i]);return n}}let Yie=class extends Wie{constructor(e,n={}){const i=typeof e=="object"?e:n;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(r=>Hie[r]).filter(r=>!!r)),super(e,i)}};function Xie(t,e="",n){let i=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),i=zy(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const s=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+s+":"+i.port+e,i.href=i.protocol+"://"+s+(n&&n.port===i.port?"":":"+i.port),i}const Qie=typeof ArrayBuffer=="function",Zie=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,VD=Object.prototype.toString,Jie=typeof Blob=="function"||typeof Blob<"u"&&VD.call(Blob)==="[object BlobConstructor]",ere=typeof File=="function"||typeof File<"u"&&VD.call(File)==="[object FileConstructor]";function O0(t){return Qie&&(t instanceof ArrayBuffer||Zie(t))||Jie&&t instanceof Blob||ere&&t instanceof File}function Ap(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,i=t.length;n<i;n++)if(Ap(t[n]))return!0;return!1}if(O0(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ap(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Ap(t[n]))return!0;return!1}function tre(t){const e=[],n=t.data,i=t;return i.data=$y(n,e),i.attachments=e.length,{packet:i,buffers:e}}function $y(t,e){if(!t)return t;if(O0(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=$y(t[i],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=$y(t[i],e));return n}return t}function nre(t,e){return t.data=Uy(t.data,e),delete t.attachments,t}function Uy(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Uy(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Uy(t[n],e));return t}const qD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ire=5;var gt;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(gt||(gt={}));class rre{constructor(e){this.replacer=e}encode(e){return(e.type===gt.EVENT||e.type===gt.ACK)&&Ap(e)?this.encodeAsBinary({type:e.type===gt.EVENT?gt.BINARY_EVENT:gt.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===gt.BINARY_EVENT||e.type===gt.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=tre(e),i=this.encodeAsString(n.packet),r=n.buffers;return r.unshift(i),r}}class M0 extends Mn{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const i=n.type===gt.BINARY_EVENT;i||n.type===gt.BINARY_ACK?(n.type=i?gt.EVENT:gt.ACK,this.reconstructor=new sre(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(O0(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const i={type:Number(e.charAt(0))};if(gt[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===gt.BINARY_EVENT||i.type===gt.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const l=e.substring(s,n);if(l!=Number(l)||e.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(l);if(!KD(u)||u<0)throw new Error("Illegal attachments");if(u>this.opts.maxAttachments)throw new Error("too many attachments");i.attachments=u}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););i.nsp=e.substring(s,n)}else i.nsp="/";const r=e.charAt(n+1);if(r!==""&&Number(r)==r){const s=n+1;for(;++n;){const l=e.charAt(n);if(l==null||Number(l)!=l){--n;break}if(n===e.length)break}i.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(M0.isPayloadValid(i.type,s))i.data=s;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case gt.CONNECT:return lm(n);case gt.DISCONNECT:return n===void 0;case gt.CONNECT_ERROR:return typeof n=="string"||lm(n);case gt.EVENT:case gt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&qD.indexOf(n[0])===-1);case gt.ACK:case gt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sre{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=nre(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function are(t){return typeof t=="string"}const KD=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function ore(t){return t===void 0||KD(t)}function lm(t){return Object.prototype.toString.call(t)==="[object Object]"}function lre(t,e){switch(t){case gt.CONNECT:return e===void 0||lm(e);case gt.DISCONNECT:return e===void 0;case gt.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&qD.indexOf(e[0])===-1);case gt.ACK:return Array.isArray(e);case gt.CONNECT_ERROR:return typeof e=="string"||lm(e);default:return!1}}function cre(t){return are(t.nsp)&&ore(t.id)&&lre(t.type,t.data)}const ure=Object.freeze(Object.defineProperty({__proto__:null,Decoder:M0,Encoder:rre,get PacketType(){return gt},isPacketValid:cre,protocol:ire},Symbol.toStringTag,{value:"Module"}));function zr(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const dre=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class WD extends Mn{constructor(e,n,i){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[zr(e,"open",this.onopen.bind(this)),zr(e,"packet",this.onpacket.bind(this)),zr(e,"error",this.onerror.bind(this)),zr(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var i,r,s;if(dre.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const l={type:gt.EVENT,data:n};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,m=n.pop();this._registerAckCallback(p,m),l.id=p}const u=(r=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||r===void 0?void 0:r.writable,d=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!u||(d?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(e,n){var i;const r=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(r===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===e&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},r),l=(...u)=>{this.io.clearTimeoutFn(s),n.apply(this,u)};l.withError=!0,this.acks[e]=l}emitWithAck(e,...n){return new Promise((i,r)=>{const s=(l,u)=>l?r(l):i(u);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...s)=>(this._queue[0],r!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(r)):(this._queue.shift(),n&&n(null,...s)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:gt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}
vendor: 7,089 bytes, line 777
777_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){const i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case gt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case gt.EVENT:case gt.BINARY_EVENT:this.onevent(e);break;case gt.ACK:case gt.BINARY_ACK:this.onack(e);break;case gt.DISCONNECT:this.ondisconnect();break;case gt.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const i of n)i.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let i=!1;return function(...r){i||(i=!0,n.packet({type:gt.ACK,id:e,data:r}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:gt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let i=0;i<n.length;i++)if(e===n[i])return n.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let i=0;i<n.length;i++)if(e===n[i])return n.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const i of n)i.apply(this,e.data)}}}function ru(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ru.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};ru.prototype.reset=function(){this.attempts=0};ru.prototype.setMin=function(t){this.ms=t};ru.prototype.setMax=function(t){this.max=t};ru.prototype.setJitter=function(t){this.jitter=t};class By extends Mn{constructor(e,n){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,sg(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((i=n.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new ru({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const r=n.parser||ure;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Yie(this.uri,this.opts);const n=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const r=zr(n,"open",function(){i.onopen(),e&&e()}),s=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},l=zr(n,"error",s);if(this._timeout!==!1){const u=this._timeout,d=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),n.close()},u);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(r),this.subs.push(l),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(zr(e,"ping",this.onping.bind(this)),zr(e,"data",this.ondata.bind(this)),zr(e,"error",this.onerror.bind(this)),zr(e,"close",this.onclose.bind(this)),zr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){rg(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new WD(this,e,n),this.nsps[e]=i),i}_destroy(e){const n=Object.keys(this.nsps);for(const i of n)if(this.nsps[i].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let i=0;i<n.length;i++)this.engine.write(n[i],e.options)}
vendor: 7,963 bytes, line 777
777cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var i;this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},n);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const gd={};function Td(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=Xie(t,e.path||"/socket.io"),i=n.source,r=n.id,s=n.path,l=gd[r]&&s in gd[r].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||l;let d;return u?d=new By(i,e):(gd[r]||(gd[r]=new By(i,e)),d=gd[r]),n.query&&!e.query&&(e.query=n.queryKey),d.socket(n.path,e)}Object.assign(Td,{Manager:By,Socket:WD,io:Td,connect:Td});function hre(t){const e=fre(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(mre);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function fre(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;if(v.isValidElement(r)){const l=xre(r),u=gre(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var pre=Symbol("radix.slottable");function mre(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===pre}function gre(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function xre(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ag="Popover",[YD]=Er(ag,[eu]),ph=eu(),[vre,vo]=YD(ag),XD=t=>{const{__scopePopover:e,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:l=!1}=t,u=ph(e),d=v.useRef(null),[f,p]=v.useState(!1),[m,x]=co({prop:i,defaultProp:r??!1,onChange:s,caller:ag});return o.jsx(Ow,{...u,children:o.jsx(vre,{scope:e,contentId:qr(),triggerRef:d,open:m,onOpenChange:x,onOpenToggle:v.useCallback(()=>x(b=>!b),[x]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>p(!0),[]),onCustomAnchorRemove:v.useCallback(()=>p(!1),[]),modal:l,children:n})})};XD.displayName=ag;var QD="PopoverAnchor",bre=v.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=vo(QD,n),s=ph(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=r;return v.useEffect(()=>(l(),()=>u()),[l,u]),o.jsx(Dm,{...s,...i,ref:e})});bre.displayName=QD;var ZD="PopoverTrigger",JD=v.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=vo(ZD,n),s=ph(n),l=Et(e,r.triggerRef),u=o.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":rL(r.open),...i,ref:l,onClick:Pe(t.onClick,r.onOpenToggle)});return r.hasCustomAnchor?u:o.jsx(Dm,{asChild:!0,...s,children:u})});JD.displayName=ZD;var I0="PopoverPortal",[yre,wre]=YD(I0,{forceMount:void 0}),eL=t=>{const{__scopePopover:e,forceMount:n,children:i,container:r}=t,s=vo(I0,e);return o.jsx(yre,{scope:e,forceMount:n,children:o.jsx(mi,{present:n||s.open,children:o.jsx(th,{asChild:!0,container:r,children:i})})})};eL.displayName=I0;var Bc="PopoverContent",tL=v.forwardRef((t,e)=>{const n=wre(Bc,t.__scopePopover),{forceMount:i=n.forceMount,...r}=t,s=vo(Bc,t.__scopePopover);return o.jsx(mi,{present:i||s.open,children:s.modal?o.jsx(Cre,{...r,ref:e}):o.jsx(Ere,{...r,ref:e})})});tL.displayName=Bc;var Sre=hre("PopoverContent.RemoveScroll"),Cre=v.forwardRef((t,e)=>{const n=vo(Bc,t.__scopePopover),i=v.useRef(null),r=Et(e,i),s=v.useRef(!1);return v.useEffect(()=>{const l=i.current;if(l)return km(l)},[]),o.jsx(Kd,{as:Sre,allowPinchZoom:!0,children:o.jsx(nL,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(t.onCloseAutoFocus,l=>{l.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;s.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ere=v.forwardRef((t,e)=>{const n=vo(Bc,t.__scopePopover),i=v.useRef(!1),r=v.useRef(!1);return o.jsx(nL,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||n.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),nL=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...m}=t,x=vo(Bc,n),b=ph(n);return Am(),o.jsx(eh,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(Mw,{"data-state":rL(x.open),role:"dialog",id:x.contentId,...b,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),iL="PopoverClose",Are=v.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=vo(iL,n);return o.jsx(Je.button,{type:"button",...i,ref:e,onClick:Pe(t.onClick,()=>r.onOpenChange(!1))})});Are.displayName=iL;var kre="PopoverArrow",Nre=v.forwardRef((t,e)=>{const{__scopePopover:n,...i}=t,r=ph(n);return o.jsx(Iw,{...r,...i,ref:e})});Nre.displayName=kre;function rL(t){return t?"open":"closed"}var jre=XD,_re=JD,Tre=eL,Rre=tL;function hl({...t}){return o.jsx(jre,{"data-slot":"popover",...t})}function fl({...t}){return o.jsx(_re,{"data-slot":"popover-trigger",...t})}function pl({className:t,align:e="center",sideOffset:n=4,...i}){return o.jsx(Tre,{children:o.jsx(Rre,{"data-slot":"popover-content",align:e,sideOffset:n,className:Fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
777de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...i})})}function Pre(){const{t}=Ye("dashboard"),[e,n]=v.useState([]),[i,r]=v.useState(null),[s,l]=v.useState(!0),[u,d]=v.useState(!1),f=v.useMemo(()=>({QUEUED:t("taskCenter.status.QUEUED"),RUNNING:t("taskCenter.status.RUNNING"),PARTIAL_SUCCESS:t("taskCenter.status.PARTIAL_SUCCESS"),COMPLETED:t("taskCenter.status.COMPLETED"),FAILED:t("taskCenter.status.FAILED"),CANCELLED:t("taskCenter.status.CANCELLED")}),[t]),p=v.useMemo(()=>({QUEUED:t("taskCenter.notificationStatus.QUEUED"),RUNNING:t("taskCenter.notificationStatus.RUNNING"),PARTIAL_SUCCESS:t("taskCenter.notificationStatus.PARTIAL_SUCCESS"),COMPLETED:t("taskCenter.notificationStatus.COMPLETED"),FAILED:t("taskCenter.notificationStatus.FAILED"),CANCELLED:t("taskCenter.notificationStatus.CANCELLED")}),[t]),m=A=>{const E=A.totalFiles,k=A.processedFiles;if(typeof E!="number"||typeof k!="number")return null;const N=typeof A.skippedFiles=="number"?A.skippedFiles:0,_=typeof A.failedFiles=="number"?A.failedFiles:0;return t("taskCenter.cloudImportStats",{ok:k,total:E,failedSuffix:_>0?t("taskCenter.cloudImportFailed",{count:_}):"",skippedSuffix:N>0?t("taskCenter.cloudImportSkipped",{count:N}):""})},x=v.useMemo(()=>e.filter(A=>A.status==="RUNNING"||A.status==="QUEUED").length,[e]),b=v.useMemo(()=>e.filter(A=>A.status==="COMPLETED"||A.status==="PARTIAL_SUCCESS"||A.status==="FAILED"||A.status==="CANCELLED").slice(0,20),[e]);v.useEffect(()=>{let A=!0,E=null;const k=localStorage.getItem("user.token"),N=async()=>{try{const[R,T]=await Promise.all([Xv(),YV()]);if(!A)return;n(R),r(T)}finally{A&&l(!1)}};N(),k&&(E=Td(`${Re}/tasks`,{transports:["websocket"],auth:{token:k}}),E.on("connect",()=>{d(!0),E?.emit("tasks.subscribe",{last:20},R=>{R?.tasks&&n(R.tasks)})}),E.on("disconnect",()=>{d(!1)}),E.on("task.created",R=>{n(T=>[R,...T.filter(L=>L.id!==R.id)].slice(0,20))}),E.on("task.updated",R=>{n(T=>[R,...T.filter(L=>L.id!==R.id)].sort((L,M)=>Zt(M.updatedAt,L.updatedAt)).slice(0,20))}),E.on("task.completed",R=>{n(T=>[R,...T.filter(L=>L.id!==R.id)].sort((L,M)=>Zt(M.updatedAt,L.updatedAt)).slice(0,20))}),E.on("task.failed",R=>{n(T=>[R,...T.filter(L=>L.id!==R.id)].sort((L,M)=>Zt(M.updatedAt,L.updatedAt)).slice(0,20))}),E.on("summary.updated",()=>{N()}));const _=window.setInterval(()=>{N()},3e3);return()=>{A=!1,window.clearInterval(_),E?.disconnect()}},[]);const w=async A=>{await ZV(A);const E=await Xv();n(E)},C=async A=>{try{await Uw(A),ee.success(t("toasts.requeued"));const E=await Xv();n(E)}catch(E){ee.error(E instanceof Error?E.message:t("toasts.requeueError"))}};return o.jsxs(hl,{children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",size:"icon",className:"relative",children:[o.jsx(Q6,{className:"h-4 w-4"}),x>0&&o.jsx("span",{className:"absolute -top-1 -right-1 min-w-4 h-4 px-1 rounded-full bg-primary text-primary-foreground text-[10px] leading-4 text-center",children:x})]})}),o.jsx(pl,{className:"flex max-h-[min(85vh,32rem)] w-[calc(100vw-1.5rem)] max-w-[420px] min-w-0 flex-col overflow-hidden p-2.5 sm:p-3",align:"end",side:"bottom",sideOffset:8,collisionPadding:12,children:o.jsxs("div",{className:"min-w-0 space-y-2.5 sm:space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("h4",{className:"truncate text-sm font-semibold sm:text-base",children:t("taskCenter.title")}),!u&&o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:t("taskCenter.polling")})]}),o.jsxs("div",{className:"rounded-md border bg-muted/30 p-2.5 sm:p-3",children:[o.jsx("p",{className:"mb-1 text-xs uppercase text-muted-foreground",children:t("taskCenter.documents")}),o.jsx("p",{className:"text-sm font-medium leading-snug",children:t("taskCenter.processingTotal",{count:i?.documents.processingTotal??0})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t("taskCenter.pendingInProgress",{pending:i?.documents.pending??0,inProgress:i?.documents.inProgress??0})})]}
777),o.jsxs(Zc,{defaultValue:"tasks",className:"min-w-0 w-full",children:[o.jsxs(Jc,{className:"grid h-auto min-h-10 w-full grid-cols-2 gap-1 rounded-lg border border-border/50 bg-muted/50 p-1 shadow-inner backdrop-blur-sm sm:min-h-11",children:[o.jsx(Xr,{value:"tasks",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 h-9 rounded-md px-2 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:t("taskCenter.tabs.tasks")}),o.jsx(Xr,{value:"notifications",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 h-9 rounded-md px-2 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:t("taskCenter.tabs.notifications")})]}),o.jsx(sl,{value:"tasks",className:"mt-2.5 sm:mt-3",children:o.jsx("div",{className:"max-h-[min(20rem,45dvh)] space-y-2 overflow-y-auto overflow-x-hidden pr-0.5 sm:max-h-80",children:s?o.jsxs("div",{className:"flex items-center text-sm text-muted-foreground gap-2",children:[o.jsx(Vn,{className:"h-4 w-4 animate-spin"}),t("taskCenter.loadingTasks")]}):e.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:t("taskCenter.noTasks")}):e.map(A=>{const E=A.type==="CLOUD_INGESTION"?m(A.stats):null;return o.jsxs("div",{className:"rounded-md border p-2 sm:p-2.5",children:[o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-sm font-medium leading-snug break-words",children:A.title}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[f[A.status]," — ",A.progress,"%",E&&` · ${E}`]}),A.errorSummary&&o.jsx("p",{className:"text-xs text-destructive mt-1 break-words",children:A.errorSummary})]}),o.jsx(Ci,{className:"w-fit shrink-0",variant:A.status==="FAILED"?"destructive":A.status==="RUNNING"||A.status==="QUEUED"?"outline":"secondary",children:f[A.status]})]}),o.jsx("div",{className:"mt-2 h-1.5 rounded bg-muted overflow-hidden",children:o.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.max(0,Math.min(100,A.progress))}%`}})}),A.status==="RUNNING"||A.status==="QUEUED"?o.jsx("div",{className:"mt-2",children:o.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>void w(A.id),children:t("common.cancel")})}):A.status==="FAILED"&&A.type==="PROCESS_DOCUMENT"&&A.resourceRef?.documentId!=null?o.jsx("div",{className:"mt-2",children:o.jsxs(ie,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:()=>void C(Number(A.resourceRef?.documentId)),children:[o.jsx(Dc,{className:"h-3 w-3"}),t("common.requeue")]})}):null]},A.id)})})}),o.jsx(sl,{value:"notifications",className:"mt-2.5 sm:mt-3",children:o.jsx("div",{className:"max-h-[min(20rem,45dvh)] space-y-2 overflow-y-auto overflow-x-hidden pr-0.5 sm:max-h-80",children:s?o.jsxs("div",{className:"flex items-center text-sm text-muted-foreground gap-2",children:[o.jsx(Vn,{className:"h-4 w-4 animate-spin"}),t("taskCenter.loadingNotifications")]}):b.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:t("taskCenter.noNotifications")}):b.map(A=>{const E=A.type==="CLOUD_INGESTION"?m(A.stats):null;return o.jsx("div",{className:"rounded-md border p-2 sm:p-2.5",children:o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-sm font-medium leading-snug break-words",children:A.title}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[p[A.status],E&&` · ${E}`]}),A.errorSummary&&o.jsx("p",{className:"text-xs text-destructive mt-1 break-words",children:A.errorSummary})]}),o.jsx(Ci,{className:"w-fit shrink-0",variant:A.status==="FAILED"?"destructive":"secondary",children:f[A.status]})]})},`notification-${A.id}`)})})})]})]})})]})}function z0({open:t,onOpenChange:e,initialTab:n="groups",target:i,onSharingChanged:r}){const{t:s}=Ye("dashboard"),[l,u]=v.useState(n),[d,f]=v.useState([]),[p,m]=v.useState([]),[x,b]=v.useState(""),[w,C]=v.useState(""),[A,E]=v.useState(""),[k,N]=v.useState(""),[_,R]=v.useState(null),[T,L]=v.useState(!1),M=v.useMemo(()=>i?i.type==="folder"?s("dialogs.collaboration.resourceFolder",{name:i.name}):i.type==="collection"?s("dialogs.collaboration.resourceConnector",{name:i.name}):s("dialogs.collaboration.resourceDocument",{name:i.name}):s("dialogs.collaboration.noResourceSelected"),[i,s]),U=async()=>{const[O,X]=await Promise.all([uR(),pT()]);f(O),m(X)},D=async()=>
777{if(!i){R(null);return}const O=i.type==="folder"?await fR(i.id):i.type==="collection"?await pR(i.id):await PV(i.id);R(O)};v.useEffect(()=>{t&&(u(n),L(!0),Promise.all([U(),D()]).catch(O=>ee.error(O instanceof Error?O.message:s("toasts.collaborationLoadError"))).finally(()=>L(!1)))},[t,n,i?.id,i?.type]);const G=async()=>{const O=x.trim();if(O)try{await AV(O),b(""),await U(),ee.success(s("toasts.groupCreated"))}catch(X){ee.error(X instanceof Error?X.message:s("toasts.groupCreateError"))}},Z=async()=>{const O=Number(w),X=Number(k);if(!(!O||!X))try{await kV(O,X),await U(),ee.success(s("toasts.memberAdded"))}catch($){ee.error($ instanceof Error?$.message:s("toasts.memberAddError"))}},Q=async(O,X)=>{try{await NV(O,X),await U(),ee.success(s("toasts.memberRemoved"))}catch($){ee.error($ instanceof Error?$.message:s("toasts.memberRemoveError"))}},K=async()=>{if(!i)return;const O=Number(A);if(O)try{i.type==="folder"?await dR(i.id,O):i.type==="collection"?await OV(i.id,O):await jV(i.id,O),await D(),await r?.(),ee.success(s("toasts.shareUpdated"))}catch(X){ee.error(X instanceof Error?X.message:s("toasts.shareError"))}},q=async()=>{if(!i)return;const O=Number(w);if(O)try{i.type==="folder"?await hR(i.id,O):i.type==="collection"?await MV(i.id,O):await _V(i.id,O),await D(),await r?.(),ee.success(s("toasts.groupShareUpdated"))}catch(X){ee.error(X instanceof Error?X.message:s("toasts.groupShareError"))}},F=async O=>{if(i)try{i.type==="folder"?await DV(i.id,O):i.type==="collection"?await IV(i.id,O):await TV(i.id,O),await D(),await r?.(),ee.success(s("toasts.accessRevoked"))}catch(X){ee.error(X instanceof Error?X.message:s("toasts.revokeError"))}},V=async O=>{if(i)try{i.type==="folder"?await LV(i.id,O):i.type==="collection"?await zV(i.id,O):await RV(i.id,O),await D(),await r?.(),ee.success(s("toasts.groupAccessRevoked"))}catch(X){ee.error(X instanceof Error?X.message:s("toasts.groupRevokeError"))}};return o.jsx(yn,{open:t,onOpenChange:e,children:o.jsxs(wn,{className:"max-w-4xl h-[min(88vh,860px)] flex flex-col overflow-hidden p-0 gap-0",children:[o.jsxs(An,{children:[o.jsxs(Sn,{className:"flex items-center gap-2 px-6 pt-6",children:[o.jsx(Md,{className:"h-5 w-5"}),s("dialogs.collaboration.title")]}),o.jsxs(In,{className:"px-6 pb-4",children:["Gestisci gruppi e accessi."," ",i?M:s("dialogs.collaboration.noResource")]})]}),o.jsxs(Zc,{value:l,onValueChange:O=>u(O),className:"flex min-h-0 flex-1 flex-col px-6 pb-6",children:[o.jsxs(Jc,{className:"bg-muted/50 flex h-auto min-h-10 w-full max-w-full gap-1 rounded-lg border border-border/50 p-1 shadow-inner backdrop-blur-sm sm:h-11 sm:max-w-[260px] sm:w-[260px]",children:[o.jsx(Xr,{value:"groups",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:s("dashboard.groups")}),o.jsx(Xr,{value:"sharing",disabled:!i,className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 px-2 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground sm:px-3 sm:text-sm",children:o.jsx("span",{className:"truncate",children:s("dialogs.collaboration.tabSharing")})})]}),o.jsxs(sl,{value:"groups",className:"mt-4 min-h-0 flex-1 space-y-4 overflow-y-auto pr-1",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsx(Qe,{placeholder:s("dialogs.collaboration.newGroupPlaceholder"),value:x,onChange:O=>b(O.target.value)}),o.jsx(ie,{className:"sm:w-auto w-full",onClick:()=>void G(),disabled:!x.trim(),children:s("dialogs.collaboration.create")})]}),o.jsxs("div",{className:"rounded-md border p-4 space-y-3",children:[o.jsx(Xe,{children:s("dialogs.collaboration.addMemberLabel")}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-2",children:[o.jsxs(Br,{value:w,onValueChange:C,children:[o.jsx(Gr,{children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectGroup")})}),o.jsx(Vr,{children:d.map(O=>o.jsx(di,{value:String(O.id),children:O.name},O.id))})]}),o.jsxs(Br,{value:k,onValueChange:N,children:[o.jsx(Gr,{children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectColleague")})}),o.jsx(Vr,{children:p.map(O=>o.jsxs(di,{value:String(O.id),children:[O.firstname," ",O.surname," (",O.email,")"]},O.id))})]}),o.jsxs(ie,{variant:"outline",className:"w-full md:w-auto min-w-[160px]",onClick:()=>void Z(),disabled:!w||!k,children:[o.jsx(u_,{className:"h-4 w-4 mr-2"}),s("dialogs.collaboration.add")]})]})]}),o.jsxs("div",{className:"space-y-2 max-h-[330px] overflow-y-auto pr-1",children:[d.map(O=>o.jsxs("div",{className:"rounded-md border p-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{className:"font-medium text-foreground",children:O.name}),o.jsxs(Ci,{variant:"secondary",children:[O.members.length," membri"]})]}),o.jsx("div",{className:"mt-2 space-y-1",children:O.members.map(X=>o.jsxs("div",{className:"flex items-center justify-between text-sm text-foreground",children:[o.jsxs("span",{children:[X.employee.firstname," ",X.employee.surname," (",X.employee.email,")"]}),o.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>void Q(O.id,X.employeeId),children:o.jsx(yi,{className:"h-4 w-4"})})]},`${O.id}-${X.employeeId}`))})]},O.id)),!T&&d.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:s("dialogs.collaboration.noGroups")})]})]}),o.jsx(sl,{value:"sharing",className:"mt-4 min-h-0 flex-1 space-y-4 overflow-y-auto pr-1",children:i?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"rounded-md border p-4 space-y-3",children:[o.jsx(Xe,{children:s("dialogs.collaboration.shareDirectLabel")}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-2",children:[o.jsxs(Br,{value:A,onValueChange:E,children:[o.jsx(Gr,{children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectColleague")})}),o.jsx(Vr,{children:p.map(O=>o.jsxs(di,{value:String(O.id),children:[O.firstname," ",O.surname," (",O.email,")"]},O.id))})]}),o.jsx("div",{}),o.jsxs(ie,{className:"w-full md:w-auto min-w-[180px]",onClick:()=>void K(),disabled:!A,children:[o.jsx(gr,{className:"h-4 w-4 mr-2"}),s("dialogs.collaboration.shareDirect")]})]})]}),o.jsxs("div",{className:"rounded-md border p-4 space-y-3",children:[o.jsx(Xe,{children:s("dialogs.collaboration.shareGroupLabel")}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-2",children:[o.jsxs(Br,{value:w,onValueChange:C,children:[o.jsx(Gr,{children:o.jsx(Hr,{placeholder:s("dialogs.collaboration.selectGroup")})}),o.jsx(Vr,{children:d.map(O=>o.jsx(di,{value:String(O.id),children:O.name},O.id))})]}),o.jsx("div",{}),o.jsxs(ie,{className:"w-full md:w-auto min-w-[180px]",onClick:()=>void q(),disabled:!w,children:[o.jsx(gr,{className:"h-4 w-4 mr-2"}),s("dialogs.collaboration.shareGroup")]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"rounded-md border p-4",children:[o.jsx("div",{className:"font-medium mb-2 text-foreground",children:s("dashboard.directAccess")}),o.jsxs("div",{className:"space-y-2",children:[(_?.directShares??[]).map(O=>o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{children:[O.recipient.firstname," ",O.recipient.surname," (",O.recipient.email,")"]}),o.jsx(ie,{variant:"ghost",size:"sm",onClick:()=>void F(O.recipientEmployeeId),children:o.jsx(yi,{className:"h-4 w-4"})})]},O.recipientEmployeeId)),(_?.directShares??[]).length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:s("dialogs.collaboration.noDirectAccess")})]})]}),o.jsxs("div",{className:"rounded-md border p-4",children:[o.jsx("div",{className:"font-medium mb-2 text-foreground",children:s("dialogs.collaboration.groupAccess")}),o.jsxs("div",{className:"space-y-2",children:[(_?.groupShares??[]).map(O=>o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsx("span",{className:"text-foreground",children:O.group.name}),o.jsx(ie,{variant:"ghost",size:"sm",onClick:()=>void V(O.groupId),children:o.jsx(yi,{className:"h-4 w-4"})})]},O.groupId)),(_?.groupShares??[]).length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:s("dialogs.collaboration.noGroupAccess")})]})]})]})]}):o.jsx("p",{className:"text-sm text-muted-foreground",children:s("dialogs.collaboration.shareHint")})})]})]})})}function vs({className:t,...e}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:Fe("w-full caption-bottom text-sm",t),...e})})}function bs({className:t,...e}){return o.jsx("thead",{"data-slot":"table-header",className:Fe("[&_tr]:border-b",t),...e})}function ys({className:t,...e}){return o.jsx("tbody",{"data-slot":"table-body",className:Fe("[&_tr:last-child]:border-0",t),...e})}function Ot({className:t,...e}){return o.jsx("tr",{"data-slot":"table-row",className:Fe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e})}function Ve({className:t,...e}){return o.jsx("th",{"data-slot":"table-head",className:Fe("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function Oe({className:t,...e}){return o.jsx("td",{"data-slot":"table-cell",className:Fe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function Dre(t){const e=Lre(t),n=v.forwardRef((i,r)=>{const{children:s,...l}=i,u=v.Children.toArray(s),d=u.find(Mre);if(d){const f=d.props.children,p=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return o.jsx(e,{...l,ref:r,children:v.isValidElement(f)?v.cloneElement(f,void 0,p):null})}return o.jsx(e,{...l,ref:r,children:s})});return n.displayName=`${t}.Slot`,n}function Lre(t){const e=v.forwardRef((n,i)=>{const{children:r,...s}=n;
vendor: 14,460 bytes, line 777
777if(v.isValidElement(r)){const l=zre(r),u=Ire(s,r.props);return r.type!==v.Fragment&&(u.ref=i?_s(i,l):l),v.cloneElement(r,u)}return v.Children.count(r)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Ore=Symbol("radix.slottable");function Mre(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ore}function Ire(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...u)=>{const d=s(...u);return r(...u),d}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function zre(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Hy=["Enter"," "],Fre=["ArrowDown","PageUp","Home"],sL=["ArrowUp","PageDown","End"],$re=[...Fre,...sL],Ure={ltr:[...Hy,"ArrowRight"],rtl:[...Hy,"ArrowLeft"]},Bre={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mh="Menu",[Vd,Hre,Gre]=Nw(mh),[Sl,aL]=Er(mh,[Gre,eu,Rm]),og=eu(),oL=Rm(),[Vre,Cl]=Sl(mh),[qre,gh]=Sl(mh),lL=t=>{const{__scopeMenu:e,open:n=!1,children:i,dir:r,onOpenChange:s,modal:l=!0}=t,u=og(e),[d,f]=v.useState(null),p=v.useRef(!1),m=Zn(s),x=ih(r);return v.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),o.jsx(Ow,{...u,children:o.jsx(Vre,{scope:e,open:n,onOpenChange:m,content:d,onContentChange:f,children:o.jsx(qre,{scope:e,onClose:v.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:x,modal:l,children:i})})})};lL.displayName=mh;var Kre="MenuAnchor",F0=v.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t,r=og(n);return o.jsx(Dm,{...r,...i,ref:e})});F0.displayName=Kre;var $0="MenuPortal",[Wre,cL]=Sl($0,{forceMount:void 0}),uL=t=>{const{__scopeMenu:e,forceMount:n,children:i,container:r}=t,s=Cl($0,e);return o.jsx(Wre,{scope:e,forceMount:n,children:o.jsx(mi,{present:n||s.open,children:o.jsx(th,{asChild:!0,container:r,children:i})})})};uL.displayName=$0;var wr="MenuContent",[Yre,U0]=Sl(wr),dL=v.forwardRef((t,e)=>{const n=cL(wr,t.__scopeMenu),{forceMount:i=n.forceMount,...r}=t,s=Cl(wr,t.__scopeMenu),l=gh(wr,t.__scopeMenu);return o.jsx(Vd.Provider,{scope:t.__scopeMenu,children:o.jsx(mi,{present:i||s.open,children:o.jsx(Vd.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(Xre,{...r,ref:e}):o.jsx(Qre,{...r,ref:e})})})})}),Xre=v.forwardRef((t,e)=>{const n=Cl(wr,t.__scopeMenu),i=v.useRef(null),r=Et(e,i);return v.useEffect(()=>{const s=i.current;if(s)return km(s)},[]),o.jsx(B0,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Qre=v.forwardRef((t,e)=>{const n=Cl(wr,t.__scopeMenu);return o.jsx(B0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zre=Dre("MenuContent.ScrollLock"),B0=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:i=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,onDismiss:b,disableOutsideScroll:w,...C}=t,A=Cl(wr,n),E=gh(wr,n),k=og(n),N=oL(n),_=Hre(n),[R,T]=v.useState(null),L=v.useRef(null),M=Et(e,L,A.onContentChange),U=v.useRef(0),D=v.useRef(""),G=v.useRef(0),Z=v.useRef(null),Q=v.useRef("right"),K=v.useRef(0),q=w?Kd:v.Fragment,F=w?{as:Zre,allowPinchZoom:!0}:void 0,V=X=>{const $=D.current+X,B=_().filter(W=>!W.disabled),H=document.activeElement,P=B.find(W=>W.ref.current===H)?.textValue,J=B.map(W=>W.textValue),he=use(J,$,P),ue=B.find(W=>W.textValue===he)?.ref.current;(function W(fe){D.current=fe,window.clearTimeout(U.current),fe!==""&&(U.current=window.setTimeout(()=>W(""),1e3))})($),ue&&setTimeout(()=>ue.focus())};v.useEffect(()=>()=>window.clearTimeout(U.current),[]),Am();const O=v.useCallback(X=>Q.current===Z.current?.side&&hse(X,Z.current?.area),[]);return o.jsx(Yre,{scope:n,searchRef:D,onItemEnter:v.useCallback(X=>{O(X)&&X.preventDefault()},[O]),onItemLeave:v.useCallback(X=>{O(X)||(L.current?.focus(),T(null))},[O]),onTriggerLeave:v.useCallback(X=>{O(X)&&X.preventDefault()},[O]),pointerGraceTimerRef:G,onPointerGraceIntentChange:v.useCallback(X=>{Z.current=X},[]),children:o.jsx(q,{...F,children:o.jsx(eh,{asChild:!0,trapped:r,onMountAutoFocus:Pe(s,X=>{X.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:x,onDismiss:b,children:o.jsx(J_,{asChild:!0,...N,dir:E.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:T,onEntryFocus:Pe(d,X=>{E.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Mw,{role:"menu","aria-orientation":"vertical","data-state":NL(A.open),"data-radix-menu-content":"",dir:E.dir,...k,...C,ref:M,style:{outline:"none",...C.style},onKeyDown:Pe(C.onKeyDown,X=>{const B=X.target.closest("[data-radix-menu-content]")===X.currentTarget,H=X.ctrlKey||X.altKey||X.metaKey,P=X.key.length===1;B&&(X.key==="Tab"&&X.preventDefault(),!H&&P&&V(X.key));const J=L.current;if(X.target!==J||!$re.includes(X.key))return;X.preventDefault();const ue=_().filter(W=>!W.disabled).map(W=>W.ref.current);sL.includes(X.key)&&ue.reverse(),lse(ue)}),onBlur:Pe(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(U.current),D.current="")}),onPointerMove:Pe(t.onPointerMove,qd(X=>{const $=X.target,B=K.current!==X.clientX;if(X.currentTarget.contains($)&&B){const H=X.clientX>K.current?"right":"left";Q.current=H,K.current=X.clientX}}))})})})})})})});dL.displayName=wr;var Jre="MenuGroup",H0=v.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return o.jsx(Je.div,{role:"group",...i,ref:e})});H0.displayName=Jre;var ese="MenuLabel",hL=v.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return o.jsx(Je.div,{...i,ref:e})});hL.displayName=ese;var cm="MenuItem",Y2="menu.itemSelect",lg=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:i,...r}=t,s=v.useRef(null),l=gh(cm,t.__scopeMenu),u=U0(cm,t.__scopeMenu),d=Et(e,s),f=v.useRef(!1),p=()=>{const m=s.current;if(!n&&m){const x=new CustomEvent(Y2,{bubbles:!0,cancelable:!0});m.addEventListener(Y2,b=>i?.(b),{once:!0}),Cj(m,x),x.defaultPrevented?f.current=!1:l.onClose()}};return o.jsx(fL,{...r,ref:d,disabled:n,onClick:Pe(t.onClick,p),onPointerDown:m=>{t.onPointerDown?.(m),f.current=!0},onPointerUp:Pe(t.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:Pe(t.onKeyDown,m=>{const x=u.searchRef.current!=="";n||x&&m.key===" "||Hy.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});lg.displayName=cm;var fL=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:i=!1,textValue:r,...s}=t,l=U0(cm,n),u=oL(n),d=v.useRef(null),f=Et(e,d),[p,m]=v.useState(!1),[x,b]=v.useState("");return v.useEffect(()=>{const w=d.current;w&&b((w.textContent??"").trim())},[s.children]),o.jsx(Vd.ItemSlot,{scope:n,disabled:i,textValue:r??x,children:o.jsx(eT,{asChild:!0,...u,focusable:!i,children:o.jsx(Je.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:f,onPointerMove:Pe(t.onPointerMove,qd(w=>{i?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(t.onPointerLeave,qd(w=>l.onItemLeave(w))),onFocus:Pe(t.onFocus,()=>m(!0)),onBlur:Pe(t.onBlur,()=>m(!1))})})})}),tse="MenuCheckboxItem",pL=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:i,...r}=t;return o.jsx(bL,{scope:t.__scopeMenu,checked:n,children:o.jsx(lg,{role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n,...r,ref:e,"data-state":V0(n),onSelect:Pe(r.onSelect,()=>i?.(um(n)?!0:!n),{checkForDefaultPrevented:!1})})})});pL.displayName=tse;var mL="MenuRadioGroup",[nse,ise]=Sl(mL,{value:void 0,onValueChange:()=>{}}),gL=v.forwardRef((t,e)=>{const{value:n,onValueChange:i,...r}=t,s=Zn(i);return o.jsx(nse,{scope:t.__scopeMenu,value:n,onValueChange:s,children:o.jsx(H0,{...r,ref:e})})});gL.displayName=mL;var xL="MenuRadioItem",vL=v.forwardRef((t,e)=>{const{value:n,...i}=t,r=ise(xL,t.__scopeMenu),s=n===r.value;return o.jsx(bL,{scope:t.__scopeMenu,checked:s,children:o.jsx(lg,{role:"menuitemradio","aria-checked":s,...i,ref:e,"data-state":V0(s),onSelect:Pe(i.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});vL.displayName=xL;var G0="MenuItemIndicator",[bL,rse]=Sl(G0,{checked:!1}),yL=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:i,...r}=t,s=rse(G0,n);return o.jsx(mi,{present:i||um(s.checked)||s.checked===!0,children:o.jsx(Je.span,{...r,ref:e,"data-state":V0(s.checked)})})});yL.displayName=G0;var sse="MenuSeparator",wL=v.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t;return o.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...i,ref:e})});wL.displayName=sse;var ase="MenuArrow",SL=v.forwardRef((t,e)=>{const{__scopeMenu:n,...i}=t,r=og(n);return o.jsx(Iw,{...r,...i,ref:e})});SL.displayName=ase;var ose="MenuSub",[ele,CL]=Sl(ose),Cd="MenuSubTrigger",EL=v.forwardRef((t,e)=>{const n=Cl(Cd,t.__scopeMenu),i=gh(Cd,t.__scopeMenu),r=CL(Cd,t.__scopeMenu),s=U0(Cd,t.__scopeMenu),l=v.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=s,f={__scopeMenu:t.__scopeMenu},p=v.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return v.useEffect(()=>p,[p]),v.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),o.jsx(F0,{asChild:!0,...f,children:o.jsx(fL,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":NL(n.open),...t,ref:_s(e,r.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(t.onPointerMove,qd(m=>{s.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Pe(t.onPointerLeave,qd(m=>{p();const x=n.content?.getBoundingClientRect();if(x){const b=n.content?.dataset.side,w=b==="right",C=w?-5:5,A=x[w?"left":"right"],E=x[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+C,y:m.clientY},{x:A,y:x.top},{x:E,y:x.top},{x:E,y:x.bottom},{x:A,y:x.bottom}],side:b}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(t.onKeyDown,m=>{const x=s.searchRef.current!=="";t.disabled||x&&m.key===" "||Ure[i.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});EL.displayName=Cd;var AL="MenuSubContent",kL=v.forwardRef((t,e)=>{const n=cL(wr,t.__scopeMenu),{forceMount:i=n.forceMount,...r}=t,s=Cl(wr,t.__scopeMenu),l=gh(wr,t.__scopeMenu),u=CL(AL,t.__scopeMenu),d=v.useRef(null),f=Et(e,d);return o.jsx(Vd.Provider,{scope:t.__scopeMenu,children:o.jsx(mi,{present:i||s.open,children:o.jsx(Vd.Slot,{scope:t.__scopeMenu,children:o.jsx(B0,{id:u.contentId,"aria-labelledby":u.triggerId,...r,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Pe(t.onFocusOutside,p=>{p.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Pe(t.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:Pe(t.onKeyDown,p=>{const m=p.currentTarget.contains(p.target),x=Bre[l.dir].includes(p.key);m&&x&&(s.onOpenChange(!1),u.trigger?.focus(),p.preventDefault())})})})})})});kL.displayName=AL;function NL(t){return t?"open":"closed"}function um(t){return t==="indeterminate"}function V0(t){return um(t)?"indeterminate":t?"checked":"unchecked"}function lse(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function cse(t,e){return t.map((n,i)=>t[(e+i)%t.length])}function use(t,e,n){const r=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let l=cse(t,Math.max(s,0));r.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function dse(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const u=e[s],d=e[l],f=u.x,p=u.y,m=d.x,x=d.y;p>i!=x>i&&n<(m-f)*(i-p)/(x-p)+f&&(r=!r)}return r}function hse(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return dse(n,e)}function qd(t){return e=>e.pointerType==="mouse"?t(e):void 0}var fse=lL,pse=F0,mse=uL,gse=dL,xse=H0,vse=hL,bse=lg,yse=pL,wse=gL,Sse=vL,Cse=yL,Ese=wL,Ase=SL,kse=EL,Nse=kL,cg="DropdownMenu",[jse]=Er(cg,[aL]),Ei=aL(),[_se,jL]=jse(cg),_L=t=>{const{__scopeDropdownMenu:e,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:l,modal:u=!0}=t,d=Ei(e),f=v.useRef(null),[p,m]=co({prop:r,defaultProp:s??!1,onChange:l,caller:cg});return o.jsx(_se,{scope:e,triggerId:qr(),triggerRef:f,contentId:qr(),open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(x=>!x),[m]),modal:u,children:o.jsx(fse,{...d,open:p,onOpenChange:m,dir:i,modal:u,children:n})})};_L.displayName=cg;var TL="DropdownMenuTrigger",RL=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:i=!1,...r}=t,s=jL(TL,n),l=Ei(n);return o.jsx(pse,{asChild:!0,...l,children:o.jsx(Je.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...r,ref:_s(e,s.triggerRef),onPointerDown:Pe(t.onPointerDown,u=>{!i&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:Pe(t.onKeyDown,u=>{i||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});RL.displayName=TL;
vendor: 6,601 bytes, line 777
777var Tse="DropdownMenuPortal",PL=t=>{const{__scopeDropdownMenu:e,...n}=t,i=Ei(e);return o.jsx(mse,{...i,...n})};PL.displayName=Tse;var DL="DropdownMenuContent",LL=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=jL(DL,n),s=Ei(n),l=v.useRef(!1);return o.jsx(gse,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...i,ref:e,onCloseAutoFocus:Pe(t.onCloseAutoFocus,u=>{l.current||r.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Pe(t.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,p=d.button===2||f;(!r.modal||p)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});LL.displayName=DL;var Rse="DropdownMenuGroup",Pse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(xse,{...r,...i,ref:e})});Pse.displayName=Rse;var Dse="DropdownMenuLabel",OL=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(vse,{...r,...i,ref:e})});OL.displayName=Dse;var Lse="DropdownMenuItem",ML=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(bse,{...r,...i,ref:e})});ML.displayName=Lse;var Ose="DropdownMenuCheckboxItem",Mse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(yse,{...r,...i,ref:e})});Mse.displayName=Ose;var Ise="DropdownMenuRadioGroup",zse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(wse,{...r,...i,ref:e})});zse.displayName=Ise;var Fse="DropdownMenuRadioItem",$se=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(Sse,{...r,...i,ref:e})});$se.displayName=Fse;var Use="DropdownMenuItemIndicator",Bse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(Cse,{...r,...i,ref:e})});Bse.displayName=Use;var Hse="DropdownMenuSeparator",IL=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(Ese,{...r,...i,ref:e})});IL.displayName=Hse;var Gse="DropdownMenuArrow",Vse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(Ase,{...r,...i,ref:e})});Vse.displayName=Gse;var qse="DropdownMenuSubTrigger",Kse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(kse,{...r,...i,ref:e})});Kse.displayName=qse;var Wse="DropdownMenuSubContent",Yse=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...i}=t,r=Ei(n);return o.jsx(Nse,{...r,...i,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yse.displayName=Wse;var Xse=_L,Qse=RL,Zse=PL,Jse=LL,eae=OL,tae=ML,nae=IL;function Fr({...t}){return o.jsx(Xse,{"data-slot":"dropdown-menu",...t})}function $r({...t}){return o.jsx(Qse,{"data-slot":"dropdown-menu-trigger",...t})}function Ur({className:t,sideOffset:e=4,...n}){return o.jsx(Zse,{children:o.jsx(Jse,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Fe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function lt({className:t,inset:e,variant:n="default",...i}){return o.jsx(tae,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Fe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-[#64748B] relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 text-[#64748B]",t),...i})}function iae({className:t,inset:e,...n}){return o.jsx(eae,{"data-slot":"dropdown-menu-label","data-inset":e,className:Fe("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...n})}function rae({className:t,...e}){return o.jsx(nae,{"data-slot":"dropdown-menu-separator",className:Fe("bg-border -mx-1 my-1 h-px",t),...e})}function qt({size:t=24,color:e="currentColor",strokeWidth:n=2,className:i,...r}){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:i,...r,children:o.jsx("path",{d:"m7 15l5 5l5-5M7 9l5-5l5 5"})})}function sae(){return Sj.useSyncExternalStore(aae,()=>!0,()=>!1)}function aae(){return()=>{}}var q0="Avatar",[oae]=Er(q0),[lae,zL]=oae(q0),FL=v.forwardRef((t,e)=>{const{__scopeAvatar:n,...i}=t,[r,s]=v.useState("idle");return o.jsx(lae,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:o.jsx(Je.span,{...i,ref:e})})});FL.displayName=q0;var $L="AvatarImage",UL=v.forwardRef((t,e)=>{const{__scopeAvatar:n,src:i,onLoadingStatusChange:r=()=>{},...s}=t,l=zL($L,n),u=cae(i,s),d=Zn(f=>{r(f),l.onImageLoadingStatusChange(f)});return zn(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?o.jsx(Je.img,{...s,ref:e,src:i}):null});UL.displayName=$L;var BL="AvatarFallback",HL=v.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:i,...r}=t,s=zL(BL,n),[l,u]=v.useState(i===void 0);return v.useEffect(()=>{if(i!==void 0){const d=window.setTimeout(()=>u(!0),i);return()=>window.clearTimeout(d)}},[i]),l&&s.imageLoadingStatus!=="loaded"?o.jsx(Je.span,{...r,ref:e}):null});HL.displayName=BL;function X2(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWi
777dth>0?"loaded":"loading"):"error":"idle"}function cae(t,{referrerPolicy:e,crossOrigin:n}){const i=sae(),r=v.useRef(null),s=i?(r.current||(r.current=new window.Image),r.current):null,[l,u]=v.useState(()=>X2(s,t));return zn(()=>{u(X2(s,t))},[s,t]),zn(()=>{const d=m=>()=>{u(m)};if(!s)return;const f=d("loaded"),p=d("error");return s.addEventListener("load",f),s.addEventListener("error",p),e&&(s.referrerPolicy=e),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",f),s.removeEventListener("error",p)}},[s,n,e]),l}var uae=FL,dae=UL,hae=HL;function fae({className:t,...e}){return o.jsx(uae,{"data-slot":"avatar",className:Fe("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...e})}function pae({className:t,...e}){return o.jsx(dae,{"data-slot":"avatar-image",className:Fe("aspect-square size-full",t),...e})}function mae({className:t,...e}){return o.jsx(hae,{"data-slot":"avatar-fallback",className:Fe("bg-muted flex size-full items-center justify-center rounded-full",t),...e})}function gae({usedPercent:t,size:e=40,strokeWidth:n=3.5}){const i=(e-n)/2,r=2*Math.PI*i,s=Math.min(100,Math.max(0,t)),l=r*(1-s/100),u=e/2;return o.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[o.jsx("circle",{cx:u,cy:u,r:i,fill:"none",stroke:"var(--muted)",strokeWidth:n}),o.jsx("circle",{cx:u,cy:u,r:i,fill:"none",stroke:"var(--accent-foreground)",strokeWidth:n,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:l,className:"transition-[stroke-dashoffset] duration-500 ease-out"})]})}function xae(t){return Number.isFinite(t)?t>=100?t.toFixed(0):t>=10?t.toFixed(1):t.toFixed(2):"0"}function vae(){const[t,e]=v.useState(null),[n,i]=v.useState(!1),r=v.useCallback(()=>(i(!0),N_().then(e).catch(()=>e(null)).finally(()=>i(!1))),[]);return{usage:t,loading:n,refetch:r,formatStorageGb:xae}}function bae({loading:t,usage:e,formatStorageGb:n}){const{t:i}=Ye("common");if(t)return o.jsxs("div",{className:"flex items-center gap-3 py-1",children:[o.jsx("div",{className:"h-10 w-10 shrink-0 rounded-full bg-muted animate-pulse","aria-hidden":!0}),o.jsxs("div",{className:"min-w-0 space-y-1.5",children:[o.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),o.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})]})]});if(!e||e.maxStorageBytes<=0)return null;const r=e.usedBytes/e.maxStorageBytes*100;return o.jsxs("div",{className:"flex items-center gap-3 py-1",children:[o.jsx(gae,{usedPercent:r}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-xs font-medium text-foreground",children:i("userProfile.storage.title")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("userProfile.storage.remaining",{amount:n(e.remainingGb)})})]})]})}function GL({userName:t,onSettings:e,onLogoutClick:n}){const{t:i}=Ye("common"),{usage:r,loading:s,refetch:l,formatStorageGb:u}=vae(),d=t?.trim()||"User",f=t?.substring(0,2).toUpperCase()||"U";return o.jsxs(Fr,{onOpenChange:p=>{p&&l()},children:[o.jsx($r,{asChild:!0,children:o.jsxs(fae,{className:"cursor-pointer",children:[o.jsx(pae,{src:`https://api.dicebear.com/7.x/initials/svg?seed=${d}`}),o.jsx(mae,{children:f})]})}),o.jsxs(Ur,{align:"end",className:"w-56",children:[o.jsx(iae,{className:"font-normal",children:o.jsx(bae,{loading:s,usage:r,formatStorageGb:u})}),r&&r.maxStorageBytes>0?o.jsx(rae,{}):null,o.jsxs(lt,{onClick:e,children:[o.jsx(il,{className:"mr-2 h-4 w-4"}),i("actions.settings")]}),o.jsxs(lt,{onClick:n,className:"text-red-600 focus:text-red-600",children:[o.jsx(r_,{className:"mr-2 h-4 w-4"}),i("actions.logout")]})]})]})}function K0({className:t=""}){return o.jsxs("svg",{width:"186",height:"36",viewBox:"0 0 186 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[o.jsx("path",{d:"M35.6737 22.0037L32.8851 16.6574C32.2795 15.4383 31.6819 14.2193 31.0923 12.9923C30.1362 11.0163 30.0486 10.2434 29.3394 9.3112C28.8773 8.68972 28.1283 7.92481 26.8694 7.23959C26.0806 6.80934 25.1803 6.61014 24.2799 6.61014H4.79097C3.46037 6.61014 2.64767 8.0762 3.34882 9.20761C3.78705 9.9247 4.04202 10.3311 4.18543 10.5781C4.27308 10.7294 4.65552 11.3509 5.18936 12.2194C5.42042 12.5859 5.38059 12.5301 6.56778 14.4742C7.94619 16.7371 8.63937 17.8685 8.68717 17.9322C9.68314 19.2708 10.4162 20.2747 11.8105 20.9759C13.42 21.7886 15.2127 21.8523 15.5792 21.8603C15.7226 21.8683 15.7466 21.8603 17.125 21.8603C17.125 21.8603 18.1209 21.8603 19.7065 21.8603C23.2043 21.8603 24.9492 21.8603 26.1045 22.2905C26.8455 22.5614 29.1562 23.6212 30.4868 28.2823C30.8374 28.2265 33.8571 27.7166 35.0841 25.7645C35.4745 25.143 35.6578 24.4657 35.6578 24.4657C35.9526 23.3901 35.7933 22.4738 35.6737 22.0037ZM7.05381 19.4062C8.8067 22.4101 11.4042 23.9319 14.894 23.908C17.1807 23.892 19.4675 23.8682 21.7462 23.916C24.8
777696 23.9877 26.8296 25.5334 27.9849 28.8002C22.1048 28.8002 16.2565 28.9834 10.4241 28.7205C7.68325 28.593 5.69133 26.6807 4.48821 24.163C3.18151 21.4539 2.05009 18.6493 0.623876 16.0041C-0.555342 13.8209 0.00239925 12.1557 1.74732 10.2992C3.55599 13.4145 5.30888 16.4104 7.05381 19.4062Z",fill:"url(#paint0_linear_60_1399)"}),o.jsx("path",{d:"M61.7799 24.0608H54.2648L52.4864 28.7362H48.3559L56.2153 8.65763H57.9937C59.2366 8.65763 60.078 9.2313 60.5178 10.3787L67.6601 28.7362H63.5296L61.7799 24.0608ZM55.3261 20.7335H60.7186L58.051 13.5052H58.0223L55.3261 20.7335ZM69.4288 14.4231H73.043V16.2588C73.4063 15.7043 73.9226 15.2549 74.5919 14.9107C75.2803 14.5473 75.9974 14.3657 76.7432 14.3657H78.6936V17.7504H76.7432C75.7297 17.7504 74.9074 18.0563 74.2764 18.6682C73.6453 19.2802 73.3298 20.0642 73.3298 21.0203V28.7362H69.4288V14.4231ZM85.4971 28.9657C84.2923 28.9657 83.2215 28.7266 82.2845 28.2486C81.3666 27.7705 80.6495 27.1012 80.1332 26.2407C79.636 25.3802 79.3874 24.3858 79.3874 23.2576V19.9016C79.3874 18.7734 79.636 17.779 80.1332 16.9185C80.6495 16.058 81.3666 15.3887 82.2845 14.9107C83.2024 14.4326 84.2637 14.1936 85.4684 14.1936H87.7344C88.8817 14.1936 89.8952 14.4231 90.7748 14.882C91.6545 15.3409 92.3333 15.9911 92.8114 16.8325C93.2895 17.6547 93.5285 18.6109 93.5285 19.7008H89.6562C89.6562 19.0507 89.4745 18.5344 89.1112 18.1519C88.767 17.7504 88.3081 17.5496 87.7344 17.5496H85.5257C84.8564 17.5496 84.3115 17.7982 83.8908 18.2953C83.4892 18.7734 83.2884 19.4044 83.2884 20.1885V22.9708C83.2884 23.7548 83.4988 24.3954 83.9194 24.8926C84.3401 25.3707 84.8851 25.6097 85.5544 25.6097H87.7631C88.375 25.6097 88.8626 25.3898 89.2259 24.95C89.6084 24.5101 89.7996 23.9269 89.7996 23.2003H93.6719C93.6719 24.9404 93.1269 26.3363 92.0369 27.3881C90.9661 28.4398 89.5414 28.9657 87.7631 28.9657H85.4971ZM96.0116 8.65763H99.9126V15.8572C100.333 15.3601 100.85 14.9585 101.462 14.6525C102.093 14.3466 102.695 14.1936 103.269 14.1936H105.047C106.577 14.1936 107.801 14.6716 108.719 15.6278C109.656 16.5839 110.124 17.846 110.124 19.414V28.7362H106.223V19.5574C106.223 18.9646 106.06 18.4866 105.735 18.1232C105.429 17.7599 105.028 17.5783 104.531 17.5783H102.752C102.083 17.5783 101.481 17.8268 100.945 18.324C100.429 18.8021 100.085 19.4331 99.9126 20.2172V28.7362H96.0116V8.65763ZM115.733 13.0749C114.988 13.0749 114.385 12.8646 113.926 12.4439C113.487 12.0041 113.267 11.4304 113.267 10.7229C113.267 10.0153 113.487 9.45121 113.926 9.03052C114.385 8.5907 114.988 8.37079 115.733 8.37079C116.479 8.37079 117.072 8.5907 117.512 9.03052C117.971 9.45121 118.2 10.0153 118.2 10.7229C118.2 11.4304 117.971 12.0041 117.512 12.4439C117.072 12.8646 116.479 13.0749 115.733 13.0749ZM113.783 14.4231H117.684V28.7362H113.783V14.4231ZM127.095 28.7362C126.54 28.7362 126.072 28.5928 125.689 28.306C125.326 28 125.01 27.5219 124.743 26.8718L119.809 14.4231H123.911L127.295 24.2616H127.353L130.766 14.4231H134.868L129.103 28.7362H127.095ZM141.717 28.9657C140.512 28.9657 139.441 28.7458 138.504 28.306C137.586 27.847 136.869 27.216 136.353 26.4128C135.836 25.5906 135.578 24.6536 135.578 23.6018V19.9016C135.578 18.7734 135.836 17.779 136.353 16.9185C136.869 16.058 137.586 15.3887 138.504 14.9107C139.441 14.4326 140.512 14.1936 141.717 14.1936H144.011C145.847 14.1936 147.319 14.7099 148.429 15.7425C149.538 16.7751 150.092 18.1519 150.092 19.8729V22.9134H139.479V23.6018C139.479 24.2329 139.68 24.7396 140.082 25.1221C140.483 25.5045 141.028 25.6957 141.717 25.6957H143.954C144.623 25.6957 145.159 25.5523 145.56 25.2655C145.981 24.9595 146.191 24.5675 146.191 24.0895H150.035C150.035 25.0456 149.777 25.8965 149.26 26.6423C148.744 27.3881 148.017 27.9617 147.08 28.3633C146.163 28.7649 145.101 28.9657 143.897 28.9657H141.717ZM146.249 20.1024V19.8729C146.249 19.1272 146.048 18.5344 145.646 18.0946C145.245 17.6356 144.709 17.4062 144.04 17.4062H141.717C141.028 17.4062 140.474 17.6452 140.053 18.1232C139.632 18.6013 139.422 19.2323 139.422 20.0164V20.1024H146.249ZM158.299 34.559C156.75 34.559 155.469 34.1192 154.456 33.2395C153.461 32.379 152.907 31.2412 152.792 29.8262H156.636C156.674 30.2469 156.846 30.5815 157.152 30.8301C157.458 31.0978 157.84 31.2317 158.299 31.2317H160.651C161.244 31.2317 161.722 30.9831 162.086 30.4859C162.468 30.0078 162.659 29.3768 162.659 28.5928V26.7283C162.219 27.3211 161.713 27.7896 161.139 28.1338C160.584 28.4589 160.03 28.6215 159.475 28.6215H157.582C156.072 28.6215 154.857 28.1243 153.939 27.1299C153.022 26.1164 152.563 24.7779 152.563 23.1142V14.4231H156.464V23.1716C156.464 23.8026 156.617 24.3189 156.923 24.7205C157.248 25.1029 157.668 25.2942 158.185 25.2942H159.848C160.479 25.2942 161.053 25.036 161.569 24.5197C162.086 23.9843 162.449 23.2863 162.659 22.4258V14.4231H166.56V28.5928C166.56 29.7784 166.312 30.8206 165.814 31.7193C165.336 32.6181 164.648 33.316 163.749 33.8132C162.851 34.3104 161.818 34.559 160.651 34.559H158.299ZM175.442 28.9657C174.238 28.9657 173.167 28.7458 172.23 28.306C171.312 27.847 170.595 27.216 170.078 26.4128C169.562 25.5906 169.304 24.6536 169.304 23.6018V19.9016C169.304 18.7734 169.562 17.779 170.078 16.9185C170.595 16.058 171.312 15.3887 172.23 14.9107C173.167 14.4326 174.238 14.1936 175.442 14.1936H177.737C179.573 14.1936 181.045 14.7099 182.154 15.7425C183.263 16.7751 183.818 18.1519 183.818 19.8729V22.9134H173.205V23.6018C173.205 24.2329 173.406 24.7396 173.807 25.1221C174.209 25.5045 174.754 25.6957 175.442 25.6957H177.68C178.349 25.6957 178.884 25.5523 179.286 25.2655C179.707 24.9595 179.917 24.5675 179.917 24.0895H183.761C183.761 25.0456 183.502 25.8965 182.986 26.6423C182.47 27.3881 181.743 27.9617 180.806 28.3633C179.888 28.7649 178.827 28.9657 177.622 28.9657H175.442ZM179.974 20.1024V19.8729C179.974 19.1272 179.774 18.5344 179.372 18.0946C178.97 17.6356 178.435 17.4062 177.766 17.4062H175.442C174.754 17.4062 174.199 17.6452 173.779 18.1232C173.358 18.6013 173.148 19.2323 173.148 20.0164V20.1024H179.974Z",className:"fill-foreground"}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:"paint0_linear_60_1399",x1:"33.3607",y1:"28.1136",x2:"1.36327",y2:"7.10988",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{stopColor:"#9A6BAB"}),o.jsx("stop",{offset:"0.3179",stopColor:"#8C579F"}),o.jsx("stop",{offset:"0.7402",stopColor:"#7C4293"}),o.jsx("stop",{offset:"1",stopColor:"#773B8F"})]})})]})}function kp(t,e,n){t.length!==0&&Promise.all(t.map(i=>QV({file:i,folderId:e}).catch(r=>{const s=r instanceof Error?r.message:"Errore trascrizione";ee.error(`${i.name}: ${s}`)}))).finally(()=>{n()})}function dm({status:t,error:e,compact:n}){const{t:i}=Ye("common");switch((t??"").toUpperCase()){case"IN_PROGRESS":return o.jsxs(Ci,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-500/20 gap-1",title:i("documentStatus.inProgress.title"),children:[o.jsx(Vn,{className:"h-3 w-3 animate-spin"}),n?null:i("documentStatus.inProgress.label")]});case"COMPLETED":return o.jsxs(Ci,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20 gap-1",title:i("documentStatus.completed.title"),children:[o.jsx(Jj,{className:"h-3 w-3"}),n?null:i("documentStatus.completed.label")]});case"FAILED":return o.jsxs(Ci,{variant:"outline",className:"bg-red-500/10 text-red-600 border-red-500/20 gap-1",title:e??i("documentStatus.failed.title"),children:[o.jsx(g8,{className:"h-3 w-3"}),n?null:i("documentStatus.failed.label")]});case"PENDING":default:return o.jsxs(Ci,{variant:"outline",className:"bg-muted text-muted-foreground border-border gap-1",title:i("documentStatus.pending.title"),children:[o.jsx(t_,{className:"h-3 w-3"}),n?null:i("documentStatus.pending.label")]})}}let hs=null,Np=0;function yae(){return localStorage.getItem("user.token")}function wae(){const t=yae();return t?(hs&&hs.connected||hs||(hs=Td(`${Re}/tasks`,{transports:["websocket"],auth:{token:t}})),hs):null}function Sae(){const t=wae();return t?(Np+=1,t):null}function Cae(){Np=Math.max(0,Np-1),Np===0&&hs&&(hs.disconnect(),hs=null)}function VL(t){const e=v.useRef(t);e.current=t,v.useEffect(()=>{if(!t)return;const n=Sae();if(!n)return;const i=r=>{e.current?.(r)};return n.on("document.updated",i),()=>{n.off("document.updated",i),Cae()}},[!!t])}async function Q2(){const t=await De(_e.COLLECTIONS,{method:"GET"});return Array.isArray(t)?t:[]}async function Eae(t){return De(_e.COLLECTIONS_ONE(t),{method:"GET"})}async function Aae(t){return De(_e.COLLECTIONS,{method:"POST",jsonBody:t})}async function kae(t,e){return De(_e.COLLECTIONS_DOCUMENTS(t),{method:"POST",jsonBody:e})}async function Nae(t,e){await De(_e.COLLECTIONS_DOCUMENT_ONE(t,e),{method:"DELETE"})}async function jae(t,e,n){return De(_e.COLLECTIONS_DOCUMENT_REPLACE(t,e),{method:"POST",jsonBody:n})}async function Z2(t){return De(_e.COLLECTIONS_SUSPEND(t),{method:"POST"})}async function J2(t){return De(_e.COLLECTIONS_ACTIVATE(t),{method:"POST"})}async function eN(t){await De(_e.COLLECTIONS_ONE(t),{method:"DELETE"})}async function W0(t){return De(_e.PROCESSING_INDEX,{method:"POST",jsonBody:t})}async function _ae(t){return De(_e.COLLECTIONS_REGENERATE_API_KEY(t),{method:"POST"})}function Tae(t,e){const n=URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,i.rel="noopener",document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}function qL(){const[t,e]=v.useState(!1),[n,i]=v.useState(""),[r,s]=v.useState(""),[l,u]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(),[x,b]=v.useState(),[w,C]=v.useState("markdown"),[A,E]=v.useState(null),[k,N]=v.useState(),[_,R]=v.useState(),[T,L]=v.useState(),[M,U]=v.useState(null),[D,G]=v.useState(!1),[Z,Q]=v.useState(null),K=v.useCallback(B=>{B&&!B.isRemote&&URL.revokeObjectURL(B.uri)},[]),q=v.useCallback(B=>{B?.isBlob&&URL.revokeObjectURL(B.uri)},[]),F=v.useCallback(B=>{if(!B){E(H=>(K(H),null)),Q(H=>(q(H),null)),e(!1),N(void 0),R(void 0),L(void 0),U(null),G(!1),C("markdown"),s("");return}e(!0)},[K,q]),V=v.useCallback((B,H,P)=>{const J=$2(H,P);J&&Q(he=>(q(he),{uri:URL.createObjectURL(B),kind:J,isBlob:!0}))},[q]),O=v.useCallback(async B=>{const{documentId:H,name:P,extension:J,...he}=B,ue=ba(J||P.split(".").pop()||"");i(P),f(he.sourceUrl),m(he.sizeLabel),b(he.updatedAtLabel),u(!0),s(""),E(W=>(K(W),null)),Q(W=>(q(W),null)),R(void 0),L(void 0),U(H),e(!0);try{if(kne(ue)){C("markdown");const[W,fe]=await Promise.all([VV(H),yk(H)]);if(s(W),R(fe.url),L(fe.name),Gne({documentSource:he.documentSource,sourceUrl:he.sourceUrl}))try{const{blob:se,contentType:pe}=await GV(H);V(se,pe,ue)}catch{}}else{C("document"),N(ue||void 0);
777const W=await yk(H);if(R(W.url),L(W.name),kD(ue))E({uri:W.url,isRemote:!0});else{const{blob:fe,contentType:se}=await bk(H),pe=URL.createObjectURL(fe),Ee=$2(se,ue);Ee?Q({uri:pe,kind:Ee,isBlob:!0}):E({uri:pe,isRemote:!1})}}}catch(W){dA.error(W instanceof Error?W.message:Jt.t("markdown.openFileError")),F(!1)}finally{u(!1)}},[K,q,F,V]),X=v.useCallback(async()=>{if(M!=null){G(!0);try{const{blob:B}=await bk(M);Tae(B,T||n)}catch(B){if(_){const H=document.createElement("a");H.href=_,H.download=T||n,H.target="_blank",H.rel="noopener noreferrer",document.body.appendChild(H),H.click(),H.remove()}else dA.error(B instanceof Error?B.message:Jt.t("markdown.downloadFailed"))}finally{G(!1)}}},[M,T,n,_]);return{sheetProps:{open:t,onOpenChange:F,title:n,content:r,loading:l,sourceUrl:d,sizeLabel:p,updatedAtLabel:x,variant:w,docUri:A?.uri,fileType:k,docUriIsRemote:A?.isRemote,downloadUrl:_,onDownload:M!=null?X:void 0,downloading:D,sidebarMedia:Z?{uri:Z.uri,kind:Z.kind}:void 0},openDocumentPreview:O}}const Rae=`<svg width="404" height="404" viewBox="0 0 404 404" fill="none" xmlns="http://www.w3.org/2000/svg">
778<path d="M316.357 37H144.203C139.485 37 134.979 38.9609 131.764 42.4131L75.0605 103.285C72.1297 106.432 70.5 110.572 70.5 114.872V353.223C70.5002 361.839 77.7164 369 86.6426 369H316.357C325.284 369 332.5 361.839 332.5 353.223V52.7773C332.5 44.1609 325.284 37.0001 316.357 37Z" stroke="#460B5D" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
779<rect x="112" y="245" width="180" height="78" rx="4" fill="#460B5D"/>
780<rect x="123.5" y="184" width="167" height="15" rx="7.5" fill="#460B5D"/>
781<rect x="123.5" y="151" width="167" height="15" rx="7.5" fill="#460B5D"/>
782<rect x="123.5" y="118" width="167" height="15" rx="7.5" fill="#460B5D"/>
783{{TEXT_PLACEHOLDER}}
784</svg>`,Pae=`<svg width="404" height="404" viewBox="0 0 404 404" fill="none" xmlns="http://www.w3.org/2000/svg">
785<path d="M316.357 37H144.203C139.485 37 134.979 38.9609 131.764 42.4131L75.0605 103.285C72.1297 106.432 70.5 110.572 70.5 114.872V353.223C70.5002 361.839 77.7164 369 86.6426 369H316.357C325.284 369 332.5 361.839 332.5 353.223V52.7773C332.5 44.1609 325.284 37.0001 316.357 37Z" stroke="white" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
786<rect x="112" y="245" width="180" height="78" rx="4" fill="white"/>
787<rect x="123.5" y="184" width="167" height="15" rx="7.5" fill="white"/>
788<rect x="123.5" y="151" width="167" height="15" rx="7.5" fill="white"/>
789<rect x="123.5" y="118" width="167" height="15" rx="7.5" fill="white"/>
790{{TEXT_PLACEHOLDER}}
791</svg>`;function jp(t,e="light"){const n=t.toUpperCase().substring(0,4),i=e==="dark"?Pae:Rae,r=e==="dark"?"#460B5D":"white",l=`<text x="202" y="290" font-family="Arial, sans-serif" font-size="${n.length>3?"36":"48"}" font-weight="bold" fill="${r}" text-anchor="middle" dominant-baseline="middle">${n}</text>`,u=i.replace("{{TEXT_PLACEHOLDER}}",l);return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}const Dae=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
792<rect width="32" height="32" rx="5" fill="#532B61"/>
793<path d="M4.40002 15L15.4 4C16.9 2.5 19.4 2.5 20.9 4C22.4 5.5 22.4 8 20.9 9.5M20.9 9.5L12.6 17.8M20.9 9.5C22.4 8 24.9 8 26.4 9.5L26.457 9.557C27.957 11.057 27.957 13.557 26.457 15.057L16.457 25.057C15.947 25.567 15.947 26.357 16.457 26.857L18.457 28.857M18.057 6.857L9.95702 14.957C8.45702 16.457 8.45702 18.957 9.95702 20.457C11.457 21.957 13.957 21.957 15.457 20.457L23.557 12.357" stroke="white" stroke-width="1.7" stroke-linecap="round"/>
794</svg>`,Lae=`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
795<rect width="32" height="32" rx="5" fill="white"/>
796<path d="M4.40002 15L15.4 4C16.9 2.5 19.4 2.5 20.9 4C22.4 5.5 22.4 8 20.9 9.5M20.9 9.5L12.6 17.8M20.9 9.5C22.4 8 24.9 8 26.4 9.5L26.457 9.557C27.957 11.057 27.957 13.557 26.457 15.057L16.457 25.057C15.947 25.567 15.947 26.357 16.457 26.857L18.457 28.857M18.057 6.857L9.95702 14.957C8.45702 16.457 8.45702 18.957 9.95702 20.457C11.457 21.957 13.957 21.957 15.457 20.457L23.557 12.357" stroke="#532B61" stroke-width="1.7" stroke-linecap="round"/>
797</svg>`;function Oae(t="light"){return`data:image/svg+xml,${encodeURIComponent(t==="dark"?Lae:Dae)}`}const Mae=new Set(["mp3","wav","m4a","aac","flac","ogg","oga","opus","wma","aiff","aif","amr","mp4","m4v","mov","avi","mkv","webm"]);function vc(t){if(t.type.startsWith("audio/")||t.type.startsWith("video/"))return!0;const e=t.name.split(".").pop()?.toLowerCase()??"";return Mae.has(e)}function tN(t){return{id:`collection-${t.id}`,collectionId:t.id,name:t.name??`Collection ${t.id}`,status:t.isActive===!1?"Disattivato":"Attivo",createdAt:t.createdAt??"",updatedAt:t.updatedAt??t.createdAt??"",sharing:t.sharing??{outgoing:!1,incoming:!1}}}function Ab(t){const e=t.size??0,n=e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,i=(t.processingStatus??"").toUpperCase(),r=i==="IN_PROGRESS"||i==="PENDING"?"In Progress":"Attivo";return{id:String(t.id),name:t.name,type:(t.type??"FILE").toUpperCase(),size:n,modified:t.createdAt?sh(t.createdAt):"—",status:r,processingStatus:t.processingStatus,processingError:t.processingError??null,sourceUrl:t.uri,documentSource:t.source}}function nN(t){return t==="mcp"?"mcp":"documenti"}function iN(t,e){return t==="Attivo"?e("status.active"):t==="Disattivato"?e("status.inactive"):t}function bc(t){const e=t._count?.documents??0,n=r=>{const s=r*666;return s<1024?`${s}Kb`:`${(s/1024).toFixed(1)}Mb`},i=EV(t);return{id:String(t.id),title:t.name??Jt.t("common.unnamed",{ns:"dashboard"}),files:e,type:"Folder",size:n(e),modified:t.createdAt?sh(t.createdAt):"—",status:"Attivo",categoryId:0,color:i,...t.sharing?{sharing:{outgoing:t.sharing.outgoing,incoming:t.sharing.incoming}}:{}}}const kb=({type:t="folder"})=>o.jsxs("div",{className:"bg-background border border-border w-[158px] h-[229.47px] rounded-[5.62px] overflow-hidden flex flex-col gap-[20.24px] p-0 shadow-sm relative",children:[o.jsxs("div",{className:"bg-muted/10 flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] mx-auto mt-[4px] relative overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-muted/20 to-transparent animate-shimmer"}),t==="folder"?o.jsxs("div",{className:"relative w-[90px] h-[60px] bg-muted/30 rounded-lg animate-pulse flex items-end p-2",children:[o.jsx("div",{className:"absolute -top-2 left-0 w-10 h-4 bg-muted/30 rounded-t-md"}),o.jsx("div",{className:"w-full h-2 bg-muted/10 rounded-full"})]}):o.jsxs("div",{className:"relative w-[70px] h-[90px] bg-muted/30 rounded-md animate-pulse flex flex-col gap-2 p-3",children:[o.jsx("div",{className:"absolute top-0 right-0 w-6 h-6 bg-muted/50 rounded-bl-lg rounded-tr-md"}),o.jsx("div",{className:"w-full h-2 bg-muted/10 rounded-full"}),o.jsx("div",{className:"w-3/4 h-2 bg-muted/10 rounded-full"}),o.jsx("div",{className:"w-1/2 h-2 bg-muted/10 rounded-full"})]})]}),o.jsxs("div",{className:"text-center w-full px-3 space-y-2 pb-4",children:[o.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[o.jsx("div",{className:"h-4 bg-muted/40 animate-pulse rounded-md w-2/3"}),o.jsx("div",{className:"w-2 h-2 rounded-full bg-muted/30 animate-pulse flex-shrink-0"})]}),o.jsx("div",{className:"h-3 bg-muted/20 animate-pulse rounded-full w-1/3 mx-auto"})]})]}),up=({columns:t=7})=>o.jsx(Ot,{className:"hover:bg-transparent",children:Array.from({length:t}).map((e,n)=>
797o.jsx(Oe,{children:n===0?o.jsx("div",{className:"h-4 w-4 rounded bg-muted/30 animate-pulse"}):n===1?o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 rounded-lg bg-muted/30 animate-pulse flex-shrink-0"}),o.jsx("div",{className:"h-4 bg-muted/40 animate-pulse rounded-md w-32"})]}):n===5?o.jsx("div",{className:"h-6 w-16 rounded-full bg-muted/20 animate-pulse"}):n===6?o.jsx("div",{className:"h-8 w-8 rounded-md bg-muted/20 animate-pulse ml-auto"}):o.jsx("div",{className:"h-4 bg-muted/20 animate-pulse rounded-md w-12"})},n))});function Iae(t){const e=`${t.firstname??""} ${t.surname??""}`.trim();return e?`${e} (${t.email})`:t.email}function Nb({resourceType:t,resourceId:e,iconClassName:n="h-4 w-4"}){const{t:i}=Ye("dashboard"),[r,s]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(null),[p,m]=v.useState(null),x=v.useRef(null),b=()=>{if(d||l)return;u(!0),m(null),(t==="folder"?fR(e):pR(e)).then(_=>f(_)).catch(()=>m(i("dashboard.sharedLoadError"))).finally(()=>u(!1))},w=()=>{x.current!=null&&(window.clearTimeout(x.current),x.current=null)},C=()=>{w(),s(!0),b()},A=()=>{w(),x.current=window.setTimeout(()=>{s(!1)},120)},E=d?.directShares??[],k=d?.groupShares??[];return o.jsxs(hl,{open:r,children:[o.jsx(fl,{asChild:!0,children:o.jsx("span",{title:i("dashboard.sharedBadgeTitle"),"aria-label":i("dashboard.sharedBadgeAria"),className:"text-primary flex-shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full transition-colors hover:bg-muted/80",onMouseEnter:C,onMouseLeave:A,onClick:N=>N.stopPropagation(),children:o.jsx(gr,{className:n})})}),o.jsx(pl,{className:"w-80 p-3",align:"start",onMouseEnter:C,onMouseLeave:A,children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"text-[10px] font-medium text-foreground",children:i("dashboard.sharedWith")}),l&&o.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("dashboard.sharedLoading")}),p&&!l&&o.jsx("p",{className:"text-[10px] text-destructive",children:p}),!l&&!p&&E.length===0&&k.length===0&&o.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("dashboard.noActiveShares")}),!l&&!p&&E.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:i("dashboard.directAccess")}),E.map(N=>o.jsx("p",{className:"text-[10px] text-foreground break-all",children:Iae(N.recipient)},N.recipientEmployeeId))]}),!l&&!p&&k.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:i("dashboard.groups")}),k.map(N=>o.jsx("p",{className:"text-[10px] text-foreground",children:N.group.name},N.groupId))]})]})})]})}function zae(){const{t}=Ye("dashboard"),e=Kn(),[n,i]=ym(),{user:r,logout:s}=Ar(),{theme:l}=nh(),[u,d]=v.useState(()=>nN(n.get("tab"))),[f,p]=v.useState("grid"),[m,x]=v.useState(""),[b,w]=v.useState([]),[C,A]=v.useState([]),[E,k]=v.useState([]),[N,_]=v.useState([]),[R,T]=v.useState([]),[L,M]=v.useState([]),[U,D]=v.useState([]),[G,Z]=v.useState(!1),[Q,K]=v.useState(!1),[q,F]=v.useState(null),[V,O]=v.useState(!1),[X,$]=v.useState(!1),[B,H]=v.useState(!1),[P,J]=v.useState(1),[he,ue]=v.useState(16),[W,fe]=v.useState(!1),[se,pe]=v.useState(!1),[Ee,Ce]=v.useState(!1),[Ne,qe]=v.useState(!1),[pt,$e]=v.useState(""),[je,xt]=v.useState("title"),[Ae,at]=v.useState("asc"),[xe,me]=v.useState(!1),[rt,ve]=v.useState(null),[Me,le]=v.useState(!1),[ye,Ie]=v.useState(!1),[et,nt]=v.useState(""),[en,tn]=v.useState([]),[cn,zt]=v.useState([]),[mn,yt]=v.useState(null),[Ai,Fn]=v.useState(!1),[su,bo]=v.useState(!1),[yo,wo]=v.useState(!1),[Nr,So]=v.useState(!1),[Ps,El]=v.useState(!1),xh=v.useRef(null),Co=v.useRef(null);v.useEffect(()=>{const I=nN(n.get("tab"));d(te=>te===I?te:I)},[n]);const{sheetProps:Eo,openDocumentPreview:ug}=qL(),[vh,Al]=v.useState(!1),[bh,kl]=v.useState("groups"),[au,ou]=v.useState(null);v.useEffect(()=>{(async()=>{if(!r?.id){console.warn("User ID not available");return}$(!0),O(!0),H(!0);try{const[te,we,ze,ot]=await Promise.all([ca(),no(),Q2(),new Promise(Tt=>setTimeout(Tt,1e3))]);F(we.id);const Yt=te.filter(Tt=>Tt.id!==we.id);T(Yt.map(bc));const nn=(await Ic({folderId:we.id,pageSize:500})).data??[];M(nn.map(Ab)),_(ze.map(tN)),K(!0);try{const Tt=await As(),rn=R_(Tt);if(Z(rn),rn){const ai=(await qV({pageSize:200})).data??[];D(ai.map(Fs=>({...Ab(Fs),readOnly:!0})))}else D([])}catch{Z(!1),D([])}finally{K(!1)}}catch(te){console.error("Error loading documents:",te),ee.error(t("toasts.loadDocumentsError")),T([]),M([]),_([])}finally{$(!1),O(!1),H(!1)}})()},[r?.id]);const jr=v.useCallback(async I=>{if(!r?.id||q==null)return;const te=I?.silent===!0;te||O(!0);try{const[we,ze]=await Promise.all([Ic({folderId:q,pageSize:500}),te?Promise.resolve():new Promise(Yt=>setTimeout(Yt,800))]),ot=we.data??[];M(ot.map(Ab))}catch(we){console.error("Error fetching unclassified files:",we),te||M([])}finally{te||O(!1)}},[r?.id,q]),ki=v.useRef(jr);ki.current=jr;const gn=async I=>{await ug({documentId:Number(I.id),name:I.name,extension:I.type,sourceUrl:I.sourceUrl,documentSource:I.documentSource,sizeLabel:I.size,updatedAtLabel:I.modified})},Jn=async I=>{try{await Zp(Number(I.id)),ee.success(t("toasts.fileDeleted",{name:I.name})),k(te=>te.filter(we=>we!==I.id)),await jr()}catch(te){ee.error(te instanceof Error?te.message:t("toasts.deleteError"))}},Ds=async I=>{try{await Uw(Number(I.id)),M(te=>te.map(we=>we.id===I.id?{...we,processingStatus:"PENDING",processingError:null,status:"In Progress"}:we)),ee.success(t("toasts.requeued"))}catch(te){ee.error(te instanceof Error?te.message:t("toasts.requeueError"))}},Ao=I=>{const te=Array.from(new Set(I));te.length!==0&&(tn(te),nt(""),le(!0))},yh=async(I,te)=>
797{if(q==null){ee.error(t("toasts.generalFolderUnavailable"));return}const we=Array.from(new Set(I));if(we.length!==0){Ie(!0);try{const ze=await Promise.allSettled(we.map(async Yn=>{const nn=Number(Yn);return await SV(te,nn),await CV(q,nn),Yn})),ot=ze.filter(Yn=>Yn.status==="fulfilled").length,Yt=ze.length-ot;ot>0?ee.success(Yt>0?`${ot} file spostati, ${Yt} non riusciti`:`${ot} file spostati con successo`):ee.error(t("toasts.moveFailed")),k(Yn=>Yn.filter(nn=>!we.includes(nn))),tn([]),le(!1),await Promise.all([jr(),ko()])}catch(ze){console.error("Move unclassified files error:",ze),ee.error(t("toasts.moveError"))}finally{Ie(!1)}}},dg=async()=>{const I=Number(et);if(Number.isNaN(I)){ee.error(t("toasts.selectDestinationFolder"));return}await yh(en,I)},wh=async()=>{const I=[...E];if(I.length!==0&&window.confirm(`Eliminare ${I.length} file selezionati? Questa azione non può essere annullata.`)){wo(!0);try{const te=await Promise.allSettled(I.map(ot=>Zp(Number(ot)))),we=te.filter(ot=>ot.status==="fulfilled").length,ze=te.length-we;we>0?ee.success(ze>0?t("toasts.deletePartialSuccess",{succeeded:we,failed:ze}):t("toasts.deleteBulkSuccess",{count:we})):ee.error(t("toasts.deleteBulkFailed")),k([]),Fn(!1),await jr()}catch(te){console.error("Delete selected unclassified files error:",te),ee.error(t("toasts.deleteBulkError"))}finally{wo(!1)}}},ya=(I,te)=>{const we=E.includes(te)?E:[te];zt(we),I.dataTransfer.effectAllowed="move",I.dataTransfer.setData("text/plain",we.join(","))},Nl=()=>{zt([]),yt(null)},Ls=(I,te)=>{cn.length!==0&&(I.preventDefault(),I.dataTransfer.dropEffect="move",yt(te))},Os=async(I,te)=>{I.preventDefault(),yt(null);const we=Number(te);if(Number.isNaN(we))return;const ze=cn.length>0?cn:I.dataTransfer.getData("text/plain").split(",").filter(Boolean);zt([]),await yh(ze,we)},Ms=v.useRef(!1);VL(I=>{Ms.current=!1;const te=String(I.id);M(we=>{if(!we.some(Yt=>Yt.id===te))return Ms.current=!0,we;const ze=(I.processingStatus??"").toUpperCase(),ot=ze==="IN_PROGRESS"||ze==="PENDING"?"In Progress":"Attivo";return we.map(Yt=>Yt.id===te?{...Yt,processingStatus:I.processingStatus,processingError:I.error??null,status:ot}:Yt)}),Ms.current&&Promise.resolve().then(()=>{ki.current({silent:!0})})});const wa=()=>{fe(!1),s(),e("/login")},Nn=()=>{e("/settings")},Sh=I=>{const te=I.target.files;if(te&&te.length>0){const we=Array.from(te).map(ze=>ze.name).join(", ");ee.success(t("toasts.filesSelected",{count:te.length,names:we}))}},Ch=async(I,te,we,ze)=>{if(!r?.id){ee.error(t("toasts.notAuthenticated"));return}let ot=!1;try{if(ze){const nn=await ca(),Tt=q!=null?nn.filter(rn=>rn.id!==q):nn;T(Tt.map(bc)),jr();return}if(I==="general"){if(te.length===0){ee.success(t("toasts.noFilesToUpload"));return}const nn=q??(await no()).id,Tt=te.filter(vc),rn=te.filter(zs=>!vc(zs));rn.length>0&&await Nc(rn,nn),Tt.length>0&&(ot=!0,kp(Tt,nn,()=>ki.current({silent:!0}))),Tt.length>0&&rn.length>0?ee.success(t("toasts.uploadMixed",{uploaded:rn.length,transcription:Tt.length})):Tt.length>0?ee.success(t("toasts.transcriptionStarted",{count:Tt.length})):ee.success(t("toasts.uploadedUnclassified"))}else if(we){const nn=await dy({name:we});if(te.length>0){const Tt=te.filter(vc),rn=te.filter(zs=>!vc(zs));rn.length>0&&await Nc(rn,nn.id),Tt.length>0&&(ot=!0,kp(Tt,nn.id,()=>ki.current({silent:!0}))),Tt.length>0&&rn.length>0?ee.success(t("toasts.folderCreatedWithMixed",{name:we,uploaded:rn.length,transcription:Tt.length})):Tt.length>0?ee.success(t("toasts.folderCreatedWithTranscription",{name:we,count:Tt.length})):ee.success(t("toasts.folderCreatedWithFiles",{name:we,count:te.length}))}else ee.success(t("toasts.folderCreated",{name:we}))}else{const nn=parseInt(I,10);if(Number.isNaN(nn)){ee.error(t("toasts.invalidFolderId"));return}if(te.length===0){ee.success(t("toasts.noFilesToUpload"));return}const Tt=te.filter(vc),rn=te.filter(zs=>!vc(zs));rn.length>0&&await Nc(rn,nn),Tt.length>0&&(ot=!0,kp(Tt,nn,()=>ki.current({silent:!0}))),Tt.length>0&&rn.length>0?ee.success(t("toasts.uploadToFolderMixed",{uploaded:rn.length,transcription:Tt.length})):Tt.length>0?ee.success(t("toasts.uploadToFolderTranscription",{count:Tt.length})):ee.success(t("toasts.uploadToFolder",{count:te.length}))}const Yt=await ca(),Yn=q!=null?Yt.filter(nn=>nn.id!==q):Yt;T(Yn.map(bc)),jr(ot?{silent:!0}:void 0)}catch(Yt){console.error("Add resource error:",Yt),ee.error(Yt instanceof Error?Yt.message:t("toasts.operationError"))}},ts=()=>{Ce(!0),setTimeout(()=>{Co.current?.focus()},100)},_r=async()=>{const I=pt.trim();if(I){if(!r?.id){ee.error(t("toasts.notAuthenticated"));return}qe(!0);try{await dy({name:I}),$e(""),Ce(!1),ee.success(t("toasts.folderCreated",{name:I}
797));const te=await ca(),we=q??(await no()).id;q==null&&F(we),$(!0),await new Promise(ot=>setTimeout(ot,600));const ze=te.filter(ot=>ot.id!==we);T(ze.map(bc))}catch(te){console.error("Create folder error:",te),ee.error(te instanceof Error?te.message:t("toasts.createFolderError"))}finally{qe(!1),$(!1)}}},jl=()=>{$e(""),Ce(!1)},Eh=async(I,te)=>{const we=N.find(ze=>ze.id===I);if(we)try{await Z2(we.collectionId),_(ze=>ze.map(ot=>ot.id===I?{...ot,status:"Disattivato"}:ot)),ee.success(t("toasts.connectorDisabled",{name:te}))}catch(ze){ee.error(ze instanceof Error?ze.message:t("toasts.disableConnectorError"))}},Ah=async(I,te)=>{const we=N.find(ze=>ze.id===I);if(we)try{await J2(we.collectionId),_(ze=>ze.map(ot=>ot.id===I?{...ot,status:"Attivo"}:ot)),ee.success(t("toasts.connectorActivated",{name:te}))}catch(ze){ee.error(ze instanceof Error?ze.message:t("toasts.activateConnectorError"))}},hg=async(I,te)=>{const we=N.find(ze=>ze.id===I);if(we)try{await eN(we.collectionId),_(ze=>ze.filter(ot=>ot.id!==I)),A(ze=>ze.filter(ot=>ot!==I)),ee.success(t("toasts.connectorDeleted",{name:te}))}catch(ze){ee.error(ze instanceof Error?ze.message:t("toasts.deleteConnectorError"))}},_l=async()=>{const I=N.filter(te=>C.includes(te.id));if(I.length!==0){So(!0);try{await Promise.all(I.map(we=>eN(we.collectionId)));const te=new Set(I.map(we=>we.id));_(we=>we.filter(ze=>!te.has(ze.id))),A([]),bo(!1),ee.success(I.length===1?t("toasts.connectorDeleted",{name:I[0].name}):t("toasts.connectorsDeleted",{count:I.length}))}catch(te){ee.error(te instanceof Error?te.message:t("toasts.deleteConnectorsError"))}finally{So(!1)}}},Tl=async()=>{const I=N.filter(te=>C.includes(te.id)&&te.status==="Attivo");if(I.length!==0){El(!0);try{await Promise.all(I.map(we=>Z2(we.collectionId)));const te=new Set(I.map(we=>we.id));_(we=>we.map(ze=>te.has(ze.id)?{...ze,status:"Disattivato"}:ze)),ee.success(I.length===1?t("toasts.connectorDisabled",{name:I[0].name}):t("toasts.connectorsDisabled",{count:I.length}))}catch(te){ee.error(te instanceof Error?te.message:t("toasts.disableConnectorsError"))}finally{El(!1)}}},Tr=async()=>{const I=N.filter(te=>C.includes(te.id)&&te.status==="Disattivato");if(I.length!==0){El(!0);try{await Promise.all(I.map(we=>J2(we.collectionId)));const te=new Set(I.map(we=>we.id));_(we=>we.map(ze=>te.has(ze.id)?{...ze,status:"Attivo"}:ze)),ee.success(I.length===1?t("toasts.connectorActivated",{name:I[0].name}):t("toasts.connectorsActivated",{count:I.length}))}catch(te){ee.error(te instanceof Error?te.message:t("toasts.activateConnectorsError"))}finally{El(!1)}}},Ni=()=>{e("/dashboard/new-mcp")},lu=I=>{ve(I),me(!0)},fg=async(I,te)=>{if(rt){if(!r?.id){ee.error(t("toasts.notAuthenticated"));return}try{await yV(Number(rt),{name:I,options:[{name:"color",value:te}]}),ee.success(t("toasts.folderUpdated",{name:I})),ve(null),$(!0);const[we,ze]=await Promise.all([ca(),new Promise(Yn=>setTimeout(Yn,600))]),ot=q??(await no()).id;q==null&&F(ot);const Yt=we.filter(Yn=>Yn.id!==ot);T(Yt.map(bc))}catch(we){console.error("Edit folder error:",we),ee.error(we instanceof Error?we.message:t("toasts.updateFolderError"))}finally{$(!1)}}},ko=v.useCallback(async()=>{const I=await ca(),te=q??(await no()).id;q==null&&F(te);const we=I.filter(ze=>ze.id!==te);T(we.map(bc))},[q]),kh=v.useCallback(async()=>{const I=await Q2();_(I.map(tN))},[]),No=async(I,te)=>{if(window.confirm(`Eliminare la cartella "${te}"? Questa azione non può essere annullata.`))try{$(!0),await wV(Number(I)),ee.success(t("toasts.folderDeleted",{name:te})),w(we=>we.filter(ze=>ze!==I)),await ko()}catch(we){console.error("Delete folder error:",we),ee.error(we instanceof Error?we.message:t("toasts.deleteFolderError"))}finally{$(!1)}},pg=()=>{ou(null),kl("groups"),Al(!0)},Wn=I=>{ou(I),kl("sharing"),Al(!0)},Rl=I=>!I||I==="purple"?Rc:DD(I),cu=R.filter(I=>I.title.toLowerCase().includes(m.toLowerCase())),Pl=N.filter(I=>I.name.toLowerCase().includes(m.toLowerCase())),Is=[...cu].sort((I,te)=>{let we=0;switch(je){case"title":we=Zt(I.title,te.title);break;case"files":we=I.files-te.files;break;case"type":we=Zt(I.type,te.type);break;case"size":we=parseInt(I.size)-parseInt(te.size);break;case"created":we=Zt(I.modified,te.modified);break;case"modified":we=Zt(I.modified,te.modified);break;default:we=0}return Ae==="asc"?we:-we}),uu=[...Pl].sort((I,te)=>{let we=0;switch(je){case"name":case"title":we=Zt(I.name,te.name);break;case"status":{const ze={Attivo:1,Disattivato:2};we=ze[I.status]-ze[te.status];break}case"created":we=new Date(I.createdAt).getTime()-new Date(te.createdAt).getTime();break;case"modified":we=new Date(I.updatedAt).getTime()-new Date(te.updatedAt).getTime();break;default:we=0}return Ae==="asc"?we:-we}
797),er=Math.ceil((u==="documenti"?Is:uu).length/he),du=(P-1)*he,hu=du+he,Rr=Is.slice(du,hu),ns=uu.slice(du,hu),Dl=L.filter(I=>E.includes(I.id)),Sa=v.useMemo(()=>N.filter(I=>C.includes(I.id)),[N,C]),jo=Sa.filter(I=>I.status==="Attivo"),tr=Sa.filter(I=>I.status==="Disattivato"),fu=I=>{w(te=>te.includes(I)?te.filter(we=>we!==I):[...te,I])},pu=()=>{b.length===Rr.length?w([]):w(Rr.map(I=>I.id))},Ca=I=>{A(te=>te.includes(I)?te.filter(we=>we!==I):[...te,I])},Ea=()=>{C.length===ns.length?A([]):A(ns.map(I=>I.id))},mu=I=>{p(I),I==="grid"&&he<16?ue(16):I==="table"&&he>10&&he!==20&&he!==50&&he!==100&&ue(10),J(1)},gu=I=>{const te=I;if(d(te),te==="mcp")i({tab:"mcp"},{replace:!0});else{const we=new URLSearchParams(n);we.delete("tab"),i(we,{replace:!0})}J(1),x(""),xt(I==="documenti"?"title":"name"),at("asc")},xn=I=>{je===I?at(Ae==="asc"?"desc":"asc"):(xt(I),at("asc"))};return o.jsxs("div",{className:"bg-background min-h-screen text-foreground",children:[o.jsx("input",{ref:xh,type:"file",multiple:!0,onChange:Sh,style:{display:"none"},accept:"*/*"}),o.jsxs("header",{className:"bg-card border-b border-border py-6 px-8 shadow-sm flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(K0,{className:"h-8 w-auto"}),o.jsx("span",{className:"text-2xl font-bold text-foreground"})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Pre,{}),r&&o.jsx(GL,{userName:r.fullName,onSettings:Nn,onLogoutClick:()=>fe(!0)}),o.jsx(si,{})]})]}),o.jsx(yn,{open:W,onOpenChange:fe,children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("dialogs.logout.title")}),o.jsx(In,{children:t("dialogs.logout.description")})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>fe(!1),children:t("common.no")}),o.jsx(ie,{variant:"destructive",onClick:wa,children:t("common.yes")})]})]})}),o.jsx(pie,{isOpen:se,onClose:()=>pe(!1),existingFolders:R,generalFolderId:q??void 0,onConfirm:Ch}),o.jsx(yn,{open:Me,onOpenChange:I=>{ye||(le(I),I||(tn([]),nt("")))},children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("dialogs.moveFiles.title")}),o.jsx(In,{children:t("dialogs.moveFiles.description",{count:en.length})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:t("dialogs.moveFiles.destinationLabel")}),o.jsxs(Br,{value:et,onValueChange:nt,disabled:ye,children:[o.jsx(Gr,{children:o.jsx(Hr,{placeholder:t("dialogs.moveFiles.destinationPlaceholder")})}),o.jsx(Vr,{children:R.map(I=>o.jsx(di,{value:I.id,children:I.title},I.id))})]})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>le(!1),disabled:ye,children:t("common.cancel")}),o.jsxs(ie,{onClick:()=>void dg(),disabled:ye||!et,children:[o.jsx(Vf,{className:"mr-2 h-4 w-4"}),t(ye?"dialogs.moveFiles.moving":"common.move")]})]})]})}),o.jsx(k0,{...Eo}),o.jsx(mie,{isOpen:xe,onClose:()=>{me(!1),ve(null)},folderName:rt&&R.find(I=>I.id===rt)?.title||"",folderColor:rt&&R.find(I=>I.id===rt)?.color||"purple",onConfirm:fg}),o.jsx(z0,{open:vh,onOpenChange:Al,initialTab:bh,target:au,onSharingChanged:async()=>{await Promise.all([ko(),jr(),kh()])}}),o.jsxs("main",{className:"flex-1 overflow-y-auto p-4 sm:p-8",children:[o.jsxs("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx(Zc,{value:u,onValueChange:gu,className:"w-full sm:w-auto",children:o.jsxs(Jc,{className:"bg-muted/50 flex h-auto min-h-10 w-full max-w-full gap-1 rounded-lg border border-border/50 p-1 shadow-inner backdrop-blur-sm sm:h-11 sm:max-w-[240px] sm:w-[240px]",children:[o.jsx(Xr,{value:"documenti",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground px-2 sm:flex-1 sm:px-3 sm:text-sm",children:t("tabs.documents")}),o.jsx(Xr,{value:"mcp",className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 rounded-md h-9 flex-1 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground px-2 sm:flex-1 sm:px-3 sm:text-sm",children:t("tabs.connectors")})]})}),o.jsxs("div",{className:"flex w-full shrink-0 flex-col gap-2 sm:w-auto 
797sm:flex-row sm:justify-end",children:[u==="documenti"&&o.jsxs(ie,{className:"flex w-full gap-2 sm:w-auto",onClick:()=>pe(!0),children:[o.jsx(c_,{className:"h-4 w-4"}),t("dashboard.addResources")]}),u==="mcp"&&o.jsxs(ie,{onClick:Ni,className:"flex w-full gap-2 sm:w-auto",children:[o.jsx(b8,{className:"h-4 w-4"}),t("dashboard.newConnector")]})]})]}),u==="documenti"&&o.jsxs("div",{className:"mb-8 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("h1",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:t("dashboard.resourceManagement")}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 sm:gap-4",children:[G&&o.jsx(ie,{variant:"outline",size:"icon",onClick:pg,"aria-label":t("dashboard.openCollabAria"),children:o.jsx(Md,{className:"h-4 w-4"})}),o.jsxs("div",{className:"flex bg-muted/50 h-9 p-1 gap-1 rounded-lg shadow-inner border border-border/50 backdrop-blur-sm",children:[o.jsx("button",{className:`h-7 px-3 border-none cursor-pointer transition-all duration-200 rounded-md ${f==="grid"?"bg-background text-foreground shadow-md shadow-black/5":"bg-transparent text-muted-foreground hover:text-foreground"}`,onClick:()=>mu("grid"),"aria-label":t("dashboard.gridViewAria"),children:o.jsx(W8,{className:"h-4 w-4"})}),o.jsx("button",{className:`h-7 px-3 border-none cursor-pointer transition-all duration-200 rounded-md ${f==="table"?"bg-background text-foreground shadow-md shadow-black/5":"bg-transparent text-muted-foreground hover:text-foreground"}`,onClick:()=>mu("table"),"aria-label":t("dashboard.tableViewAria"),children:o.jsx(G8,{className:"h-4 w-4",style:{transform:"rotate(90deg)"}})})]}),o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsxs(ie,{variant:"outline",children:[o.jsx(il,{className:"h-4 w-4 mr-2"}),t("common.sort")]})}),o.jsxs(Ur,{align:"end",className:"w-48",children:[o.jsxs(lt,{onClick:()=>xn("title"),onSelect:I=>I.preventDefault(),className:je==="title"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortNameAZ")}),je==="title"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("size"),onSelect:I=>I.preventDefault(),className:je==="size"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortWeightGb")}),je==="size"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("created"),onSelect:I=>I.preventDefault(),className:je==="created"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortCreated")}),je==="created"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("modified"),onSelect:I=>I.preventDefault(),className:je==="modified"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortModified")}),je==="modified"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]})]})]})]})]}),u==="mcp"&&o.jsxs("div",{className:"flex justify-between items-center mb-8",children:[o.jsx("h1",{className:"text-3xl font-bold text-foreground",children:t("tabs.connectors")}),o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsxs(ie,{variant:"outline",children:[o.jsx(il,{className:"h-4 w-4 mr-2"}),t("common.sort")]})}
797),o.jsxs(Ur,{align:"end",className:"w-48",children:[o.jsxs(lt,{onClick:()=>xn("name"),onSelect:I=>I.preventDefault(),className:je==="name"||je==="title"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortNameAZ")}),(je==="name"||je==="title")&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("created"),onSelect:I=>I.preventDefault(),className:je==="created"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortCreated")}),je==="created"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("modified"),onSelect:I=>I.preventDefault(),className:je==="modified"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("dashboard.sortModified")}),je==="modified"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>xn("status"),onSelect:I=>I.preventDefault(),className:je==="status"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx("span",{className:"flex-1",children:t("common.status")}),je==="status"&&(Ae==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]})]})]})})]}),u==="documenti"&&o.jsx("div",{className:"mb-6 max-w-md",children:o.jsxs("div",{className:"relative",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:t("common.searchDocuments"),value:m,onChange:I=>x(I.target.value),className:"pl-10"})]})}),u==="documenti"&&f==="grid"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-8",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground",children:t("dashboard.yourFolders")}),o.jsxs("button",{onClick:ts,disabled:Ee,className:"text-sm text-foreground hover:text-primary transition-colors flex items-center gap-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed bg-transparent border-none p-0",children:[t("dashboard.createFolder"),o.jsx(Bp,{className:"h-4 w-4"})]})]}),o.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,158px)] gap-[20.24px]",children:[Ee&&o.jsxs("div",{className:"bg-background border-2 border-primary flex flex-col items-center cursor-pointer w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0",children:[o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:Rc,alt:"New Folder",className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3",children:[o.jsx("div",{className:"flex items-center gap-1 justify-center",children:o.jsx(Qe,{ref:Co,value:pt,onChange:I=>$e(I.target.value),onKeyDown:I=>{I.key==="Enter"?_r():I.key==="Escape"&&jl()},placeholder:t("dashboard.folderNamePlaceholder"),className:"h-7 text-xs"})}),o.jsxs("div",{className:"flex gap-1 mt-2 justify-center",children:[o.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",disabled:Ne,onClick:()=>_r(),children:o.jsx(Zi,{className:"h-4 w-4 text-green-500 dark:text-green-400"})}),o.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",disabled:Ne,onClick:jl,children:o.jsx(yr,{className:"h-4 w-4 text-red-500 dark:text-red-400"})})]})]})]}),X?Array.from({length:8}).map((I,te)=>o.jsx(kb,{type:"folder"},te)):Rr.length===0&&!Ee?o.jsx("div",{className:"col-span-full text-center p-8",children:o.jsx("p",{className:"text-muted-foreground",children:t("dashboard.noDocuments")})}):Rr.map(I=>o.jsxs("div",{className:`bg-background border border-border flex flex-col items-center cursor-pointer transition-all hover:shadow-lg hover:scale-[1.02] hover:border-primary w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0 relative group ${mn===I.id?"border-primary ring-2 ring-primary/40":""}`,onClick:()=>e(`/dashboard/folder/${I.id}`),onDragOver:te=>Ls(te,I.id),onDragLeave:()=>{mn===I.id&&yt(null)},onDrop:te=>void Os(te,I.id),children:[(I.sharing?.outgoing||I.sharing?.incoming)&&o.jsx("div",{className:"absolute top-2 right-2 z-10",children:o.jsx(Nb,{resourceType:"folder",resourceId:Number(I.id),iconClassName:"h-3.5 w-3.5"})}),o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:Rl(I.color),alt:"Folder",className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3 relative",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("h3",{className:"text-sm font-semibold text-foreground truncate max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:I.title})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[I.files," File"]}),o.jsx("div",{className:"absolute bottom-0 right-2 z-20 opacity-0 group-hover:opacity-100 transition-opacity",onClick:te=>te.stopPropagation(),children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 hover:bg-accent",children:o.jsx(zA,{className:"h-4 w-4"})})}
797),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:te=>{te.stopPropagation(),e(`/dashboard/folder/${I.id}`)},children:[o.jsx(Wo,{className:"mr-2 h-4 w-4"}),t("common.open")]}),o.jsxs(lt,{onClick:te=>{te.stopPropagation(),lu(I.id)},children:[o.jsx(qf,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),G&&!I.sharing?.incoming&&o.jsxs(lt,{onClick:te=>{te.stopPropagation(),Wn({id:Number(I.id),type:"folder",name:I.title})},children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),!I.sharing?.incoming&&o.jsxs(lt,{variant:"destructive",className:"text-destructive",onClick:te=>{te.stopPropagation(),No(I.id,I.title)},children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]})]},I.id))]})]}),(V||L.length>0)&&o.jsxs("div",{className:"mb-8",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:t("dashboard.unclassifiedFiles")}),o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,158px)] gap-[20.24px]",children:V?Array.from({length:8}).map((I,te)=>o.jsx(kb,{type:"file"},te)):L.map(I=>o.jsxs("div",{className:"bg-background border border-border flex flex-col items-center cursor-pointer transition-all hover:shadow-lg hover:scale-[1.02] hover:border-primary w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0 relative group",draggable:!I.readOnly,onDragStart:te=>ya(te,I.id),onDragEnd:Nl,onClick:()=>{E.includes(I.id)?k(E.filter(te=>te!==I.id)):k([...E,I.id])},children:[o.jsx("div",{className:"absolute top-2 left-2 z-10",onClick:te=>te.stopPropagation(),children:o.jsx(On,{checked:E.includes(I.id),onCheckedChange:()=>{E.includes(I.id)?k(E.filter(te=>te!==I.id)):k([...E,I.id])}})}),o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:jp(I.type,l),alt:I.type,className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3 relative",children:[o.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground truncate max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:I.name}),o.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${(I.processingStatus??"").toUpperCase()==="COMPLETED"?"bg-green-500":["IN_PROGRESS","PENDING"].includes((I.processingStatus??"").toUpperCase())?"bg-yellow-500 animate-pulse":(I.processingStatus??"").toUpperCase()==="FAILED"?"bg-red-500":"bg-muted"}`,title:I.processingError??I.processingStatus??I.status})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:I.size}),o.jsx("div",{className:"absolute bottom-0 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:te=>te.stopPropagation(),children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6",children:o.jsx(zA,{className:"h-4 w-4"})})}),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:()=>void gn(I),children:[o.jsx(Wo,{className:"mr-2 h-4 w-4"}),t("common.open")]}),!I.readOnly&&o.jsxs(lt,{onClick:()=>Ao([I.id]),children:[o.jsx(Vf,{className:"mr-2 h-4 w-4"}),t("common.move")]}),G&&!I.readOnly&&o.jsxs(lt,{onClick:()=>Wn({id:Number(I.id),type:"document",name:I.name}),children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),!I.readOnly&&(I.processingStatus??"").toUpperCase()==="FAILED"&&o.jsxs(lt,{onClick:()=>void Ds(I),children:[o.jsx(Dc,{className:"mr-2 h-4 w-4"}),t("common.requeue")]}),!I.readOnly&&o.jsxs(lt,{children:[o.jsx(qf,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),!I.readOnly&&o.jsxs(lt,{className:"text-red-600",onClick:()=>void Jn(I),children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]})]},I.id))})]}),G&&(Q||U.length>0)&&o.jsxs("div",{className:"mb-8",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:t("dashboard.sharedWithYou")}),o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,158px)] gap-[20.24px]",children:Q?Array.from({length:4}).map((I,te)=>o.jsx(kb,{type:"file"},`sh-${te}`)):U.map(I=>o.jsxs("div",{className:"bg-background border border-border flex flex-col items-center cursor-pointer transition-all hover:shadow-lg hover:scale-[1.02] hover:border-primary w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0 relative group",onClick:()=>void gn(I),children:[o.jsx("div",{className:"absolute top-2 right-2 z-10 inline-flex h-6 w-6 items-center justify-center rounded-full transition-colors group-hover:bg-muted/80",children:o.jsx(gr,{className:"h-3.5 w-3.5 text-primary"})}),o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:jp(I.type,l),alt:I.type,className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3 relative",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground truncate max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:I.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:I.size})]})]},`shared-${I.id}`))})]})]}),u==="documenti"&&f==="table"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-8",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground",children:t("dashboard.yourFolders")}),o.jsxs("button",{onClick:ts,disabled:Ee,className:"text-sm text-foreground hover:text-primary transition-colors flex items-center gap-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed bg-transparent border-none p-0",children:[t("dashboard.createFolder"),o.jsx(Bp,{className:"h-4 w-4"})]})]}),o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-12",children:o.jsx(On,{checked:b.length===Rr.length&&Rr.length>0,onCheckedChange:pu})}
797),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="title"?"active":""}`,onClick:()=>xn("title"),children:[o.jsx("span",{children:t("common.title")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="files"?"active":""}`,onClick:()=>xn("files"),children:[o.jsx("span",{children:t("common.files")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="size"?"active":""}`,onClick:()=>xn("size"),children:[o.jsx("span",{children:t("common.size")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="modified"?"active":""}`,onClick:()=>xn("modified"),children:[o.jsx("span",{children:t("common.modified")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"w-12"})]})}),o.jsxs(ys,{children:[Ee&&o.jsxs(Ot,{className:"bg-accent/30 border-2 border-primary",children:[o.jsx(Oe,{children:o.jsx(On,{disabled:!0})}),o.jsx(Oe,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:Rc,alt:"Folder",className:"w-6 h-6 flex-shrink-0"}),o.jsx(Qe,{ref:Co,value:pt,onChange:I=>$e(I.target.value),onKeyDown:I=>{I.key==="Enter"?_r():I.key==="Escape"&&jl()},placeholder:t("dashboard.folderNamePlaceholder"),className:"h-8 max-w-xs"}),o.jsx(ie,{size:"icon",variant:"ghost",className:"h-7 w-7",disabled:Ne,onClick:()=>_r(),children:o.jsx(Zi,{className:"h-4 w-4 text-green-500 dark:text-green-400"})}),o.jsx(ie,{size:"icon",variant:"ghost",className:"h-7 w-7",disabled:Ne,onClick:jl,children:o.jsx(yr,{className:"h-4 w-4 text-red-500 dark:text-red-400"})})]})}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:"0"}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:"0 KB"}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:t("common.now")}),o.jsx(Oe,{})]}),X?Array.from({length:5}).map((I,te)=>o.jsx(up,{columns:6},te)):Rr.length===0&&!Ee?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:6,className:"text-center py-8",children:t("dashboard.noDocuments")})}):Rr.map(I=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>e(`/dashboard/folder/${I.id}`),onDragOver:te=>Ls(te,I.id),onDragLeave:()=>{mn===I.id&&yt(null)},onDrop:te=>void Os(te,I.id),children:[o.jsx(Oe,{onClick:te=>te.stopPropagation(),children:o.jsx(On,{checked:b.includes(I.id),onCheckedChange:()=>fu(I.id)})}),o.jsx(Oe,{className:"text-sm text-foreground",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:Rl(I.color),alt:"Folder",className:"w-8 h-8 flex-shrink-0"}),o.jsx("span",{className:"truncate",children:I.title}),(I.sharing?.outgoing||I.sharing?.incoming)&&o.jsx(Nb,{resourceType:"folder",resourceId:Number(I.id)})]})}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.files}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.size}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.modified}),o.jsx(Oe,{children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",onClick:te=>te.stopPropagation(),children:o.jsx(kc,{className:"h-4 w-4"})})}),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:te=>{te.stopPropagation(),e(`/dashboard/folder/${I.id}`)},children:[o.jsx(Wo,{className:"mr-2 h-4 w-4"}),t("common.open")]}),o.jsxs(lt,{onClick:te=>{te.stopPropagation(),lu(I.id)},children:[o.jsx(qf,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),G&&!I.sharing?.incoming&&o.jsxs(lt,{onClick:te=>{te.stopPropagation(),Wn({id:Number(I.id),type:"folder",name:I.title})},children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),!I.sharing?.incoming&&o.jsxs(lt,{variant:"destructive",className:"text-destructive",onClick:te=>{te.stopPropagation(),No(I.id,I.title)},children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]},I.id))]})]})})]}),(V||L.length>0)&&o.jsxs("div",{className:"mb-8",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:t("dashboard.unclassifiedFiles")}),o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-12",children:o.jsx(On,{checked:E.length===L.length&&L.length>0,onCheckedChange:()=>{E.length===L.length?k([]):k(L.map(I=>I.id))}})}
797),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="title"||je==="name"?"active":""}`,onClick:()=>xn("title"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-6"}),o.jsx("span",{children:t("common.title")})]}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="type"?"active":""}`,onClick:()=>xn("type"),children:[o.jsx("span",{children:t("common.type")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="size"?"active":""}`,onClick:()=>xn("size"),children:[o.jsx("span",{children:t("common.size")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${je==="modified"?"active":""}`,onClick:()=>xn("modified"),children:[o.jsx("span",{children:t("common.modified")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"status-column",children:o.jsxs("div",{className:`sortable-header ${je==="status"?"active":""}`,onClick:()=>xn("status"),children:[o.jsx("span",{children:t("common.status")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"w-12"})]})}),o.jsx(ys,{children:V?Array.from({length:5}).map((I,te)=>o.jsx(up,{},te)):L.map(I=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50 transition-colors",draggable:!I.readOnly,onDragStart:te=>ya(te,I.id),onDragEnd:Nl,onClick:()=>{E.includes(I.id)?k(E.filter(te=>te!==I.id)):k([...E,I.id])},children:[o.jsx(Oe,{onClick:te=>te.stopPropagation(),children:o.jsx(On,{checked:E.includes(I.id),onCheckedChange:()=>{E.includes(I.id)?k(E.filter(te=>te!==I.id)):k([...E,I.id])}})}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:jp(I.type,l),alt:I.type,className:"w-8 h-8 flex-shrink-0"}),o.jsx("span",{children:I.name})]})}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.type}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.size}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:I.modified}),o.jsx(Oe,{className:"w-32",children:o.jsx(dm,{status:I.processingStatus,error:I.processingError})}),o.jsx(Oe,{children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",children:o.jsx(kc,{className:"h-4 w-4"})})}),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:()=>void gn(I),children:[o.jsx(Wo,{className:"mr-2 h-4 w-4"}),t("common.view")]}),!I.readOnly&&o.jsxs(lt,{onClick:()=>Ao([I.id]),children:[o.jsx(Vf,{className:"mr-2 h-4 w-4"}),t("common.move")]}),G&&!I.readOnly&&o.jsxs(lt,{onClick:()=>Wn({id:Number(I.id),type:"document",name:I.name}),children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),!I.readOnly&&(I.processingStatus??"").toUpperCase()==="FAILED"&&o.jsxs(lt,{onClick:()=>void Ds(I),children:[o.jsx(Dc,{className:"mr-2 h-4 w-4"}),t("common.requeue")]}),!I.readOnly&&o.jsxs(lt,{children:[o.jsx(qf,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),!I.readOnly&&o.jsxs(lt,{className:"text-destructive",onClick:()=>void Jn(I),children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]},I.id))})]})})]}),G&&(Q||U.length>0)&&o.jsxs("div",{className:"mb-8",children:[o.jsx("h2",{className:"text-xl font-bold text-foreground mb-4",children:t("dashboard.sharedWithYou")}),o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-12"}),o.jsx(Ve,{children:t("common.title")}),o.jsx(Ve,{children:t("common.type")}),o.jsx(Ve,{children:t("common.size")}),o.jsx(Ve,{children:t("common.modified")}),o.jsx(Ve,{className:"status-column",children:t("common.status")}),o.jsx(Ve,{className:"w-12"})]})}),o.jsx(ys,{children:Q?Array.from({length:3}).map((I,te)=>o.jsx(up,{columns:7},`sh-t-${te}`)):U.map(I=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>void gn(I),children:[o.jsx(Oe,{children:o.jsx(gr,{className:"h-4 w-4 text-primary"})}),o.jsx(Oe,{className:"text-sm text-foreground",children:I.name}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:I.type}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:I.size}),o.jsx(Oe,{className:"text-sm text-muted-foreground",children:I.modified}),o.jsx(Oe,{className:"w-32",children:o.jsx(dm,{status:I.processingStatus,error:I.processingError})}),o.jsx(Oe,{})]},`shared-t-${I.id}`))})]})})]})]}),u==="mcp"&&o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden mb-8",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-12",children:o.jsx(On,{checked:C.length===ns.length&&ns.length>0,onCheckedChange:Ea})}),o.jsx(Ve,{children:o.jsxs("div",{className:`flex items-center gap-2 cursor-pointer select-none transition-colors hover:text-foreground pl-[35px] ${je==="name"||je==="title"?"text-foreground font-semibold":"text-muted-foreground"}`,onClick:()=>xn("name"),children:[o.jsx("span",{children:t("common.title")}),o.jsx(qt,{size:16,className:`transition-opacity ${je==="name"||je==="title"?"opacity-100":"opacity-50 group-hover:opacity-70"}`})]})}),o.jsx(Ve,{className:"w-32",children:o.jsxs("div",{className:`flex items-center gap-2 cursor-pointer select-none transition-colors hover:text-foreground ${je==="status"?"text-foreground font-semibold":"text-muted-foreground"}`,onClick:()=>xn("status"),children:[o.jsx("span",{children:t("common.status")}),o.jsx(qt,{size:16,className:`transition-opacity ${je==="status"?"opacity-100":"opacity-50 group-hover:opacity-70"}`})]})}),o.jsx(Ve,{className:"w-12"})]})}),o.jsx(ys,{children:B?Array.from({length:5}).map((I,te)=>o.jsx(up,{columns:4},te)):ns.length===0?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:4,className:"text-center py-8",children:t("dashboard.noConnectors")})}):ns.map(I=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50",onClick:()=>e(`/dashboard/connector/${I.collectionId}`),children:[o.jsx(Oe,{onClick:te=>te.stopPropagation(),children:o.jsx(On,{checked:C.includes(I.id),onCheckedChange:()=>Ca(I.id)})}),o.jsx(Oe,{className:"text-sm text-foreground",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("img",{src:Oae(l),alt:"Connettore",className:"w-6 h-6 flex-shrink-0 p-0.5"}),o.jsx("span",{className:"truncate",children:I.name}),I.sharing?.incoming&&o.jsx(Md,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-label":t("dashboard.sharedConnectorAria")}),I.sharing?.outgoing&&o.jsx(Nb,{resourceType:"collection",resourceId:I.collectionId})]})}),o.jsx(Oe,{className:"w-32",children:o.jsx(Ci,{variant:I.status==="Attivo"?"default":"secondary",children:iN(I.status,t)})}),o.jsx(Oe,{onClick:te=>te.stopPropagation(),children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",children:o.jsx(kc,{className:"h-4 w-4"})})}
797),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:()=>e(`/dashboard/connector/${I.collectionId}`),children:[o.jsx(nl,{className:"mr-2 h-4 w-4"}),t("dashboard.openDetail")]}),G&&!I.sharing?.incoming&&o.jsxs(lt,{onClick:()=>Wn({id:I.collectionId,type:"collection",name:I.name}),children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),!I.sharing?.incoming&&I.status==="Attivo"?o.jsxs(lt,{onClick:()=>Eh(I.id,I.name),children:[o.jsx(UA,{className:"mr-2 h-4 w-4"}),t("dashboard.disable")]}):I.sharing?.incoming?null:o.jsxs(lt,{onClick:()=>Ah(I.id,I.name),children:[o.jsx(BA,{className:"mr-2 h-4 w-4"}),t("dashboard.activate")]}),!I.sharing?.incoming&&o.jsxs(lt,{onClick:()=>hg(I.id,I.name),className:"text-destructive",children:[o.jsx(e_,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]},I.id))})]})}),u==="mcp"&&C.length>0&&o.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 border-t border-border bg-card px-8 py-4 shadow-lg",children:o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs(hl,{open:su,onOpenChange:bo,children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",className:"h-[42px] gap-3 rounded-md border",children:[o.jsx("span",{className:"text-sm font-medium",children:t("dashboard.connectorsSelected",{count:Sa.length})}),o.jsx(qt,{size:16,className:"opacity-60"})]})}),o.jsx(pl,{className:"w-[400px] p-0",align:"center",side:"top",sideOffset:8,children:o.jsx("div",{className:"space-y-2",children:Sa.length===0?o.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:t("dashboard.noConnectorsSelected")}):o.jsxs("div",{className:"p-4",children:[o.jsx("div",{className:"mb-3",children:o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t("dashboard.connectorsSelected",{count:Sa.length})})}),o.jsx(Qr,{className:"h-[200px] w-full rounded-md border border-border bg-background p-4",children:o.jsx("div",{className:"space-y-2",children:Sa.map(I=>o.jsxs("div",{className:"flex items-center justify-between rounded bg-muted/50 p-2 transition-colors hover:bg-muted",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:I.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:iN(I.status,t)})]}),o.jsx(ie,{variant:"ghost",size:"icon",className:"ml-2 h-6 w-6 flex-shrink-0",onClick:()=>A(te=>te.filter(we=>we!==I.id)),children:o.jsx(yr,{className:"h-4 w-4"})})]},I.id))})}),o.jsxs("div",{className:"mt-4 space-y-2 border-t border-border pt-4",children:[jo.length>0&&o.jsxs(ie,{className:"w-full",variant:"outline",onClick:()=>void Tl(),disabled:Nr||Ps,children:[o.jsx(UA,{className:"mr-2 h-4 w-4"}),t("dashboard.disableCount",{count:jo.length})]}),tr.length>0&&o.jsxs(ie,{className:"w-full",variant:"outline",onClick:()=>void Tr(),disabled:Nr||Ps,children:[o.jsx(BA,{className:"mr-2 h-4 w-4"}),t("dashboard.activateCount",{count:tr.length})]}),o.jsxs(ie,{type:"button",variant:"destructive",className:"w-full",onClick:()=>void _l(),disabled:Nr||Ps,children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})})]})})}),u==="documenti"&&E.length>0&&o.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border py-4 px-8 shadow-lg z-40",children:o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs(hl,{open:Ai,onOpenChange:Fn,children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",className:"h-[42px] rounded-md border gap-3",children:[o.jsx("span",{className:"text-sm font-medium",children:t("dashboard.filesSelected",{count:Dl.length})}),o.jsx(qt,{size:16,className:"opacity-60"})]})}),o.jsx(pl,{className:"w-[400px] p-0",align:"center",side:"top",sideOffset:8,children:o.jsx("div",{className:"space-y-2",children:Dl.length===0?o.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:t("dashboard.noFilesSelected")}):o.jsxs("div",{className:"p-4",children:[o.jsx("div",{className:"mb-3",children:o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t("dashboard.filesSelected",{count:Dl.length})})}),o.jsx(Qr,{className:"h-[200px] w-full rounded-md border border-border p-4 bg-background",children:o.jsx("div",{className:"space-y-2",children:Dl.map(I=>o.jsxs("div",{className:"flex items-center justify-between bg-muted/50 p-2 rounded hover:bg-muted transition-colors",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:I.name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[I.type?.toUpperCase()||"—"," •"," ",I.size]})]}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 ml-2",onClick:()=>k(te=>te.filter(we=>we!==I.id)),children:o.jsx(yr,{className:"h-4 w-4"})})]},I.id))})}),o.jsxs("div",{className:"mt-4 pt-4 border-t border-border space-y-2",children:[o.jsxs(ie,{className:"w-full",onClick:()=>{Fn(!1),Ao(E)},disabled:ye||yo,children:[o.jsx(Vf,{className:"mr-2 h-4 w-4"}),t("common.move")]}),o.jsxs(ie,{type:"button",variant:"destructive",className:"w-full",onClick:()=>void wh(),disabled:ye||yo,children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})})]})})}),o.jsxs("div",{className:"flex min-w-0 flex-col gap-3 border-t border-border bg-background px-3 py-3 shadow-sm sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-6 sm:py-4",children:[o.jsxs("div",{className:"min-w-0 shrink text-sm text-muted-foreground",children:[f==="table"&&u==="documenti"&&o.jsxs("span",{className:"block truncate",children:[b.length," di ",cu.length," righe selezionate."]}),u==="mcp"&&o.jsxs("span",{className:"block truncate",children:[C.length," di ",Pl.length," righe selezionate."]})]}),o.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-end sm:gap-x-4 sm:gap-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"hidden text-sm text-muted-foreground sm:inline",children:t("dashboard.rowsPerPage")}),o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground sm:hidden",children:t("dashboard.rows")}
797),o.jsx("select",{value:he,onChange:I=>{ue(Number(I.target.value)),J(1)},className:"min-w-0 shrink-0 rounded border border-border bg-background px-2 py-1 text-sm text-foreground",children:f==="grid"&&u==="documenti"?o.jsxs(o.Fragment,{children:[o.jsx("option",{value:16,children:"16"}),o.jsx("option",{value:32,children:"32"}),o.jsx("option",{value:64,children:"64"}),o.jsx("option",{value:128,children:"128"})]}):o.jsxs(o.Fragment,{children:[o.jsx("option",{value:10,children:"10"}),o.jsx("option",{value:20,children:"20"}),o.jsx("option",{value:50,children:"50"}),o.jsx("option",{value:100,children:"100"})]})})]}),o.jsxs("div",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["Pag. ",P," / ",er]}),o.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[o.jsx(ie,{variant:"outline",size:"icon",onClick:()=>J(1),disabled:P===1,children:o.jsx(h8,{className:"h-4 w-4"})}),o.jsx(ie,{variant:"outline",size:"icon",onClick:()=>J(I=>Math.max(1,I-1)),disabled:P===1,children:o.jsx(Zj,{className:"h-4 w-4"})}),o.jsx(ie,{variant:"outline",size:"icon",onClick:()=>J(I=>Math.min(er,I+1)),disabled:P===er,children:o.jsx(ro,{className:"h-4 w-4"})}),o.jsx(ie,{variant:"outline",size:"icon",onClick:()=>J(er),disabled:P===er,children:o.jsx(p8,{className:"h-4 w-4"})})]})]})]})]})]})}function Y0({isOpen:t,onClose:e,folders:n,onConfirm:i,selectedFolderId:r}){const{t:s}=Ye("dashboard"),[l,u]=v.useState(r),d=m=>{u(l===m?null:m)},f=()=>{i(l),e()},p=()=>{u(r),e()};return o.jsx(yn,{open:t,onOpenChange:p,children:o.jsxs(wn,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("dialogs.folderFilter.title")}),o.jsx(In,{children:s("dialogs.folderFilter.description")})]}),o.jsx("div",{className:"space-y-4 py-4",children:o.jsx("div",{className:"max-h-[min(400px,55vh)] overflow-y-auto rounded-lg border p-3 sm:p-4",children:o.jsx("div",{className:"grid grid-cols-1 justify-items-center gap-4 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3",children:n.map(m=>{const x=l===m.id;return m.id==="general"?o.jsxs("div",{onClick:()=>d(m.id),className:`bg-muted/50 border relative flex flex-col items-center justify-center cursor-pointer transition-all hover:shadow-md w-[158px] min-h-[120px] rounded-[5.62px] gap-2 p-4 ${x?"border-primary border-2":"border-border hover:border-primary/50"}`,children:[o.jsxs("div",{className:"text-center w-full",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m.title}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("dialogs.folderFilter.unclassifiedHint")})]}),x&&o.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:o.jsx(Zi,{className:"h-4 w-4"})})]},m.id):o.jsxs("div",{onClick:()=>d(m.id),className:`bg-background border relative flex flex-col items-center cursor-pointer transition-all hover:shadow-lg hover:scale-[1.02] w-[158px] h-[229.47px] rounded-[5.62px] gap-[20.24px] p-0 ${x?"border-primary border-2":"border-border hover:border-primary"}`,children:[o.jsx("div",{className:"bg-background flex items-center justify-center w-[150px] h-[150px] rounded-[8.43px] p-[15.18px]",children:o.jsx("img",{src:Rc,alt:m.title,className:"w-full h-full object-contain"})}),o.jsxs("div",{className:"text-center w-full px-3",children:[o.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground truncate max-w-full",children:m.title}),o.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${m.status==="Attivo"?"bg-green-500":"bg-muted"}`,title:m.status==="Attivo"?s("status.active"):s("status.archived")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:s("dialogs.folderFilter.fileCount",{count:m.files})})]}),x&&o.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:o.jsx(Zi,{className:"h-4 w-4"})})]},m.id)})})})}),o.jsxs(qn,{className:"flex-col sm:flex-row gap-2",children:[o.jsx(ie,{variant:"outline",onClick:p,className:"w-full sm:w-auto",children:s("common.cancel")}),o.jsx(ie,{onClick:f,className:"w-full sm:w-auto",children:s("common.confirm")})]})]})})}const Fae=t=>t<1024?`${t}B`:t<1024*1024?`${Math.round(t/1024)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`,$ae=t=>"Attivo",Uae=({columns:t=7})=>o.jsx(Ot,{className:"hover:bg-transparent",children:Array.from({length:t}).map((e,n)=>o.jsx(Oe,{className:n>=2&&n<=4?"hidden md:table-cell":void 0,children:n===0?o.jsx("div",{className:"h-4 w-4 roun
797ded bg-muted/30 animate-pulse"}):n===1?o.jsx("div",{className:"h-4 bg-muted/40 animate-pulse rounded-md w-48"}):n===5?o.jsx("div",{className:"h-6 w-16 rounded-full bg-muted/20 animate-pulse"}):o.jsx("div",{className:"h-4 bg-muted/20 animate-pulse rounded-md w-16"})},n))});function Bae(){const{t}=Ye("dashboard"),e=Kn(),{user:n}=Ar(),[i,r]=v.useState("base"),[s,l]=v.useState(""),[u,d]=v.useState(""),[f,p]=v.useState(""),[m,x]=v.useState([]),[b,w]=v.useState(null),[C,A]=v.useState(!1),[E,k]=v.useState("name"),[N,_]=v.useState("asc"),[R,T]=v.useState(!1),[L,M]=v.useState([]),[U,D]=v.useState([]),[G,Z]=v.useState(!1),[Q,K]=v.useState(!1),[q,F]=v.useState(!1);v.useEffect(()=>{(async()=>{if(n?.id){Z(!0);try{const[pe,Ee,Ce]=await Promise.all([ca(),no(),new Promise($e=>setTimeout($e,800))]),qe=pe.filter($e=>$e.id!==Ee.id).map($e=>({id:`folder-${$e.id}`,title:$e.name,files:$e._count?.documents??0,status:"Attivo",aiId:$e.id})),pt={id:"general",title:t("dashboard.unclassifiedFiles"),files:Ee._count?.documents??0,status:"Attivo",aiId:Ee.id};M([pt,...qe])}catch(pe){console.error("Error fetching folders:",pe),ee.error(t("toasts.loadFoldersError"))}finally{Z(!1)}}})()},[n?.id]),v.useEffect(()=>{(async()=>{if(L.length!==0){K(!0);try{const[pe,Ee]=await Promise.all([Promise.all(L.map(async Ne=>{const qe=await Ic({folderId:Ne.aiId,pageSize:500});return{folderId:Ne.id,folderName:Ne.title,docs:qe.data??[]}})),new Promise(Ne=>setTimeout(Ne,800))]),Ce=new Map;pe.forEach(({folderId:Ne,folderName:qe,docs:pt})=>{const $e=Ne==="general";pt.forEach(je=>{const xt={id:`file-${je.id}`,name:je.name,type:(je.type??"FILE").toUpperCase(),size:Fae(je.size??0),modified:sh(je.createdAt??new Date().toISOString()),status:$ae(je),folderId:Ne,folderName:qe,objectId:je.id},Ae=Ce.get(je.id);if(!Ae){Ce.set(je.id,xt);return}Ae.folderId==="general"&&!$e&&Ce.set(je.id,xt)})}),D(Array.from(Ce.values()))}catch(pe){console.error("Error fetching files:",pe),ee.error(t("toasts.loadFilesError"))}finally{K(!1)}}})()},[L]);const V=()=>{e("/dashboard")},O=()=>{if(!s.trim()){ee.error(t("toasts.nameRequired"));return}r("resources")},X=async()=>{if(m.length===0){ee.error(t("toasts.selectAtLeastOneFile"));return}const se=Array.from(new Set(U.filter(pe=>m.includes(pe.id)).map(pe=>pe.objectId)));if(se.length===0){ee.error(t("toasts.noValidDocuments"));return}F(!0);try{const pe=u.trim(),Ee=await Aae({name:s.trim(),...pe?{description:pe}:{},documentIds:se}),Ce=await W0({collectionId:Ee.id,documentIds:se}),Ne=Ce.taskId??Ce.task_id;ee.success(Ne?t("toasts.connectorCreatedWithTask",{name:s,taskId:Ne}):t("toasts.connectorCreated",{name:s})),e(`/dashboard/connector/${Ee.id}`)}catch(pe){console.error("Error creating connector:",pe),ee.error(pe instanceof Error?pe.message:t("toasts.createConnectorError"))}finally{F(!1)}},$=se=>{x(pe=>pe.includes(se)?pe.filter(Ee=>Ee!==se):[...pe,se])},B=()=>{m.length===W.length?x([]):x(W.map(se=>se.id))},H=se=>{E===se?_(N==="asc"?"desc":"asc"):(k(se),_("asc"))},P=se=>{w(se)},J=se=>{x(pe=>pe.filter(Ee=>Ee!==se))},he=se=>{se.key==="Enter"&&O()},W=[...U.filter(se=>{const pe=se.name.toLowerCase().includes(f.toLowerCase()),Ee=b===null||se.folderId===b;return pe&&Ee})].sort((se,pe)=>{let Ee=0;switch(E){case"name":Ee=Zt(se.name,pe.name);break;case"type":Ee=Zt(se.type,pe.type);break;case"size":Ee=parseInt(se.size)-parseInt(pe.size);break;case"modified":Ee=Zt(se.modified,pe.modified);break;case"status":Ee=Zt(se.status,pe.status);break;case"folderName":Ee=Zt(se.folderName,pe.folderName);break;default:Ee=0}return N==="asc"?Ee:-Ee}),fe=U.filter(se=>m.includes(se.id));return o.jsxs("div",{className:"min-h-screen bg-background w-full flex flex-col",children:[o.jsxs("div",{className:"flex flex-col gap-4 border-b border-border bg-card px-4 py-4 shadow-sm sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-8 sm:py-6",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 sm:gap-4",children:[o.jsxs(ie,{variant:"ghost",onClick:V,className:"shrink-0 px-2 sm:px-4",children:[o.jsx(Es,{className:"mr-2 h-4 w-4"}),t("newMcp.back")]}),o.jsx("h1",{className:"min-w-0 truncate text-xl font-bold text-foreground sm:text-2xl md:text-3xl",children:i==="resources"&&s.trim()?s:t("newMcp.title")})]}),o.jsx("div",{className:"flex shrink-0 justify-end",children:o.jsx(si,{})})]}),o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden md:flex-row",children:[o.jsxs("div",{className:"flex shrink-0 gap-1 overflow-x-auto border-b border-border bg-card px-2 py-2 md:w-[250px] md:flex-col md:gap-0 md:border-r md:border-b-0 md:px-0 md:py-6",children:[o.jsx("button",{type:"button",className:`shrink-0 rounded-md px-4 py-2.5 text-left text-sm transition-all md:w-full md:rounded-none md:border-l-[3px] md:py-3 md:pl-6 ${i==="base"?"sidebar-item-active md:bg-transparent":"sidebar-item md:bg-transparent"}`,onClick:()=>r("base"),children:t("newMcp.stepBase")}),o.jsx("button",{type:"button",className:`shrink-0 rounded-md px-4 py-2.5 text-left text-sm transition-all md:w-full md:rounded-none md:border-l-[3px] md:py-3 md:pl-6 ${i==="resources"?"sidebar-item-active md:bg-transparent":"sidebar-item md:bg-transparent"}`,onClick:()=>{s.trim()?r("resources"):ee.error(t("toasts.nameRequired"))},children:t("newMcp.stepResources")})]}),o.jsxs("div",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-4 sm:p-6 md:p-8",children:[i==="base"&&o.jsxs("div",{className:"mx-auto max-w-[700px]",children:[o.jsx("h3",{className:"mb-6 text-xl font-semibold text-foreground sm:mb-8 sm:text-2xl",children:t("newMcp.stepBase")}),o.jsxs("div",{className:"flex flex-col gap-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"mcpTitle",children:t("newMcp.titleLabel")}),o.jsx(Qe,{id:"mcpTitle",type:"text",placeholder:t("newMcp.titlePlaceholder"),value:s,onChange:se=>l(se.target.value),onKeyDown:he})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"mcpDescription",children:t("newMcp.descriptionLabel")}),o.jsx(Mc,{id:"mcpDescription",placeholder:t("newMcp.descriptionPlaceholder"),value:u,onChange:se=>d(se.target.value),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t("newMcp.descriptionHint")})]}),o.jsx(ie,{onClick:O,disabled:!s.trim(),className:"w-full sm:w-auto 
797sm:self-start",children:t("newMcp.next")})]})]}),i==="resources"&&o.jsxs("div",{className:"flex min-h-0 w-full max-w-none flex-1 flex-col",children:[o.jsx("h3",{className:"mb-4 text-xl font-semibold text-foreground sm:mb-8 sm:text-2xl",children:t("newMcp.stepResources")}),o.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:mb-6 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"relative min-w-0 flex-1",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:t("common.searchDocuments"),value:f,onChange:se=>p(se.target.value),className:"pl-10"})]}),o.jsxs(ie,{variant:"outline",onClick:()=>A(!0),className:"flex w-full shrink-0 justify-center gap-2 sm:w-auto",children:[o.jsx(il,{className:"h-4 w-4"}),t("common.filter"),b&&o.jsx(Ci,{variant:"secondary",className:"ml-1 sm:ml-2",children:t("common.filtered")})]})]}),o.jsx(Y0,{isOpen:C,onClose:()=>A(!1),folders:L,onConfirm:P,selectedFolderId:b}),o.jsx("div",{className:"mb-28 flex-1 overflow-hidden sm:mb-[100px]",children:o.jsx("div",{className:"h-full overflow-hidden rounded-lg border border-border bg-card",children:o.jsx("div",{className:"-mx-1 h-full overflow-x-auto sm:mx-0",children:o.jsxs(vs,{className:"min-w-[520px] md:min-w-0",children:[o.jsx(bs,{className:"sticky top-0 z-10 bg-card",children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-10 sm:w-12",children:o.jsx(On,{checked:m.length===W.length&&W.length>0,onCheckedChange:B,disabled:Q||G})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${E==="name"?"active":""}`,onClick:()=>H("name"),children:[o.jsx("span",{children:t("common.title")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("div",{className:`sortable-header ${E==="type"?"active":""}`,onClick:()=>H("type"),children:[o.jsx("span",{children:t("common.type")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("div",{className:`sortable-header ${E==="size"?"active":""}`,onClick:()=>H("size"),children:[o.jsx("span",{children:t("common.size")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("div",{className:`sortable-header ${E==="modified"?"active":""}`,onClick:()=>H("modified"),children:[o.jsx("span",{children:t("common.modified")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"status-column",children:o.jsxs("div",{className:`sortable-header ${E==="status"?"active":""}`,onClick:()=>H("status"),children:[o.jsx("span",{children:t("common.status")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("div",{className:`sortable-header ${E==="folderName"?"active":""}`,onClick:()=>H("folderName"),children:[o.jsx("span",{children:t("common.folder")}),o.jsx(qt,{size:16,className:"sort-icon"})]})})]})}),o.jsx(ys,{children:G||Q?Array.from({length:10}).map((se,pe)=>o.jsx(Uae,{},pe)):W.length===0?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:t("newMcp.noFilesFound")})}):W.map(se=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>$(se.id),children:[o.jsx(Oe,{onClick:pe=>pe.stopPropagation(),children:o.jsx(On,{checked:m.includes(se.id),onCheckedChange:()=>$(se.id)})}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:se.name}),o.jsx(Oe,{className:"hidden max-w-xs truncate text-sm text-foreground md:table-cell",children:se.type}),o.jsx(Oe,{className:"hidden max-w-xs truncate text-sm text-foreground md:table-cell",children:se.size}),o.jsx(Oe,{className:"hidden max-w-xs truncate text-sm text-foreground md:table-cell",children:se.modified}),o.jsx(Oe,{className:"w-32",children:o.jsx(Ci,{variant:se.status==="Attivo"?"default":se.status==="In Progress"?"outline":"secondary",className:se.status==="In Progress"?"badge-in-progress":"",children:se.status})}),o.jsx(Oe,{className:"text-sm text-foreground truncate max-w-xs",children:se.folderName})]},se.id))})]})})})}),o.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-20 border-t border-border bg-card shadow-lg pb-[env(safe-area-inset-bottom)] md:left-[250px]",children:o.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-6 sm:py-4",children:[o.jsx("div",{className:"flex flex-1 justify-center sm:justify-center",children:o.jsxs(hl,{open:R,onOpenChange:T,children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",className:"h-auto min-h-[42px] w-full max-w-md gap-2 rounded-md border px-4 py-2.5 sm:h-[42px] sm:w-auto 
797sm:gap-4",children:[o.jsx("span",{className:"truncate text-sm font-medium",children:t("dashboard.filesSelected",{count:fe.length})}),o.jsx(xs,{className:"h-4 w-4 opacity-50"})]})}),o.jsx(pl,{className:"w-[calc(100vw-2rem)] max-w-[400px] p-0",align:"center",side:"top",sideOffset:8,collisionPadding:12,children:fe.length===0?o.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:t("dashboard.noFilesSelected")}):o.jsxs("div",{className:"p-4",children:[o.jsx("div",{className:"mb-3",children:o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t("dashboard.filesSelected",{count:fe.length})})}),o.jsx(Qr,{className:"h-[200px] w-full rounded-md border border-border p-4 bg-background",children:o.jsx("div",{className:"space-y-2",children:fe.map(se=>o.jsxs("div",{className:"flex items-center justify-between bg-muted/50 p-2 rounded hover:bg-muted transition-colors",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:se.name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[se.type," • ",se.size," •"," ",se.folderName]})]}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 ml-2",onClick:()=>J(se.id),children:o.jsx(yr,{className:"h-4 w-4"})})]},se.id))})})]})})]})}),o.jsx(ie,{onClick:X,disabled:m.length===0||q,className:"h-11 w-full shrink-0 rounded-md sm:h-[36px] sm:w-auto",children:t(q?"common.deploying":"common.deploy")})]})})]})]})]})]})}const Hae=t=>t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`;function Gae({open:t,onOpenChange:e,collectionId:n,excludedDocumentIds:i,onSuccess:r}){const{t:s}=Ye("dashboard"),{user:l}=Ar(),[u,d]=v.useState(""),[f,p]=v.useState([]),[m,x]=v.useState(null),[b,w]=v.useState(!1),[C,A]=v.useState("name"),[E,k]=v.useState("asc"),[N,_]=v.useState([]),[R,T]=v.useState([]),[L,M]=v.useState(!1),[U,D]=v.useState(!1),[G,Z]=v.useState(!1),Q=v.useMemo(()=>new Set(i),[i]);v.useEffect(()=>{if(!t){d(""),p([]),x(null);return}(async()=>{if(l?.id){M(!0);try{const[P,J]=await Promise.all([ca(),no()]),ue=P.filter(fe=>fe.id!==J.id).map(fe=>({id:`folder-${fe.id}`,title:fe.name,files:fe._count?.documents??0,status:"Attivo",aiId:fe.id})),W={id:"general",title:s("dashboard.unclassifiedFiles"),files:J._count?.documents??0,status:"Attivo",aiId:J.id};_([W,...ue])}catch(P){console.error(P),ee.error(s("toasts.loadFoldersError"))}finally{M(!1)}}})()},[t,l?.id]),v.useEffect(()=>{if(!t||N.length===0)return;(async()=>{D(!0);try{const P=await Promise.all(N.map(async he=>{const ue=await Ic({folderId:he.aiId,pageSize:500});return{folderId:he.id,folderName:he.title,docs:ue.data??[]}})),J=new Map;P.forEach(({folderId:he,folderName:ue,docs:W})=>{const fe=he==="general";W.forEach(se=>{if(Q.has(se.id))return;const pe={id:`file-${se.id}`,name:se.name,type:(se.type??"FILE").toUpperCase(),size:Hae(se.size??0),modified:sh(se.createdAt??new Date().toISOString()),folderId:he,folderName:ue,objectId:se.id},Ee=J.get(se.id);if(!Ee){J.set(se.id,pe);return}Ee.folderId==="general"&&!fe&&J.set(se.id,pe)})}),T(Array.from(J.values()))}catch(P){console.error(P),ee.error(s("toasts.loadDocumentsError"))}finally{D(!1)}})()},[t,N,Q]);const q=[...R.filter(H=>{const P=H.name.toLowerCase().includes(u.toLowerCase()),J=m===null||H.folderId===m;return P&&J})].sort((H,P)=>{let J=0;switch(C){case"name":J=Zt(H.name,P.name);break;case"type":J=Zt(H.type,P.type);break;case"size":J=parseInt(H.size,10)-parseInt(P.size,10);break;case"modified":J=Zt(H.modified,P.modified);break;case"folderName":J=Zt(H.folderName,P.folderName);break;default:J=0}return E==="asc"?J:-J}),F=v.useMemo(()=>Array.from(new Set(R.filter(H=>f.includes(H.id)).map(H=>H.objectId))),[R,f]),V=H=>{C===H?k(E==="asc"?"desc":"asc"):(A(H),k("asc"))},O=H=>{p(P=>P.includes(H)?P.filter(J=>J!==H):[...P,H])},X=()=>{f.length===q.length?p([]):p(q.map(H=>H.id))},$=async()=>{if(F.length===0){ee.error(s("toasts.selectAtLeastOneDocument"));return}Z(!0);try{await kae(n,{documentIds:F});const H=await W0({collectionId:n,documentIds:F}),P=H.taskId??H.task_id;ee.success(P?`${F.length} documento/i aggiunti. Indexing in coda (task ${P}).`:`${F.length} documento/i aggiunti. Indexing in coda.`),e(!1),await r()}catch(H){console.error(H),ee.error(H instanceof Error?H.message:s("toasts.addDocumentsError"))}finally{Z(!1)}},B=L||U;return o.jsxs(o.Fragment,{children:[o.jsx(yn,{open:t,onOpenChange:e,children:o.jsxs(wn,{className:"flex max-h-[90vh] flex-col gap-4 overflow-hidden sm:max-w-4xl",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("dialogs.addDocumentsToConnector.title")}
797),o.jsx(In,{children:s("dialogs.addDocumentsToConnector.description")})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[o.jsxs("div",{className:"relative min-w-0 flex-1",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:s("common.searchDocuments"),value:u,onChange:H=>d(H.target.value),className:"pl-10"})]}),o.jsxs(ie,{variant:"outline",onClick:()=>w(!0),className:"shrink-0 gap-2",children:[o.jsx(il,{className:"h-4 w-4"}),s("common.filter"),m&&o.jsx(Ci,{variant:"secondary",className:"ml-1",children:s("common.filtered")})]})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:o.jsx(Qr,{className:"h-[min(420px,50vh)]",children:o.jsxs(vs,{children:[o.jsx(bs,{className:"sticky top-0 z-10 bg-card",children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-10",children:o.jsx(On,{checked:f.length===q.length&&q.length>0,onCheckedChange:X,disabled:B})}),o.jsx(Ve,{children:o.jsxs("button",{type:"button",className:`sortable-header ${C==="name"?"active":""}`,onClick:()=>V("name"),children:[o.jsx("span",{children:s("common.title")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("button",{type:"button",className:`sortable-header ${C==="type"?"active":""}`,onClick:()=>V("type"),children:[o.jsx("span",{children:s("common.type")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("button",{type:"button",className:`sortable-header ${C==="size"?"active":""}`,onClick:()=>V("size"),children:[o.jsx("span",{children:s("common.size")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("button",{type:"button",className:`sortable-header ${C==="folderName"?"active":""}`,onClick:()=>V("folderName"),children:[o.jsx("span",{children:s("common.folder")}),o.jsx(qt,{size:16,className:"sort-icon"})]})})]})}),o.jsx(ys,{children:B?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:5,className:"py-8 text-center text-muted-foreground",children:s("dialogs.addDocumentsToConnector.loading")})}):q.length===0?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:5,className:"py-8 text-center text-muted-foreground",children:i.length>0?s("dialogs.addDocumentsToConnector.noMoreDocuments"):s("dialogs.addDocumentsToConnector.noDocuments")})}):q.map(H=>o.jsxs(Ot,{className:"cursor-pointer hover:bg-accent/50",onClick:()=>O(H.id),children:[o.jsx(Oe,{onClick:P=>P.stopPropagation(),children:o.jsx(On,{checked:f.includes(H.id),onCheckedChange:()=>O(H.id)})}),o.jsx(Oe,{className:"max-w-xs truncate font-medium",children:H.name}),o.jsx(Oe,{className:"hidden md:table-cell",children:H.type}),o.jsx(Oe,{className:"hidden md:table-cell",children:H.size}),o.jsx(Oe,{className:"max-w-xs truncate",children:H.folderName})]},H.id))})]})})}),F.length>0&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:[F.length," documento/i selezionato/i"]}),o.jsxs(qn,{className:"gap-2 sm:gap-0",children:[o.jsx(ie,{variant:"outline",onClick:()=>e(!1),disabled:G,children:"Annulla"}),o.jsx(ie,{onClick:()=>void $(),disabled:F.length===0||G,children:G?s("dialogs.addDocumentsToConnector.adding"):s("dialogs.addDocumentsToConnector.addCount",{count:F.length})})]})]})}),o.jsx(Y0,{isOpen:b,onClose:()=>w(!1),folders:N,onConfirm:x,selectedFolderId:m})]})}const Vae=t=>t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`;function qae({open:t,onOpenChange:e,collectionId:n,documentToReplace:i,excludedDocumentIds:r,onSuccess:s}){const{t:l}=Ye("dashboard"),{user:u}=Ar(),[d,f]=v.useState(""),[p,m]=v.useState(null),[x,b]=v.useState(null),[w,C]=v.useState(!1),[A,E]=v.useState("name"),[k,N]=v.useState("asc"),[_,R]=v.useState([]),[T,L]=v.useState([]),[M,U]=v.useState(!1),[D,G]=v.useState(!1),[Z,Q]=v.useState(!1),K=v.useMemo(()=>new Set(r),[r]);v.useEffect(()=>{if(!t){f(""),m(null),b(null);return}(async()=>{if(u?.id){U(!0);try{const[P,J]=await Promise.all([ca(),no()]),ue=P.filter(fe=>fe.id!==J.id).map(fe=>({id:`folder-${fe.id}`,title:fe.name,files:fe._count?.documents??0,status:"Attivo",aiId:fe.id})),W={id:"general",title:l("dashboard.unclassifiedFiles"),files:J._count?.documents??0,status:"Attivo",aiId:J.id};R([W,...ue])}catch(P){console.error(P),ee.error(l("toasts.loadFoldersError"))}finally{U(!1)}}})()},[t,u?.id]),v.useEffect(()=>{if(!t||_.length===0)return;(async()=>{G(!0);try{const P=await Promise.all(_.map(async he=>{const ue=await Ic({folderId:he.aiId,pageSize:500});return{folderId:he.id,folderName:he.title,docs:ue.data??[]}})),J=new Map;P.forEach(({folderId:he,folderName:ue,docs:W})=>{const fe=he==="general";W.forEach(se=>{if(K.has(se.id))return;const pe={id:`file-${se.id}`,name:se.name,type:(se.type??"FILE").toUpperCase(),size:Vae(se.size??0),modified:sh(se.createdAt??new Date().toISOString()),folderId:he,folderName:ue,objectId:se.id},Ee=J.get(se.id);if(!Ee){J.set(se.id,pe);return}Ee.folderId==="general"&&!fe&&J.set(se.id,pe)})}
797),L(Array.from(J.values()))}catch(P){console.error(P),ee.error(l("toasts.loadDocumentsError"))}finally{G(!1)}})()},[t,_,K]);const F=[...T.filter(H=>{const P=H.name.toLowerCase().includes(d.toLowerCase()),J=x===null||H.folderId===x;return P&&J})].sort((H,P)=>{let J=0;switch(A){case"name":J=Zt(H.name,P.name);break;case"type":J=Zt(H.type,P.type);break;case"size":J=parseInt(H.size,10)-parseInt(P.size,10);break;case"modified":J=Zt(H.modified,P.modified);break;case"folderName":J=Zt(H.folderName,P.folderName);break;default:J=0}return k==="asc"?J:-J}),V=v.useMemo(()=>p?T.find(H=>H.id===p)?.objectId??null:null,[T,p]),O=H=>{A===H?N(k==="asc"?"desc":"asc"):(E(H),N("asc"))},X=H=>{m(P=>P===H?null:H)},$=async()=>{if(V==null){ee.error(l("toasts.selectReplacement"));return}Q(!0);try{await jae(n,i.id,{replacementDocumentId:V});const H=await W0({collectionId:n,documentIds:[V]}),P=H.taskId??H.task_id;ee.success(P?l("toasts.documentReplacedWithTask",{taskId:P}):l("toasts.documentReplaced")),e(!1),await s()}catch(H){console.error(H),ee.error(H instanceof Error?H.message:l("toasts.replaceDocumentError"))}finally{Q(!1)}},B=M||D;return o.jsxs(o.Fragment,{children:[o.jsx(yn,{open:t,onOpenChange:e,children:o.jsxs(wn,{className:"flex max-h-[90vh] flex-col gap-4 overflow-hidden sm:max-w-4xl",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:l("dialogs.replaceDocument.title")}),o.jsxs(In,{children:["Sostituisci"," ",o.jsx("span",{className:"font-medium text-foreground",children:i.name})," ","con un altro documento. I chunk del documento attuale verranno rimossi dalla collection e verranno indicizzati quelli del sostituto."]})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[o.jsxs("div",{className:"relative min-w-0 flex-1",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:l("common.searchDocuments"),value:d,onChange:H=>f(H.target.value),className:"pl-10"})]}),o.jsxs(ie,{variant:"outline",onClick:()=>C(!0),className:"shrink-0 gap-2",children:[o.jsx(il,{className:"h-4 w-4"}),l("common.filter"),x&&o.jsx(Ci,{variant:"secondary",className:"ml-1",children:l("common.filtered")})]})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:o.jsx(Qr,{className:"h-[min(420px,50vh)]",children:o.jsxs(vs,{children:[o.jsx(bs,{className:"sticky top-0 z-10 bg-card",children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-10"}),o.jsx(Ve,{children:o.jsxs("button",{type:"button",className:`sortable-header ${A==="name"?"active":""}`,onClick:()=>O("name"),children:[o.jsx("span",{children:l("common.title")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("button",{type:"button",className:`sortable-header ${A==="type"?"active":""}`,onClick:()=>O("type"),children:[o.jsx("span",{children:l("common.type")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{className:"hidden md:table-cell",children:o.jsxs("button",{type:"button",className:`sortable-header ${A==="size"?"active":""}`,onClick:()=>O("size"),children:[o.jsx("span",{children:l("common.size")}),o.jsx(qt,{size:16,className:"sort-icon"})]})}),o.jsx(Ve,{children:o.jsxs("button",{type:"button",className:`sortable-header ${A==="folderName"?"active":""}`,onClick:()=>O("folderName"),children:[o.jsx("span",{children:l("common.folder")}),o.jsx(qt,{size:16,className:"sort-icon"})]})})]})}),o.jsx(ys,{children:B?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:5,className:"py-8 text-center text-muted-foreground",children:l("dialogs.addDocumentsToConnector.loading")})}):F.length===0?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:5,className:"py-8 text-center text-muted-foreground",children:l("dialogs.replaceDocument.noDocuments")})}):F.map(H=>{const P=p===H.id;return o.jsxs(Ot,{className:`cursor-pointer hover:bg-accent/50 ${P?"bg-muted/50":""}`,onClick:()=>X(H.id),children:[o.jsx(Oe,{onClick:J=>J.stopPropagation(),children:o.jsx("input",{type:"radio",name:"replace-document",checked:P,onChange:()=>X(H.id),className:"h-4 w-4 accent-primary"})}),o.jsx(Oe,{className:"max-w-xs truncate font-medium",children:H.name}),o.jsx(Oe,{className:"hidden md:table-cell",children:H.type}),o.jsx(Oe,{className:"hidden md:table-cell",children:H.size}),o.jsx(Oe,{className:"max-w-xs truncate",children:H.folderName})]},H.id)})})]})})}),o.jsxs(qn,{className:"gap-2 sm:gap-0",children:[o.jsx(ie,{variant:"outline",onClick:()=>e(!1),disabled:Z,children:"Annulla"}),o.jsx(ie,{onClick:()=>void $(),disabled:V==null||Z,children:l(Z?"dialogs.replaceDocument.replacing":"dialogs.replaceDocument.replace")})]})]})}),o.jsx(Y0,{isOpen:w,onClose:()=>C(!1),folders:_,onConfirm:b,selectedFolderId:x})]})}const Kae="https://mcp.archiveye.ai".replace(/\/$/,"")||"http://localhost:3004";function Wae(t){return`${Kae}/collection/${encodeURIComponent(t)}/mcp`}function rN(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Yae(){const{t}=Ye("dashboard"),e=Kn(),{collectionId:n}=ow(),{isEnterpriseSharing:i}=R0(),[r,s]=v.useState(null),[l,u]=v.useState(!0),[d,f]=v.useState(!1),[p,m]=v.useState(""),[x,b]=v.useState([]),[w,C]=v.useState(!1),[A,E]=v.useState(!1),[k,N]=v.useState(null),[_,R]=v.useState(null),[T,L]=v.useState(!1),[M,U]=v.useState(!1),[D,G]=v.useState(!1),[Z,Q]=v.useState(!1),[K,q]=v.useState(null),F=n?Number.parseInt(n,10):NaN,V=r?.sharing?.incoming===!0,O=!V,X=v.useCallback(async()=>
797{if(!Number.isNaN(F)){u(!0);try{const Ce=await Eae(F);s(Ce)}catch(Ce){console.error(Ce),ee.error(Ce instanceof Error?Ce.message:t("toasts.loadConnectorError")),s(null)}finally{u(!1)}}},[F]);v.useEffect(()=>{X()},[X]);const $=r?.apiKey!=null&&r.apiKey.length>0?Wae(r.apiKey):null,B=v.useMemo(()=>(r?.documents??[]).map(Ce=>Ce.document.id),[r?.documents]),H=v.useMemo(()=>_?B.filter(Ce=>Ce!==_.id):B,[B,_]),P=v.useMemo(()=>{const Ce=r?.documents??[],Ne=p.trim().toLowerCase();return Ne?Ce.filter(qe=>qe.document.name.toLowerCase().includes(Ne)):Ce},[r?.documents,p]),J=v.useMemo(()=>(r?.documents??[]).filter(Ce=>x.includes(Ce.document.id)),[r?.documents,x]),he=async()=>{if($)try{await navigator.clipboard.writeText($),f(!0),ee.success(t("toasts.urlCopied")),window.setTimeout(()=>f(!1),2e3)}catch{ee.error(t("toasts.copyFailed"))}},ue=async()=>{if(!Number.isNaN(F)){G(!0);try{const Ce=await _ae(F);s(Ne=>Ne?{...Ne,...Ce}:Ce),U(!1),ee.success(t("toasts.apiKeyRegenerated"))}catch(Ce){ee.error(Ce instanceof Error?Ce.message:t("toasts.regenerateApiKeyError"))}finally{G(!1)}}},W=()=>{r&&(q({id:r.id,type:"collection",name:r.name}),Q(!0))},fe=Ce=>{b(Ne=>Ne.includes(Ce)?Ne.filter(qe=>qe!==Ce):[...Ne,Ce])},se=()=>{x.length===P.length?b([]):b(P.map(Ce=>Ce.document.id))},pe=Ce=>{b(Ne=>Ne.filter(qe=>qe!==Ce))},Ee=async Ce=>{if(!(Ce.length===0||Number.isNaN(F))){L(!0);try{await Promise.all(Ce.map(Ne=>Nae(F,Ne))),ee.success(Ce.length===1?t("toasts.documentRemoved"):t("toasts.documentsRemoved",{count:Ce.length})),b(Ne=>Ne.filter(qe=>!Ce.includes(qe))),N(null),E(!1),await X()}catch(Ne){ee.error(Ne instanceof Error?Ne.message:t("toasts.removeDocumentsError"))}finally{L(!1)}}};return o.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col",children:[o.jsxs("header",{className:"bg-card border-b border-border py-6 px-8 shadow-sm flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[o.jsxs(ie,{variant:"ghost",onClick:()=>e("/dashboard?tab=mcp"),children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),t("connectorDetail.backDashboard")]}),o.jsx("h1",{className:"text-2xl font-bold truncate m-0",children:l?t("common.loading"):r?.name??t("connectorDetail.defaultName")})]}),o.jsx(si,{})]}),o.jsxs("main",{className:"flex-1 p-8 max-w-5xl w-full mx-auto space-y-8 pb-28",children:[Number.isNaN(F)&&o.jsx("p",{className:"text-destructive",children:t("connectorDetail.invalid")}),!Number.isNaN(F)&&!l&&!r&&o.jsx("p",{className:"text-muted-foreground",children:t("connectorDetail.notFound")}),r&&o.jsxs(o.Fragment,{children:[V&&o.jsx("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm text-foreground",children:t("connectorDetail.readOnlyBanner")}),o.jsxs("section",{className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("h2",{className:"text-lg font-semibold m-0",children:t("connectorDetail.linkedDocuments")}),O&&o.jsxs(ie,{className:"gap-2 shrink-0",onClick:()=>C(!0),children:[o.jsx(Bp,{className:"h-4 w-4"}),t("connectorDetail.addDocuments")]})]}),o.jsxs("div",{className:"relative max-w-md",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:t("connectorDetail.searchLinked"),value:p,onChange:Ce=>m(Ce.target.value),className:"pl-10"})]}),o.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[O&&o.jsx(Ve,{className:"w-10",children:o.jsx(On,{checked:P.length>0&&x.length===P.length,onCheckedChange:se,disabled:P.length===0})}),o.jsx(Ve,{children:t("common.name")}),o.jsx(Ve,{children:t("common.type")}),o.jsx(Ve,{children:t("common.status")}),o.jsx(Ve,{className:"text-right",children:t("common.size")}),O&&o.jsx(Ve,{className:"w-10"})]})}),o.jsx(ys,{children:P.length===0?o.jsx(Ot,{children:o.jsx(Oe,{colSpan:O?6:4,className:"text-center text-muted-foreground py-8",children:t(p?"connectorDetail.noSearchResults":"connectorDetail.noLinkedDocuments")})}):P.map(Ce=>{const Ne=Ce.document,qe=x.includes(Ne.id);return o.jsxs(Ot,{className:qe?"bg-muted/50":void 0,children:[O&&o.jsx(Oe,{children:o.jsx(On,{checked:qe,onCheckedChange:()=>fe(Ne.id)})}),o.jsx(Oe,{className:"font-medium",children:Ne.name}),o.jsx(Oe,{children:Ne.type}),o.jsx(Oe,{children:o.jsx(dm,{status:Ne.processingStatus})}),o.jsx(Oe,{className:"text-right",children:rN(Ne.size)}),O&&o.jsx(Oe,{children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",children:o.jsx(kc,{className:"h-4 w-4"})})}
797),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:()=>R({id:Ne.id,name:Ne.name}),children:[o.jsx(V6,{className:"mr-2 h-4 w-4"}),t("connectorDetail.replace")]}),o.jsxs(lt,{className:"text-red-600 focus:text-red-600",onClick:()=>N([Ne.id]),children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("connectorDetail.removeFromConnector")]})]})]})})]},Ne.id)})})]})}),O&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(nl,{className:"h-3 w-3"}),t("connectorDetail.removeHint")]})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-5 space-y-2",children:[o.jsx("p",{className:"font-medium text-foreground",children:t("connectorDetail.description")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r.description?.trim()?r.description:t("connectorDetail.noDescription")})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-5 space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"font-medium text-foreground",children:t("connectorDetail.howItWorks")}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("connectorDetail.howItWorksDesc"),O?t("connectorDetail.howItWorksOwnerExtra"):""]})]}),o.jsxs("div",{className:"space-y-3 border-t border-border pt-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:t("connectorDetail.connectorAccess")}),O&&o.jsxs("div",{className:"flex flex-wrap gap-2",children:[i&&o.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"gap-2",onClick:W,children:[o.jsx(gr,{className:"h-4 w-4"}),t("connectorDetail.share")]}),o.jsxs(ie,{type:"button",variant:"outline",size:"sm",className:"gap-2",onClick:()=>U(!0),children:[o.jsx(Dc,{className:"h-4 w-4"}),t("connectorDetail.regenerateApiKey")]})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t("connectorDetail.mcpInstructions")}),$?o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("code",{className:"text-sm break-all bg-muted/50 rounded px-2 py-1 flex-1 min-w-0",children:$}),o.jsx(ie,{type:"button",variant:"outline",size:"sm",onClick:he,children:d?o.jsx(Zi,{className:"h-4 w-4"}):o.jsx(Fp,{className:"h-4 w-4"})})]}):o.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:t("connectorDetail.linkUnavailable")}),o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(nl,{className:"h-3 w-3"}),t("connectorDetail.helpHint")]})]})]})]})]}),O&&x.length>0&&o.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-20 border-t border-border bg-card shadow-lg pb-[env(safe-area-inset-bottom)]",children:o.jsxs("div",{className:"mx-auto flex max-w-5xl flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-8 sm:py-4",children:[o.jsxs(hl,{open:A,onOpenChange:E,children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",className:"h-auto min-h-[42px] gap-2",children:[o.jsx("span",{className:"text-sm font-medium",children:t("connectorDetail.documentsSelected",{count:J.length})}),o.jsx(xs,{className:"h-4 w-4 opacity-50"})]})}),o.jsx(pl,{className:"w-[calc(100vw-2rem)] max-w-[400px] p-0",align:"start",side:"top",sideOffset:8,children:o.jsxs("div",{className:"p-4",children:[o.jsx("div",{className:"mb-3",children:o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t("connectorDetail.documentsSelected",{count:J.length})})}),o.jsx(Qr,{className:"h-[200px] w-full rounded-md border border-border bg-background p-4",children:o.jsx("div",{className:"space-y-2",children:J.map(Ce=>o.jsxs("div",{className:"flex items-center justify-between rounded bg-muted/50 p-2",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:Ce.document.name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ce.document.type," •"," ",rN(Ce.document.size)]})]}),o.jsx(ie,{variant:"ghost",size:"icon",className:"ml-2 h-6 w-6 shrink-0",onClick:()=>pe(Ce.document.id),children:o.jsx(yr,{className:"h-4 w-4"})})]},Ce.document.id))})})]})})]}),o.jsxs(ie,{variant:"destructive",className:"gap-2",onClick:()=>N([...x]),children:[o.jsx(yi,{className:"h-4 w-4"}),t("connectorDetail.removeFromConnector")]})]})}),O&&o.jsx(Gae,{open:w,onOpenChange:C,collectionId:F,excludedDocumentIds:B,onSuccess:X}),O&&_&&o.jsx(qae,{open:_!=null,onOpenChange:Ce=>{Ce||R(null)},collectionId:F,documentToReplace:_,excludedDocumentIds:H,onSuccess:X}),o.jsx(yn,{open:k!=null,onOpenChange:Ce=>{Ce||N(null)},children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("connectorDetail.removeDialogTitle")}),o.jsx(In,{children:k?.length===1?t("connectorDetail.removeDialogSingle"):t("connectorDetail.removeDialogMultiple",{count:k?.length??0})})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>N(null),disabled:T,children:t("common.cancel")}),o.jsx(ie,{variant:"destructive",disabled:T,onClick:()=>{k&&Ee(k)},children:t(T?"connectorDetail.removing":"connectorDetail.remove")})]})]})}),o.jsx(yn,{open:M,onOpenChange:U,children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("connectorDetail.regenerateDialogTitle")}),o.jsx(In,{children:t("connectorDetail.regenerateDialogDesc")})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>U(!1),disabled:D,children:t("common.cancel")}),o.jsx(ie,{onClick:()=>void ue(),disabled:D,children:t(D?"connectorDetail.regenerating":"connectorDetail.regenerateApiKey")})]})]})}),o.jsx(z0,{open:Z,onOpenChange:Q,initialTab:"sharing",target:K,onSharingChanged:X})]})}function Xae({...t}){return o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Qae({className:t,...e}){return o.jsx("ol",{"data-slot":"breadcrumb-list",className:Fe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...e})}function jb({className:t,...e}){return o.jsx("li",{"data-slot":"breadcrumb-item",className:Fe("inline-flex items-center gap-1.5",t),...e})}function sN({asChild:t,className:e,...n}){const i=t?Cw:"a";return o.jsx(i,{"data-slot":"breadcrumb-link",className:Fe("hover:text-foreground transition-colors",e),...n})}function Zae({className:t,...e}){return o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Fe("text-foreground font-normal",t),...e})}function aN({children:t,className:e,...n}){return o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Fe("[&>svg]:size-3.5",e),...n,children:t??o.jsx(ro,{})})}function Jae(t,e=!0){const[n,i]=v.useState([]),[r,s]=v.useState(!1),[l,u]=v.useState(null),d=v.useCallback(async p=>{if(t===null){i([]),s(!1);return}const m=p?.silent===!0;try{m||s(!0),u(null);const b=(await Ic({folderId:t,pageSize:500})).data??[];i(b.map(WV))}catch(x){const b=x instanceof Error?x.message:"Errore nel caricamento";u(b),m||i([]),console.error("Error fetching folder documents:",x)}finally{m||s(!1)}},[t]);v.useEffect(()=>{e&&t!==null&&d()},[e,t,d]);const f=v.useCallback((p,m,x=null)=>{i(b=>b.map(w=>w.object_id===p?{...w,processingStatus:m,processingError:x}:w))},[]);return{files:n,loading:r,error:l,refetch:d,applyDocumentStatus:f}}function eoe({isOpen:t,onClose:e,folderName:n,folderId:i,onConfirm:r}){const{t:s}=Ye("dashboard"),[l,u]=v.useState(1),[d,f]=v.useState(""),[p,m]=v.useState(null),[x,b]=v.useState(!1),[w,C]=v.useState([]),{getRootProps:A,getInputProps:E,isDragActive:k}=Pw({onDrop:T=>{C(T)},multiple:!0}),N=()=>{u(1),f(""),m(null),b(!1),C([]),e()},_=()=>{d&&u(2)},R=()=>{w.length>0&&(r(w),N())};return o.jsxs(o.Fragment,{children:[o.jsx(yn,{open:t&&l===1,onOpenChange:T=>!T&&N(),children:o.jsxs(wn,{className:"sm:max-w-md",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("addResourceFlow.title")}),o.jsx(In,{children:s("addResourceFlow.selectSourceDesc")})]}),o.jsx("div",{className:"space-y-4 py-4",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Xe,{htmlFor:"source",className:"text-right font-medium",children:s("folderFilesViewer.source")}),o.jsxs(Br,{value:d,onValueChange:f,children:[o.jsx(Gr,{className:"flex-1",children:o.jsx(Hr,{placeholder:s("addResourceFlow.selectOption")})}),o.jsxs(Vr,{children:[o.jsx(di,{value:"pc",children:s("addResourceFlow.fromPc")}),o.jsx(di,{value:"external_drive",children:s("addResourceFlow.externalDrive")}
797),o.jsx(di,{value:"weburl",children:s("addResourceFlow.webUrl")})]})]})]})}),o.jsx(qn,{children:o.jsx(ie,{variant:"default",onClick:_,disabled:!d,className:"w-full sm:w-auto",children:s("newMcp.next")})})]})}),o.jsx(yn,{open:t&&l===2,modal:!x,onOpenChange:T=>{!T&&x||T||N()},children:o.jsxs(wn,{className:d==="weburl"||d==="external_drive"?"sm:max-w-2xl max-h-[90vh] overflow-y-auto":"sm:max-w-lg",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:s("addResourceFlow.title")}),o.jsxs(In,{children:["Inserisci risorse nella cartella"," ",o.jsx("span",{className:"text-foreground font-bold",children:n})]})]}),o.jsxs("div",{className:"py-4",children:[d==="pc"&&o.jsxs("div",{...A(),className:`border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${k?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[o.jsx("input",{...E()}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"text-lg font-semibold text-foreground",children:s("addResourceFlow.uploadFiles")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:s("addResourceFlow.dragOrUpload")})]})]}),w.length>0&&o.jsxs("div",{className:"mt-4 space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("dashboard.filesSelected",{count:w.length})}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:w.map((T,L)=>o.jsxs("div",{className:"flex items-center justify-between bg-muted p-2 rounded",children:[o.jsx("span",{className:"text-foreground text-sm truncate flex-1",children:T.name}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 ml-2",onClick:()=>C(M=>M.filter((U,D)=>D!==L)),children:o.jsx(yr,{className:"h-4 w-4"})})]},L))})]}),d==="weburl"&&o.jsx(jD,{folderId:i,onSingleDocumentCreated:async T=>{r([],void 0,T),N(),ee.success(s("webIngestion.webResourceSaved"))},onCrawlStarted:async()=>{N(),ee.success(s("webIngestion.webIngestionStarted"))}},`${i}-${l}`),d==="external_drive"&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("cloud.chooseProvider")}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o.jsx(ie,{type:"button",variant:p==="google"?"default":"outline",onClick:()=>m("google"),className:"h-auto py-3",children:s("cloud.googleDrive")}),o.jsx(ie,{type:"button",variant:p==="sharepoint"?"default":"outline",onClick:()=>m("sharepoint"),className:"h-auto py-3",children:s("cloud.sharepointOneDrive")})]})]}),d==="external_drive"&&p==="google"&&o.jsx(RD,{folderId:i,onPickerOpenChange:b,onTaskStarted:()=>N()},`drive-${i}`),d==="external_drive"&&p==="sharepoint"&&o.jsx(PD,{folderId:i,onImportComplete:()=>N()},`sharepoint-${i}`)]}),o.jsxs(qn,{className:"flex-col sm:flex-row gap-2",children:[o.jsxs(ie,{variant:"ghost",onClick:()=>u(1),className:"w-full sm:w-auto",children:[o.jsx(Es,{className:"h-4 w-4 mr-2"}),s("newMcp.back")]}),d==="pc"&&o.jsx(ie,{variant:"default",onClick:R,disabled:w.length===0,className:"w-full sm:w-auto",children:s("common.confirm")})]})]})})]})}const toe=new Set(["mp3","wav","m4a","aac","flac","ogg","oga","opus","wma","aiff","aif","amr","mp4","m4v","mov","avi","mkv","webm"]);function oN(t){if(t.type.startsWith("audio/")||t.type.startsWith("video/"))return!0;const e=t.name.split(".").pop()?.toLowerCase()??"";return toe.has(e)}const noe=({columns:t=7})=>o.jsx(Ot,{className:"hover:bg-transparent",children:Array.from({length:t}).map((e,n)=>o.jsx(Oe,{children:n===0?o.jsx("div",{className:"h-4 w-4 rounded bg-muted/30 animate-pulse"}):n===1?o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-6 h-6 rounded bg-muted/30 animate-pulse flex-shrink-0"}),o.jsx("div",{className:"h-4 bg-muted/40 animate-pulse rounded-md w-48"})]}):n===5?o.jsx("div",{className:"h-6 w-16 rounded-full bg-muted/20 animate-pulse"}):n===6?o.jsx("div",{className:"h-8 w-8 rounded-md bg-muted/20 animate-pulse ml-auto"}):o.jsx("div",{className:"h-4 bg-muted/20 animate-pulse rounded-md w-12"})},n))});function ioe(){const{t}=Ye("dashboard"),e=Kn(),{folderId:n}=ow(),{user:i,logout:r}=Ar(),{theme:s}=nh(),{isEnterpriseSharing:l}=R0(),[u,d]=v.useState(""),[f,p]=v.useState([]),[m,x]=v.useState(!1),[b,w]=v.useState("file_name"),[C,A]=v.useState("asc"),[E,k]=v.useState(!1),[N,_]=v.useState(!1),[R,T]=v.useState(null),{sheetProps:L,openDocumentPreview:M}=qL(),[U,D]=v.useState(!1),[G,Z]=v.useState(null),Q=n?parseInt(n,10):null,{files:K,loading:q,error:F,refetch:V,applyDocumentStatus:O}=Jae(Number.isNaN(Q??NaN)?null:Q),X=v.useRef(K);X.current=K,VL(xe=>{if(!X.current.some(me=>me.object_id===xe.id)){Promise.resolve().then(()=>void V({silent:!0}));return}O(xe.id,xe.processingStatus,xe.error??null)});const $=async xe=>
797{try{await Uw(xe),O(xe,"PENDING",null),ee.success(t("toasts.requeued"))}catch(me){const rt=me instanceof Error?me.message:t("toasts.requeueError");ee.error(rt)}};v.useEffect(()=>{(async()=>{if(!(!Q||Number.isNaN(Q)))try{const me=await xk(Q);T(me)}catch(me){console.error("Error fetching folder info:",me)}})()},[Q]);const B=()=>{x(!1),r(),e("/login")},H=()=>{e("/settings")},P=()=>{e("/dashboard")},he=[...K.filter(xe=>xe.file_name.toLowerCase().includes(u.toLowerCase()))].sort((xe,me)=>{let rt=0;switch(b){case"file_name":rt=Zt(xe.file_name,me.file_name);break;case"file_size":rt=xe.file_size-me.file_size;break;case"file_extension":rt=(xe.file_extension||"").localeCompare(me.file_extension||"");break;case"last_updated_time":rt=new Date(xe.last_updated_time).getTime()-new Date(me.last_updated_time).getTime();break;default:rt=0}return C==="asc"?rt:-rt}),ue=xe=>{b===xe?A(C==="asc"?"desc":"asc"):(w(xe),A("asc"))},W=xe=>{p(me=>me.includes(xe)?me.filter(rt=>rt!==xe):[...me,xe])},fe=()=>{f.length===he.length?p([]):p(he.map(xe=>xe.object_id))},se=xe=>{p(me=>me.filter(rt=>rt!==xe))},pe=async xe=>{await M({documentId:xe.object_id,name:xe.file_name,extension:xe.file_extension||"",sourceUrl:xe.uri,documentSource:xe.source,sizeLabel:qe(xe.file_size),updatedAtLabel:pt(xe.last_updated_time)})},Ee=async xe=>{try{await Zp(xe),ee.success(t("toasts.documentDeleted")),p(me=>me.filter(rt=>rt!==xe)),await V()}catch(me){ee.error(me instanceof Error?me.message:t("toasts.deleteError"))}},Ce=async()=>{if(f.length!==0)try{await Promise.all(f.map(xe=>Zp(xe))),ee.success(f.length===1?t("toasts.documentDeleted"):t("toasts.documentsDeleted",{count:f.length})),p([]),k(!1),await V()}catch(xe){ee.error(xe instanceof Error?xe.message:t("toasts.deleteError"))}},Ne=async(xe,me,rt)=>{if(rt){V();return}if(xe.length>0&&Q!=null)try{const ve=xe.filter(oN),Me=xe.filter(le=>!oN(le));Me.length>0&&await Nc(Me,Q),ve.length>0&&kp(ve,Q,()=>V({silent:!0})),ve.length>0&&Me.length>0?ee.success(t("toasts.uploadFolderMixed",{uploaded:Me.length,transcription:ve.length})):ve.length>0?ee.success(t("toasts.uploadFolderTranscription",{count:ve.length})):ee.success(t("toasts.uploadToFolder",{count:xe.length})),V({silent:ve.length>0})}catch(ve){ee.error(ve instanceof Error?ve.message:t("toasts.operationError"))}},qe=xe=>{if(xe===0)return"0 B";const me=1024,rt=["B","KB","MB","GB"],ve=Math.floor(Math.log(xe)/Math.log(me));return`${parseFloat((xe/Math.pow(me,ve)).toFixed(2))} ${rt[ve]}`},pt=xe=>{const me=new Date(xe),ve=new Date().getTime()-me.getTime(),Me=Math.floor(ve/6e4),le=Math.floor(ve/36e5),ye=Math.floor(ve/864e5);return Me<1?t("time.secondsAgo"):Me<60?t("time.minutesAgo",{count:Me}):le<24?t("time.hoursAgo",{count:le}):ye<7?t("time.daysAgo",{count:ye}):ye<30?t("time.weeksAgo",{count:Math.floor(ye/7)}):Kp(me,{day:"2-digit",month:"2-digit",year:"numeric"})},$e=R?.name||t("common.folderDefault"),je=R?.id??Q??0,xt=R?.employeeId!=null&&i?.id!=null&&Number(i.id)===R.employeeId,Ae=xe=>{Z(xe),D(!0)},at=he.filter(xe=>f.includes(xe.object_id));return o.jsxs("div",{className:"bg-background min-h-screen text-foreground",children:[o.jsx(k0,{...L}),o.jsx(z0,{open:U,onOpenChange:D,initialTab:"sharing",target:G,onSharingChanged:async()=>{await Promise.all([V(),Q?xk(Q).then(T):Promise.resolve()])}}),o.jsxs("header",{className:"bg-card border-b border-border py-6 px-8 shadow-sm flex items-center justify-between gap-4",children:[o.jsx("div",{className:"flex items-center gap-4",children:o.jsx(K0,{className:"h-8 w-auto"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[i&&o.jsx(GL,{userName:i.fullName,onSettings:H,onLogoutClick:()=>x(!0)}),o.jsx(si,{})]})]}),o.jsx(yn,{open:m,onOpenChange:x,children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:t("dialogs.logout.title")}),o.jsx(In,{children:t("dialogs.logout.description")})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>x(!1),children:t("common.no")}),o.jsx(ie,{variant:"destructive",onClick:B,children:t("common.yes")})]})]})}),o.jsxs("main",{className:"flex-1 p-8 overflow-y-auto",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ie,{variant:"ghost",size:"icon",onClick:P,className:"rounded-full",children:o.jsx(Zj,{className:"h-5 w-5"})}),o.jsx("h1",{className:"text-3xl font-bold text-foreground",children:$e})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[l&&je>0&&xt&&o.jsx(ie,{variant:"outline",onClick:()=>Ae({id:je,type:"folder",name:$e}),children:t("folderView.shareFolder")}),o.jsxs(ie,{className:"flex gap-2",onClick:()=>_(!0),children:[o.jsx(c_,{className:"h-4 w-4"}),t("dashboard.addResources")]})]})]}),o.jsx("div",{className:"mb-6",children:o.jsx(Xae,{children:o.jsxs(Qae,{children:[o.jsx(jb,{children:o.jsx(sN,{onClick:P,className:"cursor-pointer hover:text-foreground",children:t("folderView.breadcrumbMain")})}),o.jsx(aN,{}),o.jsx(jb,{children:o.jsx(sN,{onClick:P,className:"cursor-pointer hover:text-foreground",children:"Pura Digital"})}),o.jsx(aN,{}),o.jsx(jb,{children:o.jsx(Zae,{className:"text-foreground font-medium",children:$e})})]})})}),o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsx("div",{className:"max-w-md flex-1",children:o.jsxs("div",{className:"relative",children:[o.jsx(Yc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Qe,{type:"text",placeholder:t("common.searchDocuments"),value:u,onChange:xe=>d(xe.target.value),className:"pl-10"})]})}),o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsxs(ie,{variant:"outline",children:[o.jsx(il,{className:"h-4 w-4 mr-2"}),t("common.sort")]})}
797),o.jsxs(Ur,{align:"end",className:"w-48",children:[o.jsxs(lt,{onClick:()=>ue("file_name"),onSelect:xe=>xe.preventDefault(),className:b==="file_name"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx(bw,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"flex-1",children:t("common.title")}),b==="file_name"&&(C==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>ue("file_extension"),onSelect:xe=>xe.preventDefault(),className:b==="file_extension"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx(I8,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"flex-1",children:t("common.type")}),b==="file_extension"&&(C==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>ue("file_size"),onSelect:xe=>xe.preventDefault(),className:b==="file_size"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx(yw,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"flex-1",children:t("common.size")}),b==="file_size"&&(C==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]}),o.jsxs(lt,{onClick:()=>ue("last_updated_time"),onSelect:xe=>xe.preventDefault(),className:b==="last_updated_time"?"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-[#64748B]",children:[o.jsx(t_,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"flex-1",children:t("common.modified")}),b==="last_updated_time"&&(C==="asc"?o.jsx(pr,{className:"h-4 w-4 ml-2 text-primary-foreground"}):o.jsx(fr,{className:"h-4 w-4 ml-2 text-primary-foreground"}))]})]})]})]}),q?o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-[50px]",children:o.jsx("div",{className:"h-4 w-4 bg-muted/20 animate-pulse rounded"})}),o.jsx(Ve,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-6"}),o.jsx("div",{className:"h-4 w-24 bg-muted/20 animate-pulse rounded"})]})}),o.jsx(Ve,{children:o.jsx("div",{className:"h-4 w-12 bg-muted/20 animate-pulse rounded"})}),o.jsx(Ve,{children:o.jsx("div",{className:"h-4 w-20 bg-muted/20 animate-pulse rounded"})}),o.jsx(Ve,{children:o.jsx("div",{className:"h-4 w-24 bg-muted/20 animate-pulse rounded"})}),o.jsx(Ve,{children:o.jsx("div",{className:"h-4 w-16 bg-muted/20 animate-pulse rounded"})}),o.jsx(Ve,{className:"w-[50px]"})]})}),o.jsx(ys,{children:Array.from({length:8}).map((xe,me)=>o.jsx(noe,{columns:7},me))})]})}):F?o.jsxs("div",{className:"text-center py-12",children:[o.jsx("p",{className:"text-destructive mb-4",children:F}),o.jsx(ie,{onClick:()=>V(),variant:"outline",children:t("common.retry")})]}):he.length===0?o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:t(u?"folderView.noFilesFound":"folderView.emptyFolder")}):o.jsx("div",{className:"bg-background border border-border rounded-lg overflow-hidden",children:o.jsxs(vs,{children:[o.jsx(bs,{children:o.jsxs(Ot,{children:[o.jsx(Ve,{className:"w-[50px]",children:o.jsx(On,{checked:f.length===he.length,onCheckedChange:fe})}),o.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>ue("file_name"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-6"}),o.jsx("span",{children:t("common.title")}),b==="file_name"&&o.jsx("span",{children:C==="asc"?"↑":"↓"})]})}),o.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>ue("file_extension"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[t("common.type"),b==="file_extension"&&o.jsx("span",{children:C==="asc"?"â
797†‘":"↓"})]})}),o.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>ue("file_size"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[t("common.size"),b==="file_size"&&o.jsx("span",{children:C==="asc"?"↑":"↓"})]})}),o.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>ue("last_updated_time"),children:o.jsxs("div",{className:"flex items-center gap-2",children:[t("common.modified"),b==="last_updated_time"&&o.jsx("span",{children:C==="asc"?"↑":"↓"})]})}),o.jsx(Ve,{children:t("common.status")}),o.jsx(Ve,{className:"w-[50px]"})]})}),o.jsx(ys,{children:he.map(xe=>o.jsxs(Ot,{className:`hover:bg-accent/50 transition-colors ${f.includes(xe.object_id)?"bg-muted/50":""}`,children:[o.jsx(Oe,{onClick:me=>me.stopPropagation(),children:o.jsx(On,{checked:f.includes(xe.object_id),onCheckedChange:()=>W(xe.object_id)})}),o.jsx(Oe,{className:"font-medium",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:jp(xe.file_extension||"FILE",s),alt:xe.file_extension||"FILE",className:"w-6 h-6 flex-shrink-0"}),o.jsx("span",{children:xe.file_name}),xe.is_starred&&o.jsx($A,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"})]})}),o.jsx(Oe,{children:xe.file_extension?o.jsx("span",{className:"uppercase text-sm",children:xe.file_extension}):"—"}),o.jsx(Oe,{children:qe(xe.file_size)}),o.jsx(Oe,{className:"text-muted-foreground",children:pt(xe.last_updated_time)}),o.jsx(Oe,{children:o.jsx(dm,{status:xe.processingStatus,error:xe.processingError})}),o.jsx(Oe,{children:o.jsxs(Fr,{children:[o.jsx($r,{asChild:!0,children:o.jsx(ie,{variant:"ghost",size:"icon",children:o.jsx(kc,{className:"h-4 w-4"})})}),o.jsxs(Ur,{align:"end",children:[o.jsxs(lt,{onClick:me=>{me.stopPropagation(),pe(xe)},children:[o.jsx(Wo,{className:"mr-2 h-4 w-4"}),t("common.open")]}),l&&xe.employeeId!=null&&Number(i?.id)===xe.employeeId&&o.jsxs(lt,{onClick:me=>{me.stopPropagation(),Ae({id:xe.object_id,type:"document",name:xe.file_name})},children:[o.jsx(gr,{className:"mr-2 h-4 w-4"}),t("common.share")]}),(xe.processingStatus??"").toUpperCase()==="FAILED"&&o.jsxs(lt,{onClick:me=>{me.stopPropagation(),$(xe.object_id)},children:[o.jsx(Dc,{className:"mr-2 h-4 w-4"}),t("common.requeue")]}),o.jsxs(lt,{onClick:me=>{me.stopPropagation()},children:[o.jsx($A,{className:"mr-2 h-4 w-4"}),xe.is_starred?t("folderView.removeFavorite"):t("folderView.addFavorite")]}),o.jsxs(lt,{className:"text-red-600 focus:text-red-600",onClick:me=>{me.stopPropagation(),Ee(xe.object_id)},children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})})]},xe.object_id))})]})}),f.length>0&&o.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border py-4 px-8 shadow-lg",children:o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs(hl,{open:E,onOpenChange:k,children:[o.jsx(fl,{asChild:!0,children:o.jsxs(ie,{variant:"outline",className:"h-[42px] rounded-md border gap-4",style:{paddingTop:"10px",paddingRight:"16px",paddingBottom:"10px",paddingLeft:"16px"},children:[o.jsx("span",{className:"text-sm font-medium",children:t("dashboard.filesSelected",{count:at.length})}),o.jsx(xs,{className:"h-4 w-4 opacity-50"})]})}),o.jsx(pl,{className:"w-[400px] p-0",align:"center",side:"top",sideOffset:8,children:at.length===0?o.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:t("dashboard.noFilesSelected")}):o.jsxs("div",{className:"p-4",children:[o.jsx("div",{className:"mb-3",children:o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t("dashboard.filesSelected",{count:at.length})})}),o.jsx(Qr,{className:"h-[200px] w-full rounded-md border border-border p-4 bg-background",children:o.jsx("div",{className:"space-y-2",children:at.map(xe=>o.jsxs("div",{className:"flex items-center justify-between bg-muted/50 p-2 rounded hover:bg-muted transition-colors",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:xe.file_name}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[xe.file_extension?.toUpperCase()||"—"," • ",qe(xe.file_size)]})]}),o.jsx(ie,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 ml-2",onClick:()=>se(xe.object_id),children:o.jsx(yr,{className:"h-4 w-4"})})]},xe.object_id))})}),o.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:o.jsxs(ie,{type:"button",variant:"destructive",className:"w-full",onClick:()=>void Ce(),children:[o.jsx(yi,{className:"mr-2 h-4 w-4"}),t("dashboard.deleteSelected",{count:at.length})]})})]})})]})})}),o.jsx("div",{className:"mt-6 min-w-0 border-t border-border bg-background px-3 py-3 shadow-sm sm:px-6 sm:py-4",children:o.jsx("div",{className:"truncate text-sm text-muted-foreground",children:t("dashboard.rowsSelected",{selected:f.length,total:he.length})})})]}),o.jsx(eoe,{isOpen:N,onClose:()=>_(!1),folderName:$e,folderId:Q??0,onConfirm:Ne})]})}function roe({className:t}){const{t:e}=Ye("settings"),[n,i]=v.useState(null),[r,s]=v.useState([]),[l,u]=v.useState(!0),[d,f]=v.useState(null),[p,m]=v.useState(null),x=_=>e(`connectedAccounts.providers.${_}`),b=v.useCallback(async()=>{u(!0);try{const[_,R]=await Promise.all([N0(),j0()]);i(_),s(R)}catch(_){ee.error(_ instanceof Error?_.message:e("toasts.connectedAccountsLoadError"))}finally{u(!1)}},[e]);v.useEffect(()=>{b()},[b]);const w=async _=>{f(_);try{const{url:R}=await _D(_),T=window.open(R,"cloudOAuth","width=520,height=680");if(!T){window.location.href=R;return}const L=U=>{if(U.origin!==window.location.origin)return;U.data?.type==="cloud-oauth:success"&&(window.removeEventListener("message",L),b(),ee.success(e("toasts.connectedSuccess",{provider:x(_)})))};window.addEventListener("message",L);const M=window.setInterval(()=>{T.closed&&(window.clearInterval(M),window.removeEventListener("message",L),b())},500)}catch(R){ee.error(R instanceof Error?R.message:e("toasts.connectError"))}finally{f(null)}},C=async _=>{if(window.confirm(e("connectedAccounts.confirmDisconnect",{provider:x(_.provider)}))){m(_.id);try{await Wne(_.id),ee.success(e("toasts.disconnected")),await b()}catch(R){ee.error(R instanceof Error?R.message:e("toasts.disconnectError"))}finally{m(null)}}},A=n?.google.enabled??!1,E=n?.microsoft.enabled??!1,k=r.some(_=>_.provider==="google"&&!_.disabled),N=r.some(_=>_.provider==="microsoft"&&!_.disabled);return o.jsxs(ln,{className:t,children:[o.jsxs(hn,{className:"pb-3",children:[o.jsxs(fn,{className:"text-base flex items-center gap-2",children:[o.jsx(ww,{className:"h-4 w-4"}),e("connectedAccounts.title")]}),o.jsx(uo,{children:e("connectedAccounts.description")})]}),o.jsx(pn,{className:"space-y-3",children:l?o.jsx("div",{className:"flex justify-center py-6",children:o.jsx(Vn,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):o.jsxs(o.Fragment,{children:[r.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:e("connectedAccounts.empty")}),r.map(_=>o.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:x(_.provider)}),o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.providerAccountEmail??_.name})]}),o.jsx(ie,{size:"sm",variant:"outline",onClick:()=>void C(_),disabled:p===_.id,children:p===_.id?o.jsx(Vn,{className:"h-3 w-3 animate-spin"}):o.jsxs(o.Fragment,{children:[o.jsx(yi,{className:"h-3 w-3 mr-1"}),e("connectedAccounts.disconnect")]})})]},_.id)),o.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[A&&!k&&o.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>void w("google"),disabled:d==="google",children:[d==="google"?o.jsx(Vn,{className:"h-3 w-3 mr-2 animate-spin"}):null,e("connectedAccounts.connectGoogle")]}),E&&!N&&o.jsxs(ie,{size:"sm",variant:"secondary",onClick:()=>void w("microsoft"),disabled:d==="microsoft",children:[d==="microsoft"?o.jsx(Vn,{className:"h-3 w-3 mr-2 animate-spin"}):null,e("connectedAccounts.connectMicrosoft")]}),!A&&!E&&o.jsx("p",{className:"text-xs text-muted-foreground",children:e("connectedAccounts.noProvider")})]})]})})]})}const lN=[{id:"aiden",iconSrc:"/aiden.svg"},{id:"claude",iconSrc:"/claude.svg"},{id:"chatgpt",iconSrc:"/openai.svg"},{id:"cursor",iconSrc:"/cursor.svg"},{id:"others",icon:"more"}],KL={kbd:o.jsx("kbd",{className:"rounded bg-muted px-1 py-0.5"}),strong:o.jsx("strong",{}),code:o.jsx("code",{})};function vi({i18nKey:t,values:e}){return o.jsx("li",{children:o.jsx(Em,{i18nKey:t,ns:"settings",values:e,components:KL})})}function soe({client:t,scope:e}){const{t:n}=Ye("settings"),i=n(e==="collection"?"integrations.scopeCollection":"integrations.scopeUser"),r=n(e==="collection"?"integrations.urlHintCollection":"integrations.urlHintUser"),s=n(e==="collection"?"integrations.authHint
797Collection":"integrations.authHintUser"),l=`integrations.${t}`,u=()=>{switch(t){case"cursor":return o.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[["1","2","3","4"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d)),o.jsx(vi,{i18nKey:`${l}.steps.5`,values:{urlHint:r}}),o.jsx(vi,{i18nKey:`${l}.steps.6`})]});case"chatgpt":return o.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[["1","2","3"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d)),o.jsx(vi,{i18nKey:`${l}.steps.4`,values:{urlHint:r}}),["5","6"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d))]});case"claude":return o.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[["1","2"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d)),o.jsxs("li",{children:[o.jsx(Em,{i18nKey:`${l}.steps.3`,ns:"settings",values:{scopeWord:n(e==="collection"?`${l}.scopeWordCollection`:`${l}.scopeWordUser`)},components:KL}),o.jsx("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-3",children:n(e==="collection"?`${l}.configCollection`:`${l}.configUser`)})]}),["4","5"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d))]});case"aiden":return o.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[["1","2"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d)),o.jsx(vi,{i18nKey:`${l}.steps.3`,values:{urlHint:r}}),["4","5"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d))]});case"others":return o.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[["1","2"].map(d=>o.jsx(vi,{i18nKey:`${l}.steps.${d}`},d)),o.jsx(vi,{i18nKey:`${l}.steps.3`,values:{urlHint:r}}),o.jsx(vi,{i18nKey:`${l}.steps.${e==="collection"?"4Collection":"4User"}`}),o.jsx(vi,{i18nKey:`${l}.steps.5`})]})}};return o.jsxs(ln,{children:[o.jsxs(hn,{children:[o.jsx(fn,{className:"text-base",children:n(`${l}.title`)}),o.jsx(uo,{children:n(`${l}.description`,{scope:i})})]}),o.jsxs(pn,{className:"space-y-4 text-sm",children:[u(),o.jsx("p",{className:"text-muted-foreground",children:s})]})]})}function aoe({src:t,className:e}){return o.jsx("span",{"aria-hidden":!0,className:Fe("inline-block shrink-0 bg-current",e),style:{maskImage:`url(${t})`,WebkitMaskImage:`url(${t})`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center"}})}function cN({scope:t}){const{t:e}=Ye("settings");return o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:o.jsx(Em,{i18nKey:"help.docsLink",ns:"settings",components:{docsLink:o.jsx(Fi,{to:"/docs",className:"font-medium text-primary underline-offset-4 hover:underline"})}})}),o.jsxs(Zc,{defaultValue:"aiden",className:"w-full min-w-0",children:[o.jsx(Jc,{className:"bg-muted/50 flex h-auto min-h-11 w-full flex-wrap gap-1 rounded-lg border border-border/50 p-1 shadow-inner backdrop-blur-sm",children:lN.map(n=>o.jsxs(Xr,{value:n.id,className:"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md data-[state=active]:shadow-black/5 flex min-h-9 flex-1 basis-[calc(33.333%-4px)] items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-semibold transition-all duration-200 data-[state=inactive]:text-muted-foreground hover:text-foreground sm:basis-auto sm:gap-2 sm:text-sm",children:["iconSrc"in n?o.jsx(aoe,{src:n.iconSrc,className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}):o.jsx(kc,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),e(`integrations.clients.${n.id}`)]},n.id))}),lN.map(n=>o.jsx(sl,{value:n.id,className:"mt-4 space-y-4",children:o.jsx(soe,{client:n.id,scope:t})},n.id))]})]})}const ooe=["connectorMcp","collectionVsUser","apiKey","indexing","regenerate"];function loe(){const{t}=Ye("settings"),[e,n]=v.useState("connectorMcp");return o.jsxs("div",{className:"space-y-3",children:[o.jsx("h3",{className:"text-lg font-medium text-foreground",children:t("help.faqTitle")}),o.jsx("div",{className:"divide-y divide-border rounded-lg border border-border overflow-hidden",children:ooe.map(i=>{const r=e===i;return o.jsxs("div",{className:"bg-background",children:[o.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left hover:bg-muted/40 transition-colors",onClick:()=>n(r?null:i),"aria-expanded":r,children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t(`faq.${i}.q`)}),o.jsx(xs,{className:Fe("h-4 w-4 shrink-0 text-muted-foreground transition-transform",r&&"rotate-180")}
797)]}),r?o.jsx("p",{className:"border-t border-border px-4 pb-4 pt-0 text-sm text-muted-foreground leading-relaxed",children:t(`faq.${i}.a`)}):null]},i)})})]})}function coe({open:t,onOpenChange:e,subscription:n,onCanceled:i}){const{t:r}=Ye("settings"),[s,l]=v.useState(""),[u,d]=v.useState(!1),f=r("dialogs.cancelSubscription.confirmWord"),p=s===f,m=n.endsAt?Kp(n.endsAt,{day:"numeric",month:"long",year:"numeric"}):null;v.useEffect(()=>{t||l("")},[t]);const x=async()=>{if(p){d(!0);try{const w=await V$(n.id);i(w),e(!1),ee.success(m?r("toasts.cancelSuccessWithDate",{date:m}):r("toasts.cancelSuccess"))}catch(w){const C=w instanceof Error?w.message:r("toasts.cancelError");ee.error(C)}finally{d(!1)}}},b=n.plan.name??n.plan.description??"";return o.jsx(yn,{open:t,onOpenChange:w=>{u||e(w)},children:o.jsxs(wn,{className:"sm:max-w-lg",children:[o.jsxs(An,{children:[o.jsxs(Sn,{className:"flex items-center gap-2 text-destructive",children:[o.jsx(k7,{className:"h-5 w-5 shrink-0"}),r("dialogs.cancelSubscription.title")]}),o.jsx(In,{asChild:!0,children:o.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground pt-1",children:[o.jsx("p",{children:r("dialogs.cancelSubscription.intro",{planName:b})}),m&&o.jsx("p",{children:r("dialogs.cancelSubscription.accessUntil",{date:m})}),o.jsx("p",{children:r("dialogs.cancelSubscription.confirmInstruction",{word:f})})]})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"cancel-subscription-confirm",children:r("dialogs.cancelSubscription.confirmLabel",{word:f})}),o.jsx(Qe,{id:"cancel-subscription-confirm",value:s,onChange:w=>l(w.target.value),placeholder:f,autoComplete:"off",disabled:u})]}),o.jsxs(qn,{children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>e(!1),disabled:u,children:r("dialogs.cancelSubscription.back")}),o.jsx(ie,{type:"button",variant:"destructive",disabled:!p||u,onClick:()=>void x(),children:r(u?"dialogs.cancelSubscription.submitting":"dialogs.cancelSubscription.submit")})]})]})})}const Ya=120,Xa=118,dp=80,hp=54,uoe=12;function Qa(t,e,n,i){const r=(i-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}}function uN(t,e,n,i,r,s){const l=s-r;if(l<=0)return"";if(l>=359.999){const x=Qa(t,e,n,0),b=Qa(t,e,n,180),w=Qa(t,e,i,0),C=Qa(t,e,i,180);return[`M ${x.x} ${x.y}`,`A ${n} ${n} 0 1 1 ${b.x} ${b.y}`,`A ${n} ${n} 0 1 1 ${x.x} ${x.y}`,`M ${w.x} ${w.y}`,`A ${i} ${i} 0 1 0 ${C.x} ${C.y}`,`A ${i} ${i} 0 1 0 ${w.x} ${w.y}`,"Z"].join(" ")}const u=Qa(t,e,n,s),d=Qa(t,e,n,r),f=Qa(t,e,i,s),p=Qa(t,e,i,r),m=l<=180?"0":"1";return[`M ${u.x} ${u.y}`,`A ${n} ${n} 0 ${m} 0 ${d.x} ${d.y}`,`L ${p.x} ${p.y}`,`A ${i} ${i} 0 ${m} 1 ${f.x} ${f.y}`,"Z"].join(" ")}const dN={used:{labelKey:"used",gradientId:"storage-used-gradient"},remaining:{labelKey:"available",gradientId:"storage-remaining-gradient"}};function doe(t){return t==="used"?"color-mix(in oklch, var(--accent-foreground) 68%, var(--background))":"color-mix(in oklch, var(--foreground) 58%, var(--background))"}function hoe({usage:t,formatGb:e}){const{t:n}=Ye("settings"),[i,r]=v.useState(null),[s,l]=v.useState({rotateX:38,rotateZ:-2}),u=x=>n(`account.storage.${dN[x].labelKey}`),d=x=>{const b=x.currentTarget.getBoundingClientRect(),w=(x.clientX-b.left)/b.width-.5,C=(x.clientY-b.top)/b.height-.5;l({rotateX:38+C*6,rotateZ:-2+w*8})},f=()=>{l({rotateX:38,rotateZ:-2})},p=v.useMemo(()=>{const x=t.maxStorageBytes;if(x<=0)return null;const b=Math.min(1,Math.max(0,t.usedBytes/x)),w=b*360,C=[];return b>0&&C.push({key:"used",path:uN(Ya,Xa,dp,hp,0,w),gb:t.usedGb,percent:b*100}),b<1&&C.push({key:"remaining",path:uN(Ya,Xa,dp,hp,w,360),gb:t.remainingGb,percent:(1-b)*100}),C},[t]);if(!p||p.length===0)return null;const m=i?p.find(x=>x.key===i):null;return o.jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:items-start sm:gap-8",children:[o.jsxs("div",{className:"relative w-[min(100%,240px)] select-none",style:{perspective:"1100px"},onPointerMove:d,onPointerLeave:f,children:[o.jsxs("svg",{viewBox:"0 0 240 250",className:"w-full h-auto transition-transform duration-300 ease-out motion-reduce:transition-none",style:{transform:`rotateX(${s.rotateX}deg) rotateZ(${s.rotateZ}deg)`,transformStyle:"preserve-3d"},role:"img","aria-label":n("account.storage.ariaLabel",{remainingGb:e(t.remainingGb)}),children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"storage-used-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[o.jsx("stop",{offset:"0%",style:{stopColor:"var(--accent-foreground)"}}),o.jsx("stop",{offset:"100%",style:{stopColor:"var(--ring)"}})]}),o.jsxs("linearGradient",{id:"storage-remaining-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[o.jsx("stop",{offset:"0%",style:{stopColor:"var(--foreground)"}}),o.jsx("stop",{offset:"100%",style:{stopColor:"color-mix(in oklch, var(--foreground) 84%, var(--background))"}})]}
797),o.jsxs("radialGradient",{id:"storage-inner-cap",cx:"50%",cy:"35%",r:"65%",children:[o.jsx("stop",{offset:"0%",style:{stopColor:"var(--background)"}}),o.jsx("stop",{offset:"100%",style:{stopColor:"color-mix(in oklch, var(--background) 55%, var(--muted))"}})]}),o.jsx("filter",{id:"storage-ground-shadow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:o.jsx("feDropShadow",{dx:"0",dy:"8",stdDeviation:"10",floodColor:"var(--foreground)",floodOpacity:"0.18"})})]}),o.jsx("ellipse",{cx:Ya,cy:Xa+dp+18,rx:dp*.82,ry:14,className:"fill-foreground/10"}),o.jsx("g",{filter:"url(#storage-ground-shadow)",transform:`translate(0, ${uoe})`,children:p.map(x=>o.jsx("path",{d:x.path,style:{fill:doe(x.key),opacity:i&&i!==x.key?.35:.9},className:"transition-opacity duration-300"},`depth-${x.key}`))}),p.map(x=>{const b=dN[x.key],w=i===x.key,C=i!==null&&i!==x.key;return o.jsx("g",{className:"cursor-pointer transition-transform duration-300 motion-reduce:transition-none",style:{transform:w?"translateY(-3px)":"translateY(0)",transformOrigin:`${Ya}px ${Xa}px`},onMouseEnter:()=>r(x.key),onMouseLeave:()=>r(null),onFocus:()=>r(x.key),onBlur:()=>r(null),children:o.jsx("path",{d:x.path,fill:`url(#${b.gradientId})`,className:"transition-all duration-300 motion-reduce:transition-none",style:{opacity:C?.55:1,filter:w?"brightness(1.06) drop-shadow(0 4px 8px color-mix(in oklch, var(--foreground) 28%, transparent))":void 0}})},x.key)}),o.jsx("circle",{cx:Ya,cy:Xa,r:hp-1,fill:"url(#storage-inner-cap)",className:"pointer-events-none"}),o.jsx("circle",{cx:Ya,cy:Xa,r:hp-1,fill:"none",stroke:"var(--border)",strokeWidth:"1",className:"pointer-events-none"}),o.jsx("text",{x:Ya,y:Xa-7,textAnchor:"middle",className:"fill-foreground text-[10px] font-medium pointer-events-none",children:n("account.storage.gbRemaining")}),o.jsxs("text",{x:Ya,y:Xa+11,textAnchor:"middle",className:"fill-foreground text-[16px] font-bold pointer-events-none",children:[e(t.remainingGb)," GB"]})]}),m?o.jsxs("div",{className:"absolute left-1/2 top-2 -translate-x-1/2 rounded-lg border border-border bg-popover px-3 py-2 text-center text-xs shadow-md animate-in fade-in zoom-in-95 duration-200",children:[o.jsx("p",{className:"font-medium text-foreground",children:u(m.key)}),o.jsxs("p",{className:"text-muted-foreground",children:[e(m.gb)," GB (",m.percent.toFixed(1),"%)"]})]}):null]}),o.jsxs("div",{className:"flex flex-col gap-3 min-w-[180px]",children:[p.map(x=>{const b=i===x.key;return o.jsxs("button",{type:"button",className:`flex items-center gap-3 rounded-lg border px-3 py-2 text-left transition-colors ${b?"border-accent-foreground/40 bg-accent/30":"border-border bg-card hover:bg-muted/40"}`,onMouseEnter:()=>r(x.key),onMouseLeave:()=>r(null),onFocus:()=>r(x.key),onBlur:()=>r(null),children:[o.jsx("span",{className:`h-3 w-3 shrink-0 rounded-full ${x.key==="used"?"bg-accent-foreground":"bg-foreground"}`}),o.jsxs("span",{className:"flex-1 text-sm",children:[o.jsx("span",{className:"font-medium text-foreground",children:u(x.key)}),o.jsxs("span",{className:"block text-muted-foreground",children:[e(x.gb)," GB"]})]}),o.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[x.percent.toFixed(0),"%"]})]},x.key)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:n("account.storage.legendHint")})]})]})}const foe=[{value:"light",icon:qb,labelKey:"light"},{value:"dark",icon:s_,labelKey:"dark"},{value:"system",icon:a7,labelKey:"system"}];function poe(){const{t}=Ye("settings"),{theme:e,setTheme:n}=nh();return o.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2",children:[o.jsx("span",{className:"px-1 text-xs font-medium text-muted-foreground",children:t("appearance.label")}),o.jsx("div",{className:"flex w-full min-w-0 rounded-lg border border-border bg-muted/40 p-1",role:"group","aria-label":t("appearance.ariaLabel"),children:foe.map(i=>{const r=e===i.value,s=i.icon,l=t(`appearance.${i.labelKey}`);return o.jsxs("button",{type:"button","aria-pressed":r,"aria-label":l,title:l,onClick:()=>n(i.value),className:`flex min-w-0 flex-1 items-center justify-center rounded-md px-1 py-2 transition-all ${r?"bg-background text-foreground shadow-sm ring-1 ring-border":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[o.jsx(s,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"sr-only",children:l})]},i.value)})})]})}function WL(){const{i18n:t}=Ye(),e=Jb(t.language)?t.language:"it",n=v.useCallback(r=>{_w(r),t.changeLanguage(r)},[t]),i=v.useCallback(()=>{n(e==="it"?"en":"it")},[e,n]);return{locale:e,setLocale:n,toggleLocale:i}}
797const hN=[{value:"it",labelKey:"italian",short:"IT"},{value:"en",labelKey:"english",short:"EN"}];function YL({variant:t="default",className:e}){const{t:n}=Ye("settings"),{locale:i,setLocale:r}=WL(),s=l=>Fe("transition-all",t==="compact"?"h-8 rounded-[5px] px-2.5 text-xs font-medium":"flex min-w-0 flex-1 items-center justify-center rounded-md px-2 py-2 text-xs font-medium",l?"bg-background text-foreground shadow-sm ring-1 ring-border":"text-muted-foreground hover:bg-background/60 hover:text-foreground");return t==="compact"?o.jsx("div",{className:Fe("flex items-center rounded-md border border-border bg-muted/40 p-0.5",e),role:"group","aria-label":n("language.ariaLabel"),children:hN.map(l=>{const u=i===l.value;return o.jsx("button",{type:"button","aria-pressed":u,"aria-label":n(`language.${l.labelKey}`),title:n(`language.${l.labelKey}`),onClick:()=>r(l.value),className:s(u),children:l.short},l.value)})}):o.jsxs("div",{className:Fe("flex w-full min-w-0 flex-col gap-2",e),children:[o.jsx("span",{className:"px-1 text-xs font-medium text-muted-foreground",children:n("language.label")}),o.jsx("div",{className:"flex w-full min-w-0 rounded-lg border border-border bg-muted/40 p-1",role:"group","aria-label":n("language.ariaLabel"),children:hN.map(l=>{const u=i===l.value;return o.jsx("button",{type:"button","aria-pressed":u,onClick:()=>r(l.value),className:s(u),children:n(`language.${l.labelKey}`)},l.value)})})]})}function moe(){return o.jsx(YL,{variant:"default"})}const goe=["integrations","tools","reference"],XL=[{slug:"mcp",path:"/docs/mcp",titleKey:"routes.mcp.title",descriptionKey:"routes.mcp.description",group:"integrations"},{slug:"sdk",path:"/docs/sdk",titleKey:"routes.sdk.title",descriptionKey:"routes.sdk.description",group:"tools"},{slug:"cli",path:"/docs/cli",titleKey:"routes.cli.title",descriptionKey:"routes.cli.description",group:"tools"},{slug:"auth",path:"/docs/auth",titleKey:"routes.auth.title",descriptionKey:"routes.auth.description",group:"reference"},{slug:"webhooks",path:"/docs/webhooks",titleKey:"routes.webhooks.title",descriptionKey:"routes.webhooks.description",group:"reference"}],Gy="/docs";function QL(t){return XL.map(e=>({...e,title:t(e.titleKey),description:t(e.descriptionKey)}))}function ZL(t){return goe.map(e=>({id:e,label:t(`navGroups.${e}.label`),description:t(`navGroups.${e}.description`)}))}function xoe(t){return XL.find(e=>e.slug===t)}function voe(t,e){const n=xoe(t);if(n)return{...n,title:e(n.titleKey),description:e(n.descriptionKey)}}function boe(t){return Number.isFinite(t)?t>=100?t.toFixed(0):t>=10?t.toFixed(1):t.toFixed(2):"0"}function yoe(){const t=Kn(),{t:e}=Ye("settings"),{user:n,logout:i}=Ar(),[r,s]=v.useState("account"),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(null),[x,b]=v.useState(null),[w,C]=v.useState(!1),[A,E]=v.useState(!1),[k,N]=v.useState(!0),[_,R]=v.useState(!1),[T,L]=v.useState(!1),[M,U]=v.useState(!1),[D,G]=v.useState(""),[Z,Q]=v.useState(!1),[K,q]=v.useState(!1),[F,V]=v.useState(!1),[O,X]=v.useState(!1),[$,B]=v.useState(""),[H,P]=v.useState(!1),[J,he]=v.useState({oldPassword:"",newPassword:"",confirmPassword:""}),[ue,W]=v.useState({azienda:"",ruolo:"",name:"",email:""}),[fe,se]=v.useState(null),[pe,Ee]=v.useState(!1);v.useEffect(()=>{r==="subscription"&&(C(!0),As().then(b).catch(me=>console.error("Failed to load subscription:",me)).finally(()=>C(!1)))},[r]),v.useEffect(()=>{r==="account"&&(Ee(!0),N_().then(se).catch(me=>{console.error("Failed to load storage usage:",me),se(null)}).finally(()=>Ee(!1)))},[r]);const Ce=async()=>{try{const{portalUrl:me}=await Ew();window.location.href=me}catch(me){console.error("Failed to get portal URL:",me),ee.error(e("toasts.portalError"))}},Ne=()=>{t("/pricing",{state:{from:"profile",returnTo:"/settings"}})};v.useEffect(()=>{Id().then(me=>{m(me),G(me?.apiKey??""),me?.organization?.name&&localStorage.setItem("user.organizationName",me.organization.name),f(W$(me))}).catch(()=>f(!1))},[]),v.useEffect(()=>{const me=localStorage.getItem("user.firstname")||"",rt=localStorage.getItem("user.surname")||"",ve=localStorage.getItem("user.email")||"",Me=localStorage.getItem("user.role")||"",le=localStorage.getItem("user.organizationId")||"",ye=localStorage.getItem("user.organizationName")?.trim(),Ie=p?.organization?.name?.trim(),et=ye||Ie||(le?`Org ${le}`:"Puradigital");W(nt=>({...nt,azienda:et,ruolo:Me||"PM",name:`${me} ${rt}`.trim()||n?.fullName||"",email:ve||n?.email||""}))},[n,p]);const qe=()=>{i(),t("/login",{replace:!0})},pt=async()=>
797{if(J.newPassword!==J.confirmPassword){ee.error(e("toasts.passwordMismatch"));return}if(J.newPassword.length<8){ee.error(e("toasts.passwordMinLength"));return}if(J.oldPassword===J.newPassword){ee.error(e("toasts.passwordSame"));return}U(!0);try{await k_(J.oldPassword,J.newPassword),ee.success(e("toasts.passwordUpdated")),he({oldPassword:"",newPassword:"",confirmPassword:""}),E(!1)}catch(me){ee.error(me instanceof Error?me.message:e("toasts.passwordError"))}finally{U(!1)}},$e=()=>{t("/dashboard")},je=async()=>{if(!D){ee.error(e("toasts.apiKeyUnavailable"));return}try{await navigator.clipboard.writeText(D),ee.success(e("toasts.apiKeyCopied"))}catch{ee.error(e("toasts.apiKeyCopyError"))}},xt=D.trim().length>0,Ae=async me=>{if(me?.preventDefault(),!$.trim()){ee.error(e("toasts.passwordRequired"));return}P(!0);try{const rt=await T$($);G(rt.apiKey),Q(!1),B(""),q(!1),ee.success(e(xt?"toasts.apiKeyRegenerated":"toasts.apiKeyGenerated"))}catch(rt){ee.error(rt instanceof Error?rt.message:e("toasts.apiKeyRegenerateError"))}finally{P(!1)}},at=()=>o.jsxs(ln,{className:"border-border",children:[o.jsxs(hn,{className:"pb-3",children:[o.jsxs(fn,{className:"text-base flex items-center gap-2",children:[o.jsx(Up,{className:"h-4 w-4"}),e("account.apiKey.title")]}),o.jsx(uo,{children:e("account.apiKey.description")})]}),xt?o.jsxs(pn,{className:"space-y-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Qe,{type:Z?"text":"password",value:D,readOnly:!0,className:"font-mono"}),o.jsx(ie,{type:"button",variant:"outline",onClick:()=>Q(me=>!me),children:Z?o.jsx(D8,{className:"h-4 w-4"}):o.jsx(Wo,{className:"h-4 w-4"})}),o.jsx(ie,{type:"button",variant:"outline",onClick:je,children:o.jsx(Fp,{className:"h-4 w-4"})})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("account.apiKey.regenerateWarning")})]}):null,o.jsx(rl,{children:o.jsx(ie,{type:"button",variant:"outline",onClick:()=>q(!0),disabled:H,children:e(xt?"account.apiKey.regenerate":"account.apiKey.generate")})})]}),xe=async()=>{u(!0);try{const[me,...rt]=ue.name.trim().split(/\s+/),ve=rt.join(" ");await HU({firstname:me||void 0,surname:ve||void 0}),localStorage.setItem("user.firstname",me),localStorage.setItem("user.surname",ve),localStorage.setItem("user.name",ue.name.trim()),p?.email&&localStorage.setItem("user.email",p.email),ee.success(e("toasts.settingsUpdated"))}catch(me){console.error("Errore durante l'aggiornamento:",me),ee.error(e("toasts.settingsError"))}finally{u(!1)}};return o.jsxs("div",{className:"flex min-h-screen flex-col bg-background lg:h-screen lg:overflow-hidden",children:[o.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border bg-card px-4 py-3 shadow-sm sm:px-8 sm:py-5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-3",children:[o.jsxs(ie,{variant:"ghost",onClick:$e,"aria-label":e("header.backAria"),className:"h-9 shrink-0 px-2 text-foreground sm:px-3",children:[o.jsx(Es,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:e("common.back")})]}),o.jsx("span",{className:"h-5 w-px shrink-0 bg-border","aria-hidden":!0}),o.jsx(Fi,{to:"/dashboard",className:"flex min-w-0 items-center","aria-label":e("header.logoAria"),children:o.jsx(K0,{className:"h-7 w-auto sm:h-8"})})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[d&&o.jsx(ie,{variant:"outline",size:"icon",asChild:!0,className:"md:h-9 md:w-auto md:px-3",children:o.jsxs("a",{href:`${window.location.origin}/admin`,target:"_blank",rel:"noopener noreferrer","aria-label":e("common.organizationAdmin"),children:[o.jsx(Md,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden md:inline",children:e("common.organizationAdmin")})]})}),o.jsxs(ie,{variant:"outline",size:"icon",onClick:()=>X(!0),"aria-label":e("common.logout"),className:"md:h-9 md:w-auto md:px-3",children:[o.jsx(r_,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden md:inline",children:e("common.logout")})]}),o.jsx(si,{})]})]}),o.jsxs("main",{className:"flex min-h-0 flex-1 flex-col px-4 py-4 sm:px-8 sm:py-8 lg:overflow-hidden lg:px-12 xl:px-16",children:[o.jsxs("div",{className:"mb-6 shrink-0 sm:mb-8",children:[o.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground sm:text-3xl",children:e("header.title")}),o.jsx("p",{className:"text-muted-foreground",children:e("header.subtitle")})]}),o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 lg:flex-row lg:gap-10 xl:gap-12 lg:overflow-hidden",children:[o.jsxs("nav",{className:"flex shrink-0 flex-col gap-3 lg:h-full lg:w-52 lg:shrink-0 xl:w-56","aria-label":e("nav.ariaLabel"),children:[o.jsxs("div",{className:"-mx-1 flex gap-1 overflow-x-auto px-1 pb-1 lg:mx-0 lg:min-h-0 lg:flex-1 lg:flex-col lg:overflow-visible lg:px-0 lg:pb-0",children:[o.jsx("div",{className:`shrink-0 cursor-pointer rounded-lg px-3 py-2 text-sm font-medium transition-colors whitespace-nowrap lg:px-4 ${r==="account"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted"}`,onClick:()=>s("account"),role:"button",tabIndex:0,onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),s("account"))},children:e("nav.account")}
797),o.jsx("div",{className:`shrink-0 cursor-pointer rounded-lg px-3 py-2 text-sm font-medium transition-colors whitespace-nowrap lg:px-4 ${r==="subscription"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted"}`,onClick:()=>s("subscription"),role:"button",tabIndex:0,onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),s("subscription"))},children:e("nav.subscription")}),o.jsx("div",{className:`shrink-0 cursor-pointer rounded-lg px-3 py-2 text-sm font-medium transition-colors whitespace-nowrap lg:px-4 ${r==="help"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted"}`,onClick:()=>s("help"),role:"button",tabIndex:0,onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),s("help"))},children:e("nav.helpIntegrations")})]}),o.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3 border-t border-border pt-3 lg:mt-auto lg:border-t-0 lg:pt-0",children:[o.jsx(poe,{}),o.jsx(moe,{}),o.jsx(ie,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start gap-2",children:o.jsxs(Fi,{to:Gy,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(n_,{className:"h-4 w-4"}),e("common.forDevs")]})})]})]}),o.jsxs("div",{className:"min-w-0 flex-1 rounded-lg border border-border bg-background p-4 sm:p-6 lg:min-h-0 lg:p-8 lg:overflow-y-auto xl:p-10",children:[r==="account"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:e("account.title")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("account.subtitle")})]}),o.jsxs("div",{className:"space-y-6 lg:space-y-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(yw,{className:"h-5 w-5 text-foreground"}),o.jsx("h3",{className:"text-lg font-semibold text-foreground",children:e("account.storage.title")})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("account.storage.description")}),pe?o.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:e("account.storage.loading")}):fe?fe.maxStorageBytes>0?o.jsx(hoe,{usage:fe,formatGb:boe}):o.jsx("p",{className:"text-sm text-muted-foreground",children:e("account.storage.noLimit")}):o.jsx("p",{className:"text-sm text-muted-foreground",children:e("account.storage.loadError")})]}),o.jsxs("div",{className:"border-t border-border pt-6 lg:pt-8",children:[o.jsx("h3",{className:"text-lg font-semibold text-foreground mb-6",children:e("account.profile.title")}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"azienda",className:"text-sm font-medium text-foreground",children:e("account.profile.company")}),o.jsx(Qe,{id:"azienda",type:"text",value:ue.azienda,onChange:me=>W({...ue,azienda:me.target.value}),className:"bg-background border-border",disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"ruolo",className:"text-sm font-medium text-foreground",children:e("account.profile.role")}),o.jsx(Qe,{id:"ruolo",type:"text",value:ue.ruolo,onChange:me=>W({...ue,ruolo:me.target.value}),className:"bg-background border-border",disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"name",className:"text-sm font-medium text-foreground",children:e("account.profile.name")}),o.jsx(Qe,{id:"name",type:"text",value:ue.name,onChange:me=>W({...ue,name:me.target.value}),className:"bg-background border-border",disabled:l})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"email",className:"text-sm font-medium text-foreground",children:e("account.profile.email")}),o.jsx(Qe,{id:"email",type:"email",value:ue.email,className:"bg-background border-border",disabled:!0,readOnly:!0}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("account.profile.emailHint")})]}),o.jsx("div",{className:"pt-4",children:o.jsx(ie,{type:"button",className:"w-full",disabled:l,onClick:()=>void xe(),children:e(l?"account.profile.saving":"account.profile.save")})}),at(),o.jsx(roe,{}),o.jsxs("div",{className:"border border-border rounded-lg mt-8 overflow-hidden",children:[o.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors",onClick:()=>E(me=>!me),children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:e("account.changePassword.title")}),A?o.jsx(xs,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 text-muted-foreground"})]}),A&&o.jsxs("div",{className:"p-4 border-t border-border bg-background",children:[o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("account.changePassword.description")}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"old-password",children:e("account.changePassword.current")}),o.jsx(Qe,{id:"old-password",type:"password",value:J.oldPassword,onChange:me=>he({...J,oldPassword:me.target.value}),placeholder:"••••••••••",className:"bg-background border-border",required:!0,autoComplete:"current-password"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"new-password",children:e("account.changePassword.new")}),o.jsx(Qe,{id:"new-password",type:"password",value:J.newPassword,onChange:me=>he({...J,newPassword:me.target.value}),placeholder:e("account.changePassword.newPlaceholder"),className:"bg-background border-border",required:!0,minLength:8,autoComplete:"new-password"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"confirm-password",children:e("account.changePassword.confirm")}),o.jsx(Qe,{id:"confirm-password",type:"password",value:J.confirmPassword,onChange:me=>he({...J,confirmPassword:me.target.value}),placeholder:e("account.changePassword.confirmPlaceholder"),className:"bg-background border-border",required:!0,minLength:8,autoComplete:"new-password"})]}),o.jsx(ie,{type:"button",variant:"secondary",disabled:M,onClick:()=>void pt(),children:e(M?"account.changePassword.submitting":"account.changePassword.submit")})]})]})]})]})]})]})]}),r==="subscription"&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:e("subscription.title")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("subscription.subtitle")})]}),w?o.jsx("p",{className:"text-muted-foreground animate-pulse",children:e("subscription.loading")}):x?o.jsxs("div",{className:"space-y-6 lg:space-y-8",children:[x.canceledAt&&o.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm",children:[o.jsx("p",{className:"font-medium text-foreground",children:e("subscription.autoRenewOff")}),o.jsx("p",{className:"text-muted-foreground mt-1",children:x.endsAt?e("subscription.autoRenewOffUntilDate",{date:Kp(x.endsAt)}):e("subscription.autoRenewOffUntilPeriod")})]}),o.jsxs(ln,{className:"border-primary/20 bg-primary/5",children:[o.jsx(hn,{className:"pb-3",children:o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("div",{children:[o.jsxs(fn,{className:"text-2xl font-bold flex items-center gap-2",children:[e("subscription.plan",{name:x.plan.name}),o.jsx(Ci,{variant:"default",className:"bg-green-500 hover:bg-green-600",children:x.status})]}),o.jsx(uo,{className:"text-base mt-1",children:x.plan.description})]}),o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-2xl font-bold",children:["€",x.plan.price||x.plan.pricePerSeat]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:x.subscriberType==="ORGANIZATION"?e("subscription.perSeatMonth"):e("subscription.perMonth")})]})]})}),o.jsx(pn,{children:o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-muted-foreground",children:e("subscription.subscriberType")}),o.jsx("p",{className:"font-medium",children:x.subscriberType==="ORGANIZATION"?e("subscription.organization"):e("subscription.personal")})]}),x.subscriberType==="ORGANIZATION"&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-muted-foreground",children:e("subscription.seats")}),o.jsx("p",{className:"font-medium",children:x.seatCount})]}),x.endsAt&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-muted-foreground",children:e("subscription.renewal")}),o.jsx("p",{className:"font-medium",children:Kp(x.endsAt)})]})]})}),o.jsxs(rl,{className:"pt-2 flex flex-col gap-2",children:[(x.subscriberType==="EMPLOYEE"||d)&&o.jsxs(ie,{onClick:Ce,variant:"outline",className:"w-full flex items-center justify-center gap-2",children:[o.jsx($p,{className:"w-4 h-4"}),e("subscription.manageBilling"),o.jsx(nl,{className:"w-3 h-3 ml-1"})]}),!x.canceledAt&&(x.subscriberType==="EMPLOYEE"||d)&&o.jsx(ie,{variant:"ghost",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>V(!0),children:e("subscription.cancelAutoRenew")})]})]}),o.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg border border-border",children:[o.jsx("h4",{className:"font-semibold mb-2 text-foreground",children:e("subscription.upgradeTitle")}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("subscription.upgradeDescription")}),o.jsx(ie,{onClick:Ne,variant:"secondary",children:e("subscription.viewPlans")})]})]}):o.jsxs("div",{className:"text-center py-10 space-y-4 border border-dashed border-border rounded-xl",children:[o.jsx("div",{className:"mx-auto w-12 h-12 bg-muted rounded-full flex items-center justify-center",children:o.jsx($p,{className:"text-muted-foreground"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium text-foreground",children:e("subscription.emptyTitle")}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto mt-1",children:e("subscription.emptyDescription")})]}),o.jsx(ie,{onClick:Ne,className:"mt-2",children:e("subscription.choosePlan")})]})]}),r==="help"&&o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:e("help.title")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("help.subtitle")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[o.jsxs("button",{type:"button",className:"flex w-full items-center justify-between bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50",onClick:()=>N(me=>!me),"aria-expanded":k,children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:e("help.singleConnector")}
797),k?o.jsx(xs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}),k?o.jsxs("div",{className:"space-y-4 border-t border-border bg-background p-4",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:e("help.singleConnectorHint")}),o.jsx(cN,{scope:"collection"})]}):null]}),o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[o.jsxs("button",{type:"button",className:"flex w-full items-center justify-between bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50",onClick:()=>R(me=>!me),"aria-expanded":_,children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:e("help.allConnectors")}),_?o.jsx(xs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}),_?o.jsxs("div",{className:"space-y-4 border-t border-border bg-background p-4",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:e("help.allConnectorsHint")}),o.jsx(cN,{scope:"user"})]}):null]})]}),o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[o.jsxs("button",{type:"button",className:"flex w-full items-center justify-between bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50",onClick:()=>L(me=>!me),children:[o.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[o.jsx(Up,{className:"h-4 w-4"}),e("account.apiKey.title")]}),T?o.jsx(xs,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(ro,{className:"h-4 w-4 text-muted-foreground"})]}),T?o.jsx("div",{className:"border-t border-border bg-background p-4",children:at()}):null]}),o.jsxs("section",{className:"space-y-4 border-t border-border pt-6",children:[o.jsx(loe,{}),o.jsxs(ie,{type:"button",className:"gap-2",onClick:()=>t("/support"),children:[o.jsx(i_,{className:"h-4 w-4"}),e("help.contactSupport")]})]})]})]})]})]}),o.jsx(yn,{open:O,onOpenChange:X,children:o.jsxs(wn,{children:[o.jsxs(An,{children:[o.jsx(Sn,{children:e("dialogs.logout.title")}),o.jsx(In,{children:e("dialogs.logout.description")})]}),o.jsxs(qn,{children:[o.jsx(ie,{variant:"outline",onClick:()=>X(!1),children:e("common.no")}),o.jsx(ie,{variant:"destructive",onClick:qe,children:e("common.yes")})]})]})}),x&&o.jsx(coe,{open:F,onOpenChange:V,subscription:x,onCanceled:b}),o.jsx(yn,{open:K,onOpenChange:me=>{H||(q(me),me||B(""))},children:o.jsxs(wn,{className:"sm:max-w-lg",children:[o.jsxs(An,{children:[o.jsx(Sn,{children:e(xt?"dialogs.regenerateApiKey.titleRegenerate":"dialogs.regenerateApiKey.titleGenerate")}),o.jsx(In,{className:"space-y-2",children:xt?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:e("dialogs.regenerateApiKey.descRegenerate1")}),o.jsx("span",{className:"block",children:e("dialogs.regenerateApiKey.descRegenerate2")})]}):o.jsx("span",{className:"block",children:e("dialogs.regenerateApiKey.descGenerate")})})]}),o.jsxs("form",{onSubmit:Ae,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"confirm-regenerate-password",children:e("dialogs.regenerateApiKey.passwordLabel")}),o.jsx(Qe,{id:"confirm-regenerate-password",type:"password",value:$,onChange:me=>B(me.target.value),placeholder:e("dialogs.regenerateApiKey.passwordPlaceholder"),autoComplete:"current-password",required:!0})]}),o.jsxs(qn,{children:[o.jsx(ie,{type:"button",variant:"outline",onClick:()=>q(!1),disabled:H,children:e("common.cancel")}),o.jsx(ie,{type:"submit",disabled:H,children:e(H?xt?"dialogs.regenerateApiKey.regenerating":"dialogs.regenerateApiKey.generating":xt?"dialogs.regenerateApiKey.confirmRegenerate":"dialogs.regenerateApiKey.confirmGenerate")})]})]})]})})]})}const _b="[email protected]",woe=["bug","integration","indexing","account","billing","other"];function Soe(){const{t}=Ye("support"),e=Kn(),[n,i]=v.useState(!1),[r,s]=v.useState({issueType:"",subject:"",description:"",steps:""}),l=localStorage.getItem("user.email")??"",u=[localStorage.getItem("user.firstname"),localStorage.getItem("user.surname")].filter(
797Boolean).join(" ").trim(),d=async f=>{if(f.preventDefault(),!r.issueType||!r.subject.trim()||!r.description.trim()){ee.error(t("toast.requiredFields"));return}i(!0);const p=t(`form.issueType.options.${r.issueType}`),m=[t("email.type",{type:p}),u?t("email.user",{name:u}):null,l?t("email.email",{email:l}):null,"",t("email.descriptionHeader"),r.description.trim(),r.steps.trim()?`
798${t("email.stepsHeader")}
799${r.steps.trim()}`:null,"",t("email.footer",{timestamp:new Date().toISOString()})].filter(Boolean).join(`
800`),x=`mailto:${encodeURIComponent(_b)}?subject=${encodeURIComponent(`${t("email.subjectPrefix")} ${r.subject.trim()}`)}&body=${encodeURIComponent(m)}`;try{window.location.href=x,ee.success(t("toast.mailClientOpened")),s({issueType:"",subject:"",description:"",steps:""})}catch{ee.error(t("toast.mailClientError",{email:_b}))}finally{i(!1)}};return o.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[o.jsxs("header",{className:"flex items-center justify-between border-b border-border bg-background px-4 py-4 sm:px-8",children:[o.jsxs(ie,{type:"button",variant:"ghost",className:"gap-2",onClick:()=>e(-1),children:[o.jsx(Es,{className:"h-4 w-4"}),t("header.back")]}),o.jsx(si,{})]}),o.jsxs("main",{className:"mx-auto w-full max-w-2xl flex-1 px-4 py-8 sm:px-6",children:[o.jsxs("div",{className:"mb-8 flex items-start gap-3",children:[o.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(i_,{className:"h-6 w-6 text-primary"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-foreground",children:t("header.title")}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:o.jsx(Em,{i18nKey:"header.description",ns:"support",components:{docsLink:o.jsx(Fi,{to:"/docs",className:"font-medium text-primary underline-offset-4 hover:underline"})}})})]})]}),o.jsxs(ln,{children:[o.jsxs(hn,{children:[o.jsx(fn,{className:"text-base",children:t("form.title")}),o.jsx(uo,{children:t("form.intro",{emailSuffix:l?t("form.emailSuffix",{email:l}):""})})]}),o.jsx(pn,{children:o.jsxs("form",{onSubmit:d,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"issue-type",children:t("form.issueType.label")}),o.jsxs(Br,{value:r.issueType,onValueChange:f=>s(p=>({...p,issueType:f})),children:[o.jsx(Gr,{id:"issue-type",children:o.jsx(Hr,{placeholder:t("form.issueType.placeholder")})}),o.jsx(Vr,{children:woe.map(f=>o.jsx(di,{value:f,children:t(`form.issueType.options.${f}`)},f))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"subject",children:t("form.subject.label")}),o.jsx(Qe,{id:"subject",value:r.subject,onChange:f=>s(p=>({...p,subject:f.target.value})),placeholder:t("form.subject.placeholder"),maxLength:200,required:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"description",children:t("form.description.label")}),o.jsx(Mc,{id:"description",value:r.description,onChange:f=>s(p=>({...p,description:f.target.value})),placeholder:t("form.description.placeholder"),rows:5,required:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"steps",children:t("form.steps.label")}),o.jsx(Mc,{id:"steps",value:r.steps,onChange:f=>s(p=>({...p,steps:f.target.value})),placeholder:t("form.steps.placeholder"),rows:3})]}),o.jsxs(ie,{type:"submit",className:"w-full gap-2",disabled:n,children:[o.jsx(g7,{className:"h-4 w-4"}),t(n?"form.submit.loading":"form.submit.default")]}),o.jsx("p",{className:"text-center text-xs text-muted-foreground",children:t("form.footer",{email:_b})})]})})]})]})]})}function fN({title:t,highlight:e}){const n=t.toLowerCase().indexOf(e.toLowerCase());return n===-1?t:o.jsxs(o.Fragment,{children:[t.slice(0,n),o.jsx("span",{className:"text-link",children:t.slice(n,n+e.length)}),t.slice(n+e.length)]})}function Coe(){const{t}=Ye(["auth","common"]),e=Kn(),[n,i]=v.useState(""),[r,s]=v.useState(!1),[l,u]=v.useState(!1),d=m=>{i(m.target.value)},f=async m=>{if(m.preventDefault(),!n){ee.error(t("forgotPassword.toast.emailRequired"));return}s(!0);const x=_$(n).then(()=>{u(!0)});ee.promise(x,{loading:t("forgotPassword.toast.sending"),success:o.jsx("b",{children:t("forgotPassword.toast.success")}),error:b=>{let w=t("forgotPassword.toast.error");return b&&typeof b=="object"&&"message"in b&&typeof b.message=="string"&&(w=b.message),console.error("Reset password failed:",b),o.jsx("b",{children:w})}}).finally(()=>{s(!1)})},p=n!=="";return l?o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden",children:[o.jsx("div",{className:"absolute top-6 right-6 z-20",children:o.jsx(si,{})}),o.jsx("div",{className:"absolute top-0 right-0 w-[1000px] h-[600px] translate-x-1/4 -translate-y-1/4 rounded-full pointer-events-none"}),o.jsxs(ln,{className:"w-[560px] min-h-[580px] relative z-10",children:[o.jsxs(hn,{className:"text-center pb-6",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-[1.5625rem] font-semibold text-foreground",children:o.jsx(fN,{title:t("forgotPassword.success.title"),highlight:t("forgotPassword.success.titleHighlight")})})]}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-center text-[1.09375rem] text-muted-foreground mb-[1.875rem] leading-relaxed",children:t("forgotPassword.success.description")}),o.jsx(ie,{onClick:()=>
800e("/login"),className:"w-full",children:t("forgotPassword.success.backToLogin")}),o.jsxs("p",{className:"mt-[1.875rem] text-[1.09375rem] text-muted-foreground text-center",children:[t("forgotPassword.success.notReceived")," ",o.jsx("button",{type:"button",onClick:()=>u(!1),className:"text-link font-semibold bg-transparent border-none cursor-pointer p-0 text-[1.09375rem] no-underline hover:underline",children:t("forgotPassword.success.retry")})]})]})]})]}):o.jsxs("div",{className:"relative flex justify-center items-center min-h-screen bg-background px-5 overflow-hidden",children:[o.jsx("div",{className:"absolute top-6 right-6 z-20",children:o.jsx(si,{})}),o.jsx("div",{className:"absolute top-0 right-0 w-[1000px] h-[600px] translate-x-1/4 -translate-y-1/4 rounded-full pointer-events-none"}),o.jsxs(ln,{className:"w-[560px] min-h-[580px] relative z-10",children:[o.jsxs(hn,{className:"text-center pb-6",children:[o.jsx("div",{className:"mx-auto mb-2",children:o.jsx("img",{src:"/logo.svg",alt:t("common:logo.alt"),className:"w-16 h-auto object-contain mx-auto"})}),o.jsx(fn,{className:"text-[1.5625rem] font-semibold text-foreground",children:o.jsx(fN,{title:t("forgotPassword.title"),highlight:t("forgotPassword.titleHighlight")})})]}),o.jsxs(pn,{children:[o.jsx("p",{className:"text-center text-[1.09375rem] text-muted-foreground mb-[1.875rem] leading-relaxed",children:t("forgotPassword.description")}),o.jsxs("form",{onSubmit:f,className:"flex flex-col gap-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Xe,{htmlFor:"email",className:"block text-left text-[1.09375rem] font-medium text-foreground",children:t("forgotPassword.emailLabel")}),o.jsxs("div",{className:"flex items-center border border-border rounded-[0.625rem] px-[0.78125rem] py-[0.78125rem] bg-background focus-within:border-[#460B5D] focus-within:outline focus-within:outline-2 focus-within:outline-blue-100",children:[o.jsx("span",{className:"text-xl text-muted-foreground flex items-center flex-shrink-0",children:o.jsx(_m,{})}),o.jsx(Qe,{id:"email",type:"email",name:"email",placeholder:t("forgotPassword.emailPlaceholder"),value:n,onChange:d,className:"border-none outline-none flex-1 text-[1.09375rem] pl-[0.46875rem] bg-transparent text-foreground shadow-none placeholder:text-muted-foreground",autoCapitalize:"none"})]})]}),o.jsx(ie,{type:"submit",disabled:!p||r,className:"w-full",children:t(r?"forgotPassword.submit.loading":"forgotPassword.submit.default")})]}),o.jsxs("p",{className:"mt-[1.875rem] text-[1.09375rem] text-muted-foreground text-center",children:[t("forgotPassword.rememberPassword")," ",o.jsx(bi,{to:"/login",className:"text-link no-underline hover:underline",children:t("forgotPassword.loginLink")})]})]})]})]})}function JL({type:t}){const{locale:e,toggleLocale:n}=WL(),i=iU(e,t);return o.jsx("div",{className:"min-h-screen bg-background px-4 py-8",children:o.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[o.jsxs("div",{className:"flex justify-end items-center gap-2 text-sm text-muted-foreground",children:[o.jsxs("span",{children:[i.languageLabel,":"]}),o.jsx(ie,{type:"button",variant:"ghost",size:"sm",onClick:n,children:i.switchLanguage})]}),o.jsxs(ln,{children:[o.jsxs(hn,{children:[o.jsx(fn,{className:"text-2xl",children:i.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:i.lastUpdated})]}),o.jsxs(pn,{className:"space-y-6 max-w-none",children:[o.jsx("p",{className:"text-muted-foreground",children:i.intro}),i.sections.map(r=>o.jsxs("section",{className:"space-y-2",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:r.title}),o.jsx("p",{className:"text-muted-foreground whitespace-pre-line",children:r.body})]},r.id))]})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(ie,{variant:"outline",asChild:!0,children:o.jsx(Fi,{to:"/register",children:i.backToRegister})})})]})})}function Eoe(){return o.jsx(JL,{type:"terms"})}function Aoe(){return o.jsx(JL,{type:"privacy"})}const koe={mcp:ww,sdk:vw,cli:l_,auth:Up,webhooks:o_};function Noe(){const{t}=Ye("docs"),e=ZL(t),n=QL(t);return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx("div",{className:"pointer-events-none fixed inset-0 -z-10",style:{background:"radial-gradient(ellipse 80% 50% at 50% -10%, oklch(0.75 0.06 285 / 0.08), transparent)"}}),o.jsx("header",{className:"sticky top-0 z-30 border-b border-border/80 bg-background/90 backdrop-blur-md",children:o.jsxs("div",{className:"mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3 sm:px-6",children:[o.jsxs(Fi,{to:Gy,className:"flex items-center gap-3",children:[o.jsx("img",{src:"/logo.svg",alt:"ArchivEye",className:"h-8 w-8"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-foreground leading-tight",children:t("layout.title")}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("layout.subtitle")})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(YL,{variant:"compact"}),o.jsx(ie,{variant:"outline",size:"sm",asChild:!0,children:o.jsx(Fi,{to:"/login",children:t("layout.login")})})]})]})}),o.jsxs("div",{className:"mx-auto grid max-w-7xl gap-8 px-4 py-8 sm:px-6 lg:grid-cols-[240px_minmax(0,1fr)]",children:[o.jsx("aside",{className:"lg:sticky lg:top-20 lg:self-start",children:o.jsxs("nav",{className:"space-y-6","aria-label":t("layout.navAria"),children:[o.jsx("div",{children:o.jsxs(bi,{to:Gy,end:!0,className:({isActive:i})=>Fe("flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors",i?"bg-primary/8 text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[o.jsx(J6,{className:"h-4 w-4 shrink-0 opacity-70"}),t("layout.overview")]})}),e.map(i=>{const r=n.filter(s=>s.group===i.id);return o.jsxs("div",{children:[o.jsx("p",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i.label}),o.jsx("div",{className:"space-y-0.5",children:r.map(s=>{const l=koe[s.slug];return o.jsxs(bi,{to:s.path,className:({isActive:u})=>Fe("flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors",u?"bg-primary/8 text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[l?o.jsx(l,{className:"h-4 w-4 shrink-0 opacity-70"}):null,s.title]},s.slug)})})]},i.id)})]})}),o.jsx("main",{className:"min-w-0 pb-16",children:o.jsx(yz,{})})]})]})}const joe={mcp:ww,sdk:vw,cli:l_,auth:Up,webhooks:o_};function _oe({route:t,readGuideLabel:e}){const n=joe[t.slug]??vw;return o.jsxs(Fi,{to:t.path,className:"group relative flex flex-col rounded-xl border border-border bg-card/80 p-5 shadow-sm transition-all hover:border-primary/30 hover:shadow-md",children:[o.jsx("div",{className:"mb-4 flex h-10 w-10 items-center justify-center rounded-lg bg-primary/8 text-primary transition-colors group-hover:bg-primary/12",children:o.jsx(n,{className:"h-5 w-5"})}),o.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),o.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:t.description}),o.jsxs("span",{className:"mt-4 flex items-center gap-1 text-sm font-medium text-primary",children:[e,o.jsx(W6,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})]})}function Tb({step:t,title:e,children:n}){return o.jsxs("div",{className:"relative flex gap-4",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-muted/50 font-mono text-xs font-semibold text-muted-foreground",children:t}),o.jsxs("div",{className:"min-w-0 pb-6",children:[o.jsx("p",{className:"font-medium text-foreground",children:e}),o.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:n})]})]})}function Toe(){const{t}=Ye("docs"),e=ZL(t),n=QL(t),i=e.map(r=>({...r,routes:n.filter(s=>s.group===r.id)}));return o.jsxs("div",{className:"space-y-12",children:[o.jsxs("header",{className:"relative overflow-hidden rounded-2xl border border-border bg-gradient-to-br from-card via-card to-primary/5 px-6 py-10 sm:px-10 sm:py-12",children:[o.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.35]",style:{backgroundImage:"radial-gradient(circle at 20% 20%, oklch(0.75 0.08 285 / 0.15), transparent 45%), radial-gradient(circle at 80% 0%, oklch(0.85 0.02 0 / 0.4), transparent 40%)"}}),o.jsxs("div",{className:"relative max-w-2xl",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest text-primary/80",children:t("overview.badge")}),o.jsx("h1",{className:"mt-3 text-3xl font-semibold tracking-tight text-foreground sm:text-4xl",children:t("overview.title")}),o.jsx("p",{className:"mt-4 text-base leading-relaxed text-muted-foreground sm:text-lg",children:t("overview.subtitle")}),o.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[o.jsx(ie,{asChild:!0,children:o.jsx(Fi,{to:"/docs/mcp",children:t("overview.startMcp")})}),o.jsx(ie,{variant:"outline",asChild:!0,children:o.jsx(Fi,{to:"/docs/auth",children:t("overview.auth")})})]})]})]}),o.jsxs("section",{children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t("overview.howItWorks")}),o.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:t("overview.howItWorksDesc")}),o.jsxs("div",{className:"mt-6 rounded-xl border border-border bg-muted/20 p-6",children:[o.jsx(Tb,{step:"01",title:t("overview.step1Title"),children:t("overview.step1Desc")}),o.jsx(Tb,{step:"02",title:t("overview.step2Title"),children:t("overview.step2Desc")}),o.jsx(Tb,{step:"03",title:t("overview.step3Title"),children:t("overview.step3Desc")})]})]}),i.map(r=>o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:r.label}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:r.description})]}),o.jsx("div",{className:Fe("grid gap-4",r.routes.length>=3?"sm:grid-cols-2 lg:grid-cols-3":"sm:grid-cols-2"),children:r.routes.map(s=>o.jsx(_oe,{route:s,readGuideLabel:t("overview.readGuide")},s.slug))})]},r.id)),o.jsxs("section",{className:"rounded-xl border border-dashed border-border bg-muted/15 px-6 py-8",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:t("overview.baseUrlTitle")}),o.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-border bg-card/60 p-4",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t("overview.restApi")}),o.jsx("code",{className:"mt-2 block font-mono text-sm text-foreground",children:"https://data.archiveye.ai/api/v1"})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-card/60 p-4",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t("overview.mcpStreamable")}),o.jsx("code",{className:"mt-2 block font-mono text-sm text-foreground",children:"https://mcp.archiveye.ai"}),o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t("overview.mcpOAuthHint")})]})]})]})]})}function Roe({headings:t,className:e}){const{t:n}=Ye("docs");return t.length===0?null:o.jsxs("nav",{className:Fe("space-y-2",e),"aria-label":n("toc.ariaLabel"),children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:n("toc.title")}),o.jsx("ul",{className:"space-y-1.5 text-sm",children:t.map(i=>o.jsx("li",{children:o.jsx("a",{href:`#${i.id}`,className:Fe("block py-0.5 text-muted-foreground transition-colors hover:text-foreground",i.level===3&&"pl-3 text-[13px]"),children:i.text})},i.id))})]})}const Poe=`# Authentication
801
802ArchivEye Developer Platform APIs accept **employee API keys** (\`aek-…\`) or **collection API keys** (\`col_…\`) for machine-to-machine access. Human users continue to sign in via the web app with Keycloak; integrations use API keys.
803
804## API keys
805
806| Property | Employee key (\`aek-\`) | Collection key (\`col_\`) |
807| --- | --- | --- |
808| Prefix | \`aek-\` | \`col_\` |
809| Where to create | **Settings → API key** | Collection connector settings |
810| Scope | All collections and documents | Single collection only |
811| Rotation | Regenerate from Settings | Regenerate from collection settings |
812
813> **Warning:** Treat API keys like passwords. Do not commit them to git, paste them in public tickets, or embed them in client-side web apps.
814
815## REST authentication
816
817Send the key as a Bearer token on every BFF request:
818
819\`\`\`http
820GET /api/v1/developer/me HTTP/1.1
821Host: data.archiveye.ai
822Authorization: Bearer aek-your-key-here
823\`\`\`
824
825The same header works with collection keys: \`Authorization: Bearer col_…\`.
826
827Base URL: \`https://data.archiveye.ai/api/v1\`
828
829Verify credentials:
830
831\`\`\`bash
832curl -s https://data.archiveye.ai/api/v1/developer/me \\
833  -H "Authorization: Bearer $ARCHIVEYE_API_KEY"
834\`\`\`
835
836Response includes \`authMethod\` (\`employee-api-key\` or \`collection-api-key\`), optional \`collectionId\`, and subscription status.
837
838### SDK
839
840\`\`\`ts
841const archiveye = new Archiveye({
842  apiKey: process.env.ARCHIVEYE_API_KEY!,
843  // optional: baseUrl (BFF) and mcpBaseUrl (MCP host) for local/staging
844});
845await archiveye.http.whoami();
846\`\`\`
847
848### CLI
849
850\`\`\`bash
851archiveye config set --api-key aek-your-key-here
852archiveye config set --api-key col_your-collection-key
853archiveye whoami
854\`\`\`
855
856Or export \`ARCHIVEYE_API_KEY\` — the CLI reads it when no config file exists (works with both \`aek-\` and \`col_\` keys).
857
858## MCP authentication
859
860**OAuth (Claude connector, ChatGPT plugin, spec-compliant clients)** — resource URL, no API key in the path:
861
862\`\`\`
863https://mcp.archiveye.ai/user/mcp
864\`\`\`
865
866Discovery: \`/.well-known/oauth-protected-resource/user/mcp\` and \`/.well-known/oauth-authorization-server\` on the same host. See [MCP Integration](/docs/mcp).
867
868**Account scope (API key)** — embed the key in the URL:
869
870\`\`\`
871https://mcp.archiveye.ai/user/{api_key}/mcp
872\`\`\`
873
874**Collection scope** — use the connector MCP URL (key is the collection API key):
875
876\`\`\`
877https://mcp.archiveye.ai/collection/{collection_api_key}/mcp
878\`\`\`
879
880Some MCP clients also accept \`Authorization: Bearer aek-…\` or \`Bearer col_…\` on the HTTP transport.
881
882See [MCP Integration](/docs/mcp) for IDE examples.
883
884## Subscription and access
885
886Developer Platform endpoints require an **active subscription** on the organization. Without it:
887
888- REST calls return \`403\` with a subscription error
889- MCP connections may authenticate but tools fail on data access
890
891JWT sessions from the web app and API keys share the same employee record; subscription is checked per request.
892
893## Scopes: account vs collection
894
895| Pattern | Access |
896| --- | --- |
897| Employee API key (\`aek-\`) + REST | Full developer API: collections, documents, ingest, webhooks |
898| Employee API key + \`/user/{key}/mcp\` | All collections for that employee |
899| Collection API key (\`col_\`) + REST | Get/update **one** collection, membership changes, ingest, webhooks |
900| Collection API key + \`/collection/{key}/mcp\` | Search and document tools on that collection only |
901
902**Allowed with \`col_\` (REST):** \`GET/PATCH /collections/:id\`, add/remove/replace documents, ingest, webhooks, \`GET /developer/me\`.
903
904**Forbidden with \`col_\` (403):** list/create/delete collections, regenerate collection key, global \`/documents/*\`, ingest or membership on another collection, MCP \`list_collections\`.
905
906## Environment variables
907
908| Variable | Used by | Description |
909| --- | --- | --- |
910| \`ARCHIVEYE_API_KEY\` | SDK, CLI | Employee (\`aek-\`) or collection (\`col_\`) API key |
911| \`ARCHIVEYE_BASE_URL\` | CLI (optional) | Override BFF base URL |
912
913## Security checklist
914
915- Store keys in secret managers (AWS SSM, Vault, GitHub Actions secrets).
916- Use separate keys per environment (prod vs staging).
917- Rotate after team member offboarding.
918- Prefer webhook signing secrets per endpoint (see [Webhooks](/docs/webhooks)).
919
920## Related
921
922- [MCP Integration](/docs/mcp)
923- [TypeScript SDK](/docs/sdk)
924- [Webhooks](/docs/webhooks)
925`,Doe=`# MCP Integration
926
927Connect AI agents, IDE assistants, and automation tools to your ArchivEye knowledge bases via the [Model Context Protocol](https://modelcontextprotocol.io).
928
929You can connect in three ways:
930
9311. **Hosted clients** — official **Claude connector** and **ChatGPT plugin** (OAuth, no API key in the URL).
9322. **MCP OAuth** — any client that implements MCP authorization (discovery, P
932KCE, DCR or CIMD).
9333. **API key in the URL / Bearer** — Cursor, Claude Desktop, custom agents (\`aek-…\` or \`col_…\`).
934
935> **Tip:** For IDE configs and scripts, start with the account-scoped API-key endpoint. It exposes every collection your key can access. Use a collection-scoped URL only when you want to hard-limit an integration to a single connector.
936
937## Hosted: Claude connector and ChatGPT plugin
938
939ArchivEye is listed as a remote MCP server for **Claude** (connector) and **ChatGPT** (plugin / connected app). Both use **OAuth**: you sign in with your ArchivEye account; tools then run on your collections.
940
941| Client | How to connect | MCP URL |
942| --- | --- | --- |
943| **Claude** (claude.ai connector) | Add ArchivEye from Claude connectors / custom MCP | \`https://mcp.archiveye.ai/user/mcp\` |
944| **ChatGPT** (plugin / GPT / Connected Apps) | Developer Mode or Connected Apps → add MCP server | \`https://mcp.archiveye.ai/user/mcp\` |
945
946The resource URL must match **exactly** \`https://mcp.archiveye.ai/user/mcp\` (including path). Claude and ChatGPT resolve the client via **CIMD** (Client ID Metadata Document): the \`client_id\` is an HTTPS URL (for example \`https://claude.ai/oauth/mcp-oauth-client-metadata\`). You do not register a client id by hand.
947
948Requires an **active ArchivEye subscription**. After connecting, use the same agent workflow as account-scoped MCP (\`list_collections\` → search → documents).
949
950## MCP OAuth (for your own clients)
951
952Any OAuth-capable MCP client can use the same gateway. Implement the MCP authorization flow, not a custom login:
953
954| Spec | Role |
955| --- | --- |
956| [MCP Authorization](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization) (2025-03-26) | Overall flow: protected resource, 401 + \`WWW-Authenticate\`, then OAuth |
957| [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728) | OAuth 2.0 Protected Resource Metadata |
958| [RFC 8414](https://www.rfc-editor.org/rfc/rfc8414) | Authorization Server Metadata |
959| [RFC 7591](https://www.rfc-editor.org/rfc/rfc7591) | Dynamic Client Registration (DCR), when the client is not CIMD |
960| [CIMD](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document) | Client ID Metadata Document — Claude and ChatGPT |
961| [RFC 7636](https://www.rfc-editor.org/rfc/rfc7636) | PKCE \`S256\` (required) |
962| OAuth 2.1 Authorization Code | User login and consent on ArchivEye |
963
964### Discovery
965
966\`\`\`http
967GET https://mcp.archiveye.ai/.well-known/oauth-protected-resource/user/mcp
968GET https://mcp.archiveye.ai/.well-known/oauth-authorization-server
969\`\`\`
970
971Protected-resource JSON includes \`resource\` (must equal the MCP URL you configured), \`authorization_servers\`, \`bearer_methods_supported: ["header"]\`, and \`scopes_supported\`.
972
973If \`/user/mcp\` is called without a valid Bearer token, the server returns **401** with \`WWW-Authenticate\` pointing at the resource metadata URL.
974
975### Typical sequence
976
9771. Client calls \`POST https://mcp.archiveye.ai/user/mcp\` (Streamable HTTP).
9782. On 401, fetch protected-resource metadata, then authorization-server metadata.
9793. Register the client (DCR) **or** present a CIMD \`client_id\` URL.
9804. Authorization Code + PKCE \`S256\`; user consents on the ArchivEye consent page.
9815. Exchange the code for an access token; send \`Authorization: Bearer <token>\` on MCP requests.
982
983Audience / scopes follow discovery (\`scopes_supported\`). Do not hard-code Keycloak URLs in the client: always follow \`.well-known\`.
984
985Cursor with OAuth (no API key in the URL):
986
987\`\`\`json
988{
989  "mcpServers": {
990    "archiveye": {
991      "url": "https://mcp.archiveye.ai/user/mcp"
992    }
993  }
994}
995\`\`\`
996
997Cursor discovers OAuth from metadata. Desktop redirect: \`http://localhost:8787/callback\`. Cursor Agents/Web: \`https://www.cursor.com/agents/mcp/oauth/callback\`.
998
999## API-key endpoints
1000
1001
1002| Scope | URL pattern | When to use |
1003| --- | --- | --- |
1004| Account (all collections) | \`https://mcp.archiveye.ai/user/{api_key}/mcp\` | Cursor, Claude Desktop, multi-collection agents |
1005| Single collection | \`https://mcp.archiveye.ai/collection/{collection_api_key}/mcp\` | Locked-down integrations, shared connectors |
1006
1007API-key MCP uses the **same host** as OAuth (\`mcp.archiveye.ai\`). \`data.archiveye.ai\` is the REST/BFF host only and does not proxy \`/user/…/mcp\` or \`/collection/…/mcp\`.
1008
1009Replace \`{api_key}\` with your employee API key (\`aek-…\`) from **Settings → API key**, or the collection key from the connector detail page.
1010
1011Transport: **Streamable HTTP** (MCP spec 2025-03-26). Legacy SSE-only clients are not supported.
1012
1013## Authentication
1014
1015Two patterns are equivalent for account scope:
1016
10171. **API key in URL** — simplest for IDE config files; the key is visible in local settings.
10182. **Bearer header** — preferred for shared configs: \`Authorization: Bearer aek-…\`
1019
1020Collection-scoped URLs embed the collection key (\`col_…\`) in the path. You can also send \`Authorization: Bearer col_…\` on clients that support headers.
1021
1022See the [Authentication guide](/docs/auth) for subscription requirements and ke
1022y rotation.
1023
1024## Recommended agent workflow
1025
1026### Account scope (\`/user/{aek-}/mcp\`)
1027
10281. Call \`list_collections\` and read the JSON catalog (\`id\`, \`name\`, \`structured_document_count\`, …).
10292. Pick a \`collection_id\` from that list — never invent IDs.
10303. Run \`search_semantic\` or \`search_fulltext\` with that \`collection_id\`.
10314. Use \`get_document\` / \`get_document_content\` for full context on a hit.
10325. For spreadsheet-like documents, use \`get_tabular_schema\` then \`execute_tabular_query\`.
1033
1034> **Note:** On the account-scoped server, semantic and full-text search **require** an explicit \`collection_id\`.
1035
1036### Collection scope (\`/collection/{col_}/mcp\`)
1037
10381. **Skip** \`list_collections\` — it is not available on this server.
10392. Run \`search_semantic\` or \`search_fulltext\` with \`query\` (and optional \`limit\`) only — the collection is implicit from the URL/key.
10403. Use \`get_document\`, \`get_document_content\`, and tabular tools the same way (no \`collection_id\` parameter).
1041
1042> **Note:** Collection-scoped search does **not** accept \`collection_id\`; the key already binds the integration to one connector.
1043
1044## Available tools
1045
1046| Tool | Account scope | Collection scope |
1047| --- | --- | --- |
1048| \`list_collections\` | Yes | **No** |
1049| \`search_semantic\` | Yes (\`collection_id\` required) | Yes (\`query\` only) |
1050| \`search_fulltext\` | Yes (\`collection_id\` required) | Yes (\`query\` only) |
1051| \`get_document\` | Yes | Yes |
1052| \`get_document_content\` | Yes | Yes |
1053| \`get_tabular_schema\` | Yes (\`collection_id\` required) | Yes (no \`collection_id\`) |
1054| \`execute_tabular_query\` | Yes (\`collection_id\` required) | Yes (no \`collection_id\`) |
1055
1056### \`search_semantic\` / \`search_fulltext\` parameters
1057
1058**Account scope** (\`/user/{aek-}/mcp\`):
1059
1060| Parameter | Type | Description |
1061| --- | --- | --- |
1062| \`collection_id\` | int | From \`list_collections\` |
1063| \`query\` | string | Natural-language or keyword query |
1064| \`limit\` | int | Max results (default 5) |
1065
1066**Collection scope** (\`/collection/{col_}/mcp\`):
1067
1068| Parameter | Type | Description |
1069| --- | --- | --- |
1070| \`query\` | string | Natural-language or keyword query |
1071| \`limit\` | int | Max results (default 5) |
1072
1073Use full-text search when you need exact tokens (invoice numbers, SKUs, names).
1074
1075## IDE setup (API key)
1076
1077Prefer **OAuth** (\`https://mcp.archiveye.ai/user/mcp\`) when the client supports it (Claude connector, ChatGPT plugin, Cursor OAuth). Use the steps below when you want an API key in the URL.
1078
1079### Cursor
1080
10811. Open **Settings → Tools → MCP**.
10822. Click **+ Add new MCP server**.
10833. Name: \`ArchivEye\`, type: **HTTP**.
10844. URL: \`https://mcp.archiveye.ai/user/YOUR_API_KEY/mcp\`
10855. Save and confirm tools appear in the chat panel.
1086
1087For collection-only access, paste the connector MCP URL from the connector detail page instead.
1088
1089### Claude Desktop (API key)
1090
1091For the **claude.ai connector**, use OAuth (\`https://mcp.archiveye.ai/user/mcp\`) instead of an API key. For **Claude Desktop** with a local config file:
1092
1093Add to your Claude Desktop config:
1094
1095\`\`\`json
1096{
1097  "mcpServers": {
1098    "archiveye": {
1099      "url": "https://mcp.archiveye.ai/user/YOUR_API_KEY/mcp"
1100    }
1101  }
1102}
1103\`\`\`
1104
1105Restart Claude Desktop after editing the config file.
1106
1107### VS Code / Copilot (HTTP MCP)
1108
1109Use the same URL pattern. If the client supports headers instead of path keys:
1110
1111\`\`\`json
1112{
1113  "mcpServers": {
1114    "archiveye": {
1115      "url": "https://mcp.archiveye.ai/user/YOUR_API_KEY/mcp",
1116      "headers": {
1117        "Authorization": "Bearer YOUR_API_KEY"
1118      }
1119    }
1120  }
1121}
1122\`\`\`
1123
1124## TypeScript SDK alternative
1125
1126For server-side agents, the SDK wraps the same MCP transport. Production default \`mcpBaseUrl\` is \`https://mcp.archiveye.ai\` (not the BFF origin). The path is chosen from the key prefix:
1127
1128\`\`\`ts
1129import { Archiveye } from "@archiveye/sdk";
1130
1131// Employee key
1132const archiveye = new Archiveye({ apiKey: process.env.ARCHIVEYE_API_KEY! });
1133const hits = await archiveye.mcp.searchSemantic({
1134  collectionId: 12,
1135  query: "contracts expiring in Q4",
1136  limit: 8,
1137});
1138
1139// Collection key — no collectionId, no listCollections
1140const connector = new Archiveye({ apiKey: process.env.ARCHIVEYE_COLLECTION_KEY! });
1141const scopedHits = await connector.mcp.searchSemantic({
1142  query: "contracts expiring in Q4",
1143  limit: 8,
1144});
1145\`\`\`
1146
1147See the [SDK guide](/docs/sdk) for REST + MCP in one client.
1148
1149## Troubleshooting
1150
1151| Symptom | Likely cause | Fix |
1152| --- | --- | --- |
1153| Tools list empty | Invalid or revoked API key | Regenerate key in Settings / connector |
1154| \`405 Not Allowed\` on \`data.archiveye.ai/…/mcp\` | MCP is not served on the BFF origin | Use \`https://mcp.archiveye.ai\` (SDK \`mcpBaseUrl\`) |
1155| \`401 Unauthorized\` | Wrong key or expired subscription | Check [Authentication](/docs/auth) |
1156| Search returns nothing | Wrong \`collection_id\` (account scope) or empty index | Call \`list_collections\`, verify documents are indexed |
1157| \`list_collections\` missing | Collection-scoped URL (\`col_\`) | Expected — search without listing; use account scope if you need the catalog |
1158| Tabular tools missing | Collection has no structured docs | Check \`structured_document_count\` on account scope |
1159
1160## Next steps
1161
1162- [Authentication](/docs/auth) — keys, Bearer auth, scopes
1163- [TypeScript SDK](/docs/sdk) — programmatic MCP + REST
1164- [CLI](/docs/cli) — terminal search and upload
1165- [Webhooks](/docs/webhooks) — ingest completion events
1166`,Loe='# TypeScript SDK\n\nThe `@archiveye/sdk` package is the official TypeScript client for the Developer Platform. One `Archiveye` instance exposes:\n\n- `archiveye.http` — REST via the BFF (`/api/v1`)\n- `archiveye.mcp` — MCP tools over Streamable HTTP\n- `@archiveye/sdk/webhooks` — `constructEvent` for signed webhook payloads\n\n> **Tip:** Use ingest (`startIngest`) when you need idempotent upload + indexing into a collection. Use `uploadDocument` for library upload without binding to a collection ingest job.\n\n## Install\n\n```bash\nnpm install @archiveye/sdk\n# or\npnpm add @archiveye/sdk\n```\n\nRequires Node 18+ (native `fetch`).\n\n## Quick start\n\n**Employee key (`aek-`)** — full account access:\n\n```ts\nimport { Archiveye } from "@archiveye/sdk";\n\nconst archiveye = new Archiveye({\n  apiKey: process.env.ARCHIVEYE_API_KEY!, // aek-…\n});\n\nconst me = await archiveye.http.whoami();\n// { id, email, authMethod: "employee-api-key", hasActiveSubscription, … }\n\nconst collections = await archiveye.http.listCollections();\nconst hits = await archiveye.mcp.searchSemantic({\n  collectionId: collections[0].id,\n  query: "invoice Q3 2024",\n  limit: 10,\n});\n```\n\n**Collection key (`col_`)** — single connector, no `listCollections`:\n\n```ts\nconst archiveye = new Archiveye({\n  apiKey: process.env.ARCHIVEYE_COLLECTION_KEY!, // col_…\n});\n\nconst me = await archiveye.http.whoami();\n// { id, email, authMethod: "collection-api-key", collectionId: 12, … }\n\nconst collection = await archiveye.http.getCollection(me.collectionId!);\nconst hits = await archiveye.mcp.searchSemantic({\n  query: "invoice Q3 2024",\n  limit: 10,\n});\n```\n\n## Configuration\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `apiKey` | required | Employee (`aek-…`) or collection (`col_…`) API key |\n| `baseUrl` | `https://data.archiveye.ai/api/v1` | BFF REST base URL |\n| `mcpBaseUrl` | `https://mcp.archiveye.ai` | MCP host (no `/api/v1` path). **Not** the origin of `baseUrl`. |\n| `fetch` | global `fetch` | Custom fetch for proxies or testing |\n\n`baseUrl` and `mcpBaseUrl` are different hosts in production. `data.archiveye.ai` serves the BFF under `/api/`; Streamable HTTP MCP lives on `mcp.archiveye.ai`. Do not set `mcpBaseUrl` to `https://data.archiveye.ai`.\n\n```ts\nconst archiveye = new Archiveye({\n  apiKey: process.env.ARCHIVEYE_API_KEY!,\n  // defaults: BFF on data.archiveye.ai, MCP on mcp.ar
1166chiveye.ai\n});\n\n// Local or staging — set both explicitly\nconst local = new Archiveye({\n  apiKey: process.env.ARCHIVEYE_API_KEY!,\n  baseUrl: "http://localhost:3000/api/v1",\n  mcpBaseUrl: "http://localhost:3004",\n});\n```\n\nAuthentication details: [Authentication guide](/docs/auth).\n\n## REST client (`archiveye.http`)\n\nAll methods throw `ArchiveyeHttpError` on non-2xx responses with `status` and parsed `body`.\n\n### Profile & collections\n\n| Method | Description |\n| --- | --- |\n| `whoami()` | Authenticated principal + auth metadata |\n| `listCollections()` | All knowledge bases (**403 with `col_` keys**) |\n| `getCollection(id)` | Single collection |\n| `createCollection(input)` | Create with optional `documentIds` (**403 with `col_`**) |\n| `updateCollection(id, input)` | Patch name / description (bound collection only with `col_`) |\n| `deleteCollection(id)` | Delete collection (**403 with `col_`**) |\n| `addCollectionDocuments(id, documentIds)` | Link documents (bound collection only with `col_`) |\n| `removeCollectionDocument(collectionId, documentId)` | Unlink document |\n| `replaceCollectionDocument(collectionId, docId, replacementId)` | Swap membership |\n\n`whoami()` response fields:\n\n| Field | Description |\n| --- | --- |\n| `id` | Employee id (owner of the collection when using `col_`) |\n| `email` | Owner email |\n| `authMethod` | `employee-api-key` or `collection-api-key` |\n| `collectionId` | Present only with `col_` keys — the bound collection |\n| `hasActiveSubscription` | Subscription gate for developer endpoints |\n\n### Documents\n\n| Method | Description |\n| --- | --- |\n| `uploadDocument({ file, filename, folderId?, source? })` | Upload to library (**403 with `col_` keys**) |\n| `deleteDocument(id)` | Remove document (**403 with `col_`**) |\n| `getDocumentStatus(id)` | Processing progress (**403 with `col_`**) |\n| `searchDocuments({ query, collectionId?, limit? })` | BFF search endpoint (**403 with `col_`**) |\n\nUse **ingest** or **collection membership** APIs with collection keys instead of global document endpoints.\n\n### Ingest jobs\n\nDurable upload + processing into a collection:\n\n```ts\nimport { readFile } from "node:fs/promises";\n\n// Employee key — collectionId required\nconst job = await archiveye.http.startIngest({\n  collectionId: 12,\n  file: await readFile("./report.pdf"),\n  filename: "report.pdf",\n  idempotencyKey: "report-v1",\n  metadata: { source: "crm-export" },\n});\n\n// Collection key — omit collectionId (bound automatically)\nconst scopedJob = await archiveye.http.startIngest({\n  file: await readFile("./report.pdf"),\n  filename: "report.pdf",\n});\n\nconst status = await archiveye.http.getIngestStatus(job.id);\nawait archiveye.http.cancelIngest(job.id);\n```\n\nPass the same `idempotencyKey` (header + form field) to safely retry network failures without duplicate uploads.\n\n### Webhooks\n\n| Method | Description |\n| --- | --- |\n| `listWebhookEndpoints()` | Registered URLs |\n| `createWebhookEndpoint({ url, events })` | Returns `secret` once |\n| `testWebhookEndpoint(id)` | Send `endpoint.test` |\n| `listWebhookDeliveries({ endpointId?, status? })` | Delivery log |\n| `retryWebhookDelivery(deliveryId)` | Re-queue failed delivery |\n\nSee [Webhooks guide](/docs/webhooks) for event types and signature verification.\n\n## MCP client (`archiveye.mcp`)\n\nConnects to Streamable HTTP MCP on `mcpBaseUrl` using the key prefix:\n\n- `aek-…` → `https://mcp.archiveye.ai/user/{apiKey}/mcp`\n- `col_…` → `https://mcp.archiveye.ai/collection/{apiKey}/mcp`\n\n| Method | MCP tool | Notes |\n| --- | --- | --- |\n| `listCollections()` | `list_collections` | **Not available** with `col_` keys |\n| `searchSemantic({ collectionId?, query, limit? })` | `search_semantic` | `collectionId` required with `aek-`, omitted with `col_` |\n| `searchFulltext({ collectionId?, query, limit? })` | `search_fulltext` | Same as semantic search |\n| `getDocument({ documentId })` | `get_document` | |\n| `getDocumentContent({ documentId })` | `get_document_content` | |\n| `getTabularSchema({ collectionId?, documentId, sheet? })` | `get_tabular_schema` | `collectionId` required with `aek-`, omitted with `col_` |\n| `executeTabularQuery({ collectionId?, documentId, sql, sheet?, limit? })` | `execute_tabular_query` | Same scope rules as tabular schema |\n| `close()` | Close MCP session | |\
1166n\n```ts\nconst rows = await archiveye.mcp.executeTabularQuery({\n  documentId: 55,\n  sql: "SELECT * FROM sheet LIMIT 20",\n});\nawait archiveye.mcp.close();\n```\n\nAlways call `listCollections()` before search when using employee keys — see [MCP guide](/docs/mcp). With collection keys, search is already scoped to the bound collection.\n\n## Webhook verification\n\n```ts\nimport { constructEvent, WebhookSignatureError } from "@archiveye/sdk/webhooks";\n\ntry {\n  const event = constructEvent(rawBody, signatureHeader, endpointSecret);\n  console.log(event.type, event.data);\n} catch (err) {\n  if (err instanceof WebhookSignatureError) {\n    // invalid or expired signature\n  }\n}\n```\n\n- Header format: `t=timestamp,v1=hex_hmac`\n- Signed payload: `${timestamp}.${rawBody}`\n- Default tolerance: 300 seconds\n\n## Error handling\n\n```ts\nimport { ArchiveyeHttpError } from "@archiveye/sdk";\n\ntry {\n  await archiveye.http.getCollection(999);\n} catch (err) {\n  if (err instanceof ArchiveyeHttpError) {\n    console.error(err.status, err.message, err.body);\n  }\n}\n```\n\nCommon statuses:\n\n| Status | Meaning |\n| --- | --- |\n| `401` | Invalid API key |\n| `403` | Missing subscription or permission |\n| `404` | Resource not found |\n| `409` | Idempotency conflict |\n\n## Related\n\n- [Authentication](/docs/auth)\n- [MCP Integration](/docs/mcp)\n- [CLI](/docs/cli)\n- [Webhooks](/docs/webhooks)\n',Ooe=`# CLI
1167
1168The \`@archiveye/cli\` package installs the \`archiveye\` command for scripting, CI pipelines, and local debugging against the Developer Platform.
1169
1170Every command prints **JSON** to stdout (machine-readable). Use \`jq\` for filtering.
1171
1172## Install
1173
1174\`\`\`bash
1175npm install -g @archiveye/cli
1176# or
1177pnpm add -g @archiveye/cli
1178\`\`\`
1179
1180Verify:
1181
1182\`\`\`bash
1183archiveye --version
1184\`\`\`
1185
1186## Configure
1187
1188\`\`\`bash
1189archiveye config set --api-key aek-your-key-here
1190archiveye config set --api-key col_your-collection-key
1191archiveye config set \\
1192  --api-key aek-... \\
1193  --base-url https://data.archiveye.ai/api/v1 \\
1194  --mcp-base-url https://mcp.archiveye.ai
1195archiveye config show
1196\`\`\`
1197
1198\`--base-url\` is the BFF (\`/api/v1\`). \`--mcp-base-url\` is the MCP host (\`https://mcp.archiveye.ai\` in production). They are not the same origin: do not point MCP at \`data.archiveye.ai\`.
1199
1200Local development:
1201
1202\`\`\`bash
1203archiveye config set \\
1204  --api-key aek-... \\
1205  --base-url http://localhost:3000/api/v1 \\
1206  --mcp-base-url http://localhost:3004
1207\`\`\`
1208
1209| Source | Priority |
1210| --- | --- |
1211| \`--api-key\` flag on command | Highest |
1212| \`ARCHIVEYE_API_KEY\` env var | If no flag |
1213| \`~/.archiveye/config.json\` | Default |
1214
1215\`\`\`bash
1216export ARCHIVEYE_API_KEY=aek-your-key-here
1217archiveye whoami
1218\`\`\`
1219
1220See [Authentication](/docs/auth) for key creation and security.
1221
1222## Global options
1223
1224| Option | Description |
1225| --- | --- |
1226| \`--json\` | Explicit JSON output (default behavior) |
1227| \`--api-key <key>\` | Override API key per command |
1228
1229## Command reference
1230
1231### \`whoami\`
1232
1233\`\`\`bash
1234archiveye whoami
1235\`\`\`
1236
1237Returns the authenticated principal: employee id, email, organization, role, \`authMethod\`, and (with \`col_\` keys) \`collectionId\`.
1238
1239\`\`\`json
1240{
1241  "id": 42,
1242  "email": "[email protected]",
1243  "authMethod": "collection-api-key",
1244  "collectionId": 12,
1245  "hasActiveSubscription": true
1246}
1247\`\`\`
1248
1249### Collections
1250
1251\`\`\`bash
1252archiveye collections list
1253archiveye collections create --name "Contracts" --description "Legal docs"
1254archiveye collections update 12 --name "Contracts 2024"
1255archiveye collections delete 12
1256
1257archiveye collections add-documents 12 --document-ids 101,102
1258archiveye collections remove-document 12 102
1259archiveye collections replace-document 12 101 --with 103
1260\`\`\`
1261
1262With **collection keys** (\`col_…\`):
1263
1264- \`list\`, \`create\`, \`delete\` → **403**
1265- \`update\`, \`add-documents\`, \`remove-document\`, \`replace-document\` → only on the bound collection id (from \`whoami.collectionId\`)
1266
1267### Search (MCP semantic)
1268
1269\`\`\`bash
1270archiveye search -q "quarterly report" --collection-id 12 --limit 10
1271\`\`\`
1272
1273With collection keys (\`col_…\`), \`--collection-id\` is optional (search is scoped to the key's collection).
1274
1275Uses the same MCP \`search_semantic\` tool as IDE integrations.
1276
1277### Documents
1278
1279\`\`\`bash
1280archiveye documents upload -f ./report.pdf
1281archiveye documents upload -f ./report.pdf --folder-id 3
1282archiveye documents status 101
1283archiveye documents delete 101
1284\`\`\`
1285
1286\`upload\` adds to the document library; processing starts automatically.
1287
1288> **Note:** All \`documents\` commands return **403** with collection keys (\`col_…\`). Use \`ingest start\` to upload into the bound collection instead.
1289
1290### Ingest jobs
1291
1292Upload + index into a collection (preferred for integrations):
1293
1294\`\`\`bash
1295archiveye ingest start \\
1296  --collection-id 12 \\
1297  --file ./report.pdf \\
1298  --idempotency-key report-v1
1299
1300# With collection keys, omit --collection-id:
1301archiveye ingest start --file ./report.pdf
1302
1303archiveye ingest status ing_abc123
1304archiveye ingest cancel ing_abc123
1305\`\`\`
1306
1307Pair with [Webhooks](/docs/webhooks) or poll \`ingest status\` until \`completed\`.
1308
1309### Webhooks
1310
1311\`\`\`bash
1312archiveye webhooks endpoints list
1313archiveye webhooks endpoints create \\
1314  --url https://api.example.com/hooks \\
1315  --events ingest.completed,ingest.failed
1316archiveye webhooks endpoints test 1
1317archiveye webhooks endpoints update 1 --status DISABLED
1318archiveye webhooks endpoints rotate-secret 1
1319archiveye webhooks endpoints delete 1
1320
1321archiveye webhooks deliveries list
1322archiveye webhooks deliveries list --status FAILED --endpoint-id 1
1323archiveye webhooks deliveries retry wdel_xyz
1324\`\`\`
1325
1326## Scripting examples
1327
1328Count collections:
1329
1330\`\`\`bash
1331archiveye collections list | jq 'length'
1332\`\`\`
1333
1334Wait for ingest completion:
1335
1336\`\`\`bash
1337JOB=$(archiveye ingest start -f ./doc.pdf --collection-id 12 | jq -r .id)
1338until archiveye ingest status "$JOB" | jq -e '.status == "completed"' >/dev/null; do
1339  sleep 2
1340done
1341\`\`\`
1342
1343## Related
1344
1345- [TypeScript SDK](/docs/sdk) — same APIs from Node
1346- [MCP Integration](/docs/mcp) — IDE agents
1347- [Webhooks](/docs/webhooks) — event delivery
1348- [Authentication](/docs/auth)
1349`,Moe=`# Webhooks
1350
1351Receive HTTP callbacks when ingest jobs change state or when you send a test ping. Webhooks use **signed payloads** (Stripe-style HMAC-SHA256) so your handler can reject forged requests.
1352
1353## Event types
1354
1355| Event | When fired |
1356| --- | --- |
1357| \`ingest.created\` | Ingest job accepted, document queued |
1358| \`ingest.processing\` | Processing pipeline started |
1359| \`ingest.indexing\` | Embeddings / index update in progress |
1360| \`ingest.completed\` | Document indexed and searchable |
1361| \`ingest.failed\` | Pipeline error (see \`data.error\`) |
1362| \`collection.document.added\` | Document linked to a collection |
1363| \`collection.document.removed\` | Document unlinked from a collection |
1364| \`collection.api_key.regenerated\` | Collection MCP API key rotated |
1365| \`collection.indexing.completed\` | Collection Qdrant index rebuilt |
1366| \`collection.indexing.failed\` | Collection indexing error |
1367| \`endpoint.test\` | Manual test from CLI or API |
1368
1369Subscribe only to events you need — fewer events means less noise and lower retry load.
1370
1371## Payload shape
1372
1373\`\`\`json
1374{
1375  "id": "evt_abc123",
1376  "type": "ingest.completed",
1377  "created": 1710000000,
1378  "data": {
1379    "object": {
1380      "id": "ing_xyz",
1381      "object": "ingest",
1382      "collectionId": 12,
1383      "documentId": 101,
1384      "status": "COMPLETED",
1385      "metadata": null,
1386      "error": null
1387    }
1388  }
1389}
1390\`\`\`
1391
1392Every delivery includes headers:
1393
1394| Header | Description |
1395| --- | --- |
1396| \`x-archiveye-signature\` | \`t=timestamp,v1=hex_hmac\` |
1397| \`x-archiveye-event-id\` | Event ID (same as JSON \`id\`) |
1398
1399## Create an endpoint
1400
1401### CLI
1402
1403\`\`\`bash
1404archiveye webhooks endpoints create \\
1405  --url https://api.example.com/hooks/archiveye \\
1406  --events ingest.completed,ingest.failed
1407\`\`\`
1408
1409The response includes \`secret\` — store it immediately; it is shown only once.
1410
1411### SDK
1412
1413\`\`\`ts
1414const endpoint = await archiveye.http.createWebhookEndpoint({
1415  url: "https://api.example.com/hooks/archiveye",
1416  events: ["ingest.completed", "ingest.failed"],
1417});
1418// endpoint.secret — save to your secrets store
1419\`\`\`
1420
1421### Test delivery
1422
1423\`\`\`bash
1424archiveye webhooks endpoints test 1
1425\`\`\`
1426
1427Sends an \`endpoint.test\` event to verify URL reachability and signature verification.
1428
1429## Verify signatures
1430
1431Use the endpoint secret and raw request body (not parsed JSON):
1432
1433\`\`\`ts
1434import { constructEvent } from "@archiveye/sdk/webhooks";
1435
1436export async function handleWebhook(req: Request, secret: string) {
1437  const rawBody = await req.text();
1438  const signature = req.headers.get("x-archiveye-signature");
1439  if (!signature) throw new Error("Missing signature");
1440
1441  const event = constructEvent(rawBody, signature, secret);
1442  switch (event.type) {
1443    case "ingest.completed":
1444      // event.data contains job + document ids
1445      break;
1446    case "ingest.failed":
1447      break;
1448  }
1449  return { received: true };
1450}
1451\`\`\`
1452
1453Algorithm:
1454
14551. Parse \`t\` (timestamp) and \`v1\` (hex signature) from the header.
14562. Reject if timestamp is older than 5 minutes (configurable tolerance).
14573. Compute \`HMAC-SHA256(secret, \`\${t}.\${rawBody}\`)\` and compare with \`v1\`.
1458
1459> **Tip:** In Express or NestJS, register a raw body parser for the webhook route before JSON middleware.
1460
1461## Retries and delivery log
1462
1463Failed deliveries (non-2xx, timeouts, TLS errors) are retried automatically by the webhook worker.
1464
1465| Action | CLI |
1466| --- | --- |
1467| List deliveries | \`archiveye webhooks deliveries list\` |
1468| Filter failures | \`archiveye webhooks deliveries list --status FAILED\` |
1469| Manual retry | \`archiveye webhooks deliveries retry wdel_xyz\` |
1470
1471SDK equivalents: \`listWebhookDeliveries()\`, \`retryWebhookDelivery(id)\`.
1472
1473## Endpoint lifecycle
1474
1475\`\`\`bash
1476archiveye webhooks endpoints list
1477archiveye webhooks endpoints update 1 --status DISABLED
1478\`\`\`
1479
1480Disabled endpoints stop receiving new events but remain in the database for audit.
1481
1482## Ingest + webhook flow
1483
14841. \`startIngest\` (SDK/CLI) uploads a file and returns an ingest job with \`id\`.
14852. Processing service runs parser → chunker → embedder.
14863. On state transitions, core-service emits webhook events.
14874. Your handler receives \`ingest.completed\` when search tools can find the document.
1488
1489Pair with [MCP](/docs/mcp) or SDK search only **after** \`ingest.completed\` (or poll \`getIngestStatus\`).
1490
1491## Related
1492
1493- [Authentication](/docs/auth)
1494- [TypeScript SDK](/docs/sdk) — \`constructEvent\` and REST helpers
1495- [CLI](/docs/cli) — webhook commands
1496`,Ioe={auth:Poe,mcp:Doe,sdk:Loe,cli:Ooe,webhooks:Moe};function zoe(t){return Ioe[t]}function e4(t){return t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim()}function Foe(t){const e=[];for(const n of t.split(`
1497`)){const i=n.match(/^(#{2,3})\s+(.+)$/);if(!i)continue;const r=i[1].length,l=i[2].replace(/\*\*/g,"").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1");e.push({level:r,text:l,id:e4(l)})}return e}function $oe(t){return t?t.startsWith("/")&&!t.startsWith("//"):!1}function Uoe({href:t,children:e,...n}){const i="font-medium text-primary underline underline-offset-4 transition-colors hover:text-primary/80";return $oe(t)?o.jsx(Fi,{to:t,className:i,...n,children:e}):o.jsx("a",{href:t,className:i,target:"_blank",rel:"noopener noreferrer",...n,children:e})}function Boe({children:t,className:e}){const[n,i]=v.useState(!1),r=e?.replace("language-","")??"",s=String(t??"").replace(/\n$/,""),l=async()=>{await navigator.clipboard.writeText(s),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:"group relative my-4 overflow-hidden rounded-lg border border-border bg-muted/30",children:[r?o.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-muted/50 px-3 py-1.5",children:[o.jsx("span",{className:"font-mono text-[11px] uppercase tracking-wider text-muted-foreground",children:r}),o.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 transition-opacity group-hover:opacity-100",onClick:l,"aria-label":"Copy code",children:n?o.jsx(Zi,{className:"h-3.5 w-3.5 text-emerald-600"}):o.jsx(Fp,{className:"h-3.5 w-3.5"})})]}):null,o.jsx("pre",{className:"overflow-x-auto p-4 text-[13px] leading-relaxed",children:o.jsx("code",{className:e,children:t})}),r?null:o.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-7 w-7 opacity-0 transition-opacity group-hover:opacity-100",onClick:l,"aria-label":"Copy code",children:n?o.jsx(Zi,{className:"h-3.5 w-3.5 text-emerald-600"}):o.jsx(Fp,{className:"h-3.5 w-3.5"})})]})}function Vy(t){return typeof t=="string"||typeof t=="number"?String(t):t?Array.isArray(t)?t.map(Vy).join(""):typeof t=="object"&&"props"in t?Vy(t.props.children):"":""}function Hoe({children:t,...e}){const n=Vy(t).trim(),i=n.match(/^(Tip|Warning|Note):\s*(.*)$/is),r=i?.[1]?.toLowerCase(),s=i?.[2]??n;if(!r)return o.jsx("blockquote",{className:"my-4 border-l-2 border-border pl-5 text-muted-foreground italic",...e,children:t});const l={tip:"border-emerald-500/40 bg-emerald-500/5 text-foreground",warning:"border-amber-500/40 bg-amber-500/5 text-foreground",note:"border-primary/30 bg-primary/5 text-foreground"};
1497return o.jsxs("div",{className:Fe("my-4 rounded-lg border-l-4 px-4 py-3 text-sm leading-relaxed not-italic",l[r]),children:[o.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-70",children:i[1]}),o.jsx("p",{children:s})]})}function pN({level:t,children:e,...n}){const i=String(e??""),r=e4(i.replace(/\*\*/g,"")),s=t===2?"h2":"h3",l=t===2?"mt-10 scroll-m-24 text-xl font-semibold tracking-tight text-foreground first:mt-0 border-b border-border/60 pb-2":"mt-6 scroll-m-24 text-base font-semibold tracking-tight text-foreground";return o.jsx(s,{id:r,className:l,...n,children:e})}const Goe={ul:({children:t,...e})=>o.jsx("ul",{className:"my-3 ml-5 list-disc space-y-1.5 text-[15px] leading-relaxed",...e,children:t}),ol:({children:t,...e})=>o.jsx("ol",{className:"my-3 ml-5 list-decimal space-y-1.5 text-[15px] leading-relaxed",...e,children:t}),li:({children:t,...e})=>o.jsx("li",{className:"pl-1",...e,children:t}),p:({children:t,...e})=>o.jsx("p",{className:"text-[15px] leading-7 text-foreground/90 [&:not(:first-child)]:mt-3",...e,children:t}),a:({children:t,href:e,...n})=>o.jsx(Uoe,{href:e,...n,children:t}),blockquote:Hoe,h1:({children:t,...e})=>o.jsx("h1",{className:"scroll-m-24 text-3xl font-semibold tracking-tight text-foreground",...e,children:t}),h2:({children:t,...e})=>o.jsx(pN,{level:2,...e,children:t}),h3:({children:t,...e})=>o.jsx(pN,{level:3,...e,children:t}),pre:({children:t})=>o.jsx(o.Fragment,{children:t}),code:({children:t,className:e,...n})=>e?.includes("language-")?o.jsx(Boe,{className:e,children:t}):o.jsx("code",{className:"rounded-md border border-border/60 bg-muted/50 px-1.5 py-0.5 font-mono text-[13px] text-foreground",...n,children:t}),table:({children:t,...e})=>o.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-border",children:o.jsx("table",{className:"w-full border-collapse text-sm",...e,children:t})}),thead:({children:t,...e})=>o.jsx("thead",{className:"bg-muted/40",...e,children:t}),tr:({children:t,...e})=>o.jsx("tr",{className:"border-b border-border last:border-0",...e,children:t}),th:({children:t,...e})=>o.jsx("th",{className:"px-4 py-2.5 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground",...e,children:t}),td:({children:t,...e})=>o.jsx("td",{className:"px-4 py-2.5 text-left align-top text-[14px]",...e,children:t}),hr:t=>o.jsx("hr",{className:"my-8 border-border/60",...t}),strong:({children:t,...e})=>o.jsx("strong",{className:"font-semibold text-foreground",...e,children:t})};function Voe(){return o.jsx(Toe,{})}function qoe(){const{t}=Ye("docs"),{slug:e}=ow(),n=e?voe(e,t):void 0,i=e?zoe(e):void 0;if(!n||!i)return o.jsxs("div",{className:"space-y-4 rounded-xl border border-border bg-card/50 p-8",children:[o.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t("page.notFoundTitle")}),o.jsx("p",{className:"text-muted-foreground",children:t("page.notFoundDesc")}),o.jsx(ie,{asChild:!0,variant:"outline",children:o.jsx(Fi,{to:"/docs",children:t("page.backToDocs")})})]});const r=Foe(i);return o.jsxs("div",{className:"lg:grid lg:grid-cols-[minmax(0,1fr)_200px] lg:gap-10 xl:grid-cols-[minmax(0,1fr)_220px]",children:[o.jsxs("article",{className:"min-w-0 max-w-3xl",children:[o.jsxs("header",{className:"mb-8 border-b border-border/60 pb-6",children:[o.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest text-primary/80",children:t("page.badge")}),o.jsx("h1",{className:"mt-2 text-3xl font-semibold tracking-tight text-foreground",children:n.title}),o.jsx("p",{className:"mt-3 text-base leading-relaxed text-muted-foreground",children:n.description})]}),o.jsx("div",{className:"docs-content",children:o.jsx(JR,{remarkPlugins:[CP],components:Goe,children:i.replace(/^#\s+.+\n+/,"")})})]}),r.length>0?o.jsx("aside",{className:"hidden lg:block",children:o.jsx("div",{className:"sticky top-24 rounded-lg border border-border/60 bg-card/40 p-4",children:o.jsx(Roe,{headings:r})})}):null]})}function Koe(){const{isAuthenticated:t,logout:e}=Ar(),[n,i]=v.useState(null);return v.useEffect(()=>{if(!t){i("/login");return}let r=!1;return(async()=>{try{const l=await As();r||i(l?"/dashboard":"/pricing")}catch(l){r||(E_(l)?(e(),i("/login")):i("/pricing"))}})(),()=>{r=!0}},[t]),n?o.jsx(Mb,{to:n,replace:!0}):o.jsx("div",{className:"flex justify-center items-center min-h-screen",children:o.jsx("p",{className:"text-muted-foreground animate-pulse",children:"Caricamento..."})})}function Woe(){return o.jsxs(qz,{children:[o.jsx(B5,{position:"top-center"}),o.jsx(U$,{children:o.jsxs(Sz,{children:[o.jsx(an,{path:"/",element:o.jsx(Koe,{})}),o.jsx(an,{path:"/login",element:o.jsx(Y$,{})}),o.jsx(an,{path:"/register",element:o.jsx(sU,{})}),o.jsx(an,{path:"/pricing",element:o.jsx(os,{children:o.jsx(OU,{})})}),o.jsx(an,{path:"/billing",element:o.jsx(os,{children:o.jsx(MU,{})})}),o.jsx(an,{path:"/billing/success",element:o.jsx(IU,{})}),o.jsx(an,{path:"/billing/cancel",element:o.jsx(zU,{})}),o.jsx(an,{path:"/login-chat",element:o.jsx(FU,{})}),o.jsx(an,{path:"/auth/callback",element:o.jsx($U,{})}),o.jsx(an,{path:"/forgot-password",element:o.jsx(Coe,{})}),o.jsx(an,{path:"/terms",element:o.jsx(Eoe,{})}),o.jsx(an,{path:"/privacy",element:o.jsx(Aoe,{})}),o.jsxs(an,{path:"/docs",element:o.jsx(Noe,{}),children:[o.jsx(an,{index:!0,element:o.jsx(Voe,{})}),o.jsx(an,{path:":slug",element:o.jsx(qoe,{})})]}),o.jsx(an,{path:"/choose-role",element:o.jsx(os,{children:o.jsx(UU,{})})}),o.jsx(an,{path:"/admin",element:o.jsx(os,{children:o.jsx(GU,{})})}),o.jsx(an,{path:"/dashboard",element:o.jsx(os,{children:o.jsx(zae,{})})}),o.jsx(an,{path:"/dashboard/new-mcp",element:o.jsx(os,{children:o.jsx(Bae,{})})}),o.jsx(an,{path:"/dashboard/connector/:collectionId",element:o.jsx(os,{children:o.jsx(Yae,{})})}),o.jsx(an,{path:"/dashboard/folder/:folderId",element:o.jsx(os,{children:o.jsx(ioe,{})})}),o.jsx(an,{path:"/settings",element:o.jsx(os,{children:o.jsx(yoe,{})})}),o.jsx(an,{path:"/support",element:o.jsx(os,{children:o.jsx(Soe,{})})})]})})]})}function Yoe({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...i}){const[r,s]=v.useState(()=>localStorage.getItem(n)||e);v.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),r==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
1497k":"light";u.classList.add(d);return}u.classList.add(r)},[r]),v.useEffect(()=>{if(r!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=f=>{const p=window.document.documentElement;p.classList.remove("light","dark"),p.classList.add(f.matches?"dark":"light")};return u.addEventListener("change",d),()=>u.removeEventListener("change",d)},[r]);const l={theme:r,setTheme:u=>{localStorage.setItem(n,u),s(u)}};return o.jsx(P_.Provider,{...i,value:l,children:t})}hM.createRoot(document.getElementById("root")).render(o.jsx(v.StrictMode,{children:o.jsx(Yoe,{defaultTheme:"system",storageKey:"vite-ui-theme",children:o.jsx(DN,{children:o.jsx(Woe,{})})})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.