corisco 1.3.0-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,320 @@
1
+ (function(Qt,Xt){typeof exports=="object"&&typeof module<"u"?module.exports=Xt():typeof define=="function"&&define.amd?define(Xt):(Qt=typeof globalThis<"u"?globalThis:Qt||self,Qt.Corisco=Xt())})(this,function(){"use strict";var Jw=Qt=>{throw TypeError(Qt)};var jy=(Qt,Xt,Ve)=>Xt.has(Qt)||Jw("Cannot "+Ve);var me=(Qt,Xt,Ve)=>(jy(Qt,Xt,"read from private field"),Ve?Ve.call(Qt):Xt.get(Qt)),Qi=(Qt,Xt,Ve)=>Xt.has(Qt)?Jw("Cannot add the same private member more than once"):Xt instanceof WeakSet?Xt.add(Qt):Xt.set(Qt,Ve),Ln=(Qt,Xt,Ve,mr)=>(jy(Qt,Xt,"write to private field"),mr?mr.call(Qt,Ve):Xt.set(Qt,Ve),Ve),Ki=(Qt,Xt,Ve)=>(jy(Qt,Xt,"access private method"),Ve);var t1=(Qt,Xt,Ve,mr)=>({set _(Fc){Ln(Qt,Xt,Fc,Ve)},get _(){return me(Qt,Xt,mr)}});var zs,mi,ns,Ra,Pu,Da,Ma,pn,Nh,e1,n1,Bc,Nr,Lh;var Qt=typeof document<"u"?document.currentScript:null;const Xt={app:{name:"Corisco ChatJT",version:"1.3.0",iframe_url:"http://localhost:3000/chat"},env:"dev",ui:{panel:{min_width:420,max_width_ratio:.9}},max_pdf_size:10,action_map:[{tool:"pje",allowed_hosts:["https://*^[git|sso]pje*.jus.br/*"],actions:[{name:"Anexar selecionados",description:"Anexa os processos selecionados da timeline do PJe",job:"pje-docs-selecionados",loading_message:"Anexando documentos selecionados...",icon_menu:"SQUARE_MOUSE_POINTER",message:"EXTRACT_SELECTED_DOCUMENTS",auto_capture:!1,priority:1},{name:"Processo completo",description:"Extrai o processo completo do PJe",job:"pje-processo-completo",loading_message:"Capturando processo completo...",icon_menu:"BOOK_UP",message:"EXTRACT_FULL_PROCESS",auto_capture:!1,priority:2},{name:"Capturar documento visualizado",description:"Faz a captura automática do documento visualizado no PJe",job:"pje-doc-visualizado",loading_message:null,icon_menu:null,message:"EXTRACT_VISIBLE_DOCUMENT",auto_capture:!0,priority:1}],mapping:{"/pjekz/processo/{{d+}}/detalhe":["pje-processo-completo","pje-docs-selecionados","pje-doc-visualizado"],"/pjekz/processo/{{+d}}/detalhe/peticao/{{+d}}":["pje-processo-completo","pje-docs-selecionados","pje-doc-visualizado"],"/pjekz/processo/{{d+}}/documento/{{d+}}/conteudo":["pje-doc-visualizado"],"/pjekz/processo/{{d+}}/tarefa/{{d+}}/minutar":["pje-processo-completo"]}}]};function Ve(l){l=l.replace(/^\*:\/\//,"").replace(/https?:\/\//,"").replace(/\/\*$/,"");const t=l.match(/\*\^(\[([^\]]+)\])/);let i=[];if(t&&(i=t[2].split("|").map(c=>c.trim()),l=l.replace(t[0],"*")),l=l.replace(/\./g,"\\.").replace(/\*/g,".*"),i.length>0){const r=i.map(u=>`(?!.*${u})`).join("");return new RegExp("^"+r+l+"$")}return new RegExp("^"+l+"$")}function mr(){const l=Xt.action_map?.flatMap(t=>t.allowed_hosts||[]).filter(Boolean);return Array.from(new Set(l))}function Fc(l){const t=mr();if(!l)return!1;let i;try{i=new URL(l).hostname}catch{i=l.replace(/https?:\/\//,"").split("/")[0]}return t.some(r=>Ve(r).test(i))}function i1(){const l=[];return Xt.action_map?.forEach(t=>{Object.keys(t.mapping).forEach(i=>{l.push({url:i,allowedHosts:t.allowed_hosts||[]})})}),l}function $y(l){try{const t=new URL(l),i=t.hostname,a=t.pathname;return i1().some(c=>{if(!c.allowedHosts.some(m=>Ve(m).test(i)))return!1;const h=c.url.replace(/\{\{d\+\}\}/g,"\\d+").replace(/\{\{.*?\}\}/g,"[^/]+");return new RegExp("^"+h+"$").test(a)})}catch(t){return console.error("Erro ao verificar URL mapeada:",t),!1}}function s1(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ih={exports:{}},zo={exports:{}};zo.exports;var Gy;function a1(){return Gy||(Gy=1,function(l,t){/**
2
+ * @license React
3
+ * react.development.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
+ */(function(){function i(T,P){Object.defineProperty(c.prototype,T,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",P[0],P[1])}})}function a(T){return T===null||typeof T!="object"?null:(T=wn&&T[wn]||T["@@iterator"],typeof T=="function"?T:null)}function r(T,P){T=(T=T.constructor)&&(T.displayName||T.name)||"ReactClass";var et=T+"."+P;gi[et]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",P,T),gi[et]=!0)}function c(T,P,et){this.props=T,this.context=P,this.refs=Oa,this.updater=et||Un}function u(){}function h(T,P,et){this.props=T,this.context=P,this.refs=Oa,this.updater=et||Un}function p(T){return""+T}function m(T){try{p(T);var P=!1}catch{P=!0}if(P){P=console;var et=P.error,it=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return et.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",it),p(T)}}function g(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===gp?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case W:return"Fragment";case st:return"Profiler";case ht:return"StrictMode";case tt:return"Suspense";case Wt:return"SuspenseList";case We:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case Ct:return"Portal";case Kt:return(T.displayName||"Context")+".Provider";case bt:return(T._context.displayName||"Context")+".Consumer";case re:var P=T.render;return T=T.displayName,T||(T=P.displayName||P.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case Vt:return P=T.displayName||null,P!==null?P:g(T.type)||"Memo";case be:P=T._payload,T=T._init;try{return g(T(P))}catch{}}return null}function y(T){if(T===W)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===be)return"<...>";try{var P=g(T);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function b(){var T=Pt.A;return T===null?null:T.getOwner()}function S(){return Error("react-stack-top-frame")}function A(T){if(ka.call(T,"key")){var P=Object.getOwnPropertyDescriptor(T,"key").get;if(P&&P.isReactWarning)return!1}return T.key!==void 0}function _(T,P){function et(){Bs||(Bs=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}et.isReactWarning=!0,Object.defineProperty(T,"key",{get:et,configurable:!0})}function R(){var T=g(this.type);return fl[T]||(fl[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function C(T,P,et,it,ft,Nt,Mt,qt){return et=Nt.ref,T={$$typeof:dt,type:T,key:P,props:Nt,_owner:ft},(et!==void 0?et:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:R}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Mt}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:qt}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function N(T,P){return P=C(T.type,P,void 0,void 0,T._owner,T.props,T._debugStack,T._debugTask),T._store&&(P._store.validated=T._store.validated),P}function O(T){return typeof T=="object"&&T!==null&&T.$$typeof===dt}function U(T){var P={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(et){return P[et]})}function I(T,P){return typeof T=="object"&&T!==null&&T.key!=null?(m(T.key),U(""+T.key)):P.toString(36)}function j(){}function F(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(j,j):(T.status="pending",T.then(function(P){T.status==="pending"&&(T.status="fulfilled",T.value=P)},function(P){T.status==="pending"&&(T.status="rejected",T.reason=P)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function J(T,P,et,it,ft){var Nt=typeof T;(Nt==="undefined"||Nt==="boolean")&&(T=null);var Mt=!1;if(T===null)Mt=!0;else switch(Nt){case"bigint":case"string":case"number":Mt=!0;break;case"object":switch(T.$$typeof){case dt:case Ct:Mt=!0;break;case be:return Mt=T._init,J(Mt(T._payload),P,et,it,ft)}}if(Mt){Mt=T,ft=ft(Mt);var qt=it===""?"."+I(Mt,0):it;return Hs(ft)?(et="",qt!=null&&(et=qt.replace(gl,"$&/")+"/"),J(ft,P,et,"",function(Fe){return Fe})):ft!=null&&(O(ft)&&(ft.key!=null&&(Mt&&Mt.key===ft.key||m(ft.key)),et=N(ft,et+(ft.key==null||Mt&&Mt.key===ft.key?"":(""+ft.key).replace(gl,"$&/")+"/")+qt),it!==""&&Mt!=null&&O(Mt)&&Mt.key==null&&Mt._store&&!Mt._store.validated&&(et._store.validated=2),ft=et),P.push(ft)),1}if(Mt=0,qt=it===""?".":it+":",Hs(T))for(var Ot=0;Ot<T.length;Ot++)it=T[Ot],Nt=qt+I(it,Ot),Mt+=J(it,P,et,Nt,ft);else if(Ot=a(T),typeof Ot=="function")for(Ot===T.entries&&(ml||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ml=!0),T=Ot.call(T),Ot=0;!(it=T.next()).done;)it=it.value,Nt=qt+I(it,Ot++),Mt+=J(it,P,et,Nt,ft);else if(Nt==="object"){if(typeof T.then=="function")return J(F(T),P,et,it,ft);throw P=String(T),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Mt}function X(T,P,et){if(T==null)return T;var it=[],ft=0;return J(T,it,"","",function(Nt){return P.call(et,Nt,ft++)}),it}function at(T){if(T._status===-1){var P=T._result;P=P(),P.then(function(et){(T._status===0||T._status===-1)&&(T._status=1,T._result=et)},function(et){(T._status===0||T._status===-1)&&(T._status=2,T._result=et)}),T._status===-1&&(T._status=0,T._result=P)}if(T._status===1)return P=T._result,P===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
10
+
11
+ Your code should look like:
12
+ const MyComponent = lazy(() => import('./MyComponent'))
13
+
14
+ Did you accidentally put curly braces around the import?`,P),"default"in P||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
15
+
16
+ Your code should look like:
17
+ const MyComponent = lazy(() => import('./MyComponent'))`,P),P.default;throw T._result}function K(){var T=Pt.H;return T===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
18
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
19
+ 2. You might be breaking the Rules of Hooks
20
+ 3. You might have more than one copy of React in the same app
21
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),T}function lt(){}function St(T){if(Pr===null)try{var P=("require"+Math.random()).slice(0,7);Pr=(l&&l[P]).call(l,"timers").setImmediate}catch{Pr=function(it){yl===!1&&(yl=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var ft=new MessageChannel;ft.port1.onmessage=it,ft.port2.postMessage(void 0)}}return Pr(T)}function yt(T){return 1<T.length&&typeof AggregateError=="function"?new AggregateError(T):T[0]}function Gt(T,P){P!==Fs-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Fs=P}function B(T,P,et){var it=Pt.actQueue;if(it!==null)if(it.length!==0)try{Q(it),St(function(){return B(T,P,et)});return}catch(ft){Pt.thrownErrors.push(ft)}else Pt.actQueue=null;0<Pt.thrownErrors.length?(it=yt(Pt.thrownErrors),Pt.thrownErrors.length=0,et(it)):P(T)}function Q(T){if(!bi){bi=!0;var P=0;try{for(;P<T.length;P++){var et=T[P];do{Pt.didUsePromise=!1;var it=et(!1);if(it!==null){if(Pt.didUsePromise){T[P]=et,T.splice(0,P);return}et=it}else break}while(!0)}T.length=0}catch(ft){T.splice(0,P+1),Pt.thrownErrors.push(ft)}finally{bi=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var dt=Symbol.for("react.transitional.element"),Ct=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),ht=Symbol.for("react.strict_mode"),st=Symbol.for("react.profiler"),bt=Symbol.for("react.consumer"),Kt=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),tt=Symbol.for("react.suspense"),Wt=Symbol.for("react.suspense_list"),Vt=Symbol.for("react.memo"),be=Symbol.for("react.lazy"),We=Symbol.for("react.activity"),wn=Symbol.iterator,gi={},Un={isMounted:function(){return!1},enqueueForceUpdate:function(T){r(T,"forceUpdate")},enqueueReplaceState:function(T){r(T,"replaceState")},enqueueSetState:function(T){r(T,"setState")}},is=Object.assign,Oa={};Object.freeze(Oa),c.prototype.isReactComponent={},c.prototype.setState=function(T,P){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,P,"setState")},c.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};var Ne={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},ss;for(ss in Ne)Ne.hasOwnProperty(ss)&&i(ss,Ne[ss]);u.prototype=c.prototype,Ne=h.prototype=new u,Ne.constructor=h,is(Ne,c.prototype),Ne.isPureReactComponent=!0;var Hs=Array.isArray,gp=Symbol.for("react.client.reference"),Pt={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ka=Object.prototype.hasOwnProperty,Lr=console.createTask?console.createTask:function(){return null};Ne={"react-stack-bottom-frame":function(T){return T()}};var Bs,Uu,fl={},zu=Ne["react-stack-bottom-frame"].bind(Ne,S)(),pl=Lr(y(S)),ml=!1,gl=/\/+/g,Ir=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},yl=!1,Pr=null,Fs=0,yi=!1,bi=!1,js=typeof queueMicrotask=="function"?function(T){queueMicrotask(function(){return queueMicrotask(T)})}:St;Ne=Object.freeze({__proto__:null,c:function(T){return K().useMemoCache(T)}}),t.Children={map:X,forEach:function(T,P,et){X(T,function(){P.apply(this,arguments)},et)},count:function(T){var P=0;return X(T,function(){P++}),P},toArray:function(T){return X(T,function(P){return P})||[]},only:function(T){if(!O(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},t.Component=c,t.Fragment=W,t.Profiler=st,t.PureComponent=h,t.StrictMode=ht,t.Suspense=tt,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pt,t.__COMPILER_RUNTIME=Ne,t.act=function(T){var P=Pt.actQueue,et=Fs;Fs++;var it=Pt.actQueue=P!==null?P:[],ft=!1;try{var Nt=T()}catch(Ot){Pt.thrownErrors.push(Ot)}if(0<Pt.thrownErrors.length)throw Gt(P,et),T=yt(Pt.thrownErrors),Pt.thrownErrors.length=0,T;if(Nt!==null&&typeof Nt=="object"&&typeof Nt.then=="function"){var Mt=Nt;return js(function(){ft||yi||(yi=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(Ot,Fe){ft=!0,Mt.then(function(as){if(Gt(P,et),et===0){try{Q(it),St(function(){return B(as,Ot,Fe)})}catch(bp){Pt.thrownErrors.push(bp)}if(0<Pt.thrownErrors.length){var yp=yt(Pt.thrownErrors);Pt.thrownErrors.length=0,Fe(yp)}}else Ot(as)},function(as){Gt(P,et),0<Pt.thrownErrors.length&&(as=yt(Pt.thrownErrors),Pt.thrownErrors.length=0),Fe(as)})}}}var qt=Nt;if(Gt(P,et),et===0&&(Q(it),it.length!==0&&js(function(){ft||yi||(yi=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Pt.actQueue=null),0<Pt.thrownErrors.length)throw T=yt(Pt.thrownErrors),Pt.thrownErrors.length=0,T;return{then:function(Ot,Fe){ft=!0,et===0?(Pt.actQueue=it,St(function(){return B(qt,Ot,Fe)})):Ot(qt)}}},t.cache=function(T){return function(){return T.apply(null,arguments)}},t.captureOwnerStack=function(){var T=Pt.getCurrentStack;return T===null?null:T()},t.cloneElement=function(T,P,et){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var it=is({},T.props),ft=T.key,Nt=T._owner;if(P!=null){var Mt;t:{if(ka.call(P,"ref")&&(Mt=Object.getOwnPropertyDescriptor(P,"ref").get)&&Mt.isReactWarning){Mt=!1;break t}Mt=P.ref!==void 0}Mt&&(Nt=b()),A(P)&&(m(P.key),ft=""+P.key);for(qt in P)!ka.call(P,qt)||qt==="key"||qt==="__self"||qt==="__source"||qt==="ref"&&P.ref===void 0||(it[qt]=P[qt])}var qt=arguments.length-2;if(qt===1)it.children=et;else if(1<qt){Mt=Array(qt);for(var Ot=0;Ot<qt;Ot++)Mt[Ot]=arguments[Ot+2];it.children=Mt}for(it=C(T.type,ft,void 0,void 0,Nt,it,T._debugStack,T._debugTask),ft=2;ft<arguments.length;ft++)Nt=arguments[ft],O(Nt)&&Nt._store&&(Nt._store.validated=1);return it},t.createContext=function(T){return T={$$typeof:Kt,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:bt,_context:T},T._currentRenderer=null,T._currentRenderer2=null,T},t.createElement=function(T,P,et){for(var it=2;it<arguments.length;it++){var ft=arguments[it];O(ft)&&ft._store&&(ft._store.validated=1)}if(it={},ft=null,P!=null)for(Ot in Uu||!("__self"in P)||"key"in P||(Uu=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),A(P)&&(m(P.key),ft=""+P.key),P)ka.call(P,Ot)&&Ot!=="key"&&Ot!=="__self"&&Ot!=="__source"&&(it[Ot]=P[Ot]);var Nt=arguments.length-2;if(Nt===1)it.children=et;else if(1<Nt){for(var Mt=Array(Nt),qt=0;qt<Nt;qt++)Mt[qt]=arguments[qt+2];Object.freeze&&Object.freeze(Mt),it.children=Mt}if(T&&T.defaultProps)for(Ot in Nt=T.defaultProps,Nt)it[Ot]===void 0&&(it[Ot]=Nt[Ot]);ft&&_(it,typeof T=="function"?T.displayName||T.name||"Unknown":T);var Ot=1e4>Pt.recentlyCreatedOwnerStacks++;return C(T,ft,void 0,void 0,b(),it,Ot?Error("react-stack-top-frame"):zu,Ot?Lr(y(T)):pl)},t.createRef=function(){var T={current:null};return Object.seal(T),T},t.forwardRef=function(T){T!=null&&T.$$typeof===Vt?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof T!="function"?console.error("forwardRef requires a render function but was given %s.",T===null?"null":typeof T):T.length!==0&&T.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",T.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),T!=null&&T.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var P={$$typeof:re,render:T},et;return Object.defineProperty(P,"displayName",{enumerable:!1,configurable:!0,get:function(){return et},set:function(it){et=it,T.name||T.displayName||(Object.defineProperty(T,"name",{value:it}),T.displayName=it)}}),P},t.isValidElement=O,t.lazy=function(T){return{$$typeof:be,_payload:{_status:-1,_result:T},_init:at}},t.memo=function(T,P){T==null&&console.error("memo: The first argument must be a component. Instead received: %s",T===null?"null":typeof T),P={$$typeof:Vt,type:T,compare:P===void 0?null:P};var et;return Object.defineProperty(P,"displayName",{enumerable:!1,configurable:!0,get:function(){return et},set:function(it){et=it,T.name||T.displayName||(Object.defineProperty(T,"name",{value:it}),T.displayName=it)}}),P},t.startTransition=function(T){var P=Pt.T,et={};Pt.T=et,et._updatedFibers=new Set;try{var it=T(),ft=Pt.S;ft!==null&&ft(et,it),typeof it=="object"&&it!==null&&typeof it.then=="function"&&it.then(lt,Ir)}catch(Nt){Ir(Nt)}finally{P===null&&et._updatedFibers&&(T=et._updatedFibers.size,et._updatedFibers.clear(),10<T&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Pt.T=P}},t.unstable_useCacheRefresh=function(){return K().useCacheRefresh()},t.use=function(T){return K().use(T)},t.useActionState=function(T,P,et){return K().useActionState(T,P,et)},t.useCallback=function(T,P){return K().useCallback(T,P)},t.useContext=function(T){var P=K();return T.$$typeof===bt&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),P.useContext(T)},t.useDebugValue=function(T,P){return K().useDebugValue(T,P)},t.useDeferredValue=function(T,P){return K().useDeferredValue(T,P)},t.useEffect=function(T,P,et){T==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var it=K();if(typeof et=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return it.useEffect(T,P)},t.useId=function(){return K().useId()},t.useImperativeHandle=function(T,P,et){return K().useImperativeHandle(T,P,et)},t.useInsertionEffect=function(T,P){return T==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),K().useInsertionEffect(T,P)},t.useLayoutEffect=function(T,P){return T==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),K().useLayoutEffect(T,P)},t.useMemo=function(T,P){return K().useMemo(T,P)},t.useOptimistic=function(T,P){return K().useOptimistic(T,P)},t.useReducer=function(T,P,et){return K().useReducer(T,P,et)},t.useRef=function(T){return K().useRef(T)},t.useState=function(T){return K().useState(T)},t.useSyncExternalStore=function(T,P,et){return K().useSyncExternalStore(T,P,et)},t.useTransition=function(){return K().useTransition()},t.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()}(zo,zo.exports)),zo.exports}var Vy;function jc(){return Vy||(Vy=1,Ih.exports=a1()),Ih.exports}var An=jc();const r1=s1(An);var Ph={exports:{}},Ho={},Uh={exports:{}},zh={},qy;function o1(){return qy||(qy=1,function(l){/**
22
+ * @license React
23
+ * scheduler.development.js
24
+ *
25
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */(function(){function t(){if(I=!1,X){var B=l.unstable_now();lt=B;var Q=!0;try{t:{O=!1,U&&(U=!1,F(at),at=-1),N=!0;var dt=C;try{e:{for(u(B),R=a(S);R!==null&&!(R.expirationTime>B&&p());){var Ct=R.callback;if(typeof Ct=="function"){R.callback=null,C=R.priorityLevel;var W=Ct(R.expirationTime<=B);if(B=l.unstable_now(),typeof W=="function"){R.callback=W,u(B),Q=!0;break e}R===a(S)&&r(S),u(B)}else r(S);R=a(S)}if(R!==null)Q=!0;else{var ht=a(A);ht!==null&&m(h,ht.startTime-B),Q=!1}}break t}finally{R=null,C=dt,N=!1}Q=void 0}}finally{Q?St():X=!1}}}function i(B,Q){var dt=B.length;B.push(Q);t:for(;0<dt;){var Ct=dt-1>>>1,W=B[Ct];if(0<c(W,Q))B[Ct]=Q,B[dt]=W,dt=Ct;else break t}}function a(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Q=B[0],dt=B.pop();if(dt!==Q){B[0]=dt;t:for(var Ct=0,W=B.length,ht=W>>>1;Ct<ht;){var st=2*(Ct+1)-1,bt=B[st],Kt=st+1,re=B[Kt];if(0>c(bt,dt))Kt<W&&0>c(re,bt)?(B[Ct]=re,B[Kt]=dt,Ct=Kt):(B[Ct]=bt,B[st]=dt,Ct=st);else if(Kt<W&&0>c(re,dt))B[Ct]=re,B[Kt]=dt,Ct=Kt;else break t}}return Q}function c(B,Q){var dt=B.sortIndex-Q.sortIndex;return dt!==0?dt:B.id-Q.id}function u(B){for(var Q=a(A);Q!==null;){if(Q.callback===null)r(A);else if(Q.startTime<=B)r(A),Q.sortIndex=Q.expirationTime,i(S,Q);else break;Q=a(A)}}function h(B){if(U=!1,u(B),!O)if(a(S)!==null)O=!0,X||(X=!0,St());else{var Q=a(A);Q!==null&&m(h,Q.startTime-B)}}function p(){return I?!0:!(l.unstable_now()-lt<K)}function m(B,Q){at=j(function(){B(l.unstable_now())},Q)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;l.unstable_now=function(){return g.now()}}else{var y=Date,b=y.now();l.unstable_now=function(){return y.now()-b}}var S=[],A=[],_=1,R=null,C=3,N=!1,O=!1,U=!1,I=!1,j=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null,X=!1,at=-1,K=5,lt=-1;if(typeof J=="function")var St=function(){J(t)};else if(typeof MessageChannel<"u"){var yt=new MessageChannel,Gt=yt.port2;yt.port1.onmessage=t,St=function(){Gt.postMessage(null)}}else St=function(){j(t,0)};l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(B){B.callback=null},l.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<B?Math.floor(1e3/B):5},l.unstable_getCurrentPriorityLevel=function(){return C},l.unstable_next=function(B){switch(C){case 1:case 2:case 3:var Q=3;break;default:Q=C}var dt=C;C=Q;try{return B()}finally{C=dt}},l.unstable_requestPaint=function(){I=!0},l.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var dt=C;C=B;try{return Q()}finally{C=dt}},l.unstable_scheduleCallback=function(B,Q,dt){var Ct=l.unstable_now();switch(typeof dt=="object"&&dt!==null?(dt=dt.delay,dt=typeof dt=="number"&&0<dt?Ct+dt:Ct):dt=Ct,B){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=dt+W,B={id:_++,callback:Q,priorityLevel:B,startTime:dt,expirationTime:W,sortIndex:-1},dt>Ct?(B.sortIndex=dt,i(A,B),a(S)===null&&B===a(A)&&(U?(F(at),at=-1):U=!0,m(h,dt-Ct))):(B.sortIndex=W,i(S,B),O||N||(O=!0,X||(X=!0,St()))),B},l.unstable_shouldYield=p,l.unstable_wrapCallback=function(B){var Q=C;return function(){var dt=C;C=Q;try{return B.apply(this,arguments)}finally{C=dt}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()}(zh)),zh}var Yy;function l1(){return Yy||(Yy=1,Uh.exports=o1()),Uh.exports}var Hh={exports:{}},sn={},Xy;function c1(){if(Xy)return sn;Xy=1;/**
30
+ * @license React
31
+ * react-dom.development.js
32
+ *
33
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
34
+ *
35
+ * This source code is licensed under the MIT license found in the
36
+ * LICENSE file in the root directory of this source tree.
37
+ */return function(){function l(){}function t(y){return""+y}function i(y,b,S){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(A);var _=!1}catch{_=!0}return _&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object"),t(A)),{$$typeof:m,key:A==null?null:""+A,children:y,containerInfo:b,implementation:S}}function a(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}function r(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function c(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function u(){var y=g.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
38
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
39
+ 2. You might be breaking the Rules of Hooks
40
+ 3. You might have more than one copy of React in the same app
41
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var h=jc(),p={d:{f:l,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},m=Symbol.for("react.portal"),g=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,sn.createPortal=function(y,b){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error("Target container is not a DOM element.");return i(y,b,null,S)},sn.flushSync=function(y){var b=g.T,S=p.p;try{if(g.T=null,p.p=2,y)return y()}finally{g.T=b,p.p=S,p.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},sn.preconnect=function(y,b){typeof y=="string"&&y?b!=null&&typeof b!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",c(b)):b!=null&&typeof b.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",r(b.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(y)),typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,p.d.C(y,b))},sn.prefetchDNS=function(y){if(typeof y!="string"||!y)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(y));else if(1<arguments.length){var b=arguments[1];typeof b=="object"&&b.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",c(b)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",c(b))}typeof y=="string"&&p.d.D(y)},sn.preinit=function(y,b){if(typeof y=="string"&&y?b==null||typeof b!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",c(b)):b.as!=="style"&&b.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',c(b.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(y)),typeof y=="string"&&b&&typeof b.as=="string"){var S=b.as,A=a(S,b.crossOrigin),_=typeof b.integrity=="string"?b.integrity:void 0,R=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;S==="style"?p.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:A,integrity:_,fetchPriority:R}):S==="script"&&p.d.X(y,{crossOrigin:A,integrity:_,fetchPriority:R,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},sn.preinitModule=function(y,b){var S="";if(typeof y=="string"&&y||(S+=" The `href` argument encountered was "+r(y)+"."),b!==void 0&&typeof b!="object"?S+=" The `options` argument encountered was "+r(b)+".":b&&"as"in b&&b.as!=="script"&&(S+=" The `as` option encountered was "+c(b.as)+"."),S)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",S);else switch(S=b&&typeof b.as=="string"?b.as:"script",S){case"script":break;default:S=c(S),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',S,y)}typeof y=="string"&&(typeof b=="object"&&b!==null?(b.as==null||b.as==="script")&&(S=a(b.as,b.crossOrigin),p.d.M(y,{crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})):b==null&&p.d.M(y))},sn.preload=function(y,b){var S="";if(typeof y=="string"&&y||(S+=" The `href` argument encountered was "+r(y)+"."),b==null||typeof b!="object"?S+=" The `options` argument encountered was "+r(b)+".":typeof b.as=="string"&&b.as||(S+=" The `as` option encountered was "+r(b.as)+"."),S&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',S),typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){S=b.as;var A=a(S,b.crossOrigin);p.d.L(y,S,{crossOrigin:A,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},sn.preloadModule=function(y,b){var S="";typeof y=="string"&&y||(S+=" The `href` argument encountered was "+r(y)+"."),b!==void 0&&typeof b!="object"?S+=" The `options` argument encountered was "+r(b)+".":b&&"as"in b&&typeof b.as!="string"&&(S+=" The `as` option encountered was "+r(b.as)+"."),S&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',S),typeof y=="string"&&(b?(S=a(b.as,b.crossOrigin),p.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0})):p.d.m(y))},sn.requestFormReset=function(y){p.d.r(y)},sn.unstable_batchedUpdates=function(y,b){return y(b)},sn.useFormState=function(y,b,S){return u().useFormState(y,b,S)},sn.useFormStatus=function(){return u().useHostTransitionStatus()},sn.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),sn}var Wy;function u1(){return Wy||(Wy=1,Hh.exports=c1()),Hh.exports}var Qy;function d1(){if(Qy)return Ho;Qy=1;/**
42
+ * @license React
43
+ * react-dom-client.development.js
44
+ *
45
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
46
+ *
47
+ * This source code is licensed under the MIT license found in the
48
+ * LICENSE file in the root directory of this source tree.
49
+ */return function(){function l(e,n){for(e=e.memoizedState;e!==null&&0<n;)e=e.next,n--;return e}function t(e,n,s,o){if(s>=n.length)return o;var d=n[s],f=Je(e)?e.slice():Lt({},e);return f[d]=t(e[d],n,s+1,o),f}function i(e,n,s){if(n.length!==s.length)console.warn("copyWithRename() expects paths of the same length");else{for(var o=0;o<s.length-1;o++)if(n[o]!==s[o]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return a(e,n,s,0)}}function a(e,n,s,o){var d=n[o],f=Je(e)?e.slice():Lt({},e);return o+1===n.length?(f[s[o]]=f[d],Je(f)?f.splice(d,1):delete f[d]):f[d]=a(e[d],n,s,o+1),f}function r(e,n,s){var o=n[s],d=Je(e)?e.slice():Lt({},e);return s+1===n.length?(Je(d)?d.splice(o,1):delete d[o],d):(d[o]=r(e[o],n,s+1),d)}function c(){return!1}function u(){return null}function h(){}function p(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function m(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function g(){}function y(e){var n=[];return e.forEach(function(s){n.push(s)}),n.sort().join(", ")}function b(e,n,s,o){return new xk(e,n,s,o)}function S(e,n){e.context===sa&&(pg(e.current,2,n,e,null,null),Yr())}function A(e,n){if(si!==null){var s=n.staleFamilies;n=n.updatedFamilies,$l(),Np(e.current,n,s),Yr()}}function _(e){si=e}function R(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function C(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function N(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function O(e){if(C(e)!==e)throw Error("Unable to find node on an unmounted component.")}function U(e){var n=e.alternate;if(!n){if(n=C(e),n===null)throw Error("Unable to find node on an unmounted component.");return n!==e?null:e}for(var s=e,o=n;;){var d=s.return;if(d===null)break;var f=d.alternate;if(f===null){if(o=d.return,o!==null){s=o;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===s)return O(d),e;if(f===o)return O(d),n;f=f.sibling}throw Error("Unable to find node on an unmounted component.")}if(s.return!==o.return)s=d,o=f;else{for(var v=!1,E=d.child;E;){if(E===s){v=!0,s=d,o=f;break}if(E===o){v=!0,o=d,s=f;break}E=E.sibling}if(!v){for(E=f.child;E;){if(E===s){v=!0,s=f,o=d;break}if(E===o){v=!0,o=f,s=d;break}E=E.sibling}if(!v)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(s.alternate!==o)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(s.tag!==3)throw Error("Unable to find node on an unmounted component.");return s.stateNode.current===s?e:n}function I(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=I(e),n!==null)return n;e=e.sibling}return null}function j(e){return e===null||typeof e!="object"?null:(e=E_&&e[E_]||e["@@iterator"],typeof e=="function"?e:null)}function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$N?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case to:return"Fragment";case Eg:return"Profiler";case Hd:return"StrictMode";case _g:return"Suspense";case Tg:return"SuspenseList";case wg:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Jr:return"Portal";case Bi:return(e.displayName||"Context")+".Provider";case Ag:return(e._context.displayName||"Context")+".Consumer";case Zl:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bd:return n=e.displayName||null,n!==null?n:F(e.type)||"Memo";case $n:n=e._payload,e=e._init;try{return F(e(n))}catch{}}return null}function J(e){return typeof e.tag=="number"?X(e):typeof e.name=="string"?e.name:null}function X(e){var n=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(n._context.displayName||"Context")+".Consumer";case 10:return(n.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(n);case 8:return n===Hd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;break;case 29:if(n=e._debugInfo,n!=null){for(var s=n.length-1;0<=s;s--)if(typeof n[s].name=="string")return n[s].name}if(e.return!==null)return X(e.return)}return null}function at(e){return{current:e}}function K(e,n){0>ms?console.error("Unexpected pop."):(n!==xg[ms]&&console.error("Unexpected Fiber popped."),e.current=Cg[ms],Cg[ms]=null,xg[ms]=null,ms--)}function lt(e,n,s){ms++,Cg[ms]=e.current,xg[ms]=s,e.current=n}function St(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function yt(e,n){lt(ta,n,e),lt(Jl,e,e),lt(Js,null,e);var s=n.nodeType;switch(s){case 9:case 11:s=s===9?"#document":"#fragment",n=(n=n.documentElement)&&(n=n.namespaceURI)?WA(n):xs;break;default:if(s=n.tagName,n=n.namespaceURI)n=WA(n),n=QA(n,s);else switch(s){case"svg":n=Po;break;case"math":n=Ch;break;default:n=xs}}s=s.toLowerCase(),s=aS(null,s),s={context:n,ancestorInfo:s},K(Js,e),lt(Js,s,e)}function Gt(e){K(Js,e),K(Jl,e),K(ta,e)}function B(){return St(Js.current)}function Q(e){e.memoizedState!==null&&lt(Fd,e,e);var n=St(Js.current),s=e.type,o=QA(n.context,s);s=aS(n.ancestorInfo,s),o={context:o,ancestorInfo:s},n!==o&&(lt(Jl,e,e),lt(Js,o,e))}function dt(e){Jl.current===e&&(K(Js,e),K(Jl,e)),Fd.current===e&&(K(Fd,e),Uc._currentValue=pr)}function Ct(e){return typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function W(e){try{return ht(e),!1}catch{return!0}}function ht(e){return""+e}function st(e,n){if(W(e))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",n,Ct(e)),ht(e)}function bt(e,n){if(W(e))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",n,Ct(e)),ht(e)}function Kt(e){if(W(e))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",Ct(e)),ht(e)}function re(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled)return!0;if(!n.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{no=n.inject(e),rn=n}catch(s){console.error("React instrumentation encountered an error: %s.",s)}return!!n.checkDCE}function tt(e){if(typeof QN=="function"&&KN(e),rn&&typeof rn.setStrictMode=="function")try{rn.setStrictMode(no,e)}catch(n){ji||(ji=!0,console.error("React instrumentation encountered an error: %s",n))}}function Wt(e){rt=e}function Vt(){rt!==null&&typeof rt.markCommitStopped=="function"&&rt.markCommitStopped()}function be(e){rt!==null&&typeof rt.markComponentRenderStarted=="function"&&rt.markComponentRenderStarted(e)}function We(){rt!==null&&typeof rt.markComponentRenderStopped=="function"&&rt.markComponentRenderStopped()}function wn(e){rt!==null&&typeof rt.markRenderStarted=="function"&&rt.markRenderStarted(e)}function gi(){rt!==null&&typeof rt.markRenderStopped=="function"&&rt.markRenderStopped()}function Un(e,n){rt!==null&&typeof rt.markStateUpdateScheduled=="function"&&rt.markStateUpdateScheduled(e,n)}function is(e){return e>>>=0,e===0?32:31-(ZN(e)/JN|0)|0}function Oa(e){if(e&1)return"SyncHydrationLane";if(e&2)return"Sync";if(e&4)return"InputContinuousHydration";if(e&8)return"InputContinuous";if(e&16)return"DefaultHydration";if(e&32)return"Default";if(e&128)return"TransitionHydration";if(e&4194048)return"Transition";if(e&62914560)return"Retry";if(e&67108864)return"SelectiveHydration";if(e&134217728)return"IdleHydration";if(e&268435456)return"Idle";if(e&536870912)return"Offscreen";if(e&1073741824)return"Deferred"}function Ne(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function ss(e,n,s){var o=e.pendingLanes;if(o===0)return 0;var d=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var E=o&134217727;return E!==0?(o=E&~f,o!==0?d=Ne(o):(v&=E,v!==0?d=Ne(v):s||(s=E&~e,s!==0&&(d=Ne(s))))):(E=o&~f,E!==0?d=Ne(E):v!==0?d=Ne(v):s||(s=o&~e,s!==0&&(d=Ne(s)))),d===0?0:n!==0&&n!==d&&(n&f)===0&&(f=d&-d,s=n&-n,f>=s||f===32&&(s&4194048)!==0)?n:d}function Hs(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function gp(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function Pt(){var e=jd;return jd<<=1,(jd&4194048)===0&&(jd=256),e}function ka(){var e=$d;return $d<<=1,($d&62914560)===0&&($d=4194304),e}function Lr(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function Bs(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Uu(e,n,s,o,d,f){var v=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var E=e.entanglements,w=e.expirationTimes,x=e.hiddenUpdates;for(s=v&~s;0<s;){var H=31-mn(s),V=1<<H;E[H]=0,w[H]=-1;var z=x[H];if(z!==null)for(x[H]=null,H=0;H<z.length;H++){var q=z[H];q!==null&&(q.lane&=-536870913)}s&=~V}o!==0&&fl(e,o,0),f!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=f&~(v&~n))}function fl(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-mn(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|s&4194090}function zu(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var o=31-mn(s),d=1<<o;d&n|e[o]&n&&(e[o]|=n),s&=~d}}function pl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ml(e,n,s){if(Ei)for(e=e.pendingUpdatersLaneMap;0<s;){var o=31-mn(s),d=1<<o;e[o].add(n),s&=~d}}function gl(e,n){if(Ei)for(var s=e.pendingUpdatersLaneMap,o=e.memoizedUpdaters;0<n;){var d=31-mn(n);e=1<<d,d=s[d],0<d.size&&(d.forEach(function(f){var v=f.alternate;v!==null&&o.has(v)||o.add(f)}),d.clear()),n&=~e}}function Ir(e){return e&=-e,ni<e?$i<e?(e&134217727)!==0?ys:Gd:$i:ni}function yl(){var e=Zt.p;return e!==0?e:(e=window.event,e===void 0?ys:m_(e.type))}function Pr(e,n){var s=Zt.p;try{return Zt.p=e,n()}finally{Zt.p=s}}function Fs(e){delete e[on],delete e[Mn],delete e[kg],delete e[tL],delete e[eL]}function yi(e){var n=e[on];if(n)return n;for(var s=e.parentNode;s;){if(n=s[na]||s[on]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=n_(e);e!==null;){if(s=e[on])return s;e=n_(e)}return n}e=s,s=e.parentNode}return null}function bi(e){if(e=e[on]||e[na]){var n=e.tag;if(n===5||n===6||n===13||n===26||n===27||n===3)return e}return null}function js(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function T(e){var n=e[A_];return n||(n=e[A_]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function P(e){e[tc]=!0}function et(e,n){it(e,n),it(e+"Capture",n)}function it(e,n){Wa[e]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",e),Wa[e]=n;var s=e.toLowerCase();for(Ng[s]=e,e==="onDoubleClick"&&(Ng.ondblclick=e),e=0;e<n.length;e++)__.add(n[e])}function ft(e,n){nL[n.type]||n.onChange||n.onInput||n.readOnly||n.disabled||n.value==null||console.error(e==="select"?"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`.":"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),n.onChange||n.readOnly||n.disabled||n.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function Nt(e){return gs.call(w_,e)?!0:gs.call(T_,e)?!1:iL.test(e)?w_[e]=!0:(T_[e]=!0,console.error("Invalid attribute name: `%s`",e),!1)}function Mt(e,n,s){if(Nt(n)){if(!e.hasAttribute(n)){switch(typeof s){case"symbol":case"object":return s;case"function":return s;case"boolean":if(s===!1)return s}return s===void 0?void 0:null}return e=e.getAttribute(n),e===""&&s===!0?!0:(st(s,n),e===""+s?s:e)}}function qt(e,n,s){if(Nt(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}st(s,n),e.setAttribute(n,""+s)}}function Ot(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}st(s,n),e.setAttribute(n,""+s)}}function Fe(e,n,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}st(o,s),e.setAttributeNS(n,s,""+o)}}function as(){}function yp(){if(ec===0){C_=console.log,x_=console.info,R_=console.warn,D_=console.error,M_=console.group,O_=console.groupCollapsed,k_=console.groupEnd;var e={configurable:!0,enumerable:!0,value:as,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ec++}function bp(){if(ec--,ec===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Lt({},e,{value:C_}),info:Lt({},e,{value:x_}),warn:Lt({},e,{value:R_}),error:Lt({},e,{value:D_}),group:Lt({},e,{value:M_}),groupCollapsed:Lt({},e,{value:O_}),groupEnd:Lt({},e,{value:k_})})}0>ec&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Kn(e){if(Lg===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Lg=n&&n[1]||"",N_=-1<s.stack.indexOf(`
50
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
51
+ `+Lg+e+N_}function vp(e,n){if(!e||Ig)return"";var s=Pg.get(e);if(s!==void 0)return s;Ig=!0,s=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var o=null;o=G.H,G.H=null,yp();try{var d={DetermineComponentFrameRoot:function(){try{if(n){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(ct){var q=ct}Reflect.construct(e,[],z)}else{try{z.call()}catch(ct){q=ct}e.call(z.prototype)}}else{try{throw Error()}catch(ct){q=ct}(z=e())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(ct){if(ct&&q&&typeof ct.stack=="string")return[ct.stack,q.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),E=v[0],w=v[1];if(E&&w){var x=E.split(`
52
+ `),H=w.split(`
53
+ `);for(v=f=0;f<x.length&&!x[f].includes("DetermineComponentFrameRoot");)f++;for(;v<H.length&&!H[v].includes("DetermineComponentFrameRoot");)v++;if(f===x.length||v===H.length)for(f=x.length-1,v=H.length-1;1<=f&&0<=v&&x[f]!==H[v];)v--;for(;1<=f&&0<=v;f--,v--)if(x[f]!==H[v]){if(f!==1||v!==1)do if(f--,v--,0>v||x[f]!==H[v]){var V=`
54
+ `+x[f].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),typeof e=="function"&&Pg.set(e,V),V}while(1<=f&&0<=v);break}}}finally{Ig=!1,G.H=o,bp(),Error.prepareStackTrace=s}return x=(x=e?e.displayName||e.name:"")?Kn(x):"",typeof e=="function"&&Pg.set(e,x),x}function j0(e){var n=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=n,e.startsWith(`Error: react-stack-top-frame
55
+ `)&&(e=e.slice(29)),n=e.indexOf(`
56
+ `),n!==-1&&(e=e.slice(n+1)),n=e.indexOf("react-stack-bottom-frame"),n!==-1&&(n=e.lastIndexOf(`
57
+ `,n)),n!==-1)e=e.slice(0,n);else return"";return e}function rk(e){switch(e.tag){case 26:case 27:case 5:return Kn(e.type);case 16:return Kn("Lazy");case 13:return Kn("Suspense");case 19:return Kn("SuspenseList");case 0:case 15:return vp(e.type,!1);case 11:return vp(e.type.render,!1);case 1:return vp(e.type,!0);case 31:return Kn("Activity");default:return""}}function $0(e){try{var n="";do{n+=rk(e);var s=e._debugInfo;if(s)for(var o=s.length-1;0<=o;o--){var d=s[o];if(typeof d.name=="string"){var f=n,v=d.env,E=Kn(d.name+(v?" ["+v+"]":""));n=f+E}}e=e.return}while(e);return n}catch(w){return`
58
+ Error generating stack: `+w.message+`
59
+ `+w.stack}}function G0(e){return(e=e?e.displayName||e.name:"")?Kn(e):""}function Hu(){if(Gn===null)return null;var e=Gn._debugOwner;return e!=null?J(e):null}function ok(){if(Gn===null)return"";var e=Gn;try{var n="";switch(e.tag===6&&(e=e.return),e.tag){case 26:case 27:case 5:n+=Kn(e.type);break;case 13:n+=Kn("Suspense");break;case 19:n+=Kn("SuspenseList");break;case 31:n+=Kn("Activity");break;case 30:case 0:case 15:case 1:e._debugOwner||n!==""||(n+=G0(e.type));break;case 11:e._debugOwner||n!==""||(n+=G0(e.type.render))}for(;e;)if(typeof e.tag=="number"){var s=e;e=s._debugOwner;var o=s._debugStack;e&&o&&(typeof o!="string"&&(s._debugStack=o=j0(o)),o!==""&&(n+=`
60
+ `+o))}else if(e.debugStack!=null){var d=e.debugStack;(e=e.owner)&&d&&(n+=`
61
+ `+j0(d))}else break;var f=n}catch(v){f=`
62
+ Error generating stack: `+v.message+`
63
+ `+v.stack}return f}function pt(e,n,s,o,d,f,v){var E=Gn;Sp(e);try{return e!==null&&e._debugTask?e._debugTask.run(n.bind(null,s,o,d,f,v)):n(s,o,d,f,v)}finally{Sp(E)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function Sp(e){G.getCurrentStack=e===null?null:ok,Gi=!1,Gn=e}function Zn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return Kt(e),e;default:return""}}function V0(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function lk(e){var n=V0(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);Kt(e[n]);var o=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,f=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(v){Kt(v),o=""+v,f.call(this,v)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(v){Kt(v),o=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Bu(e){e._valueTracker||(e._valueTracker=lk(e))}function q0(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),o="";return e&&(o=V0(e)?e.checked?"true":"false":e.value),e=o,e!==s?(n.setValue(e),!0):!1}function Fu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Jn(e){return e.replace(sL,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Y0(e,n){n.checked===void 0||n.defaultChecked===void 0||I_||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Hu()||"A component",n.type),I_=!0),n.value===void 0||n.defaultValue===void 0||L_||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Hu()||"A component",n.type),L_=!0)}function Ep(e,n,s,o,d,f,v,E){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?(st(v,"type"),e.type=v):e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Zn(n)):e.value!==""+Zn(n)&&(e.value=""+Zn(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?Ap(e,v,Zn(n)):s!=null?Ap(e,v,Zn(s)):o!=null&&e.removeAttribute("value"),d==null&&f!=null&&(e.defaultChecked=!!f),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?(st(E,"name"),e.name=""+Zn(E)):e.removeAttribute("name")}function X0(e,n,s,o,d,f,v,E){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(st(f,"type"),e.type=f),n!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||n!=null))return;s=s!=null?""+Zn(s):"",n=n!=null?""+Zn(n):s,E||n===e.value||(e.value=n),e.defaultValue=n}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=E?e.checked:!!o,e.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(st(v,"name"),e.name=v)}function Ap(e,n,s){n==="number"&&Fu(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function W0(e,n){n.value==null&&(typeof n.children=="object"&&n.children!==null?Sg.Children.forEach(n.children,function(s){s==null||typeof s=="string"||typeof s=="number"||typeof s=="bigint"||U_||(U_=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):n.dangerouslySetInnerHTML==null||z_||(z_=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),n.selected==null||P_||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),P_=!0)}function Q0(){var e=Hu();return e?`
64
+
65
+ Check the render method of \``+e+"`.":""}function Ur(e,n,s,o){if(e=e.options,n){n={};for(var d=0;d<s.length;d++)n["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=n.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Zn(s),n=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function K0(e,n){for(e=0;e<B_.length;e++){var s=B_[e];if(n[s]!=null){var o=Je(n[s]);n.multiple&&!o?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",s,Q0()):!n.multiple&&o&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",s,Q0())}}n.value===void 0||n.defaultValue===void 0||H_||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),H_=!0)}function Z0(e,n){n.value===void 0||n.defaultValue===void 0||F_||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",Hu()||"A component"),F_=!0),n.children!=null&&n.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function J0(e,n,s){if(n!=null&&(n=""+Zn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+Zn(s):""}function tS(e,n,s,o){if(n==null){if(o!=null){if(s!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(Je(o)){if(1<o.length)throw Error("<textarea> can only have at most one child.");o=o[0]}s=o}s==null&&(s=""),n=s}s=Zn(n),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o)}function eS(e,n){return e.serverProps===void 0&&e.serverTail.length===0&&e.children.length===1&&3<e.distanceFromLeaf&&e.distanceFromLeaf>15-n?eS(e.children[0],n):e}function zn(e){return" "+" ".repeat(e)}function zr(e){return"+ "+" ".repeat(e)}function Na(e){return"- "+" ".repeat(e)}function nS(e){switch(e.tag){case 26:case 27:case 5:return e.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return e=e.type,e.displayName||e.name||null;case 11:return e=e.type.render,e.displayName||e.name||null;case 1:return e=e.type,e.displayName||e.name||null;default:return null}}function bl(e,n){return j_.test(e)?(e=JSON.stringify(e),e.length>n-2?8>n?'{"..."}':"{"+e.slice(0,n-7)+'..."}':"{"+e+"}"):e.length>n?5>n?'{"..."}':e.slice(0,n-3)+"...":e}function ju(e,n,s){var o=120-2*s;if(n===null)return zr(s)+bl(e,o)+`
66
+ `;if(typeof n=="string"){for(var d=0;d<n.length&&d<e.length&&n.charCodeAt(d)===e.charCodeAt(d);d++);return d>o-8&&10<d&&(e="..."+e.slice(d-8),n="..."+n.slice(d-8)),zr(s)+bl(e,o)+`
67
+ `+Na(s)+bl(n,o)+`
68
+ `}return zn(s)+bl(e,o)+`
69
+ `}function _p(e){return Object.prototype.toString.call(e).replace(/^\[object (.*)\]$/,function(n,s){return s})}function vl(e,n){switch(typeof e){case"string":return e=JSON.stringify(e),e.length>n?5>n?'"..."':e.slice(0,n-4)+'..."':e;case"object":if(e===null)return"null";if(Je(e))return"[...]";if(e.$$typeof===Zs)return(n=F(e.type))?"<"+n+">":"<...>";var s=_p(e);if(s==="Object"){s="",n-=2;for(var o in e)if(e.hasOwnProperty(o)){var d=JSON.stringify(o);if(d!=='"'+o+'"'&&(o=d),n-=o.length-2,d=vl(e[o],15>n?n:15),n-=d.length,0>n){s+=s===""?"...":", ...";break}s+=(s===""?"":",")+o+":"+d}return"{"+s+"}"}return s;case"function":return(n=e.displayName||e.name)?"function "+n:"function";default:return String(e)}}function Hr(e,n){return typeof e!="string"||j_.test(e)?"{"+vl(e,n-2)+"}":e.length>n-2?5>n?'"..."':'"'+e.slice(0,n-5)+'..."':'"'+e+'"'}function Tp(e,n,s){var o=120-s.length-e.length,d=[],f;for(f in n)if(n.hasOwnProperty(f)&&f!=="children"){var v=Hr(n[f],120-s.length-f.length-1);o-=f.length+v.length+2,d.push(f+"="+v)}return d.length===0?s+"<"+e+`>
70
+ `:0<o?s+"<"+e+" "+d.join(" ")+`>
71
+ `:s+"<"+e+`
72
+ `+s+" "+d.join(`
73
+ `+s+" ")+`
74
+ `+s+`>
75
+ `}function ck(e,n,s){var o="",d=Lt({},n),f;for(f in e)if(e.hasOwnProperty(f)){delete d[f];var v=120-2*s-f.length-2,E=vl(e[f],v);n.hasOwnProperty(f)?(v=vl(n[f],v),o+=zr(s)+f+": "+E+`
76
+ `,o+=Na(s)+f+": "+v+`
77
+ `):o+=zr(s)+f+": "+E+`
78
+ `}for(var w in d)d.hasOwnProperty(w)&&(e=vl(d[w],120-2*s-w.length-2),o+=Na(s)+w+": "+e+`
79
+ `);return o}function uk(e,n,s,o){var d="",f=new Map;for(x in s)s.hasOwnProperty(x)&&f.set(x.toLowerCase(),x);if(f.size===1&&f.has("children"))d+=Tp(e,n,zn(o));else{for(var v in n)if(n.hasOwnProperty(v)&&v!=="children"){var E=120-2*(o+1)-v.length-1,w=f.get(v.toLowerCase());if(w!==void 0){f.delete(v.toLowerCase());var x=n[v];w=s[w];var H=Hr(x,E);E=Hr(w,E),typeof x=="object"&&x!==null&&typeof w=="object"&&w!==null&&_p(x)==="Object"&&_p(w)==="Object"&&(2<Object.keys(x).length||2<Object.keys(w).length||-1<H.indexOf("...")||-1<E.indexOf("..."))?d+=zn(o+1)+v+`={{
80
+ `+ck(x,w,o+2)+zn(o+1)+`}}
81
+ `:(d+=zr(o+1)+v+"="+H+`
82
+ `,d+=Na(o+1)+v+"="+E+`
83
+ `)}else d+=zn(o+1)+v+"="+Hr(n[v],E)+`
84
+ `}f.forEach(function(V){if(V!=="children"){var z=120-2*(o+1)-V.length-1;d+=Na(o+1)+V+"="+Hr(s[V],z)+`
85
+ `}}),d=d===""?zn(o)+"<"+e+`>
86
+ `:zn(o)+"<"+e+`
87
+ `+d+zn(o)+`>
88
+ `}return e=s.children,n=n.children,typeof e=="string"||typeof e=="number"||typeof e=="bigint"?(f="",(typeof n=="string"||typeof n=="number"||typeof n=="bigint")&&(f=""+n),d+=ju(f,""+e,o+1)):(typeof n=="string"||typeof n=="number"||typeof n=="bigint")&&(d=e==null?d+ju(""+n,null,o+1):d+ju(""+n,void 0,o+1)),d}function iS(e,n){var s=nS(e);if(s===null){for(s="",e=e.child;e;)s+=iS(e,n),e=e.sibling;return s}return zn(n)+"<"+s+`>
89
+ `}function wp(e,n){var s=eS(e,n);if(s!==e&&(e.children.length!==1||e.children[0]!==s))return zn(n)+`...
90
+ `+wp(s,n+1);s="";var o=e.fiber._debugInfo;if(o)for(var d=0;d<o.length;d++){var f=o[d].name;typeof f=="string"&&(s+=zn(n)+"<"+f+`>
91
+ `,n++)}if(o="",d=e.fiber.pendingProps,e.fiber.tag===6)o=ju(d,e.serverProps,n),n++;else if(f=nS(e.fiber),f!==null)if(e.serverProps===void 0){o=n;var v=120-2*o-f.length-2,E="";for(x in d)if(d.hasOwnProperty(x)&&x!=="children"){var w=Hr(d[x],15);if(v-=x.length+w.length+2,0>v){E+=" ...";break}E+=" "+x+"="+w}o=zn(o)+"<"+f+E+`>
92
+ `,n++}else e.serverProps===null?(o=Tp(f,d,zr(n)),n++):typeof e.serverProps=="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(o=uk(f,d,e.serverProps,n),n++);var x="";for(d=e.fiber.child,f=0;d&&f<e.children.length;)v=e.children[f],v.fiber===d?(x+=wp(v,n),f++):x+=iS(d,n),d=d.sibling;for(d&&0<e.children.length&&(x+=zn(n)+`...
93
+ `),d=e.serverTail,e.serverProps===null&&n--,e=0;e<d.length;e++)f=d[e],x=typeof f=="string"?x+(Na(n)+bl(f,120-2*n)+`
94
+ `):x+Tp(f.type,f.props,Na(n));return s+o+x}function Cp(e){try{return`
95
+
96
+ `+wp(e,0)}catch{return""}}function sS(e,n,s){for(var o=n,d=null,f=0;o;)o===e&&(f=0),d={fiber:o,children:d!==null?[d]:[],serverProps:o===n?s:o===e?null:void 0,serverTail:[],distanceFromLeaf:f},f++,o=o.return;return d!==null?Cp(d).replaceAll(/^[+-]/gm,">"):""}function aS(e,n){var s=Lt({},e||G_),o={tag:n};return $_.indexOf(n)!==-1&&(s.aTagInScope=null,s.buttonTagInScope=null,s.nobrTagInScope=null),rL.indexOf(n)!==-1&&(s.pTagInButtonScope=null),aL.indexOf(n)!==-1&&n!=="address"&&n!=="div"&&n!=="p"&&(s.listItemTagAutoclosing=null,s.dlItemTagAutoclosing=null),s.current=o,n==="form"&&(s.formTag=o),n==="a"&&(s.aTagInScope=o),n==="button"&&(s.buttonTagInScope=o),n==="nobr"&&(s.nobrTagInScope=o),n==="p"&&(s.pTagInButtonScope=o),n==="li"&&(s.listItemTagAutoclosing=o),(n==="dd"||n==="dt")&&(s.dlItemTagAutoclosing=o),n==="#document"||n==="html"?s.containerTagInScope=null:s.containerTagInScope||(s.containerTagInScope=o),e!==null||n!=="#document"&&n!=="html"&&n!=="body"?s.implicitRootScope===!0&&(s.implicitRootScope=!1):s.implicitRootScope=!0,s}function rS(e,n,s){switch(n){case"select":return e==="hr"||e==="option"||e==="optgroup"||e==="script"||e==="template"||e==="#text";case"optgroup":return e==="option"||e==="#text";case"option":return e==="#text";case"tr":return e==="th"||e==="td"||e==="style"||e==="script"||e==="template";case"tbody":case"thead":case"tfoot":return e==="tr"||e==="style"||e==="script"||e==="template";case"colgroup":return e==="col"||e==="template";case"table":return e==="caption"||e==="colgroup"||e==="tbody"||e==="tfoot"||e==="thead"||e==="style"||e==="script"||e==="template";case"head":return e==="base"||e==="basefont"||e==="bgsound"||e==="link"||e==="meta"||e==="title"||e==="noscript"||e==="noframes"||e==="style"||e==="script"||e==="template";case"html":if(s)break;return e==="head"||e==="body"||e==="frameset";case"frameset":return e==="frame";case"#document":if(!s)return e==="html"}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6";case"rp":case"rt":return oL.indexOf(n)===-1;case"caption":case"col":case"colgroup":case"frameset":case"frame":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return n==null;case"head":return s||n===null;case"html":return s&&n==="#document"||n===null;case"body":return s&&(n==="#document"||n==="html")||n===null}return!0}function dk(e,n){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return n.pTagInButtonScope;case"form":return n.formTag||n.pTagInButtonScope;case"li":return n.listItemTagAutoclosing;case"dd":case"dt":return n.dlItemTagAutoclosing;case"button":return n.buttonTagInScope;case"a":return n.aTagInScope;case"nobr":return n.nobrTagInScope}return null}function oS(e,n){for(;e;){switch(e.tag){case 5:case 26:case 27:if(e.type===n)return e}e=e.return}return null}function xp(e,n){n=n||G_;var s=n.current;if(n=(s=rS(e,s&&s.tag,n.implicitRootScope)?null:s)?null:dk(e,n),n=s||n,!n)return!0;var o=n.tag;if(n=String(!!s)+"|"+e+"|"+o,Vd[n])return!1;Vd[n]=!0;var d=(n=Gn)?oS(n.return,o):null,f=n!==null&&d!==null?sS(d,n,null):"",v="<"+e+">";return s?(s="",o==="table"&&e==="tr"&&(s+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),console.error(`In HTML, %s cannot be a child of <%s>.%s
97
+ This will cause a hydration error.%s`,v,o,s,f)):console.error(`In HTML, %s cannot be a descendant of <%s>.
98
+ This will cause a hydration error.%s`,v,o,f),n&&(e=n.return,d===null||e===null||d===e&&e._debugOwner===n._debugOwner||pt(d,function(){console.error(`<%s> cannot contain a nested %s.
99
+ See this log for the ancestor stack trace.`,o,v)})),!1}function $u(e,n,s){if(s||rS("#text",n,!1))return!0;if(s="#text|"+n,Vd[s])return!1;Vd[s]=!0;var o=(s=Gn)?oS(s,n):null;return s=s!==null&&o!==null?sS(o,s,s.tag!==6?{children:null}:null):"",/\S/.test(e)?console.error(`In HTML, text nodes cannot be a child of <%s>.
100
+ This will cause a hydration error.%s`,n,s):console.error(`In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
101
+ This will cause a hydration error.%s`,n,s),!1}function Sl(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}function hk(e){return e.replace(uL,function(n,s){return s.toUpperCase()})}function lS(e,n,s){var o=n.indexOf("--")===0;o||(-1<n.indexOf("-")?io.hasOwnProperty(n)&&io[n]||(io[n]=!0,console.error("Unsupported style property %s. Did you mean %s?",n,hk(n.replace(cL,"ms-")))):lL.test(n)?io.hasOwnProperty(n)&&io[n]||(io[n]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",n,n.charAt(0).toUpperCase()+n.slice(1))):!Y_.test(s)||zg.hasOwnProperty(s)&&zg[s]||(zg[s]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,n,s.replace(Y_,""))),typeof s=="number"&&(isNaN(s)?X_||(X_=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",n)):isFinite(s)||W_||(W_=!0,console.error("`Infinity` is an invalid value for the `%s` css style property.",n)))),s==null||typeof s=="boolean"||s===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,s):typeof s!="number"||s===0||Q_.has(n)?n==="float"?e.cssFloat=s:(bt(s,n),e[n]=(""+s).trim()):e[n]=s+"px"}function cS(e,n,s){if(n!=null&&typeof n!="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");if(n&&Object.freeze(n),e=e.style,s!=null){if(n){var o={};if(s){for(var d in s)if(s.hasOwnProperty(d)&&!n.hasOwnProperty(d))for(var f=Ug[d]||[d],v=0;v<f.length;v++)o[f[v]]=d}for(var E in n)if(n.hasOwnProperty(E)&&(!s||s[E]!==n[E]))for(d=Ug[E]||[E],f=0;f<d.length;f++)o[d[f]]=E;E={};for(var w in n)for(d=Ug[w]||[w],f=0;f<d.length;f++)E[d[f]]=w;w={};for(var x in o)if(d=o[x],(f=E[x])&&d!==f&&(v=d+","+f,!w[v])){w[v]=!0,v=console;var H=n[d];v.error.call(v,"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",H==null||typeof H=="boolean"||H===""?"Removing":"Updating",d,f)}}for(var V in s)!s.hasOwnProperty(V)||n!=null&&n.hasOwnProperty(V)||(V.indexOf("--")===0?e.setProperty(V,""):V==="float"?e.cssFloat="":e[V]="");for(var z in n)x=n[z],n.hasOwnProperty(z)&&s[z]!==x&&lS(e,z,x)}else for(o in n)n.hasOwnProperty(o)&&lS(e,o,n[o])}function El(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function uS(e){return dL.get(e)||e}function fk(e,n){if(gs.call(ao,n)&&ao[n])return!0;if(fL.test(n)){if(e="aria-"+n.slice(4).toLowerCase(),e=K_.hasOwnProperty(e)?e:null,e==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",n),ao[n]=!0;if(n!==e)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",n,e),ao[n]=!0}if(hL.test(n)){if(e=n.toLowerCase(),e=K_.hasOwnProperty(e)?e:null,e==null)return ao[n]=!0,!1;n!==e&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",n,e),ao[n]=!0)}return!0}function pk(e,n){var s=[],o;for(o in n)fk(e,o)||s.push(o);n=s.map(function(d){return"`"+d+"`"}).join(", "),s.length===1?console.error("Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",n,e):1<s.length&&console.error("Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",n,e)}function mk(e,n,s,o){if(gs.call(gn,n)&&gn[n])return!0;var d=n.toLowerCase();if(d==="onfocusin"||d==="onfocusout")return console.error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),gn[n]=!0;if(typeof s=="function"&&(e==="form"&&n==="action"||e==="input"&&n==="formAction"||e==="button"&&n==="formAction"))return!0;if(o!=null){if(e=o.possibleRegistrationNames,o.registrationNameDependencies.hasOwnProperty(n))return!0;if(o=e.hasOwnProperty(d)?e[d]:null,o!=null)return console.error("Invalid event handler property `%s`. Did you mean `%s`?",n,o),gn[n]=!0;if(J_.test(n))return console.error("Unknown event handler property `%s`. It will be ignored.",n),gn[n]=!0}else if(J_.test(n))return pL.test(n)&&console.error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",n),gn[n]=!0;if(mL.test(n)||gL.test(n))return!0;if(d==="innerhtml")return console.error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),gn[n]=!0;if(d==="aria")return console.error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),gn[n]=!0;if(d==="is"&&s!==null&&s!==void 0&&typeof s!="string")return console.error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof s),gn[n]=!0;if(typeof s=="number"&&isNaN(s))return console.error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",n),gn[n]=!0;if(Yd.hasOwnProperty(d)){if(d=Yd[d],d!==n)return console.error("Invalid DOM property `%s`. Did you mean `%s`?",n,d),gn[n]=!0}else if(n!==d)return console.error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",n,d),gn[n]=!0;switch(n){case"dangerouslySetInnerHTML":case"children":case"style":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":return!0;case"innerText":case"textContent":return!0}switch(typeof s){case"boolean":switch(n){case"autoFocus":case"checked":case"multiple":case"muted":case"selected":case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"capture":case"download":case"inert":return!0;default:return d=n.toLowerCase().slice(0,5),d==="data-"||d==="aria-"?!0:(s?console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',s,n,n,s,n):console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',s,n,n,s,n,n,n),gn[n]=!0)}case"function":case"symbol":return gn[n]=!0,!1;case"string":if(s==="false"||s==="true"){switch(n){case"checked":case"selected":case"multiple":case"muted":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"inert":break;default:return!0}console.error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",s,n,s==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',n,s),gn[n]=!0}}return!0}function gk(e,n,s){var o=[],d;for(d in n)mk(e,d,n[d],s)||o.push(d);n=o.map(function(f){return"`"+f+"`"}).join(", "),o.length===1?console.error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",n,e):1<o.length&&console.error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",n,e)}function Al(e){return yL.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}function dS(e){var n=bi(e);if(n&&(e=n.stateNode)){var s=e[Mn]||null;t:switch(e=n.stateNode,n.type){case"input":if(Ep(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(st(n,"name"),s=s.querySelectorAll('input[name="'+Jn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var o=s[n];if(o!==e&&o.form===e.form){var d=o[Mn]||null;if(!d)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Ep(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<s.length;n++)o=s[n],o.form===e.form&&q0(o)}break t;case"textarea":J0(e,s.value,s.defaultValue);break t;case"select":n=s.value,n!=null&&Ur(e,!!s.multiple,n,!1)}}}function hS(e,n,s){if(Hg)return e(n,s);Hg=!0;try{var o=e(n);return o}finally{if(Hg=!1,(ro!==null||oo!==null)&&(Yr(),ro&&(n=ro,e=oo,oo=ro=null,dS(n),e)))for(n=0;n<e.length;n++)dS(e[n])}}function _l(e,n){var s=e.stateNode;if(s===null)return null;var o=s[Mn]||null;if(o===null)return null;s=o[n];t:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error("Expected `"+n+"` listener to be a function, instead got a value of `"+typeof s+"` type.");return s}function fS(){if(Xd)return Xd;var e,n=Fg,s=n.length,o,d="value"in ia?ia.value:ia.textContent,f=d.length;for(e=0;e<s&&n[e]===d[e];e++);var v=s-e;for(o=1;o<=v&&n[s-o]===d[f-o];o++);return Xd=d.slice(e,1<o?1-o:void 0)}function Gu(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Vu(){return!0}function pS(){return!1}function Cn(e){function n(s,o,d,f,v){this._reactName=s,this._targetInst=d,this.type=o,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(s=e[E],this[E]=s?s(f):f[E]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Vu:pS,this.isPropagationStopped=pS,this}return Lt(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Vu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Vu)},persist:function(){},isPersistent:Vu}),n}function yk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ML[e])?!!n[e]:!1}function Dp(){return yk}function mS(e,n){switch(e){case"keyup":return jL.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==iT;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}function bk(e,n){switch(e){case"compositionend":return gS(n);case"keypress":return n.which!==aT?null:(oT=!0,rT);case"textInput":return e=n.data,e===rT&&oT?null:e;default:return null}}function vk(e,n){if(lo)return e==="compositionend"||!Vg&&mS(e,n)?(e=fS(),Xd=Fg=ia=null,lo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return sT&&n.locale!=="ko"?null:n.data;default:return null}}function yS(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!GL[e.type]:n==="textarea"}function Sk(e){if(!Vi)return!1;e="on"+e;var n=e in document;return n||(n=document.createElement("div"),n.setAttribute(e,"return;"),n=typeof n[e]=="function"),n}function bS(e,n,s,o){ro?oo?oo.push(o):oo=[o]:ro=o,n=Dd(n,"onChange"),0<n.length&&(s=new Wd("onChange","change",null,s,o),e.push({event:s,listeners:n}))}function Ek(e){HA(e,0)}function qu(e){var n=js(e);if(q0(n))return e}function vS(e,n){if(e==="change")return n}function SS(){oc&&(oc.detachEvent("onpropertychange",ES),lc=oc=null)}function ES(e){if(e.propertyName==="value"&&qu(lc)){var n=[];bS(n,lc,e,Rp(e)),hS(Ek,n)}}function Ak(e,n,s){e==="focusin"?(SS(),oc=n,lc=s,oc.attachEvent("onpropertychange",ES)):e==="focusout"&&SS()}function _k(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qu(lc)}function Tk(e,n){if(e==="click")return qu(n)}function wk(e,n){if(e==="input"||e==="change")return qu(n)}function Ck(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}function Tl(e,n){if(yn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),o=Object.keys(n);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var d=s[o];if(!gs.call(n,d)||!yn(e[d],n[d]))return!1}return!0}function AS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _S(e,n){var s=AS(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=n&&o>=n)return{node:s,offset:n-e};e=o}t:{for(;s;){if(s.nextSibling){s=s.nextSibling;break t}s=s.parentNode}s=void 0}s=AS(s)}}function TS(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?TS(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function wS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Fu(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Fu(e.document)}return n}function Mp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function CS(e,n,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Yg||co==null||co!==Fu(o)||(o=co,"selectionStart"in o&&Mp(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),cc&&Tl(cc,o)||(cc=o,o=Dd(qg,"onSelect"),0<o.length&&(n=new Wd("onSelect","select",null,n,s),e.push({event:n,listeners:o}),n.target=co)))}function La(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}function Ia(e){if(Xg[e])return Xg[e];if(!uo[e])return e;var n=uo[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in cT)return Xg[e]=n[s];return e}function vi(e,n){pT.set(e,n),et(n,[e])}function Hn(e,n){if(typeof e=="object"&&e!==null){var s=Qg.get(e);return s!==void 0?s:(n={value:e,source:n,stack:$0(n)},Qg.set(e,n),n)}return{value:e,source:n,stack:$0(n)}}function Yu(){for(var e=ho,n=Kg=ho=0;n<e;){var s=ii[n];ii[n++]=null;var o=ii[n];ii[n++]=null;var d=ii[n];ii[n++]=null;var f=ii[n];if(ii[n++]=null,o!==null&&d!==null){var v=o.pending;v===null?d.next=d:(d.next=v.next,v.next=d),o.pending=d}f!==0&&xS(s,d,f)}}function Xu(e,n,s,o){ii[ho++]=e,ii[ho++]=n,ii[ho++]=s,ii[ho++]=o,Kg|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Op(e,n,s,o){return Xu(e,n,s,o),Wu(e)}function xn(e,n){return Xu(e,null,null,n),Wu(e)}function xS(e,n,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var d=!1,f=e.return;f!==null;)f.childLanes|=s,o=f.alternate,o!==null&&(o.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&Kd||(d=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,d&&n!==null&&(d=31-mn(s),e=f.hiddenUpdates,o=e[d],o===null?e[d]=[n]:o.push(n),n.lane=s|536870912),f):null}function Wu(e){if(Oc>fI)throw cr=Oc=0,kc=xy=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");cr>pI&&(cr=0,kc=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),e.alternate===null&&(e.flags&4098)!==0&&kA(e);for(var n=e,s=n.return;s!==null;)n.alternate===null&&(n.flags&4098)!==0&&kA(e),n=s,s=n.return;return n.tag===3?n.stateNode:null}function Pa(e){if(si===null)return e;var n=si(e);return n===void 0?e:n.current}function kp(e){if(si===null)return e;var n=si(e);return n===void 0?e!=null&&typeof e.render=="function"&&(n=Pa(e.render),e.render!==n)?(n={$$typeof:Zl,render:n},e.displayName!==void 0&&(n.displayName=e.displayName),n):e:n.current}function RS(e,n){if(si===null)return!1;var s=e.elementType;n=n.type;var o=!1,d=typeof n=="object"&&n!==null?n.$$typeof:null;switch(e.tag){case 1:typeof n=="function"&&(o=!0);break;case 0:(typeof n=="function"||d===$n)&&(o=!0);break;case 11:(d===Zl||d===$n)&&(o=!0);break;case 14:case 15:(d===Bd||d===$n)&&(o=!0);break;default:return!1}return!!(o&&(e=si(s),e!==void 0&&e===si(n)))}function DS(e){si!==null&&typeof WeakSet=="function"&&(fo===null&&(fo=new WeakSet),fo.add(e))}function Np(e,n,s){var o=e.alternate,d=e.child,f=e.sibling,v=e.tag,E=e.type,w=null;switch(v){case 0:case 15:case 1:w=E;break;case 11:w=E.render}if(si===null)throw Error("Expected resolveFamily to be set during hot reload.");var x=!1;E=!1,w!==null&&(w=si(w),w!==void 0&&(s.has(w)?E=!0:n.has(w)&&(v===1?E=!0:x=!0))),fo!==null&&(fo.has(e)||o!==null&&fo.has(o))&&(E=!0),E&&(e._debugNeedsRemount=!0),(E||x)&&(o=xn(e,2),o!==null&&Ce(o,e,2)),d===null||E||Np(d,n,s),f!==null&&Np(f,n,s)}function xk(e,n,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,gT||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function Lp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rs(e,n){var s=e.alternate;switch(s===null?(s=b(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s._debugOwner=e._debugOwner,s._debugStack=e._debugStack,s._debugTask=e._debugTask,s._debugHookTypes=e._debugHookTypes,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null,s.actualDuration=-0,s.actualStartTime=-1.1),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext,_debugThenableState:n._debugThenableState},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s.selfBaseDuration=e.selfBaseDuration,s.treeBaseDuration=e.treeBaseDuration,s._debugInfo=e._debugInfo,s._debugNeedsRemount=e._debugNeedsRemount,s.tag){case 0:case 15:s.type=Pa(e.type);break;case 1:s.type=Pa(e.type);break;case 11:s.type=kp(e.type)}return s}function MS(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null,e.selfBaseDuration=0,e.treeBaseDuration=0):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext,_debugThenableState:n._debugThenableState},e.selfBaseDuration=s.selfBaseDuration,e.treeBaseDuration=s.treeBaseDuration),e}function Ip(e,n,s,o,d,f){var v=0,E=e;if(typeof e=="function")Lp(e)&&(v=1),E=Pa(E);else if(typeof e=="string")v=B(),v=xN(e,s,v)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case wg:return n=b(31,s,n,d),n.elementType=wg,n.lanes=f,n;case to:return Ua(s.children,d,f,n);case Hd:v=8,d|=ln,d|=Ai;break;case Eg:return e=s,o=d,typeof e.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof e.id),n=b(12,e,n,o|tn),n.elementType=Eg,n.lanes=f,n.stateNode={effectDuration:0,passiveEffectDuration:0},n;case _g:return n=b(13,s,n,d),n.elementType=_g,n.lanes=f,n;case Tg:return n=b(19,s,n,d),n.elementType=Tg,n.lanes=f,n;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FN:case Bi:v=10;break t;case Ag:v=9;break t;case Zl:v=11,E=kp(E);break t;case Bd:v=14;break t;case $n:v=16,E=null;break t}E="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(E+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?s="null":Je(e)?s="array":e!==void 0&&e.$$typeof===Zs?(s="<"+(F(e.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,(v=o?J(o):null)&&(E+=`
102
+
103
+ Check the render method of \``+v+"`."),v=29,s=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(s+"."+E)),E=null}return n=b(v,s,n,d),n.elementType=e,n.type=E,n.lanes=f,n._debugOwner=o,n}function Qu(e,n,s){return n=Ip(e.type,e.key,e.props,e._owner,n,s),n._debugOwner=e._owner,n._debugStack=e._debugStack,n._debugTask=e._debugTask,n}function Ua(e,n,s,o){return e=b(7,e,o,n),e.lanes=s,e}function Pp(e,n,s){return e=b(6,e,null,n),e.lanes=s,e}function Up(e,n,s){return n=b(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function za(e,n){Ha(),po[mo++]=Jd,po[mo++]=Zd,Zd=e,Jd=n}function OS(e,n,s){Ha(),ai[ri++]=vs,ai[ri++]=Ss,ai[ri++]=Ka,Ka=e;var o=vs;e=Ss;var d=32-mn(o)-1;o&=~(1<<d),s+=1;var f=32-mn(n)+d;if(30<f){var v=d-d%5;f=(o&(1<<v)-1).toString(32),o>>=v,d-=v,vs=1<<32-mn(n)+d|s<<d|o,Ss=f+e}else vs=1<<f|s<<d|o,Ss=e}function zp(e){Ha(),e.return!==null&&(za(e,1),OS(e,1,0))}function Hp(e){for(;e===Zd;)Zd=po[--mo],po[mo]=null,Jd=po[--mo],po[mo]=null;for(;e===Ka;)Ka=ai[--ri],ai[ri]=null,Ss=ai[--ri],ai[ri]=null,vs=ai[--ri],ai[ri]=null}function Ha(){Yt||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Ba(e,n){if(e.return===null){if(oi===null)oi={fiber:e,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:n};else{if(oi.fiber!==e)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");oi.distanceFromLeaf>n&&(oi.distanceFromLeaf=n)}return oi}var s=Ba(e.return,n+1).children;return 0<s.length&&s[s.length-1].fiber===e?(s=s[s.length-1],s.distanceFromLeaf>n&&(s.distanceFromLeaf=n),s):(n={fiber:e,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:n},s.push(n),n)}function Bp(e,n){Es||(e=Ba(e,0),e.serverProps=null,n!==null&&(n=JA(n),e.serverTail.push(n)))}function Fa(e){var n="",s=oi;throw s!==null&&(oi=null,n=Cp(s)),xl(Hn(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
104
+
105
+ - A server/client branch \`if (typeof window !== 'undefined')\`.
106
+ - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
107
+ - Date formatting in a user's locale which doesn't match the server.
108
+ - External changing data without sending a snapshot of it along with the HTML.
109
+ - Invalid HTML tag nesting.
110
+
111
+ It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
112
+
113
+ https://react.dev/link/hydration-mismatch`+n),e)),Zg}function kS(e){var n=e.stateNode,s=e.type,o=e.memoizedProps;switch(n[on]=e,n[Mn]=o,ig(s,o),s){case"dialog":Ft("cancel",n),Ft("close",n);break;case"iframe":case"object":case"embed":Ft("load",n);break;case"video":case"audio":for(s=0;s<Nc.length;s++)Ft(Nc[s],n);break;case"source":Ft("error",n);break;case"img":case"image":case"link":Ft("error",n),Ft("load",n);break;case"details":Ft("toggle",n);break;case"input":ft("input",o),Ft("invalid",n),Y0(n,o),X0(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0),Bu(n);break;case"option":W0(n,o);break;case"select":ft("select",o),Ft("invalid",n),K0(n,o);break;case"textarea":ft("textarea",o),Ft("invalid",n),Z0(n,o),tS(n,o.value,o.defaultValue,o.children),Bu(n)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||o.suppressHydrationWarning===!0||$A(n.textContent,s)?(o.popover!=null&&(Ft("beforetoggle",n),Ft("toggle",n)),o.onScroll!=null&&Ft("scroll",n),o.onScrollEnd!=null&&Ft("scrollend",n),o.onClick!=null&&(n.onclick=Md),n=!0):n=!1,n||Fa(e)}function NS(e){for(bn=e.return;bn;)switch(bn.tag){case 5:case 13:qi=!1;return;case 27:case 3:qi=!0;return;default:bn=bn.return}}function wl(e){if(e!==bn)return!1;if(!Yt)return NS(e),Yt=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||lg(e.type,e.memoizedProps)),s=!s),s&&ve){for(s=ve;s;){var o=Ba(e,0),d=JA(s);o.serverTail.push(d),s=d.type==="Suspense"?e_(s):ei(s.nextSibling)}Fa(e)}if(NS(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");ve=e_(e)}else n===27?(n=ve,Ks(e.type)?(e=Hy,Hy=null,ve=e):ve=n):ve=bn?ei(e.stateNode.nextSibling):null;return!0}function Cl(){ve=bn=null,Es=Yt=!1}function LS(){var e=Za;return e!==null&&(En===null?En=e:En.push.apply(En,e),Za=null),e}function xl(e){Za===null?Za=[e]:Za.push(e)}function IS(){var e=oi;if(e!==null){oi=null;for(var n=Cp(e);0<e.children.length;)e=e.children[0];pt(e.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
114
+
115
+ - A server/client branch \`if (typeof window !== 'undefined')\`.
116
+ - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
117
+ - Date formatting in a user's locale which doesn't match the server.
118
+ - External changing data without sending a snapshot of it along with the HTML.
119
+ - Invalid HTML tag nesting.
120
+
121
+ It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
122
+
123
+ %s%s`,"https://react.dev/link/hydration-mismatch",n)})}}function Ku(){go=th=null,yo=!1}function $s(e,n,s){lt(Jg,n._currentValue,e),n._currentValue=s,lt(ty,n._currentRenderer,e),n._currentRenderer!==void 0&&n._currentRenderer!==null&&n._currentRenderer!==ST&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),n._currentRenderer=ST}function os(e,n){e._currentValue=Jg.current;var s=ty.current;K(ty,n),e._currentRenderer=s,K(Jg,n)}function Fp(e,n,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===s)break;e=e.return}e!==s&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function jp(e,n,s,o){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var f=d.dependencies;if(f!==null){var v=d.child;f=f.firstContext;t:for(;f!==null;){var E=f;f=d;for(var w=0;w<n.length;w++)if(E.context===n[w]){f.lanes|=s,E=f.alternate,E!==null&&(E.lanes|=s),Fp(f.return,s,e),o||(v=null);break t}f=E.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");v.lanes|=s,f=v.alternate,f!==null&&(f.lanes|=s),Fp(v,s,e),v=null}else v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===e){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function Rl(e,n,s,o){e=null;for(var d=n,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error("Should have a current fiber. This is a bug in React.");if(v=v.memoizedProps,v!==null){var E=d.type;yn(d.pendingProps.value,v.value)||(e!==null?e.push(E):e=[E])}}else if(d===Fd.current){if(v=d.alternate,v===null)throw Error("Should have a current fiber. This is a bug in React.");v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Uc):e=[Uc])}d=d.return}e!==null&&jp(n,e,s,o),n.flags|=262144}function Zu(e){for(e=e.firstContext;e!==null;){if(!yn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ja(e){th=e,go=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fe(e){return yo&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),PS(th,e)}function Ju(e,n){return th===null&&ja(e),PS(e,n)}function PS(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},go===null){if(e===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");go=n,e.dependencies={lanes:0,firstContext:n,_debugThenableState:null},e.flags|=524288}else go=go.next=n;return s}function $p(){return{controller:new ZL,data:new Map,refCount:0}}function $a(e){e.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),e.refCount++}function Dl(e){e.refCount--,0>e.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),e.refCount===0&&JL(tI,function(){e.controller.abort()})}function ls(){var e=Ja;return Ja=0,e}function td(e){var n=Ja;return Ja=e,n}function Ml(e){var n=Ja;return Ja+=e,n}function Gp(e){On=bo(),0>e.actualStartTime&&(e.actualStartTime=On)}function Vp(e){if(0<=On){var n=bo()-On;e.actualDuration+=n,e.selfBaseDuration=n,On=-1}}function US(e){if(0<=On){var n=bo()-On;e.actualDuration+=n,On=-1}}function Ni(){if(0<=On){var e=bo()-On;On=-1,Ja+=e}}function Li(){On=bo()}function ed(e){for(var n=e.child;n;)e.actualDuration+=n.actualDuration,n=n.sibling}function Rk(e,n){if(uc===null){var s=uc=[];ey=0,tr=Jm(),vo={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ey++,n.then(zS,zS),n}function zS(){if(--ey===0&&uc!==null){vo!==null&&(vo.status="fulfilled");var e=uc;uc=null,tr=0,vo=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Dk(e,n){var s=[],o={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var d=0;d<s.length;d++)(0,s[d])(n)},function(d){for(o.status="rejected",o.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),o}function qp(){var e=er.current;return e!==null?e:oe.pooledCache}function nd(e,n){n===null?lt(er,er.current,e):lt(er,n.pool,e)}function HS(){var e=qp();return e===null?null:{parent:ze._currentValue,pool:e}}function BS(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function FS(e){return e=e.status,e==="fulfilled"||e==="rejected"}function id(){}function jS(e,n,s){G.actQueue!==null&&(G.didUsePromise=!0);var o=e.thenables;switch(s=o[s],s===void 0?o.push(n):s!==n&&(e.didWarnAboutUncachedPromise||(e.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),n.then(id,id),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,GS(e),e;default:if(typeof n.status=="string")n.then(id,id);else{if(e=oe,e!==null&&100<e.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");e=n,e.status="pending",e.then(function(d){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=d}},function(d){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=d}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,GS(e),e}throw bc=n,rh=!0,yc}}function $S(){if(bc===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var e=bc;return bc=null,rh=!1,e}function GS(e){if(e===yc||e===ah)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function Yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xp(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Gs(e){return{lane:e,tag:wT,payload:null,callback:null,next:null}}function Vs(e,n,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,sy===o&&!RT){var d=X(e);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.
124
+
125
+ Please update the following component: %s`,d),RT=!0}return(Jt&Sn)!==Vn?(d=o.pending,d===null?n.next=n:(n.next=d.next,d.next=n),o.pending=n,n=Wu(e),xS(e,null,s),n):(Xu(e,o,n,s),Wu(e))}function Ol(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,s|=o,n.lanes=s,zu(e,s)}}function sd(e,n){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var d=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var v={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?d=f=v:f=f.next=v,s=s.next}while(s!==null);f===null?d=f=n:f=f.next=n}else d=f=n;s={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function kl(){if(ay){var e=vo;if(e!==null)throw e}}function Nl(e,n,s,o){ay=!1;var d=e.updateQueue;aa=!1,sy=d.shared;var f=d.firstBaseUpdate,v=d.lastBaseUpdate,E=d.shared.pending;if(E!==null){d.shared.pending=null;var w=E,x=w.next;w.next=null,v===null?f=x:v.next=x,v=w;var H=e.alternate;H!==null&&(H=H.updateQueue,E=H.lastBaseUpdate,E!==v&&(E===null?H.firstBaseUpdate=x:E.next=x,H.lastBaseUpdate=w))}if(f!==null){var V=d.baseState;v=0,H=x=w=null,E=f;do{var z=E.lane&-536870913,q=z!==E.lane;if(q?(Bt&z)===z:(o&z)===z){z!==0&&z===tr&&(ay=!0),H!==null&&(H=H.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});t:{z=e;var ct=E,Et=n,le=s;switch(ct.tag){case CT:if(ct=ct.payload,typeof ct=="function"){yo=!0;var jt=ct.call(le,V,Et);if(z.mode&ln){tt(!0);try{ct.call(le,V,Et)}finally{tt(!1)}}yo=!1,V=jt;break t}V=ct;break t;case iy:z.flags=z.flags&-65537|128;case wT:if(jt=ct.payload,typeof jt=="function"){if(yo=!0,ct=jt.call(le,V,Et),z.mode&ln){tt(!0);try{jt.call(le,V,Et)}finally{tt(!1)}}yo=!1}else ct=jt;if(ct==null)break t;V=Lt({},V,ct);break t;case xT:aa=!0}}z=E.callback,z!==null&&(e.flags|=64,q&&(e.flags|=8192),q=d.callbacks,q===null?d.callbacks=[z]:q.push(z))}else q={lane:z,tag:E.tag,payload:E.payload,callback:E.callback,next:null},H===null?(x=H=q,w=V):H=H.next=q,v|=z;if(E=E.next,E===null){if(E=d.shared.pending,E===null)break;q=E,E=q.next,q.next=null,d.lastBaseUpdate=q,d.shared.pending=null}}while(!0);H===null&&(w=V),d.baseState=w,d.firstBaseUpdate=x,d.lastBaseUpdate=H,f===null&&(d.shared.lanes=0),ca|=v,e.lanes=v,e.memoizedState=V}sy=null}function VS(e,n){if(typeof e!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+e);e.call(n)}function Mk(e,n){var s=e.shared.hiddenCallbacks;if(s!==null)for(e.shared.hiddenCallbacks=null,e=0;e<s.length;e++)VS(s[e],n)}function qS(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)VS(s[e],n)}function YS(e,n){var s=Wi;lt(oh,s,e),lt(So,n,e),Wi=s|n.baseLanes}function Wp(e){lt(oh,Wi,e),lt(So,So.current,e)}function Qp(e){Wi=oh.current,K(So,e),K(oh,e)}function Ht(){var e=$;ui===null?ui=[e]:ui.push(e)}function Z(){var e=$;if(ui!==null&&(_s++,ui[_s]!==e)){var n=X(At);if(!DT.has(n)&&(DT.add(n),ui!==null)){for(var s="",o=0;o<=_s;o++){var d=ui[o],f=o===_s?e:d;for(d=o+1+". "+d;30>d.length;)d+=" ";d+=f+`
126
+ `,s+=d}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
127
+
128
+ Previous render Next render
129
+ ------------------------------------------------------
130
+ %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
+ `,n,s)}}}function Br(e){e==null||Je(e)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",$,typeof e)}function ad(){var e=X(At);OT.has(e)||(OT.add(e),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",e))}function we(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
132
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
133
+ 2. You might be breaking the Rules of Hooks
134
+ 3. You might have more than one copy of React in the same app
135
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function Kp(e,n){if(Sc)return!1;if(n===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",$),!1;e.length!==n.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
136
+
137
+ Previous: %s
138
+ Incoming: %s`,$,"["+n.join(", ")+"]","["+e.join(", ")+"]");for(var s=0;s<n.length&&s<e.length;s++)if(!yn(e[s],n[s]))return!1;return!0}function Zp(e,n,s,o,d,f){ra=f,At=n,ui=e!==null?e._debugHookTypes:null,_s=-1,Sc=e!==null&&e.type!==n.type,(Object.prototype.toString.call(s)==="[object AsyncFunction]"||Object.prototype.toString.call(s)==="[object AsyncGeneratorFunction]")&&(f=X(At),ry.has(f)||(ry.add(f),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",f===null?"An unknown Component":"<"+f+">"))),n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e!==null&&e.memoizedState!==null?ly:ui!==null?kT:oy,ir=f=(n.mode&ln)!==ue;var v=cy(s,o,d);if(ir=!1,Ao&&(v=Jp(n,s,o,d)),f){tt(!0);try{v=Jp(n,s,o,d)}finally{tt(!1)}}return XS(e,n),v}function XS(e,n){n._debugHookTypes=ui,n.dependencies===null?As!==null&&(n.dependencies={lanes:0,firstContext:null,_debugThenableState:As}):n.dependencies._debugThenableState=As,G.H=uh;var s=ae!==null&&ae.next!==null;if(ra=0,ui=$=Ie=ae=At=null,_s=-1,e!==null&&(e.flags&65011712)!==(n.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),lh=!1,vc=0,As=null,s)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");e===null||$e||(e=e.dependencies,e!==null&&Zu(e)&&($e=!0)),rh?(rh=!1,e=!0):e=!1,e&&(n=X(n)||"Unknown",MT.has(n)||ry.has(n)||(MT.add(n),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function Jp(e,n,s,o){At=e;var d=0;do{if(Ao&&(As=null),vc=0,Ao=!1,d>=nI)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(d+=1,Sc=!1,Ie=ae=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}_s=-1,G.H=NT,f=cy(n,s,o)}while(Ao);return f}function Ok(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?Ll(n):n,e=e.useState()[0],(ae!==null?ae.memoizedState:null)!==e&&(At.flags|=1024),n}function tm(){var e=ch!==0;return ch=0,e}function em(e,n,s){n.updateQueue=e.updateQueue,n.flags=(n.mode&Ai)!==ue?n.flags&-402655237:n.flags&-2053,e.lanes&=~s}function nm(e){if(lh){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}lh=!1}ra=0,ui=Ie=ae=At=null,_s=-1,$=null,Ao=!1,vc=ch=0,As=null}function Rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?At.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function ee(){if(ae===null){var e=At.alternate;e=e!==null?e.memoizedState:null}else e=ae.next;var n=Ie===null?At.memoizedState:Ie.next;if(n!==null)Ie=n,ae=e;else{if(e===null)throw At.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");ae=e,e={memoizedState:ae.memoizedState,baseState:ae.baseState,baseQueue:ae.baseQueue,queue:ae.queue,next:null},Ie===null?At.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function im(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ll(e){var n=vc;return vc+=1,As===null&&(As=BS()),e=jS(As,e,n),n=At,(Ie===null?n.memoizedState:Ie.next)===null&&(n=n.alternate,G.H=n!==null&&n.memoizedState!==null?ly:oy),e}function qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ll(e);if(e.$$typeof===Bi)return fe(e)}throw Error("An unsupported type was passed to use(): "+String(e))}function Ga(e){var n=null,s=At.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var o=At.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=im(),At.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0||Sc)for(s=n.data[n.index]=Array(e),o=0;o<e;o++)s[o]=jN;else s.length!==e&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",s.length,e);return n.index++,s}function Si(e,n){return typeof n=="function"?n(e):n}function sm(e,n,s){var o=Rn();if(s!==void 0){var d=s(n);if(ir){tt(!0);try{s(n)}finally{tt(!1)}}}else d=n;return o.memoizedState=o.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},o.queue=e,e=e.dispatch=Ik.bind(null,At,e),[o.memoizedState,e]}function Fr(e){var n=ee();return am(n,ae,e)}function am(e,n,s){var o=e.queue;if(o===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");o.lastRenderedReducer=s;var d=e.baseQueue,f=o.pending;if(f!==null){if(d!==null){var v=d.next;d.next=f.next,f.next=v}n.baseQueue!==d&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),n.baseQueue=d=f,o.pending=null}if(f=e.baseState,d===null)e.memoizedState=f;else{n=d.next;var E=v=null,w=null,x=n,H=!1;do{var V=x.lane&-536870913;if(V!==x.lane?(Bt&V)===V:(ra&V)===V){var z=x.revertLane;if(z===0)w!==null&&(w=w.next={lane:0,revertLane:0,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null}),V===tr&&(H=!0);else if((ra&z)===z){x=x.next,z===tr&&(H=!0);continue}else V={lane:0,revertLane:x.revertLane,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null},w===null?(E=w=V,v=f):w=w.next=V,At.lanes|=z,ca|=z;V=x.action,ir&&s(f,V),f=x.hasEagerState?x.eagerState:s(f,V)}else z={lane:V,revertLane:x.revertLane,action:x.action,hasEagerState:x.hasEagerState,eagerState:x.eagerState,next:null},w===null?(E=w=z,v=f):w=w.next=z,At.lanes|=V,ca|=V;x=x.next}while(x!==null&&x!==n);if(w===null?v=f:w.next=E,!yn(f,e.memoizedState)&&($e=!0,H&&(s=vo,s!==null)))throw s;e.memoizedState=f,e.baseState=v,e.baseQueue=w,o.lastRenderedState=f}return d===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Il(e){var n=ee(),s=n.queue;if(s===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");s.lastRenderedReducer=e;var o=s.dispatch,d=s.pending,f=n.memoizedState;if(d!==null){s.pending=null;var v=d=d.next;do f=e(f,v.action),v=v.next;while(v!==d);yn(f,n.memoizedState)||($e=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,o]}function rm(e,n,s){var o=At,d=Rn();if(Yt){if(s===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var f=s();Eo||f===s()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),Eo=!0)}else{if(f=n(),Eo||(s=n(),yn(f,s)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Eo=!0)),oe===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(Bt&124)!==0||WS(o,n,f)}return d.memoizedState=f,s={value:f,getSnapshot:n},d.queue=s,ud(KS.bind(null,o,s,e),[e]),o.flags|=2048,$r(ci|He,cd(),QS.bind(null,o,s,f,n),null),f}function rd(e,n,s){var o=At,d=ee(),f=Yt;if(f){if(s===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");s=s()}else if(s=n(),!Eo){var v=n();yn(s,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Eo=!0)}(v=!yn((ae||d).memoizedState,s))&&(d.memoizedState=s,$e=!0),d=d.queue;var E=KS.bind(null,o,d,e);if(Dn(2048,He,E,[e]),d.getSnapshot!==n||v||Ie!==null&&Ie.memoizedState.tag&ci){if(o.flags|=2048,$r(ci|He,cd(),QS.bind(null,o,d,s,n),null),oe===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");f||(ra&124)!==0||WS(o,n,s)}return s}function WS(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=At.updateQueue,n===null?(n=im(),At.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function QS(e,n,s,o){n.value=s,n.getSnapshot=o,ZS(n)&&JS(e)}function KS(e,n,s){return s(function(){ZS(n)&&JS(e)})}function ZS(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!yn(e,s)}catch{return!0}}function JS(e){var n=xn(e,2);n!==null&&Ce(n,e,2)}function om(e){var n=Rn();if(typeof e=="function"){var s=e;if(e=s(),ir){tt(!0);try{s()}finally{tt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},n}function lm(e){e=om(e);var n=e.queue,s=bE.bind(null,At,n);return n.dispatch=s,[e.memoizedState,s]}function cm(e){var n=Rn();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Am.bind(null,At,!0,s),s.dispatch=n,[e,n]}function tE(e,n){var s=ee();return eE(s,ae,e,n)}function eE(e,n,s,o){return e.baseState=s,am(e,ae,typeof o=="function"?o:Si)}function nE(e,n){var s=ee();return ae!==null?eE(s,ae,e,n):(s.baseState=e,[e,s.queue.dispatch])}function kk(e,n,s,o,d){if(pd(e))throw Error("Cannot update form state while rendering.");if(e=n.action,e!==null){var f={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){f.listeners.push(v)}};G.T!==null?s(!0):f.isTransition=!1,o(f),s=n.pending,s===null?(f.next=n.pending=f,iE(n,f)):(f.next=s.next,n.pending=s.next=f)}}function iE(e,n){var s=n.action,o=n.payload,d=e.state;if(n.isTransition){var f=G.T,v={};G.T=v,G.T._updatedFibers=new Set;try{var E=s(d,o),w=G.S;w!==null&&w(v,E),sE(e,n,E)}catch(x){um(e,n,x)}finally{G.T=f,f===null&&v._updatedFibers&&(e=v._updatedFibers.size,v._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{v=s(d,o),sE(e,n,v)}catch(x){um(e,n,x)}}function sE(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?(s.then(function(o){aE(e,n,o)},function(o){return um(e,n,o)}),n.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):aE(e,n,s)}function aE(e,n,s){n.status="fulfilled",n.value=s,rE(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,iE(e,s)))}function um(e,n,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=s,rE(n),n=n.next;while(n!==o)}e.action=null}function rE(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function oE(e,n){return n}function jr(e,n){if(Yt){var s=oe.formState;if(s!==null){t:{var o=At;if(Yt){if(ve){e:{for(var d=ve,f=qi;d.nodeType!==8;){if(!f){d=null;break e}if(d=ei(d.nextSibling),d===null){d=null;break e}}f=d.data,d=f===Iy||f===Ow?d:null}if(d){ve=ei(d.nextSibling),o=d.data===Iy;break t}}Fa(o)}o=!1}o&&(n=s[0])}}return s=Rn(),s.memoizedState=s.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oE,lastRenderedState:n},s.queue=o,s=bE.bind(null,At,o),o.dispatch=s,o=om(!1),f=Am.bind(null,At,!1,o.queue),o=Rn(),d={state:n,dispatch:null,action:e,pending:null},o.queue=d,s=kk.bind(null,At,d,f,s),d.dispatch=s,o.memoizedState=e,[n,s,!1]}function od(e){var n=ee();return lE(n,ae,e)}function lE(e,n,s){if(n=am(e,n,oE)[0],e=Fr(Si)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ll(n)}catch(v){throw v===yc?ah:v}else o=n;n=ee();var d=n.queue,f=d.dispatch;return s!==n.memoizedState&&(At.flags|=2048,$r(ci|He,cd(),Nk.bind(null,d,s),null)),[o,f,e]}function Nk(e,n){e.action=n}function ld(e){var n=ee(),s=ae;if(s!==null)return lE(n,s,e);ee(),n=n.memoizedState,s=ee();var o=s.queue.dispatch;return s.memoizedState=e,[n,o,!1]}function $r(e,n,s,o){return e={tag:e,create:s,deps:o,inst:n,next:null},n=At.updateQueue,n===null&&(n=im(),At.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,n.lastEffect=e),e}function cd(){return{destroy:void 0,resource:void 0}}function dm(e){var n=Rn();return e={current:e},n.memoizedState=e}function Va(e,n,s,o){var d=Rn();o=o===void 0?null:o,At.flags|=e,d.memoizedState=$r(ci|n,cd(),s,o)}function Dn(e,n,s,o){var d=ee();o=o===void 0?null:o;var f=d.memoizedState.inst;ae!==null&&o!==null&&Kp(o,ae.memoizedState.deps)?d.memoizedState=$r(n,f,s,o):(At.flags|=e,d.memoizedState=$r(ci|n,f,s,o))}function ud(e,n){(At.mode&Ai)!==ue&&(At.mode&mT)===ue?Va(276826112,He,e,n):Va(8390656,He,e,n)}function hm(e,n){var s=4194308;return(At.mode&Ai)!==ue&&(s|=134217728),Va(s,en,e,n)}function cE(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return n.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(n).join(", ")+"}"),e=e(),n.current=e,function(){n.current=null}}function fm(e,n,s){typeof n!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",n!==null?typeof n:"null"),s=s!=null?s.concat([e]):null;var o=4194308;(At.mode&Ai)!==ue&&(o|=134217728),Va(o,en,cE.bind(null,n,e),s)}function dd(e,n,s){typeof n!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",n!==null?typeof n:"null"),s=s!=null?s.concat([e]):null,Dn(4,en,cE.bind(null,n,e),s)}function pm(e,n){return Rn().memoizedState=[e,n===void 0?null:n],e}function hd(e,n){var s=ee();n=n===void 0?null:n;var o=s.memoizedState;return n!==null&&Kp(n,o[1])?o[0]:(s.memoizedState=[e,n],e)}function mm(e,n){var s=Rn();n=n===void 0?null:n;var o=e();if(ir){tt(!0);try{e()}finally{tt(!1)}}return s.memoizedState=[o,n],o}function fd(e,n){var s=ee();n=n===void 0?null:n;var o=s.memoizedState;if(n!==null&&Kp(n,o[1]))return o[0];if(o=e(),ir){tt(!0);try{e()}finally{tt(!1)}}return s.memoizedState=[o,n],o}function gm(e,n){var s=Rn();return ym(s,e,n)}function uE(e,n){var s=ee();return hE(s,ae.memoizedState,e,n)}function dE(e,n){var s=ee();return ae===null?ym(s,e,n):hE(s,ae.memoizedState,e,n)}function ym(e,n,s){return s===void 0||(ra&1073741824)!==0?e.memoizedState=n:(e.memoizedState=s,e=fA(),At.lanes|=e,ca|=e,s)}function hE(e,n,s,o){return yn(s,n)?s:So.current!==null?(e=ym(e,s,o),yn(e,n)||($e=!0),e):(ra&42)===0?($e=!0,e.memoizedState=s):(e=fA(),At.lanes|=e,ca|=e,n)}function fE(e,n,s,o,d){var f=Zt.p;Zt.p=f!==0&&f<$i?f:$i;var v=G.T,E={};G.T=E,Am(e,!1,n,s),E._updatedFibers=new Set;try{var w=d(),x=G.S;if(x!==null&&x(E,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var H=Dk(w,o);Pl(e,n,H,jn(e))}else Pl(e,n,o,jn(e))}catch(V){Pl(e,n,{then:function(){},status:"rejected",reason:V},jn(e))}finally{Zt.p=f,G.T=v,v===null&&E._updatedFibers&&(e=E._updatedFibers.size,E._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function bm(e,n,s,o){if(e.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var d=pE(e).queue;fE(e,d,n,pr,s===null?g:function(){return mE(e),s(o)})}function pE(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:pr,baseState:pr,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:pr},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function mE(e){G.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var n=pE(e).next.queue;Pl(e,n,{},jn(e))}function vm(){var e=om(!1);return e=fE.bind(null,At,e.queue,!0,!1),Rn().memoizedState=e,[!1,e]}function gE(){var e=Fr(Si)[0],n=ee().memoizedState;return[typeof e=="boolean"?e:Ll(e),n]}function yE(){var e=Il(Si)[0],n=ee().memoizedState;return[typeof e=="boolean"?e:Ll(e),n]}function qa(){return fe(Uc)}function Sm(){var e=Rn(),n=oe.identifierPrefix;if(Yt){var s=Ss,o=vs;s=(o&~(1<<32-mn(o)-1)).toString(32)+s,n="«"+n+"R"+s,s=ch++,0<s&&(n+="H"+s.toString(32)),n+="»"}else s=eI++,n="«"+n+"r"+s.toString(32)+"»";return e.memoizedState=n}function Em(){return Rn().memoizedState=Lk.bind(null,At)}function Lk(e,n){for(var s=e.return;s!==null;){switch(s.tag){case 24:case 3:var o=jn(s);e=Gs(o);var d=Vs(s,e,o);d!==null&&(Ce(d,s,o),Ol(d,s,o)),s=$p(),n!=null&&d!==null&&console.error("The seed argument is not enabled outside experimental channels."),e.payload={cache:s};return}s=s.return}}function Ik(e,n,s){var o=arguments;typeof o[3]=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),o=jn(e);var d={lane:o,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};pd(e)?vE(n,d):(d=Op(e,n,d,o),d!==null&&(Ce(d,e,o),SE(d,n,o))),Un(e,o)}function bE(e,n,s){var o=arguments;typeof o[3]=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),o=jn(e),Pl(e,n,s,o),Un(e,o)}function Pl(e,n,s,o){var d={lane:o,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(pd(e))vE(n,d);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null)){var v=G.H;G.H=Ti;try{var E=n.lastRenderedState,w=f(E,s);if(d.hasEagerState=!0,d.eagerState=w,yn(w,E))return Xu(e,n,d,0),oe===null&&Yu(),!1}catch{}finally{G.H=v}}if(s=Op(e,n,d,o),s!==null)return Ce(s,e,o),SE(s,n,o),!0}return!1}function Am(e,n,s,o){if(G.T===null&&tr===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),o={lane:2,revertLane:Jm(),action:o,hasEagerState:!1,eagerState:null,next:null},pd(e)){if(n)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else n=Op(e,s,o,2),n!==null&&Ce(n,e,2);Un(e,2)}function pd(e){var n=e.alternate;return e===At||n!==null&&n===At}function vE(e,n){Ao=lh=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function SE(e,n,s){if((s&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,s|=o,n.lanes=s,zu(e,s)}}function Qe(e){var n=kt;return e!=null&&(kt=n===null?e:n.concat(e)),n}function md(e,n,s){for(var o=Object.keys(e.props),d=0;d<o.length;d++){var f=o[d];if(f!=="children"&&f!=="key"){n===null&&(n=Qu(e,s.mode,0),n._debugInfo=kt,n.return=s),pt(n,function(v){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v)},f);break}}}function gd(e){var n=Ec;return Ec+=1,_o===null&&(_o=BS()),jS(_o,e,n)}function Ul(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function yd(e,n){throw n.$$typeof===BN?Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
139
+ - Multiple copies of the "react" package is used.
140
+ - A library pre-bundled an old copy of "react" or "react/jsx-runtime".
141
+ - A compiler tries to "inline" JSX instead of using the runtime.`):(e=Object.prototype.toString.call(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead."))}function bd(e,n){var s=X(e)||"Component";XT[s]||(XT[s]=!0,n=n.displayName||n.name||"Component",e.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
142
+ root.render(%s)`,n,n,n):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
143
+ <%s>{%s}</%s>`,n,n,s,n,s))}function vd(e,n){var s=X(e)||"Component";WT[s]||(WT[s]=!0,n=String(n),e.tag===3?console.error(`Symbols are not valid as a React child.
144
+ root.render(%s)`,n):console.error(`Symbols are not valid as a React child.
145
+ <%s>%s</%s>`,s,n,s))}function EE(e){function n(D,M){if(e){var k=D.deletions;k===null?(D.deletions=[M],D.flags|=16):k.push(M)}}function s(D,M){if(!e)return null;for(;M!==null;)n(D,M),M=M.sibling;return null}function o(D){for(var M=new Map;D!==null;)D.key!==null?M.set(D.key,D):M.set(D.index,D),D=D.sibling;return M}function d(D,M){return D=rs(D,M),D.index=0,D.sibling=null,D}function f(D,M,k){return D.index=k,e?(k=D.alternate,k!==null?(k=k.index,k<M?(D.flags|=67108866,M):k):(D.flags|=67108866,M)):(D.flags|=1048576,M)}function v(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function E(D,M,k,Y){return M===null||M.tag!==6?(M=Pp(k,D.mode,Y),M.return=D,M._debugOwner=D,M._debugTask=D._debugTask,M._debugInfo=kt,M):(M=d(M,k),M.return=D,M._debugInfo=kt,M)}function w(D,M,k,Y){var nt=k.type;return nt===to?(M=H(D,M,k.props.children,Y,k.key),md(k,M,D),M):M!==null&&(M.elementType===nt||RS(M,k)||typeof nt=="object"&&nt!==null&&nt.$$typeof===$n&&oa(nt)===M.type)?(M=d(M,k.props),Ul(M,k),M.return=D,M._debugOwner=k._owner,M._debugInfo=kt,M):(M=Qu(k,D.mode,Y),Ul(M,k),M.return=D,M._debugInfo=kt,M)}function x(D,M,k,Y){return M===null||M.tag!==4||M.stateNode.containerInfo!==k.containerInfo||M.stateNode.implementation!==k.implementation?(M=Up(k,D.mode,Y),M.return=D,M._debugInfo=kt,M):(M=d(M,k.children||[]),M.return=D,M._debugInfo=kt,M)}function H(D,M,k,Y,nt){return M===null||M.tag!==7?(M=Ua(k,D.mode,Y,nt),M.return=D,M._debugOwner=D,M._debugTask=D._debugTask,M._debugInfo=kt,M):(M=d(M,k),M.return=D,M._debugInfo=kt,M)}function V(D,M,k){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Pp(""+M,D.mode,k),M.return=D,M._debugOwner=D,M._debugTask=D._debugTask,M._debugInfo=kt,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Zs:return k=Qu(M,D.mode,k),Ul(k,M),k.return=D,D=Qe(M._debugInfo),k._debugInfo=kt,kt=D,k;case Jr:return M=Up(M,D.mode,k),M.return=D,M._debugInfo=kt,M;case $n:var Y=Qe(M._debugInfo);return M=oa(M),D=V(D,M,k),kt=Y,D}if(Je(M)||j(M))return k=Ua(M,D.mode,k,null),k.return=D,k._debugOwner=D,k._debugTask=D._debugTask,D=Qe(M._debugInfo),k._debugInfo=kt,kt=D,k;if(typeof M.then=="function")return Y=Qe(M._debugInfo),D=V(D,gd(M),k),kt=Y,D;if(M.$$typeof===Bi)return V(D,Ju(D,M),k);yd(D,M)}return typeof M=="function"&&bd(D,M),typeof M=="symbol"&&vd(D,M),null}function z(D,M,k,Y){var nt=M!==null?M.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return nt!==null?null:E(D,M,""+k,Y);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Zs:return k.key===nt?(nt=Qe(k._debugInfo),D=w(D,M,k,Y),kt=nt,D):null;case Jr:return k.key===nt?x(D,M,k,Y):null;case $n:return nt=Qe(k._debugInfo),k=oa(k),D=z(D,M,k,Y),kt=nt,D}if(Je(k)||j(k))return nt!==null?null:(nt=Qe(k._debugInfo),D=H(D,M,k,Y,null),kt=nt,D);if(typeof k.then=="function")return nt=Qe(k._debugInfo),D=z(D,M,gd(k),Y),kt=nt,D;if(k.$$typeof===Bi)return z(D,M,Ju(D,k),Y);yd(D,k)}return typeof k=="function"&&bd(D,k),typeof k=="symbol"&&vd(D,k),null}function q(D,M,k,Y,nt){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return D=D.get(k)||null,E(M,D,""+Y,nt);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case Zs:return k=D.get(Y.key===null?k:Y.key)||null,D=Qe(Y._debugInfo),M=w(M,k,Y,nt),kt=D,M;case Jr:return D=D.get(Y.key===null?k:Y.key)||null,x(M,D,Y,nt);case $n:var xt=Qe(Y._debugInfo);return Y=oa(Y),M=q(D,M,k,Y,nt),kt=xt,M}if(Je(Y)||j(Y))return k=D.get(k)||null,D=Qe(Y._debugInfo),M=H(M,k,Y,nt,null),kt=D,M;if(typeof Y.then=="function")return xt=Qe(Y._debugInfo),M=q(D,M,k,gd(Y),nt),kt=xt,M;if(Y.$$typeof===Bi)return q(D,M,k,Ju(M,Y),nt);yd(M,Y)}return typeof Y=="function"&&bd(M,Y),typeof Y=="symbol"&&vd(M,Y),null}function ct(D,M,k,Y){if(typeof k!="object"||k===null)return Y;switch(k.$$typeof){case Zs:case Jr:h(D,M,k);var nt=k.key;if(typeof nt!="string")break;if(Y===null){Y=new Set,Y.add(nt);break}if(!Y.has(nt)){Y.add(nt);break}pt(M,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",nt)});break;case $n:k=oa(k),ct(D,M,k,Y)}return Y}function Et(D,M,k,Y){for(var nt=null,xt=null,ut=null,Rt=M,Dt=M=0,de=null;Rt!==null&&Dt<k.length;Dt++){Rt.index>Dt?(de=Rt,Rt=null):de=Rt.sibling;var Re=z(D,Rt,k[Dt],Y);if(Re===null){Rt===null&&(Rt=de);break}nt=ct(D,Re,k[Dt],nt),e&&Rt&&Re.alternate===null&&n(D,Rt),M=f(Re,M,Dt),ut===null?xt=Re:ut.sibling=Re,ut=Re,Rt=de}if(Dt===k.length)return s(D,Rt),Yt&&za(D,Dt),xt;if(Rt===null){for(;Dt<k.length;Dt++)Rt=V(D,k[Dt],Y),Rt!==null&&(nt=ct(D,Rt,k[Dt],nt),M=f(Rt,M,Dt),ut===null?xt=Rt:ut.sibling=Rt,ut=Rt);return Yt&&za(D,Dt),xt}for(Rt=o(Rt);Dt<k.length;Dt++)de=q(Rt,D,Dt,k[Dt],Y),de!==null&&(nt=ct(D,de,k[Dt],nt),e&&de.alternate!==null&&Rt.delete(de.key===null?Dt:de.key),M=f(de,M,Dt),ut===null?xt=de:ut.sibling=de,ut=de);return e&&Rt.forEach(function(Ds){return n(D,Ds)}),Yt&&za(D,Dt),xt}function le(D,M,k,Y){if(k==null)throw Error("An iterable object provided no iterator.");for(var nt=null,xt=null,ut=M,Rt=M=0,Dt=null,de=null,Re=k.next();ut!==null&&!Re.done;Rt++,Re=k.next()){ut.index>Rt?(Dt=ut,ut=null):Dt=ut.sibling;var Ds=z(D,ut,Re.value,Y);if(Ds===null){ut===null&&(ut=Dt);break}de=ct(D,Ds,Re.value,de),e&&ut&&Ds.alternate===null&&n(D,ut),M=f(Ds,M,Rt),xt===null?nt=Ds:xt.sibling=Ds,xt=Ds,ut=Dt}if(Re.done)return s(D,ut),Yt&&za(D,Rt),nt;if(ut===null){for(;!Re.done;Rt++,Re=k.next())ut=V(D,Re.value,Y),ut!==null&&(de=ct(D,ut,Re.value,de),M=f(ut,M,Rt),xt===null?nt=ut:xt.sibling=ut,xt=ut);return Yt&&za(D,Rt),nt}for(ut=o(ut);!Re.done;Rt++,Re=k.next())Dt=q(ut,D,Rt,Re.value,Y),Dt!==null&&(de=ct(D,Dt,Re.value,de),e&&Dt.alternate!==null&&ut.delete(Dt.key===null?Rt:Dt.key),M=f(Dt,M,Rt),xt===null?nt=Dt:xt.sibling=Dt,xt=Dt);return e&&ut.forEach(function(RI){return n(D,RI)}),Yt&&za(D,Rt),nt}function jt(D,M,k,Y){if(typeof k=="object"&&k!==null&&k.type===to&&k.key===null&&(md(k,null,D),k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case Zs:var nt=Qe(k._debugInfo);t:{for(var xt=k.key;M!==null;){if(M.key===xt){if(xt=k.type,xt===to){if(M.tag===7){s(D,M.sibling),Y=d(M,k.props.children),Y.return=D,Y._debugOwner=k._owner,Y._debugInfo=kt,md(k,Y,D),D=Y;break t}}else if(M.elementType===xt||RS(M,k)||typeof xt=="object"&&xt!==null&&xt.$$typeof===$n&&oa(xt)===M.type){s(D,M.sibling),Y=d(M,k.props),Ul(Y,k),Y.return=D,Y._debugOwner=k._owner,Y._debugInfo=kt,D=Y;break t}s(D,M);break}else n(D,M);M=M.sibling}k.type===to?(Y=Ua(k.props.children,D.mode,Y,k.key),Y.return=D,Y._debugOwner=D,Y._debugTask=D._debugTask,Y._debugInfo=kt,md(k,Y,D),D=Y):(Y=Qu(k,D.mode,Y),Ul(Y,k),Y.return=D,Y._debugInfo=kt,D=Y)}return D=v(D),kt=nt,D;case Jr:t:{for(nt=k,k=nt.key;M!==null;){if(M.key===k)if(M.tag===4&&M.stateNode.containerInfo===nt.containerInfo&&M.stateNode.implementation===nt.implementation){s(D,M.sibling),Y=d(M,nt.children||[]),Y.return=D,D=Y;break t}else{s(D,M);break}else n(D,M);M=M.sibling}Y=Up(nt,D.mode,Y),Y.return=D,D=Y}return v(D);case $n:return nt=Qe(k._debugInfo),k=oa(k),D=jt(D,M,k,Y),kt=nt,D}if(Je(k))return nt=Qe(k._debugInfo),D=Et(D,M,k,Y),kt=nt,D;if(j(k)){if(nt=Qe(k._debugInfo),xt=j(k),typeof xt!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var ut=xt.call(k);return ut===k?(D.tag!==0||Object.prototype.toString.call(D.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(ut)!=="[object Generator]")&&(qT||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),qT=!0):k.entries!==xt||dy||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),dy=!0),D=le(D,M,ut,Y),kt=nt,D}if(typeof k.then=="function")return nt=Qe(k._debugInfo),D=jt(D,M,gd(k),Y),kt=nt,D;if(k.$$typeof===Bi)return jt(D,M,Ju(D,k),Y);yd(D,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(nt=""+k,M!==null&&M.tag===6?(s(D,M.sibling),Y=d(M,nt),Y.return=D,D=Y):(s(D,M),Y=Pp(nt,D.mode,Y),Y.return=D,Y._debugOwner=D,Y._debugTask=D._debugTask,Y._debugInfo=kt,D=Y),v(D)):(typeof k=="function"&&bd(D,k),typeof k=="symbol"&&vd(D,k),s(D,M))}return function(D,M,k,Y){var nt=kt;kt=null;try{Ec=0;var xt=jt(D,M,k,Y);return _o=null,xt}catch(de){if(de===yc||de===ah)throw de;var ut=b(29,de,null,D.mode);ut.lanes=Y,ut.return=D;var Rt=ut._debugInfo=kt;if(ut._debugOwner=D._debugOwner,ut._debugTask=D._debugTask,Rt!=null){for(var Dt=Rt.length-1;0<=Dt;Dt--)if(typeof Rt[Dt].stack=="string"){ut._debugOwner=Rt[Dt],ut._debugTask=Rt[Dt].debugTask;break}}return ut}finally{kt=nt}}}function Ys(e){var n=e.alternate;lt(Be,Be.current&wo,e),lt(di,e,e),Xi===null&&(n===null||So.current!==null||n.memoizedState!==null)&&(Xi=e)}function AE(e){if(e.tag===22){if(lt(Be,Be.current,e),lt(di,e,e),Xi===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(Xi=e)}}else Xs(e)}function Xs(e){lt(Be,Be.current,e),lt(di,di.current,e)}function cs(e){K(di,e),Xi===e&&(Xi=null),K(Be,e)}function Sd(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data===Cs||ug(s)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function _m(e){if(e!==null&&typeof e!="function"){var n=String(e);ow.has(n)||(ow.add(n),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",e))}}function Tm(e,n,s,o){var d=e.memoizedState,f=s(o,d);if(e.mode&ln){tt(!0);try{f=s(o,d)}finally{tt(!1)}}f===void 0&&(n=F(n)||"Component",iw.has(n)||(iw.add(n),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",n))),d=f==null?d:Lt({},d,f),e.memoizedState=d,e.lanes===0&&(e.updateQueue.baseState=d)}function _E(e,n,s,o,d,f,v){var E=e.stateNode;if(typeof E.shouldComponentUpdate=="function"){if(s=E.shouldComponentUpdate(o,f,v),e.mode&ln){tt(!0);try{s=E.shouldComponentUpdate(o,f,v)}finally{tt(!1)}}return s===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",F(n)||"Component"),s}return n.prototype&&n.prototype.isPureReactComponent?!Tl(s,o)||!Tl(d,f):!0}function TE(e,n,s,o){var d=n.state;typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,o),n.state!==d&&(e=X(e)||"Component",ZT.has(e)||(ZT.add(e),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",e)),hy.enqueueReplaceState(n,n.state,null))}function Ya(e,n){var s=n;if("ref"in n){s={};for(var o in n)o!=="ref"&&(s[o]=n[o])}if(e=e.defaultProps){s===n&&(s=Lt({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function wE(e){fy(e),console.warn(`%s
146
+
147
+ %s
148
+ `,Co?"An error occurred in the <"+Co+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
149
+ Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}function CE(e){var n=Co?"The above error occurred in the <"+Co+"> component.":"The above error occurred in one of your React components.",s="React will try to recreate this component tree from scratch using the error boundary you provided, "+((py||"Anonymous")+".");if(typeof e=="object"&&e!==null&&typeof e.environmentName=="string"){var o=e.environmentName;e=[`%o
150
+
151
+ %s
152
+
153
+ %s
154
+ `,e,n,s].slice(0),typeof e[0]=="string"?e.splice(0,1,Hw+e[0],Bw,Dh+o+Dh,Fw):e.splice(0,0,Hw,Bw,Dh+o+Dh,Fw),e.unshift(console),o=CI.apply(console.error,e),o()}else console.error(`%o
155
+
156
+ %s
157
+
158
+ %s
159
+ `,e,n,s)}function xE(e){fy(e)}function Ed(e,n){try{Co=n.source?X(n.source):null,py=null;var s=n.value;if(G.actQueue!==null)G.thrownErrors.push(s);else{var o=e.onUncaughtError;o(s,{componentStack:n.stack})}}catch(d){setTimeout(function(){throw d})}}function RE(e,n,s){try{Co=s.source?X(s.source):null,py=X(n);var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function wm(e,n,s){return s=Gs(s),s.tag=iy,s.payload={element:null},s.callback=function(){pt(n.source,Ed,e,n)},s}function Cm(e){return e=Gs(e),e.tag=iy,e}function xm(e,n,s,o){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var f=o.value;e.payload=function(){return d(f)},e.callback=function(){DS(s),pt(o.source,RE,n,s,o)}}var v=s.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){DS(s),pt(o.source,RE,n,s,o),typeof d!="function"&&(da===null?da=new Set([this]):da.add(this)),iI(this,o),typeof d=="function"||(s.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",X(s)||"Unknown")})}function Pk(e,n,s,o,d){if(s.flags|=32768,Ei&&Gl(e,d),o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=s.alternate,n!==null&&Rl(n,s,d,!0),Yt&&(Es=!0),s=di.current,s!==null){switch(s.tag){case 13:return Xi===null?qm():s.alternate===null&&Se===ws&&(Se=by),s.flags&=-257,s.flags|=65536,s.lanes=d,o===ny?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([o]):n.add(o),Wm(e,o,d)),!1;case 22:return s.flags|=65536,o===ny?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([o]):s.add(o)),Wm(e,o,d)),!1}throw Error("Unexpected Suspense handler tag ("+s.tag+"). This is a bug in React.")}return Wm(e,o,d),qm(),!1}if(Yt)return Es=!0,n=di.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,o!==Zg&&xl(Hn(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:o}),s))):(o!==Zg&&xl(Hn(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:o}),s)),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,o=Hn(o,s),d=wm(e.stateNode,o,d),sd(e,d),Se!==sr&&(Se=Mo)),!1;var f=Hn(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:o}),s);if(Dc===null?Dc=[f]:Dc.push(f),Se!==sr&&(Se=Mo),n===null)return!0;o=Hn(o,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=wm(s.stateNode,o,e),sd(s,e),!1;case 1:if(n=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(da===null||!da.has(f))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Cm(d),xm(d,e,s,o),sd(s,d),!1}s=s.return}while(s!==null);return!1}function Ke(e,n,s,o){n.child=e===null?QT(n,null,s,o):To(n,e.child,s,o)}function DE(e,n,s,o,d){s=s.render;var f=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return ja(n),be(n),o=Zp(e,n,s,v,f,d),E=tm(),We(),e!==null&&!$e?(em(e,n,d),us(e,n,d)):(Yt&&E&&zp(n),n.flags|=1,Ke(e,n,o,d),n.child)}function ME(e,n,s,o,d){if(e===null){var f=s.type;return typeof f=="function"&&!Lp(f)&&f.defaultProps===void 0&&s.compare===null?(s=Pa(f),n.tag=15,n.type=s,Dm(n,f),OE(e,n,s,o,d)):(e=Ip(s.type,null,o,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!Im(e,d)){var v=f.memoizedProps;if(s=s.compare,s=s!==null?s:Tl,s(v,o)&&e.ref===n.ref)return us(e,n,d)}return n.flags|=1,e=rs(f,o),e.ref=n.ref,e.return=n,n.child=e}function OE(e,n,s,o,d){if(e!==null){var f=e.memoizedProps;if(Tl(f,o)&&e.ref===n.ref&&n.type===e.type)if($e=!1,n.pendingProps=o=f,Im(e,d))(e.flags&131072)!==0&&($e=!0);else return n.lanes=e.lanes,us(e,n,d)}return Rm(e,n,s,o,d)}function kE(e,n,s){var o=n.pendingProps,d=o.children,f=e!==null?e.memoizedState:null;if(o.mode==="hidden"){if((n.flags&128)!==0){if(o=f!==null?f.baseLanes|s:s,e!==null){for(d=n.child=e.child,f=0;d!==null;)f=f|d.lanes|d.childLanes,d=d.sibling;n.childLanes=f&~o}else n.childLanes=0,n.child=null;return NE(e,n,o,s)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&nd(n,f!==null?f.cachePool:null),f!==null?YS(n,f):Wp(n),AE(n);else return n.lanes=n.childLanes=536870912,NE(e,n,f!==null?f.baseLanes|s:s,s)}else f!==null?(nd(n,f.cachePool),YS(n,f),Xs(n),n.memoizedState=null):(e!==null&&nd(n,null),Wp(n),Xs(n));return Ke(e,n,d,s),n.child}function NE(e,n,s,o){var d=qp();return d=d===null?null:{parent:ze._currentValue,pool:d},n.memoizedState={baseLanes:s,cachePool:d},e!==null&&nd(n,null),Wp(n),AE(n),e!==null&&Rl(e,n,o,!0),null}function Ad(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Rm(e,n,s,o,d){if(s.prototype&&typeof s.prototype.render=="function"){var f=F(s)||"Unknown";cw[f]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",f,f),cw[f]=!0)}return n.mode&ln&&_i.recordLegacyContextWarning(n,null),e===null&&(Dm(n,n.type),s.contextTypes&&(f=F(s)||"Unknown",dw[f]||(dw[f]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",f)))),ja(n),be(n),s=Zp(e,n,s,o,void 0,d),o=tm(),We(),e!==null&&!$e?(em(e,n,d),us(e,n,d)):(Yt&&o&&zp(n),n.flags|=1,Ke(e,n,s,d),n.child)}function LE(e,n,s,o,d,f){return ja(n),be(n),_s=-1,Sc=e!==null&&e.type!==n.type,n.updateQueue=null,s=Jp(n,o,s,d),XS(e,n),o=tm(),We(),e!==null&&!$e?(em(e,n,f),us(e,n,f)):(Yt&&o&&zp(n),n.flags|=1,Ke(e,n,s,f),n.child)}function IE(e,n,s,o,d){switch(u(n)){case!1:var f=n.stateNode,v=new n.type(n.memoizedProps,f.context).state;f.updater.enqueueSetState(f,v,null);break;case!0:n.flags|=128,n.flags|=65536,f=Error("Simulated error coming from DevTools");var E=d&-d;if(n.lanes|=E,v=oe,v===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");E=Cm(E),xm(E,v,n,Hn(f,n)),sd(n,E)}if(ja(n),n.stateNode===null){if(v=sa,f=s.contextType,"contextType"in s&&f!==null&&(f===void 0||f.$$typeof!==Bi)&&!rw.has(s)&&(rw.add(s),E=f===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof f!="object"?" However, it is set to a "+typeof f+".":f.$$typeof===Ag?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(f).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",F(s)||"Component",E)),typeof f=="object"&&f!==null&&(v=fe(f)),f=new s(o,v),n.mode&ln){tt(!0);try{f=new s(o,v)}finally{tt(!1)}}if(v=n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=hy,n.stateNode=f,f._reactInternals=n,f._reactInternalInstance=KT,typeof s.getDerivedStateFromProps=="function"&&v===null&&(v=F(s)||"Component",JT.has(v)||(JT.add(v),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",v,f.state===null?"null":"undefined",v))),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"){var w=E=v=null;if(typeof f.componentWillMount=="function"&&f.componentWillMount.__suppressDeprecationWarning!==!0?v="componentWillMount":typeof f.UNSAFE_componentWillMount=="function"&&(v="UNSAFE_componentWillMount"),typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps.__suppressDeprecationWarning!==!0?E="componentWillReceiveProps":typeof f.UNSAFE_componentWillReceiveProps=="function"&&(E="UNSAFE_componentWillReceiveProps"),typeof f.componentWillUpdate=="function"&&f.componentWillUpdate.__suppressDeprecationWarning!==!0?w="componentWillUpdate":typeof f.UNSAFE_componentWillUpdate=="function"&&(w="UNSAFE_componentWillUpdate"),v!==null||E!==null||w!==null){f=F(s)||"Component";var x=typeof s.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";ew.has(f)||(ew.add(f),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
160
+
161
+ %s uses %s but also contains the following legacy lifecycles:%s%s%s
162
+
163
+ The above lifecycles should be removed. Learn more about this warning here:
164
+ https://react.dev/link/unsafe-component-lifecycles`,f,x,v!==null?`
165
+ `+v:"",E!==null?`
166
+ `+E:"",w!==null?`
167
+ `+w:""))}}f=n.stateNode,v=F(s)||"Component",f.render||(s.prototype&&typeof s.prototype.render=="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",v):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",v)),!f.getInitialState||f.getInitialState.isReactClassApproved||f.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",v),f.getDefaultProps&&!f.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",v),f.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",v),s.childContextTypes&&!aw.has(s)&&(aw.add(s),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",v)),s.contextTypes&&!sw.has(s)&&(sw.add(s),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",v)),typeof f.componentShouldUpdate=="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",v),s.prototype&&s.prototype.isPureReactComponent&&typeof f.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",F(s)||"A pure component"),typeof f.componentDidUnmount=="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",v),typeof f.componentDidReceiveProps=="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",v),typeof f.componentWillRecieveProps=="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",v),typeof f.UNSAFE_componentWillRecieveProps=="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",v),E=f.props!==o,f.props!==void 0&&E&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",v),f.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",v,v),typeof f.getSnapshotBeforeUpdate!="function"||typeof f.componentDidUpdate=="function"||tw.has(s)||(tw.add(s),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",F(s))),typeof f.getDerivedStateFromProps=="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof f.getDerivedStateFromError=="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof s.getSnapshotBeforeUpdate=="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",v),(E=f.state)&&(typeof E!="object"||Je(E))&&console.error("%s.state: must be set to an object or null",v),typeof f.getChildContext=="function"&&typeof s.childContextTypes!="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",v),f=n.stateNode,f.props=o,f.state=n.memoizedState,f.refs={},Yp(n),v=s.contextType,f.context=typeof v=="object"&&v!==null?fe(v):sa,f.state===o&&(v=F(s)||"Component",nw.has(v)||(nw.add(v),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",v))),n.mode&ln&&_i.recordLegacyContextWarning(n,f),_i.recordUnsafeLifecycleWarnings(n,f),f.state=n.memoizedState,v=s.getDerivedStateFromProps,typeof v=="function"&&(Tm(n,s,v,o),f.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",X(n)||"Component"),hy.enqueueReplaceState(f,f.state,null)),Nl(n,o,f,d),kl(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&Ai)!==ue&&(n.flags|=134217728),f=!0}else if(e===null){f=n.stateNode;var H=n.memoizedProps;E=Ya(s,H),f.props=E;var V=f.context;w=s.contextType,v=sa,typeof w=="object"&&w!==null&&(v=fe(w)),x=s.getDerivedStateFromProps,w=typeof x=="function"||typeof f.getSnapshotBeforeUpdate=="function",H=n.pendingProps!==H,w||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(H||V!==v)&&TE(n,f,o,v),aa=!1;var z=n.memoizedState;f.state=z,Nl(n,o,f,d),kl(),V=n.memoizedState,H||z!==V||aa?(typeof x=="function"&&(Tm(n,s,x,o),V=n.memoizedState),(E=aa||_E(n,s,E,o,z,V,v))?(w||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&Ai)!==ue&&(n.flags|=134217728)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&Ai)!==ue&&(n.flags|=134217728),n.memoizedProps=o,n.memoizedState=V),f.props=o,f.state=V,f.context=v,f=E):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&Ai)!==ue&&(n.flags|=134217728),f=!1)}else{f=n.stateNode,Xp(e,n),v=n.memoizedProps,w=Ya(s,v),f.props=w,x=n.pendingProps,z=f.context,V=s.contextType,E=sa,typeof V=="object"&&V!==null&&(E=fe(V)),H=s.getDerivedStateFromProps,(V=typeof H=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==x||z!==E)&&TE(n,f,o,E),aa=!1,z=n.memoizedState,f.state=z,Nl(n,o,f,d),kl();var q=n.memoizedState;v!==x||z!==q||aa||e!==null&&e.dependencies!==null&&Zu(e.dependencies)?(typeof H=="function"&&(Tm(n,s,H,o),q=n.memoizedState),(w=aa||_E(n,s,w,o,z,q,E)||e!==null&&e.dependencies!==null&&Zu(e.dependencies))?(V||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,q,E),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,q,E)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&z===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&z===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=q),f.props=o,f.state=q,f.context=E,f=w):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&z===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&z===e.memoizedState||(n.flags|=1024),f=!1)}if(E=f,Ad(e,n),v=(n.flags&128)!==0,E||v){if(E=n.stateNode,Sp(n),v&&typeof s.getDerivedStateFromError!="function")s=null,On=-1;else{if(be(n),s=PT(E),n.mode&ln){tt(!0);try{PT(E)}finally{tt(!1)}}We()}n.flags|=1,e!==null&&v?(n.child=To(n,e.child,null,d),n.child=To(n,null,s,d)):Ke(e,n,s,d),n.memoizedState=E.state,e=n.child}else e=us(e,n,d);return d=n.stateNode,f&&d.props!==o&&(xo||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",X(n)||"a component"),xo=!0),e}function PE(e,n,s,o){return Cl(),n.flags|=256,Ke(e,n,s,o),n.child}function Dm(e,n){n&&n.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
168
+ %s.childContextTypes = ...`,n.displayName||n.name||"Component"),typeof n.getDerivedStateFromProps=="function"&&(e=F(n)||"Unknown",hw[e]||(console.error("%s: Function components do not support getDerivedStateFromProps.",e),hw[e]=!0)),typeof n.contextType=="object"&&n.contextType!==null&&(n=F(n)||"Unknown",uw[n]||(console.error("%s: Function components do not support contextType.",n),uw[n]=!0))}function Mm(e){return{baseLanes:e,cachePool:HS()}}function Om(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=Yn),e}function UE(e,n,s){var o,d=n.pendingProps;c(n)&&(n.flags|=128);var f=!1,v=(n.flags&128)!==0;if((o=v)||(o=e!==null&&e.memoizedState===null?!1:(Be.current&Ac)!==0),o&&(f=!0,n.flags&=-129),o=(n.flags&32)!==0,n.flags&=-33,e===null){if(Yt){if(f?Ys(n):Xs(n),Yt){var E=ve,w;if(!(w=!E)){t:{var x=E;for(w=qi;x.nodeType!==8;){if(!w){w=null;break t}if(x=ei(x.nextSibling),x===null){w=null;break t}}w=x}w!==null?(Ha(),n.memoizedState={dehydrated:w,treeContext:Ka!==null?{id:vs,overflow:Ss}:null,retryLane:536870912,hydrationErrors:null},x=b(18,null,null,ue),x.stateNode=w,x.return=n,n.child=x,bn=n,ve=null,w=!0):w=!1,w=!w}w&&(Bp(n,E),Fa(n))}if(E=n.memoizedState,E!==null&&(E=E.dehydrated,E!==null))return ug(E)?n.lanes=32:n.lanes=536870912,null;cs(n)}return E=d.children,d=d.fallback,f?(Xs(n),f=n.mode,E=_d({mode:"hidden",children:E},f),d=Ua(d,f,s,null),E.return=n,d.return=n,E.sibling=d,n.child=E,f=n.child,f.memoizedState=Mm(s),f.childLanes=Om(e,o,s),n.memoizedState=gy,d):(Ys(n),km(n,E))}var H=e.memoizedState;if(H!==null&&(E=H.dehydrated,E!==null)){if(v)n.flags&256?(Ys(n),n.flags&=-257,n=Nm(e,n,s)):n.memoizedState!==null?(Xs(n),n.child=e.child,n.flags|=128,n=null):(Xs(n),f=d.fallback,E=n.mode,d=_d({mode:"visible",children:d.children},E),f=Ua(f,E,s,null),f.flags|=2,d.return=n,f.return=n,d.sibling=f,n.child=d,To(n,e.child,null,s),d=n.child,d.memoizedState=Mm(s),d.childLanes=Om(e,o,s),n.memoizedState=gy,n=f);else if(Ys(n),Yt&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),ug(E)){if(o=E.nextSibling&&E.nextSibling.dataset,o){w=o.dgst;var V=o.msg;x=o.stck;var z=o.cstck}E=V,o=w,d=x,w=f=z,f=Error(E||"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),f.stack=d||"",f.digest=o,o=w===void 0?null:w,d={value:f,source:null,stack:o},typeof o=="string"&&Qg.set(f,d),xl(d),n=Nm(e,n,s)}else if($e||Rl(e,n,s,!1),o=(s&e.childLanes)!==0,$e||o){if(o=oe,o!==null&&(d=s&-s,d=(d&42)!==0?1:pl(d),d=(d&(o.suspendedLanes|s))!==0?0:d,d!==0&&d!==H.retryLane))throw H.retryLane=d,xn(e,d),Ce(o,e,d),lw;E.data===Cs||qm(),n=Nm(e,n,s)}else E.data===Cs?(n.flags|=192,n.child=e.child,n=null):(e=H.treeContext,ve=ei(E.nextSibling),bn=n,Yt=!0,Za=null,Es=!1,oi=null,qi=!1,e!==null&&(Ha(),ai[ri++]=vs,ai[ri++]=Ss,ai[ri++]=Ka,vs=e.id,Ss=e.overflow,Ka=n),n=km(n,d.children),n.flags|=4096);return n}return f?(Xs(n),f=d.fallback,E=n.mode,w=e.child,x=w.sibling,d=rs(w,{mode:"hidden",children:d.children}),d.subtreeFlags=w.subtreeFlags&65011712,x!==null?f=rs(x,f):(f=Ua(f,E,s,null),f.flags|=2),f.return=n,d.return=n,d.sibling=f,n.child=d,d=f,f=n.child,E=e.child.memoizedState,E===null?E=Mm(s):(w=E.cachePool,w!==null?(x=ze._currentValue,w=w.parent!==x?{parent:x,pool:x}:w):w=HS(),E={baseLanes:E.baseLanes|s,cachePool:w}),f.memoizedState=E,f.childLanes=Om(e,o,s),n.memoizedState=gy,d):(Ys(n),s=e.child,e=s.sibling,s=rs(s,{mode:"visible",children:d.children}),s.return=n,s.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=s,n.memoizedState=null,s)}function km(e,n){return n=_d({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function _d(e,n){return e=b(22,e,null,n),e.lanes=0,e.stateNode={_visibility:Kd,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Nm(e,n,s){return To(n,e.child,null,s),e=km(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function zE(e,n,s){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Fp(e.return,n,s)}function HE(e,n){var s=Je(e);return e=!s&&typeof j(e)=="function",s||e?(s=s?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",s,n,s),!1):!0}function Lm(e,n,s,o,d){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:d}:(f.isBackwards=n,f.rendering=null,f.renderingStartTime=0,f.last=o,f.tail=s,f.tailMode=d)}function BE(e,n,s){var o=n.pendingProps,d=o.revealOrder,f=o.tail;if(o=o.children,d!==void 0&&d!=="forwards"&&d!=="backwards"&&d!=="together"&&!fw[d])if(fw[d]=!0,typeof d=="string")switch(d.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',d,d.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',d,d.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',d)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',d);f===void 0||my[f]||(f!=="collapsed"&&f!=="hidden"?(my[f]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',f)):d!=="forwards"&&d!=="backwards"&&(my[f]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',f)));t:if((d==="forwards"||d==="backwards")&&o!==void 0&&o!==null&&o!==!1)if(Je(o)){for(var v=0;v<o.length;v++)if(!HE(o[v],v))break t}else if(v=j(o),typeof v=="function"){if(v=v.call(o))for(var E=v.next(),w=0;!E.done;E=v.next()){if(!HE(E.value,w))break t;w++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',d);if(Ke(e,n,o,s),o=Be.current,(o&Ac)!==0)o=o&wo|Ac,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)t:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zE(e,s,n);else if(e.tag===19)zE(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break t;for(;e.sibling===null;){if(e.return===null||e.return===n)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=wo}switch(lt(Be,o,n),d){case"forwards":for(s=n.child,d=null;s!==null;)e=s.alternate,e!==null&&Sd(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=n.child,n.child=null):(d=s.sibling,s.sibling=null),Lm(n,!1,d,s,f);break;case"backwards":for(s=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Sd(e)===null){n.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Lm(n,!0,s,null,f);break;case"together":Lm(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function us(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),On=-1,ca|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(Rl(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error("Resuming work not yet implemented.");if(n.child!==null){for(e=n.child,s=rs(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=rs(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function Im(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Zu(e)))}function Uk(e,n,s){switch(n.tag){case 3:yt(n,n.stateNode.containerInfo),$s(n,ze,e.memoizedState.cache),Cl();break;case 27:case 5:Q(n);break;case 4:yt(n,n.stateNode.containerInfo);break;case 10:$s(n,n.type,n.memoizedProps.value);break;case 12:(s&n.childLanes)!==0&&(n.flags|=4),n.flags|=2048;var o=n.stateNode;o.effectDuration=-0,o.passiveEffectDuration=-0;break;case 13:if(o=n.memoizedState,o!==null)return o.dehydrated!==null?(Ys(n),n.flags|=128,null):(s&n.child.childLanes)!==0?UE(e,n,s):(Ys(n),e=us(e,n,s),e!==null?e.sibling:null);Ys(n);break;case 19:var d=(e.flags&128)!==0;if(o=(s&n.childLanes)!==0,o||(Rl(e,n,s,!1),o=(s&n.childLanes)!==0),d){if(o)return BE(e,n,s);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),lt(Be,Be.current,n),o)break;return null;case 22:case 23:return n.lanes=0,kE(e,n,s);case 24:$s(n,ze,e.memoizedState.cache)}return us(e,n,s)}function Pm(e,n,s){if(n._debugNeedsRemount&&e!==null){s=Ip(n.type,n.key,n.pendingProps,n._debugOwner||null,n.mode,n.lanes),s._debugStack=n._debugStack,s._debugTask=n._debugTask;var o=n.return;if(o===null)throw Error("Cannot swap the root fiber.");if(e.alternate=null,n.alternate=null,s.index=n.index,s.sibling=n.sibling,s.return=n.return,s.ref=n.ref,s._debugInfo=n._debugInfo,n===o.child)o.child=s;else{var d=o.child;if(d===null)throw Error("Expected parent to have a child.");for(;d.sibling!==n;)if(d=d.sibling,d===null)throw Error("Expected to find the previous sibling.");d.sibling=s}return n=o.deletions,n===null?(o.deletions=[e],o.flags|=16):n.push(e),s.flags|=2,s}if(e!==null)if(e.memoizedProps!==n.pendingProps||n.type!==e.type)$e=!0;else{if(!Im(e,s)&&(n.flags&128)===0)return $e=!1,Uk(e,n,s);$e=(e.flags&131072)!==0}else $e=!1,(o=Yt)&&(Ha(),o=(n.flags&1048576)!==0),o&&(o=n.index,Ha(),OS(n,Jd,o));switch(n.lanes=0,n.tag){case 16:t:if(o=n.pendingProps,e=oa(n.elementType),n.type=e,typeof e=="function")Lp(e)?(o=Ya(e,o),n.tag=1,n.type=e=Pa(e),n=IE(null,n,e,o,s)):(n.tag=0,Dm(n,e),n.type=e=Pa(e),n=Rm(null,n,e,o,s));else{if(e!=null){if(d=e.$$typeof,d===Zl){n.tag=11,n.type=e=kp(e),n=DE(null,n,e,o,s);break t}else if(d===Bd){n.tag=14,n=ME(null,n,e,o,s);break t}}throw n="",e!==null&&typeof e=="object"&&e.$$typeof===$n&&(n=" Did you wrap a component in React.lazy() more than once?"),e=F(e)||e,Error("Element type is invalid. Received a promise that resolves to: "+e+". Lazy element type must resolve to a class or function."+n)}return n;case 0:return Rm(e,n,n.type,n.pendingProps,s);case 1:return o=n.type,d=Ya(o,n.pendingProps),IE(e,n,o,d,s);case 3:t:{if(yt(n,n.stateNode.containerInfo),e===null)throw Error("Should have a current fiber. This is a bug in React.");o=n.pendingProps;var f=n.memoizedState;d=f.element,Xp(e,n),Nl(n,o,null,s);var v=n.memoizedState;if(o=v.cache,$s(n,ze,o),o!==f.cache&&jp(n,[ze],s,!0),kl(),o=v.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=PE(e,n,o,s);break t}else if(o!==d){d=Hn(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),n),xl(d),n=PE(e,n,o,s);break t}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ve=ei(e.firstChild),bn=n,Yt=!0,Za=null,Es=!1,oi=null,qi=!0,e=QT(n,null,o,s),n.child=e;e;)e.flags=e.flags&-3|4096,e=e.sibling}else{if(Cl(),o===d){n=us(e,n,s);break t}Ke(e,n,o,s)}n=n.child}return n;case 26:return Ad(e,n),e===null?(e=a_(n.type,null,n.pendingProps,null))?n.memoizedState=e:Yt||(e=n.type,s=n.pendingProps,o=St(ta.current),o=Od(o).createElement(e),o[on]=n,o[Mn]=s,Ze(o,e,s),P(o),n.stateNode=o):n.memoizedState=a_(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Q(n),e===null&&Yt&&(o=St(ta.current),d=B(),o=n.stateNode=i_(n.type,n.pendingProps,o,d,!1),Es||(d=XA(o,n.type,n.pendingProps,d),d!==null&&(Ba(n,0).serverProps=d)),bn=n,qi=!0,d=ve,Ks(n.type)?(Hy=d,ve=ei(o.firstChild)):ve=d),Ke(e,n,n.pendingProps.children,s),Ad(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Yt&&(f=B(),o=xp(n.type,f.ancestorInfo),d=ve,(v=!d)||(v=SN(d,n.type,n.pendingProps,qi),v!==null?(n.stateNode=v,Es||(f=XA(v,n.type,n.pendingProps,f),f!==null&&(Ba(n,0).serverProps=f)),bn=n,ve=ei(v.firstChild),qi=!1,f=!0):f=!1,v=!f),v&&(o&&Bp(n,d),Fa(n))),Q(n),d=n.type,f=n.pendingProps,v=e!==null?e.memoizedProps:null,o=f.children,lg(d,f)?o=null:v!==null&&lg(d,v)&&(n.flags|=32),n.memoizedState!==null&&(d=Zp(e,n,Ok,null,null,s),Uc._currentValue=d),Ad(e,n),Ke(e,n,o,s),n.child;case 6:return e===null&&Yt&&(e=n.pendingProps,s=B(),o=s.ancestorInfo.current,e=o!=null?$u(e,o.tag,s.ancestorInfo.implicitRootScope):!0,s=ve,(o=!s)||(o=EN(s,n.pendingProps,qi),o!==null?(n.stateNode=o,bn=n,ve=null,o=!0):o=!1,o=!o),o&&(e&&Bp(n,s),Fa(n))),null;case 13:return UE(e,n,s);case 4:return yt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=To(n,null,o,s):Ke(e,n,o,s),n.child;case 11:return DE(e,n,n.type,n.pendingProps,s);case 7:return Ke(e,n,n.pendingProps,s),n.child;case 8:return Ke(e,n,n.pendingProps.children,s),n.child;case 12:return n.flags|=4,n.flags|=2048,o=n.stateNode,o.effectDuration=-0,o.passiveEffectDuration=-0,Ke(e,n,n.pendingProps.children,s),n.child;case 10:return o=n.type,d=n.pendingProps,f=d.value,"value"in d||pw||(pw=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),$s(n,o,f),Ke(e,n,d.children,s),n.child;case 9:return d=n.type._context,o=n.pendingProps.children,typeof o!="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),ja(n),d=fe(d),be(n),o=cy(o,d,void 0),We(),n.flags|=1,Ke(e,n,o,s),n.child;case 14:return ME(e,n,n.type,n.pendingProps,s);case 15:return OE(e,n,n.type,n.pendingProps,s);case 19:return BE(e,n,s);case 31:return o=n.pendingProps,s=n.mode,o={mode:o.mode,children:o.children},e===null?(e=_d(o,s),e.ref=n.ref,n.child=e,e.return=n,n=e):(e=rs(e.child,o),e.ref=n.ref,n.child=e,e.return=n,n=e),n;case 22:return kE(e,n,s);case 24:return ja(n),o=fe(ze),e===null?(d=qp(),d===null&&(d=oe,f=$p(),d.pooledCache=f,$a(f),f!==null&&(d.pooledCacheLanes|=s),d=f),n.memoizedState={parent:o,cache:d},Yp(n),$s(n,ze,d)):((e.lanes&s)!==0&&(Xp(e,n),Nl(n,null,null,s),kl()),d=e.memoizedState,f=n.memoizedState,d.parent!==o?(d={parent:o,cache:o},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),$s(n,ze,o)):(o=f.cache,$s(n,ze,o),o!==d.cache&&jp(n,[ze],s,!0))),Ke(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error("Unknown unit of work tag ("+n.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function ds(e){e.flags|=4}function FE(e,n){if(n.type!=="stylesheet"||(n.state.loading&hi)!==fr)e.flags&=-16777217;else if(e.flags|=16777216,!u_(n)){if(n=di.current,n!==null&&((Bt&4194048)===Bt?Xi!==null:(Bt&62914560)!==Bt&&(Bt&536870912)===0||n!==Xi))throw bc=ny,TT;e.flags|=8192}}function Td(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ka():536870912,e.lanes|=n,or|=n)}function zl(e,n){if(!Yt)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function pe(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(n)if((e.mode&tn)!==ue){for(var d=e.selfBaseDuration,f=e.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,d+=f.treeBaseDuration,f=f.sibling;e.treeBaseDuration=d}else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags&65011712,o|=d.flags&65011712,d.return=e,d=d.sibling;else if((e.mode&tn)!==ue){d=e.actualDuration,f=e.selfBaseDuration;for(var v=e.child;v!==null;)s|=v.lanes|v.childLanes,o|=v.subtreeFlags,o|=v.flags,d+=v.actualDuration,f+=v.treeBaseDuration,v=v.sibling;e.actualDuration=d,e.treeBaseDuration=f}else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=s,n}function zk(e,n,s){var o=n.pendingProps;switch(Hp(n),n.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pe(n),null;case 1:return pe(n),null;case 3:return s=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),os(ze,n),Gt(n),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(wl(n)?(IS(),ds(n)):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,LS())),pe(n),null;case 26:return s=n.memoizedState,e===null?(ds(n),s!==null?(pe(n),FE(n,s)):(pe(n),n.flags&=-16777217)):s?s!==e.memoizedState?(ds(n),pe(n),FE(n,s)):(pe(n),n.flags&=-16777217):(e.memoizedProps!==o&&ds(n),pe(n),n.flags&=-16777217),null;case 27:dt(n),s=St(ta.current);var d=n.type;if(e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ds(n);else{if(!o){if(n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return pe(n),null}e=B(),wl(n)?kS(n):(e=i_(d,o,s,e,!0),n.stateNode=e,ds(n))}return pe(n),null;case 5:if(dt(n),s=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ds(n);else{if(!o){if(n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return pe(n),null}if(d=B(),wl(n))kS(n);else{switch(e=St(ta.current),xp(s,d.ancestorInfo),d=d.context,e=Od(e),d){case Po:e=e.createElementNS(so,s);break;case Ch:e=e.createElementNS(qd,s);break;default:switch(s){case"svg":e=e.createElementNS(so,s);break;case"math":e=e.createElementNS(qd,s);break;case"script":e=e.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof o.is=="string"?e.createElement("select",{is:o.is}):e.createElement("select"),o.multiple?e.multiple=!0:o.size&&(e.size=o.size);break;default:e=typeof o.is=="string"?e.createElement(s,{is:o.is}):e.createElement(s),s.indexOf("-")===-1&&(s!==s.toLowerCase()&&console.error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",s),Object.prototype.toString.call(e)!=="[object HTMLUnknownElement]"||gs.call(Nw,s)||(Nw[s]=!0,console.error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",s)))}}e[on]=n,e[Mn]=o;t:for(d=n.child;d!==null;){if(d.tag===5||d.tag===6)e.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break t;for(;d.sibling===null;){if(d.return===null||d.return===n)break t;d=d.return}d.sibling.return=d.return,d=d.sibling}n.stateNode=e;t:switch(Ze(e,s,o),s){case"button":case"input":case"select":case"textarea":e=!!o.autoFocus;break t;case"img":e=!0;break t;default:e=!1}e&&ds(n)}}return pe(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&ds(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(e=St(ta.current),s=B(),wl(n)){e=n.stateNode,s=n.memoizedProps,d=!Es,o=null;var f=bn;if(f!==null)switch(f.tag){case 3:d&&(d=t_(e,s,o),d!==null&&(Ba(n,0).serverProps=d));break;case 27:case 5:o=f.memoizedProps,d&&(d=t_(e,s,o),d!==null&&(Ba(n,0).serverProps=d))}e[on]=n,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||$A(e.nodeValue,s)),e||Fa(n)}else d=s.ancestorInfo.current,d!=null&&$u(o,d.tag,s.ancestorInfo.implicitRootScope),e=Od(e).createTextNode(o),e[on]=n,n.stateNode=e}return pe(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=wl(n),o!==null&&o.dehydrated!==null){if(e===null){if(!d)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");d[on]=n,pe(n),(n.mode&tn)!==ue&&o!==null&&(d=n.child,d!==null&&(n.treeBaseDuration-=d.treeBaseDuration))}else IS(),Cl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4,pe(n),(n.mode&tn)!==ue&&o!==null&&(d=n.child,d!==null&&(n.treeBaseDuration-=d.treeBaseDuration));d=!1}else d=LS(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(cs(n),n):(cs(n),null)}return cs(n),(n.flags&128)!==0?(n.lanes=s,(n.mode&tn)!==ue&&ed(n),n):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=n.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==d&&(o.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),Td(n,n.updateQueue),pe(n),(n.mode&tn)!==ue&&s&&(e=n.child,e!==null&&(n.treeBaseDuration-=e.treeBaseDuration)),null);case 4:return Gt(n),e===null&&eg(n.stateNode.containerInfo),pe(n),null;case 10:return os(n.type,n),pe(n),null;case 19:if(K(Be,n),d=n.memoizedState,d===null)return pe(n),null;if(o=(n.flags&128)!==0,f=d.rendering,f===null)if(o)zl(d,!1);else{if(Se!==ws||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Sd(e),f!==null){for(n.flags|=128,zl(d,!1),e=f.updateQueue,n.updateQueue=e,Td(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)MS(s,e),s=s.sibling;return lt(Be,Be.current&wo|Ac,n),n.child}e=e.sibling}d.tail!==null&&Fi()>ph&&(n.flags|=128,o=!0,zl(d,!1),n.lanes=4194304)}else{if(!o)if(e=Sd(f),e!==null){if(n.flags|=128,o=!0,e=e.updateQueue,n.updateQueue=e,Td(n,e),zl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!f.alternate&&!Yt)return pe(n),null}else 2*Fi()-d.renderingStartTime>ph&&s!==536870912&&(n.flags|=128,o=!0,zl(d,!1),n.lanes=4194304);d.isBackwards?(f.sibling=n.child,n.child=f):(e=d.last,e!==null?e.sibling=f:n.child=f,d.last=f)}return d.tail!==null?(e=d.tail,d.rendering=e,d.tail=e.sibling,d.renderingStartTime=Fi(),e.sibling=null,s=Be.current,s=o?s&wo|Ac:s&wo,lt(Be,s,n),e):(pe(n),null);case 22:case 23:return cs(n),Qp(n),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(s&536870912)!==0&&(n.flags&128)===0&&(pe(n),n.subtreeFlags&6&&(n.flags|=8192)):pe(n),s=n.updateQueue,s!==null&&Td(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048),e!==null&&K(er,n),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),os(ze,n),pe(n),null;case 25:return null;case 30:return null}throw Error("Unknown unit of work tag ("+n.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Hk(e,n){switch(Hp(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,(n.mode&tn)!==ue&&ed(n),n):null;case 3:return os(ze,n),Gt(n),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return dt(n),null;case 13:if(cs(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");Cl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,(n.mode&tn)!==ue&&ed(n),n):null;case 19:return K(Be,n),null;case 4:return Gt(n),null;case 10:return os(n.type,n),null;case 22:case 23:return cs(n),Qp(n),e!==null&&K(er,n),e=n.flags,e&65536?(n.flags=e&-65537|128,(n.mode&tn)!==ue&&ed(n),n):null;case 24:return os(ze,n),null;case 25:return null;default:return null}}function jE(e,n){switch(Hp(n),n.tag){case 3:os(ze,n),Gt(n);break;case 26:case 27:case 5:dt(n);break;case 4:Gt(n);break;case 13:cs(n);break;case 19:K(Be,n);break;case 10:os(n.type,n);break;case 22:case 23:cs(n),Qp(n),e!==null&&K(er,n);break;case 24:os(ze,n)}}function Ii(e){return(e.mode&tn)!==ue}function $E(e,n){Ii(e)?(Li(),Hl(n,e),Ni()):Hl(n,e)}function Um(e,n,s){Ii(e)?(Li(),Gr(s,e,n),Ni()):Gr(s,e,n)}function Hl(e,n){try{var s=n.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var d=o.next;s=d;do{if((s.tag&e)===e&&((e&He)!==li?rt!==null&&typeof rt.markComponentPassiveEffectMountStarted=="function"&&rt.markComponentPassiveEffectMountStarted(n):(e&en)!==li&&rt!==null&&typeof rt.markComponentLayoutEffectMountStarted=="function"&&rt.markComponentLayoutEffectMountStarted(n),o=void 0,(e&vn)!==li&&(Lo=!0),o=pt(n,sI,s),(e&vn)!==li&&(Lo=!1),(e&He)!==li?rt!==null&&typeof rt.markComponentPassiveEffectMountStopped=="function"&&rt.markComponentPassiveEffectMountStopped():(e&en)!==li&&rt!==null&&typeof rt.markComponentLayoutEffectMountStopped=="function"&&rt.markComponentLayoutEffectMountStopped(),o!==void 0&&typeof o!="function")){var f=void 0;f=(s.tag&en)!==0?"useLayoutEffect":(s.tag&vn)!==0?"useInsertionEffect":"useEffect";var v=void 0;v=o===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof o.then=="function"?`
169
+
170
+ It looks like you wrote `+f+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
171
+
172
+ `+f+`(() => {
173
+ async function fetchData() {
174
+ // You can await here
175
+ const response = await MyAPI.getData(someId);
176
+ // ...
177
+ }
178
+ fetchData();
179
+ }, [someId]); // Or [] if effect doesn't need props or state
180
+
181
+ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+o,pt(n,function(E,w){console.error("%s must not return anything besides a function, which is used for clean-up.%s",E,w)},f,v)}s=s.next}while(s!==d)}}catch(E){ie(n,n.return,E)}}function Gr(e,n,s){try{var o=n.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var f=d.next;o=f;do{if((o.tag&e)===e){var v=o.inst,E=v.destroy;E!==void 0&&(v.destroy=void 0,(e&He)!==li?rt!==null&&typeof rt.markComponentPassiveEffectUnmountStarted=="function"&&rt.markComponentPassiveEffectUnmountStarted(n):(e&en)!==li&&rt!==null&&typeof rt.markComponentLayoutEffectUnmountStarted=="function"&&rt.markComponentLayoutEffectUnmountStarted(n),(e&vn)!==li&&(Lo=!0),d=n,pt(d,aI,d,s,E),(e&vn)!==li&&(Lo=!1),(e&He)!==li?rt!==null&&typeof rt.markComponentPassiveEffectUnmountStopped=="function"&&rt.markComponentPassiveEffectUnmountStopped():(e&en)!==li&&rt!==null&&typeof rt.markComponentLayoutEffectUnmountStopped=="function"&&rt.markComponentLayoutEffectUnmountStopped())}o=o.next}while(o!==f)}}catch(w){ie(n,n.return,w)}}function GE(e,n){Ii(e)?(Li(),Hl(n,e),Ni()):Hl(n,e)}function zm(e,n,s){Ii(e)?(Li(),Gr(s,e,n),Ni()):Gr(s,e,n)}function VE(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;e.type.defaultProps||"ref"in e.memoizedProps||xo||(s.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(e)||"instance"),s.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(e)||"instance"));try{pt(e,qS,n,s)}catch(o){ie(e,e.return,o)}}}function Bk(e,n,s){return e.getSnapshotBeforeUpdate(n,s)}function Fk(e,n){var s=n.memoizedProps,o=n.memoizedState;n=e.stateNode,e.type.defaultProps||"ref"in e.memoizedProps||xo||(n.props!==e.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(e)||"instance"),n.state!==e.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(e)||"instance"));try{var d=Ya(e.type,s,e.elementType===e.type),f=pt(e,Bk,n,d,o);s=mw,f!==void 0||s.has(e.type)||(s.add(e.type),pt(e,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",X(e))})),n.__reactInternalSnapshotBeforeUpdate=f}catch(v){ie(e,e.return,v)}}function qE(e,n,s){s.props=Ya(e.type,e.memoizedProps),s.state=e.memoizedState,Ii(e)?(Li(),pt(e,jT,e,n,s),Ni()):pt(e,jT,e,n,s)}function jk(e){var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}if(typeof n=="function")if(Ii(e))try{Li(),e.refCleanup=n(s)}finally{Ni()}else e.refCleanup=n(s);else typeof n=="string"?console.error("String refs are no longer supported."):n.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",X(e)),n.current=s}}function Bl(e,n){try{pt(e,jk,e)}catch(s){ie(e,n,s)}}function Pi(e,n){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{if(Ii(e))try{Li(),pt(e,o)}finally{Ni(e)}else pt(e,o)}catch(d){ie(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{if(Ii(e))try{Li(),pt(e,s,null)}finally{Ni(e)}else pt(e,s,null)}catch(d){ie(e,n,d)}else s.current=null}function YE(e,n,s,o){var d=e.memoizedProps,f=d.id,v=d.onCommit;d=d.onRender,n=n===null?"mount":"update",nh&&(n="nested-update"),typeof d=="function"&&d(f,n,e.actualDuration,e.treeBaseDuration,e.actualStartTime,s),typeof v=="function"&&v(e.memoizedProps.id,n,o,s)}function $k(e,n,s,o){var d=e.memoizedProps;e=d.id,d=d.onPostCommit,n=n===null?"mount":"update",nh&&(n="nested-update"),typeof d=="function"&&d(e,n,o,s)}function XE(e){var n=e.type,s=e.memoizedProps,o=e.stateNode;try{pt(e,dN,o,n,s,e)}catch(d){ie(e,e.return,d)}}function Hm(e,n,s){try{pt(e,hN,e.stateNode,e.type,s,n,e)}catch(o){ie(e,e.return,o)}}function WE(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ks(e.type)||e.tag===4}function Bm(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||WE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ks(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fm(e,n,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Md));else if(o!==4&&(o===27&&Ks(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(Fm(e,n,s),e=e.sibling;e!==null;)Fm(e,n,s),e=e.sibling}function wd(e,n,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(o!==4&&(o===27&&Ks(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(wd(e,n,s),e=e.sibling;e!==null;)wd(e,n,s),e=e.sibling}function Gk(e){for(var n,s=e.return;s!==null;){if(WE(s)){n=s;break}s=s.return}if(n==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(n.tag){case 27:n=n.stateNode,s=Bm(e),wd(e,s,n);break;case 5:s=n.stateNode,n.flags&32&&(KA(s),n.flags&=-33),n=Bm(e),wd(e,n,s);break;case 3:case 4:n=n.stateNode.containerInfo,s=Bm(e),Fm(e,s,n);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function QE(e){var n=e.stateNode,s=e.memoizedProps;try{pt(e,wN,e.type,s,n,e)}catch(o){ie(e,e.return,o)}}function Vk(e,n){if(e=e.containerInfo,Py=Mh,e=wS(e),Mp(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else t:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var d=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break t}var v=0,E=-1,w=-1,x=0,H=0,V=e,z=null;e:for(;;){for(var q;V!==s||d!==0&&V.nodeType!==3||(E=v+d),V!==f||o!==0&&V.nodeType!==3||(w=v+o),V.nodeType===3&&(v+=V.nodeValue.length),(q=V.firstChild)!==null;)z=V,V=q;for(;;){if(V===e)break e;if(z===s&&++x===d&&(E=v),z===f&&++H===o&&(w=v),(q=V.nextSibling)!==null)break;V=z,z=V.parentNode}V=q}s=E===-1||w===-1?null:{start:E,end:w}}else s=null}s=s||{start:0,end:0}}else s=null;for(Uy={focusedElem:e,selectionRange:s},Mh=!1,Ge=n;Ge!==null;)if(n=Ge,e=n.child,(n.subtreeFlags&1024)!==0&&e!==null)e.return=n,Ge=e;else for(;Ge!==null;){switch(e=n=Ge,s=e.alternate,d=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:(d&1024)!==0&&s!==null&&Fk(e,s);break;case 3:if((d&1024)!==0){if(e=e.stateNode.containerInfo,s=e.nodeType,s===9)cg(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cg(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((d&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(e=n.sibling,e!==null){e.return=n.return,Ge=e;break}Ge=n.return}}function KE(e,n,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:fs(e,s),o&4&&$E(s,en|ci);break;case 1:if(fs(e,s),o&4)if(e=s.stateNode,n===null)s.type.defaultProps||"ref"in s.memoizedProps||xo||(e.props!==s.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(s)||"instance"),e.state!==s.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(s)||"instance")),Ii(s)?(Li(),pt(s,uy,s,e),Ni()):pt(s,uy,s,e);else{var d=Ya(s.type,n.memoizedProps);n=n.memoizedState,s.type.defaultProps||"ref"in s.memoizedProps||xo||(e.props!==s.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",X(s)||"instance"),e.state!==s.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",X(s)||"instance")),Ii(s)?(Li(),pt(s,HT,s,e,d,n,e.__reactInternalSnapshotBeforeUpdate),Ni()):pt(s,HT,s,e,d,n,e.__reactInternalSnapshotBeforeUpdate)}o&64&&VE(s),o&512&&Bl(s,s.return);break;case 3:if(n=ls(),fs(e,s),o&64&&(o=s.updateQueue,o!==null)){if(d=null,s.child!==null)switch(s.child.tag){case 27:case 5:d=s.child.stateNode;break;case 1:d=s.child.stateNode}try{pt(s,qS,o,d)}catch(v){ie(s,s.return,v)}}e.effectDuration+=td(n);break;case 27:n===null&&o&4&&QE(s);case 26:case 5:fs(e,s),n===null&&o&4&&XE(s),o&512&&Bl(s,s.return);break;case 12:if(o&4){o=ls(),fs(e,s),e=s.stateNode,e.effectDuration+=Ml(o);try{pt(s,YE,s,n,eh,e.effectDuration)}catch(v){ie(s,s.return,v)}}else fs(e,s);break;case 13:fs(e,s),o&4&&tA(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=tN.bind(null,s),AN(e,s))));break;case 22:if(o=s.memoizedState!==null||Ts,!o){n=n!==null&&n.memoizedState!==null||xe,d=Ts;var f=xe;Ts=o,(xe=n)&&!f?ps(e,s,(s.subtreeFlags&8772)!==0):fs(e,s),Ts=d,xe=f}break;case 30:break;default:fs(e,s)}}function ZE(e){var n=e.alternate;n!==null&&(e.alternate=null,ZE(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Fs(n)),e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hs(e,n,s){for(s=s.child;s!==null;)JE(e,n,s),s=s.sibling}function JE(e,n,s){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(no,s)}catch(f){ji||(ji=!0,console.error("React instrumentation encountered an error: %s",f))}switch(s.tag){case 26:xe||Pi(s,n),hs(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xe||Pi(s,n);var o=Pe,d=kn;Ks(s.type)&&(Pe=s.stateNode,kn=!1),hs(e,n,s),pt(s,Yl,s.stateNode),Pe=o,kn=d;break;case 5:xe||Pi(s,n);case 6:if(o=Pe,d=kn,Pe=null,hs(e,n,s),Pe=o,kn=d,Pe!==null)if(kn)try{pt(s,mN,Pe,s.stateNode)}catch(f){ie(s,n,f)}else try{pt(s,pN,Pe,s.stateNode)}catch(f){ie(s,n,f)}break;case 18:Pe!==null&&(kn?(e=Pe,ZA(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Kl(e)):ZA(Pe,s.stateNode));break;case 4:o=Pe,d=kn,Pe=s.stateNode.containerInfo,kn=!0,hs(e,n,s),Pe=o,kn=d;break;case 0:case 11:case 14:case 15:xe||Gr(vn,s,n),xe||Um(s,n,en),hs(e,n,s);break;case 1:xe||(Pi(s,n),o=s.stateNode,typeof o.componentWillUnmount=="function"&&qE(s,n,o)),hs(e,n,s);break;case 21:hs(e,n,s);break;case 22:xe=(o=xe)||s.memoizedState!==null,hs(e,n,s),xe=o;break;default:hs(e,n,s)}}function tA(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{pt(n,TN,e)}catch(s){ie(n,n.return,s)}}function qk(e){switch(e.tag){case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new gw),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new gw),n;default:throw Error("Unexpected Suspense handler tag ("+e.tag+"). This is a bug in React.")}}function jm(e,n){var s=qk(e);n.forEach(function(o){var d=eN.bind(null,e,o);if(!s.has(o)){if(s.add(o),Ei)if(Ro!==null&&Do!==null)Gl(Do,Ro);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");o.then(d,d)}})}function Bn(e,n){var s=n.deletions;if(s!==null)for(var o=0;o<s.length;o++){var d=e,f=n,v=s[o],E=f;t:for(;E!==null;){switch(E.tag){case 27:if(Ks(E.type)){Pe=E.stateNode,kn=!1;break t}break;case 5:Pe=E.stateNode,kn=!1;break t;case 3:case 4:Pe=E.stateNode.containerInfo,kn=!0;break t}E=E.return}if(Pe===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");JE(d,f,v),Pe=null,kn=!1,d=v,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(n.subtreeFlags&13878)for(n=n.child;n!==null;)eA(n,e),n=n.sibling}function eA(e,n){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Bn(n,e),Fn(e),o&4&&(Gr(vn|ci,e,e.return),Hl(vn|ci,e),Um(e,e.return,en|ci));break;case 1:Bn(n,e),Fn(e),o&512&&(xe||s===null||Pi(s,s.return)),o&64&&Ts&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var d=wi;if(Bn(n,e),Fn(e),o&512&&(xe||s===null||Pi(s,s.return)),o&4)if(n=s!==null?s.memoizedState:null,o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){t:{o=e.type,s=e.memoizedProps,n=d.ownerDocument||d;e:switch(o){case"title":d=n.getElementsByTagName("title")[0],(!d||d[tc]||d[on]||d.namespaceURI===so||d.hasAttribute("itemprop"))&&(d=n.createElement(o),n.head.insertBefore(d,n.querySelector("head > title"))),Ze(d,o,s),d[on]=e,P(d),o=d;break t;case"link":var f=l_("link","href",n).get(o+(s.href||""));if(f){for(var v=0;v<f.length;v++)if(d=f[v],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){f.splice(v,1);break e}}d=n.createElement(o),Ze(d,o,s),n.head.appendChild(d);break;case"meta":if(f=l_("meta","content",n).get(o+(s.content||""))){for(v=0;v<f.length;v++)if(d=f[v],st(s.content,"content"),d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){f.splice(v,1);break e}}d=n.createElement(o),Ze(d,o,s),n.head.appendChild(d);break;default:throw Error('getNodesForType encountered a type it did not expect: "'+o+'". This is a bug in React.')}d[on]=e,P(d),o=d}e.stateNode=o}else c_(d,e.type,e.stateNode);else e.stateNode=o_(d,o,e.memoizedProps);else n!==o?(n===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):n.count--,o===null?c_(d,e.type,e.stateNode):o_(d,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Hm(e,e.memoizedProps,s.memoizedProps);break;case 27:Bn(n,e),Fn(e),o&512&&(xe||s===null||Pi(s,s.return)),s!==null&&o&4&&Hm(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Bn(n,e),Fn(e),o&512&&(xe||s===null||Pi(s,s.return)),e.flags&32){n=e.stateNode;try{pt(e,KA,n)}catch(H){ie(e,e.return,H)}}o&4&&e.stateNode!=null&&(n=e.memoizedProps,Hm(e,n,s!==null?s.memoizedProps:n)),o&1024&&(yy=!0,e.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(Bn(n,e),Fn(e),o&4){if(e.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");o=e.memoizedProps,s=s!==null?s.memoizedProps:o,n=e.stateNode;try{pt(e,fN,n,s,o)}catch(H){ie(e,e.return,H)}}break;case 3:if(d=ls(),xh=null,f=wi,wi=kd(n.containerInfo),Bn(n,e),wi=f,Fn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{pt(e,_N,n.containerInfo)}catch(H){ie(e,e.return,H)}yy&&(yy=!1,nA(e)),n.effectDuration+=td(d);break;case 4:o=wi,wi=kd(e.stateNode.containerInfo),Bn(n,e),Fn(e),wi=o;break;case 12:o=ls(),Bn(n,e),Fn(e),e.stateNode.effectDuration+=Ml(o);break;case 13:Bn(n,e),Fn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_y=Fi()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,jm(e,o)));break;case 22:d=e.memoizedState!==null;var E=s!==null&&s.memoizedState!==null,w=Ts,x=xe;if(Ts=w||d,xe=x||E,Bn(n,e),xe=x,Ts=w,Fn(e),o&8192)t:for(n=e.stateNode,n._visibility=d?n._visibility&~Kd:n._visibility|Kd,d&&(s===null||E||Ts||xe||Xa(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){E=s=n;try{f=E.stateNode,d?pt(E,gN,f):pt(E,bN,E.stateNode,E.memoizedProps)}catch(H){ie(E,E.return,H)}}}else if(n.tag===6){if(s===null){E=n;try{v=E.stateNode,d?pt(E,yN,v):pt(E,vN,v,E.memoizedProps)}catch(H){ie(E,E.return,H)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,jm(e,s))));break;case 19:Bn(n,e),Fn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,jm(e,o)));break;case 30:break;case 21:break;default:Bn(n,e),Fn(e)}}function Fn(e){var n=e.flags;if(n&2){try{pt(e,Gk,e)}catch(s){ie(e,e.return,s)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function nA(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;nA(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function fs(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)KE(e,n.alternate,n),n=n.sibling}function iA(e){switch(e.tag){case 0:case 11:case 14:case 15:Um(e,e.return,en),Xa(e);break;case 1:Pi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&qE(e,e.return,n),Xa(e);break;case 27:pt(e,Yl,e.stateNode);case 26:case 5:Pi(e,e.return),Xa(e);break;case 22:e.memoizedState===null&&Xa(e);break;case 30:Xa(e);break;default:Xa(e)}}function Xa(e){for(e=e.child;e!==null;)iA(e),e=e.sibling}function sA(e,n,s,o){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ps(e,s,o),$E(s,en);break;case 1:if(ps(e,s,o),n=s.stateNode,typeof n.componentDidMount=="function"&&pt(s,uy,s,n),n=s.updateQueue,n!==null){e=s.stateNode;try{pt(s,Mk,n,e)}catch(f){ie(s,s.return,f)}}o&&d&64&&VE(s),Bl(s,s.return);break;case 27:QE(s);case 26:case 5:ps(e,s,o),o&&n===null&&d&4&&XE(s),Bl(s,s.return);break;case 12:if(o&&d&4){d=ls(),ps(e,s,o),o=s.stateNode,o.effectDuration+=Ml(d);try{pt(s,YE,s,n,eh,o.effectDuration)}catch(f){ie(s,s.return,f)}}else ps(e,s,o);break;case 13:ps(e,s,o),o&&d&4&&tA(e,s);break;case 22:s.memoizedState===null&&ps(e,s,o),Bl(s,s.return);break;case 30:break;default:ps(e,s,o)}}function ps(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;)sA(e,n.alternate,n,s),n=n.sibling}function $m(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&$a(e),s!=null&&Dl(s))}function Gm(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&($a(n),e!=null&&Dl(e))}function Ui(e,n,s,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)aA(e,n,s,o),n=n.sibling}function aA(e,n,s,o){var d=n.flags;switch(n.tag){case 0:case 11:case 15:Ui(e,n,s,o),d&2048&&GE(n,He|ci);break;case 1:Ui(e,n,s,o);break;case 3:var f=ls();Ui(e,n,s,o),d&2048&&(s=null,n.alternate!==null&&(s=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==s&&($a(n),s!=null&&Dl(s))),e.passiveEffectDuration+=td(f);break;case 12:if(d&2048){d=ls(),Ui(e,n,s,o),e=n.stateNode,e.passiveEffectDuration+=Ml(d);try{pt(n,$k,n,n.alternate,eh,e.passiveEffectDuration)}catch(E){ie(n,n.return,E)}}else Ui(e,n,s,o);break;case 13:Ui(e,n,s,o);break;case 23:break;case 22:f=n.stateNode;var v=n.alternate;n.memoizedState!==null?f._visibility&bs?Ui(e,n,s,o):Fl(e,n):f._visibility&bs?Ui(e,n,s,o):(f._visibility|=bs,Vr(e,n,s,o,(n.subtreeFlags&10256)!==0)),d&2048&&$m(v,n);break;case 24:Ui(e,n,s,o),d&2048&&Gm(n.alternate,n);break;default:Ui(e,n,s,o)}}function Vr(e,n,s,o,d){for(d=d&&(n.subtreeFlags&10256)!==0,n=n.child;n!==null;)rA(e,n,s,o,d),n=n.sibling}function rA(e,n,s,o,d){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Vr(e,n,s,o,d),GE(n,He);break;case 23:break;case 22:var v=n.stateNode;n.memoizedState!==null?v._visibility&bs?Vr(e,n,s,o,d):Fl(e,n):(v._visibility|=bs,Vr(e,n,s,o,d)),d&&f&2048&&$m(n.alternate,n);break;case 24:Vr(e,n,s,o,d),d&&f&2048&&Gm(n.alternate,n);break;default:Vr(e,n,s,o,d)}}function Fl(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,o=n,d=o.flags;switch(o.tag){case 22:Fl(s,o),d&2048&&$m(o.alternate,o);break;case 24:Fl(s,o),d&2048&&Gm(o.alternate,o);break;default:Fl(s,o)}n=n.sibling}}function qr(e){if(e.subtreeFlags&_c)for(e=e.child;e!==null;)oA(e),e=e.sibling}function oA(e){switch(e.tag){case 26:qr(e),e.flags&_c&&e.memoizedState!==null&&DN(wi,e.memoizedState,e.memoizedProps);break;case 5:qr(e);break;case 3:case 4:var n=wi;wi=kd(e.stateNode.containerInfo),qr(e),wi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=_c,_c=16777216,qr(e),_c=n):qr(e));break;default:qr(e)}}function lA(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function jl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];Ge=o,dA(o,e)}lA(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cA(e),e=e.sibling}function cA(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zm(e,e.return,He|ci);break;case 3:var n=ls();jl(e),e.stateNode.passiveEffectDuration+=td(n);break;case 12:n=ls(),jl(e),e.stateNode.passiveEffectDuration+=Ml(n);break;case 22:n=e.stateNode,e.memoizedState!==null&&n._visibility&bs&&(e.return===null||e.return.tag!==13)?(n._visibility&=~bs,Cd(e)):jl(e);break;default:jl(e)}}function Cd(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];Ge=o,dA(o,e)}lA(e)}for(e=e.child;e!==null;)uA(e),e=e.sibling}function uA(e){switch(e.tag){case 0:case 11:case 15:zm(e,e.return,He),Cd(e);break;case 22:var n=e.stateNode;n._visibility&bs&&(n._visibility&=~bs,Cd(e));break;default:Cd(e)}}function dA(e,n){for(;Ge!==null;){var s=Ge,o=s;switch(o.tag){case 0:case 11:case 15:zm(o,n,He);break;case 23:case 22:o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(o=o.memoizedState.cachePool.pool,o!=null&&$a(o));break;case 24:Dl(o.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Ge=o;else t:for(s=e;Ge!==null;){o=Ge;var d=o.sibling,f=o.return;if(ZE(o),o===s){Ge=null;break t}if(d!==null){d.return=f,Ge=d;break t}Ge=f}}}function Yk(){oI.forEach(function(e){return e()})}function hA(){var e=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return e||G.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),e}function jn(e){if((Jt&Sn)!==Vn&&Bt!==0)return Bt&-Bt;var n=G.T;return n!==null?(n._updatedFibers||(n._updatedFibers=new Set),n._updatedFibers.add(e),e=tr,e!==0?e:Jm()):yl()}function fA(){Yn===0&&(Yn=(Bt&536870912)===0||Yt?Pt():536870912);var e=di.current;return e!==null&&(e.flags|=32),Yn}function Ce(e,n,s){if(Lo&&console.error("useInsertionEffect must not schedule updates."),Ry&&(mh=!0),(e===oe&&(te===ar||te===rr)||e.cancelPendingCommit!==null)&&(Xr(e,0),Ws(e,Bt,Yn,!1)),Bs(e,s),(Jt&Sn)!==0&&e===oe){if(Gi)switch(n.tag){case 0:case 11:case 15:e=Ut&&X(Ut)||"Unknown",Cw.has(e)||(Cw.add(e),n=X(n)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",n,e,e));break;case 1:ww||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),ww=!0)}}else Ei&&ml(e,n,s),iN(n),e===oe&&((Jt&Sn)===Vn&&(ua|=s),Se===sr&&Ws(e,Bt,Yn,!1)),zi(e)}function pA(e,n,s){if((Jt&(Sn|Ci))!==Vn)throw Error("Should not already be working.");var o=!s&&(n&124)===0&&(n&e.expiredLanes)===0||Hs(e,n),d=o?Wk(e,n):Ym(e,n,!0),f=o;do{if(d===ws){ko&&!o&&Ws(e,n,0,!1);break}else{if(s=e.current.alternate,f&&!Xk(s)){d=Ym(e,n,!1),f=!1;continue}if(d===Mo){if(f=n,e.errorRecoveryDisabledLanes&f)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;t:{d=e;var E=v;v=Dc;var w=d.current.memoizedState.isDehydrated;if(w&&(Xr(d,E).flags|=256),E=Ym(d,E,!1),E!==Mo){if(Ey&&!w){d.errorRecoveryDisabledLanes|=f,ua|=f,d=sr;break t}d=En,En=v,d!==null&&(En===null?En=d:En.push.apply(En,d))}d=E}if(f=!1,d!==Mo)continue}}if(d===wc){Xr(e,0),Ws(e,n,0,!0);break}t:{switch(o=e,d){case ws:case wc:throw Error("Root did not complete. This is a bug in React.");case sr:if((n&4194048)!==n)break;case hh:Ws(o,n,Yn,!la);break t;case Mo:En=null;break;case by:case yw:break;default:throw Error("Unknown root exit status.")}if(G.actQueue!==null)Xm(o,s,n,En,Mc,fh,Yn,ua,or);else{if((n&62914560)===n&&(f=_y+vw-Fi(),10<f)){if(Ws(o,n,Yn,!la),ss(o,0,!0)!==0)break t;o.timeoutHandle=Lw(mA.bind(null,o,s,En,Mc,fh,n,Yn,ua,or,la,d,dI,ET,0),f);break t}mA(o,s,En,Mc,fh,n,Yn,ua,or,la,d,cI,ET,0)}}}break}while(!0);zi(e)}function mA(e,n,s,o,d,f,v,E,w,x,H,V,z,q){if(e.timeoutHandle=hr,V=n.subtreeFlags,(V&8192||(V&16785408)===16785408)&&(Pc={stylesheets:null,count:0,unsuspend:RN},oA(n),V=MN(),V!==null)){e.cancelPendingCommit=V(Xm.bind(null,e,n,f,s,o,d,v,E,w,H,uI,z,q)),Ws(e,f,v,!x);return}Xm(e,n,f,s,o,d,v,E,w)}function Xk(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var d=s[o],f=d.getSnapshot;d=d.value;try{if(!yn(f(),d))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ws(e,n,s,o){n&=~Ay,n&=~ua,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var d=n;0<d;){var f=31-mn(d),v=1<<f;o[f]=-1,d&=~v}s!==0&&fl(e,s,n)}function Yr(){return(Jt&(Sn|Ci))===Vn?(Vl(0),!1):!0}function Vm(){if(Ut!==null){if(te===Nn)var e=Ut.return;else e=Ut,Ku(),nm(e),_o=null,Ec=0,e=Ut;for(;e!==null;)jE(e.alternate,e),e=e.return;Ut=null}}function Xr(e,n){var s=e.timeoutHandle;s!==hr&&(e.timeoutHandle=hr,TI(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Vm(),oe=e,Ut=s=rs(e.current,null),Bt=n,te=Nn,qn=null,la=!1,ko=Hs(e,n),Ey=!1,Se=ws,or=Yn=Ay=ua=ca=0,En=Dc=null,fh=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var d=31-mn(o),f=1<<d;n|=e[d],o&=~f}return Wi=n,Yu(),n=vT(),1e3<n-bT&&(G.recentlyCreatedOwnerStacks=0,bT=n),_i.discardPendingWarnings(),s}function gA(e,n){At=null,G.H=uh,G.getCurrentStack=null,Gi=!1,Gn=null,n===yc||n===ah?(n=$S(),te=xc):n===TT?(n=$S(),te=bw):te=n===lw?Sy:n!==null&&typeof n=="object"&&typeof n.then=="function"?Oo:Cc,qn=n;var s=Ut;if(s===null)Se=wc,Ed(e,Hn(n,e.current));else switch(s.mode&tn&&Vp(s),We(),te){case Cc:rt!==null&&typeof rt.markComponentErrored=="function"&&rt.markComponentErrored(s,n,Bt);break;case ar:case rr:case xc:case Oo:case Rc:rt!==null&&typeof rt.markComponentSuspended=="function"&&rt.markComponentSuspended(s,n,Bt)}}function yA(){var e=G.H;return G.H=uh,e===null?uh:e}function bA(){var e=G.A;return G.A=rI,e}function qm(){Se=sr,la||(Bt&4194048)!==Bt&&di.current!==null||(ko=!0),(ca&134217727)===0&&(ua&134217727)===0||oe===null||Ws(oe,Bt,Yn,!1)}function Ym(e,n,s){var o=Jt;Jt|=Sn;var d=yA(),f=bA();if(oe!==e||Bt!==n){if(Ei){var v=e.memoizedUpdaters;0<v.size&&(Gl(e,Bt),v.clear()),gl(e,n)}Mc=null,Xr(e,n)}wn(n),n=!1,v=Se;t:do try{if(te!==Nn&&Ut!==null){var E=Ut,w=qn;switch(te){case Sy:Vm(),v=hh;break t;case xc:case ar:case rr:case Oo:di.current===null&&(n=!0);var x=te;if(te=Nn,qn=null,Wr(e,E,w,x),s&&ko){v=ws;break t}break;default:x=te,te=Nn,qn=null,Wr(e,E,w,x)}}vA(),v=Se;break}catch(H){gA(e,H)}while(!0);return n&&e.shellSuspendCounter++,Ku(),Jt=o,G.H=d,G.A=f,gi(),Ut===null&&(oe=null,Bt=0,Yu()),v}function vA(){for(;Ut!==null;)SA(Ut)}function Wk(e,n){var s=Jt;Jt|=Sn;var o=yA(),d=bA();if(oe!==e||Bt!==n){if(Ei){var f=e.memoizedUpdaters;0<f.size&&(Gl(e,Bt),f.clear()),gl(e,n)}Mc=null,ph=Fi()+Sw,Xr(e,n)}else ko=Hs(e,n);wn(n);t:do try{if(te!==Nn&&Ut!==null)e:switch(n=Ut,f=qn,te){case Cc:te=Nn,qn=null,Wr(e,n,f,Cc);break;case ar:case rr:if(FS(f)){te=Nn,qn=null,EA(n);break}n=function(){te!==ar&&te!==rr||oe!==e||(te=Rc),zi(e)},f.then(n,n);break t;case xc:te=Rc;break t;case bw:te=vy;break t;case Rc:FS(f)?(te=Nn,qn=null,EA(n)):(te=Nn,qn=null,Wr(e,n,f,Rc));break;case vy:var v=null;switch(Ut.tag){case 26:v=Ut.memoizedState;case 5:case 27:var E=Ut;if(!v||u_(v)){te=Nn,qn=null;var w=E.sibling;if(w!==null)Ut=w;else{var x=E.return;x!==null?(Ut=x,xd(x)):Ut=null}break e}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}te=Nn,qn=null,Wr(e,n,f,vy);break;case Oo:te=Nn,qn=null,Wr(e,n,f,Oo);break;case Sy:Vm(),Se=hh;break t;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}G.actQueue!==null?vA():Qk();break}catch(H){gA(e,H)}while(!0);return Ku(),G.H=o,G.A=d,Jt=s,Ut!==null?(rt!==null&&typeof rt.markRenderYielded=="function"&&rt.markRenderYielded(),ws):(gi(),oe=null,Bt=0,Yu(),Se)}function Qk(){for(;Ut!==null&&!qN();)SA(Ut)}function SA(e){var n=e.alternate;(e.mode&tn)!==ue?(Gp(e),n=pt(e,Pm,n,e,Wi),Vp(e)):n=pt(e,Pm,n,e,Wi),e.memoizedProps=e.pendingProps,n===null?xd(e):Ut=n}function EA(e){var n=pt(e,Kk,e);e.memoizedProps=e.pendingProps,n===null?xd(e):Ut=n}function Kk(e){var n=e.alternate,s=(e.mode&tn)!==ue;switch(s&&Gp(e),e.tag){case 15:case 0:n=LE(n,e,e.pendingProps,e.type,void 0,Bt);break;case 11:n=LE(n,e,e.pendingProps,e.type.render,e.ref,Bt);break;case 5:nm(e);default:jE(n,e),e=Ut=MS(e,Wi),n=Pm(n,e,Wi)}return s&&Vp(e),n}function Wr(e,n,s,o){Ku(),nm(n),_o=null,Ec=0;var d=n.return;try{if(Pk(e,d,n,s,Bt)){Se=wc,Ed(e,Hn(s,e.current)),Ut=null;return}}catch(f){if(d!==null)throw Ut=d,f;Se=wc,Ed(e,Hn(s,e.current)),Ut=null;return}n.flags&32768?(Yt||o===Cc?e=!0:ko||(Bt&536870912)!==0?e=!1:(la=e=!0,(o===ar||o===rr||o===xc||o===Oo)&&(o=di.current,o!==null&&o.tag===13&&(o.flags|=16384))),AA(n,e)):xd(n)}function xd(e){var n=e;do{if((n.flags&32768)!==0){AA(n,la);return}var s=n.alternate;if(e=n.return,Gp(n),s=pt(n,zk,s,n,Wi),(n.mode&tn)!==ue&&US(n),s!==null){Ut=s;return}if(n=n.sibling,n!==null){Ut=n;return}Ut=n=e}while(n!==null);Se===ws&&(Se=yw)}function AA(e,n){do{var s=Hk(e.alternate,e);if(s!==null){s.flags&=32767,Ut=s;return}if((e.mode&tn)!==ue){US(e),s=e.actualDuration;for(var o=e.child;o!==null;)s+=o.actualDuration,o=o.sibling;e.actualDuration=s}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){Ut=e;return}Ut=e=s}while(e!==null);Se=hh,Ut=null}function Xm(e,n,s,o,d,f,v,E,w){e.cancelPendingCommit=null;do $l();while(nn!==lr);if(_i.flushLegacyContextWarning(),_i.flushPendingUnsafeLifecycleWarnings(),(Jt&(Sn|Ci))!==Vn)throw Error("Should not already be working.");if(rt!==null&&typeof rt.markCommitStarted=="function"&&rt.markCommitStarted(s),n===null)Vt();else{if(s===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),n===e.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(f=n.lanes|n.childLanes,f|=Kg,Uu(e,s,f,v,E,w),e===oe&&(Ut=oe=null,Bt=0),No=n,ha=e,fa=s,wy=f,Cy=d,Tw=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,nN(eo,function(){return xA(),null})):(e.callbackNode=null,e.callbackPriority=0),eh=bo(),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=G.T,G.T=null,d=Zt.p,Zt.p=ni,v=Jt,Jt|=Ci;try{Vk(e,n,s)}finally{Jt=v,Zt.p=d,G.T=o}}nn=Ew,_A(),TA(),wA()}}function _A(){if(nn===Ew){nn=lr;var e=ha,n=No,s=fa,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=G.T,G.T=null;var d=Zt.p;Zt.p=ni;var f=Jt;Jt|=Ci;try{Ro=s,Do=e,eA(n,e),Do=Ro=null,s=Uy;var v=wS(e.containerInfo),E=s.focusedElem,w=s.selectionRange;if(v!==E&&E&&E.ownerDocument&&TS(E.ownerDocument.documentElement,E)){if(w!==null&&Mp(E)){var x=w.start,H=w.end;if(H===void 0&&(H=x),"selectionStart"in E)E.selectionStart=x,E.selectionEnd=Math.min(H,E.value.length);else{var V=E.ownerDocument||document,z=V&&V.defaultView||window;if(z.getSelection){var q=z.getSelection(),ct=E.textContent.length,Et=Math.min(w.start,ct),le=w.end===void 0?Et:Math.min(w.end,ct);!q.extend&&Et>le&&(v=le,le=Et,Et=v);var jt=_S(E,Et),D=_S(E,le);if(jt&&D&&(q.rangeCount!==1||q.anchorNode!==jt.node||q.anchorOffset!==jt.offset||q.focusNode!==D.node||q.focusOffset!==D.offset)){var M=V.createRange();M.setStart(jt.node,jt.offset),q.removeAllRanges(),Et>le?(q.addRange(M),q.extend(D.node,D.offset)):(M.setEnd(D.node,D.offset),q.addRange(M))}}}}for(V=[],q=E;q=q.parentNode;)q.nodeType===1&&V.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<V.length;E++){var k=V[E];k.element.scrollLeft=k.left,k.element.scrollTop=k.top}}Mh=!!Py,Uy=Py=null}finally{Jt=f,Zt.p=d,G.T=o}}e.current=n,nn=Aw}}function TA(){if(nn===Aw){nn=lr;var e=ha,n=No,s=fa,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=G.T,G.T=null;var d=Zt.p;Zt.p=ni;var f=Jt;Jt|=Ci;try{rt!==null&&typeof rt.markLayoutEffectsStarted=="function"&&rt.markLayoutEffectsStarted(s),Ro=s,Do=e,KE(e,n.alternate,n),Do=Ro=null,rt!==null&&typeof rt.markLayoutEffectsStopped=="function"&&rt.markLayoutEffectsStopped()}finally{Jt=f,Zt.p=d,G.T=o}}nn=_w}}function wA(){if(nn===hI||nn===_w){nn=lr,YN();var e=ha,n=No,s=fa,o=Tw,d=(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0;d?nn=Ty:(nn=lr,No=ha=null,CA(e,e.pendingLanes),cr=0,kc=null);var f=e.pendingLanes;if(f===0&&(da=null),d||OA(e),d=Ir(s),n=n.stateNode,rn&&typeof rn.onCommitFiberRoot=="function")try{var v=(n.current.flags&128)===128;switch(d){case ni:var E=Dg;break;case $i:E=Mg;break;case ys:E=eo;break;case Gd:E=Og;break;default:E=eo}rn.onCommitFiberRoot(no,n,E,v)}catch(V){ji||(ji=!0,console.error("React instrumentation encountered an error: %s",V))}if(Ei&&e.memoizedUpdaters.clear(),Yk(),o!==null){v=G.T,E=Zt.p,Zt.p=ni,G.T=null;try{var w=e.onRecoverableError;for(n=0;n<o.length;n++){var x=o[n],H=Zk(x.stack);pt(x.source,w,x.value,H)}}finally{G.T=v,Zt.p=E}}(fa&3)!==0&&$l(),zi(e),f=e.pendingLanes,(s&4194090)!==0&&(f&42)!==0?(ih=!0,e===xy?Oc++:(Oc=0,xy=e)):Oc=0,Vl(0),Vt()}}function Zk(e){return e={componentStack:e},Object.defineProperty(e,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),e}function CA(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Dl(n)))}function $l(e){return _A(),TA(),wA(),xA()}function xA(){if(nn!==Ty)return!1;var e=ha,n=wy;wy=0;var s=Ir(fa),o=ys>s?ys:s;s=G.T;var d=Zt.p;try{Zt.p=o,G.T=null,o=Cy,Cy=null;var f=ha,v=fa;if(nn=lr,No=ha=null,fa=0,(Jt&(Sn|Ci))!==Vn)throw Error("Cannot flush passive effects while already rendering.");Ry=!0,mh=!1,rt!==null&&typeof rt.markPassiveEffectsStarted=="function"&&rt.markPassiveEffectsStarted(v);var E=Jt;if(Jt|=Ci,cA(f.current),aA(f,f.current,v,o),rt!==null&&typeof rt.markPassiveEffectsStopped=="function"&&rt.markPassiveEffectsStopped(),OA(f),Jt=E,Vl(0,!1),mh?f===kc?cr++:(cr=0,kc=f):cr=0,mh=Ry=!1,rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(no,f)}catch(x){ji||(ji=!0,console.error("React instrumentation encountered an error: %s",x))}var w=f.current.stateNode;return w.effectDuration=0,w.passiveEffectDuration=0,!0}finally{Zt.p=d,G.T=s,CA(e,n)}}function RA(e,n,s){n=Hn(s,n),n=wm(e.stateNode,n,2),e=Vs(e,n,2),e!==null&&(Bs(e,2),zi(e))}function ie(e,n,s){if(Lo=!1,e.tag===3)RA(e,e,s);else{for(;n!==null;){if(n.tag===3){RA(n,e,s);return}if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(da===null||!da.has(o))){e=Hn(s,e),s=Cm(2),o=Vs(n,s,2),o!==null&&(xm(s,o,n,e),Bs(o,2),zi(o));return}}n=n.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
182
+
183
+ Error message:
184
+
185
+ %s`,s)}}function Wm(e,n,s){var o=e.pingCache;if(o===null){o=e.pingCache=new lI;var d=new Set;o.set(n,d)}else d=o.get(n),d===void 0&&(d=new Set,o.set(n,d));d.has(s)||(Ey=!0,d.add(s),o=Jk.bind(null,e,n,s),Ei&&Gl(e,s),n.then(o,o))}function Jk(e,n,s){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,hA()&&G.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
186
+
187
+ When testing, code that resolves suspended data should be wrapped into act(...):
188
+
189
+ act(() => {
190
+ /* finish loading suspended data */
191
+ });
192
+ /* assert on the output */
193
+
194
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),oe===e&&(Bt&s)===s&&(Se===sr||Se===by&&(Bt&62914560)===Bt&&Fi()-_y<vw?(Jt&Sn)===Vn&&Xr(e,0):Ay|=s,or===Bt&&(or=0)),zi(e)}function DA(e,n){n===0&&(n=ka()),e=xn(e,n),e!==null&&(Bs(e,n),zi(e))}function tN(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),DA(e,s)}function eN(e,n){var s=0;switch(e.tag){case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}o!==null&&o.delete(n),DA(e,s)}function Qm(e,n,s){if((n.subtreeFlags&67117056)!==0)for(n=n.child;n!==null;){var o=e,d=n,f=d.type===Hd;f=s||f,d.tag!==22?d.flags&67108864?f&&pt(d,MA,o,d,(d.mode&mT)===ue):Qm(o,d,f):d.memoizedState===null&&(f&&d.flags&8192?pt(d,MA,o,d):d.subtreeFlags&67108864&&pt(d,Qm,o,d,f)),n=n.sibling}}function MA(e,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;tt(!0);try{iA(n),s&&uA(n),sA(e,n.alternate,n,!1),s&&rA(e,n,0,null,!1,0)}finally{tt(!1)}}function OA(e){var n=!0;e.current.mode&(ln|Ai)||(n=!1),Qm(e,e.current,n)}function kA(e){if((Jt&Sn)===Vn){var n=e.tag;if(n===3||n===1||n===0||n===11||n===14||n===15){if(n=X(e)||"ReactComponent",gh!==null){if(gh.has(n))return;gh.add(n)}else gh=new Set([n]);pt(e,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function Gl(e,n){Ei&&e.memoizedUpdaters.forEach(function(s){ml(e,s,n)})}function nN(e,n){var s=G.actQueue;return s!==null?(s.push(n),mI):Rg(e,n)}function iN(e){hA()&&G.actQueue===null&&pt(e,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
195
+
196
+ When testing, code that causes React state updates should be wrapped into act(...):
197
+
198
+ act(() => {
199
+ /* fire events that update state */
200
+ });
201
+ /* assert on the output */
202
+
203
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,X(e))})}function zi(e){e!==Io&&e.next===null&&(Io===null?yh=Io=e:Io=Io.next=e),bh=!0,G.actQueue!==null?My||(My=!0,PA()):Dy||(Dy=!0,PA())}function Vl(e,n){if(!Oy&&bh){Oy=!0;do for(var s=!1,o=yh;o!==null;){if(e!==0){var d=o.pendingLanes;if(d===0)var f=0;else{var v=o.suspendedLanes,E=o.pingedLanes;f=(1<<31-mn(42|e)+1)-1,f&=d&~(v&~E),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,IA(o,f))}else f=Bt,f=ss(o,o===oe?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==hr),(f&3)===0||Hs(o,f)||(s=!0,IA(o,f));o=o.next}while(s);Oy=!1}}function sN(){Km()}function Km(){bh=My=Dy=!1;var e=0;ur!==0&&(cN()&&(e=ur),ur=0);for(var n=Fi(),s=null,o=yh;o!==null;){var d=o.next,f=NA(o,n);f===0?(o.next=null,s===null?yh=d:s.next=d,d===null&&(Io=s)):(s=o,(e!==0||(f&3)!==0)&&(bh=!0)),o=d}Vl(e)}function NA(e,n){for(var s=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var v=31-mn(f),E=1<<v,w=d[v];w===-1?((E&s)===0||(E&o)!==0)&&(d[v]=gp(E,n)):w<=n&&(e.expiredLanes|=E),f&=~E}if(n=oe,s=Bt,s=ss(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==hr),o=e.callbackNode,s===0||e===n&&(te===ar||te===rr)||e.cancelPendingCommit!==null)return o!==null&&Zm(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Hs(e,s)){if(n=s&-s,n!==e.callbackPriority||G.actQueue!==null&&o!==ky)Zm(o);else return n;switch(Ir(s)){case ni:case $i:s=Mg;break;case ys:s=eo;break;case Gd:s=Og;break;default:s=eo}return o=LA.bind(null,e),G.actQueue!==null?(G.actQueue.push(o),s=ky):s=Rg(s,o),e.callbackPriority=n,e.callbackNode=s,n}return o!==null&&Zm(o),e.callbackPriority=2,e.callbackNode=null,2}function LA(e,n){if(ih=nh=!1,nn!==lr&&nn!==Ty)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if($l()&&e.callbackNode!==s)return null;var o=Bt;return o=ss(e,e===oe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==hr),o===0?null:(pA(e,o,n),NA(e,Fi()),e.callbackNode!=null&&e.callbackNode===s?LA.bind(null,e):null)}function IA(e,n){if($l())return null;nh=ih,ih=!1,pA(e,n,!0)}function Zm(e){e!==ky&&e!==null&&VN(e)}function PA(){G.actQueue!==null&&G.actQueue.push(function(){return Km(),null}),wI(function(){(Jt&(Sn|Ci))!==Vn?Rg(Dg,sN):Km()})}function Jm(){return ur===0&&(ur=Pt()),ur}function UA(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:(st(e,"action"),Al(""+e))}function zA(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function aN(e,n,s,o,d){if(n==="submit"&&s&&s.stateNode===d){var f=UA((d[Mn]||null).action),v=o.submitter;v&&(n=(n=v[Mn]||null)?UA(n.formAction):v.getAttribute("formAction"),n!==null&&(f=n,v=null));var E=new Wd("action","action",null,o,d);e.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ur!==0){var w=v?zA(d,v):new FormData(d),x={pending:!0,data:w,method:d.method,action:f};Object.freeze(x),bm(s,x,null,w)}}else typeof f=="function"&&(E.preventDefault(),w=v?zA(d,v):new FormData(d),x={pending:!0,data:w,method:d.method,action:f},Object.freeze(x),bm(s,x,f,w))},currentTarget:d}]})}}function Rd(e,n,s){e.currentTarget=s;try{n(e)}catch(o){fy(o)}e.currentTarget=null}function HA(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var o=e[s];t:{var d=void 0,f=o.event;if(o=o.listeners,n)for(var v=o.length-1;0<=v;v--){var E=o[v],w=E.instance,x=E.currentTarget;if(E=E.listener,w!==d&&f.isPropagationStopped())break t;w!==null?pt(w,Rd,f,E,x):Rd(f,E,x),d=w}else for(v=0;v<o.length;v++){if(E=o[v],w=E.instance,x=E.currentTarget,E=E.listener,w!==d&&f.isPropagationStopped())break t;w!==null?pt(w,Rd,f,E,x):Rd(f,E,x),d=w}}}}function Ft(e,n){Ny.has(e)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',e);var s=n[kg];s===void 0&&(s=n[kg]=new Set);var o=e+"__bubble";s.has(o)||(BA(n,e,2,!1),s.add(o))}function tg(e,n,s){Ny.has(e)&&!n&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',e);var o=0;n&&(o|=4),BA(s,e,o,n)}function eg(e){if(!e[vh]){e[vh]=!0,__.forEach(function(s){s!=="selectionchange"&&(Ny.has(s)||tg(s,!1,e),tg(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[vh]||(n[vh]=!0,tg("selectionchange",!1,n))}}function BA(e,n,s,o){switch(m_(n)){case ni:var d=IN;break;case $i:d=PN;break;default:d=gg}s=d.bind(null,n,s,e),d=void 0,!Bg||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(n,s,{capture:!0,passive:d}):e.addEventListener(n,s,!0):d!==void 0?e.addEventListener(n,s,{passive:d}):e.addEventListener(n,s,!1)}function ng(e,n,s,o,d){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)t:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var E=o.stateNode.containerInfo;if(E===d)break;if(v===4)for(v=o.return;v!==null;){var w=v.tag;if((w===3||w===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;E!==null;){if(v=yi(E),v===null)return;if(w=v.tag,w===5||w===6||w===26||w===27){o=f=v;continue t}E=E.parentNode}}o=o.return}hS(function(){var x=f,H=Rp(s),V=[];t:{var z=pT.get(e);if(z!==void 0){var q=Wd,ct=e;switch(e){case"keypress":if(Gu(s)===0)break t;case"keydown":case"keyup":q=kL;break;case"focusin":ct="focus",q=Gg;break;case"focusout":ct="blur",q=Gg;break;case"beforeblur":case"afterblur":q=Gg;break;case"click":if(s.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=tT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=SL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=IL;break;case uT:case dT:case hT:q=_L;break;case fT:q=UL;break;case"scroll":case"scrollend":q=bL;break;case"wheel":q=HL;break;case"copy":case"cut":case"paste":q=wL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=nT;break;case"toggle":case"beforetoggle":q=FL}var Et=(n&4)!==0,le=!Et&&(e==="scroll"||e==="scrollend"),jt=Et?z!==null?z+"Capture":null:z;Et=[];for(var D=x,M;D!==null;){var k=D;if(M=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||M===null||jt===null||(k=_l(D,jt),k!=null&&Et.push(ql(D,k,M))),le)break;D=D.return}0<Et.length&&(z=new q(z,ct,null,s,H),V.push({event:z,listeners:Et}))}}if((n&7)===0){t:{if(z=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",z&&s!==nc&&(ct=s.relatedTarget||s.fromElement)&&(yi(ct)||ct[na]))break t;if((q||z)&&(z=H.window===H?H:(z=H.ownerDocument)?z.defaultView||z.parentWindow:window,q?(ct=s.relatedTarget||s.toElement,q=x,ct=ct?yi(ct):null,ct!==null&&(le=C(ct),Et=ct.tag,ct!==le||Et!==5&&Et!==27&&Et!==6)&&(ct=null)):(q=null,ct=x),q!==ct)){if(Et=tT,k="onMouseLeave",jt="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Et=nT,k="onPointerLeave",jt="onPointerEnter",D="pointer"),le=q==null?z:js(q),M=ct==null?z:js(ct),z=new Et(k,D+"leave",q,s,H),z.target=le,z.relatedTarget=M,k=null,yi(H)===x&&(Et=new Et(jt,D+"enter",ct,s,H),Et.target=M,Et.relatedTarget=le,k=Et),le=k,q&&ct)e:{for(Et=q,jt=ct,D=0,M=Et;M;M=Qr(M))D++;for(M=0,k=jt;k;k=Qr(k))M++;for(;0<D-M;)Et=Qr(Et),D--;for(;0<M-D;)jt=Qr(jt),M--;for(;D--;){if(Et===jt||jt!==null&&Et===jt.alternate)break e;Et=Qr(Et),jt=Qr(jt)}Et=null}else Et=null;q!==null&&FA(V,z,q,Et,!1),ct!==null&&le!==null&&FA(V,le,ct,Et,!0)}}t:{if(z=x?js(x):window,q=z.nodeName&&z.nodeName.toLowerCase(),q==="select"||q==="input"&&z.type==="file")var Y=vS;else if(yS(z))if(lT)Y=wk;else{Y=_k;var nt=Ak}else q=z.nodeName,!q||q.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?x&&El(x.elementType)&&(Y=vS):Y=Tk;if(Y&&(Y=Y(e,x))){bS(V,Y,s,H);break t}nt&&nt(e,z,x),e==="focusout"&&x&&z.type==="number"&&x.memoizedProps.value!=null&&Ap(z,"number",z.value)}switch(nt=x?js(x):window,e){case"focusin":(yS(nt)||nt.contentEditable==="true")&&(co=nt,qg=x,cc=null);break;case"focusout":cc=qg=co=null;break;case"mousedown":Yg=!0;break;case"contextmenu":case"mouseup":case"dragend":Yg=!1,CS(V,s,H);break;case"selectionchange":if(VL)break;case"keydown":case"keyup":CS(V,s,H)}var xt;if(Vg)t:{switch(e){case"compositionstart":var ut="onCompositionStart";break t;case"compositionend":ut="onCompositionEnd";break t;case"compositionupdate":ut="onCompositionUpdate";break t}ut=void 0}else lo?mS(e,s)&&(ut="onCompositionEnd"):e==="keydown"&&s.keyCode===iT&&(ut="onCompositionStart");ut&&(sT&&s.locale!=="ko"&&(lo||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&lo&&(xt=fS()):(ia=H,Fg="value"in ia?ia.value:ia.textContent,lo=!0)),nt=Dd(x,ut),0<nt.length&&(ut=new eT(ut,e,null,s,H),V.push({event:ut,listeners:nt}),xt?ut.data=xt:(xt=gS(s),xt!==null&&(ut.data=xt)))),(xt=$L?bk(e,s):vk(e,s))&&(ut=Dd(x,"onBeforeInput"),0<ut.length&&(nt=new xL("onBeforeInput","beforeinput",null,s,H),V.push({event:nt,listeners:ut}),nt.data=xt)),aN(V,e,x,s,H)}HA(V,n)})}function ql(e,n,s){return{instance:e,listener:n,currentTarget:s}}function Dd(e,n){for(var s=n+"Capture",o=[];e!==null;){var d=e,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=_l(e,s),d!=null&&o.unshift(ql(e,d,f)),d=_l(e,n),d!=null&&o.push(ql(e,d,f))),e.tag===3)return o;e=e.return}return[]}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function FA(e,n,s,o,d){for(var f=n._reactName,v=[];s!==null&&s!==o;){var E=s,w=E.alternate,x=E.stateNode;if(E=E.tag,w!==null&&w===o)break;E!==5&&E!==26&&E!==27||x===null||(w=x,d?(x=_l(s,f),x!=null&&v.unshift(ql(s,x,w))):d||(x=_l(s,f),x!=null&&v.push(ql(s,x,w)))),s=s.return}v.length!==0&&e.push({event:n,listeners:v})}function ig(e,n){pk(e,n),e!=="input"&&e!=="textarea"&&e!=="select"||n==null||n.value!==null||Z_||(Z_=!0,e==="select"&&n.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",e):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",e));var s={registrationNameDependencies:Wa,possibleRegistrationNames:Ng};El(e)||typeof n.is=="string"||gk(e,n,s),n.contentEditable&&!n.suppressContentEditableWarning&&n.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function je(e,n,s,o){n!==s&&(s=Qs(s),Qs(n)!==s&&(o[e]=n))}function rN(e,n,s){n.forEach(function(o){s[GA(o)]=o==="style"?ag(e):e.getAttribute(o)})}function Hi(e,n){n===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",e,e,e):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",e,typeof n)}function jA(e,n){return e=e.namespaceURI===qd||e.namespaceURI===so?e.ownerDocument.createElementNS(e.namespaceURI,e.tagName):e.ownerDocument.createElement(e.tagName),e.innerHTML=n,e.innerHTML}function Qs(e){return W(e)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",Ct(e)),ht(e)),(typeof e=="string"?e:""+e).replace(gI,`
204
+ `).replace(yI,"")}function $A(e,n){return n=Qs(n),Qs(e)===n}function Md(){}function se(e,n,s,o,d,f){switch(s){case"children":typeof o=="string"?($u(o,n,!1),n==="body"||n==="textarea"&&o===""||Sl(e,o)):(typeof o=="number"||typeof o=="bigint")&&($u(""+o,n,!1),n!=="body"&&Sl(e,""+o));break;case"className":Ot(e,"class",o);break;case"tabIndex":Ot(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ot(e,s,o);break;case"style":cS(e,o,f);break;case"data":if(n!=="object"){Ot(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||s!=="href")){console.error(s==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',s,s),e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}st(o,s),o=Al(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(o!=null&&(n==="form"?s==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof o=="function"&&(d.encType==null&&d.method==null||Ah||(Ah=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),d.target==null||Eh||(Eh=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):n==="input"||n==="button"?s==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):n!=="input"||d.type==="submit"||d.type==="image"||Sh?n!=="button"||d.type==null||d.type==="submit"||Sh?typeof o=="function"&&(d.name==null||Dw||(Dw=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),d.formEncType==null&&d.formMethod==null||Ah||(Ah=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),d.formTarget==null||Eh||(Eh=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(Sh=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(Sh=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):console.error(s==="action"?"You can only pass the action prop to <form>.":"You can only pass the formAction prop to <input> or <button>.")),typeof o=="function"){e.setAttribute(s,"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 f=="function"&&(s==="formAction"?(n!=="input"&&se(e,n,"name",d.name,d,null),se(e,n,"formEncType",d.formEncType,d,null),se(e,n,"formMethod",d.formMethod,d,null),se(e,n,"formTarget",d.formTarget,d,null)):(se(e,n,"encType",d.encType,d,null),se(e,n,"method",d.method,d,null),se(e,n,"target",d.target,d,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}st(o,s),o=Al(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(typeof o!="function"&&Hi(s,o),e.onclick=Md);break;case"onScroll":o!=null&&(typeof o!="function"&&Hi(s,o),Ft("scroll",e));break;case"onScrollEnd":o!=null&&(typeof o!="function"&&Hi(s,o),Ft("scrollend",e));break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(s=o.__html,s!=null){if(d.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}st(o,s),s=Al(""+o),e.setAttributeNS(dr,"xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?(st(o,s),e.setAttribute(s,""+o)):e.removeAttribute(s);break;case"inert":o!==""||_h[s]||(_h[s]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",s));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?(st(o,s),e.setAttribute(s,o)):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?(st(o,s),e.setAttribute(s,o)):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):(st(o,s),e.setAttribute(s,o));break;case"popover":Ft("beforetoggle",e),Ft("toggle",e),qt(e,"popover",o);break;case"xlinkActuate":Fe(e,dr,"xlink:actuate",o);break;case"xlinkArcrole":Fe(e,dr,"xlink:arcrole",o);break;case"xlinkRole":Fe(e,dr,"xlink:role",o);break;case"xlinkShow":Fe(e,dr,"xlink:show",o);break;case"xlinkTitle":Fe(e,dr,"xlink:title",o);break;case"xlinkType":Fe(e,dr,"xlink:type",o);break;case"xmlBase":Fe(e,Ly,"xml:base",o);break;case"xmlLang":Fe(e,Ly,"xml:lang",o);break;case"xmlSpace":Fe(e,Ly,"xml:space",o);break;case"is":f!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),qt(e,"is",o);break;case"innerText":case"textContent":break;case"popoverTarget":Mw||o==null||typeof o!="object"||(Mw=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",o));default:!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N"?(s=uS(s),qt(e,s,o)):Wa.hasOwnProperty(s)&&o!=null&&typeof o!="function"&&Hi(s,o)}}function sg(e,n,s,o,d,f){switch(s){case"style":cS(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(s=o.__html,s!=null){if(d.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");e.innerHTML=s}}break;case"children":typeof o=="string"?Sl(e,o):(typeof o=="number"||typeof o=="bigint")&&Sl(e,""+o);break;case"onScroll":o!=null&&(typeof o!="function"&&Hi(s,o),Ft("scroll",e));break;case"onScrollEnd":o!=null&&(typeof o!="function"&&Hi(s,o),Ft("scrollend",e));break;case"onClick":o!=null&&(typeof o!="function"&&Hi(s,o),e.onclick=Md);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(Wa.hasOwnProperty(s))o!=null&&typeof o!="function"&&Hi(s,o);else t:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),n=s.slice(2,d?s.length-7:void 0),f=e[Mn]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(n,f,d),typeof o=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,o,d);break t}s in e?e[s]=o:o===!0?e.setAttribute(s,""):qt(e,s,o)}}}function Ze(e,n,s){switch(ig(n,s),n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ft("error",e),Ft("load",e);var o=!1,d=!1,f;for(f in s)if(s.hasOwnProperty(f)){var v=s[f];if(v!=null)switch(f){case"src":o=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:se(e,n,f,v,s,null)}}d&&se(e,n,"srcSet",s.srcSet,s,null),o&&se(e,n,"src",s.src,s,null);return;case"input":ft("input",s),Ft("invalid",e);var E=f=v=d=null,w=null,x=null;for(o in s)if(s.hasOwnProperty(o)){var H=s[o];if(H!=null)switch(o){case"name":d=H;break;case"type":v=H;break;case"checked":w=H;break;case"defaultChecked":x=H;break;case"value":f=H;break;case"defaultValue":E=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:se(e,n,o,H,s,null)}}Y0(e,s),X0(e,f,E,w,x,v,d,!1),Bu(e);return;case"select":ft("select",s),Ft("invalid",e),o=v=f=null;for(d in s)if(s.hasOwnProperty(d)&&(E=s[d],E!=null))switch(d){case"value":f=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:se(e,n,d,E,s,null)}K0(e,s),n=f,s=v,e.multiple=!!o,n!=null?Ur(e,!!o,n,!1):s!=null&&Ur(e,!!o,s,!0);return;case"textarea":ft("textarea",s),Ft("invalid",e),f=d=o=null;for(v in s)if(s.hasOwnProperty(v)&&(E=s[v],E!=null))switch(v){case"value":o=E;break;case"defaultValue":d=E;break;case"children":f=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:se(e,n,v,E,s,null)}Z0(e,s),tS(e,o,d,f),Bu(e);return;case"option":W0(e,s);for(w in s)if(s.hasOwnProperty(w)&&(o=s[w],o!=null))switch(w){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:se(e,n,w,o,s,null)}return;case"dialog":Ft("beforetoggle",e),Ft("toggle",e),Ft("cancel",e),Ft("close",e);break;case"iframe":case"object":Ft("load",e);break;case"video":case"audio":for(o=0;o<Nc.length;o++)Ft(Nc[o],e);break;case"image":Ft("error",e),Ft("load",e);break;case"details":Ft("toggle",e);break;case"embed":case"source":case"link":Ft("error",e),Ft("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(x in s)if(s.hasOwnProperty(x)&&(o=s[x],o!=null))switch(x){case"children":case"dangerouslySetInnerHTML":throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:se(e,n,x,o,s,null)}return;default:if(El(n)){for(H in s)s.hasOwnProperty(H)&&(o=s[H],o!==void 0&&sg(e,n,H,o,s,void 0));return}}for(E in s)s.hasOwnProperty(E)&&(o=s[E],o!=null&&se(e,n,E,o,s,null))}function oN(e,n,s,o){switch(ig(n,o),n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,v=null,E=null,w=null,x=null,H=null;for(q in s){var V=s[q];if(s.hasOwnProperty(q)&&V!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":w=V;default:o.hasOwnProperty(q)||se(e,n,q,null,o,V)}}for(var z in o){var q=o[z];if(V=s[z],o.hasOwnProperty(z)&&(q!=null||V!=null))switch(z){case"type":f=q;break;case"name":d=q;break;case"checked":x=q;break;case"defaultChecked":H=q;break;case"value":v=q;break;case"defaultValue":E=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:q!==V&&se(e,n,z,q,o,V)}}n=s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null,o=o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null,n||!o||Rw||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),Rw=!0),!n||o||xw||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),xw=!0),Ep(e,v,E,w,x,H,f,d);return;case"select":q=v=E=z=null;for(f in s)if(w=s[f],s.hasOwnProperty(f)&&w!=null)switch(f){case"value":break;case"multiple":q=w;default:o.hasOwnProperty(f)||se(e,n,f,null,o,w)}for(d in o)if(f=o[d],w=s[d],o.hasOwnProperty(d)&&(f!=null||w!=null))switch(d){case"value":z=f;break;case"defaultValue":E=f;break;case"multiple":v=f;default:f!==w&&se(e,n,d,f,o,w)}o=E,n=v,s=q,z!=null?Ur(e,!!n,z,!1):!!s!=!!n&&(o!=null?Ur(e,!!n,o,!0):Ur(e,!!n,n?[]:"",!1));return;case"textarea":q=z=null;for(E in s)if(d=s[E],s.hasOwnProperty(E)&&d!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:se(e,n,E,null,o,d)}for(v in o)if(d=o[v],f=s[v],o.hasOwnProperty(v)&&(d!=null||f!=null))switch(v){case"value":z=d;break;case"defaultValue":q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:d!==f&&se(e,n,v,d,o,f)}J0(e,z,q);return;case"option":for(var ct in s)if(z=s[ct],s.hasOwnProperty(ct)&&z!=null&&!o.hasOwnProperty(ct))switch(ct){case"selected":e.selected=!1;break;default:se(e,n,ct,null,o,z)}for(w in o)if(z=o[w],q=s[w],o.hasOwnProperty(w)&&z!==q&&(z!=null||q!=null))switch(w){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:se(e,n,w,z,o,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Et in s)z=s[Et],s.hasOwnProperty(Et)&&z!=null&&!o.hasOwnProperty(Et)&&se(e,n,Et,null,o,z);for(x in o)if(z=o[x],q=s[x],o.hasOwnProperty(x)&&z!==q&&(z!=null||q!=null))switch(x){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:se(e,n,x,z,o,q)}return;default:if(El(n)){for(var le in s)z=s[le],s.hasOwnProperty(le)&&z!==void 0&&!o.hasOwnProperty(le)&&sg(e,n,le,void 0,o,z);for(H in o)z=o[H],q=s[H],!o.hasOwnProperty(H)||z===q||z===void 0&&q===void 0||sg(e,n,H,z,o,q);return}}for(var jt in s)z=s[jt],s.hasOwnProperty(jt)&&z!=null&&!o.hasOwnProperty(jt)&&se(e,n,jt,null,o,z);for(V in o)z=o[V],q=s[V],!o.hasOwnProperty(V)||z===q||z==null&&q==null||se(e,n,V,z,o,q)}function GA(e){switch(e){case"class":return"className";case"for":return"htmlFor";default:return e}}function ag(e){var n={};e=e.style;for(var s=0;s<e.length;s++){var o=e[s];n[o]=e.getPropertyValue(o)}return n}function VA(e,n,s){if(n!=null&&typeof n!="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var o,d=o="",f;for(f in n)if(n.hasOwnProperty(f)){var v=n[f];v!=null&&typeof v!="boolean"&&v!==""&&(f.indexOf("--")===0?(bt(v,f),o+=d+f+":"+(""+v).trim()):typeof v!="number"||v===0||Q_.has(f)?(bt(v,f),o+=d+f.replace(V_,"-$1").toLowerCase().replace(q_,"-ms-")+":"+(""+v).trim()):o+=d+f.replace(V_,"-$1").toLowerCase().replace(q_,"-ms-")+":"+v+"px",d=";")}o=o||null,n=e.getAttribute("style"),n!==o&&(o=Qs(o),Qs(n)!==o&&(s.style=ag(e)))}}function ti(e,n,s,o,d,f){if(d.delete(s),e=e.getAttribute(s),e===null)switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":return}else if(o!=null)switch(typeof o){case"function":case"symbol":case"boolean":break;default:if(st(o,n),e===""+o)return}je(n,e,o,f)}function qA(e,n,s,o,d,f){if(d.delete(s),e=e.getAttribute(s),e===null){switch(typeof o){case"function":case"symbol":return}if(!o)return}else switch(typeof o){case"function":case"symbol":break;default:if(o)return}je(n,e,o,f)}function rg(e,n,s,o,d,f){if(d.delete(s),e=e.getAttribute(s),e===null)switch(typeof o){case"undefined":case"function":case"symbol":return}else if(o!=null)switch(typeof o){case"function":case"symbol":break;default:if(st(o,s),e===""+o)return}je(n,e,o,f)}function YA(e,n,s,o,d,f){if(d.delete(s),e=e.getAttribute(s),e===null)switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(o))return}else if(o!=null)switch(typeof o){case"function":case"symbol":case"boolean":break;default:if(!isNaN(o)&&(st(o,n),e===""+o))return}je(n,e,o,f)}function og(e,n,s,o,d,f){if(d.delete(s),e=e.getAttribute(s),e===null)switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":return}else if(o!=null)switch(typeof o){case"function":case"symbol":case"boolean":break;default:if(st(o,n),s=Al(""+o),e===s)return}je(n,e,o,f)}function XA(e,n,s,o){for(var d={},f=new Set,v=e.attributes,E=0;E<v.length;E++)switch(v[E].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;default:f.add(v[E].name)}if(El(n)){for(var w in s)if(s.hasOwnProperty(w)){var x=s[w];if(x!=null){if(Wa.hasOwnProperty(w))typeof x!="function"&&Hi(w,x);else if(s.suppressHydrationWarning!==!0)switch(w){case"children":typeof x!="string"&&typeof x!="number"||je("children",e.textContent,x,d);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":v=e.innerHTML,x=x?x.__html:void 0,x!=null&&(x=jA(e,x),je(w,v,x,d));continue;case"style":f.delete(w),VA(e,x,d);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":f.delete(w.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",w);continue;case"className":f.delete("class"),v=Mt(e,"class",x),je("className",v,x,d);continue;default:o.context===xs&&n!=="svg"&&n!=="math"?f.delete(w.toLowerCase()):f.delete(w),v=Mt(e,w,x),je(w,v,x,d)}}}}else for(x in s)if(s.hasOwnProperty(x)&&(w=s[x],w!=null)){if(Wa.hasOwnProperty(x))typeof w!="function"&&Hi(x,w);else if(s.suppressHydrationWarning!==!0)switch(x){case"children":typeof w!="string"&&typeof w!="number"||je("children",e.textContent,w,d);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":v=e.innerHTML,w=w?w.__html:void 0,w!=null&&(w=jA(e,w),v!==w&&(d[x]={__html:v}));continue;case"className":ti(e,x,"class",w,f,d);continue;case"tabIndex":ti(e,x,"tabindex",w,f,d);continue;case"style":f.delete(x),VA(e,w,d);continue;case"multiple":f.delete(x),je(x,e.multiple,w,d);continue;case"muted":f.delete(x),je(x,e.muted,w,d);continue;case"autoFocus":f.delete("autofocus"),je(x,e.autofocus,w,d);continue;case"data":if(n!=="object"){f.delete(x),v=e.getAttribute("data"),je(x,v,w,d);continue}case"src":case"href":if(!(w!==""||n==="a"&&x==="href"||n==="object"&&x==="data")){console.error(x==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',x,x);continue}og(e,x,x,w,f,d);continue;case"action":case"formAction":if(v=e.getAttribute(x),typeof w=="function"){f.delete(x.toLowerCase()),x==="formAction"?(f.delete("name"),f.delete("formenctype"),f.delete("formmethod"),f.delete("formtarget")):(f.delete("enctype"),f.delete("method"),f.delete("target"));continue}else if(v===bI){f.delete(x.toLowerCase()),je(x,"function",w,d);continue}og(e,x,x.toLowerCase(),w,f,d);continue;case"xlinkHref":og(e,x,"xlink:href",w,f,d);continue;case"contentEditable":rg(e,x,"contenteditable",w,f,d);continue;case"spellCheck":rg(e,x,"spellcheck",w,f,d);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":rg(e,x,x,w,f,d);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":qA(e,x,x.toLowerCase(),w,f,d);continue;case"capture":case"download":t:{E=e;var H=v=x,V=d;if(f.delete(H),E=E.getAttribute(H),E===null)switch(typeof w){case"undefined":case"function":case"symbol":break t;default:if(w===!1)break t}else if(w!=null)switch(typeof w){case"function":case"symbol":break;case"boolean":if(w===!0&&E==="")break t;break;default:if(st(w,v),E===""+w)break t}je(v,E,w,V)}continue;case"cols":case"rows":case"size":case"span":t:{if(E=e,H=v=x,V=d,f.delete(H),E=E.getAttribute(H),E===null)switch(typeof w){case"undefined":case"function":case"symbol":case"boolean":break t;default:if(isNaN(w)||1>w)break t}else if(w!=null)switch(typeof w){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(w)||1>w)&&(st(w,v),E===""+w))break t}je(v,E,w,V)}continue;case"rowSpan":YA(e,x,"rowspan",w,f,d);continue;case"start":YA(e,x,x,w,f,d);continue;case"xHeight":ti(e,x,"x-height",w,f,d);continue;case"xlinkActuate":ti(e,x,"xlink:actuate",w,f,d);continue;case"xlinkArcrole":ti(e,x,"xlink:arcrole",w,f,d);continue;case"xlinkRole":ti(e,x,"xlink:role",w,f,d);continue;case"xlinkShow":ti(e,x,"xlink:show",w,f,d);continue;case"xlinkTitle":ti(e,x,"xlink:title",w,f,d);continue;case"xlinkType":ti(e,x,"xlink:type",w,f,d);continue;case"xmlBase":ti(e,x,"xml:base",w,f,d);continue;case"xmlLang":ti(e,x,"xml:lang",w,f,d);continue;case"xmlSpace":ti(e,x,"xml:space",w,f,d);continue;case"inert":w!==""||_h[x]||(_h[x]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",x)),qA(e,x,x,w,f,d);continue;default:if(!(2<x.length)||x[0]!=="o"&&x[0]!=="O"||x[1]!=="n"&&x[1]!=="N"){E=uS(x),v=!1,o.context===xs&&n!=="svg"&&n!=="math"?f.delete(E.toLowerCase()):(H=x.toLowerCase(),H=Yd.hasOwnProperty(H)&&Yd[H]||null,H!==null&&H!==x&&(v=!0,f.delete(H)),f.delete(E));t:if(H=e,V=E,E=w,Nt(V))if(H.hasAttribute(V))H=H.getAttribute(V),st(E,V),E=H===""+E?E:H;else{switch(typeof E){case"function":case"symbol":break t;case"boolean":if(H=V.toLowerCase().slice(0,5),H!=="data-"&&H!=="aria-")break t}E=E===void 0?void 0:null}else E=void 0;v||je(x,E,w,d)}}}return 0<f.size&&s.suppressHydrationWarning!==!0&&rN(e,f,d),Object.keys(d).length===0?null:d}function lN(e,n){switch(e.length){case 0:return"";case 1:return e[0];case 2:return e[0]+" "+n+" "+e[1];default:return e.slice(0,-1).join(", ")+", "+n+" "+e[e.length-1]}}function Od(e){return e.nodeType===9?e:e.ownerDocument}function WA(e){switch(e){case so:return Po;case qd:return Ch;default:return xs}}function QA(e,n){if(e===xs)switch(n){case"svg":return Po;case"math":return Ch;default:return xs}return e===Po&&n==="foreignObject"?xs:e}function lg(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}function cN(){var e=window.event;return e&&e.type==="popstate"?e===zy?!1:(zy=e,!0):(zy=null,!1)}function uN(e){setTimeout(function(){throw e})}function dN(e,n,s){switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&e.focus();break;case"img":s.src?e.src=s.src:s.srcSet&&(e.srcset=s.srcSet)}}function hN(e,n,s,o){oN(e,n,s,o),e[Mn]=o}function KA(e){Sl(e,"")}function fN(e,n,s){e.nodeValue=s}function Ks(e){return e==="head"}function pN(e,n){e.removeChild(n)}function mN(e,n){(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).removeChild(n)}function ZA(e,n){var s=n,o=0,d=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s===wh){if(0<o&&8>o){s=o;var v=e.ownerDocument;if(s&SI&&Yl(v.documentElement),s&EI&&Yl(v.body),s&AI)for(s=v.head,Yl(s),v=s.firstChild;v;){var E=v.nextSibling,w=v.nodeName;v[tc]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=E}}if(d===0){e.removeChild(f),Kl(n);return}d--}else s===Th||s===Cs||s===Lc?d++:o=s.charCodeAt(0)-48;else o=0;s=f}while(s);Kl(n)}function gN(e){e=e.style,typeof e.setProperty=="function"?e.setProperty("display","none","important"):e.display="none"}function yN(e){e.nodeValue=""}function bN(e,n){n=n[_I],n=n!=null&&n.hasOwnProperty("display")?n.display:null,e.style.display=n==null||typeof n=="boolean"?"":(""+n).trim()}function vN(e,n){e.nodeValue=n}function cg(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":cg(s),Fs(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function SN(e,n,s,o){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[tc])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){st(d.name,"name");var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=ei(e.nextSibling),e===null)break}return null}function EN(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ei(e.nextSibling),e===null))return null;return e}function ug(e){return e.data===Lc||e.data===Cs&&e.ownerDocument.readyState===kw}function AN(e,n){var s=e.ownerDocument;if(e.data!==Cs||s.readyState===kw)n();else{var o=function(){n(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function ei(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n===Th||n===Lc||n===Cs||n===Iy||n===Ow)break;if(n===wh)return null}}return e}function JA(e){if(e.nodeType===1){for(var n=e.nodeName.toLowerCase(),s={},o=e.attributes,d=0;d<o.length;d++){var f=o[d];s[GA(f.name)]=f.name.toLowerCase()==="style"?ag(e):f.value}return{type:n,props:s}}return e.nodeType===8?{type:"Suspense",props:{}}:e.nodeValue}function t_(e,n,s){return s===null||s[vI]!==!0?(e.nodeValue===n?e=null:(n=Qs(n),e=Qs(e.nodeValue)===n?null:e.nodeValue),e):null}function e_(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s===wh){if(n===0)return ei(e.nextSibling);n--}else s!==Th&&s!==Lc&&s!==Cs||n++}e=e.nextSibling}return null}function n_(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s===Th||s===Lc||s===Cs){if(n===0)return e;n--}else s===wh&&n++}e=e.previousSibling}return null}function _N(e){Kl(e)}function TN(e){Kl(e)}function i_(e,n,s,o,d){switch(d&&xp(e,o.ancestorInfo),n=Od(s),e){case"html":if(e=n.documentElement,!e)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return e;case"head":if(e=n.head,!e)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return e;case"body":if(e=n.body,!e)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return e;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function wN(e,n,s,o){if(!s[na]&&bi(s)){var d=s.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",d,d,d)}switch(e){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(d=s.attributes;d.length;)s.removeAttributeNode(d[0]);Ze(s,e,n),s[on]=o,s[Mn]=n}function Yl(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Fs(e)}function kd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}function s_(e,n,s){var o=Uo;if(o&&typeof n=="string"&&n){var d=Jn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),zw.has(d)||(zw.add(d),e={rel:e,crossOrigin:s,href:n},o.querySelector(d)===null&&(n=o.createElement("link"),Ze(n,"link",e),P(n),o.head.appendChild(n)))}}function a_(e,n,s,o){var d=(d=ta.current)?kd(d):null;if(!d)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Kr(s.href),n=T(d).hoistableStyles,o=n.get(s),o||(o={type:"style",instance:null,count:0,state:null},n.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Kr(s.href);var f=T(d).hoistableStyles,v=f.get(e);if(!v&&(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:fr,preload:null}},f.set(e,v),(f=d.querySelector(Xl(e)))&&!f._p&&(v.instance=f,v.state.loading=Ic|hi),!fi.has(e))){var E={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy};fi.set(e,E),f||CN(d,e,E,v.state)}if(n&&o===null)throw s=`
205
+
206
+ - `+Nd(n)+`
207
+ + `+Nd(s),Error("Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+s);return v}if(n&&o!==null)throw s=`
208
+
209
+ - `+Nd(n)+`
210
+ + `+Nd(s),Error("Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+s);return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(s=Zr(s),n=T(d).hoistableScripts,o=n.get(s),o||(o={type:"script",instance:null,count:0,state:null},n.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error('getResource encountered a type it did not expect: "'+e+'". this is a bug in React.')}}function Nd(e){var n=0,s="<link";return typeof e.rel=="string"?(n++,s+=' rel="'+e.rel+'"'):gs.call(e,"rel")&&(n++,s+=' rel="'+(e.rel===null?"null":"invalid type "+typeof e.rel)+'"'),typeof e.href=="string"?(n++,s+=' href="'+e.href+'"'):gs.call(e,"href")&&(n++,s+=' href="'+(e.href===null?"null":"invalid type "+typeof e.href)+'"'),typeof e.precedence=="string"?(n++,s+=' precedence="'+e.precedence+'"'):gs.call(e,"precedence")&&(n++,s+=" precedence={"+(e.precedence===null?"null":"invalid type "+typeof e.precedence)+"}"),Object.getOwnPropertyNames(e).length>n&&(s+=" ..."),s+" />"}function Kr(e){return'href="'+Jn(e)+'"'}function Xl(e){return'link[rel="stylesheet"]['+e+"]"}function r_(e){return Lt({},e,{"data-precedence":e.precedence,precedence:null})}function CN(e,n,s,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=Ic:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=Ic}),n.addEventListener("error",function(){return o.loading|=Pw}),Ze(n,"link",s),P(n),e.head.appendChild(n))}function Zr(e){return'[src="'+Jn(e)+'"]'}function Wl(e){return"script[async]"+e}function o_(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Jn(s.href)+'"]');if(o)return n.instance=o,P(o),o;var d=Lt({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),P(o),Ze(o,"style",d),Ld(o,s.precedence,e),n.instance=o;case"stylesheet":d=Kr(s.href);var f=e.querySelector(Xl(d));if(f)return n.state.loading|=hi,n.instance=f,P(f),f;o=r_(s),(d=fi.get(d))&&dg(o,d),f=(e.ownerDocument||e).createElement("link"),P(f);var v=f;return v._p=new Promise(function(E,w){v.onload=E,v.onerror=w}),Ze(f,"link",o),n.state.loading|=hi,Ld(f,s.precedence,e),n.instance=f;case"script":return f=Zr(s.src),(d=e.querySelector(Wl(f)))?(n.instance=d,P(d),d):(o=s,(d=fi.get(f))&&(o=Lt({},s),hg(o,d)),e=e.ownerDocument||e,d=e.createElement("script"),P(d),Ze(d,"link",o),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error('acquireResource encountered a resource type it did not expect: "'+n.type+'". this is a bug in React.')}else n.type==="stylesheet"&&(n.state.loading&hi)===fr&&(o=n.instance,n.state.loading|=hi,Ld(o,s.precedence,e));return n.instance}function Ld(e,n,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,f=d,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)f=E;else if(f!==d)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function dg(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function hg(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}function l_(e,n,s){if(xh===null){var o=new Map,d=xh=new Map;d.set(s,o)}else d=xh,o=d.get(s),o||(o=new Map,d.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var f=s[d];if(!(f[tc]||f[on]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!==so){var v=f.getAttribute(n)||"";v=e+v;var E=o.get(v);E?E.push(f):o.set(v,[f])}}return o}function c_(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function xN(e,n,s){var o=!s.ancestorInfo.containerTagInScope;if(s.context===Po||n.itemProp!=null)return!o||n.itemProp==null||e!=="meta"&&e!=="title"&&e!=="style"&&e!=="link"&&e!=="script"||console.error("Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",e,e),!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href===""){o&&console.error('Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.');break}return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError){if(n.rel==="stylesheet"&&typeof n.precedence=="string"){e=n.href;var d=n.onError,f=n.disabled;s=[],n.onLoad&&s.push("`onLoad`"),d&&s.push("`onError`"),f!=null&&s.push("`disabled`"),d=lN(s,"and"),d+=s.length===1?" prop":" props",f=s.length===1?"an "+d:"the "+d,s.length&&console.error('React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',e,f,d)}o&&(typeof n.rel!="string"||typeof n.href!="string"||n.href===""?console.error("Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"):(n.onError||n.onLoad)&&console.error("Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."));break}switch(n.rel){case"stylesheet":return e=n.precedence,n=n.disabled,typeof e!="string"&&o&&console.error('Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'),typeof e=="string"&&n==null;default:return!0}case"script":if(e=n.async&&typeof n.async!="function"&&typeof n.async!="symbol",!e||n.onLoad||n.onError||!n.src||typeof n.src!="string"){o&&(e?n.onLoad||n.onError?console.error("Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."):console.error("Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."):console.error('Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'));break}return!0;case"noscript":case"template":o&&console.error("Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",e)}return!1}function u_(e){return!(e.type==="stylesheet"&&(e.state.loading&Uw)===fr)}function RN(){}function DN(e,n,s){if(Pc===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var o=Pc;if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&hi)===fr){if(n.instance===null){var d=Kr(s.href),f=e.querySelector(Xl(d));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(o.count++,o=Id.bind(o),e.then(o,o)),n.state.loading|=hi,n.instance=f,P(f);return}f=e.ownerDocument||e,s=r_(s),(d=fi.get(d))&&dg(s,d),f=f.createElement("link"),P(f);var v=f;v._p=new Promise(function(E,w){v.onload=E,v.onerror=w}),Ze(f,"link",s),n.instance=f}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&Uw)===fr&&(o.count++,n=Id.bind(o),e.addEventListener("load",n),e.addEventListener("error",n))}}function MN(){if(Pc===null)throw Error("Internal React Error: suspendedState null when it was expected to exists. Please report this as a React bug.");var e=Pc;return e.stylesheets&&e.count===0&&fg(e,e.stylesheets),0<e.count?function(n){var s=setTimeout(function(){if(e.stylesheets&&fg(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s)}}:null}function Id(){if(this.count--,this.count===0){if(this.stylesheets)fg(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}function fg(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rh=new Map,n.forEach(ON,e),Rh=null,Id.call(e))}function ON(e,n){if(!(n.state.loading&hi)){var s=Rh.get(e);if(s)var o=s.get(By);else{s=new Map,Rh.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var v=d[f];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(s.set(v.dataset.precedence,v),o=v)}o&&s.set(By,o)}d=n.instance,v=d.getAttribute("data-precedence"),f=s.get(v)||o,f===o&&s.set(By,d),s.set(v,d),this.count++,o=Id.bind(this),d.addEventListener("load",o),d.addEventListener("error",o),f?f.parentNode.insertBefore(d,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=hi}}function kN(e,n,s,o,d,f,v,E){for(this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=hr,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Lr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lr(0),this.hiddenUpdates=Lr(null),this.identifierPrefix=o,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,e=this.pendingUpdatersLaneMap=[],n=0;31>n;n++)e.push(new Set);this._debugRootType=s?"hydrateRoot()":"createRoot()"}function d_(e,n,s,o,d,f,v,E,w,x,H,V){return e=new kN(e,n,s,v,E,w,x,V),n=WL,f===!0&&(n|=ln|Ai),Ei&&(n|=tn),f=b(3,null,null,n),e.current=f,f.stateNode=e,n=$p(),$a(n),e.pooledCache=n,$a(n),f.memoizedState={element:o,isDehydrated:s,cache:n},Yp(f),e}function h_(e){return e?(e=sa,e):sa}function pg(e,n,s,o,d,f){if(rn&&typeof rn.onScheduleFiberRoot=="function")try{rn.onScheduleFiberRoot(no,o,s)}catch(v){ji||(ji=!0,console.error("React instrumentation encountered an error: %s",v))}rt!==null&&typeof rt.markRenderScheduled=="function"&&rt.markRenderScheduled(n),d=h_(d),o.context===null?o.context=d:o.pendingContext=d,Gi&&Gn!==null&&!jw&&(jw=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
211
+
212
+ Check the render method of %s.`,X(Gn)||"Unknown")),o=Gs(n),o.payload={element:s},f=f===void 0?null:f,f!==null&&(typeof f!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",f),o.callback=f),s=Vs(e,o,n),s!==null&&(Ce(s,e,n),Ol(s,e,n))}function f_(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function mg(e,n){f_(e,n),(e=e.alternate)&&f_(e,n)}function p_(e){if(e.tag===13){var n=xn(e,67108864);n!==null&&Ce(n,e,67108864),mg(e,67108864)}}function NN(){return Gn}function LN(){for(var e=new Map,n=1,s=0;31>s;s++){var o=Oa(n);e.set(n,o),n*=2}return e}function IN(e,n,s,o){var d=G.T;G.T=null;var f=Zt.p;try{Zt.p=ni,gg(e,n,s,o)}finally{Zt.p=f,G.T=d}}function PN(e,n,s,o){var d=G.T;G.T=null;var f=Zt.p;try{Zt.p=$i,gg(e,n,s,o)}finally{Zt.p=f,G.T=d}}function gg(e,n,s,o){if(Mh){var d=yg(o);if(d===null)ng(e,n,o,Oh,s),g_(e,o);else if(UN(d,e,n,s,o))o.stopPropagation();else if(g_(e,o),n&4&&-1<xI.indexOf(e)){for(;d!==null;){var f=bi(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var v=Ne(f.pendingLanes);if(v!==0){var E=f;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var w=1<<31-mn(v);E.entanglements[1]|=w,v&=~w}zi(f),(Jt&(Sn|Ci))===Vn&&(ph=Fi()+Sw,Vl(0))}}break;case 13:E=xn(f,2),E!==null&&Ce(E,f,2),Yr(),mg(f,2)}if(f=yg(o),f===null&&ng(e,n,o,Oh,s),f===d)break;d=f}d!==null&&o.stopPropagation()}else ng(e,n,o,null,s)}}function yg(e){return e=Rp(e),bg(e)}function bg(e){if(Oh=null,e=yi(e),e!==null){var n=C(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=N(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Oh=e,null}function m_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return ni;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 $i;case"message":switch(XN()){case Dg:return ni;case Mg:return $i;case eo:case WN:return ys;case Og:return Gd;default:return ys}default:return ys}}function g_(e,n){switch(e){case"focusin":case"focusout":pa=null;break;case"dragenter":case"dragleave":ma=null;break;case"mouseover":case"mouseout":ga=null;break;case"pointerover":case"pointerout":zc.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hc.delete(n.pointerId)}}function Ql(e,n,s,o,d,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:s,eventSystemFlags:o,nativeEvent:f,targetContainers:[d]},n!==null&&(n=bi(n),n!==null&&p_(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function UN(e,n,s,o,d){switch(n){case"focusin":return pa=Ql(pa,e,n,s,o,d),!0;case"dragenter":return ma=Ql(ma,e,n,s,o,d),!0;case"mouseover":return ga=Ql(ga,e,n,s,o,d),!0;case"pointerover":var f=d.pointerId;return zc.set(f,Ql(zc.get(f)||null,e,n,s,o,d)),!0;case"gotpointercapture":return f=d.pointerId,Hc.set(f,Ql(Hc.get(f)||null,e,n,s,o,d)),!0}return!1}function y_(e){var n=yi(e.target);if(n!==null){var s=C(n);if(s!==null){if(n=s.tag,n===13){if(n=N(s),n!==null){e.blockedOn=n,Pr(e.priority,function(){if(s.tag===13){var o=jn(s);o=pl(o);var d=xn(s,o);d!==null&&Ce(d,s,o),mg(s,o)}});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pd(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=yg(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s),d=o;nc!==null&&console.error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),nc=d,s.target.dispatchEvent(o),nc===null&&console.error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),nc=null}else return n=bi(s),n!==null&&p_(n),e.blockedOn=s,!1;n.shift()}return!0}function b_(e,n,s){Pd(e)&&s.delete(n)}function zN(){Fy=!1,pa!==null&&Pd(pa)&&(pa=null),ma!==null&&Pd(ma)&&(ma=null),ga!==null&&Pd(ga)&&(ga=null),zc.forEach(b_),Hc.forEach(b_)}function Ud(e,n){e.blockedOn===n&&(e.blockedOn=null,Fy||(Fy=!0,Le.unstable_scheduleCallback(Le.unstable_NormalPriority,zN)))}function v_(e){kh!==e&&(kh=e,Le.unstable_scheduleCallback(Le.unstable_NormalPriority,function(){kh===e&&(kh=null);for(var n=0;n<e.length;n+=3){var s=e[n],o=e[n+1],d=e[n+2];if(typeof o!="function"){if(bg(o||s)===null)continue;break}var f=bi(s);f!==null&&(e.splice(n,3),n-=3,s={pending:!0,data:d,method:s.method,action:o},Object.freeze(s),bm(f,s,o,d))}}))}function Kl(e){function n(w){return Ud(w,e)}pa!==null&&Ud(pa,e),ma!==null&&Ud(ma,e),ga!==null&&Ud(ga,e),zc.forEach(n),Hc.forEach(n);for(var s=0;s<ya.length;s++){var o=ya[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ya.length&&(s=ya[0],s.blockedOn===null);)y_(s),s.blockedOn===null&&ya.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var d=s[o],f=s[o+1],v=d[Mn]||null;if(typeof f=="function")v||v_(s);else if(v){var E=null;if(f&&f.hasAttribute("formAction")){if(d=f,v=f[Mn]||null)E=v.formAction;else if(bg(d)!==null)continue}else E=v.action;typeof E=="function"?s[o+1]=E:(s.splice(o,3),o-=3),v_(s)}}}function vg(e){this._internalRoot=e}function zd(e){this._internalRoot=e}function S_(e){e[na]&&(e._reactRootContainer?console.error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):console.error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Le=l1(),Sg=jc(),HN=u1(),Lt=Object.assign,BN=Symbol.for("react.element"),Zs=Symbol.for("react.transitional.element"),Jr=Symbol.for("react.portal"),to=Symbol.for("react.fragment"),Hd=Symbol.for("react.strict_mode"),Eg=Symbol.for("react.profiler"),FN=Symbol.for("react.provider"),Ag=Symbol.for("react.consumer"),Bi=Symbol.for("react.context"),Zl=Symbol.for("react.forward_ref"),_g=Symbol.for("react.suspense"),Tg=Symbol.for("react.suspense_list"),Bd=Symbol.for("react.memo"),$n=Symbol.for("react.lazy"),wg=Symbol.for("react.activity"),jN=Symbol.for("react.memo_cache_sentinel"),E_=Symbol.iterator,$N=Symbol.for("react.client.reference"),Je=Array.isArray,G=Sg.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Zt=HN.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,GN=Object.freeze({pending:!1,data:null,method:null,action:null}),Cg=[],xg=[],ms=-1,Js=at(null),Jl=at(null),ta=at(null),Fd=at(null),gs=Object.prototype.hasOwnProperty,Rg=Le.unstable_scheduleCallback,VN=Le.unstable_cancelCallback,qN=Le.unstable_shouldYield,YN=Le.unstable_requestPaint,Fi=Le.unstable_now,XN=Le.unstable_getCurrentPriorityLevel,Dg=Le.unstable_ImmediatePriority,Mg=Le.unstable_UserBlockingPriority,eo=Le.unstable_NormalPriority,WN=Le.unstable_LowPriority,Og=Le.unstable_IdlePriority,QN=Le.log,KN=Le.unstable_setDisableYieldValue,no=null,rn=null,rt=null,ji=!1,Ei=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",mn=Math.clz32?Math.clz32:is,ZN=Math.log,JN=Math.LN2,jd=256,$d=4194304,ni=2,$i=8,ys=32,Gd=268435456,ea=Math.random().toString(36).slice(2),on="__reactFiber$"+ea,Mn="__reactProps$"+ea,na="__reactContainer$"+ea,kg="__reactEvents$"+ea,tL="__reactListeners$"+ea,eL="__reactHandles$"+ea,A_="__reactResources$"+ea,tc="__reactMarker$"+ea,__=new Set,Wa={},Ng={},nL={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},iL=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]*$"),T_={},w_={},ec=0,C_,x_,R_,D_,M_,O_,k_;as.__reactDisabledLog=!0;var Lg,N_,Ig=!1,Pg=new(typeof WeakMap=="function"?WeakMap:Map),Gn=null,Gi=!1,sL=/[\n"\\]/g,L_=!1,I_=!1,P_=!1,U_=!1,z_=!1,H_=!1,B_=["value","defaultValue"],F_=!1,j_=/["'&<>\n\t]|^\s|\s$/,aL="address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(" "),$_="applet caption html table td th marquee object template foreignObject desc title".split(" "),rL=$_.concat(["button"]),oL="dd dt li option optgroup p rp rt".split(" "),G_={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null,implicitRootScope:!1},Vd={},Ug={animation:"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(" "),background:"backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(" "),backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:"borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(" "),borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:"fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(" "),fontVariant:"fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(" "),gap:["columnGap","rowGap"],grid:"gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(" "),gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:"maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(" "),maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},V_=/([A-Z])/g,q_=/^ms-/,lL=/^(?:webkit|moz|o)[A-Z]/,cL=/^-ms-/,uL=/-(.)/g,Y_=/;\s*$/,io={},zg={},X_=!1,W_=!1,Q_=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(" ")),qd="http://www.w3.org/1998/Math/MathML",so="http://www.w3.org/2000/svg",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-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"]]),Yd={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",fetchpriority:"fetchPriority",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",inert:"inert",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",popover:"popover",popovertarget:"popoverTarget",popovertargetaction:"popoverTargetAction",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",transformorigin:"transformOrigin","transform-origin":"transformOrigin",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},K_={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},ao={},hL=RegExp("^(aria)-[: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]*$"),fL=RegExp("^(aria)[A-Z][: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]*$"),Z_=!1,gn={},J_=/^on./,pL=/^on[^A-Z]/,mL=RegExp("^(aria)-[: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]*$"),gL=RegExp("^(aria)[A-Z][: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]*$"),yL=/^[\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,nc=null,ro=null,oo=null,Hg=!1,Vi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bg=!1;if(Vi)try{var ic={};Object.defineProperty(ic,"passive",{get:function(){Bg=!0}}),window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{Bg=!1}var ia=null,Fg=null,Xd=null,Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=Cn(Qa),sc=Lt({},Qa,{view:0,detail:0}),bL=Cn(sc),jg,$g,ac,Qd=Lt({},sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ac&&(ac&&e.type==="mousemove"?(jg=e.screenX-ac.screenX,$g=e.screenY-ac.screenY):$g=jg=0,ac=e),jg)},movementY:function(e){return"movementY"in e?e.movementY:$g}}),tT=Cn(Qd),vL=Lt({},Qd,{dataTransfer:0}),SL=Cn(vL),EL=Lt({},sc,{relatedTarget:0}),Gg=Cn(EL),AL=Lt({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),_L=Cn(AL),TL=Lt({},Qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wL=Cn(TL),CL=Lt({},Qa,{data:0}),eT=Cn(CL),xL=eT,RL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DL={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"},ML={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},OL=Lt({},sc,{key:function(e){if(e.key){var n=RL[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Gu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?DL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dp,charCode:function(e){return e.type==="keypress"?Gu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kL=Cn(OL),NL=Lt({},Qd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nT=Cn(NL),LL=Lt({},sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dp}),IL=Cn(LL),PL=Lt({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),UL=Cn(PL),zL=Lt({},Qd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),HL=Cn(zL),BL=Lt({},Qa,{newState:0,oldState:0}),FL=Cn(BL),jL=[9,13,27,32],iT=229,Vg=Vi&&"CompositionEvent"in window,rc=null;Vi&&"documentMode"in document&&(rc=document.documentMode);var $L=Vi&&"TextEvent"in window&&!rc,sT=Vi&&(!Vg||rc&&8<rc&&11>=rc),aT=32,rT=String.fromCharCode(aT),oT=!1,lo=!1,GL={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},oc=null,lc=null,lT=!1;Vi&&(lT=Sk("input")&&(!document.documentMode||9<document.documentMode));var yn=typeof Object.is=="function"?Object.is:Ck,VL=Vi&&"documentMode"in document&&11>=document.documentMode,co=null,qg=null,cc=null,Yg=!1,uo={animationend:La("Animation","AnimationEnd"),animationiteration:La("Animation","AnimationIteration"),animationstart:La("Animation","AnimationStart"),transitionrun:La("Transition","TransitionRun"),transitionstart:La("Transition","TransitionStart"),transitioncancel:La("Transition","TransitionCancel"),transitionend:La("Transition","TransitionEnd")},Xg={},cT={};Vi&&(cT=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);var uT=Ia("animationend"),dT=Ia("animationiteration"),hT=Ia("animationstart"),qL=Ia("transitionrun"),YL=Ia("transitionstart"),XL=Ia("transitioncancel"),fT=Ia("transitionend"),pT=new Map,Wg="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(" ");Wg.push("scrollEnd");var Qg=new WeakMap,Kd=1,bs=2,ii=[],ho=0,Kg=0,sa={};Object.freeze(sa);var si=null,fo=null,ue=0,WL=1,tn=2,ln=8,Ai=16,mT=64,gT=!1;try{var yT=Object.preventExtensions({})}catch{gT=!0}var po=[],mo=0,Zd=null,Jd=0,ai=[],ri=0,Ka=null,vs=1,Ss="",bn=null,ve=null,Yt=!1,Es=!1,oi=null,Za=null,qi=!1,Zg=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),bT=0;if(typeof performance=="object"&&typeof performance.now=="function")var QL=performance,vT=function(){return QL.now()};else{var KL=Date;vT=function(){return KL.now()}}var Jg=at(null),ty=at(null),ST={},th=null,go=null,yo=!1,ZL=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},JL=Le.unstable_scheduleCallback,tI=Le.unstable_NormalPriority,ze={$$typeof:Bi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},bo=Le.unstable_now,ET=-0,eh=-0,On=-1.1,Ja=-0,nh=!1,ih=!1,uc=null,ey=0,tr=0,vo=null,AT=G.S;G.S=function(e,n){typeof n=="object"&&n!==null&&typeof n.then=="function"&&Rk(e,n),AT!==null&&AT(e,n)};var er=at(null),_i={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},dc=[],hc=[],fc=[],pc=[],mc=[],gc=[],nr=new Set;_i.recordUnsafeLifecycleWarnings=function(e,n){nr.has(e.type)||(typeof n.componentWillMount=="function"&&n.componentWillMount.__suppressDeprecationWarning!==!0&&dc.push(e),e.mode&ln&&typeof n.UNSAFE_componentWillMount=="function"&&hc.push(e),typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&fc.push(e),e.mode&ln&&typeof n.UNSAFE_componentWillReceiveProps=="function"&&pc.push(e),typeof n.componentWillUpdate=="function"&&n.componentWillUpdate.__suppressDeprecationWarning!==!0&&mc.push(e),e.mode&ln&&typeof n.UNSAFE_componentWillUpdate=="function"&&gc.push(e))},_i.flushPendingUnsafeLifecycleWarnings=function(){var e=new Set;0<dc.length&&(dc.forEach(function(E){e.add(X(E)||"Component"),nr.add(E.type)}),dc=[]);var n=new Set;0<hc.length&&(hc.forEach(function(E){n.add(X(E)||"Component"),nr.add(E.type)}),hc=[]);var s=new Set;0<fc.length&&(fc.forEach(function(E){s.add(X(E)||"Component"),nr.add(E.type)}),fc=[]);var o=new Set;0<pc.length&&(pc.forEach(function(E){o.add(X(E)||"Component"),nr.add(E.type)}),pc=[]);var d=new Set;0<mc.length&&(mc.forEach(function(E){d.add(X(E)||"Component"),nr.add(E.type)}),mc=[]);var f=new Set;if(0<gc.length&&(gc.forEach(function(E){f.add(X(E)||"Component"),nr.add(E.type)}),gc=[]),0<n.size){var v=y(n);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
213
+
214
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
215
+
216
+ Please update the following components: %s`,v)}0<o.size&&(v=y(o),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
217
+
218
+ * Move data fetching code or side effects to componentDidUpdate.
219
+ * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
220
+
221
+ Please update the following components: %s`,v)),0<f.size&&(v=y(f),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
222
+
223
+ * Move data fetching code or side effects to componentDidUpdate.
224
+
225
+ Please update the following components: %s`,v)),0<e.size&&(v=y(e),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
226
+
227
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
228
+ * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
229
+
230
+ Please update the following components: %s`,v)),0<s.size&&(v=y(s),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
231
+
232
+ * Move data fetching code or side effects to componentDidUpdate.
233
+ * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
234
+ * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
235
+
236
+ Please update the following components: %s`,v)),0<d.size&&(v=y(d),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
237
+
238
+ * Move data fetching code or side effects to componentDidUpdate.
239
+ * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
240
+
241
+ Please update the following components: %s`,v))};var sh=new Map,_T=new Set;_i.recordLegacyContextWarning=function(e,n){for(var s=null,o=e;o!==null;)o.mode&ln&&(s=o),o=o.return;s===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!_T.has(e.type)&&(o=sh.get(s),e.type.contextTypes!=null||e.type.childContextTypes!=null||n!==null&&typeof n.getChildContext=="function")&&(o===void 0&&(o=[],sh.set(s,o)),o.push(e))},_i.flushLegacyContextWarning=function(){sh.forEach(function(e){if(e.length!==0){var n=e[0],s=new Set;e.forEach(function(d){s.add(X(d)||"Component"),_T.add(d.type)});var o=y(s);pt(n,function(){console.error(`Legacy context API has been detected within a strict-mode tree.
242
+
243
+ The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
244
+
245
+ Please update the following components: %s
246
+
247
+ Learn more about this warning here: https://react.dev/link/legacy-context`,o)})}})},_i.discardPendingWarnings=function(){dc=[],hc=[],fc=[],pc=[],mc=[],gc=[],sh=new Map};var yc=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),TT=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),ah=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),ny={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},bc=null,rh=!1,li=0,ci=1,vn=2,en=4,He=8,wT=0,CT=1,xT=2,iy=3,aa=!1,RT=!1,sy=null,ay=!1,So=at(null),oh=at(0),Eo,DT=new Set,MT=new Set,ry=new Set,OT=new Set,ra=0,At=null,ae=null,Ie=null,lh=!1,Ao=!1,ir=!1,ch=0,vc=0,As=null,eI=0,nI=25,$=null,ui=null,_s=-1,Sc=!1,uh={readContext:fe,use:qs,useCallback:we,useContext:we,useEffect:we,useImperativeHandle:we,useLayoutEffect:we,useInsertionEffect:we,useMemo:we,useReducer:we,useRef:we,useState:we,useDebugValue:we,useDeferredValue:we,useTransition:we,useSyncExternalStore:we,useId:we,useHostTransitionStatus:we,useFormState:we,useActionState:we,useOptimistic:we,useMemoCache:we,useCacheRefresh:we},oy=null,kT=null,ly=null,NT=null,Yi=null,Ti=null,dh=null;oy={readContext:function(e){return fe(e)},use:qs,useCallback:function(e,n){return $="useCallback",Ht(),Br(n),pm(e,n)},useContext:function(e){return $="useContext",Ht(),fe(e)},useEffect:function(e,n){return $="useEffect",Ht(),Br(n),ud(e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",Ht(),Br(s),fm(e,n,s)},useInsertionEffect:function(e,n){$="useInsertionEffect",Ht(),Br(n),Va(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",Ht(),Br(n),hm(e,n)},useMemo:function(e,n){$="useMemo",Ht(),Br(n);var s=G.H;G.H=Yi;try{return mm(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",Ht();var o=G.H;G.H=Yi;try{return sm(e,n,s)}finally{G.H=o}},useRef:function(e){return $="useRef",Ht(),dm(e)},useState:function(e){$="useState",Ht();var n=G.H;G.H=Yi;try{return lm(e)}finally{G.H=n}},useDebugValue:function(){$="useDebugValue",Ht()},useDeferredValue:function(e,n){return $="useDeferredValue",Ht(),gm(e,n)},useTransition:function(){return $="useTransition",Ht(),vm()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",Ht(),rm(e,n,s)},useId:function(){return $="useId",Ht(),Sm()},useFormState:function(e,n){return $="useFormState",Ht(),ad(),jr(e,n)},useActionState:function(e,n){return $="useActionState",Ht(),jr(e,n)},useOptimistic:function(e){return $="useOptimistic",Ht(),cm(e)},useHostTransitionStatus:qa,useMemoCache:Ga,useCacheRefresh:function(){return $="useCacheRefresh",Ht(),Em()}},kT={readContext:function(e){return fe(e)},use:qs,useCallback:function(e,n){return $="useCallback",Z(),pm(e,n)},useContext:function(e){return $="useContext",Z(),fe(e)},useEffect:function(e,n){return $="useEffect",Z(),ud(e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",Z(),fm(e,n,s)},useInsertionEffect:function(e,n){$="useInsertionEffect",Z(),Va(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",Z(),hm(e,n)},useMemo:function(e,n){$="useMemo",Z();var s=G.H;G.H=Yi;try{return mm(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",Z();var o=G.H;G.H=Yi;try{return sm(e,n,s)}finally{G.H=o}},useRef:function(e){return $="useRef",Z(),dm(e)},useState:function(e){$="useState",Z();var n=G.H;G.H=Yi;try{return lm(e)}finally{G.H=n}},useDebugValue:function(){$="useDebugValue",Z()},useDeferredValue:function(e,n){return $="useDeferredValue",Z(),gm(e,n)},useTransition:function(){return $="useTransition",Z(),vm()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",Z(),rm(e,n,s)},useId:function(){return $="useId",Z(),Sm()},useActionState:function(e,n){return $="useActionState",Z(),jr(e,n)},useFormState:function(e,n){return $="useFormState",Z(),ad(),jr(e,n)},useOptimistic:function(e){return $="useOptimistic",Z(),cm(e)},useHostTransitionStatus:qa,useMemoCache:Ga,useCacheRefresh:function(){return $="useCacheRefresh",Z(),Em()}},ly={readContext:function(e){return fe(e)},use:qs,useCallback:function(e,n){return $="useCallback",Z(),hd(e,n)},useContext:function(e){return $="useContext",Z(),fe(e)},useEffect:function(e,n){$="useEffect",Z(),Dn(2048,He,e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",Z(),dd(e,n,s)},useInsertionEffect:function(e,n){return $="useInsertionEffect",Z(),Dn(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",Z(),Dn(4,en,e,n)},useMemo:function(e,n){$="useMemo",Z();var s=G.H;G.H=Ti;try{return fd(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",Z();var o=G.H;G.H=Ti;try{return Fr(e,n,s)}finally{G.H=o}},useRef:function(){return $="useRef",Z(),ee().memoizedState},useState:function(){$="useState",Z();var e=G.H;G.H=Ti;try{return Fr(Si)}finally{G.H=e}},useDebugValue:function(){$="useDebugValue",Z()},useDeferredValue:function(e,n){return $="useDeferredValue",Z(),uE(e,n)},useTransition:function(){return $="useTransition",Z(),gE()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",Z(),rd(e,n,s)},useId:function(){return $="useId",Z(),ee().memoizedState},useFormState:function(e){return $="useFormState",Z(),ad(),od(e)},useActionState:function(e){return $="useActionState",Z(),od(e)},useOptimistic:function(e,n){return $="useOptimistic",Z(),tE(e,n)},useHostTransitionStatus:qa,useMemoCache:Ga,useCacheRefresh:function(){return $="useCacheRefresh",Z(),ee().memoizedState}},NT={readContext:function(e){return fe(e)},use:qs,useCallback:function(e,n){return $="useCallback",Z(),hd(e,n)},useContext:function(e){return $="useContext",Z(),fe(e)},useEffect:function(e,n){$="useEffect",Z(),Dn(2048,He,e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",Z(),dd(e,n,s)},useInsertionEffect:function(e,n){return $="useInsertionEffect",Z(),Dn(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",Z(),Dn(4,en,e,n)},useMemo:function(e,n){$="useMemo",Z();var s=G.H;G.H=dh;try{return fd(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",Z();var o=G.H;G.H=dh;try{return Il(e,n,s)}finally{G.H=o}},useRef:function(){return $="useRef",Z(),ee().memoizedState},useState:function(){$="useState",Z();var e=G.H;G.H=dh;try{return Il(Si)}finally{G.H=e}},useDebugValue:function(){$="useDebugValue",Z()},useDeferredValue:function(e,n){return $="useDeferredValue",Z(),dE(e,n)},useTransition:function(){return $="useTransition",Z(),yE()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",Z(),rd(e,n,s)},useId:function(){return $="useId",Z(),ee().memoizedState},useFormState:function(e){return $="useFormState",Z(),ad(),ld(e)},useActionState:function(e){return $="useActionState",Z(),ld(e)},useOptimistic:function(e,n){return $="useOptimistic",Z(),nE(e,n)},useHostTransitionStatus:qa,useMemoCache:Ga,useCacheRefresh:function(){return $="useCacheRefresh",Z(),ee().memoizedState}},Yi={readContext:function(e){return m(),fe(e)},use:function(e){return p(),qs(e)},useCallback:function(e,n){return $="useCallback",p(),Ht(),pm(e,n)},useContext:function(e){return $="useContext",p(),Ht(),fe(e)},useEffect:function(e,n){return $="useEffect",p(),Ht(),ud(e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",p(),Ht(),fm(e,n,s)},useInsertionEffect:function(e,n){$="useInsertionEffect",p(),Ht(),Va(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",p(),Ht(),hm(e,n)},useMemo:function(e,n){$="useMemo",p(),Ht();var s=G.H;G.H=Yi;try{return mm(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",p(),Ht();var o=G.H;G.H=Yi;try{return sm(e,n,s)}finally{G.H=o}},useRef:function(e){return $="useRef",p(),Ht(),dm(e)},useState:function(e){$="useState",p(),Ht();var n=G.H;G.H=Yi;try{return lm(e)}finally{G.H=n}},useDebugValue:function(){$="useDebugValue",p(),Ht()},useDeferredValue:function(e,n){return $="useDeferredValue",p(),Ht(),gm(e,n)},useTransition:function(){return $="useTransition",p(),Ht(),vm()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",p(),Ht(),rm(e,n,s)},useId:function(){return $="useId",p(),Ht(),Sm()},useFormState:function(e,n){return $="useFormState",p(),Ht(),jr(e,n)},useActionState:function(e,n){return $="useActionState",p(),Ht(),jr(e,n)},useOptimistic:function(e){return $="useOptimistic",p(),Ht(),cm(e)},useMemoCache:function(e){return p(),Ga(e)},useHostTransitionStatus:qa,useCacheRefresh:function(){return $="useCacheRefresh",Ht(),Em()}},Ti={readContext:function(e){return m(),fe(e)},use:function(e){return p(),qs(e)},useCallback:function(e,n){return $="useCallback",p(),Z(),hd(e,n)},useContext:function(e){return $="useContext",p(),Z(),fe(e)},useEffect:function(e,n){$="useEffect",p(),Z(),Dn(2048,He,e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",p(),Z(),dd(e,n,s)},useInsertionEffect:function(e,n){return $="useInsertionEffect",p(),Z(),Dn(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",p(),Z(),Dn(4,en,e,n)},useMemo:function(e,n){$="useMemo",p(),Z();var s=G.H;G.H=Ti;try{return fd(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",p(),Z();var o=G.H;G.H=Ti;try{return Fr(e,n,s)}finally{G.H=o}},useRef:function(){return $="useRef",p(),Z(),ee().memoizedState},useState:function(){$="useState",p(),Z();var e=G.H;G.H=Ti;try{return Fr(Si)}finally{G.H=e}},useDebugValue:function(){$="useDebugValue",p(),Z()},useDeferredValue:function(e,n){return $="useDeferredValue",p(),Z(),uE(e,n)},useTransition:function(){return $="useTransition",p(),Z(),gE()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",p(),Z(),rd(e,n,s)},useId:function(){return $="useId",p(),Z(),ee().memoizedState},useFormState:function(e){return $="useFormState",p(),Z(),od(e)},useActionState:function(e){return $="useActionState",p(),Z(),od(e)},useOptimistic:function(e,n){return $="useOptimistic",p(),Z(),tE(e,n)},useMemoCache:function(e){return p(),Ga(e)},useHostTransitionStatus:qa,useCacheRefresh:function(){return $="useCacheRefresh",Z(),ee().memoizedState}},dh={readContext:function(e){return m(),fe(e)},use:function(e){return p(),qs(e)},useCallback:function(e,n){return $="useCallback",p(),Z(),hd(e,n)},useContext:function(e){return $="useContext",p(),Z(),fe(e)},useEffect:function(e,n){$="useEffect",p(),Z(),Dn(2048,He,e,n)},useImperativeHandle:function(e,n,s){return $="useImperativeHandle",p(),Z(),dd(e,n,s)},useInsertionEffect:function(e,n){return $="useInsertionEffect",p(),Z(),Dn(4,vn,e,n)},useLayoutEffect:function(e,n){return $="useLayoutEffect",p(),Z(),Dn(4,en,e,n)},useMemo:function(e,n){$="useMemo",p(),Z();var s=G.H;G.H=Ti;try{return fd(e,n)}finally{G.H=s}},useReducer:function(e,n,s){$="useReducer",p(),Z();var o=G.H;G.H=Ti;try{return Il(e,n,s)}finally{G.H=o}},useRef:function(){return $="useRef",p(),Z(),ee().memoizedState},useState:function(){$="useState",p(),Z();var e=G.H;G.H=Ti;try{return Il(Si)}finally{G.H=e}},useDebugValue:function(){$="useDebugValue",p(),Z()},useDeferredValue:function(e,n){return $="useDeferredValue",p(),Z(),dE(e,n)},useTransition:function(){return $="useTransition",p(),Z(),yE()},useSyncExternalStore:function(e,n,s){return $="useSyncExternalStore",p(),Z(),rd(e,n,s)},useId:function(){return $="useId",p(),Z(),ee().memoizedState},useFormState:function(e){return $="useFormState",p(),Z(),ld(e)},useActionState:function(e){return $="useActionState",p(),Z(),ld(e)},useOptimistic:function(e,n){return $="useOptimistic",p(),Z(),nE(e,n)},useMemoCache:function(e){return p(),Ga(e)},useHostTransitionStatus:qa,useCacheRefresh:function(){return $="useCacheRefresh",Z(),ee().memoizedState}};var LT={"react-stack-bottom-frame":function(e,n,s){var o=Gi;Gi=!0;try{return e(n,s)}finally{Gi=o}}},cy=LT["react-stack-bottom-frame"].bind(LT),IT={"react-stack-bottom-frame":function(e){var n=Gi;Gi=!0;try{return e.render()}finally{Gi=n}}},PT=IT["react-stack-bottom-frame"].bind(IT),UT={"react-stack-bottom-frame":function(e,n){try{n.componentDidMount()}catch(s){ie(e,e.return,s)}}},uy=UT["react-stack-bottom-frame"].bind(UT),zT={"react-stack-bottom-frame":function(e,n,s,o,d){try{n.componentDidUpdate(s,o,d)}catch(f){ie(e,e.return,f)}}},HT=zT["react-stack-bottom-frame"].bind(zT),BT={"react-stack-bottom-frame":function(e,n){var s=n.stack;e.componentDidCatch(n.value,{componentStack:s!==null?s:""})}},iI=BT["react-stack-bottom-frame"].bind(BT),FT={"react-stack-bottom-frame":function(e,n,s){try{s.componentWillUnmount()}catch(o){ie(e,n,o)}}},jT=FT["react-stack-bottom-frame"].bind(FT),$T={"react-stack-bottom-frame":function(e){e.resourceKind!=null&&console.error("Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",e.resourceKind);var n=e.create;return e=e.inst,n=n(),e.destroy=n}},sI=$T["react-stack-bottom-frame"].bind($T),GT={"react-stack-bottom-frame":function(e,n,s){try{s()}catch(o){ie(e,n,o)}}},aI=GT["react-stack-bottom-frame"].bind(GT),VT={"react-stack-bottom-frame":function(e){var n=e._init;return n(e._payload)}},oa=VT["react-stack-bottom-frame"].bind(VT),_o=null,Ec=0,kt=null,dy,qT=dy=!1,YT={},XT={},WT={};h=function(e,n,s){if(s!==null&&typeof s=="object"&&s._store&&(!s._store.validated&&s.key==null||s._store.validated===2)){if(typeof s._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");s._store.validated=1;var o=X(e),d=o||"null";if(!YT[d]){YT[d]=!0,s=s._owner,e=e._debugOwner;var f="";e&&typeof e.tag=="number"&&(d=X(e))&&(f=`
248
+
249
+ Check the render method of \``+d+"`."),f||o&&(f=`
250
+
251
+ Check the top-level render call using <`+o+">.");var v="";s!=null&&e!==s&&(o=null,typeof s.tag=="number"?o=X(s):typeof s.name=="string"&&(o=s.name),o&&(v=" It was passed a child from "+o+".")),pt(n,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',f,v)})}}};var To=EE(!0),QT=EE(!1),di=at(null),Xi=null,wo=1,Ac=2,Be=at(0),KT={},ZT=new Set,JT=new Set,tw=new Set,ew=new Set,nw=new Set,iw=new Set,sw=new Set,aw=new Set,rw=new Set,ow=new Set;Object.freeze(KT);var hy={enqueueSetState:function(e,n,s){e=e._reactInternals;var o=jn(e),d=Gs(o);d.payload=n,s!=null&&(_m(s),d.callback=s),n=Vs(e,d,o),n!==null&&(Ce(n,e,o),Ol(n,e,o)),Un(e,o)},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var o=jn(e),d=Gs(o);d.tag=CT,d.payload=n,s!=null&&(_m(s),d.callback=s),n=Vs(e,d,o),n!==null&&(Ce(n,e,o),Ol(n,e,o)),Un(e,o)},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=jn(e),o=Gs(s);o.tag=xT,n!=null&&(_m(n),o.callback=n),n=Vs(e,o,s),n!==null&&(Ce(n,e,s),Ol(n,e,s)),rt!==null&&typeof rt.markForceUpdateScheduled=="function"&&rt.markForceUpdateScheduled(e,s)}},fy=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Co=null,py=null,lw=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),$e=!1,cw={},uw={},dw={},hw={},xo=!1,fw={},my={},gy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},pw=!1,mw=null;mw=new Set;var Ts=!1,xe=!1,yy=!1,gw=typeof WeakSet=="function"?WeakSet:Set,Ge=null,Ro=null,Do=null,Pe=null,kn=!1,wi=null,_c=8192,rI={getCacheForType:function(e){var n=fe(ze),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},getOwner:function(){return Gn}};if(typeof Symbol=="function"&&Symbol.for){var Tc=Symbol.for;Tc("selector.component"),Tc("selector.has_pseudo_class"),Tc("selector.role"),Tc("selector.test_id"),Tc("selector.text")}var oI=[],lI=typeof WeakMap=="function"?WeakMap:Map,Vn=0,Sn=2,Ci=4,ws=0,wc=1,Mo=2,by=3,sr=4,hh=6,yw=5,Jt=Vn,oe=null,Ut=null,Bt=0,Nn=0,Cc=1,ar=2,xc=3,bw=4,vy=5,Oo=6,Rc=7,Sy=8,rr=9,te=Nn,qn=null,la=!1,ko=!1,Ey=!1,Wi=0,Se=ws,ca=0,ua=0,Ay=0,Yn=0,or=0,Dc=null,En=null,fh=!1,_y=0,vw=300,ph=1/0,Sw=500,Mc=null,da=null,cI=0,uI=1,dI=2,lr=0,Ew=1,Aw=2,_w=3,hI=4,Ty=5,nn=0,ha=null,No=null,fa=0,wy=0,Cy=null,Tw=null,fI=50,Oc=0,xy=null,Ry=!1,mh=!1,pI=50,cr=0,kc=null,Lo=!1,gh=null,ww=!1,Cw=new Set,mI={},yh=null,Io=null,Dy=!1,My=!1,bh=!1,Oy=!1,ur=0,ky={};(function(){for(var e=0;e<Wg.length;e++){var n=Wg[e],s=n.toLowerCase();n=n[0].toUpperCase()+n.slice(1),vi(s,"on"+n)}vi(uT,"onAnimationEnd"),vi(dT,"onAnimationIteration"),vi(hT,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(qL,"onTransitionRun"),vi(YL,"onTransitionStart"),vi(XL,"onTransitionCancel"),vi(fT,"onTransitionEnd")})(),it("onMouseEnter",["mouseout","mouseover"]),it("onMouseLeave",["mouseout","mouseover"]),it("onPointerEnter",["pointerout","pointerover"]),it("onPointerLeave",["pointerout","pointerover"]),et("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),et("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),et("onBeforeInput",["compositionend","keypress","textInput","paste"]),et("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),Ny=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc)),vh="_reactListening"+Math.random().toString(36).slice(2),xw=!1,Rw=!1,Sh=!1,Dw=!1,Eh=!1,Ah=!1,Mw=!1,_h={},gI=/\r\n?/g,yI=/\u0000|\uFFFD/g,dr="http://www.w3.org/1999/xlink",Ly="http://www.w3.org/XML/1998/namespace",bI="javascript:throw new Error('React form unexpectedly submitted.')",vI="suppressHydrationWarning",Th="$",wh="/$",Cs="$?",Lc="$!",SI=1,EI=2,AI=4,Iy="F!",Ow="F",kw="complete",_I="style",xs=0,Po=1,Ch=2,Py=null,Uy=null,Nw={dialog:!0,webview:!0},zy=null,Lw=typeof setTimeout=="function"?setTimeout:void 0,TI=typeof clearTimeout=="function"?clearTimeout:void 0,hr=-1,Iw=typeof Promise=="function"?Promise:void 0,wI=typeof queueMicrotask=="function"?queueMicrotask:typeof Iw<"u"?function(e){return Iw.resolve(null).then(e).catch(uN)}:Lw,Hy=null,fr=0,Ic=1,Pw=2,Uw=3,hi=4,fi=new Map,zw=new Set,Rs=Zt.d;Zt.d={f:function(){var e=Rs.f(),n=Yr();return e||n},r:function(e){var n=bi(e);n!==null&&n.tag===5&&n.type==="form"?mE(n):Rs.r(e)},D:function(e){Rs.D(e),s_("dns-prefetch",e,null)},C:function(e,n){Rs.C(e,n),s_("preconnect",e,n)},L:function(e,n,s){Rs.L(e,n,s);var o=Uo;if(o&&e&&n){var d='link[rel="preload"][as="'+Jn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+Jn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+Jn(s.imageSizes)+'"]')):d+='[href="'+Jn(e)+'"]';var f=d;switch(n){case"style":f=Kr(e);break;case"script":f=Zr(e)}fi.has(f)||(e=Lt({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),fi.set(f,e),o.querySelector(d)!==null||n==="style"&&o.querySelector(Xl(f))||n==="script"&&o.querySelector(Wl(f))||(n=o.createElement("link"),Ze(n,"link",e),P(n),o.head.appendChild(n)))}},m:function(e,n){Rs.m(e,n);var s=Uo;if(s&&e){var o=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Jn(o)+'"][href="'+Jn(e)+'"]',f=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Zr(e)}if(!fi.has(f)&&(e=Lt({rel:"modulepreload",href:e},n),fi.set(f,e),s.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Wl(f)))return}o=s.createElement("link"),Ze(o,"link",e),P(o),s.head.appendChild(o)}}},X:function(e,n){Rs.X(e,n);var s=Uo;if(s&&e){var o=T(s).hoistableScripts,d=Zr(e),f=o.get(d);f||(f=s.querySelector(Wl(d)),f||(e=Lt({src:e,async:!0},n),(n=fi.get(d))&&hg(e,n),f=s.createElement("script"),P(f),Ze(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(d,f))}},S:function(e,n,s){Rs.S(e,n,s);var o=Uo;if(o&&e){var d=T(o).hoistableStyles,f=Kr(e);n=n||"default";var v=d.get(f);if(!v){var E={loading:fr,preload:null};if(v=o.querySelector(Xl(f)))E.loading=Ic|hi;else{e=Lt({rel:"stylesheet",href:e,"data-precedence":n},s),(s=fi.get(f))&&dg(e,s);var w=v=o.createElement("link");P(w),Ze(w,"link",e),w._p=new Promise(function(x,H){w.onload=x,w.onerror=H}),w.addEventListener("load",function(){E.loading|=Ic}),w.addEventListener("error",function(){E.loading|=Pw}),E.loading|=hi,Ld(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},d.set(f,v)}}},M:function(e,n){Rs.M(e,n);var s=Uo;if(s&&e){var o=T(s).hoistableScripts,d=Zr(e),f=o.get(d);f||(f=s.querySelector(Wl(d)),f||(e=Lt({src:e,async:!0,type:"module"},n),(n=fi.get(d))&&hg(e,n),f=s.createElement("script"),P(f),Ze(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(d,f))}}};var Uo=typeof document>"u"?null:document,xh=null,Pc=null,By=null,Rh=null,pr=GN,Uc={$$typeof:Bi,Provider:null,Consumer:null,_currentValue:pr,_currentValue2:pr,_threadCount:0},Hw="%c%s%c ",Bw="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",Fw="",Dh=" ",CI=Function.prototype.bind,jw=!1,$w=null,Gw=null,Vw=null,qw=null,Yw=null,Xw=null,Ww=null,Qw=null,Kw=null;$w=function(e,n,s,o){n=l(e,n),n!==null&&(s=t(n.memoizedState,s,0,o),n.memoizedState=s,n.baseState=s,e.memoizedProps=Lt({},e.memoizedProps),s=xn(e,2),s!==null&&Ce(s,e,2))},Gw=function(e,n,s){n=l(e,n),n!==null&&(s=r(n.memoizedState,s,0),n.memoizedState=s,n.baseState=s,e.memoizedProps=Lt({},e.memoizedProps),s=xn(e,2),s!==null&&Ce(s,e,2))},Vw=function(e,n,s,o){n=l(e,n),n!==null&&(s=i(n.memoizedState,s,o),n.memoizedState=s,n.baseState=s,e.memoizedProps=Lt({},e.memoizedProps),s=xn(e,2),s!==null&&Ce(s,e,2))},qw=function(e,n,s){e.pendingProps=t(e.memoizedProps,n,0,s),e.alternate&&(e.alternate.pendingProps=e.pendingProps),n=xn(e,2),n!==null&&Ce(n,e,2)},Yw=function(e,n){e.pendingProps=r(e.memoizedProps,n,0),e.alternate&&(e.alternate.pendingProps=e.pendingProps),n=xn(e,2),n!==null&&Ce(n,e,2)},Xw=function(e,n,s){e.pendingProps=i(e.memoizedProps,n,s),e.alternate&&(e.alternate.pendingProps=e.pendingProps),n=xn(e,2),n!==null&&Ce(n,e,2)},Ww=function(e){var n=xn(e,2);n!==null&&Ce(n,e,2)},Qw=function(e){u=e},Kw=function(e){c=e};var Mh=!0,Oh=null,Fy=!1,pa=null,ma=null,ga=null,zc=new Map,Hc=new Map,ya=[],xI="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(" "),kh=null;if(zd.prototype.render=vg.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error("Cannot update an unmounted root.");var s=arguments;typeof s[1]=="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):R(s[1])?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof s[1]<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),s=e;var o=n.current,d=jn(o);pg(o,d,s,n,null,null)},zd.prototype.unmount=vg.prototype.unmount=function(){var e=arguments;if(typeof e[0]=="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),e=this._internalRoot,e!==null){this._internalRoot=null;var n=e.containerInfo;(Jt&(Sn|Ci))!==Vn&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),pg(e.current,2,null,e,null,null),Yr(),n[na]=null}},zd.prototype.unstable_scheduleHydration=function(e){if(e){var n=yl();e={blockedOn:null,target:e,priority:n};for(var s=0;s<ya.length&&n!==0&&n<ya[s].priority;s++);ya.splice(s,0,e),s===0&&y_(e)}},function(){var e=Sg.version;if(e!=="19.1.0")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
252
+ - react: `+(e+`
253
+ - react-dom: 19.1.0
254
+ Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Zt.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error("Unable to find node on an unmounted component."):(e=Object.keys(e).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+e));return e=U(n),e=e!==null?I(e):null,e=e===null?null:e.stateNode,e},!function(){var e={bundleType:1,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.1.0"};return e.overrideHookState=$w,e.overrideHookStateDeletePath=Gw,e.overrideHookStateRenamePath=Vw,e.overrideProps=qw,e.overridePropsDeletePath=Yw,e.overridePropsRenamePath=Xw,e.scheduleUpdate=Ww,e.setErrorHandler=Qw,e.setSuspenseHandler=Kw,e.scheduleRefresh=A,e.scheduleRoot=S,e.setRefreshHandler=_,e.getCurrentFiber=NN,e.getLaneLabelMap=LN,e.injectProfilingHooks=Wt,re(e)}()&&Vi&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var Zw=window.location.protocol;/^(https?|file):$/.test(Zw)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(Zw==="file:"?`
255
+ You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}Ho.createRoot=function(e,n){if(!R(e))throw Error("Target container is not a DOM element.");S_(e);var s=!1,o="",d=wE,f=CE,v=xE,E=null;return n!=null&&(n.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof n=="object"&&n!==null&&n.$$typeof===Zs&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
256
+
257
+ let root = createRoot(domContainer);
258
+ root.render(<App />);`),n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(E=n.unstable_transitionCallbacks)),n=d_(e,1,!1,null,null,s,o,d,f,v,E,null),e[na]=n.current,eg(e),new vg(n)},Ho.hydrateRoot=function(e,n,s){if(!R(e))throw Error("Target container is not a DOM element.");S_(e),n===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var o=!1,d="",f=wE,v=CE,E=xE,w=null,x=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(v=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(w=s.unstable_transitionCallbacks),s.formState!==void 0&&(x=s.formState)),n=d_(e,1,!0,n,s??null,o,d,f,v,E,w,x),n.context=h_(null),s=n.current,o=jn(s),o=pl(o),d=Gs(o),d.callback=null,Vs(s,d,o),s=o,n.current.lanes=s,Bs(n,s),zi(n),e[na]=n.current,eg(e),new zd(n)},Ho.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),Ho}var Ky;function h1(){return Ky||(Ky=1,Ph.exports=d1()),Ph.exports}var f1=h1(),Bh={exports:{}},$c={},Zy;function p1(){if(Zy)return $c;Zy=1;/**
259
+ * @license React
260
+ * react-jsx-dev-runtime.development.js
261
+ *
262
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
263
+ *
264
+ * This source code is licensed under the MIT license found in the
265
+ * LICENSE file in the root directory of this source tree.
266
+ */return function(){function l(W){if(W==null)return null;if(typeof W=="function")return W.$$typeof===at?null:W.displayName||W.name||null;if(typeof W=="string")return W;switch(W){case _:return"Fragment";case C:return"Profiler";case R:return"StrictMode";case I:return"Suspense";case j:return"SuspenseList";case X:return"Activity"}if(typeof W=="object")switch(typeof W.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),W.$$typeof){case A:return"Portal";case O:return(W.displayName||"Context")+".Provider";case N:return(W._context.displayName||"Context")+".Consumer";case U:var ht=W.render;return W=W.displayName,W||(W=ht.displayName||ht.name||"",W=W!==""?"ForwardRef("+W+")":"ForwardRef"),W;case F:return ht=W.displayName||null,ht!==null?ht:l(W.type)||"Memo";case J:ht=W._payload,W=W._init;try{return l(W(ht))}catch{}}return null}function t(W){return""+W}function i(W){try{t(W);var ht=!1}catch{ht=!0}if(ht){ht=console;var st=ht.error,bt=typeof Symbol=="function"&&Symbol.toStringTag&&W[Symbol.toStringTag]||W.constructor.name||"Object";return st.call(ht,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",bt),t(W)}}function a(W){if(W===_)return"<>";if(typeof W=="object"&&W!==null&&W.$$typeof===J)return"<...>";try{var ht=l(W);return ht?"<"+ht+">":"<...>"}catch{return"<...>"}}function r(){var W=K.A;return W===null?null:W.getOwner()}function c(){return Error("react-stack-top-frame")}function u(W){if(lt.call(W,"key")){var ht=Object.getOwnPropertyDescriptor(W,"key").get;if(ht&&ht.isReactWarning)return!1}return W.key!==void 0}function h(W,ht){function st(){Gt||(Gt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ht))}st.isReactWarning=!0,Object.defineProperty(W,"key",{get:st,configurable:!0})}function p(){var W=l(this.type);return B[W]||(B[W]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),W=this.props.ref,W!==void 0?W:null}function m(W,ht,st,bt,Kt,re,tt,Wt){return st=re.ref,W={$$typeof:S,type:W,key:ht,props:re,_owner:Kt},(st!==void 0?st:null)!==null?Object.defineProperty(W,"ref",{enumerable:!1,get:p}):Object.defineProperty(W,"ref",{enumerable:!1,value:null}),W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(W,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(W,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:tt}),Object.defineProperty(W,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Wt}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W}function g(W,ht,st,bt,Kt,re,tt,Wt){var Vt=ht.children;if(Vt!==void 0)if(bt)if(St(Vt)){for(bt=0;bt<Vt.length;bt++)y(Vt[bt]);Object.freeze&&Object.freeze(Vt)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(Vt);if(lt.call(ht,"key")){Vt=l(W);var be=Object.keys(ht).filter(function(wn){return wn!=="key"});bt=0<be.length?"{key: someKey, "+be.join(": ..., ")+": ...}":"{key: someKey}",Ct[Vt+bt]||(be=0<be.length?"{"+be.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
267
+ let props = %s;
268
+ <%s {...props} />
269
+ React keys must be passed directly to JSX without using spread:
270
+ let props = %s;
271
+ <%s key={someKey} {...props} />`,bt,Vt,be,Vt),Ct[Vt+bt]=!0)}if(Vt=null,st!==void 0&&(i(st),Vt=""+st),u(ht)&&(i(ht.key),Vt=""+ht.key),"key"in ht){st={};for(var We in ht)We!=="key"&&(st[We]=ht[We])}else st=ht;return Vt&&h(st,typeof W=="function"?W.displayName||W.name||"Unknown":W),m(W,Vt,re,Kt,r(),st,tt,Wt)}function y(W){typeof W=="object"&&W!==null&&W.$$typeof===S&&W._store&&(W._store.validated=1)}var b=jc(),S=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),O=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),at=Symbol.for("react.client.reference"),K=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=Object.prototype.hasOwnProperty,St=Array.isArray,yt=console.createTask?console.createTask:function(){return null};b={"react-stack-bottom-frame":function(W){return W()}};var Gt,B={},Q=b["react-stack-bottom-frame"].bind(b,c)(),dt=yt(a(c)),Ct={};$c.Fragment=_,$c.jsxDEV=function(W,ht,st,bt,Kt,re){var tt=1e4>K.recentlyCreatedOwnerStacks++;return g(W,ht,st,bt,Kt,re,tt?Error("react-stack-top-frame"):Q,tt?yt(a(W)):dt)}}(),$c}var Jy;function m1(){return Jy||(Jy=1,Bh.exports=p1()),Bh.exports}var ge=m1();function tb(l){return typeof chrome<"u"&&chrome.runtime&&chrome.runtime.getURL?chrome.runtime.getURL(l):typeof browser<"u"&&browser.runtime&&browser.runtime.getURL?browser.runtime.getURL(l):new URL(l,typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Qt&&Qt.tagName.toUpperCase()==="SCRIPT"&&Qt.src||new URL("corisco.umd.js",document.baseURI).href).href}const eb={icons:{icon128:tb("public/icon-128.png"),chevron:tb("public/chevron-right.svg")}},g1=()=>{const l=Xt.app.iframe_url,t=eb.icons.icon128,i=eb.icons.chevron,a=Xt.ui.panel.min_width,r=Xt.ui.panel.max_width_ratio,c=540,u=()=>{try{const tt=localStorage.getItem("chatjt-panel-width");return tt?parseInt(tt,10):c}catch{return c}},h=tt=>{try{localStorage.setItem("chatjt-panel-width",tt.toString())}catch{}},[p,m]=An.useState(!1),[g,y]=An.useState(!1),[b,S]=An.useState(!1),[A,_]=An.useState(!1),[R,C]=An.useState(u()||c),[N,O]=An.useState(!1),U=An.useRef(null),I=An.useRef(null),j=An.useRef(null);An.useEffect(()=>{const tt=j.current,Wt=U.current;if(!tt||!Wt)return;let Vt=!1;const be=gi=>{if(!N)return;const Un=window.innerWidth*r,is=window.innerWidth-gi.clientX;if(is>=a){const Oa=Math.max(a,Math.min(Un,is));C(Oa),_(!1),Vt=!1}else C(a),_(!0),Vt=!0},We=()=>{N&&(O(!1),document.body.style.userSelect="",I.current&&(I.current.style.pointerEvents="auto"),tt.style.backgroundColor="transparent",Vt?m(!1):h(R),_(!1),Vt=!1),O(!1)},wn=()=>{O(!0),document.body.style.userSelect="none",I.current&&(I.current.style.pointerEvents="none"),tt.style.backgroundColor="#1591EA90"};return tt.addEventListener("mousedown",wn),window.addEventListener("mousemove",be),window.addEventListener("mouseup",We),()=>{tt.removeEventListener("mousedown",wn),window.removeEventListener("mousemove",be),window.removeEventListener("mouseup",We)}},[a,r,N,R]),An.useEffect(()=>{!p&&R!==u()&&h(R)},[p,R]),An.useEffect(()=>{p&&_(!1)},[p]);const F=()=>{y(!0),S(!1)},J=()=>{S(!0)},X=()=>{S(!1),I.current?.contentWindow?.location.reload()},at={position:"absolute",bottom:50,right:50,width:60,height:60,backgroundColor:"#111827",color:"white",border:"none",borderRadius:"33%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",zIndex:9998,transition:"transform 0.3s ease, box-shadow 0.3s ease",padding:10,boxSizing:"border-box"},K={width:"100%",height:"100%",objectFit:"contain"},lt={position:"fixed",top:0,right:0,height:"100vh",width:R,backgroundColor:"#f8f9fa",borderLeft:"1px solid #111827",boxShadow:"-5px 0 15px rgba(0, 0, 0, 0.1)",zIndex:9999,display:"flex",flexDirection:"column",transition:p?"transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease":"transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s 0.2s, opacity 0s 0.2s ease",transform:p?"translateX(0)":"translateX(100%)",visibility:p?"visible":"hidden"},St={position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.15)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10003,opacity:A?1:0,visibility:A?"visible":"hidden",transition:"opacity 0.2s ease, visibility 0.2s ease"},yt={color:"white",fontSize:18,fontWeight:600,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",textAlign:"center",textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)",animation:A?"chatjt-pulse 1.5s ease-in-out infinite":""},Gt={position:"absolute",top:0,left:-8,width:8,height:"100%",cursor:"col-resize",backgroundColor:"transparent",zIndex:10002},B={position:"absolute",top:"50%",left:-36,width:28,height:50,transform:"translateY(-50%)",backgroundColor:"#111827",color:"white",borderRadius:20,cursor:"pointer",zIndex:10001,display:"flex",justifyContent:"center",alignItems:"center",transition:"transform 0.2s ease",padding:"6px 4px",boxSizing:"border-box"},Q={width:"100%",height:"100%",objectFit:"contain"},dt={position:"relative",flexGrow:1,overflow:"hidden"},Ct={width:"100%",height:"100%",border:"none",transition:"opacity 0.3s ease"},W={position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"linear-gradient(135deg, #253557 0%, #111827 100%)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},ht={textAlign:"center",color:"white"},st={width:40,height:40,border:"3px solid rgba(255, 255, 255, 0.3)",borderRadius:"50%",borderTopColor:"white",animation:"chatjt-spin 1s ease-in-out infinite",margin:"0 auto 16px auto"},bt={fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSize:14,fontWeight:500,marginBottom:12},Kt={fontSize:32,marginBottom:12,animation:"chatjt-pulse 2s ease-in-out infinite"},re={background:"rgba(255, 255, 255, 0.2)",border:"1px solid rgba(255, 255, 255, 0.3)",color:"white",padding:"10px 20px",borderRadius:6,cursor:"pointer",fontSize:13,fontWeight:500,transition:"all 0.2s ease",marginTop:8};return An.useEffect(()=>{const tt=document.createElement("style");return tt.innerHTML=`
272
+ @keyframes chatjt-spin {
273
+ to { transform: rotate(360deg); }
274
+ }
275
+ @keyframes chatjt-pulse {
276
+ 0%, 100% { opacity: 1; transform: scale(1);}
277
+ 50% { opacity: 0.7; transform: scale(1.05);}
278
+ }
279
+ `,document.head.appendChild(tt),()=>{document.head.removeChild(tt)}},[]),ge.jsxDEV(ge.Fragment,{children:[!p&&ge.jsxDEV("button",{id:"chatjt-open-button",style:at,onClick:()=>m(!0),onMouseEnter:tt=>{tt.currentTarget.style.transform="translateY(-10%) scale(1.05)",tt.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.2)"},onMouseLeave:tt=>{tt.currentTarget.style.transform="",tt.currentTarget.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.2)"},children:ge.jsxDEV("img",{src:t,alt:"Abrir ChatJT",style:K},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:354,columnNumber:21},void 0)},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:341,columnNumber:17},void 0),ge.jsxDEV("div",{id:"chatjt-panel",ref:U,style:lt,children:[ge.jsxDEV("div",{id:"chatjt-resizer",ref:j,style:Gt,onMouseMove:tt=>{N?(tt.currentTarget.style.background="linear-gradient(to right, transparent 95%, #1591EA90 95%)",tt.currentTarget.style.left="-160px",tt.currentTarget.style.width="160px"):(tt.currentTarget.style.left="-8px",tt.currentTarget.style.width="8px")},onMouseEnter:tt=>{N||(tt.currentTarget.style.background="#11182750")},onMouseLeave:tt=>{N||(tt.currentTarget.style.background="transparent")}},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:365,columnNumber:17},void 0),ge.jsxDEV("div",{id:"chatjt-iframe-container",style:dt,children:[b?ge.jsxDEV("div",{id:"chatjt-loading",style:W,children:ge.jsxDEV("div",{style:ht,children:[ge.jsxDEV("div",{style:Kt,children:"⚠️"},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:397,columnNumber:33},void 0),ge.jsxDEV("div",{style:bt,children:"Erro ao carregar ChatJT"},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:398,columnNumber:33},void 0),ge.jsxDEV("button",{style:re,onClick:X,onMouseEnter:tt=>{tt.currentTarget.style.background="rgba(255,255,255,0.3)",tt.currentTarget.style.borderColor="rgba(255,255,255,0.5)",tt.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:tt=>{tt.currentTarget.style.background="rgba(255,255,255,0.2)",tt.currentTarget.style.borderColor="rgba(255,255,255,0.3)",tt.currentTarget.style.transform=""},onMouseDown:tt=>{tt.currentTarget.style.transform="translateY(0)"},children:"Tentar novamente"},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:399,columnNumber:33},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:396,columnNumber:29},void 0)},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:395,columnNumber:25},void 0):ge.jsxDEV(ge.Fragment,{children:[!g&&ge.jsxDEV("div",{id:"chatjt-loading",style:W,children:ge.jsxDEV("div",{style:ht,children:[ge.jsxDEV("div",{style:st},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:425,columnNumber:41},void 0),ge.jsxDEV("div",{style:bt,children:"Carregando ChatJT..."},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:426,columnNumber:41},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:424,columnNumber:37},void 0)},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:423,columnNumber:33},void 0),ge.jsxDEV("iframe",{id:"chatjt-iframe",ref:I,src:l,style:Ct,onLoad:F,onError:J,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-storage-access-by-user-activation allow-top-navigation-by-user-activation allow-modals",allow:"storage-access 'src'"},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:430,columnNumber:29},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:421,columnNumber:25},void 0),ge.jsxDEV("div",{style:St,children:ge.jsxDEV("div",{style:yt,children:"Solte para fechar"},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:445,columnNumber:25},void 0)},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:444,columnNumber:21},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:393,columnNumber:17},void 0),ge.jsxDEV("div",{id:"chatjt-close-button",style:B,title:"Fechar painel","aria-label":"Fechar painel",onClick:()=>m(!1),onMouseEnter:tt=>{tt.currentTarget.style.transform="translateY(-50%) scale(1.1)",tt.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.2)"},onMouseLeave:tt=>{tt.currentTarget.style.transform="translateY(-50%)",tt.currentTarget.style.boxShadow=""},children:ge.jsxDEV("img",{src:i,alt:"Fechar painel",style:Q},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:467,columnNumber:21},void 0)},void 0,!1,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:452,columnNumber:17},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:359,columnNumber:13},void 0)]},void 0,!0,{fileName:"C:/Users/guilherme.moreira/git/corisco/src/ui/ExtensionPanel.tsx",lineNumber:338,columnNumber:9},void 0)},It=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ce=globalThis,ba="10.8.0";function Gc(){return Vc(ce),ce}function Vc(l){const t=l.__SENTRY__=l.__SENTRY__||{};return t.version=t.version||ba,t[ba]=t[ba]||{}}function Bo(l,t,i=ce){const a=i.__SENTRY__=i.__SENTRY__||{},r=a[ba]=a[ba]||{};return r[l]||(r[l]=t())}const y1=["debug","info","warn","error","log","assert","trace"],b1="Sentry Logger ",qc={};function gr(l){if(!("console"in ce))return l();const t=ce.console,i={},a=Object.keys(qc);a.forEach(r=>{const c=qc[r];i[r]=t[r],t[r]=c});try{return l()}finally{a.forEach(r=>{t[r]=i[r]})}}function v1(){jh().enabled=!0}function S1(){jh().enabled=!1}function nb(){return jh().enabled}function E1(...l){Fh("log",...l)}function A1(...l){Fh("warn",...l)}function _1(...l){Fh("error",...l)}function Fh(l,...t){It&&nb()&&gr(()=>{ce.console[l](`${b1}[${l}]:`,...t)})}function jh(){return It?Bo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const _t={enable:v1,disable:S1,isEnabled:nb,log:E1,warn:A1,error:_1},ib=50,va="?",sb=/\(error: (.*)\)/,ab=/captureMessage|captureException/;function rb(...l){const t=l.sort((i,a)=>i[0]-a[0]).map(i=>i[1]);return(i,a=0,r=0)=>{const c=[],u=i.split(`
280
+ `);for(let h=a;h<u.length;h++){let p=u[h];p.length>1024&&(p=p.slice(0,1024));const m=sb.test(p)?p.replace(sb,"$1"):p;if(!m.match(/\S*Error: /)){for(const g of t){const y=g(m);if(y){c.push(y);break}}if(c.length>=ib+r)break}}return w1(c.slice(r))}}function T1(l){return Array.isArray(l)?rb(...l):l}function w1(l){if(!l.length)return[];const t=Array.from(l);return/sentryWrapped/.test(Yc(t).function||"")&&t.pop(),t.reverse(),ab.test(Yc(t).function||"")&&(t.pop(),ab.test(Yc(t).function||"")&&t.pop()),t.slice(0,ib).map(i=>({...i,filename:i.filename||Yc(t).filename,function:i.function||va}))}function Yc(l){return l[l.length-1]||{}}const $h="<anonymous>";function Ms(l){try{return!l||typeof l!="function"?$h:l.name||$h}catch{return $h}}function ob(l){const t=l.exception;if(t){const i=[];try{return t.values.forEach(a=>{a.stacktrace.frames&&i.push(...a.stacktrace.frames)}),i}catch{return}}}const Xc={},lb={};function Wc(l,t){Xc[l]=Xc[l]||[],Xc[l].push(t)}function Qc(l,t){if(!lb[l]){lb[l]=!0;try{t()}catch(i){It&&_t.error(`Error while instrumenting ${l}`,i)}}}function yr(l,t){const i=l&&Xc[l];if(i)for(const a of i)try{a(t)}catch(r){It&&_t.error(`Error while triggering instrumentation handler.
281
+ Type: ${l}
282
+ Name: ${Ms(a)}
283
+ Error:`,r)}}let Gh=null;function C1(l){const t="error";Wc(t,l),Qc(t,x1)}function x1(){Gh=ce.onerror,ce.onerror=function(l,t,i,a,r){return yr("error",{column:a,error:r,line:i,msg:l,url:t}),Gh?Gh.apply(this,arguments):!1},ce.onerror.__SENTRY_INSTRUMENTED__=!0}let Vh=null;function R1(l){const t="unhandledrejection";Wc(t,l),Qc(t,D1)}function D1(){Vh=ce.onunhandledrejection,ce.onunhandledrejection=function(l){return yr("unhandledrejection",l),Vh?Vh.apply(this,arguments):!0},ce.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const cb=Object.prototype.toString;function qh(l){switch(cb.call(l)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Os(l,Error)}}function br(l,t){return cb.call(l)===`[object ${t}]`}function ub(l){return br(l,"ErrorEvent")}function db(l){return br(l,"DOMError")}function M1(l){return br(l,"DOMException")}function Fo(l){return br(l,"String")}function Yh(l){return typeof l=="object"&&l!==null&&"__sentry_template_string__"in l&&"__sentry_template_values__"in l}function Xh(l){return l===null||Yh(l)||typeof l!="object"&&typeof l!="function"}function jo(l){return br(l,"Object")}function Kc(l){return typeof Event<"u"&&Os(l,Event)}function O1(l){return typeof Element<"u"&&Os(l,Element)}function k1(l){return br(l,"RegExp")}function Zc(l){return!!(l?.then&&typeof l.then=="function")}function N1(l){return jo(l)&&"nativeEvent"in l&&"preventDefault"in l&&"stopPropagation"in l}function Os(l,t){try{return l instanceof t}catch{return!1}}function hb(l){return!!(typeof l=="object"&&l!==null&&(l.__isVue||l._isVue))}function L1(l){return typeof Request<"u"&&Os(l,Request)}const Wh=ce,I1=80;function fb(l,t={}){if(!l)return"<unknown>";try{let i=l;const a=5,r=[];let c=0,u=0;const h=" > ",p=h.length;let m;const g=Array.isArray(t)?t:t.keyAttrs,y=!Array.isArray(t)&&t.maxStringLength||I1;for(;i&&c++<a&&(m=P1(i,g),!(m==="html"||c>1&&u+r.length*p+m.length>=y));)r.push(m),u+=m.length,i=i.parentNode;return r.reverse().join(h)}catch{return"<unknown>"}}function P1(l,t){const i=l,a=[];if(!i?.tagName)return"";if(Wh.HTMLElement&&i instanceof HTMLElement&&i.dataset){if(i.dataset.sentryComponent)return i.dataset.sentryComponent;if(i.dataset.sentryElement)return i.dataset.sentryElement}a.push(i.tagName.toLowerCase());const r=t?.length?t.filter(u=>i.getAttribute(u)).map(u=>[u,i.getAttribute(u)]):null;if(r?.length)r.forEach(u=>{a.push(`[${u[0]}="${u[1]}"]`)});else{i.id&&a.push(`#${i.id}`);const u=i.className;if(u&&Fo(u)){const h=u.split(/\s+/);for(const p of h)a.push(`.${p}`)}}const c=["aria-label","type","name","title","alt"];for(const u of c){const h=i.getAttribute(u);h&&a.push(`[${u}="${h}"]`)}return a.join("")}function Qh(){try{return Wh.document.location.href}catch{return""}}function U1(l){if(!Wh.HTMLElement)return null;let t=l;const i=5;for(let a=0;a<i;a++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function Jc(l,t=0){return typeof l!="string"||t===0||l.length<=t?l:`${l.slice(0,t)}...`}function pb(l,t){if(!Array.isArray(l))return"";const i=[];for(let a=0;a<l.length;a++){const r=l[a];try{hb(r)?i.push("[VueViewModel]"):i.push(String(r))}catch{i.push("[value cannot be serialized]")}}return i.join(t)}function tu(l,t,i=!1){return Fo(l)?k1(t)?t.test(l):Fo(t)?i?l===t:l.includes(t):!1:!1}function eu(l,t=[],i=!1){return t.some(a=>tu(l,a,i))}function Zi(l,t,i){if(!(t in l))return;const a=l[t];if(typeof a!="function")return;const r=i(a);typeof r=="function"&&mb(r,a);try{l[t]=r}catch{It&&_t.log(`Failed to replace method "${t}" in object`,l)}}function $o(l,t,i){try{Object.defineProperty(l,t,{value:i,writable:!0,configurable:!0})}catch{It&&_t.log(`Failed to add non-enumerable property "${t}" to object`,l)}}function mb(l,t){try{const i=t.prototype||{};l.prototype=t.prototype=i,$o(l,"__sentry_original__",t)}catch{}}function Kh(l){return l.__sentry_original__}function gb(l){if(qh(l))return{message:l.message,name:l.name,stack:l.stack,...bb(l)};if(Kc(l)){const t={type:l.type,target:yb(l.target),currentTarget:yb(l.currentTarget),...bb(l)};return typeof CustomEvent<"u"&&Os(l,CustomEvent)&&(t.detail=l.detail),t}else return l}function yb(l){try{return O1(l)?fb(l):Object.prototype.toString.call(l)}catch{return"<unknown>"}}function bb(l){if(typeof l=="object"&&l!==null){const t={};for(const i in l)Object.prototype.hasOwnProperty.call(l,i)&&(t[i]=l[i]);return t}else return{}}function z1(l,t=40){const i=Object.keys(gb(l));i.sort();const a=i[0];if(!a)return"[object has no keys]";if(a.length>=t)return Jc(a,t);for(let r=i.length;r>0;r--){const c=i.slice(0,r).join(", ");if(!(c.length>t))return r===i.length?c:Jc(c,t)}return""}function H1(){const l=ce;return l.crypto||l.msCrypto}function pi(l=H1()){let t=()=>Math.random()*16;try{if(l?.randomUUID)return l.randomUUID().replace(/-/g,"");l?.getRandomValues&&(t=()=>{const i=new Uint8Array(1);return l.getRandomValues(i),i[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,i=>(i^(t()&15)>>i/4).toString(16))}function vb(l){return l.exception?.values?.[0]}function Sa(l){const{message:t,event_id:i}=l;if(t)return t;const a=vb(l);return a?a.type&&a.value?`${a.type}: ${a.value}`:a.type||a.value||i||"<unknown>":i||"<unknown>"}function Zh(l,t,i){const a=l.exception=l.exception||{},r=a.values=a.values||[],c=r[0]=r[0]||{};c.value||(c.value=t||""),c.type||(c.type="Error")}function vr(l,t){const i=vb(l);if(!i)return;const a={type:"generic",handled:!0},r=i.mechanism;if(i.mechanism={...a,...r,...t},t&&"data"in t){const c={...r?.data,...t.data};i.mechanism.data=c}}function Sb(l){if(B1(l))return!0;try{$o(l,"__sentry_captured__",!0)}catch{}return!1}function B1(l){try{return l.__sentry_captured__}catch{}}const Eb=1e3;function Go(){return Date.now()/Eb}function F1(){const{performance:l}=ce;if(!l?.now||!l.timeOrigin)return Go;const t=l.timeOrigin;return()=>(t+l.now())/Eb}let Ab;function Sr(){return(Ab??(Ab=F1()))()}function j1(l){const t=Sr(),i={sid:pi(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>G1(i)};return l&&Er(i,l),i}function Er(l,t={}){if(t.user&&(!l.ipAddress&&t.user.ip_address&&(l.ipAddress=t.user.ip_address),!l.did&&!t.did&&(l.did=t.user.id||t.user.email||t.user.username)),l.timestamp=t.timestamp||Sr(),t.abnormal_mechanism&&(l.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(l.ignoreDuration=t.ignoreDuration),t.sid&&(l.sid=t.sid.length===32?t.sid:pi()),t.init!==void 0&&(l.init=t.init),!l.did&&t.did&&(l.did=`${t.did}`),typeof t.started=="number"&&(l.started=t.started),l.ignoreDuration)l.duration=void 0;else if(typeof t.duration=="number")l.duration=t.duration;else{const i=l.timestamp-l.started;l.duration=i>=0?i:0}t.release&&(l.release=t.release),t.environment&&(l.environment=t.environment),!l.ipAddress&&t.ipAddress&&(l.ipAddress=t.ipAddress),!l.userAgent&&t.userAgent&&(l.userAgent=t.userAgent),typeof t.errors=="number"&&(l.errors=t.errors),t.status&&(l.status=t.status)}function $1(l,t){let i={};l.status==="ok"&&(i={status:"exited"}),Er(l,i)}function G1(l){return{sid:`${l.sid}`,init:l.init,started:new Date(l.started*1e3).toISOString(),timestamp:new Date(l.timestamp*1e3).toISOString(),status:l.status,errors:l.errors,did:typeof l.did=="number"||typeof l.did=="string"?`${l.did}`:void 0,duration:l.duration,abnormal_mechanism:l.abnormal_mechanism,attrs:{release:l.release,environment:l.environment,ip_address:l.ipAddress,user_agent:l.userAgent}}}function Vo(l,t,i=2){if(!t||typeof t!="object"||i<=0)return t;if(l&&Object.keys(t).length===0)return l;const a={...l};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=Vo(a[r],t[r],i-1));return a}function _b(){return pi()}function Tb(){return pi().substring(16)}const Jh="_sentrySpan";function wb(l,t){t?$o(l,Jh,t):delete l[Jh]}function Cb(l){return l[Jh]}const V1=100;class xi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:_b(),sampleRand:Math.random()}}clone(){const t=new xi;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,wb(t,Cb(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Er(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,i){return this._tags={...this._tags,[t]:i},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,i){return this._extra={...this._extra,[t]:i},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,i){return i===null?delete this._contexts[t]:this._contexts[t]=i,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const i=typeof t=="function"?t(this):t,a=i instanceof xi?i.getScopeData():jo(i)?t:void 0,{tags:r,extra:c,user:u,contexts:h,level:p,fingerprint:m=[],propagationContext:g}=a||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...c},this._contexts={...this._contexts,...h},u&&Object.keys(u).length&&(this._user=u),p&&(this._level=p),m.length&&(this._fingerprint=m),g&&(this._propagationContext=g),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,wb(this,void 0),this._attachments=[],this.setPropagationContext({traceId:_b(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,i){const a=typeof i=="number"?i:V1;if(a<=0)return this;const r={timestamp:Go(),...t,message:t.message?Jc(t.message,2048):t.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>a&&(this._breadcrumbs=this._breadcrumbs.slice(-a),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Cb(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,i){const a=i?.event_id||pi();if(!this._client)return It&&_t.warn("No client configured on scope - will not capture exception!"),a;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...i,event_id:a},this),a}captureMessage(t,i,a){const r=a?.event_id||pi();if(!this._client)return It&&_t.warn("No client configured on scope - will not capture message!"),r;const c=new Error(t);return this._client.captureMessage(t,i,{originalException:t,syntheticException:c,...a,event_id:r},this),r}captureEvent(t,i){const a=i?.event_id||pi();return this._client?(this._client.captureEvent(t,{...i,event_id:a},this),a):(It&&_t.warn("No client configured on scope - will not capture event!"),a)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function q1(){return Bo("defaultCurrentScope",()=>new xi)}function Y1(){return Bo("defaultIsolationScope",()=>new xi)}class X1{constructor(t,i){let a;t?a=t:a=new xi;let r;i?r=i:r=new xi,this._stack=[{scope:a}],this._isolationScope=r}withScope(t){const i=this._pushScope();let a;try{a=t(i)}catch(r){throw this._popScope(),r}return Zc(a)?a.then(r=>(this._popScope(),r),r=>{throw this._popScope(),r}):(this._popScope(),a)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Ar(){const l=Gc(),t=Vc(l);return t.stack=t.stack||new X1(q1(),Y1())}function W1(l){return Ar().withScope(l)}function Q1(l,t){const i=Ar();return i.withScope(()=>(i.getStackTop().scope=l,t(l)))}function xb(l){return Ar().withScope(()=>l(Ar().getIsolationScope()))}function K1(){return{withIsolationScope:xb,withScope:W1,withSetScope:Q1,withSetIsolationScope:(l,t)=>xb(t),getCurrentScope:()=>Ar().getScope(),getIsolationScope:()=>Ar().getIsolationScope()}}function tf(l){const t=Vc(l);return t.acs?t.acs:K1()}function ks(){const l=Gc();return tf(l).getCurrentScope()}function qo(){const l=Gc();return tf(l).getIsolationScope()}function Z1(){return Bo("globalScope",()=>new xi)}function J1(...l){const t=Gc(),i=tf(t);if(l.length===2){const[a,r]=l;return a?i.withSetScope(a,r):i.withScope(r)}return i.withScope(l[0])}function cn(){return ks().getClient()}function tC(l){const t=l.getPropagationContext(),{traceId:i,parentSpanId:a,propagationSpanId:r}=t,c={trace_id:i,span_id:r||Tb()};return a&&(c.parent_span_id=a),c}const eC="sentry.source",nC="sentry.sample_rate",iC="sentry.previous_trace_sample_rate",sC="sentry.op",aC="sentry.origin",Rb="sentry.profile_id",Db="sentry.exclusive_time",rC=0,oC=1,lC="_sentryScope",cC="_sentryIsolationScope";function Mb(l){return{scope:l[lC],isolationScope:l[cC]}}const uC="sentry-",dC=/^sentry-/;function hC(l){const t=fC(l);if(!t)return;const i=Object.entries(t).reduce((a,[r,c])=>{if(r.match(dC)){const u=r.slice(uC.length);a[u]=c}return a},{});if(Object.keys(i).length>0)return i}function fC(l){if(!(!l||!Fo(l)&&!Array.isArray(l)))return Array.isArray(l)?l.reduce((t,i)=>{const a=Ob(i);return Object.entries(a).forEach(([r,c])=>{t[r]=c}),t},{}):Ob(l)}function Ob(l){return l.split(",").map(t=>t.split("=").map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})).reduce((t,[i,a])=>(i&&a&&(t[i]=a),t),{})}const pC=/^o(\d+)\./,mC=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gC(l){return l==="http"||l==="https"}function nu(l,t=!1){const{host:i,path:a,pass:r,port:c,projectId:u,protocol:h,publicKey:p}=l;return`${h}://${p}${t&&r?`:${r}`:""}@${i}${c?`:${c}`:""}/${a&&`${a}/`}${u}`}function yC(l){const t=mC.exec(l);if(!t){gr(()=>{console.error(`Invalid Sentry Dsn: ${l}`)});return}const[i,a,r="",c="",u="",h=""]=t.slice(1);let p="",m=h;const g=m.split("/");if(g.length>1&&(p=g.slice(0,-1).join("/"),m=g.pop()),m){const y=m.match(/^\d+/);y&&(m=y[0])}return kb({host:c,pass:r,path:p,projectId:m,port:u,protocol:i,publicKey:a})}function kb(l){return{protocol:l.protocol,publicKey:l.publicKey||"",pass:l.pass||"",host:l.host,port:l.port||"",path:l.path||"",projectId:l.projectId}}function bC(l){if(!It)return!0;const{port:t,projectId:i,protocol:a}=l;return["protocol","publicKey","host","projectId"].find(u=>l[u]?!1:(_t.error(`Invalid Sentry Dsn: ${u} missing`),!0))?!1:i.match(/^\d+$/)?gC(a)?t&&isNaN(parseInt(t,10))?(_t.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(_t.error(`Invalid Sentry Dsn: Invalid protocol ${a}`),!1):(_t.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),!1)}function vC(l){return l.match(pC)?.[1]}function SC(l){const t=l.getOptions(),{host:i}=l.getDsn()||{};let a;return t.orgId?a=String(t.orgId):i&&(a=vC(i)),a}function EC(l){const t=typeof l=="string"?yC(l):kb(l);if(!(!t||!bC(t)))return t}function AC(l){if(typeof l=="boolean")return Number(l);const t=typeof l=="string"?parseFloat(l):l;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Nb=1;let Lb=!1;function _C(l){const{spanId:t,traceId:i,isRemote:a}=l.spanContext(),r=a?t:ef(l).parent_span_id,c=Mb(l).scope,u=a?c?.getPropagationContext().propagationSpanId||Tb():t;return{parent_span_id:r,span_id:u,trace_id:i}}function TC(l){if(l&&l.length>0)return l.map(({context:{spanId:t,traceId:i,traceFlags:a,...r},attributes:c})=>({span_id:t,trace_id:i,sampled:a===Nb,attributes:c,...r}))}function Ib(l){return typeof l=="number"?Pb(l):Array.isArray(l)?l[0]+l[1]/1e9:l instanceof Date?Pb(l.getTime()):Sr()}function Pb(l){return l>9999999999?l/1e3:l}function ef(l){if(CC(l))return l.getSpanJSON();const{spanId:t,traceId:i}=l.spanContext();if(wC(l)){const{attributes:a,startTime:r,name:c,endTime:u,status:h,links:p}=l,m="parentSpanId"in l?l.parentSpanId:"parentSpanContext"in l?l.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:i,data:a,description:c,parent_span_id:m,start_timestamp:Ib(r),timestamp:Ib(u)||void 0,status:RC(h),op:a[sC],origin:a[aC],links:TC(p)}}return{span_id:t,trace_id:i,start_timestamp:0,data:{}}}function wC(l){const t=l;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function CC(l){return typeof l.getSpanJSON=="function"}function xC(l){const{traceFlags:t}=l.spanContext();return t===Nb}function RC(l){if(!(!l||l.code===rC))return l.code===oC?"ok":l.message||"unknown_error"}const DC="_sentryRootSpan";function Ub(l){return l[DC]||l}function zb(){Lb||(gr(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Lb=!0)}function MC(l){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=cn()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}const nf="production",OC="_frozenDsc";function Hb(l,t){const i=t.getOptions(),{publicKey:a}=t.getDsn()||{},r={environment:i.environment||nf,release:i.release,public_key:a,trace_id:l,org_id:SC(t)};return t.emit("createDsc",r),r}function kC(l,t){const i=t.getPropagationContext();return i.dsc||Hb(i.traceId,l)}function NC(l){const t=cn();if(!t)return{};const i=Ub(l),a=ef(i),r=a.data,c=i.spanContext().traceState,u=c?.get("sentry.sample_rate")??r[nC]??r[iC];function h(A){return(typeof u=="number"||typeof u=="string")&&(A.sample_rate=`${u}`),A}const p=i[OC];if(p)return h(p);const m=c?.get("sentry.dsc"),g=m&&hC(m);if(g)return h(g);const y=Hb(l.spanContext().traceId,t),b=r[eC],S=a.description;return b!=="url"&&S&&(y.transaction=S),MC()&&(y.sampled=String(xC(i)),y.sample_rand=c?.get("sentry.sample_rand")??Mb(i).scope?.getPropagationContext().sampleRand.toString()),h(y),t.emit("createDsc",y,i),y}function Ji(l,t=100,i=1/0){try{return sf("",l,t,i)}catch(a){return{ERROR:`**non-serializable** (${a})`}}}function Bb(l,t=3,i=100*1024){const a=Ji(l,t);return UC(a)>i?Bb(l,t-1,i):a}function sf(l,t,i=1/0,a=1/0,r=zC()){const[c,u]=r;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const h=LC(l,t);if(!h.startsWith("[object "))return h;if(t.__sentry_skip_normalization__)return t;const p=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:i;if(p===0)return h.replace("object ","");if(c(t))return"[Circular ~]";const m=t;if(m&&typeof m.toJSON=="function")try{const S=m.toJSON();return sf("",S,p-1,a,r)}catch{}const g=Array.isArray(t)?[]:{};let y=0;const b=gb(t);for(const S in b){if(!Object.prototype.hasOwnProperty.call(b,S))continue;if(y>=a){g[S]="[MaxProperties ~]";break}const A=b[S];g[S]=sf(S,A,p-1,a,r),y++}return u(t),g}function LC(l,t){try{if(l==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(l==="domainEmitter")return"[DomainEmitter]";if(typeof globalThis<"u"&&t===globalThis)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(hb(t))return"[VueViewModel]";if(N1(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ms(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const i=IC(t);return/^HTML(\w*)Element$/.test(i)?`[HTMLElement: ${i}]`:`[object ${i}]`}catch(i){return`**non-serializable** (${i})`}}function IC(l){const t=Object.getPrototypeOf(l);return t?.constructor?t.constructor.name:"null prototype"}function PC(l){return~-encodeURI(l).split(/%..|./).length}function UC(l){return PC(JSON.stringify(l))}function zC(){const l=new WeakSet;function t(a){return l.has(a)?!0:(l.add(a),!1)}function i(a){l.delete(a)}return[t,i]}function Yo(l,t=[]){return[l,t]}function HC(l,t){const[i,a]=l;return[i,[...a,t]]}function Fb(l,t){const i=l[1];for(const a of i){const r=a[0].type;if(t(a,r))return!0}return!1}function af(l){const t=Vc(ce);return t.encodePolyfill?t.encodePolyfill(l):new TextEncoder().encode(l)}function BC(l){const[t,i]=l;let a=JSON.stringify(t);function r(c){typeof a=="string"?a=typeof c=="string"?a+c:[af(a),c]:a.push(typeof c=="string"?af(c):c)}for(const c of i){const[u,h]=c;if(r(`
284
+ ${JSON.stringify(u)}
285
+ `),typeof h=="string"||h instanceof Uint8Array)r(h);else{let p;try{p=JSON.stringify(h)}catch{p=JSON.stringify(Ji(h))}r(p)}}return typeof a=="string"?a:FC(a)}function FC(l){const t=l.reduce((r,c)=>r+c.length,0),i=new Uint8Array(t);let a=0;for(const r of l)i.set(r,a),a+=r.length;return i}function jC(l){const t=typeof l.data=="string"?af(l.data):l.data;return[{type:"attachment",length:t.length,filename:l.filename,content_type:l.contentType,attachment_type:l.attachmentType},t]}const $C={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function jb(l){return $C[l]}function $b(l){if(!l?.sdk)return;const{name:t,version:i}=l.sdk;return{name:t,version:i}}function GC(l,t,i,a){const r=l.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:l.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!i&&a&&{dsn:nu(a)},...r&&{trace:r}}}function Gb(l,t){if(!t?.length||!l.description)return!1;for(const i of t){if(qC(i)){if(tu(l.description,i))return!0;continue}if(!i.name&&!i.op)continue;const a=i.name?tu(l.description,i.name):!0,r=i.op?l.op&&tu(l.op,i.op):!0;if(a&&r)return!0}return!1}function VC(l,t){const i=t.parent_span_id,a=t.span_id;if(i)for(const r of l)r.parent_span_id===a&&(r.parent_span_id=i)}function qC(l){return typeof l=="string"||l instanceof RegExp}function YC(l,t){if(!t)return l;const i=l.sdk||{};return l.sdk={...i,name:i.name||t.name,version:i.version||t.version,integrations:[...l.sdk?.integrations||[],...t.integrations||[]],packages:[...l.sdk?.packages||[],...t.packages||[]],settings:l.sdk?.settings||t.settings?{...l.sdk?.settings,...t.settings}:void 0},l}function XC(l,t,i,a){const r=$b(i),c={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!a&&t&&{dsn:nu(t)}},u="aggregates"in l?[{type:"sessions"},l]:[{type:"session"},l.toJSON()];return Yo(c,[u])}function WC(l,t,i,a){const r=$b(i),c=l.type&&l.type!=="replay_event"?l.type:"event";YC(l,i?.sdk);const u=GC(l,r,a,t);return delete l.sdkProcessingMetadata,Yo(u,[[{type:c},l]])}const rf=0,Vb=1,qb=2;function Ea(l){return new Ns(t=>{t(l)})}function iu(l){return new Ns((t,i)=>{i(l)})}class Ns{constructor(t){this._state=rf,this._handlers=[],this._runExecutor(t)}then(t,i){return new Ns((a,r)=>{this._handlers.push([!1,c=>{if(!t)a(c);else try{a(t(c))}catch(u){r(u)}},c=>{if(!i)r(c);else try{a(i(c))}catch(u){r(u)}}]),this._executeHandlers()})}catch(t){return this.then(i=>i,t)}finally(t){return new Ns((i,a)=>{let r,c;return this.then(u=>{c=!1,r=u,t&&t()},u=>{c=!0,r=u,t&&t()}).then(()=>{if(c){a(r);return}i(r)})})}_executeHandlers(){if(this._state===rf)return;const t=this._handlers.slice();this._handlers=[],t.forEach(i=>{i[0]||(this._state===Vb&&i[1](this._value),this._state===qb&&i[2](this._value),i[0]=!0)})}_runExecutor(t){const i=(c,u)=>{if(this._state===rf){if(Zc(u)){u.then(a,r);return}this._state=c,this._value=u,this._executeHandlers()}},a=c=>{i(Vb,c)},r=c=>{i(qb,c)};try{t(a,r)}catch(c){r(c)}}}function of(l,t,i,a=0){return new Ns((r,c)=>{const u=l[a];if(t===null||typeof u!="function")r(t);else{const h=u({...t},i);It&&u.id&&h===null&&_t.log(`Event processor "${u.id}" dropped event`),Zc(h)?h.then(p=>of(l,p,i,a+1).then(r)).then(null,c):of(l,h,i,a+1).then(r).then(null,c)}})}function QC(l,t){const{fingerprint:i,span:a,breadcrumbs:r,sdkProcessingMetadata:c}=t;KC(l,t),a&&tx(l,a),ex(l,i),ZC(l,r),JC(l,c)}function Yb(l,t){const{extra:i,tags:a,user:r,contexts:c,level:u,sdkProcessingMetadata:h,breadcrumbs:p,fingerprint:m,eventProcessors:g,attachments:y,propagationContext:b,transactionName:S,span:A}=t;su(l,"extra",i),su(l,"tags",a),su(l,"user",r),su(l,"contexts",c),l.sdkProcessingMetadata=Vo(l.sdkProcessingMetadata,h,2),u&&(l.level=u),S&&(l.transactionName=S),A&&(l.span=A),p.length&&(l.breadcrumbs=[...l.breadcrumbs,...p]),m.length&&(l.fingerprint=[...l.fingerprint,...m]),g.length&&(l.eventProcessors=[...l.eventProcessors,...g]),y.length&&(l.attachments=[...l.attachments,...y]),l.propagationContext={...l.propagationContext,...b}}function su(l,t,i){l[t]=Vo(l[t],i,1)}function KC(l,t){const{extra:i,tags:a,user:r,contexts:c,level:u,transactionName:h}=t;Object.keys(i).length&&(l.extra={...i,...l.extra}),Object.keys(a).length&&(l.tags={...a,...l.tags}),Object.keys(r).length&&(l.user={...r,...l.user}),Object.keys(c).length&&(l.contexts={...c,...l.contexts}),u&&(l.level=u),h&&l.type!=="transaction"&&(l.transaction=h)}function ZC(l,t){const i=[...l.breadcrumbs||[],...t];l.breadcrumbs=i.length?i:void 0}function JC(l,t){l.sdkProcessingMetadata={...l.sdkProcessingMetadata,...t}}function tx(l,t){l.contexts={trace:_C(t),...l.contexts},l.sdkProcessingMetadata={dynamicSamplingContext:NC(t),...l.sdkProcessingMetadata};const i=Ub(t),a=ef(i).description;a&&!l.transaction&&l.type==="transaction"&&(l.transaction=a)}function ex(l,t){l.fingerprint=l.fingerprint?Array.isArray(l.fingerprint)?l.fingerprint:[l.fingerprint]:[],t&&(l.fingerprint=l.fingerprint.concat(t)),l.fingerprint.length||delete l.fingerprint}let au,Xb,ru;function nx(l){const t=ce._sentryDebugIds;if(!t)return{};const i=Object.keys(t);return ru&&i.length===Xb||(Xb=i.length,ru=i.reduce((a,r)=>{au||(au={});const c=au[r];if(c)a[c[0]]=c[1];else{const u=l(r);for(let h=u.length-1;h>=0;h--){const m=u[h]?.filename,g=t[r];if(m&&g){a[m]=g,au[r]=[m,g];break}}}return a},{})),ru}function ix(l,t,i,a,r,c){const{normalizeDepth:u=3,normalizeMaxBreadth:h=1e3}=l,p={...t,event_id:t.event_id||i.event_id||pi(),timestamp:t.timestamp||Go()},m=i.integrations||l.integrations.map(R=>R.name);sx(p,l),ox(p,m),r&&r.emit("applyFrameMetadata",t),t.type===void 0&&ax(p,l.stackParser);const g=cx(a,i.captureContext);i.mechanism&&vr(p,i.mechanism);const y=r?r.getEventProcessors():[],b=Z1().getScopeData();if(c){const R=c.getScopeData();Yb(b,R)}if(g){const R=g.getScopeData();Yb(b,R)}const S=[...i.attachments||[],...b.attachments];S.length&&(i.attachments=S),QC(p,b);const A=[...y,...b.eventProcessors];return of(A,p,i).then(R=>(R&&rx(R),typeof u=="number"&&u>0?lx(R,u,h):R))}function sx(l,t){const{environment:i,release:a,dist:r,maxValueLength:c=250}=t;l.environment=l.environment||i||nf,!l.release&&a&&(l.release=a),!l.dist&&r&&(l.dist=r);const u=l.request;u?.url&&(u.url=Jc(u.url,c))}function ax(l,t){const i=nx(t);l.exception?.values?.forEach(a=>{a.stacktrace?.frames?.forEach(r=>{r.filename&&(r.debug_id=i[r.filename])})})}function rx(l){const t={};if(l.exception?.values?.forEach(a=>{a.stacktrace?.frames?.forEach(r=>{r.debug_id&&(r.abs_path?t[r.abs_path]=r.debug_id:r.filename&&(t[r.filename]=r.debug_id),delete r.debug_id)})}),Object.keys(t).length===0)return;l.debug_meta=l.debug_meta||{},l.debug_meta.images=l.debug_meta.images||[];const i=l.debug_meta.images;Object.entries(t).forEach(([a,r])=>{i.push({type:"sourcemap",code_file:a,debug_id:r})})}function ox(l,t){t.length>0&&(l.sdk=l.sdk||{},l.sdk.integrations=[...l.sdk.integrations||[],...t])}function lx(l,t,i){if(!l)return null;const a={...l,...l.breadcrumbs&&{breadcrumbs:l.breadcrumbs.map(r=>({...r,...r.data&&{data:Ji(r.data,t,i)}}))},...l.user&&{user:Ji(l.user,t,i)},...l.contexts&&{contexts:Ji(l.contexts,t,i)},...l.extra&&{extra:Ji(l.extra,t,i)}};return l.contexts?.trace&&a.contexts&&(a.contexts.trace=l.contexts.trace,l.contexts.trace.data&&(a.contexts.trace.data=Ji(l.contexts.trace.data,t,i))),l.spans&&(a.spans=l.spans.map(r=>({...r,...r.data&&{data:Ji(r.data,t,i)}}))),l.contexts?.flags&&a.contexts&&(a.contexts.flags=Ji(l.contexts.flags,3,i)),a}function cx(l,t){if(!t)return l;const i=l?l.clone():new xi;return i.update(t),i}function ux(l){if(l)return dx(l)?{captureContext:l}:fx(l)?{captureContext:l}:l}function dx(l){return l instanceof xi||typeof l=="function"}const hx=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function fx(l){return Object.keys(l).some(t=>hx.includes(t))}function Wb(l,t){return ks().captureException(l,ux(t))}function Qb(l,t){return ks().captureEvent(l,t)}function Kb(l){const t=qo(),i=ks(),{userAgent:a}=ce.navigator||{},r=j1({user:i.getUser()||t.getUser(),...a&&{userAgent:a},...l}),c=t.getSession();return c?.status==="ok"&&Er(c,{status:"exited"}),Zb(),t.setSession(r),r}function Zb(){const l=qo(),i=ks().getSession()||l.getSession();i&&$1(i),Jb(),l.setSession()}function Jb(){const l=qo(),t=cn(),i=l.getSession();i&&t&&t.captureSession(i)}function tv(l=!1){if(l){Zb();return}Jb()}const px="7";function mx(l){const t=l.protocol?`${l.protocol}:`:"",i=l.port?`:${l.port}`:"";return`${t}//${l.host}${i}${l.path?`/${l.path}`:""}/api/`}function gx(l){return`${mx(l)}${l.projectId}/envelope/`}function yx(l,t){const i={sentry_version:px};return l.publicKey&&(i.sentry_key=l.publicKey),t&&(i.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(i).toString()}function bx(l,t,i){return t||`${gx(l)}?${yx(l,i)}`}const ev=[];function vx(l){const t={};return l.forEach(i=>{const{name:a}=i,r=t[a];r&&!r.isDefaultInstance&&i.isDefaultInstance||(t[a]=i)}),Object.values(t)}function Sx(l){const t=l.defaultIntegrations||[],i=l.integrations;t.forEach(r=>{r.isDefaultInstance=!0});let a;if(Array.isArray(i))a=[...t,...i];else if(typeof i=="function"){const r=i(t);a=Array.isArray(r)?r:[r]}else a=t;return vx(a)}function Ex(l,t){const i={};return t.forEach(a=>{a&&iv(l,a,i)}),i}function nv(l,t){for(const i of t)i?.afterAllSetup&&i.afterAllSetup(l)}function iv(l,t,i){if(i[t.name]){It&&_t.log(`Integration skipped because it was already installed: ${t.name}`);return}if(i[t.name]=t,ev.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),ev.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(l),typeof t.preprocessEvent=="function"){const a=t.preprocessEvent.bind(t);l.on("preprocessEvent",(r,c)=>a(r,c,l))}if(typeof t.processEvent=="function"){const a=t.processEvent.bind(t),r=Object.assign((c,u)=>a(c,u,l),{id:t.name});l.addEventProcessor(r)}It&&_t.log(`Integration installed: ${t.name}`)}function DI(l){return l}function Ax(l,t,i){const a=[{type:"client_report"},{timestamp:Go(),discarded_events:l}];return Yo(t?{dsn:t}:{},[a])}function sv(l){const t=[];l.message&&t.push(l.message);try{const i=l.exception.values[l.exception.values.length-1];i?.value&&(t.push(i.value),i.type&&t.push(`${i.type}: ${i.value}`))}catch{}return t}function _x(l){const{trace_id:t,parent_span_id:i,span_id:a,status:r,origin:c,data:u,op:h}=l.contexts?.trace??{};return{data:u??{},description:l.transaction,op:h,parent_span_id:i,span_id:a??"",start_timestamp:l.start_timestamp??0,status:r,timestamp:l.timestamp,trace_id:t??"",origin:c,profile_id:u?.[Rb],exclusive_time:u?.[Db],measurements:l.measurements,is_segment:!0}}function Tx(l){return{type:"transaction",timestamp:l.timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{[Rb]:l.profile_id},...l.exclusive_time&&{[Db]:l.exclusive_time}}}},measurements:l.measurements}}const av="Not capturing exception because it's already been captured.",rv="Discarded session because of missing or non-string release",ov=Symbol.for("SentryInternalError"),lv=Symbol.for("SentryDoNotSendEventError");function ou(l){return{message:l,[ov]:!0}}function lf(l){return{message:l,[lv]:!0}}function cv(l){return!!l&&typeof l=="object"&&ov in l}function uv(l){return!!l&&typeof l=="object"&&lv in l}class wx{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=EC(t.dsn):It&&_t.warn("No DSN provided, client will not send events."),this._dsn){const i=bx(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}}captureException(t,i,a){const r=pi();if(Sb(t))return It&&_t.log(av),r;const c={event_id:r,...i};return this._process(this.eventFromException(t,c).then(u=>this._captureEvent(u,c,a))),c.event_id}captureMessage(t,i,a,r){const c={event_id:pi(),...a},u=Yh(t)?t:String(t),h=Xh(t)?this.eventFromMessage(u,i,c):this.eventFromException(t,c);return this._process(h.then(p=>this._captureEvent(p,c,r))),c.event_id}captureEvent(t,i,a){const r=pi();if(i?.originalException&&Sb(i.originalException))return It&&_t.log(av),r;const c={event_id:r,...i},u=t.sdkProcessingMetadata||{},h=u.capturedSpanScope,p=u.capturedSpanIsolationScope;return this._process(this._captureEvent(t,c,h||a,p)),c.event_id}captureSession(t){this.sendSession(t),Er(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const i=this._transport;return i?(this.emit("flush"),this._isClientDoneProcessing(t).then(a=>i.flush(t).then(r=>a&&r))):Ea(!0)}close(t){return this.flush(t).then(i=>(this.getOptions().enabled=!1,this.emit("close"),i))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const i=this._integrations[t.name];iv(this,t,this._integrations),i||nv(this,[t])}sendEvent(t,i={}){this.emit("beforeSendEvent",t,i);let a=WC(t,this._dsn,this._options._metadata,this._options.tunnel);for(const c of i.attachments||[])a=HC(a,jC(c));const r=this.sendEnvelope(a);r&&r.then(c=>this.emit("afterSendEvent",t,c),null)}sendSession(t){const{release:i,environment:a=nf}=this._options;if("aggregates"in t){const c=t.attrs||{};if(!c.release&&!i){It&&_t.warn(rv);return}c.release=c.release||i,c.environment=c.environment||a,t.attrs=c}else{if(!t.release&&!i){It&&_t.warn(rv);return}t.release=t.release||i,t.environment=t.environment||a}this.emit("beforeSendSession",t);const r=XC(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(t,i,a=1){if(this._options.sendClientReports){const r=`${t}:${i}`;It&&_t.log(`Recording outcome: "${r}"${a>1?` (${a} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+a}}on(t,i){const a=this._hooks[t]=this._hooks[t]||[];return a.push(i),()=>{const r=a.indexOf(i);r>-1&&a.splice(r,1)}}emit(t,...i){const a=this._hooks[t];a&&a.forEach(r=>r(...i))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,i=>(It&&_t.error("Error while sending envelope:",i),i)):(It&&_t.error("Transport disabled"),Ea({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Ex(this,t),nv(this,t)}_updateSessionFromEvent(t,i){let a=i.level==="fatal",r=!1;const c=i.exception?.values;if(c){r=!0;for(const p of c)if(p.mechanism?.handled===!1){a=!0;break}}const u=t.status==="ok";(u&&t.errors===0||u&&a)&&(Er(t,{...a&&{status:"crashed"},errors:t.errors||Number(r||a)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Ns(i=>{let a=0;const r=1,c=setInterval(()=>{this._numProcessing==0?(clearInterval(c),i(!0)):(a+=r,t&&a>=t&&(clearInterval(c),i(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,i,a,r){const c=this.getOptions(),u=Object.keys(this._integrations);return!i.integrations&&u?.length&&(i.integrations=u),this.emit("preprocessEvent",t,i),t.type||r.setLastEventId(t.event_id||i.event_id),ix(c,t,i,a,this,r).then(h=>{if(h===null)return h;this.emit("postprocessEvent",h,i),h.contexts={trace:tC(a),...h.contexts};const p=kC(this,a);return h.sdkProcessingMetadata={dynamicSamplingContext:p,...h.sdkProcessingMetadata},h})}_captureEvent(t,i={},a=ks(),r=qo()){return It&&cf(t)&&_t.log(`Captured error event \`${sv(t)[0]||"<unknown>"}\``),this._processEvent(t,i,a,r).then(c=>c.event_id,c=>{It&&(uv(c)?_t.log(c.message):cv(c)?_t.warn(c.message):_t.warn(c))})}_processEvent(t,i,a,r){const c=this.getOptions(),{sampleRate:u}=c,h=dv(t),p=cf(t),m=t.type||"error",g=`before send for type \`${m}\``,y=typeof u>"u"?void 0:AC(u);if(p&&typeof y=="number"&&Math.random()>y)return this.recordDroppedEvent("sample_rate","error"),iu(lf(`Discarding event because it's not included in the random sample (sampling rate = ${u})`));const b=m==="replay_event"?"replay":m;return this._prepareEvent(t,i,a,r).then(S=>{if(S===null)throw this.recordDroppedEvent("event_processor",b),lf("An event processor returned `null`, will not send event.");if(i.data&&i.data.__sentry__===!0)return S;const _=xx(this,c,S,i);return Cx(_,g)}).then(S=>{if(S===null){if(this.recordDroppedEvent("before_send",b),h){const C=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",C)}throw lf(`${g} returned \`null\`, will not send event.`)}const A=a.getSession()||r.getSession();if(p&&A&&this._updateSessionFromEvent(A,S),h){const R=S.sdkProcessingMetadata?.spanCountBeforeProcessing||0,C=S.spans?S.spans.length:0,N=R-C;N>0&&this.recordDroppedEvent("before_send","span",N)}const _=S.transaction_info;if(h&&_&&S.transaction!==t.transaction){const R="custom";S.transaction_info={..._,source:R}}return this.sendEvent(S,i),S}).then(null,S=>{throw uv(S)||cv(S)?S:(this.captureException(S,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:S}),ou(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
286
+ Reason: ${S}`))})}_process(t){this._numProcessing++,t.then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([i,a])=>{const[r,c]=i.split(":");return{reason:r,category:c,quantity:a}})}_flushOutcomes(){It&&_t.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){It&&_t.log("No outcomes to send");return}if(!this._dsn){It&&_t.log("No dsn provided, will not send outcomes");return}It&&_t.log("Sending outcomes:",t);const i=Ax(t,this._options.tunnel&&nu(this._dsn));this.sendEnvelope(i)}}function Cx(l,t){const i=`${t} must return \`null\` or a valid event.`;if(Zc(l))return l.then(a=>{if(!jo(a)&&a!==null)throw ou(i);return a},a=>{throw ou(`${t} rejected with ${a}`)});if(!jo(l)&&l!==null)throw ou(i);return l}function xx(l,t,i,a){const{beforeSend:r,beforeSendTransaction:c,beforeSendSpan:u,ignoreSpans:h}=t;let p=i;if(cf(p)&&r)return r(p,a);if(dv(p)){if(u||h){const m=_x(p);if(h?.length&&Gb(m,h))return null;if(u){const g=u(m);g?p=Vo(i,Tx(g)):zb()}if(p.spans){const g=[],y=p.spans;for(const S of y){if(h?.length&&Gb(S,h)){VC(y,S);continue}if(u){const A=u(S);A?g.push(A):(zb(),g.push(S))}else g.push(S)}const b=p.spans.length-g.length;b&&l.recordDroppedEvent("before_send","span",b),p.spans=g}}if(c){if(p.spans){const m=p.spans.length;p.sdkProcessingMetadata={...i.sdkProcessingMetadata,spanCountBeforeProcessing:m}}return c(p,a)}}return p}function cf(l){return l.type===void 0}function dv(l){return l.type==="transaction"}function Rx(l){return[{type:"log",item_count:l.length,content_type:"application/vnd.sentry.items.log+json"},{items:l}]}function Dx(l,t,i,a){const r={};return t?.sdk&&(r.sdk={name:t.sdk.name,version:t.sdk.version}),i&&a&&(r.dsn=nu(a)),Yo(r,[Rx(l)])}function uf(l,t){const i=Mx(l)??[];if(i.length===0)return;const a=l.getOptions(),r=Dx(i,a._metadata,a.tunnel,l.getDsn());hv().set(l,[]),l.emit("flushLogs"),l.sendEnvelope(r)}function Mx(l){return hv().get(l)}function hv(){return Bo("clientToLogBufferMap",()=>new WeakMap)}function Ox(l,t){t.debug===!0&&(It?_t.enable():gr(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ks().update(t.initialScope);const a=new l(t);return kx(a),a.init(),a}function kx(l){ks().setClient(l)}const fv=Symbol.for("SentryBufferFullError");function Nx(l){const t=[];function i(){return l===void 0||t.length<l}function a(u){return t.splice(t.indexOf(u),1)[0]||Promise.resolve(void 0)}function r(u){if(!i())return iu(fv);const h=u();return t.indexOf(h)===-1&&t.push(h),h.then(()=>a(h)).then(null,()=>a(h).then(null,()=>{})),h}function c(u){return new Ns((h,p)=>{let m=t.length;if(!m)return h(!0);const g=setTimeout(()=>{u&&u>0&&h(!1)},u);t.forEach(y=>{Ea(y).then(()=>{--m||(clearTimeout(g),h(!0))},p)})})}return{$:t,add:r,drain:c}}const Lx=60*1e3;function Ix(l,t=Date.now()){const i=parseInt(`${l}`,10);if(!isNaN(i))return i*1e3;const a=Date.parse(`${l}`);return isNaN(a)?Lx:a-t}function Px(l,t){return l[t]||l.all||0}function Ux(l,t,i=Date.now()){return Px(l,t)>i}function zx(l,{statusCode:t,headers:i},a=Date.now()){const r={...l},c=i?.["x-sentry-rate-limits"],u=i?.["retry-after"];if(c)for(const h of c.trim().split(",")){const[p,m,,,g]=h.split(":",5),y=parseInt(p,10),b=(isNaN(y)?60:y)*1e3;if(!m)r.all=a+b;else for(const S of m.split(";"))S==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(r[S]=a+b):r[S]=a+b}else u?r.all=a+Ix(u,a):t===429&&(r.all=a+60*1e3);return r}const Hx=64;function Bx(l,t,i=Nx(l.bufferSize||Hx)){let a={};const r=u=>i.drain(u);function c(u){const h=[];if(Fb(u,(y,b)=>{const S=jb(b);Ux(a,S)?l.recordDroppedEvent("ratelimit_backoff",S):h.push(y)}),h.length===0)return Ea({});const p=Yo(u[0],h),m=y=>{Fb(p,(b,S)=>{l.recordDroppedEvent(y,jb(S))})},g=()=>t({body:BC(p)}).then(y=>(y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&It&&_t.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),a=zx(a,y),y),y=>{throw m("network_error"),It&&_t.error("Encountered error running transport request:",y),y});return i.add(g).then(y=>y,y=>{if(y===fv)return It&&_t.error("Skipped sending event because buffer is full."),m("queue_overflow"),Ea({});throw y})}return{send:c,flush:r}}function df(l){if(!l)return{};const t=l.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const i=t[6]||"",a=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:i,hash:a,relative:t[5]+i+a}}function Fx(l){"aggregates"in l?l.attrs?.ip_address===void 0&&(l.attrs={...l.attrs,ip_address:"{{auto}}"}):l.ipAddress===void 0&&(l.ipAddress="{{auto}}")}function jx(l,t,i=[t],a="npm"){const r=l._metadata||{};r.sdk||(r.sdk={name:`sentry.javascript.${t}`,packages:i.map(c=>({name:`${a}:@sentry/${c}`,version:ba})),version:ba}),l._metadata=r}const $x=100;function Aa(l,t){const i=cn(),a=qo();if(!i)return;const{beforeBreadcrumb:r=null,maxBreadcrumbs:c=$x}=i.getOptions();if(c<=0)return;const h={timestamp:Go(),...l},p=r?gr(()=>r(h,t)):h;p!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",p,t),a.addBreadcrumb(p,c))}let pv;const Gx="FunctionToString",mv=new WeakMap,Vx=()=>({name:Gx,setupOnce(){pv=Function.prototype.toString;try{Function.prototype.toString=function(...l){const t=Kh(this),i=mv.has(cn())&&t!==void 0?t:this;return pv.apply(i,l)}}catch{}},setup(l){mv.set(l,!0)}}),qx=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Yx="EventFilters",Xx=(l={})=>{let t;return{name:Yx,setup(i){const a=i.getOptions();t=gv(l,a)},processEvent(i,a,r){if(!t){const c=r.getOptions();t=gv(l,c)}return Qx(i,t)?null:i}}},Wx=(l={})=>({...Xx(l),name:"InboundFilters"});function gv(l={},t={}){return{allowUrls:[...l.allowUrls||[],...t.allowUrls||[]],denyUrls:[...l.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...l.ignoreErrors||[],...t.ignoreErrors||[],...l.disableErrorDefaults?[]:qx],ignoreTransactions:[...l.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Qx(l,t){if(l.type){if(l.type==="transaction"&&Zx(l,t.ignoreTransactions))return It&&_t.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
287
+ Event: ${Sa(l)}`),!0}else{if(Kx(l,t.ignoreErrors))return It&&_t.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
288
+ Event: ${Sa(l)}`),!0;if(nR(l))return It&&_t.warn(`Event dropped due to not having an error message, error type or stacktrace.
289
+ Event: ${Sa(l)}`),!0;if(Jx(l,t.denyUrls))return It&&_t.warn(`Event dropped due to being matched by \`denyUrls\` option.
290
+ Event: ${Sa(l)}.
291
+ Url: ${lu(l)}`),!0;if(!tR(l,t.allowUrls))return It&&_t.warn(`Event dropped due to not being matched by \`allowUrls\` option.
292
+ Event: ${Sa(l)}.
293
+ Url: ${lu(l)}`),!0}return!1}function Kx(l,t){return t?.length?sv(l).some(i=>eu(i,t)):!1}function Zx(l,t){if(!t?.length)return!1;const i=l.transaction;return i?eu(i,t):!1}function Jx(l,t){if(!t?.length)return!1;const i=lu(l);return i?eu(i,t):!1}function tR(l,t){if(!t?.length)return!0;const i=lu(l);return i?eu(i,t):!0}function eR(l=[]){for(let t=l.length-1;t>=0;t--){const i=l[t];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}function lu(l){try{const i=[...l.exception?.values??[]].reverse().find(a=>a.mechanism?.parent_id===void 0&&a.stacktrace?.frames?.length)?.stacktrace?.frames;return i?eR(i):null}catch{return It&&_t.error(`Cannot extract url for event ${Sa(l)}`),null}}function nR(l){return l.exception?.values?.length?!l.message&&!l.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function iR(l,t,i,a,r,c){if(!r.exception?.values||!c||!Os(c.originalException,Error))return;const u=r.exception.values.length>0?r.exception.values[r.exception.values.length-1]:void 0;u&&(r.exception.values=hf(l,t,a,c.originalException,i,r.exception.values,u,0))}function hf(l,t,i,a,r,c,u,h){if(c.length>=i+1)return c;let p=[...c];if(Os(a[r],Error)){yv(u,h);const m=l(t,a[r]),g=p.length;bv(m,r,g,h),p=hf(l,t,i,a[r],r,[m,...p],m,g)}return Array.isArray(a.errors)&&a.errors.forEach((m,g)=>{if(Os(m,Error)){yv(u,h);const y=l(t,m),b=p.length;bv(y,`errors[${g}]`,b,h),p=hf(l,t,i,m,r,[y,...p],y,b)}}),p}function yv(l,t){l.mechanism=l.mechanism||{type:"generic",handled:!0},l.mechanism={...l.mechanism,...l.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function bv(l,t,i,a){l.mechanism=l.mechanism||{type:"generic",handled:!0},l.mechanism={...l.mechanism,type:"chained",source:t,exception_id:i,parent_id:a}}function sR(l){const t="console";Wc(t,l),Qc(t,aR)}function aR(){"console"in ce&&y1.forEach(function(l){l in ce.console&&Zi(ce.console,l,function(t){return qc[l]=t,function(...i){yr("console",{args:i,level:l}),qc[l]?.apply(ce.console,i)}})})}function rR(l){return l==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(l)?l:"log"}const oR="Dedupe",lR=()=>{let l;return{name:oR,processEvent(t){if(t.type)return t;try{if(cR(t,l))return It&&_t.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return l=t}}};function cR(l,t){return t?!!(uR(l,t)||dR(l,t)):!1}function uR(l,t){const i=l.message,a=t.message;return!(!i&&!a||i&&!a||!i&&a||i!==a||!Sv(l,t)||!vv(l,t))}function dR(l,t){const i=Ev(t),a=Ev(l);return!(!i||!a||i.type!==a.type||i.value!==a.value||!Sv(l,t)||!vv(l,t))}function vv(l,t){let i=ob(l),a=ob(t);if(!i&&!a)return!0;if(i&&!a||!i&&a||(i=i,a=a,a.length!==i.length))return!1;for(let r=0;r<a.length;r++){const c=a[r],u=i[r];if(c.filename!==u.filename||c.lineno!==u.lineno||c.colno!==u.colno||c.function!==u.function)return!1}return!0}function Sv(l,t){let i=l.fingerprint,a=t.fingerprint;if(!i&&!a)return!0;if(i&&!a||!i&&a)return!1;i=i,a=a;try{return i.join("")===a.join("")}catch{return!1}}function Ev(l){return l.exception?.values?.[0]}function Av(l){if(l!==void 0)return l>=400&&l<500?"warning":l>=500?"error":void 0}const ff=ce;function hR(){if(!("fetch"in ff))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function _v(l){return l&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(l.toString())}function fR(){if(typeof EdgeRuntime=="string")return!0;if(!hR())return!1;if(_v(ff.fetch))return!0;let l=!1;const t=ff.document;if(t&&typeof t.createElement=="function")try{const i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i),i.contentWindow?.fetch&&(l=_v(i.contentWindow.fetch)),t.head.removeChild(i)}catch(i){It&&_t.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return l}function pR(l,t){const i="fetch";Wc(i,l),Qc(i,()=>mR(void 0,t))}function mR(l,t=!1){t&&!fR()||Zi(ce,"fetch",function(i){return function(...a){const r=new Error,{method:c,url:u}=gR(a),h={args:a,fetchData:{method:c,url:u},startTimestamp:Sr()*1e3,virtualError:r,headers:yR(a)};return yr("fetch",{...h}),i.apply(ce,a).then(async p=>(yr("fetch",{...h,endTimestamp:Sr()*1e3,response:p}),p),p=>{if(yr("fetch",{...h,endTimestamp:Sr()*1e3,error:p}),qh(p)&&p.stack===void 0&&(p.stack=r.stack,$o(p,"framesToPop",1)),p instanceof TypeError&&(p.message==="Failed to fetch"||p.message==="Load failed"||p.message==="NetworkError when attempting to fetch resource."))try{const m=new URL(h.fetchData.url);p.message=`${p.message} (${m.host})`}catch{}throw p})}})}function pf(l,t){return!!l&&typeof l=="object"&&!!l[t]}function Tv(l){return typeof l=="string"?l:l?pf(l,"url")?l.url:l.toString?l.toString():"":""}function gR(l){if(l.length===0)return{method:"GET",url:""};if(l.length===2){const[i,a]=l;return{url:Tv(i),method:pf(a,"method")?String(a.method).toUpperCase():"GET"}}const t=l[0];return{url:Tv(t),method:pf(t,"method")?String(t.method).toUpperCase():"GET"}}function yR(l){const[t,i]=l;try{if(typeof i=="object"&&i!==null&&"headers"in i&&i.headers)return new Headers(i.headers);if(L1(t))return new Headers(t.headers)}catch{}}function bR(){return"npm"}const Ee=ce;let mf=0;function wv(){return mf>0}function vR(){mf++,setTimeout(()=>{mf--})}function _r(l,t={}){function i(r){return typeof r=="function"}if(!i(l))return l;try{const r=l.__sentry_wrapped__;if(r)return typeof r=="function"?r:l;if(Kh(l))return l}catch{return l}const a=function(...r){try{const c=r.map(u=>_r(u,t));return l.apply(this,c)}catch(c){throw vR(),J1(u=>{u.addEventProcessor(h=>(t.mechanism&&(Zh(h,void 0),vr(h,t.mechanism)),h.extra={...h.extra,arguments:r},h)),Wb(c)}),c}};try{for(const r in l)Object.prototype.hasOwnProperty.call(l,r)&&(a[r]=l[r])}catch{}mb(a,l),$o(l,"__sentry_wrapped__",a);try{Object.getOwnPropertyDescriptor(a,"name").configurable&&Object.defineProperty(a,"name",{get(){return l.name}})}catch{}return a}function SR(){const l=Qh(),{referrer:t}=Ee.document||{},{userAgent:i}=Ee.navigator||{},a={...t&&{Referer:t},...i&&{"User-Agent":i}};return{url:l,headers:a}}function gf(l,t){const i=bf(l,t),a={type:wR(t),value:CR(t)};return i.length&&(a.stacktrace={frames:i}),a.type===void 0&&a.value===""&&(a.value="Unrecoverable error caught"),a}function ER(l,t,i,a){const c=cn()?.getOptions().normalizeDepth,u=OR(t),h={__serialized__:Bb(t,c)};if(u)return{exception:{values:[gf(l,u)]},extra:h};const p={exception:{values:[{type:Kc(t)?t.constructor.name:a?"UnhandledRejection":"Error",value:DR(t,{isUnhandledRejection:a})}]},extra:h};if(i){const m=bf(l,i);m.length&&(p.exception.values[0].stacktrace={frames:m})}return p}function yf(l,t){return{exception:{values:[gf(l,t)]}}}function bf(l,t){const i=t.stacktrace||t.stack||"",a=_R(t),r=TR(t);try{return l(i,a,r)}catch{}return[]}const AR=/Minified React error #\d+;/i;function _R(l){return l&&AR.test(l.message)?1:0}function TR(l){return typeof l.framesToPop=="number"?l.framesToPop:0}function Cv(l){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?l instanceof WebAssembly.Exception:!1}function wR(l){const t=l?.name;return!t&&Cv(l)?l.message&&Array.isArray(l.message)&&l.message.length==2?l.message[0]:"WebAssembly.Exception":t}function CR(l){const t=l?.message;return Cv(l)?Array.isArray(l.message)&&l.message.length==2?l.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function xR(l,t,i,a){const r=i?.syntheticException||void 0,c=vf(l,t,r,a);return vr(c),c.level="error",i?.event_id&&(c.event_id=i.event_id),Ea(c)}function RR(l,t,i="info",a,r){const c=a?.syntheticException||void 0,u=Sf(l,t,c,r);return u.level=i,a?.event_id&&(u.event_id=a.event_id),Ea(u)}function vf(l,t,i,a,r){let c;if(ub(t)&&t.error)return yf(l,t.error);if(db(t)||M1(t)){const u=t;if("stack"in t)c=yf(l,t);else{const h=u.name||(db(u)?"DOMError":"DOMException"),p=u.message?`${h}: ${u.message}`:h;c=Sf(l,p,i,a),Zh(c,p)}return"code"in u&&(c.tags={...c.tags,"DOMException.code":`${u.code}`}),c}return qh(t)?yf(l,t):jo(t)||Kc(t)?(c=ER(l,t,i,r),vr(c,{synthetic:!0}),c):(c=Sf(l,t,i,a),Zh(c,`${t}`),vr(c,{synthetic:!0}),c)}function Sf(l,t,i,a){const r={};if(a&&i){const c=bf(l,i);c.length&&(r.exception={values:[{value:t,stacktrace:{frames:c}}]}),vr(r,{synthetic:!0})}if(Yh(t)){const{__sentry_template_string__:c,__sentry_template_values__:u}=t;return r.logentry={message:c,params:u},r}return r.message=t,r}function DR(l,{isUnhandledRejection:t}){const i=z1(l),a=t?"promise rejection":"exception";return ub(l)?`Event \`ErrorEvent\` captured as ${a} with message \`${l.message}\``:Kc(l)?`Event \`${MR(l)}\` (type=${l.type}) captured as ${a}`:`Object captured as ${a} with keys: ${i}`}function MR(l){try{const t=Object.getPrototypeOf(l);return t?t.constructor.name:void 0}catch{}}function OR(l){for(const t in l)if(Object.prototype.hasOwnProperty.call(l,t)){const i=l[t];if(i instanceof Error)return i}}const kR=5e3;class NR extends wx{constructor(t){const i=LR(t),a=Ee.SENTRY_SDK_SOURCE||bR();jx(i,"browser",["browser"],a),i._metadata?.sdk&&(i._metadata.sdk.settings={infer_ip:i.sendDefaultPii?"auto":"never",...i._metadata.sdk.settings}),super(i);const{sendDefaultPii:r,sendClientReports:c,enableLogs:u}=this._options;Ee.document&&(c||u)&&Ee.document.addEventListener("visibilitychange",()=>{Ee.document.visibilityState==="hidden"&&(c&&this._flushOutcomes(),u&&uf(this))}),u&&(this.on("flush",()=>{uf(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{uf(this)},kR)})),r&&this.on("beforeSendSession",Fx)}eventFromException(t,i){return xR(this._options.stackParser,t,i,this._options.attachStacktrace)}eventFromMessage(t,i="info",a){return RR(this._options.stackParser,t,i,a,this._options.attachStacktrace)}_prepareEvent(t,i,a,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,i,a,r)}}function LR(l){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Ee.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...l}}const Tr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ls=globalThis,xv="10.8.0";function IR(l,t,i=Ls){const a=i.__SENTRY__=i.__SENTRY__||{},r=a[xv]=a[xv]||{};return r[l]||(r[l]=t())}const PR="Sentry Logger ",Rv={};function UR(l){if(!("console"in Ls))return l();const t=Ls.console,i={},a=Object.keys(Rv);a.forEach(r=>{const c=Rv[r];i[r]=t[r],t[r]=c});try{return l()}finally{a.forEach(r=>{t[r]=i[r]})}}function zR(){Af().enabled=!0}function HR(){Af().enabled=!1}function Dv(){return Af().enabled}function BR(...l){Ef("log",...l)}function FR(...l){Ef("warn",...l)}function jR(...l){Ef("error",...l)}function Ef(l,...t){Tr&&Dv()&&UR(()=>{Ls.console[l](`${PR}[${l}]:`,...t)})}function Af(){return Tr?IR("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Xo={enable:zR,disable:HR,isEnabled:Dv,log:BR,warn:FR,error:jR},_f="<anonymous>";function $R(l){try{return!l||typeof l!="function"?_f:l.name||_f}catch{return _f}}const cu={},Mv={};function Tf(l,t){cu[l]=cu[l]||[],cu[l].push(t)}function wf(l,t){if(!Mv[l]){Mv[l]=!0;try{t()}catch(i){Tr&&Xo.error(`Error while instrumenting ${l}`,i)}}}function Wo(l,t){const i=l&&cu[l];if(i)for(const a of i)try{a(t)}catch(r){Tr&&Xo.error(`Error while triggering instrumentation handler.
294
+ Type: ${l}
295
+ Name: ${$R(a)}
296
+ Error:`,r)}}const GR=Object.prototype.toString;function VR(l,t){return GR.call(l)===`[object ${t}]`}function uu(l){return VR(l,"String")}function du(l,t,i){if(!(t in l))return;const a=l[t];if(typeof a!="function")return;const r=i(a);typeof r=="function"&&qR(r,a);try{l[t]=r}catch{Tr&&Xo.log(`Failed to replace method "${t}" in object`,l)}}function Cf(l,t,i){try{Object.defineProperty(l,t,{value:i,writable:!0,configurable:!0})}catch{Tr&&Xo.log(`Failed to add non-enumerable property "${t}" to object`,l)}}function qR(l,t){try{const i=t.prototype||{};l.prototype=t.prototype=i,Cf(l,"__sentry_original__",t)}catch{}}function YR(){const l=Ls;return l.crypto||l.msCrypto}function XR(l=YR()){let t=()=>Math.random()*16;try{if(l?.randomUUID)return l.randomUUID().replace(/-/g,"");l?.getRandomValues&&(t=()=>{const i=new Uint8Array(1);return l.getRandomValues(i),i[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,i=>(i^(t()&15)>>i/4).toString(16))}const Ov=1e3;function WR(){return Date.now()/Ov}function QR(){const{performance:l}=Ls;if(!l?.now||!l.timeOrigin)return WR;const t=l.timeOrigin;return()=>(t+l.now())/Ov}let kv;function xf(){return(kv??(kv=QR()))()}const Nv=Ls;function KR(){return"history"in Nv&&!!Nv.history}function ZR(l){return l&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(l.toString())}const JR=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,un=Ls,tD=1e3;let Lv,Rf,Df;function eD(l){Tf("dom",l),wf("dom",nD)}function nD(){if(!un.document)return;const l=Wo.bind(null,"dom"),t=Iv(l,!0);un.document.addEventListener("click",t,!1),un.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(i=>{const r=un[i]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(du(r,"addEventListener",function(c){return function(u,h,p){if(u==="click"||u=="keypress")try{const m=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=m[u]=m[u]||{refCount:0};if(!g.handler){const y=Iv(l);g.handler=y,c.call(this,u,y,p)}g.refCount++}catch{}return c.call(this,u,h,p)}}),du(r,"removeEventListener",function(c){return function(u,h,p){if(u==="click"||u=="keypress")try{const m=this.__sentry_instrumentation_handlers__||{},g=m[u];g&&(g.refCount--,g.refCount<=0&&(c.call(this,u,g.handler,p),g.handler=void 0,delete m[u]),Object.keys(m).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,u,h,p)}}))})}function iD(l){if(l.type!==Rf)return!1;try{if(!l.target||l.target._sentryId!==Df)return!1}catch{}return!0}function sD(l,t){return l!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Iv(l,t=!1){return i=>{if(!i||i._sentryCaptured)return;const a=aD(i);if(sD(i.type,a))return;Cf(i,"_sentryCaptured",!0),a&&!a._sentryId&&Cf(a,"_sentryId",XR());const r=i.type==="keypress"?"input":i.type;iD(i)||(l({event:i,name:r,global:t}),Rf=i.type,Df=a?a._sentryId:void 0),clearTimeout(Lv),Lv=un.setTimeout(()=>{Df=void 0,Rf=void 0},tD)}}function aD(l){try{return l.target}catch{return null}}let hu;function Pv(l){const t="history";Tf(t,l),wf(t,rD)}function rD(){if(un.addEventListener("popstate",()=>{const t=un.location.href,i=hu;if(hu=t,i===t)return;Wo("history",{from:i,to:t})}),!KR())return;function l(t){return function(...i){const a=i.length>2?i[2]:void 0;if(a){const r=hu,c=oD(String(a));if(hu=c,r===c)return t.apply(this,i);Wo("history",{from:r,to:c})}return t.apply(this,i)}}du(un.history,"pushState",l),du(un.history,"replaceState",l)}function oD(l){try{return new URL(l,un.location.origin).toString()}catch{return l}}const fu={};function lD(l){const t=fu[l];if(t)return t;let i=un[l];if(ZR(i))return fu[l]=i.bind(un);const a=un.document;if(a&&typeof a.createElement=="function")try{const r=a.createElement("iframe");r.hidden=!0,a.head.appendChild(r);const c=r.contentWindow;c?.[l]&&(i=c[l]),a.head.removeChild(r)}catch(r){JR&&Xo.warn(`Could not create sandbox iframe for ${l} check, bailing to window.${l}: `,r)}return i&&(fu[l]=i.bind(un))}function Uv(l){fu[l]=void 0}const Qo="__sentry_xhr_v3__";function cD(l){Tf("xhr",l),wf("xhr",uD)}function uD(){if(!un.XMLHttpRequest)return;const l=XMLHttpRequest.prototype;l.open=new Proxy(l.open,{apply(t,i,a){const r=new Error,c=xf()*1e3,u=uu(a[0])?a[0].toUpperCase():void 0,h=dD(a[1]);if(!u||!h)return t.apply(i,a);i[Qo]={method:u,url:h,request_headers:{}},u==="POST"&&h.match(/sentry_key/)&&(i.__sentry_own_request__=!0);const p=()=>{const m=i[Qo];if(m&&i.readyState===4){try{m.status_code=i.status}catch{}const g={endTimestamp:xf()*1e3,startTimestamp:c,xhr:i,virtualError:r};Wo("xhr",g)}};return"onreadystatechange"in i&&typeof i.onreadystatechange=="function"?i.onreadystatechange=new Proxy(i.onreadystatechange,{apply(m,g,y){return p(),m.apply(g,y)}}):i.addEventListener("readystatechange",p),i.setRequestHeader=new Proxy(i.setRequestHeader,{apply(m,g,y){const[b,S]=y,A=g[Qo];return A&&uu(b)&&uu(S)&&(A.request_headers[b.toLowerCase()]=S),m.apply(g,y)}}),t.apply(i,a)}}),l.send=new Proxy(l.send,{apply(t,i,a){const r=i[Qo];if(!r)return t.apply(i,a);a[0]!==void 0&&(r.body=a[0]);const c={startTimestamp:xf()*1e3,xhr:i};return Wo("xhr",c),t.apply(i,a)}})}function dD(l){if(uu(l))return l;try{return l.toString()}catch{}}function hD(l,t=lD("fetch")){let i=0,a=0;function r(c){const u=c.body.length;i+=u,a++;const h={body:c.body,method:"POST",referrerPolicy:"strict-origin",headers:l.headers,keepalive:i<=6e4&&a<15,...l.fetchOptions};if(!t)return Uv("fetch"),iu("No fetch implementation available");try{return t(l.url,h).then(p=>(i-=u,a--,{statusCode:p.status,headers:{"x-sentry-rate-limits":p.headers.get("X-Sentry-Rate-Limits"),"retry-after":p.headers.get("Retry-After")}}))}catch(p){return Uv("fetch"),i-=u,a--,iu(p)}}return Bx(l,r)}const fD=30,pD=50;function Mf(l,t,i,a){const r={filename:l,function:t==="<anonymous>"?va:t,in_app:!0};return i!==void 0&&(r.lineno=i),a!==void 0&&(r.colno=a),r}const mD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yD=/\((\S*)(?::(\d+))(?::(\d+))\)/,bD=/at (.+?) ?\(data:(.+?),/,vD=[fD,l=>{const t=l.match(bD);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const i=mD.exec(l);if(i){const[,r,c,u]=i;return Mf(r,va,+c,+u)}const a=gD.exec(l);if(a){if(a[2]&&a[2].indexOf("eval")===0){const h=yD.exec(a[2]);h&&(a[2]=h[1],a[3]=h[2],a[4]=h[3])}const[c,u]=zv(a[1]||va,a[2]);return Mf(u,c,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}}],SD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ED=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,AD=rb(...[vD,[pD,l=>{const t=SD.exec(l);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const c=ED.exec(t[3]);c&&(t[1]=t[1]||"eval",t[3]=c[1],t[4]=c[2],t[5]="")}let a=t[3],r=t[1]||va;return[r,a]=zv(r,a),Mf(a,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),zv=(l,t)=>{const i=l.indexOf("safari-extension")!==-1,a=l.indexOf("safari-web-extension")!==-1;return i||a?[l.indexOf("@")!==-1?l.split("@")[0]:va,i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[l,t]},pu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,mu=1024,_D="Breadcrumbs",TD=(l={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...l};return{name:_D,setup(i){t.console&&sR(xD(i)),t.dom&&eD(CD(i,t.dom)),t.xhr&&cD(RD(i)),t.fetch&&pR(DD(i)),t.history&&Pv(MD(i)),t.sentry&&i.on("beforeSendEvent",wD(i))}}};function wD(l){return function(i){cn()===l&&Aa({category:`sentry.${i.type==="transaction"?"transaction":"event"}`,event_id:i.event_id,level:i.level,message:Sa(i)},{event:i})}}function CD(l,t){return function(a){if(cn()!==l)return;let r,c,u=typeof t=="object"?t.serializeAttribute:void 0,h=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;h&&h>mu&&(pu&&_t.warn(`\`dom.maxStringLength\` cannot exceed ${mu}, but a value of ${h} was configured. Sentry will use ${mu} instead.`),h=mu),typeof u=="string"&&(u=[u]);try{const m=a.event,g=OD(m)?m.target:m;r=fb(g,{keyAttrs:u,maxStringLength:h}),c=U1(g)}catch{r="<unknown>"}if(r.length===0)return;const p={category:`ui.${a.name}`,message:r};c&&(p.data={"ui.component_name":c}),Aa(p,{event:a.event,name:a.name,global:a.global})}}function xD(l){return function(i){if(cn()!==l)return;const a={category:"console",data:{arguments:i.args,logger:"console"},level:rR(i.level),message:pb(i.args," ")};if(i.level==="assert")if(i.args[0]===!1)a.message=`Assertion failed: ${pb(i.args.slice(1)," ")||"console.assert"}`,a.data.arguments=i.args.slice(1);else return;Aa(a,{input:i.args,level:i.level})}}function RD(l){return function(i){if(cn()!==l)return;const{startTimestamp:a,endTimestamp:r}=i,c=i.xhr[Qo];if(!a||!r||!c)return;const{method:u,url:h,status_code:p,body:m}=c,g={method:u,url:h,status_code:p},y={xhr:i.xhr,input:m,startTimestamp:a,endTimestamp:r},b={category:"xhr",data:g,type:"http",level:Av(p)};l.emit("beforeOutgoingRequestBreadcrumb",b,y),Aa(b,y)}}function DD(l){return function(i){if(cn()!==l)return;const{startTimestamp:a,endTimestamp:r}=i;if(r&&!(i.fetchData.url.match(/sentry_key/)&&i.fetchData.method==="POST"))if(i.fetchData.method,i.fetchData.url,i.error){const c=i.fetchData,u={data:i.error,input:i.args,startTimestamp:a,endTimestamp:r},h={category:"fetch",data:c,level:"error",type:"http"};l.emit("beforeOutgoingRequestBreadcrumb",h,u),Aa(h,u)}else{const c=i.response,u={...i.fetchData,status_code:c?.status};i.fetchData.request_body_size,i.fetchData.response_body_size,c?.status;const h={input:i.args,response:c,startTimestamp:a,endTimestamp:r},p={category:"fetch",data:u,type:"http",level:Av(u.status_code)};l.emit("beforeOutgoingRequestBreadcrumb",p,h),Aa(p,h)}}}function MD(l){return function(i){if(cn()!==l)return;let a=i.from,r=i.to;const c=df(Ee.location.href);let u=a?df(a):void 0;const h=df(r);u?.path||(u=c),c.protocol===h.protocol&&c.host===h.host&&(r=h.relative),c.protocol===u.protocol&&c.host===u.host&&(a=u.relative),Aa({category:"navigation",data:{from:a,to:r}})}}function OD(l){return!!l&&!!l.target}const kD=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ND="BrowserApiErrors",LD=(l={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...l};return{name:ND,setupOnce(){t.setTimeout&&Zi(Ee,"setTimeout",Hv),t.setInterval&&Zi(Ee,"setInterval",Hv),t.requestAnimationFrame&&Zi(Ee,"requestAnimationFrame",ID),t.XMLHttpRequest&&"XMLHttpRequest"in Ee&&Zi(XMLHttpRequest.prototype,"send",PD);const i=t.eventTarget;i&&(Array.isArray(i)?i:kD).forEach(r=>UD(r,t))}}};function Hv(l){return function(...t){const i=t[0];return t[0]=_r(i,{mechanism:{data:{function:Ms(l)},handled:!1,type:"instrument"}}),l.apply(this,t)}}function ID(l){return function(t){return l.apply(this,[_r(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ms(l)},handled:!1,type:"instrument"}})])}}function PD(l){return function(...t){const i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in i&&typeof i[r]=="function"&&Zi(i,r,function(c){const u={mechanism:{data:{function:r,handler:Ms(c)},handled:!1,type:"instrument"}},h=Kh(c);return h&&(u.mechanism.data.handler=Ms(h)),_r(c,u)})}),l.apply(this,t)}}function UD(l,t){const a=Ee[l]?.prototype;a?.hasOwnProperty?.("addEventListener")&&(Zi(a,"addEventListener",function(r){return function(c,u,h){try{zD(u)&&(u.handleEvent=_r(u.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ms(u),target:l},handled:!1,type:"instrument"}}))}catch{}return t.unregisterOriginalCallbacks&&HD(this,c,u),r.apply(this,[c,_r(u,{mechanism:{data:{function:"addEventListener",handler:Ms(u),target:l},handled:!1,type:"instrument"}}),h])}}),Zi(a,"removeEventListener",function(r){return function(c,u,h){try{const p=u.__sentry_wrapped__;p&&r.call(this,c,p,h)}catch{}return r.call(this,c,u,h)}}))}function zD(l){return typeof l.handleEvent=="function"}function HD(l,t,i){l&&typeof l=="object"&&"removeEventListener"in l&&typeof l.removeEventListener=="function"&&l.removeEventListener(t,i)}const BD=()=>({name:"BrowserSession",setupOnce(){if(typeof Ee.document>"u"){pu&&_t.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Kb({ignoreDuration:!0}),tv(),Pv(({from:l,to:t})=>{l!==void 0&&l!==t&&(Kb({ignoreDuration:!0}),tv())})}}),FD="GlobalHandlers",jD=(l={})=>{const t={onerror:!0,onunhandledrejection:!0,...l};return{name:FD,setupOnce(){Error.stackTraceLimit=50},setup(i){t.onerror&&($D(i),Bv("onerror")),t.onunhandledrejection&&(GD(i),Bv("onunhandledrejection"))}}};function $D(l){C1(t=>{const{stackParser:i,attachStacktrace:a}=Fv();if(cn()!==l||wv())return;const{msg:r,url:c,line:u,column:h,error:p}=t,m=YD(vf(i,p||r,void 0,a,!1),c,u,h);m.level="error",Qb(m,{originalException:p,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function GD(l){R1(t=>{const{stackParser:i,attachStacktrace:a}=Fv();if(cn()!==l||wv())return;const r=VD(t),c=Xh(r)?qD(r):vf(i,r,void 0,a,!0);c.level="error",Qb(c,{originalException:r,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function VD(l){if(Xh(l))return l;try{if("reason"in l)return l.reason;if("detail"in l&&"reason"in l.detail)return l.detail.reason}catch{}return l}function qD(l){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(l)}`}]}}}function YD(l,t,i,a){const r=l.exception=l.exception||{},c=r.values=r.values||[],u=c[0]=c[0]||{},h=u.stacktrace=u.stacktrace||{},p=h.frames=h.frames||[],m=a,g=i,y=XD(t)??Qh();return p.length===0&&p.push({colno:m,filename:y,function:va,in_app:!0,lineno:g}),l}function Bv(l){pu&&_t.log(`Global Handler attached: ${l}`)}function Fv(){return cn()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function XD(l){if(!(!Fo(l)||l.length===0)){if(l.startsWith("data:")){const t=l.match(/^data:([^;]+)/),i=t?t[1]:"text/javascript",a=l.includes("base64,");return`<data:${i}${a?",base64":""}>`}return l.slice(0,1024)}}const WD=()=>({name:"HttpContext",preprocessEvent(l){if(!Ee.navigator&&!Ee.location&&!Ee.document)return;const t=SR(),i={...t.headers,...l.request?.headers};l.request={...t,...l.request,headers:i}}}),QD="cause",KD=5,ZD="LinkedErrors",JD=(l={})=>{const t=l.limit||KD,i=l.key||QD;return{name:ZD,preprocessEvent(a,r,c){const u=c.getOptions();iR(gf,u.stackParser,i,t,a,r)}}};function tM(){return eM()?(pu&&gr(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function eM(){if(typeof Ee.window>"u")return!1;const l=Ee;if(l.nw||!(l.chrome||l.browser)?.runtime?.id)return!1;const i=Qh(),a=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(Ee===Ee.top&&a.some(c=>i.startsWith(`${c}://`)))}function nM(l){return[Wx(),Vx(),LD(),TD(),jD(),JD(),lR(),WD(),BD()]}function iM(l={}){const t=!l.skipBrowserExtensionCheck&&tM(),i={...l,enabled:t?!1:l.enabled,stackParser:T1(l.stackParser||AD),integrations:Sx({integrations:l.integrations,defaultIntegrations:l.defaultIntegrations==null?nM():l.defaultIntegrations}),transport:l.transport||hD};return Ox(NR,i)}class sM{config;debug;logLevel;constructor(){this.config=Xt,this.debug=this.config.env!=="prd",this.logLevel=this.config.env==="hml"?1:2}getTimestamp(){return new Date().toLocaleString("pt-BR",{timeZone:"America/Sao_Paulo"}).replace(",","")}BASE="[⚡ChatJT";info(t,...i){this.debug&&this.logLevel>=1&&console.log(`[${this.getTimestamp()}] ${this.BASE}] ${t}`,...i)}detail(t,...i){this.debug&&this.logLevel>=2&&console.log(`[${this.getTimestamp()}] ${this.BASE} Detail] ${t}`,...i)}warn(t,...i){this.debug&&console.warn(`[${this.getTimestamp()}] ${this.BASE} Warning] ${t}`,...i)}error(t,...i){this.debug&&console.error(`[${this.getTimestamp()}] ${this.BASE} Error] ${t}`,...i),Wb(new Error(t),{extra:{args:i}})}}const L=new sM,Of="chatjt-container",jv="chatjt-open-button",$v="chatjt-panel";class aM{root=null;container=null;async init(){try{if(document.getElementById(Of))return;this.container=document.createElement("div"),this.container.id=Of,this.container.style.pointerEvents="auto",document.body.appendChild(this.container),this.root=f1.createRoot(this.container),this.root.render(r1.createElement(g1)),L.info("UI da extensão inicializada via React"),setTimeout(()=>{const t=document.getElementById(jv),i=document.getElementById($v);L.info("Elementos criados:",{button:!!t,panel:!!i})},100)}catch(t){L.error("Erro ao inicializar UI:",t)}}destroy(){try{this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.remove(),this.container=null);const t=document.getElementById(Of);t&&t.remove();const i=document.getElementById(jv);i&&i.remove();const a=document.getElementById($v);a&&a.remove(),L.info("UI da extensão destruída")}catch(t){L.error("Erro ao destruir UI:",t)}}}const kf={EXTENSION:"extension",IFRAME:"iframe"},Ae={HANDSHAKE:"HANDSHAKE",HANDSHAKE_ACK:"HANDSHAKE_ACK",SINGLE_DOCUMENT_EXTRACTED:"SINGLE_DOCUMENT_EXTRACTED",MULTIPLE_DOCUMENTS_EXTRACTED:"MULTIPLE_DOCUMENTS_EXTRACTED",AUTO_CAPTURE_DETECTION:"AUTO_CAPTURE_DETECTION",AUTO_CAPTURE_CLEANUP:"AUTO_CAPTURE_CLEANUP",EXTRACT_FULL_PROCESS:"EXTRACT_FULL_PROCESS",EXTRACT_SELECTED_DOCUMENTS:"EXTRACT_SELECTED_DOCUMENTS",EXTRACT_VISIBLE_DOCUMENT:"EXTRACT_VISIBLE_DOCUMENT",EXTRACTION_ERROR:"EXTRACTION_ERROR",GENERIC_ERROR:"GENERIC_ERROR",UNSUPPORTED_MESSAGE:"UNSUPPORTED_MESSAGE"};function rM(l){return new RegExp("^"+l.replace(/{{.*?}}/g,"\\d+")+"$")}function oM(l){try{const t=new URL(l),i=t.origin,a=t.pathname;for(const r of Xt.action_map)if(r.allowed_hosts.some(c=>Fc(i,c)))for(const[c,u]of Object.entries(r.mapping)){if(c==="/*"&&u===null)continue;if(rM(c).test(a)){const p=u.map(m=>r.actions.find(g=>g.job===m)).filter(Boolean);if(p&&p.length>0)return p}}}catch(t){L.error("Erro ao obter actions para URL:",t)}return[]}let lM=class{source;isHandshakeComplete=!1;messageQueue=[];listeners=new Map;iframe;constructor(t=kf.EXTENSION){this.source=t,this.iframe=null,this.initializeIframe(),this.setupMessageListener()}initializeIframe(){this.iframe=document.querySelector("#chatjt-iframe"),this.iframe?(L.info("Iframe encontrado e inicializado"),this.onIframeReady()):(L.detail("Iframe não encontrado inicialmente, aguardando criação..."),this.waitForIframe())}waitForIframe(){const t=new MutationObserver(i=>{i.forEach(a=>{a.type==="childList"&&a.addedNodes.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE){const c=r,u=c.id==="chatjt-iframe"?c:c.querySelector("#chatjt-iframe");u&&(this.iframe=u,L.info("Iframe detectado via MutationObserver"),this.onIframeReady(),t.disconnect())}})})});t.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{t.disconnect(),this.iframe||L.error("Timeout: Iframe não foi encontrado após 10 segundos")},1e4)}onIframeReady(){this.iframe&&(this.iframe.contentWindow?this.processQueuedMessages():this.iframe.addEventListener("load",()=>{L.info("Iframe carregado completamente"),this.processQueuedMessages()}))}setupMessageListener(){window.addEventListener("message",t=>{try{const i=this.validateMessage(t.data);i&&this.handleMessage(i,t)}catch(i){L.error("Erro ao processar mensagem:",i)}})}validateMessage(t){return!t||typeof t!="object"||!t.type||typeof t.type!="string"||this.isErrorMessage(t.type)&&t.source===this.source||!t.source||!Object.values(kf).includes(t.source)?null:{id:t.id??crypto.randomUUID(),type:t.type,data:t.data??null,error:t.error??null,responseTo:t.responseTo??null,timestamp:t.timestamp??new Date().toISOString(),source:t.source??this.source}}isErrorMessage(t){return[Ae.GENERIC_ERROR,Ae.UNSUPPORTED_MESSAGE].includes(t)}handleMessage(t,i){if(t.type===Ae.HANDSHAKE){this.handleHandshake();return}if(!this.isHandshakeComplete){this.messageQueue.push({message:t,event:i});return}this.processMessage(t,i)}handleHandshake(){L.info("Handshake recebido do iframe"),this.isHandshakeComplete=!0;let t="";try{t=window.location.href}catch{t="unknown"}L.info("URL do iframe:",t);const i=oM(t);L.info("Ações disponíveis para a URL do iframe:",i),this.sendMessage(Ae.HANDSHAKE_ACK,{extensionVersion:Xt.app.version??"unknown",actions:i}),this.processQueuedMessages()}processMessage(t,i){const a=this.listeners.get(t.type);a&&a(t,i)}processQueuedMessages(){for(;this.messageQueue.length>0;){const{message:t,event:i}=this.messageQueue.shift();L.info(`Processando mensagem enfileirada: ${t.type}`),this.processMessage(t,i)}}sendMessage(t,i,a,r=null){const c={id:crypto.randomUUID(),type:t,data:i??null,error:a??void 0,responseTo:r??void 0,timestamp:new Date().toISOString(),source:this.source};if(L.info(`Enviando mensagem: ${t}`,c),!this.iframe||!this.iframe.contentWindow){L.warn(`Iframe não disponível, enfileirando mensagem: ${t}`),this.messageQueue.push({message:c,event:null});return}try{this.iframe.contentWindow.postMessage(c,"*"),L.info(`Mensagem enviada para o iframe: ${t}`)}catch(u){L.error("Erro ao enviar mensagem:",u),this.messageQueue.push({message:c,event:null})}}sendSuccessMessage(t,i=null,a){this.sendMessage(t,i,null,a??null)}sendError(t,i,a){this.sendMessage(t,null,i,a??null)}onMessage(t,i){this.listeners.set(t,i)}};const dn=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Nf=[.001,0,0,.001,0,0],Lf=1.35,In={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Is={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Gv="pdfjs_internal_editor_",Tt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},$t={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_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},cM={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},an={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},gu={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},De={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,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},wr={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},yu={ERRORS:0,WARNINGS:1,INFOS:5},bu={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},vu={moveTo:0,lineTo:1,curveTo:2,closePath:3},uM={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Su=yu.WARNINGS;function dM(l){Number.isInteger(l)&&(Su=l)}function hM(){return Su}function Eu(l){Su>=yu.INFOS&&console.log(`Info: ${l}`)}function wt(l){Su>=yu.WARNINGS&&console.log(`Warning: ${l}`)}function ne(l){throw new Error(l)}function Me(l,t){l||ne(t)}function fM(l){switch(l?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Vv(l,t=null,i=null){if(!l)return null;if(i&&typeof l=="string"&&(i.addDefaultProtocol&&l.startsWith("www.")&&l.match(/\./g)?.length>=2&&(l=`http://${l}`),i.tryConvertEncoding))try{l=bM(l)}catch{}const a=t?URL.parse(l,t):URL.parse(l);return fM(a)?a:null}function qv(l,t,i=!1){const a=URL.parse(l);return a?(a.hash=t,a.href):i&&Vv(l,"http://example.com")?l.split("#",1)[0]+`${t?`#${t}`:""}`:""}function zt(l,t,i,a=!1){return Object.defineProperty(l,t,{value:i,enumerable:!a,configurable:!0,writable:!1}),i}const _a=function(){function t(i,a){this.message=i,this.name=a}return t.prototype=new Error,t.constructor=t,t}();class Yv extends _a{constructor(t,i){super(t,"PasswordException"),this.code=i}}class If extends _a{constructor(t,i){super(t,"UnknownErrorException"),this.details=i}}class Pf extends _a{constructor(t){super(t,"InvalidPDFException")}}class Au extends _a{constructor(t,i,a){super(t,"ResponseException"),this.status=i,this.missing=a}}class pM extends _a{constructor(t){super(t,"FormatError")}}class Ps extends _a{constructor(t){super(t,"AbortException")}}function Xv(l){(typeof l!="object"||l?.length===void 0)&&ne("Invalid argument for bytesToString");const t=l.length,i=8192;if(t<i)return String.fromCharCode.apply(null,l);const a=[];for(let r=0;r<t;r+=i){const c=Math.min(r+i,t),u=l.subarray(r,c);a.push(String.fromCharCode.apply(null,u))}return a.join("")}function Ko(l){typeof l!="string"&&ne("Invalid argument for stringToBytes");const t=l.length,i=new Uint8Array(t);for(let a=0;a<t;++a)i[a]=l.charCodeAt(a)&255;return i}function mM(l){return String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,l&255)}function gM(){const l=new Uint8Array(4);return l[0]=1,new Uint32Array(l.buffer,0,1)[0]===1}function yM(){try{return new Function(""),!0}catch{return!1}}class qe{static get isLittleEndian(){return zt(this,"isLittleEndian",gM())}static get isEvalSupported(){return zt(this,"isEvalSupported",yM())}static get isOffscreenCanvasSupported(){return zt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return zt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:i}=navigator;return zt(this,"platform",{isAndroid:i.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){return zt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Uf=Array.from(Array(256).keys(),l=>l.toString(16).padStart(2,"0"));class mt{static makeHexColor(t,i,a){return`#${Uf[t]}${Uf[i]}${Uf[a]}`}static scaleMinMax(t,i){let a;t[0]?(t[0]<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=t[0],i[2]*=t[0],t[3]<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t[3],i[3]*=t[3]):(a=i[0],i[0]=i[1],i[1]=a,a=i[2],i[2]=i[3],i[3]=a,t[1]<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t[1],i[3]*=t[1],t[2]<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=t[2],i[2]*=t[2]),i[0]+=t[4],i[1]+=t[5],i[2]+=t[4],i[3]+=t[5]}static transform(t,i){return[t[0]*i[0]+t[2]*i[1],t[1]*i[0]+t[3]*i[1],t[0]*i[2]+t[2]*i[3],t[1]*i[2]+t[3]*i[3],t[0]*i[4]+t[2]*i[5]+t[4],t[1]*i[4]+t[3]*i[5]+t[5]]}static applyTransform(t,i,a=0){const r=t[a],c=t[a+1];t[a]=r*i[0]+c*i[2]+i[4],t[a+1]=r*i[1]+c*i[3]+i[5]}static applyTransformToBezier(t,i,a=0){const r=i[0],c=i[1],u=i[2],h=i[3],p=i[4],m=i[5];for(let g=0;g<6;g+=2){const y=t[a+g],b=t[a+g+1];t[a+g]=y*r+b*u+p,t[a+g+1]=y*c+b*h+m}}static applyInverseTransform(t,i){const a=t[0],r=t[1],c=i[0]*i[3]-i[1]*i[2];t[0]=(a*i[3]-r*i[2]+i[2]*i[5]-i[4]*i[3])/c,t[1]=(-a*i[1]+r*i[0]+i[4]*i[1]-i[5]*i[0])/c}static axialAlignedBoundingBox(t,i,a){const r=i[0],c=i[1],u=i[2],h=i[3],p=i[4],m=i[5],g=t[0],y=t[1],b=t[2],S=t[3];let A=r*g+p,_=A,R=r*b+p,C=R,N=h*y+m,O=N,U=h*S+m,I=U;if(c!==0||u!==0){const j=c*g,F=c*b,J=u*y,X=u*S;A+=J,C+=J,R+=X,_+=X,N+=j,I+=j,U+=F,O+=F}a[0]=Math.min(a[0],A,R,_,C),a[1]=Math.min(a[1],N,U,O,I),a[2]=Math.max(a[2],A,R,_,C),a[3]=Math.max(a[3],N,U,O,I)}static inverseTransform(t){const i=t[0]*t[3]-t[1]*t[2];return[t[3]/i,-t[1]/i,-t[2]/i,t[0]/i,(t[2]*t[5]-t[4]*t[3])/i,(t[4]*t[1]-t[5]*t[0])/i]}static singularValueDecompose2dScale(t,i){const a=t[0],r=t[1],c=t[2],u=t[3],h=a**2+r**2,p=a*c+r*u,m=c**2+u**2,g=(h+m)/2,y=Math.sqrt(g**2-(h*m-p**2));i[0]=Math.sqrt(g+y||1),i[1]=Math.sqrt(g-y||1)}static normalizeRect(t){const i=t.slice(0);return t[0]>t[2]&&(i[0]=t[2],i[2]=t[0]),t[1]>t[3]&&(i[1]=t[3],i[3]=t[1]),i}static intersect(t,i){const a=Math.max(Math.min(t[0],t[2]),Math.min(i[0],i[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(i[0],i[2]));if(a>r)return null;const c=Math.max(Math.min(t[1],t[3]),Math.min(i[1],i[3])),u=Math.min(Math.max(t[1],t[3]),Math.max(i[1],i[3]));return c>u?null:[a,c,r,u]}static pointBoundingBox(t,i,a){a[0]=Math.min(a[0],t),a[1]=Math.min(a[1],i),a[2]=Math.max(a[2],t),a[3]=Math.max(a[3],i)}static rectBoundingBox(t,i,a,r,c){c[0]=Math.min(c[0],t,a),c[1]=Math.min(c[1],i,r),c[2]=Math.max(c[2],t,a),c[3]=Math.max(c[3],i,r)}static#t(t,i,a,r,c,u,h,p,m,g){if(m<=0||m>=1)return;const y=1-m,b=m*m,S=b*m,A=y*(y*(y*t+3*m*i)+3*b*a)+S*r,_=y*(y*(y*c+3*m*u)+3*b*h)+S*p;g[0]=Math.min(g[0],A),g[1]=Math.min(g[1],_),g[2]=Math.max(g[2],A),g[3]=Math.max(g[3],_)}static#e(t,i,a,r,c,u,h,p,m,g,y,b){if(Math.abs(m)<1e-12){Math.abs(g)>=1e-12&&this.#t(t,i,a,r,c,u,h,p,-y/g,b);return}const S=g**2-4*y*m;if(S<0)return;const A=Math.sqrt(S),_=2*m;this.#t(t,i,a,r,c,u,h,p,(-g+A)/_,b),this.#t(t,i,a,r,c,u,h,p,(-g-A)/_,b)}static bezierBoundingBox(t,i,a,r,c,u,h,p,m){m[0]=Math.min(m[0],t,h),m[1]=Math.min(m[1],i,p),m[2]=Math.max(m[2],t,h),m[3]=Math.max(m[3],i,p),this.#e(t,a,c,h,i,r,u,p,3*(-t+3*(a-c)+h),6*(t-2*a+c),3*(a-t),m),this.#e(t,a,c,h,i,r,u,p,3*(-i+3*(r-u)+p),6*(i-2*r+u),3*(r-i),m)}}function bM(l){return decodeURIComponent(escape(l))}let zf=null,Wv=null;function vM(l){return zf||(zf=/([\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,Wv=new Map([["ſt","ſt"]])),l.replaceAll(zf,(t,i,a)=>i?i.normalize("NFKC"):Wv.get(a))}function Qv(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const l=new Uint8Array(32);return crypto.getRandomValues(l),Xv(l)}const Hf="pdfjs_internal_id_";function SM(l,t,i){if(!Array.isArray(i)||i.length<2)return!1;const[a,r,...c]=i;if(!l(a)&&!Number.isInteger(a)||!t(r))return!1;const u=c.length;let h=!0;switch(r.name){case"XYZ":if(u<2||u>3)return!1;break;case"Fit":case"FitB":return u===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(u>1)return!1;break;case"FitR":if(u!==4)return!1;h=!1;break;default:return!1}for(const p of c)if(!(typeof p=="number"||h&&p===null))return!1;return!0}function hn(l,t,i){return Math.min(Math.max(l,t),i)}function Kv(l){return Uint8Array.prototype.toBase64?l.toBase64():btoa(Xv(l))}function EM(l){return Uint8Array.fromBase64?Uint8Array.fromBase64(l):Ko(atob(l))}typeof Promise.try!="function"&&(Promise.try=function(l,...t){return new Promise(i=>{i(l(...t))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(l){return l.reduce((t,i)=>t+i,0)});const ts="http://www.w3.org/2000/svg";class Cr{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Zo(l,t="text"){if(tl(l,document.baseURI)){const i=await fetch(l);if(!i.ok)throw new Error(i.statusText);switch(t){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,a)=>{const r=new XMLHttpRequest;r.open("GET",l,!0),r.responseType=t,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){switch(t){case"arraybuffer":case"blob":case"json":i(r.response);return}i(r.responseText);return}a(new Error(r.statusText))}},r.send(null)})}class Jo{constructor({viewBox:t,userUnit:i,scale:a,rotation:r,offsetX:c=0,offsetY:u=0,dontFlip:h=!1}){this.viewBox=t,this.userUnit=i,this.scale=a,this.rotation=r,this.offsetX=c,this.offsetY=u,a*=i;const p=(t[2]+t[0])/2,m=(t[3]+t[1])/2;let g,y,b,S;switch(r%=360,r<0&&(r+=360),r){case 180:g=-1,y=0,b=0,S=1;break;case 90:g=0,y=1,b=1,S=0;break;case 270:g=0,y=-1,b=-1,S=0;break;case 0:g=1,y=0,b=0,S=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}h&&(b=-b,S=-S);let A,_,R,C;g===0?(A=Math.abs(m-t[1])*a+c,_=Math.abs(p-t[0])*a+u,R=(t[3]-t[1])*a,C=(t[2]-t[0])*a):(A=Math.abs(p-t[0])*a+c,_=Math.abs(m-t[1])*a+u,R=(t[2]-t[0])*a,C=(t[3]-t[1])*a),this.transform=[g*a,y*a,b*a,S*a,A-g*a*p-b*a*m,_-y*a*p-S*a*m],this.width=R,this.height=C}get rawDims(){const t=this.viewBox;return zt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:i=this.rotation,offsetX:a=this.offsetX,offsetY:r=this.offsetY,dontFlip:c=!1}={}){return new Jo({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:i,offsetX:a,offsetY:r,dontFlip:c})}convertToViewportPoint(t,i){const a=[t,i];return mt.applyTransform(a,this.transform),a}convertToViewportRectangle(t){const i=[t[0],t[1]];mt.applyTransform(i,this.transform);const a=[t[2],t[3]];return mt.applyTransform(a,this.transform),[i[0],i[1],a[0],a[1]]}convertToPdfPoint(t,i){const a=[t,i];return mt.applyInverseTransform(a,this.transform),a}}class Bf extends _a{constructor(t,i=0){super(t,"RenderingCancelledException"),this.extraDelay=i}}function _u(l){const t=l.length;let i=0;for(;i<t&&l[i].trim()==="";)i++;return l.substring(i,i+5).toLowerCase()==="data:"}function Ff(l){return typeof l=="string"&&/\.pdf$/i.test(l)}function AM(l){return[l]=l.split(/[#?]/,1),l.substring(l.lastIndexOf("/")+1)}function _M(l,t="document.pdf"){if(typeof l!="string")return t;if(_u(l))return wt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const a=(h=>{try{return new URL(h)}catch{try{return new URL(decodeURIComponent(h))}catch{try{return new URL(h,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(h),"https://foo.bar")}catch{return null}}}}})(l);if(!a)return t;const r=h=>{try{let p=decodeURIComponent(h);return p.includes("/")?(p=p.split("/").at(-1),p.test(/^\.pdf$/i)?p:h):p}catch{return h}},c=/\.pdf$/i,u=a.pathname.split("/").at(-1);if(c.test(u))return r(u);if(a.searchParams.size>0){const h=Array.from(a.searchParams.values()).reverse();for(const m of h)if(c.test(m))return r(m);const p=Array.from(a.searchParams.keys()).reverse();for(const m of p)if(c.test(m))return r(m)}if(a.hash){const p=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(a.hash);if(p)return r(p[0])}return t}class Zv{started=Object.create(null);times=[];time(t){t in this.started&&wt(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||wt(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let i=0;for(const{name:a}of this.times)i=Math.max(a.length,i);for(const{name:a,start:r,end:c}of this.times)t.push(`${a.padEnd(i)} ${c-r}ms
297
+ `);return t.join("")}}function tl(l,t){const i=t?URL.parse(l,t):URL.parse(l);return i?.protocol==="http:"||i?.protocol==="https:"}function Xn(l){l.preventDefault()}function Oe(l){l.preventDefault(),l.stopPropagation()}function TM(l){console.log("Deprecated API usage: "+l)}class jf{static#t;static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const i=this.#t.exec(t);if(!i)return null;const a=parseInt(i[1],10);let r=parseInt(i[2],10);r=r>=1&&r<=12?r-1:0;let c=parseInt(i[3],10);c=c>=1&&c<=31?c:1;let u=parseInt(i[4],10);u=u>=0&&u<=23?u:0;let h=parseInt(i[5],10);h=h>=0&&h<=59?h:0;let p=parseInt(i[6],10);p=p>=0&&p<=59?p:0;const m=i[7]||"Z";let g=parseInt(i[8],10);g=g>=0&&g<=23?g:0;let y=parseInt(i[9],10)||0;return y=y>=0&&y<=59?y:0,m==="-"?(u+=g,h+=y):m==="+"&&(u-=g,h-=y),new Date(Date.UTC(a,r,c,u,h,p))}}function wM(l,{scale:t=1,rotation:i=0}){const{width:a,height:r}=l.attributes.style,c=[0,0,parseInt(a),parseInt(r)];return new Jo({viewBox:c,userUnit:1,scale:t,rotation:i})}function Tu(l){if(l.startsWith("#")){const t=parseInt(l.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return l.startsWith("rgb(")?l.slice(4,-1).split(",").map(t=>parseInt(t)):l.startsWith("rgba(")?l.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(wt(`Not a valid color format: "${l}"`),[0,0,0])}function CM(l){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const i of l.keys()){t.style.color=i;const a=window.getComputedStyle(t).color;l.set(i,Tu(a))}t.remove()}function ye(l){const{a:t,b:i,c:a,d:r,e:c,f:u}=l.getTransform();return[t,i,a,r,c,u]}function Ri(l){const{a:t,b:i,c:a,d:r,e:c,f:u}=l.getTransform().invertSelf();return[t,i,a,r,c,u]}function Ta(l,t,i=!1,a=!0){if(t instanceof Jo){const{pageWidth:r,pageHeight:c}=t.rawDims,{style:u}=l,h=qe.isCSSRoundSupported,p=`var(--total-scale-factor) * ${r}px`,m=`var(--total-scale-factor) * ${c}px`,g=h?`round(down, ${p}, var(--scale-round-x))`:`calc(${p})`,y=h?`round(down, ${m}, var(--scale-round-y))`:`calc(${m})`;!i||t.rotation%180===0?(u.width=g,u.height=y):(u.width=y,u.height=g)}a&&l.setAttribute("data-main-rotation",t.rotation)}class Di{constructor(){const{pixelRatio:t}=Di;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,i,a,r,c=-1){let u=1/0,h=1/0,p=1/0;a=Di.capPixels(a,c),a>0&&(u=Math.sqrt(a/(t*i))),r!==-1&&(h=r/t,p=r/i);const m=Math.min(u,h,p);return this.sx>m||this.sy>m?(this.sx=m,this.sy=m,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,i){if(i>=0){const a=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return t>0?Math.min(t,a):a}return t}}const $f=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class el{#t=null;#e=null;#n;#i=null;#a=null;#s=null;#r=null;static#o=null;constructor(t){this.#n=t,el.#o||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#t=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",Xn,{signal:i}),t.addEventListener("pointerdown",el.#u,{signal:i});const a=this.#i=document.createElement("div");a.className="buttons",t.append(a);const r=this.#n.toolbarPosition;if(r){const{style:c}=t,u=this.#n._uiManager.direction==="ltr"?1-r[0]:r[0];c.insetInlineEnd=`${100*u}%`,c.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#t}static#u(t){t.stopPropagation()}#c(t){this.#n._focusEventsAllowed=!1,Oe(t)}#h(t){this.#n._focusEventsAllowed=!0,Oe(t)}#l(t){const i=this.#n._uiManager._signal;t.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:i}),t.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:i}),t.addEventListener("contextmenu",Xn,{signal:i})}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#a?.shown(),this.#s?.shown()}addDeleteButton(){const{editorType:t,_uiManager:i}=this.#n,a=document.createElement("button");a.className="delete",a.tabIndex=0,a.setAttribute("data-l10n-id",el.#o[t]),this.#l(a),a.addEventListener("click",r=>{i.delete()},{signal:i._signal}),this.#i.append(a)}get#p(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const i=await t.render();this.#l(i),this.#i.append(i,this.#p),this.#a=t}addComment(t){if(this.#s)return;const i=t.render();i&&(this.#l(i),this.#i.prepend(i,this.#p),this.#s=t,t.toolbar=this)}addColorPicker(t){if(this.#e)return;this.#e=t;const i=t.renderButton();this.#l(i),this.#i.append(i,this.#p)}async addEditSignatureButton(t){const i=this.#r=await t.renderEditButton(this.#n);this.#l(i),this.#i.append(i,this.#p)}async addButton(t,i){switch(t){case"colorPicker":this.addColorPicker(i);break;case"altText":await this.addAltText(i);break;case"editSignature":await this.addEditSignatureButton(i);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(i);break}}updateEditSignatureButton(t){this.#r&&(this.#r.title=t)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class xM{#t=null;#e=null;#n;constructor(t){this.#n=t}#i(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Xn,{signal:this.#n._signal});const i=this.#t=document.createElement("div");return i.className="buttons",t.append(i),this.#s(),t}#a(t,i){let a=0,r=0;for(const c of t){const u=c.y+c.height;if(u<a)continue;const h=c.x+(i?c.width:0);if(u>a){r=h,a=u;continue}i?h>r&&(r=h):h<r&&(r=h)}return[i?1-r:r,a]}show(t,i,a){const[r,c]=this.#a(i,a),{style:u}=this.#e||=this.#i();t.append(this.#e),u.insetInlineEnd=`${100*r}%`,u.top=`calc(${100*c}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#s(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const i=document.createElement("span");t.append(i),i.className="visuallyHidden",i.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const a=this.#n._signal;t.addEventListener("contextmenu",Xn,{signal:a}),t.addEventListener("click",()=>{this.#n.highlightSelection("floating_button")},{signal:a}),this.#t.append(t)}}function Jv(l,t,i){for(const a of i)t.addEventListener(a,l[a].bind(l))}class RM{#t=0;get id(){return`${Gv}${this.#t++}`}}class Gf{#t=Qv();#e=0;#n=null;static get _isSVGFittingCanvas(){const t='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>',a=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=t;const c=r.decode().then(()=>(a.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(a.getImageData(0,0,1,1).data.buffer)[0]===0));return zt(this,"_isSVGFittingCanvas",c)}async#i(t,i){this.#n||=new Map;let a=this.#n.get(t);if(a===null)return null;if(a?.bitmap)return a.refCounter+=1,a;try{a||={bitmap:null,id:`image_${this.#t}_${this.#e++}`,refCounter:0,isSvg:!1};let r;if(typeof i=="string"?(a.url=i,r=await Zo(i,"blob")):i instanceof File?r=a.file=i:i instanceof Blob&&(r=i),r.type==="image/svg+xml"){const c=Gf._isSVGFittingCanvas,u=new FileReader,h=new Image,p=new Promise((m,g)=>{h.onload=()=>{a.bitmap=h,a.isSvg=!0,m()},u.onload=async()=>{const y=a.svgUrl=u.result;h.src=await c?`${y}#svgView(preserveAspectRatio(none))`:y},h.onerror=u.onerror=g});u.readAsDataURL(r),await p}else a.bitmap=await createImageBitmap(r);a.refCounter=1}catch(r){wt(r),a=null}return this.#n.set(t,a),a&&this.#n.set(a.id,a),a}async getFromFile(t){const{lastModified:i,name:a,size:r,type:c}=t;return this.#i(`${i}_${a}_${r}_${c}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromBlob(t,i){const a=await i;return this.#i(t,a)}async getFromId(t){this.#n||=new Map;const i=this.#n.get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:a}=i;return delete i.blobPromise,this.getFromBlob(i.id,a)}return this.getFromUrl(i.url)}getFromCanvas(t,i){this.#n||=new Map;let a=this.#n.get(t);if(a?.bitmap)return a.refCounter+=1,a;const r=new OffscreenCanvas(i.width,i.height);return r.getContext("2d").drawImage(i,0,0),a={bitmap:r.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#n.set(t,a),this.#n.set(a.id,a),a}getSvgUrl(t){const i=this.#n.get(t);return i?.isSvg?i.svgUrl:null}deleteId(t){this.#n||=new Map;const i=this.#n.get(t);if(!i||(i.refCounter-=1,i.refCounter!==0))return;const{bitmap:a}=i;if(!i.url&&!i.file){const r=new OffscreenCanvas(a.width,a.height);r.getContext("bitmaprenderer").transferFromImageBitmap(a),i.blobPromise=r.convertToBlob()}a.close?.(),i.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#t}_`)}}class DM{#t=[];#e=!1;#n;#i=-1;constructor(t=128){this.#n=t}add({cmd:t,undo:i,post:a,mustExec:r,type:c=NaN,overwriteIfSameType:u=!1,keepUndo:h=!1}){if(r&&t(),this.#e)return;const p={cmd:t,undo:i,post:a,type:c};if(this.#i===-1){this.#t.length>0&&(this.#t.length=0),this.#i=0,this.#t.push(p);return}if(u&&this.#t[this.#i].type===c){h&&(p.undo=this.#t[this.#i].undo),this.#t[this.#i]=p;return}const m=this.#i+1;m===this.#n?this.#t.splice(0,1):(this.#i=m,m<this.#t.length&&this.#t.splice(m)),this.#t.push(p)}undo(){if(this.#i===-1)return;this.#e=!0;const{undo:t,post:i}=this.#t[this.#i];t(),i?.(),this.#e=!1,this.#i-=1}redo(){if(this.#i<this.#t.length-1){this.#i+=1,this.#e=!0;const{cmd:t,post:i}=this.#t[this.#i];t(),i?.(),this.#e=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#t.length-1}cleanType(t){if(this.#i!==-1){for(let i=this.#i;i>=0;i--)if(this.#t[i].type!==t){this.#t.splice(i+1,this.#i-i),this.#i=i;return}this.#t.length=0,this.#i=-1}}destroy(){this.#t=null}}class nl{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=qe.platform;for(const[a,r,c={}]of t)for(const u of a){const h=u.startsWith("mac+");i&&h?(this.callbacks.set(u.slice(4),{callback:r,options:c}),this.allKeys.add(u.split("+").at(-1))):!i&&!h&&(this.callbacks.set(u,{callback:r,options:c}),this.allKeys.add(u.split("+").at(-1)))}}#t(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const i=this.buffer.join("+");return this.buffer.length=0,i}exec(t,i){if(!this.allKeys.has(i.key))return;const a=this.callbacks.get(this.#t(i));if(!a)return;const{callback:r,options:{bubbles:c=!1,args:u=[],checker:h=null}}=a;h&&!h(t,i)||(r.bind(t,...u,i)(),c||Oe(i))}}class Vf{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return CM(t),zt(this,"_colors",t)}convert(t){const i=Tu(t);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[a,r]of this._colors)if(r.every((c,u)=>c===i[u]))return Vf._colorsMapping.get(a);return i}getHexCode(t){const i=this._colors.get(t);return i?mt.makeHexColor(...i):t}}class Us{#t=new AbortController;#e=null;#n=new Map;#i=new Map;#a=null;#s=null;#r=null;#o=new DM;#u=null;#c=null;#h=null;#l=0;#p=new Set;#g=null;#f=null;#d=new Set;_editorUndoBar=null;#m=!1;#v=!1;#y=!1;#E=null;#A=null;#b=null;#T=null;#D=!1;#_=null;#M=new RM;#R=!1;#x=!1;#C=null;#k=null;#U=null;#N=null;#F=null;#w=Tt.NONE;#S=new Set;#z=null;#H=null;#j=null;#V=null;#q={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#$=[0,0];#L=null;#I=null;#G=null;#Q=null;#P=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=Us.prototype,i=u=>u.#I.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&u.hasSomethingToControl(),a=(u,{target:h})=>{if(h instanceof HTMLInputElement){const{type:p}=h;return p!=="text"&&p!=="number"}return!0},r=this.TRANSLATE_SMALL,c=this.TRANSLATE_BIG;return zt(this,"_keyboardManager",new nl([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:a}],[["ctrl+z","mac+meta+z"],t.undo,{checker:a}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:a}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:a}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(u,{target:h})=>!(h instanceof HTMLButtonElement)&&u.#I.contains(h)&&!u.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(u,{target:h})=>!(h instanceof HTMLButtonElement)&&u.#I.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-c,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[c,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-c],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,c],checker:i}]]))}constructor(t,i,a,r,c,u,h,p,m,g,y,b,S,A,_,R){const C=this._signal=this.#t.signal;this.#I=t,this.#G=i,this.#Q=a,this.#a=r,this.#u=c,this.#H=u,this._eventBus=h,h._on("editingaction",this.onEditingAction.bind(this),{signal:C}),h._on("pagechanging",this.onPageChanging.bind(this),{signal:C}),h._on("scalechanging",this.onScaleChanging.bind(this),{signal:C}),h._on("rotationchanging",this.onRotationChanging.bind(this),{signal:C}),h._on("setpreference",this.onSetPreference.bind(this),{signal:C}),h._on("switchannotationeditorparams",N=>this.updateParams(N.type,N.value),{signal:C}),this.#at(),this.#ct(),this.#Z(),this.#s=p.annotationStorage,this.#E=p.filterFactory,this.#j=m,this.#T=g||null,this.#m=y,this.#v=b,this.#y=S,this.#F=A||null,this.viewParameters={realScale:Cr.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=_||null,this._supportsPinchToZoom=R!==!1}destroy(){this.#P?.resolve(),this.#P=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const t of this.#i.values())t.destroy();this.#i.clear(),this.#n.clear(),this.#d.clear(),this.#N?.clear(),this.#e=null,this.#S.clear(),this.#o.destroy(),this.#a?.destroy(),this.#u?.destroy(),this.#H?.destroy(),this.#_?.hide(),this.#_=null,this.#U?.destroy(),this.#U=null,this.#A&&(clearTimeout(this.#A),this.#A=null),this.#L&&(clearTimeout(this.#L),this.#L=null),this._editorUndoBar?.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#F}get useNewAltTextFlow(){return this.#v}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return zt(this,"hcmFilter",this.#j?this.#E.addHCMFilter(this.#j.foreground,this.#j.background):"none")}get direction(){return zt(this,"direction",getComputedStyle(this.#I).direction)}get _highlightColors(){return zt(this,"_highlightColors",this.#T?new Map(this.#T.split(",").map(t=>(t=t.split("=").map(i=>i.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return zt(this,"highlightColors",null);const i=new Map,a=!!this.#j;for(const[r,c]of t){const u=r.endsWith("_HCM");if(a&&u){i.set(r.replace("_HCM",""),c);continue}!a&&!u&&i.set(r,c)}return zt(this,"highlightColors",i)}get highlightColorNames(){return zt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const i=this.highlightColorNames.get(t);return this._highlightColors.get(i)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=t}setMainHighlightColorPicker(t){this.#U=t}editAltText(t,i=!1){this.#a?.editAltText(this,t,i)}hasCommentManager(){return!!this.#u}editComment(t,i){this.#u?.open(this,t,i)}getSignature(t){this.#H?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#H}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){switch(t){case"enableNewAltTextWhenAddingImage":this.#y=i;break}}onPageChanging({pageNumber:t}){this.#l=t-1}focusMainContainer(){this.#I.focus()}findParent(t,i){for(const a of this.#i.values()){const{x:r,y:c,width:u,height:h}=a.div.getBoundingClientRect();if(t>=r&&t<=r+u&&i>=c&&i<=c+h)return a}return null}disableUserSelect(t=!1){this.#G.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#d.add(t)}removeShouldRescale(t){this.#d.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Cr.PDF_TO_CSS_UNITS;for(const i of this.#d)i.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#X({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#K(t){const{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(const a of this.#i.values())if(a.hasTextLayer(t))return a;return null}highlightSelection(t=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:a,anchorOffset:r,focusNode:c,focusOffset:u}=i,h=i.toString(),m=this.#X(i).closest(".textLayer"),g=this.getSelectionBoxes(m);if(!g)return;i.empty();const y=this.#K(m),b=this.#w===Tt.NONE,S=()=>{y?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:g,anchorNode:a,anchorOffset:r,focusNode:c,focusOffset:u,text:h}),b&&this.showAllEditors("highlight",!0,!0)};if(b){this.switchToMode(Tt.HIGHLIGHT,S);return}S()}#it(){const t=document.getSelection();if(!t||t.isCollapsed)return;const a=this.#X(t).closest(".textLayer"),r=this.getSelectionBoxes(a);r&&(this.#_||=new xM(this),this.#_.show(a,r,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#s&&!this.#s.has(t.id)&&this.#s.setValue(t.id,t)}a11yAlert(t,i=null){const a=this.#Q;a&&(a.setAttribute("data-l10n-id",t),i?a.setAttribute("data-l10n-args",JSON.stringify(i)):a.removeAttribute("data-l10n-args"))}#st(){const t=document.getSelection();if(!t||t.isCollapsed){this.#z&&(this.#_?.hide(),this.#z=null,this.#O({hasSelectedText:!1}));return}const{anchorNode:i}=t;if(i===this.#z)return;const r=this.#X(t).closest(".textLayer");if(!r){this.#z&&(this.#_?.hide(),this.#z=null,this.#O({hasSelectedText:!1}));return}if(this.#_?.hide(),this.#z=i,this.#O({hasSelectedText:!0}),!(this.#w!==Tt.HIGHLIGHT&&this.#w!==Tt.NONE)&&(this.#w===Tt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#D=this.isShiftKeyDown,!this.isShiftKeyDown)){const c=this.#w===Tt.HIGHLIGHT?this.#K(r):null;c?.toggleDrawing();const u=new AbortController,h=this.combinedSignal(u),p=m=>{m.type==="pointerup"&&m.button!==0||(u.abort(),c?.toggleDrawing(!0),m.type==="pointerup"&&this.#W("main_toolbar"))};window.addEventListener("pointerup",p,{signal:h}),window.addEventListener("blur",p,{signal:h})}}#W(t=""){this.#w===Tt.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#it()}#at(){document.addEventListener("selectionchange",this.#st.bind(this),{signal:this._signal})}#rt(){if(this.#b)return;this.#b=new AbortController;const t=this.combinedSignal(this.#b);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#ot(){this.#b?.abort(),this.#b=null}blur(){if(this.isShiftKeyDown=!1,this.#D&&(this.#D=!1,this.#W("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const i of this.#S)if(i.div.contains(t)){this.#k=[i,t],i._focusEventsAllowed=!1;break}}focus(){if(!this.#k)return;const[t,i]=this.#k;this.#k=null,i.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}#Z(){if(this.#C)return;this.#C=new AbortController;const t=this.combinedSignal(this.#C);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#lt(){this.#C?.abort(),this.#C=null}#J(){if(this.#c)return;this.#c=new AbortController;const t=this.combinedSignal(this.#c);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#tt(){this.#c?.abort(),this.#c=null}#ct(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#Z(),this.#J()}removeEditListeners(){this.#lt(),this.#tt()}dragOver(t){for(const{type:i}of t.dataTransfer.items)for(const a of this.#f)if(a.isHandlingMimeForPasting(i)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const i of t.dataTransfer.items)for(const a of this.#f)if(a.isHandlingMimeForPasting(i.type)){a.paste(i,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const i=[];for(const a of this.#S){const r=a.serialize(!0);r&&i.push(r)}i.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:i}=t;for(const c of i.items)for(const u of this.#f)if(u.isHandlingMimeForPasting(c.type)){u.paste(c,this.currentLayer);return}let a=i.getData("application/pdfjs");if(!a)return;try{a=JSON.parse(a)}catch(c){wt(`paste: "${c.message}".`);return}if(!Array.isArray(a))return;this.unselectAll();const r=this.currentLayer;try{const c=[];for(const p of a){const m=await r.deserialize(p);if(!m)return;c.push(m)}const u=()=>{for(const p of c)this.#et(p);this.#nt(c)},h=()=>{for(const p of c)p.remove()};this.addCommands({cmd:u,undo:h,mustExec:!0})}catch(c){wt(`paste: "${c.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#w!==Tt.NONE&&!this.isEditorHandlingKeyboard&&Us._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#D&&(this.#D=!1,this.#W("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#O(t){Object.entries(t).some(([a,r])=>this.#q[a]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#q,t)}),this.#w===Tt.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#B([[$t.HIGHLIGHT_FREE,!0]]))}#B(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#rt(),this.#J(),this.#O({isEditing:this.#w!==Tt.NONE,isEmpty:this.#Y(),hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:this.#o.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ot(),this.#tt(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#f){this.#f=t;for(const i of this.#f)this.#B(i.defaultPropertiesToUpdate)}}getId(){return this.#M.id}get currentLayer(){return this.#i.get(this.#l)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#l}addLayer(t){this.#i.set(t.pageIndex,t),this.#R?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}async updateMode(t,i=null,a=!1,r=!1,c=!1){if(this.#w!==t&&!(this.#P&&(await this.#P.promise,!this.#P))){if(this.#P=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#w=t,t===Tt.NONE){this.setEditingState(!1),this.#dt(),this._editorUndoBar?.hide(),this.#P.resolve();return}t===Tt.SIGNATURE&&await this.#H?.loadSignatures(),this.setEditingState(!0),await this.#ut(),this.unselectAll();for(const u of this.#i.values())u.updateMode(t);if(!i){a&&this.addNewEditorFromKeyboard(),this.#P.resolve();return}for(const u of this.#n.values())u.annotationElementId===i||u.id===i?(this.setSelected(u),c?u.editComment():r&&u.enterInEditMode()):u.unselect();this.#P.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#w&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,i){if(this.#f){switch(t){case $t.CREATE:this.currentLayer.addNewEditor(i);return;case $t.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#V||=new Map).set(t,i),this.showAllEditors("highlight",i);break}if(this.hasSelection)for(const a of this.#S)a.updateParams(t,i);else for(const a of this.#f)a.updateDefaultParams(t,i)}}showAllEditors(t,i,a=!1){for(const c of this.#n.values())c.editorType===t&&c.show(i);(this.#V?.get($t.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#B([[$t.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(this.#x!==t){this.#x=t;for(const i of this.#i.values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}async#ut(){if(!this.#R){this.#R=!0;const t=[];for(const i of this.#i.values())t.push(i.enable());await Promise.all(t);for(const i of this.#n.values())i.enable()}}#dt(){if(this.unselectAll(),this.#R){this.#R=!1;for(const t of this.#i.values())t.disable();for(const t of this.#n.values())t.disable()}}getEditors(t){const i=[];for(const a of this.#n.values())a.pageIndex===t&&i.push(a);return i}getEditor(t){return this.#n.get(t)}addEditor(t){this.#n.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#A&&clearTimeout(this.#A),this.#A=setTimeout(()=>{this.focusMainContainer(),this.#A=null},0)),this.#n.delete(t.id),t.annotationElementId&&this.#N?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!this.#p.has(t.annotationElementId))&&this.#s?.remove(t.id)}addDeletedAnnotationElement(t){this.#p.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#p.has(t)}removeDeletedAnnotationElement(t){this.#p.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#et(t){const i=this.#i.get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#e!==t&&(this.#e=t,t&&this.#B(t.propertiesToUpdate))}get#ht(){let t=null;for(t of this.#S);return t}updateUI(t){this.#ht===t&&this.#B(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#B(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#S.has(t)){this.#S.delete(t),t.unselect(),this.#O({hasSelectedEditor:this.hasSelection});return}this.#S.add(t),t.select(),this.#B(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.id}),this.#h?.commitOrRemove();for(const i of this.#S)i!==t&&i.unselect();this.#S.clear(),this.#S.add(t),t.select(),this.#B(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(t){return this.#S.has(t)}get firstSelectedEditor(){return this.#S.values().next().value}unselect(t){t.unselect(),this.#S.delete(t),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#S.size!==0}get isEnterHandled(){return this.#S.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#o.undo(),this.#O({hasSomethingToUndo:this.#o.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Y()}),this._editorUndoBar?.hide()}redo(){this.#o.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#o.hasSomethingToRedo(),isEmpty:this.#Y()})}addCommands(t){this.#o.add(t),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Y()})}cleanUndoStack(t){this.#o.cleanType(t)}#Y(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(const t of this.#n.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const i=t?[t]:[...this.#S],a=()=>{this._editorUndoBar?.show(r,i.length===1?i[0].editorType:i.length);for(const c of i)c.remove()},r=()=>{for(const c of i)this.#et(c)};this.addCommands({cmd:a,undo:r,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#nt(t){for(const i of this.#S)i.unselect();this.#S.clear();for(const i of t)i.isEmpty()||(this.#S.add(i),i.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#S)t.commit();this.#nt(this.#n.values())}unselectAll(){if(!(this.#e&&(this.#e.commitOrRemove(),this.#w!==Tt.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(const t of this.#S)t.unselect();this.#S.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(t,i,a=!1){if(a||this.commitOrRemove(),!this.hasSelection)return;this.#$[0]+=t,this.#$[1]+=i;const[r,c]=this.#$,u=[...this.#S],h=1e3;this.#L&&clearTimeout(this.#L),this.#L=setTimeout(()=>{this.#L=null,this.#$[0]=this.#$[1]=0,this.addCommands({cmd:()=>{for(const p of u)this.#n.has(p.id)&&(p.translateInPage(r,c),p.translationDone())},undo:()=>{for(const p of u)this.#n.has(p.id)&&(p.translateInPage(-r,-c),p.translationDone())},mustExec:!1})},h);for(const p of u)p.translateInPage(t,i),p.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(const t of this.#S)this.#g.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);const t=this.#g;this.#g=null;let i=!1;for(const[{x:r,y:c,pageIndex:u},h]of t)h.newX=r,h.newY=c,h.newPageIndex=u,i||=r!==h.savedX||c!==h.savedY||u!==h.savedPageIndex;if(!i)return!1;const a=(r,c,u,h)=>{if(this.#n.has(r.id)){const p=this.#i.get(h);p?r._setParentAndPosition(p,c,u):(r.pageIndex=h,r.x=c,r.y=u)}};return this.addCommands({cmd:()=>{for(const[r,{newX:c,newY:u,newPageIndex:h}]of t)a(r,c,u,h)},undo:()=>{for(const[r,{savedX:c,savedY:u,savedPageIndex:h}]of t)a(r,c,u,h)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(this.#g)for(const a of this.#g.keys())a.drag(t,i)}rebuild(t){if(t.parent===null){const i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#S.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#e===t}getActive(){return this.#e}getMode(){return this.#w}get imageManager(){return zt(this,"imageManager",new Gf)}getSelectionBoxes(t){if(!t)return null;const i=document.getSelection();for(let m=0,g=i.rangeCount;m<g;m++)if(!t.contains(i.getRangeAt(m).commonAncestorContainer))return null;const{x:a,y:r,width:c,height:u}=t.getBoundingClientRect();let h;switch(t.getAttribute("data-main-rotation")){case"90":h=(m,g,y,b)=>({x:(g-r)/u,y:1-(m+y-a)/c,width:b/u,height:y/c});break;case"180":h=(m,g,y,b)=>({x:1-(m+y-a)/c,y:1-(g+b-r)/u,width:y/c,height:b/u});break;case"270":h=(m,g,y,b)=>({x:1-(g+b-r)/u,y:(m-a)/c,width:b/u,height:y/c});break;default:h=(m,g,y,b)=>({x:(m-a)/c,y:(g-r)/u,width:y/c,height:b/u});break}const p=[];for(let m=0,g=i.rangeCount;m<g;m++){const y=i.getRangeAt(m);if(!y.collapsed)for(const{x:b,y:S,width:A,height:_}of y.getClientRects())A===0||_===0||p.push(h(b,S,A,_))}return p.length===0?null:p}addChangedExistingAnnotation({annotationElementId:t,id:i}){(this.#r||=new Map).set(t,i)}removeChangedExistingAnnotation({annotationElementId:t}){this.#r?.delete(t)}renderAnnotationElement(t){const i=this.#r?.get(t.data.id);if(!i)return;const a=this.#s.getRawValue(i);a&&(this.#w===Tt.NONE&&!a.hasBeenModified||a.renderAnnotationElement(t))}setMissingCanvas(t,i,a){const r=this.#N?.get(t);r&&(r.setCanvas(i,a),this.#N.delete(t))}addMissingCanvas(t,i){(this.#N||=new Map).set(t,i)}}class Mi{#t=null;#e=!1;#n=null;#i=null;#a=null;#s=null;#r=!1;#o=null;#u=null;#c=null;#h=null;#l=!1;static#p=null;static _l10n=null;constructor(t){this.#u=t,this.#l=t._uiManager.useNewAltTextFlow,Mi.#p||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){Mi._l10n??=t}async render(){const t=this.#n=document.createElement("button");t.className="altText",t.tabIndex="0";const i=this.#i=document.createElement("span");t.append(i),this.#l?(t.classList.add("new"),t.setAttribute("data-l10n-id",Mi.#p.missing),i.setAttribute("data-l10n-id",Mi.#p["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const a=this.#u._uiManager._signal;t.addEventListener("contextmenu",Xn,{signal:a}),t.addEventListener("pointerdown",c=>c.stopPropagation(),{signal:a});const r=c=>{c.preventDefault(),this.#u._uiManager.editAltText(this.#u),this.#l&&this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#g}})};return t.addEventListener("click",r,{capture:!0,signal:a}),t.addEventListener("keydown",c=>{c.target===t&&c.key==="Enter"&&(this.#r=!0,r(c))},{signal:a}),await this.#f(),t}get#g(){return this.#t&&"added"||this.#t===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return this.#l?this.#t===null:!this.#t&&!this.#e}hasData(){return this.#l?this.#t!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(t){this.#t===null&&(this.#c=t,this.#h=await Mi._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#f())}toggleAltTextBadge(t=!1){if(!this.#l||this.#t){this.#o?.remove(),this.#o=null;return}if(!this.#o){const i=this.#o=document.createElement("div");i.className="noAltTextBadge",this.#u.div.append(i)}this.#o.classList.toggle("hidden",!t)}serialize(t){let i=this.#t;return!t&&this.#c===i&&(i=this.#h),{altText:i,decorative:this.#e,guessedText:this.#c,textWithDisclaimer:this.#h}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:i,guessedText:a,textWithDisclaimer:r,cancel:c=!1}){a&&(this.#c=a,this.#h=r),!(this.#t===t&&this.#e===i)&&(c||(this.#t=t,this.#e=i),this.#f())}toggle(t=!1){this.#n&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#n.disabled=!t)}shown(){this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#g}})}destroy(){this.#n?.remove(),this.#n=null,this.#i=null,this.#a=null,this.#o?.remove(),this.#o=null}async#f(){const t=this.#n;if(!t)return;if(this.#l){if(t.classList.toggle("done",!!this.#t),t.setAttribute("data-l10n-id",Mi.#p[this.#g]),this.#i?.setAttribute("data-l10n-id",Mi.#p[`${this.#g}-label`]),!this.#t){this.#a?.remove();return}}else{if(!this.#t&&!this.#e){t.classList.remove("done"),this.#a?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=this.#a;if(!i){this.#a=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${this.#u.id}`;const r=100,c=this.#u._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#a.classList.add("show"),this.#u._reportTelemetry({action:"alt_text_tooltip"})},r)},{signal:c}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#a?.classList.remove("show")},{signal:c})}this.#e?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=this.#t),i.parentNode||t.append(i),this.#u.getElementForAltText()?.setAttribute("aria-describedby",i.id)}}class wu{#t=null;#e=!1;#n=null;#i=null;#a=null;#s=null;#r=!1;constructor(t){this.#n=t,this.toolbar=null}render(){if(!this.#n._uiManager.hasCommentManager())return null;const t=this.#t=document.createElement("button");t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const i=this.#n._uiManager._signal;t.addEventListener("contextmenu",Xn,{signal:i}),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:i});const a=r=>{r.preventDefault(),this.edit()};return t.addEventListener("click",a,{capture:!0,signal:i}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(this.#e=!0,a(r))},{signal:i}),t}edit(){const{bottom:t,left:i,right:a}=this.#n.getClientDimensions(),r={top:t};this.#n._uiManager.direction==="ltr"?r.right=a:r.left=i,this.#n._uiManager.editComment(this.#n,r)}finish(){this.#t&&(this.#t.focus({focusVisible:this.#e}),this.#e=!1)}isDeleted(){return this.#r||this.#a===""}hasBeenEdited(){return this.isDeleted()||this.#a!==this.#i}serialize(){return this.data}get data(){return{text:this.#a,date:this.#s,deleted:this.#r}}set data(t){if(t===null){this.#a="",this.#r=!0;return}this.#a=t,this.#s=new Date,this.#r=!1}setInitialText(t){this.#i=t,this.data=t}toggle(t=!1){this.#t&&(this.#t.disabled=!t)}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#a="",this.#s=null,this.#n=null,this.#e=!1,this.#r=!1}}class Cu{#t;#e=!1;#n=null;#i;#a;#s;#r;#o=null;#u;#c=null;#h;#l=null;constructor({container:t,isPinchingDisabled:i=null,isPinchingStopped:a=null,onPinchStart:r=null,onPinching:c=null,onPinchEnd:u=null,signal:h}){this.#t=t,this.#n=a,this.#i=i,this.#a=r,this.#s=c,this.#r=u,this.#h=new AbortController,this.#u=AbortSignal.any([h,this.#h.signal]),t.addEventListener("touchstart",this.#p.bind(this),{passive:!1,signal:this.#u})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Di.pixelRatio}#p(t){if(this.#i?.())return;if(t.touches.length===1){if(this.#o)return;const r=this.#o=new AbortController,c=AbortSignal.any([this.#u,r.signal]),u=this.#t,h={capture:!0,signal:c,passive:!1},p=m=>{m.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};u.addEventListener("pointerdown",m=>{m.pointerType==="touch"&&(Oe(m),p(m))},h),u.addEventListener("pointerup",p,h),u.addEventListener("pointercancel",p,h);return}if(!this.#l){this.#l=new AbortController;const r=AbortSignal.any([this.#u,this.#l.signal]),c=this.#t,u={signal:r,capture:!1,passive:!1};c.addEventListener("touchmove",this.#g.bind(this),u);const h=this.#f.bind(this);c.addEventListener("touchend",h,u),c.addEventListener("touchcancel",h,u),u.capture=!0,c.addEventListener("pointerdown",Oe,u),c.addEventListener("pointermove",Oe,u),c.addEventListener("pointercancel",Oe,u),c.addEventListener("pointerup",Oe,u),this.#a?.()}if(Oe(t),t.touches.length!==2||this.#n?.()){this.#c=null;return}let[i,a]=t.touches;i.identifier>a.identifier&&([i,a]=[a,i]),this.#c={touch0X:i.screenX,touch0Y:i.screenY,touch1X:a.screenX,touch1Y:a.screenY}}#g(t){if(!this.#c||t.touches.length!==2)return;Oe(t);let[i,a]=t.touches;i.identifier>a.identifier&&([i,a]=[a,i]);const{screenX:r,screenY:c}=i,{screenX:u,screenY:h}=a,p=this.#c,{touch0X:m,touch0Y:g,touch1X:y,touch1Y:b}=p,S=y-m,A=b-g,_=u-r,R=h-c,C=Math.hypot(_,R)||1,N=Math.hypot(S,A)||1;if(!this.#e&&Math.abs(N-C)<=Cu.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(p.touch0X=r,p.touch0Y=c,p.touch1X=u,p.touch1Y=h,!this.#e){this.#e=!0;return}const O=[(r+u)/2,(c+h)/2];this.#s?.(O,N,C)}#f(t){t.touches.length>=2||(this.#l&&(this.#l.abort(),this.#l=null,this.#r?.()),this.#c&&(Oe(t),this.#c=null,this.#e=!1))}destroy(){this.#h?.abort(),this.#h=null,this.#o?.abort(),this.#o=null}}class gt{#t=null;#e=null;#n=null;#i=null;#a=!1;#s=null;#r="";#o=!1;#u=null;#c=null;#h=null;#l=null;#p="";#g=!1;#f=null;#d=!1;#m=!1;#v=!1;#y=null;#E=0;#A=0;#b=null;#T=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#D=!1;#_=gt._zIndex++;static _borderLineWidth=-1;static _colorManager=new Vf;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=gt.prototype._resizeWithKeyboard,i=Us.TRANSLATE_SMALL,a=Us.TRANSLATE_BIG;return zt(this,"_resizerKeyboardManager",new nl([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-a,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[a,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-a]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,a]}],[["Escape","mac+Escape"],gt.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null;const{rotation:i,rawDims:{pageWidth:a,pageHeight:r,pageX:c,pageY:u}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[a,r],this.pageTranslation=[c,u];const[h,p]=this.parentDimensions;this.x=t.x/h,this.y=t.y/p,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return zt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const i=new MM({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});i.annotationElementId=t.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(t,i){if(gt._l10n??=t,gt._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),gt._borderLineWidth!==-1)return;const a=getComputedStyle(document.documentElement);gt._borderLineWidth=parseFloat(a.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,i){ne("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#D}set _isDraggable(t){this.#D=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(t*2),this.y+=this.width*t/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(t*2),this.y-=this.width*t/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#_}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#G(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,i,a,r){const[c,u]=this.parentDimensions;[a,r]=this.screenToPageTranslation(a,r),this.x=(t+a)/c,this.y=(i+r)/u,this.fixAndSetPosition()}_moveAfterPaste(t,i){const[a,r]=this.parentDimensions;this.setAt(t*a,i*r,this.width*a,this.height*r),this._onTranslated()}#M([t,i],a,r){[a,r]=this.screenToPageTranslation(a,r),this.x+=a/t,this.y+=r/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,i){this.#M(this.parentDimensions,t,i)}translateInPage(t,i){this.#f||=[this.x,this.y,this.width,this.height],this.#M(this.pageDimensions,t,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,i){this.#f||=[this.x,this.y,this.width,this.height];const{div:a,parentDimensions:[r,c]}=this;if(this.x+=t/r,this.y+=i/c,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:y,y:b}=this.div.getBoundingClientRect();this.parent.findNewParent(this,y,b)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:u,y:h}=this;const[p,m]=this.getBaseTranslation();u+=p,h+=m;const{style:g}=a;g.left=`${(100*u).toFixed(2)}%`,g.top=`${(100*h).toFixed(2)}%`,this._onTranslating(u,h),a.scrollIntoView({block:"nearest"})}_onTranslating(t,i){}_onTranslated(t,i){}get _hasBeenMoved(){return!!this.#f&&(this.#f[0]!==this.x||this.#f[1]!==this.y)}get _hasBeenResized(){return!!this.#f&&(this.#f[2]!==this.width||this.#f[3]!==this.height)}getBaseTranslation(){const[t,i]=this.parentDimensions,{_borderLineWidth:a}=gt,r=a/t,c=a/i;switch(this.rotation){case 90:return[-r,c];case 180:return[r,c];case 270:return[r,-c];default:return[-r,-c]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:i},pageDimensions:[a,r]}=this;let{x:c,y:u,width:h,height:p}=this;if(h*=a,p*=r,c*=a,u*=r,this._mustFixPosition)switch(t){case 0:c=hn(c,0,a-h),u=hn(u,0,r-p);break;case 90:c=hn(c,0,a-p),u=hn(u,h,r);break;case 180:c=hn(c,h,a),u=hn(u,p,r);break;case 270:c=hn(c,p,a),u=hn(u,0,r-h);break}this.x=c/=a,this.y=u/=r;const[m,g]=this.getBaseTranslation();c+=m,u+=g,i.left=`${(100*c).toFixed(2)}%`,i.top=`${(100*u).toFixed(2)}%`,this.moveInDOM()}static#R(t,i,a){switch(a){case 90:return[i,-t];case 180:return[-t,-i];case 270:return[-i,t];default:return[t,i]}}screenToPageTranslation(t,i){return gt.#R(t,i,this.parentRotation)}pageTranslationToScreen(t,i){return gt.#R(t,i,360-this.parentRotation)}#x(t){switch(t){case 90:{const[i,a]=this.pageDimensions;return[0,-i/a,a/i,0]}case 180:return[-1,0,0,-1];case 270:{const[i,a]=this.pageDimensions;return[0,i/a,-a/i,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:t,pageDimensions:[i,a]}=this;return[i*t,a*t]}setDims(t,i){const[a,r]=this.parentDimensions,{style:c}=this.div;c.width=`${(100*t/a).toFixed(2)}%`,this.#o||(c.height=`${(100*i/r).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:i,width:a}=t,r=a.endsWith("%"),c=!this.#o&&i.endsWith("%");if(r&&c)return;const[u,h]=this.parentDimensions;r||(t.width=`${(100*parseFloat(a)/u).toFixed(2)}%`),!this.#o&&!c&&(t.height=`${(100*parseFloat(i)/h).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#C(){if(this.#u)return;this.#u=document.createElement("div"),this.#u.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const a of t){const r=document.createElement("div");this.#u.append(r),r.classList.add("resizer",a),r.setAttribute("data-resizer-name",a),r.addEventListener("pointerdown",this.#k.bind(this,a),{signal:i}),r.addEventListener("contextmenu",Xn,{signal:i}),r.tabIndex=-1}this.div.prepend(this.#u)}#k(t,i){i.preventDefault();const{isMac:a}=qe.platform;if(i.button!==0||i.ctrlKey&&a)return;this.#n?.toggle(!1);const r=this._isDraggable;this._isDraggable=!1,this.#c=[i.screenX,i.screenY];const c=new AbortController,u=this._uiManager.combinedSignal(c);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#F.bind(this,t),{passive:!0,capture:!0,signal:u}),window.addEventListener("touchmove",Oe,{passive:!1,signal:u}),window.addEventListener("contextmenu",Xn,{signal:u}),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const h=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const m=()=>{c.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=h,this.div.style.cursor=p,this.#N()};window.addEventListener("pointerup",m,{signal:u}),window.addEventListener("blur",m,{signal:u})}#U(t,i,a,r){this.width=a,this.height=r,this.x=t,this.y=i;const[c,u]=this.parentDimensions;this.setDims(c*a,u*r),this.fixAndSetPosition(),this._onResized()}_onResized(){}#N(){if(!this.#h)return;const{savedX:t,savedY:i,savedWidth:a,savedHeight:r}=this.#h;this.#h=null;const c=this.x,u=this.y,h=this.width,p=this.height;c===t&&u===i&&h===a&&p===r||this.addCommands({cmd:this.#U.bind(this,c,u,h,p),undo:this.#U.bind(this,t,i,a,r),mustExec:!0})}static _round(t){return Math.round(t*1e4)/1e4}#F(t,i){const[a,r]=this.parentDimensions,c=this.x,u=this.y,h=this.width,p=this.height,m=gt.MIN_SIZE/a,g=gt.MIN_SIZE/r,y=this.#x(this.rotation),b=(B,Q)=>[y[0]*B+y[2]*Q,y[1]*B+y[3]*Q],S=this.#x(360-this.rotation),A=(B,Q)=>[S[0]*B+S[2]*Q,S[1]*B+S[3]*Q];let _,R,C=!1,N=!1;switch(t){case"topLeft":C=!0,_=(B,Q)=>[0,0],R=(B,Q)=>[B,Q];break;case"topMiddle":_=(B,Q)=>[B/2,0],R=(B,Q)=>[B/2,Q];break;case"topRight":C=!0,_=(B,Q)=>[B,0],R=(B,Q)=>[0,Q];break;case"middleRight":N=!0,_=(B,Q)=>[B,Q/2],R=(B,Q)=>[0,Q/2];break;case"bottomRight":C=!0,_=(B,Q)=>[B,Q],R=(B,Q)=>[0,0];break;case"bottomMiddle":_=(B,Q)=>[B/2,Q],R=(B,Q)=>[B/2,0];break;case"bottomLeft":C=!0,_=(B,Q)=>[0,Q],R=(B,Q)=>[B,0];break;case"middleLeft":N=!0,_=(B,Q)=>[0,Q/2],R=(B,Q)=>[B,Q/2];break}const O=_(h,p),U=R(h,p);let I=b(...U);const j=gt._round(c+I[0]),F=gt._round(u+I[1]);let J=1,X=1,at,K;if(i.fromKeyboard)({deltaX:at,deltaY:K}=i);else{const{screenX:B,screenY:Q}=i,[dt,Ct]=this.#c;[at,K]=this.screenToPageTranslation(B-dt,Q-Ct),this.#c[0]=B,this.#c[1]=Q}if([at,K]=A(at/a,K/r),C){const B=Math.hypot(h,p);J=X=Math.max(Math.min(Math.hypot(U[0]-O[0]-at,U[1]-O[1]-K)/B,1/h,1/p),m/h,g/p)}else N?J=hn(Math.abs(U[0]-O[0]-at),m,1)/h:X=hn(Math.abs(U[1]-O[1]-K),g,1)/p;const lt=gt._round(h*J),St=gt._round(p*X);I=b(...R(lt,St));const yt=j-I[0],Gt=F-I[1];this.#f||=[this.x,this.y,this.width,this.height],this.width=lt,this.height=St,this.x=yt,this.y=Gt,this.setDims(a*lt,r*St),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#m)return this._editToolbar;this._editToolbar=new el(this),this.div.append(this._editToolbar.render()),this._editToolbar.addButton("comment",this.addCommentButton());const{toolbarButtons:t}=this;if(t)for(const[i,a]of t)await this._editToolbar.addButton(i,a);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#n?.destroy())}addContainer(t){const i=this._editToolbar?.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Mi.initialize(gt._l10n),this.#n=new Mi(this),this.#t&&(this.#n.data=this.#t,this.#t=null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(t){this.#n&&(this.#n.data=t)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(t){await this.#n?.setGuessedText(t)}serializeAltText(t){return this.#n?.serialize(t)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}addCommentButton(){return this.#i?this.#i:this.#i=new wu(this)}get commentColor(){return null}get comment(){const t=this.#i;return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){this.#i||(this.#i=new wu(this)),this.#i.data=t}setCommentData(t){this.#i||(this.#i=new wu(this)),this.#i.setInitialText(t)}get hasEditedComment(){return this.#i?.hasBeenEdited()}async editComment(){this.#i||(this.#i=new wu(this)),this.#i.edit()}addComment(t){this.hasEditedComment&&(t.popup={contents:this.comment.text,deleted:this.comment.deleted})}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#a?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#V();const[i,a]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*a/i).toFixed(2)}%`,t.style.maxHeight=`${(100*i/a).toFixed(2)}%`);const[r,c]=this.getInitialTranslation();return this.translate(r,c),Jv(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#T||=new Cu({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#w.bind(this),onPinching:this.#S.bind(this),onPinchEnd:this.#z.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),t}#w(){this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#S(t,i,a){let c=.7*(a/i)+1-.7;if(c===1)return;const u=this.#x(this.rotation),h=(j,F)=>[u[0]*j+u[2]*F,u[1]*j+u[3]*F],[p,m]=this.parentDimensions,g=this.x,y=this.y,b=this.width,S=this.height,A=gt.MIN_SIZE/p,_=gt.MIN_SIZE/m;c=Math.max(Math.min(c,1/b,1/S),A/b,_/S);const R=gt._round(b*c),C=gt._round(S*c);if(R===b&&C===S)return;this.#f||=[g,y,b,S];const N=h(b/2,S/2),O=gt._round(g+N[0]),U=gt._round(y+N[1]),I=h(R/2,C/2);this.x=O-I[0],this.y=U-I[1],this.width=R,this.height=C,this.setDims(p*R,m*C),this.fixAndSetPosition(),this._onResizing()}#z(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#N()}pointerdown(t){const{isMac:i}=qe.platform;if(t.button!==0||t.ctrlKey&&i){t.preventDefault();return}if(this.#g=!0,this._isDraggable){this.#j(t);return}this.#H(t)}#H(t){const{isMac:i}=qe.platform;t.ctrlKey&&!i||t.shiftKey||t.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)}#j(t){const{isSelected:i}=this;this._uiManager.setUpDragSession();let a=!1;const r=new AbortController,c=this._uiManager.combinedSignal(r),u={capture:!0,passive:!1,signal:c},h=m=>{r.abort(),this.#s=null,this.#g=!1,this._uiManager.endDragSession()||this.#H(m),a&&this._onStopDragging()};i&&(this.#E=t.clientX,this.#A=t.clientY,this.#s=t.pointerId,this.#r=t.pointerType,window.addEventListener("pointermove",m=>{a||(a=!0,this._onStartDragging());const{clientX:g,clientY:y,pointerId:b}=m;if(b!==this.#s){Oe(m);return}const[S,A]=this.screenToPageTranslation(g-this.#E,y-this.#A);this.#E=g,this.#A=y,this._uiManager.dragSelectedEditors(S,A)},u),window.addEventListener("touchmove",Oe,u),window.addEventListener("pointerdown",m=>{m.pointerType===this.#r&&(this.#T||m.isPrimary)&&h(m),Oe(m)},u));const p=m=>{if(!this.#s||this.#s===m.pointerId){h(m);return}Oe(m)};window.addEventListener("pointerup",p,{signal:c}),window.addEventListener("blur",p,{signal:c})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,i,a){t.changeParent(this),this.x=i,this.y=a,this.fixAndSetPosition(),this._onTranslated()}getRect(t,i,a=this.rotation){const r=this.parentScale,[c,u]=this.pageDimensions,[h,p]=this.pageTranslation,m=t/r,g=i/r,y=this.x*c,b=this.y*u,S=this.width*c,A=this.height*u;switch(a){case 0:return[y+m+h,u-b-g-A+p,y+m+S+h,u-b-g+p];case 90:return[y+g+h,u-b+m+p,y+g+A+h,u-b+m+S+p];case 180:return[y-m-S+h,u-b+g+p,y-m+h,u-b+g+A+p];case 270:return[y-g-A+h,u-b-m-S+p,y-g+h,u-b-m+p];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,i){const[a,r,c,u]=t,h=c-a,p=u-r;switch(this.rotation){case 0:return[a,i-u,h,p];case 90:return[a,i-r,p,h];case 180:return[c,i-r,h,p];case 270:return[c,i-u,p,h];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#m=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#m=!1,!0):!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:i,bottom:a,right:r}=this.getClientDimensions(),{innerHeight:c,innerWidth:u}=window;return i<u&&r>0&&t<c&&a>0}#V(){if(this.#l||!this.div)return;this.#l=new AbortController;const t=this._uiManager.combinedSignal(this.#l);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#V()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,i=null){ne("An editor must be serializable")}static async deserialize(t,i,a){const r=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:a,annotationElementId:t.annotationElementId});r.rotation=t.rotation,r.#t=t.accessibilityData,r._isCopy=t.isCopy||!1;const[c,u]=r.pageDimensions,[h,p,m,g]=r.getRectInCurrentCoords(t.rect,u);return r.x=h/c,r.y=p/u,r.width=m/c,r.height=g/u,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#l?.abort(),this.#l=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#G(),this.removeEditToolbar(),this.#b){for(const t of this.#b.values())clearTimeout(t);this.#b=null}this.parent=null,this.#T?.destroy(),this.#T=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#C(),this.#u.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const i=this.#u.children;if(!this.#e){this.#e=Array.from(i);const u=this.#q.bind(this),h=this.#$.bind(this),p=this._uiManager._signal;for(const m of this.#e){const g=m.getAttribute("data-resizer-name");m.setAttribute("role","spinbutton"),m.addEventListener("keydown",u,{signal:p}),m.addEventListener("blur",h,{signal:p}),m.addEventListener("focus",this.#L.bind(this,g),{signal:p}),m.setAttribute("data-l10n-id",gt._l10nResizer[g])}}const a=this.#e[0];let r=0;for(const u of i){if(u===a)break;r++}const c=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(c!==r){if(c<r)for(let h=0;h<r-c;h++)this.#u.append(this.#u.firstChild);else if(c>r)for(let h=0;h<c-r;h++)this.#u.firstChild.before(this.#u.lastChild);let u=0;for(const h of i){const m=this.#e[u++].getAttribute("data-resizer-name");h.setAttribute("data-l10n-id",gt._l10nResizer[m])}}this.#I(0),this.#v=!0,this.#u.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#q(t){gt._resizerKeyboardManager.exec(this,t)}#$(t){this.#v&&t.relatedTarget?.parentNode!==this.#u&&this.#G()}#L(t){this.#p=this.#v?t:""}#I(t){if(this.#e)for(const i of this.#e)i.tabIndex=t}_resizeWithKeyboard(t,i){this.#v&&this.#F(this.#p,{deltaX:t,deltaY:i,fromKeyboard:!0})}#G(){this.#v=!1,this.#I(-1),this.#N()}_stopResizingWithKeyboard(){this.#G(),this.div.focus()}select(){if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}}unselect(){this.isSelected&&(this.isSelected=!1,this.#u?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0))}updateParams(t,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#d}set isEditing(t){this.#d=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,i){this.#o=!0;const a=t/i,{style:r}=this.div;r.aspectRatio=a,r.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,i=!1){if(i){this.#b||=new Map;const{action:a}=t;let r=this.#b.get(a);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#b.delete(a),this.#b.size===0&&(this.#b=null)},gt._telemetryTimeout),this.#b.set(a,r);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}renderAnnotationElement(t){let i=t.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.container.prepend(i);else if(i.nodeName==="CANVAS"){const a=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),a.before(i)}return i}resetAnnotationElement(t){const{firstChild:i}=t.container;i?.nodeName==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}}class MM extends gt{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const t0=3285377520,Wn=4294901760,Oi=65535;class e0{constructor(t){this.h1=t?t&4294967295:t0,this.h2=t?t&4294967295:t0}update(t){let i,a;if(typeof t=="string"){i=new Uint8Array(t.length*2),a=0;for(let _=0,R=t.length;_<R;_++){const C=t.charCodeAt(_);C<=255?i[a++]=C:(i[a++]=C>>>8,i[a++]=C&255)}}else if(ArrayBuffer.isView(t))i=t.slice(),a=i.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=a>>2,c=a-r*4,u=new Uint32Array(i.buffer,0,r);let h=0,p=0,m=this.h1,g=this.h2;const y=3432918353,b=461845907,S=y&Oi,A=b&Oi;for(let _=0;_<r;_++)_&1?(h=u[_],h=h*y&Wn|h*S&Oi,h=h<<15|h>>>17,h=h*b&Wn|h*A&Oi,m^=h,m=m<<13|m>>>19,m=m*5+3864292196):(p=u[_],p=p*y&Wn|p*S&Oi,p=p<<15|p>>>17,p=p*b&Wn|p*A&Oi,g^=p,g=g<<13|g>>>19,g=g*5+3864292196);switch(h=0,c){case 3:h^=i[r*4+2]<<16;case 2:h^=i[r*4+1]<<8;case 1:h^=i[r*4],h=h*y&Wn|h*S&Oi,h=h<<15|h>>>17,h=h*b&Wn|h*A&Oi,r&1?m^=h:g^=h}this.h1=m,this.h2=g}hexdigest(){let t=this.h1,i=this.h2;return t^=i>>>1,t=t*3981806797&Wn|t*36045&Oi,i=i*4283543511&Wn|((i<<16|t>>>16)*2950163797&Wn)>>>16,t^=i>>>1,t=t*444984403&Wn|t*60499&Oi,i=i*3301882366&Wn|((i<<16|t>>>16)*3120437893&Wn)>>>16,t^=i>>>1,(t>>>0).toString(16).padStart(8,"0")+(i>>>0).toString(16).padStart(8,"0")}}const qf=Object.freeze({map:null,hash:"",transfer:void 0});class Yf{#t=!1;#e=null;#n=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,i){const a=this.#n.get(t);return a===void 0?i:Object.assign(i,a)}getRawValue(t){return this.#n.get(t)}remove(t){if(this.#n.delete(t),this.#n.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of this.#n.values())if(i instanceof gt)return;this.onAnnotationEditor(null)}}setValue(t,i){const a=this.#n.get(t);let r=!1;if(a!==void 0)for(const[c,u]of Object.entries(i))a[c]!==u&&(r=!0,a[c]=u);else r=!0,this.#n.set(t,i);r&&this.#i(),i instanceof gt&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(t){return this.#n.has(t)}get size(){return this.#n.size}#i(){this.#t||(this.#t=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new n0(this)}get serializable(){if(this.#n.size===0)return qf;const t=new Map,i=new e0,a=[],r=Object.create(null);let c=!1;for(const[u,h]of this.#n){const p=h instanceof gt?h.serialize(!1,r):h;p&&(t.set(u,p),i.update(`${u}:${JSON.stringify(p)}`),c||=!!p.bitmap)}if(c)for(const u of t.values())u.bitmap&&a.push(u.bitmap);return t.size>0?{map:t,hash:i.hexdigest(),transfer:a}:qf}get editorStats(){let t=null;const i=new Map;for(const a of this.#n.values()){if(!(a instanceof gt))continue;const r=a.telemetryFinalData;if(!r)continue;const{type:c}=r;i.has(c)||i.set(c,Object.getPrototypeOf(a).constructor),t||=Object.create(null);const u=t[c]||=new Map;for(const[h,p]of Object.entries(r)){if(h==="type")continue;let m=u.get(h);m||(m=new Map,u.set(h,m));const g=m.get(p)??0;m.set(p,g+1)}}for(const[a,r]of i)t[a]=r.computeTelemetryFinalData(t[a]);return t}resetModifiedIds(){this.#e=null}get modifiedIds(){if(this.#e)return this.#e;const t=[];for(const i of this.#n.values())!(i instanceof gt)||!i.annotationElementId||!i.serialize()||t.push(i.annotationElementId);return this.#e={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#n.entries()}}class n0 extends Yf{#t;constructor(t){super();const{map:i,hash:a,transfer:r}=t.serializable,c=structuredClone(i,r?{transfer:r}:null);this.#t={map:c,hash:a,transfer:r}}get print(){ne("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return zt(this,"modifiedIds",{ids:new Set,hash:""})}}class OM{#t=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:i=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:i,_inspectFont:a}){if(!(!t||this.#t.has(t.loadedName))){if(Me(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:c,style:u}=t,h=new FontFace(r,c,u);this.addNativeFontFace(h);try{await h.load(),this.#t.add(r),a?.(t)}catch{wt(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(h)}return}ne("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const a=t.createNativeFontFace();if(a){this.addNativeFontFace(a);try{await a.loaded}catch(r){throw wt(`Failed to load font '${a.family}': '${r}'.`),t.disableFontFace=!0,r}}return}const i=t.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(a=>{const r=this._queueLoadingCallback(a);this._prepareFontLoadEvent(t,r)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return zt(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return zt(this,"isSyncFontLoadingSupported",dn||qe.platform.isFirefox)}_queueLoadingCallback(t){function i(){for(Me(!r.done,"completeRequest() cannot be called twice."),r.done=!0;a.length>0&&a[0].done;){const c=a.shift();setTimeout(c.callback,0)}}const{loadingRequests:a}=this,r={done:!1,complete:i,callback:t};return a.push(r),r}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return zt(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,i){function a(U,I){return U.charCodeAt(I)<<24|U.charCodeAt(I+1)<<16|U.charCodeAt(I+2)<<8|U.charCodeAt(I+3)&255}function r(U,I,j,F){const J=U.substring(0,I),X=U.substring(I+j);return J+F+X}let c,u;const h=this._document.createElement("canvas");h.width=1,h.height=1;const p=h.getContext("2d");let m=0;function g(U,I){if(++m>30){wt("Load test font never loaded."),I();return}if(p.font="30px "+U,p.fillText(".",0,20),p.getImageData(0,0,1,1).data[3]>0){I();return}setTimeout(g.bind(null,U,I))}const y=`lt${Date.now()}${this.loadTestFontId++}`;let b=this._loadTestFont;b=r(b,976,y.length,y);const A=16,_=1482184792;let R=a(b,A);for(c=0,u=y.length-3;c<u;c+=4)R=R-_+a(y,c)|0;c<y.length&&(R=R-_+a(y+"XXX",c)|0),b=r(b,A,4,mM(R));const C=`url(data:font/opentype;base64,${btoa(b)});`,N=`@font-face {font-family:"${y}";src:${C}}`;this.insertRule(N);const O=this._document.createElement("div");O.style.visibility="hidden",O.style.width=O.style.height="10px",O.style.position="absolute",O.style.top=O.style.left="0px";for(const U of[t.loadedName,y]){const I=this._document.createElement("span");I.textContent="Hi",I.style.fontFamily=U,O.append(I)}this._document.body.append(O),g(y,()=>{O.remove(),i.complete()})}}class kM{constructor(t,i=null){this.compiledGlyphs=Object.create(null);for(const a in t)this[a]=t[a];this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${Kv(this.data)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${t}}`}return this._inspectFont?.(this,t),i}getPathGenerator(t,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const a=this.loadedName+"_path_"+i;let r;try{r=t.get(a)}catch(u){wt(`getPathGenerator - ignoring character: "${u}".`)}const c=new Path2D(r||"");return this.fontExtraProperties||t.delete(a),this.compiledGlyphs[i]=c}}function NM(l){if(l instanceof URL)return l.href;if(typeof l=="string"){if(dn)return l;const t=URL.parse(l,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function LM(l){if(dn&&typeof Buffer<"u"&&l instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength)return l;if(typeof l=="string")return Ko(l);if(l instanceof ArrayBuffer||ArrayBuffer.isView(l)||typeof l=="object"&&!isNaN(l?.length))return new Uint8Array(l);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function xu(l){if(typeof l!="string")return null;if(l.endsWith("/"))return l;throw new Error(`Invalid factory url: "${l}" must include trailing slash.`)}const Xf=l=>typeof l=="object"&&Number.isInteger(l?.num)&&l.num>=0&&Number.isInteger(l?.gen)&&l.gen>=0,IM=l=>typeof l=="object"&&typeof l?.name=="string",PM=SM.bind(null,Xf,IM);class UM{#t=new Map;#e=Promise.resolve();postMessage(t,i){const a={data:structuredClone(t,i?{transfer:i}:null)};this.#e.then(()=>{for(const[r]of this.#t)r.call(this,a)})}addEventListener(t,i,a=null){let r=null;if(a?.signal instanceof AbortSignal){const{signal:c}=a;if(c.aborted){wt("LoopbackPort - cannot use an `aborted` signal.");return}const u=()=>this.removeEventListener(t,i);r=()=>c.removeEventListener("abort",u),c.addEventListener("abort",u)}this.#t.set(i,r)}removeEventListener(t,i){this.#t.get(i)?.(),this.#t.delete(i)}terminate(){for(const[,t]of this.#t)t?.();this.#t.clear()}}const Ru={DATA:1,ERROR:2},ke={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function i0(){}function _n(l){if(l instanceof Ps||l instanceof Pf||l instanceof Yv||l instanceof Au||l instanceof If)return l;switch(l instanceof Error||typeof l=="object"&&l!==null||ne('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),l.name){case"AbortException":return new Ps(l.message);case"InvalidPDFException":return new Pf(l.message);case"PasswordException":return new Yv(l.message,l.code);case"ResponseException":return new Au(l.message,l.status,l.missing);case"UnknownErrorException":return new If(l.message,l.details)}return new If(l.message,l.toString())}class il{#t=new AbortController;constructor(t,i,a){this.sourceName=t,this.targetName=i,this.comObj=a,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),a.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){this.#i(t);return}if(t.callback){const a=t.callbackId,r=this.callbackCapabilities[a];if(!r)throw new Error(`Cannot resolve callback ${a}`);if(delete this.callbackCapabilities[a],t.callback===Ru.DATA)r.resolve(t.data);else if(t.callback===Ru.ERROR)r.reject(_n(t.reason));else throw new Error("Unexpected callback case");return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const a=this.sourceName,r=t.sourceName,c=this.comObj;Promise.try(i,t.data).then(function(u){c.postMessage({sourceName:a,targetName:r,callback:Ru.DATA,callbackId:t.callbackId,data:u})},function(u){c.postMessage({sourceName:a,targetName:r,callback:Ru.ERROR,callbackId:t.callbackId,reason:_n(u)})});return}if(t.streamId){this.#n(t);return}i(t.data)}on(t,i){const a=this.actionHandler;if(a[t])throw new Error(`There is already an actionName called "${t}"`);a[t]=i}send(t,i,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:i},a)}sendWithPromise(t,i,a){const r=this.callbackId++,c=Promise.withResolvers();this.callbackCapabilities[r]=c;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:i},a)}catch(u){c.reject(u)}return c.promise}sendWithStream(t,i,a,r){const c=this.streamId++,u=this.sourceName,h=this.targetName,p=this.comObj;return new ReadableStream({start:m=>{const g=Promise.withResolvers();return this.streamControllers[c]={controller:m,startCall:g,pullCall:null,cancelCall:null,isClosed:!1},p.postMessage({sourceName:u,targetName:h,action:t,streamId:c,data:i,desiredSize:m.desiredSize},r),g.promise},pull:m=>{const g=Promise.withResolvers();return this.streamControllers[c].pullCall=g,p.postMessage({sourceName:u,targetName:h,stream:ke.PULL,streamId:c,desiredSize:m.desiredSize}),g.promise},cancel:m=>{Me(m instanceof Error,"cancel must have a valid reason");const g=Promise.withResolvers();return this.streamControllers[c].cancelCall=g,this.streamControllers[c].isClosed=!0,p.postMessage({sourceName:u,targetName:h,stream:ke.CANCEL,streamId:c,reason:_n(m)}),g.promise}},a)}#n(t){const i=t.streamId,a=this.sourceName,r=t.sourceName,c=this.comObj,u=this,h=this.actionHandler[t.action],p={enqueue(m,g=1,y){if(this.isCancelled)return;const b=this.desiredSize;this.desiredSize-=g,b>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),c.postMessage({sourceName:a,targetName:r,stream:ke.ENQUEUE,streamId:i,chunk:m},y)},close(){this.isCancelled||(this.isCancelled=!0,c.postMessage({sourceName:a,targetName:r,stream:ke.CLOSE,streamId:i}),delete u.streamSinks[i])},error(m){Me(m instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,c.postMessage({sourceName:a,targetName:r,stream:ke.ERROR,streamId:i,reason:_n(m)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};p.sinkCapability.resolve(),p.ready=p.sinkCapability.promise,this.streamSinks[i]=p,Promise.try(h,t.data,p).then(function(){c.postMessage({sourceName:a,targetName:r,stream:ke.START_COMPLETE,streamId:i,success:!0})},function(m){c.postMessage({sourceName:a,targetName:r,stream:ke.START_COMPLETE,streamId:i,reason:_n(m)})})}#i(t){const i=t.streamId,a=this.sourceName,r=t.sourceName,c=this.comObj,u=this.streamControllers[i],h=this.streamSinks[i];switch(t.stream){case ke.START_COMPLETE:t.success?u.startCall.resolve():u.startCall.reject(_n(t.reason));break;case ke.PULL_COMPLETE:t.success?u.pullCall.resolve():u.pullCall.reject(_n(t.reason));break;case ke.PULL:if(!h){c.postMessage({sourceName:a,targetName:r,stream:ke.PULL_COMPLETE,streamId:i,success:!0});break}h.desiredSize<=0&&t.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=t.desiredSize,Promise.try(h.onPull||i0).then(function(){c.postMessage({sourceName:a,targetName:r,stream:ke.PULL_COMPLETE,streamId:i,success:!0})},function(m){c.postMessage({sourceName:a,targetName:r,stream:ke.PULL_COMPLETE,streamId:i,reason:_n(m)})});break;case ke.ENQUEUE:if(Me(u,"enqueue should have stream controller"),u.isClosed)break;u.controller.enqueue(t.chunk);break;case ke.CLOSE:if(Me(u,"close should have stream controller"),u.isClosed)break;u.isClosed=!0,u.controller.close(),this.#a(u,i);break;case ke.ERROR:Me(u,"error should have stream controller"),u.controller.error(_n(t.reason)),this.#a(u,i);break;case ke.CANCEL_COMPLETE:t.success?u.cancelCall.resolve():u.cancelCall.reject(_n(t.reason)),this.#a(u,i);break;case ke.CANCEL:if(!h)break;const p=_n(t.reason);Promise.try(h.onCancel||i0,p).then(function(){c.postMessage({sourceName:a,targetName:r,stream:ke.CANCEL_COMPLETE,streamId:i,success:!0})},function(m){c.postMessage({sourceName:a,targetName:r,stream:ke.CANCEL_COMPLETE,streamId:i,reason:_n(m)})}),h.sinkCapability.reject(p),h.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}}async#a(t,i){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[i]}destroy(){this.#t?.abort(),this.#t=null}}class s0{#t=!1;constructor({enableHWA:t=!1}){this.#t=t}create(t,i){if(t<=0||i<=0)throw new Error("Invalid canvas size");const a=this._createCanvas(t,i);return{canvas:a,context:a.getContext("2d",{willReadFrequently:!this.#t})}}reset(t,i,a){if(!t.canvas)throw new Error("Canvas is not specified");if(i<=0||a<=0)throw new Error("Invalid canvas size");t.canvas.width=i,t.canvas.height=a}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,i){ne("Abstract method `_createCanvas` called.")}}class zM extends s0{constructor({ownerDocument:t=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=t}_createCanvas(t,i){const a=this._document.createElement("canvas");return a.width=t,a.height=i,a}}class a0{constructor({baseUrl:t=null,isCompressed:i=!0}){this.baseUrl=t,this.isCompressed=i}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(i).then(a=>({cMapData:a,isCompressed:this.isCompressed})).catch(a=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class r0 extends a0{async _fetch(t){const i=await Zo(t,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):Ko(i)}}class o0{addFilter(t){return"none"}addHCMFilter(t,i){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,i,a,r,c){return"none"}destroy(t=!1){}}class HM extends o0{#t;#e;#n;#i;#a;#s;#r=0;constructor({docId:t,ownerDocument:i=globalThis.document}){super(),this.#i=t,this.#a=i}get#o(){return this.#e||=new Map}get#u(){return this.#s||=new Map}get#c(){if(!this.#n){const t=this.#a.createElement("div"),{style:i}=t;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const a=this.#a.createElementNS(ts,"svg");a.setAttribute("width",0),a.setAttribute("height",0),this.#n=this.#a.createElementNS(ts,"defs"),t.append(a),a.append(this.#n),this.#a.body.append(t)}return this.#n}#h(t){if(t.length===1){const p=t[0],m=new Array(256);for(let y=0;y<256;y++)m[y]=p[y]/255;const g=m.join(",");return[g,g,g]}const[i,a,r]=t,c=new Array(256),u=new Array(256),h=new Array(256);for(let p=0;p<256;p++)c[p]=i[p]/255,u[p]=a[p]/255,h[p]=r[p]/255;return[c.join(","),u.join(","),h.join(",")]}#l(t){if(this.#t===void 0){this.#t="";const i=this.#a.URL;i!==this.#a.baseURI&&(_u(i)?wt('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=qv(i,""))}return`url(${this.#t}#${t})`}addFilter(t){if(!t)return"none";let i=this.#o.get(t);if(i)return i;const[a,r,c]=this.#h(t),u=t.length===1?a:`${a}${r}${c}`;if(i=this.#o.get(u),i)return this.#o.set(t,i),i;const h=`g_${this.#i}_transfer_map_${this.#r++}`,p=this.#l(h);this.#o.set(t,p),this.#o.set(u,p);const m=this.#f(h);return this.#m(a,r,c,m),p}addHCMFilter(t,i){const a=`${t}-${i}`,r="base";let c=this.#u.get(r);if(c?.key===a||(c?(c.filter?.remove(),c.key=a,c.url="none",c.filter=null):(c={key:a,url:"none",filter:null},this.#u.set(r,c)),!t||!i))return c.url;const u=this.#y(t);t=mt.makeHexColor(...u);const h=this.#y(i);if(i=mt.makeHexColor(...h),this.#c.style.color="",t==="#000000"&&i==="#ffffff"||t===i)return c.url;const p=new Array(256);for(let S=0;S<=255;S++){const A=S/255;p[S]=A<=.03928?A/12.92:((A+.055)/1.055)**2.4}const m=p.join(","),g=`g_${this.#i}_hcm_filter`,y=c.filter=this.#f(g);this.#m(m,m,m,y),this.#g(y);const b=(S,A)=>{const _=u[S]/255,R=h[S]/255,C=new Array(A+1);for(let N=0;N<=A;N++)C[N]=_+N/A*(R-_);return C.join(",")};return this.#m(b(0,5),b(1,5),b(2,5),y),c.url=this.#l(g),c.url}addAlphaFilter(t){let i=this.#o.get(t);if(i)return i;const[a]=this.#h([t]),r=`alpha_${a}`;if(i=this.#o.get(r),i)return this.#o.set(t,i),i;const c=`g_${this.#i}_alpha_map_${this.#r++}`,u=this.#l(c);this.#o.set(t,u),this.#o.set(r,u);const h=this.#f(c);return this.#v(a,h),u}addLuminosityFilter(t){let i=this.#o.get(t||"luminosity");if(i)return i;let a,r;if(t?([a]=this.#h([t]),r=`luminosity_${a}`):r="luminosity",i=this.#o.get(r),i)return this.#o.set(t,i),i;const c=`g_${this.#i}_luminosity_map_${this.#r++}`,u=this.#l(c);this.#o.set(t,u),this.#o.set(r,u);const h=this.#f(c);return this.#p(h),t&&this.#v(a,h),u}addHighlightHCMFilter(t,i,a,r,c){const u=`${i}-${a}-${r}-${c}`;let h=this.#u.get(t);if(h?.key===u||(h?(h.filter?.remove(),h.key=u,h.url="none",h.filter=null):(h={key:u,url:"none",filter:null},this.#u.set(t,h)),!i||!a))return h.url;const[p,m]=[i,a].map(this.#y.bind(this));let g=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),y=Math.round(.2126*m[0]+.7152*m[1]+.0722*m[2]),[b,S]=[r,c].map(this.#y.bind(this));y<g&&([g,y,b,S]=[y,g,S,b]),this.#c.style.color="";const A=(C,N,O)=>{const U=new Array(256),I=(y-g)/O,j=C/255,F=(N-C)/(255*O);let J=0;for(let X=0;X<=O;X++){const at=Math.round(g+X*I),K=j+X*F;for(let lt=J;lt<=at;lt++)U[lt]=K;J=at+1}for(let X=J;X<256;X++)U[X]=U[J-1];return U.join(",")},_=`g_${this.#i}_hcm_${t}_filter`,R=h.filter=this.#f(_);return this.#g(R),this.#m(A(b[0],S[0],5),A(b[1],S[1],5),A(b[2],S[2],5),R),h.url=this.#l(_),h.url}destroy(t=!1){t&&this.#s?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#e?.clear(),this.#e=null,this.#s?.clear(),this.#s=null,this.#r=0)}#p(t){const i=this.#a.createElementNS(ts,"feColorMatrix");i.setAttribute("type","matrix"),i.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"),t.append(i)}#g(t){const i=this.#a.createElementNS(ts,"feColorMatrix");i.setAttribute("type","matrix"),i.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"),t.append(i)}#f(t){const i=this.#a.createElementNS(ts,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",t),this.#c.append(i),i}#d(t,i,a){const r=this.#a.createElementNS(ts,i);r.setAttribute("type","discrete"),r.setAttribute("tableValues",a),t.append(r)}#m(t,i,a,r){const c=this.#a.createElementNS(ts,"feComponentTransfer");r.append(c),this.#d(c,"feFuncR",t),this.#d(c,"feFuncG",i),this.#d(c,"feFuncB",a)}#v(t,i){const a=this.#a.createElementNS(ts,"feComponentTransfer");i.append(a),this.#d(a,"feFuncA",t)}#y(t){return this.#c.style.color=t,Tu(getComputedStyle(this.#c).getPropertyValue("color"))}}class l0{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(a=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class c0 extends l0{async _fetch(t){const i=await Zo(t,"arraybuffer");return new Uint8Array(i)}}class u0{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(a=>{throw new Error(`Unable to load wasm data at: ${i}`)})}async _fetch(t){ne("Abstract method `_fetch` called.")}}class d0 extends u0{async _fetch(t){const i=await Zo(t,"arraybuffer");return new Uint8Array(i)}}dn&&wt("Please use the `legacy` build in Node.js environments.");async function Wf(l){const i=await process.getBuiltinModule("fs").promises.readFile(l);return new Uint8Array(i)}class BM extends o0{}class FM extends s0{_createCanvas(t,i){return process.getBuiltinModule("module").createRequire(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Qt&&Qt.tagName.toUpperCase()==="SCRIPT"&&Qt.src||new URL("corisco.umd.js",document.baseURI).href)("@napi-rs/canvas").createCanvas(t,i)}}class jM extends a0{async _fetch(t){return Wf(t)}}class $M extends l0{async _fetch(t){return Wf(t)}}class GM extends u0{async _fetch(t){return Wf(t)}}const Ye={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Qf(l,t){if(!t)return;const i=t[2]-t[0],a=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],i,a),l.clip(r)}class Kf{isModifyingCurrentTransform(){return!1}getPattern(){ne("Abstract method `getPattern` called.")}}class VM extends Kf{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let i;this._type==="axial"?i=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const a of this._colorStops)i.addColorStop(a[0],a[1]);return i}getPattern(t,i,a,r){let c;if(r===Ye.STROKE||r===Ye.FILL){const u=i.current.getClippedPathBoundingBox(r,ye(t))||[0,0,0,0],h=Math.ceil(u[2]-u[0])||1,p=Math.ceil(u[3]-u[1])||1,m=i.cachedCanvases.getCanvas("pattern",h,p),g=m.context;g.clearRect(0,0,g.canvas.width,g.canvas.height),g.beginPath(),g.rect(0,0,g.canvas.width,g.canvas.height),g.translate(-u[0],-u[1]),a=mt.transform(a,[1,0,0,1,u[0],u[1]]),g.transform(...i.baseTransform),this.matrix&&g.transform(...this.matrix),Qf(g,this._bbox),g.fillStyle=this._createGradient(g),g.fill(),c=t.createPattern(m.canvas,"no-repeat");const y=new DOMMatrix(a);c.setTransform(y)}else Qf(t,this._bbox),c=this._createGradient(t);return c}}function Zf(l,t,i,a,r,c,u,h){const p=t.coords,m=t.colors,g=l.data,y=l.width*4;let b;p[i+1]>p[a+1]&&(b=i,i=a,a=b,b=c,c=u,u=b),p[a+1]>p[r+1]&&(b=a,a=r,r=b,b=u,u=h,h=b),p[i+1]>p[a+1]&&(b=i,i=a,a=b,b=c,c=u,u=b);const S=(p[i]+t.offsetX)*t.scaleX,A=(p[i+1]+t.offsetY)*t.scaleY,_=(p[a]+t.offsetX)*t.scaleX,R=(p[a+1]+t.offsetY)*t.scaleY,C=(p[r]+t.offsetX)*t.scaleX,N=(p[r+1]+t.offsetY)*t.scaleY;if(A>=N)return;const O=m[c],U=m[c+1],I=m[c+2],j=m[u],F=m[u+1],J=m[u+2],X=m[h],at=m[h+1],K=m[h+2],lt=Math.round(A),St=Math.round(N);let yt,Gt,B,Q,dt,Ct,W,ht;for(let st=lt;st<=St;st++){if(st<R){const Wt=st<A?0:(A-st)/(A-R);yt=S-(S-_)*Wt,Gt=O-(O-j)*Wt,B=U-(U-F)*Wt,Q=I-(I-J)*Wt}else{let Wt;st>N?Wt=1:R===N?Wt=0:Wt=(R-st)/(R-N),yt=_-(_-C)*Wt,Gt=j-(j-X)*Wt,B=F-(F-at)*Wt,Q=J-(J-K)*Wt}let bt;st<A?bt=0:st>N?bt=1:bt=(A-st)/(A-N),dt=S-(S-C)*bt,Ct=O-(O-X)*bt,W=U-(U-at)*bt,ht=I-(I-K)*bt;const Kt=Math.round(Math.min(yt,dt)),re=Math.round(Math.max(yt,dt));let tt=y*st+Kt*4;for(let Wt=Kt;Wt<=re;Wt++)bt=(yt-Wt)/(yt-dt),bt<0?bt=0:bt>1&&(bt=1),g[tt++]=Gt-(Gt-Ct)*bt|0,g[tt++]=B-(B-W)*bt|0,g[tt++]=Q-(Q-ht)*bt|0,g[tt++]=255}}function qM(l,t,i){const a=t.coords,r=t.colors;let c,u;switch(t.type){case"lattice":const h=t.verticesPerRow,p=Math.floor(a.length/h)-1,m=h-1;for(c=0;c<p;c++){let g=c*h;for(let y=0;y<m;y++,g++)Zf(l,i,a[g],a[g+1],a[g+h],r[g],r[g+1],r[g+h]),Zf(l,i,a[g+h+1],a[g+1],a[g+h],r[g+h+1],r[g+1],r[g+h])}break;case"triangles":for(c=0,u=a.length;c<u;c+=3)Zf(l,i,a[c],a[c+1],a[c+2],r[c],r[c+1],r[c+2]);break;default:throw new Error("illegal figure")}}class YM extends Kf{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,i,a){const h=Math.floor(this._bounds[0]),p=Math.floor(this._bounds[1]),m=Math.ceil(this._bounds[2])-h,g=Math.ceil(this._bounds[3])-p,y=Math.min(Math.ceil(Math.abs(m*t[0]*1.1)),3e3),b=Math.min(Math.ceil(Math.abs(g*t[1]*1.1)),3e3),S=m/y,A=g/b,_={coords:this._coords,colors:this._colors,offsetX:-h,offsetY:-p,scaleX:1/S,scaleY:1/A},R=y+4,C=b+4,N=a.getCanvas("mesh",R,C),O=N.context,U=O.createImageData(y,b);if(i){const j=U.data;for(let F=0,J=j.length;F<J;F+=4)j[F]=i[0],j[F+1]=i[1],j[F+2]=i[2],j[F+3]=255}for(const j of this._figures)qM(U,j,_);return O.putImageData(U,2,2),{canvas:N.canvas,offsetX:h-2*S,offsetY:p-2*A,scaleX:S,scaleY:A}}isModifyingCurrentTransform(){return!0}getPattern(t,i,a,r){Qf(t,this._bbox);const c=new Float32Array(2);if(r===Ye.SHADING)mt.singularValueDecompose2dScale(ye(t),c);else if(this.matrix){mt.singularValueDecompose2dScale(this.matrix,c);const[h,p]=c;mt.singularValueDecompose2dScale(i.baseTransform,c),c[0]*=h,c[1]*=p}else mt.singularValueDecompose2dScale(i.baseTransform,c);const u=this._createMeshCanvas(c,r===Ye.SHADING?null:this._background,i.cachedCanvases);return r!==Ye.SHADING&&(t.setTransform(...i.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(u.offsetX,u.offsetY),t.scale(u.scaleX,u.scaleY),t.createPattern(u.canvas,"no-repeat")}}class XM extends Kf{getPattern(){return"hotpink"}}function WM(l){switch(l[0]){case"RadialAxial":return new VM(l);case"Mesh":return new YM(l);case"Dummy":return new XM}throw new Error(`Unknown IR type: ${l[0]}`)}const h0={COLORED:1,UNCOLORED:2};class Jf{static MAX_PATTERN_SIZE=3e3;constructor(t,i,a,r){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=i,this.canvasGraphicsFactory=a,this.baseTransform=r}createPatternCanvas(t){const{bbox:i,operatorList:a,paintType:r,tilingType:c,color:u,canvasGraphicsFactory:h}=this;let{xstep:p,ystep:m}=this;p=Math.abs(p),m=Math.abs(m),Eu("TilingType: "+c);const g=i[0],y=i[1],b=i[2],S=i[3],A=b-g,_=S-y,R=new Float32Array(2);mt.singularValueDecompose2dScale(this.matrix,R);const[C,N]=R;mt.singularValueDecompose2dScale(this.baseTransform,R);const O=C*R[0],U=N*R[1];let I=A,j=_,F=!1,J=!1;const X=Math.ceil(p*O),at=Math.ceil(m*U),K=Math.ceil(A*O),lt=Math.ceil(_*U);X>=K?I=p:F=!0,at>=lt?j=m:J=!0;const St=this.getSizeAndScale(I,this.ctx.canvas.width,O),yt=this.getSizeAndScale(j,this.ctx.canvas.height,U),Gt=t.cachedCanvases.getCanvas("pattern",St.size,yt.size),B=Gt.context,Q=h.createCanvasGraphics(B);if(Q.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(Q,r,u),B.translate(-St.scale*g,-yt.scale*y),Q.transform(St.scale,0,0,yt.scale,0,0),B.save(),this.clipBbox(Q,g,y,b,S),Q.baseTransform=ye(Q.ctx),Q.executeOperatorList(a),Q.endDrawing(),B.restore(),F||J){const dt=Gt.canvas;F&&(I=p),J&&(j=m);const Ct=this.getSizeAndScale(I,this.ctx.canvas.width,O),W=this.getSizeAndScale(j,this.ctx.canvas.height,U),ht=Ct.size,st=W.size,bt=t.cachedCanvases.getCanvas("pattern-workaround",ht,st),Kt=bt.context,re=F?Math.floor(A/p):0,tt=J?Math.floor(_/m):0;for(let Wt=0;Wt<=re;Wt++)for(let Vt=0;Vt<=tt;Vt++)Kt.drawImage(dt,ht*Wt,st*Vt,ht,st,0,0,ht,st);return{canvas:bt.canvas,scaleX:Ct.scale,scaleY:W.scale,offsetX:g,offsetY:y}}return{canvas:Gt.canvas,scaleX:St.scale,scaleY:yt.scale,offsetX:g,offsetY:y}}getSizeAndScale(t,i,a){const r=Math.max(Jf.MAX_PATTERN_SIZE,i);let c=Math.ceil(t*a);return c>=r?c=r:a=c/t,{scale:a,size:c}}clipBbox(t,i,a,r,c){const u=r-i,h=c-a;t.ctx.rect(i,a,u,h),mt.axialAlignedBoundingBox([i,a,r,c],ye(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,a){const r=t.ctx,c=t.current;switch(i){case h0.COLORED:const{fillStyle:u,strokeStyle:h}=this.ctx;r.fillStyle=c.fillColor=u,r.strokeStyle=c.strokeColor=h;break;case h0.UNCOLORED:r.fillStyle=r.strokeStyle=a,c.fillColor=c.strokeColor=a;break;default:throw new pM(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,i,a,r){let c=a;r!==Ye.SHADING&&(c=mt.transform(c,i.baseTransform),this.matrix&&(c=mt.transform(c,this.matrix)));const u=this.createPatternCanvas(i);let h=new DOMMatrix(c);h=h.translate(u.offsetX,u.offsetY),h=h.scale(1/u.scaleX,1/u.scaleY);const p=t.createPattern(u.canvas,"repeat");return p.setTransform(h),p}}function QM({src:l,srcPos:t=0,dest:i,width:a,height:r,nonBlackColor:c=4294967295,inverseDecode:u=!1}){const h=qe.isLittleEndian?4278190080:255,[p,m]=u?[c,h]:[h,c],g=a>>3,y=a&7,b=l.length;i=new Uint32Array(i.buffer);let S=0;for(let A=0;A<r;A++){for(const R=t+g;t<R;t++){const C=t<b?l[t]:255;i[S++]=C&128?m:p,i[S++]=C&64?m:p,i[S++]=C&32?m:p,i[S++]=C&16?m:p,i[S++]=C&8?m:p,i[S++]=C&4?m:p,i[S++]=C&2?m:p,i[S++]=C&1?m:p}if(y===0)continue;const _=t<b?l[t++]:255;for(let R=0;R<y;R++)i[S++]=_&1<<7-R?m:p}return{srcPos:t,destPos:S}}const f0=16,p0=100,KM=15,m0=10,Tn=16,tp=new DOMMatrix,Pn=new Float32Array(2),xr=new Float32Array([1/0,1/0,-1/0,-1/0]);function ZM(l,t){if(l._removeMirroring)throw new Error("Context is already forwarding operations.");l.__originalSave=l.save,l.__originalRestore=l.restore,l.__originalRotate=l.rotate,l.__originalScale=l.scale,l.__originalTranslate=l.translate,l.__originalTransform=l.transform,l.__originalSetTransform=l.setTransform,l.__originalResetTransform=l.resetTransform,l.__originalClip=l.clip,l.__originalMoveTo=l.moveTo,l.__originalLineTo=l.lineTo,l.__originalBezierCurveTo=l.bezierCurveTo,l.__originalRect=l.rect,l.__originalClosePath=l.closePath,l.__originalBeginPath=l.beginPath,l._removeMirroring=()=>{l.save=l.__originalSave,l.restore=l.__originalRestore,l.rotate=l.__originalRotate,l.scale=l.__originalScale,l.translate=l.__originalTranslate,l.transform=l.__originalTransform,l.setTransform=l.__originalSetTransform,l.resetTransform=l.__originalResetTransform,l.clip=l.__originalClip,l.moveTo=l.__originalMoveTo,l.lineTo=l.__originalLineTo,l.bezierCurveTo=l.__originalBezierCurveTo,l.rect=l.__originalRect,l.closePath=l.__originalClosePath,l.beginPath=l.__originalBeginPath,delete l._removeMirroring},l.save=function(){t.save(),this.__originalSave()},l.restore=function(){t.restore(),this.__originalRestore()},l.translate=function(i,a){t.translate(i,a),this.__originalTranslate(i,a)},l.scale=function(i,a){t.scale(i,a),this.__originalScale(i,a)},l.transform=function(i,a,r,c,u,h){t.transform(i,a,r,c,u,h),this.__originalTransform(i,a,r,c,u,h)},l.setTransform=function(i,a,r,c,u,h){t.setTransform(i,a,r,c,u,h),this.__originalSetTransform(i,a,r,c,u,h)},l.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},l.rotate=function(i){t.rotate(i),this.__originalRotate(i)},l.clip=function(i){t.clip(i),this.__originalClip(i)},l.moveTo=function(i,a){t.moveTo(i,a),this.__originalMoveTo(i,a)},l.lineTo=function(i,a){t.lineTo(i,a),this.__originalLineTo(i,a)},l.bezierCurveTo=function(i,a,r,c,u,h){t.bezierCurveTo(i,a,r,c,u,h),this.__originalBezierCurveTo(i,a,r,c,u,h)},l.rect=function(i,a,r,c){t.rect(i,a,r,c),this.__originalRect(i,a,r,c)},l.closePath=function(){t.closePath(),this.__originalClosePath()},l.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class JM{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,i,a){let r;return this.cache[t]!==void 0?(r=this.cache[t],this.canvasFactory.reset(r,i,a)):(r=this.canvasFactory.create(i,a),this.cache[t]=r),r}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const i=this.cache[t];this.canvasFactory.destroy(i),delete this.cache[t]}}}function Du(l,t,i,a,r,c,u,h,p,m){const[g,y,b,S,A,_]=ye(l);if(y===0&&b===0){const N=u*g+A,O=Math.round(N),U=h*S+_,I=Math.round(U),j=(u+p)*g+A,F=Math.abs(Math.round(j)-O)||1,J=(h+m)*S+_,X=Math.abs(Math.round(J)-I)||1;return l.setTransform(Math.sign(g),0,0,Math.sign(S),O,I),l.drawImage(t,i,a,r,c,0,0,F,X),l.setTransform(g,y,b,S,A,_),[F,X]}if(g===0&&S===0){const N=h*b+A,O=Math.round(N),U=u*y+_,I=Math.round(U),j=(h+m)*b+A,F=Math.abs(Math.round(j)-O)||1,J=(u+p)*y+_,X=Math.abs(Math.round(J)-I)||1;return l.setTransform(0,Math.sign(y),Math.sign(b),0,O,I),l.drawImage(t,i,a,r,c,0,0,X,F),l.setTransform(g,y,b,S,A,_),[X,F]}l.drawImage(t,i,a,r,c,u,h,p,m);const R=Math.hypot(g,y),C=Math.hypot(b,S);return[R*p,C*m]}class g0{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Nf;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=an.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,i){this.clipBox=new Float32Array([0,0,t,i]),this.minMax=xr.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Ye.FILL,i=null){const a=this.minMax.slice();if(t===Ye.STROKE){i||ne("Stroke bounding box must include transform."),mt.singularValueDecompose2dScale(i,Pn);const r=Pn[0]*this.lineWidth/2,c=Pn[1]*this.lineWidth/2;a[0]-=r,a[1]-=c,a[2]+=r,a[3]+=c}return a}updateClipFromPath(){const t=mt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(xr,0)}getClippedPathBoundingBox(t=Ye.FILL,i=null){return mt.intersect(this.clipBox,this.getPathBoundingBox(t,i))}}function y0(l,t){if(t instanceof ImageData){l.putImageData(t,0,0);return}const i=t.height,a=t.width,r=i%Tn,c=(i-r)/Tn,u=r===0?c:c+1,h=l.createImageData(a,Tn);let p=0,m;const g=t.data,y=h.data;let b,S,A,_;if(t.kind===gu.GRAYSCALE_1BPP){const R=g.byteLength,C=new Uint32Array(y.buffer,0,y.byteLength>>2),N=C.length,O=a+7>>3,U=4294967295,I=qe.isLittleEndian?4278190080:255;for(b=0;b<u;b++){for(A=b<c?Tn:r,m=0,S=0;S<A;S++){const j=R-p;let F=0;const J=j>O?a:j*8-7,X=J&-8;let at=0,K=0;for(;F<X;F+=8)K=g[p++],C[m++]=K&128?U:I,C[m++]=K&64?U:I,C[m++]=K&32?U:I,C[m++]=K&16?U:I,C[m++]=K&8?U:I,C[m++]=K&4?U:I,C[m++]=K&2?U:I,C[m++]=K&1?U:I;for(;F<J;F++)at===0&&(K=g[p++],at=128),C[m++]=K&at?U:I,at>>=1}for(;m<N;)C[m++]=0;l.putImageData(h,0,b*Tn)}}else if(t.kind===gu.RGBA_32BPP){for(S=0,_=a*Tn*4,b=0;b<c;b++)y.set(g.subarray(p,p+_)),p+=_,l.putImageData(h,0,S),S+=Tn;b<u&&(_=a*r*4,y.set(g.subarray(p,p+_)),l.putImageData(h,0,S))}else if(t.kind===gu.RGB_24BPP)for(A=Tn,_=a*A,b=0;b<u;b++){for(b>=c&&(A=r,_=a*A),m=0,S=_;S--;)y[m++]=g[p++],y[m++]=g[p++],y[m++]=g[p++],y[m++]=255;l.putImageData(h,0,b*Tn)}else throw new Error(`bad image kind: ${t.kind}`)}function b0(l,t){if(t.bitmap){l.drawImage(t.bitmap,0,0);return}const i=t.height,a=t.width,r=i%Tn,c=(i-r)/Tn,u=r===0?c:c+1,h=l.createImageData(a,Tn);let p=0;const m=t.data,g=h.data;for(let y=0;y<u;y++){const b=y<c?Tn:r;({srcPos:p}=QM({src:m,srcPos:p,dest:g,width:a,height:b,nonBlackColor:0})),l.putImageData(h,0,y*Tn)}}function sl(l,t){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const a of i)l[a]!==void 0&&(t[a]=l[a]);l.setLineDash!==void 0&&(t.setLineDash(l.getLineDash()),t.lineDashOffset=l.lineDashOffset)}function Mu(l){l.strokeStyle=l.fillStyle="#000000",l.fillRule="nonzero",l.globalAlpha=1,l.lineWidth=1,l.lineCap="butt",l.lineJoin="miter",l.miterLimit=10,l.globalCompositeOperation="source-over",l.font="10px sans-serif",l.setLineDash!==void 0&&(l.setLineDash([]),l.lineDashOffset=0);const{filter:t}=l;t!=="none"&&t!==""&&(l.filter="none")}function v0(l,t){if(t)return!0;mt.singularValueDecompose2dScale(l,Pn);const i=Math.fround(Di.pixelRatio*Cr.PDF_TO_CSS_UNITS);return Pn[0]<=i&&Pn[1]<=i}const tO=["butt","round","square"],eO=["miter","round","bevel"],nO={},S0={};class Rr{constructor(t,i,a,r,c,{optionalContentConfig:u,markedContentStack:h=null},p,m){this.ctx=t,this.current=new g0(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=a,this.canvasFactory=r,this.filterFactory=c,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=h||[],this.optionalContentConfig=u,this.cachedCanvases=new JM(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=p,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=m,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,i=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):i}beginDrawing({transform:t,viewport:i,transparency:a=!1,background:r=null}){const c=this.ctx.canvas.width,u=this.ctx.canvas.height,h=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,c,u),this.ctx.fillStyle=h,a){const p=this.cachedCanvases.getCanvas("transparent",c,u);this.compositeCtx=this.ctx,this.transparentCanvas=p.canvas,this.ctx=p.context,this.ctx.save(),this.ctx.transform(...ye(this.compositeCtx))}this.ctx.save(),Mu(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=ye(this.ctx)}executeOperatorList(t,i,a,r){const c=t.argsArray,u=t.fnArray;let h=i||0;const p=c.length;if(p===h)return h;const m=p-h>m0&&typeof a=="function",g=m?Date.now()+KM:0;let y=0;const b=this.commonObjs,S=this.objs;let A;for(;;){if(r!==void 0&&h===r.nextBreakPoint)return r.breakIt(h,a),h;if(A=u[h],A!==bu.dependency)this[A].apply(this,c[h]);else for(const _ of c[h]){const R=_.startsWith("g_")?b:S;if(!R.has(_))return R.get(_,a),h}if(h++,h===p)return h;if(m&&++y>m0){if(Date.now()>g)return a(),h;y=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const i of t.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const i=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}}_scaleImage(t,i){const a=t.width??t.displayWidth,r=t.height??t.displayHeight;let c=Math.max(Math.hypot(i[0],i[1]),1),u=Math.max(Math.hypot(i[2],i[3]),1),h=a,p=r,m="prescale1",g,y;for(;c>2&&h>1||u>2&&p>1;){let b=h,S=p;c>2&&h>1&&(b=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h/2),c/=h/b),u>2&&p>1&&(S=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,u/=p/S),g=this.cachedCanvases.getCanvas(m,b,S),y=g.context,y.clearRect(0,0,b,S),y.drawImage(t,0,0,h,p,0,0,b,S),t=g.canvas,h=b,p=S,m=m==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:h,paintHeight:p}}_createMaskCanvas(t){const i=this.ctx,{width:a,height:r}=t,c=this.current.fillColor,u=this.current.patternFill,h=ye(i);let p,m,g,y;if((t.bitmap||t.data)&&t.count>1){const X=t.bitmap||t.data.buffer;m=JSON.stringify(u?h:[h.slice(0,4),c]),p=this._cachedBitmapsMap.get(X),p||(p=new Map,this._cachedBitmapsMap.set(X,p));const at=p.get(m);if(at&&!u){const K=Math.round(Math.min(h[0],h[2])+h[4]),lt=Math.round(Math.min(h[1],h[3])+h[5]);return{canvas:at,offsetX:K,offsetY:lt}}g=at}g||(y=this.cachedCanvases.getCanvas("maskCanvas",a,r),b0(y.context,t));let b=mt.transform(h,[1/a,0,0,-1/r,0,0]);b=mt.transform(b,[1,0,0,1,0,-r]);const S=xr.slice();mt.axialAlignedBoundingBox([0,0,a,r],b,S);const[A,_,R,C]=S,N=Math.round(R-A)||1,O=Math.round(C-_)||1,U=this.cachedCanvases.getCanvas("fillCanvas",N,O),I=U.context,j=A,F=_;I.translate(-j,-F),I.transform(...b),g||(g=this._scaleImage(y.canvas,Ri(I)),g=g.img,p&&u&&p.set(m,g)),I.imageSmoothingEnabled=v0(ye(I),t.interpolate),Du(I,g,0,0,g.width,g.height,0,0,a,r),I.globalCompositeOperation="source-in";const J=mt.transform(Ri(I),[1,0,0,1,-j,-F]);return I.fillStyle=u?c.getPattern(i,this,J,Ye.FILL):c,I.fillRect(0,0,a,r),p&&!u&&(this.cachedCanvases.delete("fillCanvas"),p.set(m,U.canvas)),{canvas:U.canvas,offsetX:Math.round(j),offsetY:Math.round(F)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=tO[t]}setLineJoin(t){this.ctx.lineJoin=eO[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,i){const a=this.ctx;a.setLineDash!==void 0&&(a.setLineDash(t),a.lineDashOffset=i)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[i,a]of t)switch(i){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=a;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=a;break;case"BM":this.ctx.globalCompositeOperation=a;break;case"SMask":this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(a);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,i=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(a,t,i);this.suspendedCtx=this.ctx;const c=this.ctx=r.context;c.setTransform(this.suspendedCtx.getTransform()),sl(this.suspendedCtx,c),ZM(c,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),sl(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,a=this.suspendedCtx;this.composeSMask(a,i,this.ctx,t),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(t,i,a,r){const c=r[0],u=r[1],h=r[2]-c,p=r[3]-u;h===0||p===0||(this.genericComposeSMask(i.context,a,h,p,i.subtype,i.backdrop,i.transferMap,c,u,i.offsetX,i.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(a.canvas,0,0),t.restore())}genericComposeSMask(t,i,a,r,c,u,h,p,m,g,y){let b=t.canvas,S=p-g,A=m-y;if(u)if(S<0||A<0||S+a>b.width||A+r>b.height){const R=this.cachedCanvases.getCanvas("maskExtension",a,r),C=R.context;C.drawImage(b,-S,-A),C.globalCompositeOperation="destination-atop",C.fillStyle=u,C.fillRect(0,0,a,r),C.globalCompositeOperation="source-over",b=R.canvas,S=A=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const R=new Path2D;R.rect(S,A,a,r),t.clip(R),t.globalCompositeOperation="destination-atop",t.fillStyle=u,t.fillRect(S,A,a,r),t.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),c==="Alpha"&&h?i.filter=this.filterFactory.addAlphaFilter(h):c==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(h));const _=new Path2D;_.rect(p,m,a,r),i.clip(_),i.globalCompositeOperation="destination-in",i.drawImage(b,S,A,a,r,p,m,a,r),i.restore()}save(){this.inSMaskMode&&sl(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&sl(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,i,a,r,c,u){this.ctx.transform(t,i,a,r,c,u),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,i,a){let[r]=i;if(!a){r||=i[0]=new Path2D,this[t](r);return}if(!(r instanceof Path2D)){const c=i[0]=new Path2D;for(let u=0,h=r.length;u<h;)switch(r[u++]){case vu.moveTo:c.moveTo(r[u++],r[u++]);break;case vu.lineTo:c.lineTo(r[u++],r[u++]);break;case vu.curveTo:c.bezierCurveTo(r[u++],r[u++],r[u++],r[u++],r[u++],r[u++]);break;case vu.closePath:c.closePath();break;default:wt(`Unrecognized drawing path operator: ${r[u-1]}`);break}r=c}mt.axialAlignedBoundingBox(a,ye(this.ctx),this.current.minMax),this[t](r)}closePath(){this.ctx.closePath()}stroke(t,i=!0){const a=this.ctx,r=this.current.strokeColor;if(a.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof r=="object"&&r?.getPattern){const c=r.isModifyingCurrentTransform()?a.getTransform():null;if(a.save(),a.strokeStyle=r.getPattern(a,this,Ri(a),Ye.STROKE),c){const u=new Path2D;u.addPath(t,a.getTransform().invertSelf().multiplySelf(c)),t=u}this.rescaleAndStroke(t,!1),a.restore()}else this.rescaleAndStroke(t,!0);i&&this.consumePath(t,this.current.getClippedPathBoundingBox(Ye.STROKE,ye(this.ctx))),a.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,i=!0){const a=this.ctx,r=this.current.fillColor,c=this.current.patternFill;let u=!1;if(c){const p=r.isModifyingCurrentTransform()?a.getTransform():null;if(a.save(),a.fillStyle=r.getPattern(a,this,Ri(a),Ye.FILL),p){const m=new Path2D;m.addPath(t,a.getTransform().invertSelf().multiplySelf(p)),t=m}u=!0}const h=this.current.getClippedPathBoundingBox();this.contentVisible&&h!==null&&(this.pendingEOFill?(a.fill(t,"evenodd"),this.pendingEOFill=!1):a.fill(t)),u&&a.restore(),i&&this.consumePath(t,h)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=nO}eoClip(){this.pendingClip=S0}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,i=this.ctx;if(t===void 0)return;const a=new Path2D,r=i.getTransform().invertSelf();for(const{transform:c,x:u,y:h,fontSize:p,path:m}of t)m&&a.addPath(m,new DOMMatrix(c).preMultiplySelf(r).translate(u,h).scale(p,-p));i.clip(a),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,i){const a=this.commonObjs.get(t),r=this.current;if(!a)throw new Error(`Can't find font for ${t}`);if(r.fontMatrix=a.fontMatrix||Nf,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&wt("Invalid font matrix for font "+t),i<0?(i=-i,r.fontDirection=-1):r.fontDirection=1,this.current.font=a,this.current.fontSize=i,a.isType3Font)return;const c=a.loadedName||"sans-serif",u=a.systemFontInfo?.css||`"${c}", ${a.fallbackName}`;let h="normal";a.black?h="900":a.bold&&(h="bold");const p=a.italic?"italic":"normal";let m=i;i<f0?m=f0:i>p0&&(m=p0),this.current.fontSizeScale=i/m,this.ctx.font=`${p} ${h} ${m}px ${u}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,i){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,i){this.setLeading(-i),this.moveText(t,i)}setTextMatrix(t){const{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#n(t,i,a){const r=new Path2D;return r.addPath(t,new DOMMatrix(a).invertSelf().multiplySelf(i)),r}paintChar(t,i,a,r,c){const u=this.ctx,h=this.current,p=h.font,m=h.textRenderingMode,g=h.fontSize/h.fontSizeScale,y=m&an.FILL_STROKE_MASK,b=!!(m&an.ADD_TO_PATH_FLAG),S=h.patternFill&&!p.missingFile,A=h.patternStroke&&!p.missingFile;let _;if((p.disableFontFace||b||S||A)&&!p.missingFile&&(_=p.getPathGenerator(this.commonObjs,t)),_&&(p.disableFontFace||S||A)){u.save(),u.translate(i,a),u.scale(g,-g);let R;if((y===an.FILL||y===an.FILL_STROKE)&&(r?(R=u.getTransform(),u.setTransform(...r),u.fill(this.#n(_,R,r))):u.fill(_)),y===an.STROKE||y===an.FILL_STROKE)if(c){R||=u.getTransform(),u.setTransform(...c);const{a:C,b:N,c:O,d:U}=R,I=mt.inverseTransform(c),j=mt.transform([C,N,O,U,0,0],I);mt.singularValueDecompose2dScale(j,Pn),u.lineWidth*=Math.max(Pn[0],Pn[1])/g,u.stroke(this.#n(_,R,c))}else u.lineWidth/=g,u.stroke(_);u.restore()}else(y===an.FILL||y===an.FILL_STROKE)&&u.fillText(t,i,a),(y===an.STROKE||y===an.FILL_STROKE)&&u.strokeText(t,i,a);b&&(this.pendingTextPaths||=[]).push({transform:ye(u),x:i,y:a,fontSize:g,path:_})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const i=t.getImageData(0,0,10,10).data;let a=!1;for(let r=3;r<i.length;r+=4)if(i[r]>0&&i[r]<255){a=!0;break}return zt(this,"isFontSubpixelAAEnabled",a)}showText(t){const i=this.current,a=i.font;if(a.isType3Font)return this.showType3Text(t);const r=i.fontSize;if(r===0)return;const c=this.ctx,u=i.fontSizeScale,h=i.charSpacing,p=i.wordSpacing,m=i.fontDirection,g=i.textHScale*m,y=t.length,b=a.vertical,S=b?1:-1,A=a.defaultVMetrics,_=r*i.fontMatrix[0],R=i.textRenderingMode===an.FILL&&!a.disableFontFace&&!i.patternFill;c.save(),i.textMatrix&&c.transform(...i.textMatrix),c.translate(i.x,i.y+i.textRise),m>0?c.scale(g,-1):c.scale(g,1);let C,N;if(i.patternFill){c.save();const F=i.fillColor.getPattern(c,this,Ri(c),Ye.FILL);C=ye(c),c.restore(),c.fillStyle=F}if(i.patternStroke){c.save();const F=i.strokeColor.getPattern(c,this,Ri(c),Ye.STROKE);N=ye(c),c.restore(),c.strokeStyle=F}let O=i.lineWidth;const U=i.textMatrixScale;if(U===0||O===0){const F=i.textRenderingMode&an.FILL_STROKE_MASK;(F===an.STROKE||F===an.FILL_STROKE)&&(O=this.getSinglePixelWidth())}else O/=U;if(u!==1&&(c.scale(u,u),O/=u),c.lineWidth=O,a.isInvalidPDFjsFont){const F=[];let J=0;for(const X of t)F.push(X.unicode),J+=X.width;c.fillText(F.join(""),0,0),i.x+=J*_*g,c.restore(),this.compose();return}let I=0,j;for(j=0;j<y;++j){const F=t[j];if(typeof F=="number"){I+=S*F*r/1e3;continue}let J=!1;const X=(F.isSpace?p:0)+h,at=F.fontChar,K=F.accent;let lt,St,yt=F.width;if(b){const B=F.vmetric||A,Q=-(F.vmetric?B[1]:yt*.5)*_,dt=B[2]*_;yt=B?-B[0]:yt,lt=Q/u,St=(I+dt)/u}else lt=I/u,St=0;if(a.remeasure&&yt>0){const B=c.measureText(at).width*1e3/r*u;if(yt<B&&this.isFontSubpixelAAEnabled){const Q=yt/B;J=!0,c.save(),c.scale(Q,1),lt/=Q}else yt!==B&&(lt+=(yt-B)/2e3*r/u)}if(this.contentVisible&&(F.isInFont||a.missingFile)){if(R&&!K)c.fillText(at,lt,St);else if(this.paintChar(at,lt,St,C,N),K){const B=lt+r*K.offset.x/u,Q=St-r*K.offset.y/u;this.paintChar(K.fontChar,B,Q,C,N)}}const Gt=b?yt*_-X*m:yt*_+X*m;I+=Gt,J&&c.restore()}b?i.y-=I:i.x+=I*g,c.restore(),this.compose()}showType3Text(t){const i=this.ctx,a=this.current,r=a.font,c=a.fontSize,u=a.fontDirection,h=r.vertical?1:-1,p=a.charSpacing,m=a.wordSpacing,g=a.textHScale*u,y=a.fontMatrix||Nf,b=t.length,S=a.textRenderingMode===an.INVISIBLE;let A,_,R,C;if(!(S||c===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),a.textMatrix&&i.transform(...a.textMatrix),i.translate(a.x,a.y+a.textRise),i.scale(g,u),A=0;A<b;++A){if(_=t[A],typeof _=="number"){C=h*_*c/1e3,this.ctx.translate(C,0),a.x+=C*g;continue}const N=(_.isSpace?m:0)+p,O=r.charProcOperatorList[_.operatorListId];O?this.contentVisible&&(this.save(),i.scale(c,c),i.transform(...y),this.executeOperatorList(O),this.restore()):wt(`Type3 character "${_.operatorListId}" is not available.`);const U=[_.width,0];mt.applyTransform(U,y),R=U[0]*c+N,i.translate(R,0),a.x+=R*g}i.restore()}}setCharWidth(t,i){}setCharWidthAndBounds(t,i,a,r,c,u){const h=new Path2D;h.rect(a,r,c-a,u-r),this.ctx.clip(h),this.endPath()}getColorN_Pattern(t){let i;if(t[0]==="TilingPattern"){const a=this.baseTransform||ye(this.ctx),r={createCanvasGraphics:c=>new Rr(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new Jf(t,this.ctx,r,a)}else i=this._getPattern(t[1],t[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,i=null){let a;return this.cachedPatterns.has(t)?a=this.cachedPatterns.get(t):(a=WM(this.getObject(t)),this.cachedPatterns.set(t,a)),i&&(a.matrix=i),a}shadingFill(t){if(!this.contentVisible)return;const i=this.ctx;this.save();const a=this._getPattern(t);i.fillStyle=a.getPattern(i,this,Ri(i),Ye.SHADING);const r=Ri(i);if(r){const{width:c,height:u}=i.canvas,h=xr.slice();mt.axialAlignedBoundingBox([0,0,c,u],r,h);const[p,m,g,y]=h;this.ctx.fillRect(p,m,g-p,y-m)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){ne("Should not call beginInlineImage")}beginImageData(){ne("Should not call beginImageData")}paintFormXObjectBegin(t,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=ye(this.ctx),i)){mt.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[a,r,c,u]=i,h=new Path2D;h.rect(a,r,c-a,u-r),this.ctx.clip(h),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||Eu("TODO: Support non-isolated groups."),t.knockout&&wt("Knockout groups not supported.");const a=ye(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let r=xr.slice();mt.axialAlignedBoundingBox(t.bbox,ye(i),r);const c=[0,0,i.canvas.width,i.canvas.height];r=mt.intersect(r,c)||[0,0,0,0];const u=Math.floor(r[0]),h=Math.floor(r[1]),p=Math.max(Math.ceil(r[2])-u,1),m=Math.max(Math.ceil(r[3])-h,1);this.current.startNewPathAndClipBox([0,0,p,m]);let g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);const y=this.cachedCanvases.getCanvas(g,p,m),b=y.context;b.translate(-u,-h),b.transform(...a);let S=new Path2D;const[A,_,R,C]=t.bbox;if(S.rect(A,_,R-A,C-_),t.matrix){const N=new Path2D;N.addPath(S,new DOMMatrix(t.matrix)),S=N}b.clip(S),t.smask?this.smaskStack.push({canvas:y.canvas,context:b,offsetX:u,offsetY:h,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(u,h),i.save()),sl(i,b),this.ctx=b,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,a=this.groupStack.pop();if(this.ctx=a,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const r=ye(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...r);const c=xr.slice();mt.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],r,c),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(c)}}beginAnnotation(t,i,a,r,c){if(this.#t(),Mu(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const u=i[2]-i[0],h=i[3]-i[1];if(c&&this.annotationCanvasMap){a=a.slice(),a[4]-=i[0],a[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=u,i[3]=h,mt.singularValueDecompose2dScale(ye(this.ctx),Pn);const{viewportScale:p}=this,m=Math.ceil(u*this.outputScaleX*p),g=Math.ceil(h*this.outputScaleY*p);this.annotationCanvas=this.canvasFactory.create(m,g);const{canvas:y,context:b}=this.annotationCanvas;this.annotationCanvasMap.set(t,y),this.annotationCanvas.savedCtx=this.ctx,this.ctx=b,this.ctx.save(),this.ctx.setTransform(Pn[0],0,0,-Pn[1],0,h*Pn[1]),Mu(this.ctx)}else{Mu(this.ctx),this.endPath();const p=new Path2D;p.rect(i[0],i[1],u,h),this.ctx.clip(p)}}this.current=new g0(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...a),this.transform(...r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const i=t.count;t=this.getObject(t.data,t),t.count=i;const a=this.ctx,r=this._createMaskCanvas(t),c=r.canvas;a.save(),a.setTransform(1,0,0,1,0,0),a.drawImage(c,r.offsetX,r.offsetY),a.restore(),this.compose()}paintImageMaskXObjectRepeat(t,i,a=0,r=0,c,u){if(!this.contentVisible)return;t=this.getObject(t.data,t);const h=this.ctx;h.save();const p=ye(h);h.transform(i,a,r,c,0,0);const m=this._createMaskCanvas(t);h.setTransform(1,0,0,1,m.offsetX-p[4],m.offsetY-p[5]);for(let g=0,y=u.length;g<y;g+=2){const b=mt.transform(p,[i,a,r,c,u[g],u[g+1]]);h.drawImage(m.canvas,b[4],b[5])}h.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const i=this.ctx,a=this.current.fillColor,r=this.current.patternFill;for(const c of t){const{data:u,width:h,height:p,transform:m}=c,g=this.cachedCanvases.getCanvas("maskCanvas",h,p),y=g.context;y.save();const b=this.getObject(u,c);b0(y,b),y.globalCompositeOperation="source-in",y.fillStyle=r?a.getPattern(y,this,Ri(i),Ye.FILL):a,y.fillRect(0,0,h,p),y.restore(),i.save(),i.transform(...m),i.scale(1,-1),Du(i,g.canvas,0,0,h,p,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const i=this.getObject(t);if(!i){wt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(i)}paintImageXObjectRepeat(t,i,a,r){if(!this.contentVisible)return;const c=this.getObject(t);if(!c){wt("Dependent image isn't ready yet");return}const u=c.width,h=c.height,p=[];for(let m=0,g=r.length;m<g;m+=2)p.push({transform:[i,0,0,a,r[m],r[m+1]],x:0,y:0,w:u,h});this.paintInlineImageXObjectGroup(c,p)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:i,width:a,height:r}=t,c=this.cachedCanvases.getCanvas("inlineImage",a,r),u=c.context;return u.filter=this.current.transferMaps,u.drawImage(i,0,0),u.filter="none",c.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const i=t.width,a=t.height,r=this.ctx;this.save();const{filter:c}=r;c!=="none"&&c!==""&&(r.filter="none"),r.scale(1/i,-1/a);let u;if(t.bitmap)u=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)u=t;else{const m=this.cachedCanvases.getCanvas("inlineImage",i,a).context;y0(m,t),u=this.applyTransferMapsToCanvas(m)}const h=this._scaleImage(u,Ri(r));r.imageSmoothingEnabled=v0(ye(r),t.interpolate),Du(r,h.img,0,0,h.paintWidth,h.paintHeight,0,-a,i,a),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,i){if(!this.contentVisible)return;const a=this.ctx;let r;if(t.bitmap)r=t.bitmap;else{const c=t.width,u=t.height,p=this.cachedCanvases.getCanvas("inlineImage",c,u).context;y0(p,t),r=this.applyTransferMapsToCanvas(p)}for(const c of i)a.save(),a.transform(...c.transform),a.scale(1,-1),Du(a,r,c.x,c.y,c.w,c.h,0,-1,1,1),a.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,i){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,i){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,i){const a=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const r=this.ctx;this.pendingClip&&(a||(this.pendingClip===S0?r.clip(t,"evenodd"):r.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=ye(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const i=Math.abs(t[0]*t[3]-t[2]*t[1]),a=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(a,r)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:i,b:a,c:r,d:c}=this.ctx.getTransform();let u,h;if(a===0&&r===0){const p=Math.abs(i),m=Math.abs(c);if(p===m)if(t===0)u=h=1/p;else{const g=p*t;u=h=g<1?1/g:1}else if(t===0)u=1/p,h=1/m;else{const g=p*t,y=m*t;u=g<1?1/g:1,h=y<1?1/y:1}}else{const p=Math.abs(i*c-a*r),m=Math.hypot(i,a),g=Math.hypot(r,c);if(t===0)u=g/p,h=m/p;else{const y=t*p;u=g>y?g/y:1,h=m>y?m/y:1}}this._cachedScaleForStroking[0]=u,this._cachedScaleForStroking[1]=h}return this._cachedScaleForStroking}rescaleAndStroke(t,i){const{ctx:a,current:{lineWidth:r}}=this,[c,u]=this.getScaleForStroking();if(c===u){a.lineWidth=(r||1)*c,a.stroke(t);return}const h=a.getLineDash();i&&a.save(),a.scale(c,u),tp.a=1/c,tp.d=1/u;const p=new Path2D;if(p.addPath(t,tp),h.length>0){const m=Math.max(c,u);a.setLineDash(h.map(g=>g/m)),a.lineDashOffset/=m}a.lineWidth=r||1,a.stroke(p),i&&a.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const l in bu)Rr.prototype[l]!==void 0&&(Rr.prototype[bu[l]]=Rr.prototype[l]);class Dr{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#t=t}static get workerSrc(){return this.#e}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#e=t}}class iO{#t;#e;constructor({parsedData:t,rawData:i}){this.#t=t,this.#e=i}getRaw(){return this.#e}get(t){return this.#t.get(t)??null}[Symbol.iterator](){return this.#t.entries()}}const Mr=Symbol("INTERNAL");class sO{#t=!1;#e=!1;#n=!1;#i=!0;constructor(t,{name:i,intent:a,usage:r,rbGroups:c}){this.#t=!!(t&In.DISPLAY),this.#e=!!(t&In.PRINT),this.name=i,this.intent=a,this.usage=r,this.rbGroups=c}get visible(){if(this.#n)return this.#i;if(!this.#i)return!1;const{print:t,view:i}=this.usage;return this.#t?i?.viewState!=="OFF":this.#e?t?.printState!=="OFF":!0}_setVisible(t,i,a=!1){t!==Mr&&ne("Internal method `_setVisible` called."),this.#n=a,this.#i=i}}class aO{#t=null;#e=new Map;#n=null;#i=null;constructor(t,i=In.DISPLAY){if(this.renderingIntent=i,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const a of t.groups)this.#e.set(a.id,new sO(i,a));if(t.baseState==="OFF")for(const a of this.#e.values())a._setVisible(Mr,!1);for(const a of t.on)this.#e.get(a)._setVisible(Mr,!0);for(const a of t.off)this.#e.get(a)._setVisible(Mr,!1);this.#n=this.getHash()}}#a(t){const i=t.length;if(i<2)return!0;const a=t[0];for(let r=1;r<i;r++){const c=t[r];let u;if(Array.isArray(c))u=this.#a(c);else if(this.#e.has(c))u=this.#e.get(c).visible;else return wt(`Optional content group not found: ${c}`),!0;switch(a){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return a==="And"}isVisible(t){if(this.#e.size===0)return!0;if(!t)return Eu("Optional content group not defined."),!0;if(t.type==="OCG")return this.#e.has(t.id)?this.#e.get(t.id).visible:(wt(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#a(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const i of t.ids){if(!this.#e.has(i))return wt(`Optional content group not found: ${i}`),!0;if(this.#e.get(i).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const i of t.ids){if(!this.#e.has(i))return wt(`Optional content group not found: ${i}`),!0;if(!this.#e.get(i).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const i of t.ids){if(!this.#e.has(i))return wt(`Optional content group not found: ${i}`),!0;if(!this.#e.get(i).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const i of t.ids){if(!this.#e.has(i))return wt(`Optional content group not found: ${i}`),!0;if(this.#e.get(i).visible)return!1}return!0}return wt(`Unknown optional content policy ${t.policy}.`),!0}return wt(`Unknown group type ${t.type}.`),!0}setVisibility(t,i=!0,a=!0){const r=this.#e.get(t);if(!r){wt(`Optional content group not found: ${t}`);return}if(a&&i&&r.rbGroups.length)for(const c of r.rbGroups)for(const u of c)u!==t&&this.#e.get(u)?._setVisible(Mr,!1,!0);r._setVisible(Mr,!!i,!0),this.#t=null}setOCGState({state:t,preserveRB:i}){let a;for(const r of t){switch(r){case"ON":case"OFF":case"Toggle":a=r;continue}const c=this.#e.get(r);if(c)switch(a){case"ON":this.setVisibility(r,!0,i);break;case"OFF":this.setVisibility(r,!1,i);break;case"Toggle":this.setVisibility(r,!c.visible,i);break}}this.#t=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#e.size?this.#i?this.#i.slice():[...this.#e.keys()]:null}getGroup(t){return this.#e.get(t)||null}getHash(){if(this.#t!==null)return this.#t;const t=new e0;for(const[i,a]of this.#e)t.update(`${i}:${a.visible}`);return this.#t=t.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class rO{constructor(t,{disableRange:i=!1,disableStream:a=!1}){Me(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:r,initialData:c,progressiveDone:u,contentDispositionFilename:h}=t;if(this._queuedChunks=[],this._progressiveDone=u,this._contentDispositionFilename=h,c?.length>0){const p=c instanceof Uint8Array&&c.byteLength===c.buffer.byteLength?c.buffer:new Uint8Array(c).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!a,this._isRangeSupported=!i,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((p,m)=>{this._onReceiveData({begin:p,chunk:m})}),t.addProgressListener((p,m)=>{this._onProgress({loaded:p,total:m})}),t.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:i}){const a=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(a):this._queuedChunks.push(a);else{const r=this._rangeReaders.some(function(c){return c._begin!==t?!1:(c._enqueue(a),!0)});Me(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const i=this._rangeReaders.indexOf(t);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){Me(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new oO(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const a=new lO(this,t,i);return this._pdfDataRangeTransport.requestDataRange(t,i),this._rangeReaders.push(a),a}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class oO{constructor(t,i,a=!1,r=null){this._stream=t,this._done=a||!1,this._filename=Ff(r)?r:null,this._queuedChunks=i||[],this._loaded=0;for(const c of this._queuedChunks)this._loaded+=c.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class lO{constructor(t,i,a){this._stream=t,this._begin=i,this._end=a,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const a of this._requests)a.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 i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function cO(l){let t=!0,i=a("filename\\*","i").exec(l);if(i){i=i[1];let g=h(i);return g=unescape(g),g=p(g),g=m(g),c(g)}if(i=u(l),i){const g=m(i);return c(g)}if(i=a("filename","i").exec(l),i){i=i[1];let g=h(i);return g=m(g),c(g)}function a(g,y){return new RegExp("(?:^|;)\\s*"+g+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',y)}function r(g,y){if(g){if(!/^[\x00-\xFF]+$/.test(y))return y;try{const b=new TextDecoder(g,{fatal:!0}),S=Ko(y);y=b.decode(S),t=!1}catch{}}return y}function c(g){return t&&/[\x80-\xff]/.test(g)&&(g=r("utf-8",g),t&&(g=r("iso-8859-1",g))),g}function u(g){const y=[];let b;const S=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(b=S.exec(g))!==null;){let[,_,R,C]=b;if(_=parseInt(_,10),_ in y){if(_===0)break;continue}y[_]=[R,C]}const A=[];for(let _=0;_<y.length&&_ in y;++_){let[R,C]=y[_];C=h(C),R&&(C=unescape(C),_===0&&(C=p(C))),A.push(C)}return A.join("")}function h(g){if(g.startsWith('"')){const y=g.slice(1).split('\\"');for(let b=0;b<y.length;++b){const S=y[b].indexOf('"');S!==-1&&(y[b]=y[b].slice(0,S),y.length=b+1),y[b]=y[b].replaceAll(/\\(.)/g,"$1")}g=y.join('"')}return g}function p(g){const y=g.indexOf("'");if(y===-1)return g;const b=g.slice(0,y),A=g.slice(y+1).replace(/^[^']*'/,"");return r(b,A)}function m(g){return!g.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(g)?g:g.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(y,b,S,A){if(S==="q"||S==="Q")return A=A.replaceAll("_"," "),A=A.replaceAll(/=([0-9a-fA-F]{2})/g,function(_,R){return String.fromCharCode(parseInt(R,16))}),r(b,A);try{A=atob(A)}catch{}return r(b,A)})}return""}function E0(l,t){const i=new Headers;if(!l||!t||typeof t!="object")return i;for(const a in t){const r=t[a];r!==void 0&&i.append(a,r)}return i}function Ou(l){return URL.parse(l)?.origin??null}function A0({responseHeaders:l,isHttp:t,rangeChunkSize:i,disableRange:a}){const r={allowRangeRequests:!1,suggestedLength:void 0},c=parseInt(l.get("Content-Length"),10);return!Number.isInteger(c)||(r.suggestedLength=c,c<=2*i)||a||!t||l.get("Accept-Ranges")!=="bytes"||(l.get("Content-Encoding")||"identity")!=="identity"||(r.allowRangeRequests=!0),r}function _0(l){const t=l.get("Content-Disposition");if(t){let i=cO(t);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(Ff(i))return i}return null}function al(l,t){return new Au(`Unexpected server response (${l}) while retrieving PDF "${t}".`,l,l===404||l===0&&t.startsWith("file:"))}function T0(l){return l===200||l===206}function w0(l,t,i){return{method:"GET",headers:l,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function C0(l){return l instanceof Uint8Array?l.buffer:l instanceof ArrayBuffer?l:(wt(`getArrayBuffer - unexpected data format: ${l}`),new Uint8Array(l).buffer)}class uO{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=E0(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Me(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new dO(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const a=new hO(this,t,i);return this._rangeRequestReaders.push(a),a}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class dO{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const i=t.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const a=new Headers(t.headers),r=i.url;fetch(r,w0(a,this._withCredentials,this._abortController)).then(c=>{if(t._responseOrigin=Ou(c.url),!T0(c.status))throw al(c.status,r);this._reader=c.body.getReader(),this._headersCapability.resolve();const u=c.headers,{allowRangeRequests:h,suggestedLength:p}=A0({responseHeaders:u,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=h,this._contentLength=p||this._contentLength,this._filename=_0(u),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ps("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:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:C0(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class hO{constructor(t,i,a){this._stream=t,this._reader=null,this._loaded=0;const r=t.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;const c=new Headers(t.headers);c.append("Range",`bytes=${i}-${a-1}`);const u=r.url;fetch(u,w0(c,this._withCredentials,this._abortController)).then(h=>{const p=Ou(h.url);if(p!==t._responseOrigin)throw new Error(`Expected range response-origin "${p}" to match "${t._responseOrigin}".`);if(!T0(h.status))throw al(h.status,u);this._readCapability.resolve(),this._reader=h.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:C0(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const ep=200,np=206;function fO(l){const t=l.response;return typeof t!="string"?t:Ko(t).buffer}class pO{_responseOrigin=null;constructor({url:t,httpHeaders:i,withCredentials:a}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=E0(this.isHttp,i),this.withCredentials=a||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const i=new XMLHttpRequest,a=this.currXhrId++,r=this.pendingRequests[a]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[c,u]of this.headers)i.setRequestHeader(c,u);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.expectedStatus=np):r.expectedStatus=ep,i.responseType="arraybuffer",Me(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{t.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,a),i.onprogress=this.onProgress.bind(this,a),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,i.send(null),a}onProgress(t,i){const a=this.pendingRequests[t];a&&a.onProgress?.(i)}onStateChange(t,i){const a=this.pendingRequests[t];if(!a)return;const r=a.xhr;if(r.readyState>=2&&a.onHeadersReceived&&(a.onHeadersReceived(),delete a.onHeadersReceived),r.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],r.status===0&&this.isHttp){a.onError(r.status);return}const c=r.status||ep;if(!(c===ep&&a.expectedStatus===np)&&c!==a.expectedStatus){a.onError(r.status);return}const h=fO(r);if(c===np){const p=r.getResponseHeader("Content-Range"),m=/bytes (\d+)-(\d+)\/(\d+)/.exec(p);m?a.onDone({begin:parseInt(m[1],10),chunk:h}):(wt('Missing or invalid "Content-Range" header.'),a.onError(0))}else h?a.onDone({begin:0,chunk:h}):a.onError(r.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const i=this.pendingRequests[t].xhr;delete this.pendingRequests[t],i.abort()}}class mO{constructor(t){this._source=t,this._manager=new pO(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const i=this._rangeRequestReaders.indexOf(t);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return Me(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new gO(this._manager,this._source),this._fullRequestReader}getRangeReader(t,i){const a=new yO(this._manager,t,i);return a.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(a),a}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class gO{constructor(t,i){this._manager=t,this._url=i.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.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 t=this._fullRequestId,i=this._manager.getRequestXhr(t);this._manager._responseOrigin=Ou(i.responseURL);const a=i.getAllResponseHeaders(),r=new Headers(a?a.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(h=>{const[p,...m]=h.split(": ");return[p,m.join(": ")]}):[]),{allowRangeRequests:c,suggestedLength:u}=A0({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});c&&(this._isRangeSupported=!0),this._contentLength=u||this._contentLength,this._filename=_0(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=al(t,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.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._headersCapability.promise}async read(){if(await this._headersCapability.promise,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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class yO{constructor(t,i,a){this._manager=t,this._url=t.url,this._requestId=t.request({begin:i,end:a,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=Ou(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const i=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const a of this._requests)a.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=al(t,this._url);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const bO=/^[a-z][a-z0-9\-+.]+:/i;function vO(l){if(bO.test(l))return new URL(l);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(l))}class SO{constructor(t){this.source=t,this.url=vO(t.url),Me(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Me(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new EO(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const a=new AO(this,t,i);return this._rangeRequestReaders.push(a),a}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class EO{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=t.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const a=process.getBuiltinModule("fs");a.promises.lstat(this._url).then(r=>{this._contentLength=r.size,this._setReadableStream(a.createReadStream(this._url)),this._headersCapability.resolve()},r=>{r.code==="ENOENT"&&(r=al(0,this._url.href)),this._storedError=r,this._headersCapability.reject(r)})}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 t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Ps("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class AO{constructor(t,i,a){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const r=t.source;this._isStreamingSupported=!r.disableStream;const c=process.getBuiltinModule("fs");this._setReadableStream(c.createReadStream(this._url,{start:i,end:a-1}))}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 t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const rl=Symbol("INITIAL_DATA");class x0{#t=Object.create(null);#e(t){return this.#t[t]||={...Promise.withResolvers(),data:rl}}get(t,i=null){if(i){const r=this.#e(t);return r.promise.then(()=>i(r.data)),null}const a=this.#t[t];if(!a||a.data===rl)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return a.data}has(t){const i=this.#t[t];return!!i&&i.data!==rl}delete(t){const i=this.#t[t];return!i||i.data===rl?!1:(delete this.#t[t],!0)}resolve(t,i=null){const a=this.#e(t);a.data=i,a.resolve()}clear(){for(const t in this.#t){const{data:i}=this.#t[t];i?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const t in this.#t){const{data:i}=this.#t[t];i!==rl&&(yield[t,i])}}}const _O=1e5,R0=30;class fn{#t=Promise.withResolvers();#e=null;#n=!1;#i=!!globalThis.FontInspector?.enabled;#a=null;#s=null;#r=0;#o=0;#u=null;#c=null;#h=0;#l=0;#p=Object.create(null);#g=[];#f=null;#d=[];#m=new WeakMap;#v=null;static#y=new Map;static#E=new Map;static#A=new WeakMap;static#b=null;static#T=new Set;constructor({textContentSource:t,container:i,viewport:a}){if(t instanceof ReadableStream)this.#f=t;else if(typeof t=="object")this.#f=new ReadableStream({start(p){p.enqueue(t),p.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#e=this.#c=i,this.#l=a.scale*Di.pixelRatio,this.#h=a.rotation,this.#s={div:null,properties:null,ctx:null};const{pageWidth:r,pageHeight:c,pageX:u,pageY:h}=a.rawDims;this.#v=[1,0,0,-1,-u,h+c],this.#o=r,this.#r=c,fn.#C(),Ta(i,a),this.#t.promise.finally(()=>{fn.#T.delete(this),this.#s=null,this.#p=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:i}=qe.platform;return zt(this,"fontFamilyMap",new Map([["sans-serif",`${t&&i?"Calibri, ":""}sans-serif`],["monospace",`${t&&i?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{this.#u.read().then(({value:i,done:a})=>{if(a){this.#t.resolve();return}this.#a??=i.lang,Object.assign(this.#p,i.styles),this.#D(i.items),t()},this.#t.reject)};return this.#u=this.#f.getReader(),fn.#T.add(this),t(),this.#t.promise}update({viewport:t,onBefore:i=null}){const a=t.scale*Di.pixelRatio,r=t.rotation;if(r!==this.#h&&(i?.(),this.#h=r,Ta(this.#c,{rotation:r})),a!==this.#l){i?.(),this.#l=a;const c={div:null,properties:null,ctx:fn.#R(this.#a)};for(const u of this.#d)c.properties=this.#m.get(u),c.div=u,this.#M(c)}}cancel(){const t=new Ps("TextLayer task cancelled.");this.#u?.cancel(t).catch(()=>{}),this.#u=null,this.#t.reject(t)}get textDivs(){return this.#d}get textContentItemsStr(){return this.#g}#D(t){if(this.#n)return;this.#s.ctx??=fn.#R(this.#a);const i=this.#d,a=this.#g;for(const r of t){if(i.length>_O){wt("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(r.str===void 0){if(r.type==="beginMarkedContentProps"||r.type==="beginMarkedContent"){const c=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),r.id&&this.#e.setAttribute("id",`${r.id}`),c.append(this.#e)}else r.type==="endMarkedContent"&&(this.#e=this.#e.parentNode);continue}a.push(r.str),this.#_(r)}}#_(t){const i=document.createElement("span"),a={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#d.push(i);const r=mt.transform(this.#v,t.transform);let c=Math.atan2(r[1],r[0]);const u=this.#p[t.fontName];u.vertical&&(c+=Math.PI/2);let h=this.#i&&u.fontSubstitution||u.fontFamily;h=fn.fontFamilyMap.get(h)||h;const p=Math.hypot(r[2],r[3]),m=p*fn.#k(h,u,this.#a);let g,y;c===0?(g=r[4],y=r[5]-m):(g=r[4]+m*Math.sin(c),y=r[5]-m*Math.cos(c));const b="calc(var(--total-scale-factor) *",S=i.style;this.#e===this.#c?(S.left=`${(100*g/this.#o).toFixed(2)}%`,S.top=`${(100*y/this.#r).toFixed(2)}%`):(S.left=`${b}${g.toFixed(2)}px)`,S.top=`${b}${y.toFixed(2)}px)`),S.fontSize=`${b}${(fn.#b*p).toFixed(2)}px)`,S.fontFamily=h,a.fontSize=p,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,this.#i&&(i.dataset.fontName=u.fontSubstitutionLoadedName||t.fontName),c!==0&&(a.angle=c*(180/Math.PI));let A=!1;if(t.str.length>1)A=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const _=Math.abs(t.transform[0]),R=Math.abs(t.transform[3]);_!==R&&Math.max(_,R)/Math.min(_,R)>1.5&&(A=!0)}if(A&&(a.canvasWidth=u.vertical?t.height:t.width),this.#m.set(i,a),this.#s.div=i,this.#s.properties=a,this.#M(this.#s),a.hasText&&this.#e.append(i),a.hasEOL){const _=document.createElement("br");_.setAttribute("role","presentation"),this.#e.append(_)}}#M(t){const{div:i,properties:a,ctx:r}=t,{style:c}=i;let u="";if(fn.#b>1&&(u=`scale(${1/fn.#b})`),a.canvasWidth!==0&&a.hasText){const{fontFamily:h}=c,{canvasWidth:p,fontSize:m}=a;fn.#x(r,m*this.#l,h);const{width:g}=r.measureText(i.textContent);g>0&&(u=`scaleX(${p*this.#l/g}) ${u}`)}a.angle!==0&&(u=`rotate(${a.angle}deg) ${u}`),u.length>0&&(c.transform=u)}static cleanup(){if(!(this.#T.size>0)){this.#y.clear();for(const{canvas:t}of this.#E.values())t.remove();this.#E.clear()}}static#R(t=null){let i=this.#E.get(t||="");if(!i){const a=document.createElement("canvas");a.className="hiddenCanvasElement",a.lang=t,document.body.append(a),i=a.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#E.set(t,i),this.#A.set(i,{size:0,family:""})}return i}static#x(t,i,a){const r=this.#A.get(t);i===r.size&&a===r.family||(t.font=`${i}px ${a}`,r.size=i,r.family=a)}static#C(){if(this.#b!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#b=t.getBoundingClientRect().height,t.remove()}static#k(t,i,a){const r=this.#y.get(t);if(r)return r;const c=this.#R(a);c.canvas.width=c.canvas.height=R0,this.#x(c,R0,t);const u=c.measureText(""),h=u.fontBoundingBoxAscent,p=Math.abs(u.fontBoundingBoxDescent);c.canvas.width=c.canvas.height=0;let m=.8;return h?m=h/(h+p):(qe.platform.isFirefox&&wt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?m=i.ascent:i.descent&&(m=1+i.descent)),this.#y.set(t,m),m}}class ol{static textContent(t){const i=[],a={items:i,styles:Object.create(null)};function r(c){if(!c)return;let u=null;const h=c.name;if(h==="#text")u=c.value;else if(ol.shouldBuildText(h))c?.attributes?.textContent?u=c.attributes.textContent:c.value&&(u=c.value);else return;if(u!==null&&i.push({str:u}),!!c.children)for(const p of c.children)r(p)}return r(t),a}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const TO=100;function D0(l={}){typeof l=="string"||l instanceof URL?l={url:l}:(l instanceof ArrayBuffer||ArrayBuffer.isView(l))&&(l={data:l});const t=new ip,{docId:i}=t,a=l.url?NM(l.url):null,r=l.data?LM(l.data):null,c=l.httpHeaders||null,u=l.withCredentials===!0,h=l.password??null,p=l.range instanceof M0?l.range:null,m=Number.isInteger(l.rangeChunkSize)&&l.rangeChunkSize>0?l.rangeChunkSize:2**16;let g=l.worker instanceof ll?l.worker:null;const y=l.verbosity,b=typeof l.docBaseUrl=="string"&&!_u(l.docBaseUrl)?l.docBaseUrl:null,S=xu(l.cMapUrl),A=l.cMapPacked!==!1,_=l.CMapReaderFactory||(dn?jM:r0),R=xu(l.iccUrl),C=xu(l.standardFontDataUrl),N=l.StandardFontDataFactory||(dn?$M:c0),O=xu(l.wasmUrl),U=l.WasmFactory||(dn?GM:d0),I=l.stopAtErrors!==!0,j=Number.isInteger(l.maxImageSize)&&l.maxImageSize>-1?l.maxImageSize:-1,F=l.isEvalSupported!==!1,J=typeof l.isOffscreenCanvasSupported=="boolean"?l.isOffscreenCanvasSupported:!dn,X=typeof l.isImageDecoderSupported=="boolean"?l.isImageDecoderSupported:!dn&&(qe.platform.isFirefox||!globalThis.chrome),at=Number.isInteger(l.canvasMaxAreaInBytes)?l.canvasMaxAreaInBytes:-1,K=typeof l.disableFontFace=="boolean"?l.disableFontFace:dn,lt=l.fontExtraProperties===!0,St=l.enableXfa===!0,yt=l.ownerDocument||globalThis.document,Gt=l.disableRange===!0,B=l.disableStream===!0,Q=l.disableAutoFetch===!0,dt=l.pdfBug===!0,Ct=l.CanvasFactory||(dn?FM:zM),W=l.FilterFactory||(dn?BM:HM),ht=l.enableHWA===!0,st=l.useWasm!==!1,bt=p?p.length:l.length??NaN,Kt=typeof l.useSystemFonts=="boolean"?l.useSystemFonts:!dn&&!K,re=typeof l.useWorkerFetch=="boolean"?l.useWorkerFetch:!!(_===r0&&N===c0&&U===d0&&S&&C&&O&&tl(S,document.baseURI)&&tl(C,document.baseURI)&&tl(O,document.baseURI)),tt=null;dM(y);const Wt={canvasFactory:new Ct({ownerDocument:yt,enableHWA:ht}),filterFactory:new W({docId:i,ownerDocument:yt}),cMapReaderFactory:re?null:new _({baseUrl:S,isCompressed:A}),standardFontDataFactory:re?null:new N({baseUrl:C}),wasmFactory:re?null:new U({baseUrl:O})};g||(g=ll.create({verbosity:y,port:Dr.workerPort}),t._worker=g);const Vt={docId:i,apiVersion:"5.4.54",data:r,password:h,disableAutoFetch:Q,rangeChunkSize:m,length:bt,docBaseUrl:b,enableXfa:St,evaluatorOptions:{maxImageSize:j,disableFontFace:K,ignoreErrors:I,isEvalSupported:F,isOffscreenCanvasSupported:J,isImageDecoderSupported:X,canvasMaxAreaInBytes:at,fontExtraProperties:lt,useSystemFonts:Kt,useWasm:st,useWorkerFetch:re,cMapUrl:S,iccUrl:R,standardFontDataUrl:C,wasmUrl:O}},be={ownerDocument:yt,pdfBug:dt,styleElement:tt,loadingParams:{disableAutoFetch:Q,enableXfa:St}};return g.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(g.destroyed)throw new Error("Worker was destroyed");const We=g.messageHandler.sendWithPromise("GetDocRequest",Vt,r?[r.buffer]:null);let wn;if(p)wn=new rO(p,{disableRange:Gt,disableStream:B});else if(!r){if(!a)throw new Error("getDocument - no `url` parameter provided.");const gi=tl(a)?uO:dn?SO:mO;wn=new gi({url:a,length:bt,httpHeaders:c,withCredentials:u,rangeChunkSize:m,disableRange:Gt,disableStream:B})}return We.then(gi=>{if(t.destroyed)throw new Error("Loading aborted");if(g.destroyed)throw new Error("Worker was destroyed");const Un=new il(i,gi,g.port),is=new xO(Un,t,wn,be,Wt,ht);t._transport=is,Un.send("Ready",null)})}).catch(t._capability.reject),t}class ip{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${ip.#t++}`;destroyed=!1;onPassword=null;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(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class M0{#t=Promise.withResolvers();#e=[];#n=[];#i=[];#a=[];constructor(t,i,a=!1,r=null){this.length=t,this.initialData=i,this.progressiveDone=a,this.contentDispositionFilename=r}addRangeListener(t){this.#a.push(t)}addProgressListener(t){this.#i.push(t)}addProgressiveReadListener(t){this.#n.push(t)}addProgressiveDoneListener(t){this.#e.push(t)}onDataRange(t,i){for(const a of this.#a)a(t,i)}onDataProgress(t,i){this.#t.promise.then(()=>{for(const a of this.#i)a(t,i)})}onDataProgressiveRead(t){this.#t.promise.then(()=>{for(const i of this.#n)i(t)})}onDataProgressiveDone(){this.#t.promise.then(()=>{for(const t of this.#e)t()})}transportReady(){this.#t.resolve()}requestDataRange(t,i){ne("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class wO{constructor(t,i){this._pdfInfo=t,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return zt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(i)}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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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 CO{#t=!1;constructor(t,i,a,r=!1){this._pageIndex=t,this._pageInfo=i,this._transport=a,this._stats=r?new Zv:null,this._pdfBug=r,this.commonObjs=a.commonObjs,this.objs=new x0,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:t,rotation:i=this.rotate,offsetX:a=0,offsetY:r=0,dontFlip:c=!1}={}){return new Jo({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:i,offsetX:a,offsetY:r,dontFlip:c})}getAnnotations({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return zt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:i=t.canvas,viewport:a,intent:r="display",annotationMode:c=Is.ENABLE,transform:u=null,background:h=null,optionalContentConfigPromise:p=null,annotationCanvasMap:m=null,pageColors:g=null,printAnnotationStorage:y=null,isEditing:b=!1}){this._stats?.time("Overall");const S=this._transport.getRenderingIntent(r,c,y,b),{renderingIntent:A,cacheKey:_}=S;this.#t=!1,p||=this._transport.getOptionalContentConfig(A);let R=this._intentStates.get(_);R||(R=Object.create(null),this._intentStates.set(_,R)),R.streamReaderCancelTimeout&&(clearTimeout(R.streamReaderCancelTimeout),R.streamReaderCancelTimeout=null);const C=!!(A&In.PRINT);R.displayReadyCapability||(R.displayReadyCapability=Promise.withResolvers(),R.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(S));const N=I=>{R.renderTasks.delete(O),C&&(this.#t=!0),this.#e(),I?(O.capability.reject(I),this._abortOperatorList({intentState:R,reason:I instanceof Error?I:new Error(I)})):O.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},O=new Or({callback:N,params:{canvas:i,canvasContext:t,viewport:a,transform:u,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:m,operatorList:R.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!C,pdfBug:this._pdfBug,pageColors:g,enableHWA:this._transport.enableHWA});(R.renderTasks||=new Set).add(O);const U=O.task;return Promise.all([R.displayReadyCapability.promise,p]).then(([I,j])=>{if(this.destroyed){N();return}if(this._stats?.time("Rendering"),!(j.renderingIntent&A))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");O.initializeGraphics({transparency:I,optionalContentConfig:j}),O.operatorListChanged()}).catch(N),U}getOperatorList({intent:t="display",annotationMode:i=Is.ENABLE,printAnnotationStorage:a=null,isEditing:r=!1}={}){function c(){h.operatorList.lastChunk&&(h.opListReadCapability.resolve(h.operatorList),h.renderTasks.delete(p))}const u=this._transport.getRenderingIntent(t,i,a,r,!0);let h=this._intentStates.get(u.cacheKey);h||(h=Object.create(null),this._intentStates.set(u.cacheKey,h));let p;return h.opListReadCapability||(p=Object.create(null),p.operatorListChanged=c,h.opListReadCapability=Promise.withResolvers(),(h.renderTasks||=new Set).add(p),h.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u)),h.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:i===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(a=>ol.textContent(a));const i=this.streamTextContent(t);return new Promise(function(a,r){function c(){u.read().then(function({value:p,done:m}){if(m){a(h);return}h.lang??=p.lang,Object.assign(h.styles,p.styles),h.items.push(...p.items),c()},r)}const u=i.getReader(),h={items:[],styles:Object.create(null),lang:null};c()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const a of i.renderTasks)t.push(a.completed),a.cancel();return this.objs.clear(),this.#t=!1,Promise.all(t)}cleanup(t=!1){this.#t=!0;const i=this.#e();return t&&i&&(this._stats&&=new Zv),i}#e(){if(!this.#t||this.destroyed)return!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}_startRenderPage(t,i){const a=this._intentStates.get(i);a&&(this._stats?.timeEnd("Page Request"),a.displayReadyCapability?.resolve(t))}_renderPageChunk(t,i){for(let a=0,r=t.length;a<r;a++)i.operatorList.fnArray.push(t.fnArray[a]),i.operatorList.argsArray.push(t.argsArray[a]);i.operatorList.lastChunk=t.lastChunk,i.operatorList.separateAnnots=t.separateAnnots;for(const a of i.renderTasks)a.operatorListChanged();t.lastChunk&&this.#e()}_pumpOperatorList({renderingIntent:t,cacheKey:i,annotationStorageSerializable:a,modifiedIds:r}){const{map:c,transfer:u}=a,p=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:c,modifiedIds:r},u).getReader(),m=this._intentStates.get(i);m.streamReader=p;const g=()=>{p.read().then(({value:y,done:b})=>{if(b){m.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(y,m),g())},y=>{if(m.streamReader=null,!this._transport.destroyed){if(m.operatorList){m.operatorList.lastChunk=!0;for(const b of m.renderTasks)b.operatorListChanged();this.#e()}if(m.displayReadyCapability)m.displayReadyCapability.reject(y);else if(m.opListReadCapability)m.opListReadCapability.reject(y);else throw y}})};g()}_abortOperatorList({intentState:t,reason:i,force:a=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!a){if(t.renderTasks.size>0)return;if(i instanceof Bf){let r=TO;i.extraDelay>0&&i.extraDelay<1e3&&(r+=i.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})},r);return}}if(t.streamReader.cancel(new Ps(i.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[r,c]of this._intentStates)if(c===t){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}const he=class he{constructor({name:t=null,port:i=null,verbosity:a=hM()}={}){Qi(this,pn);Qi(this,zs,Promise.withResolvers());Qi(this,mi,null);Qi(this,ns,null);Qi(this,Ra,null);if(this.name=t,this.destroyed=!1,this.verbosity=a,i){if(me(he,Ma).has(i))throw new Error("Cannot use more than one PDFWorker per port.");me(he,Ma).set(i,this),Ki(this,pn,e1).call(this,i)}else Ki(this,pn,n1).call(this)}get promise(){return me(this,zs).promise}get port(){return me(this,ns)}get messageHandler(){return me(this,mi)}destroy(){this.destroyed=!0,me(this,Ra)?.terminate(),Ln(this,Ra,null),me(he,Ma).delete(me(this,ns)),Ln(this,ns,null),me(this,mi)?.destroy(),Ln(this,mi,null)}static create(t){const i=me(this,Ma).get(t?.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new he(t)}static get workerSrc(){if(Dr.workerSrc)return Dr.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return zt(this,"_setupFakeWorkerGlobal",(async()=>me(this,Nr,Lh)?me(this,Nr,Lh):(await import(this.workerSrc)).WorkerMessageHandler)())}};zs=new WeakMap,mi=new WeakMap,ns=new WeakMap,Ra=new WeakMap,Pu=new WeakMap,Da=new WeakMap,Ma=new WeakMap,pn=new WeakSet,Nh=function(){me(this,zs).resolve(),me(this,mi).send("configure",{verbosity:this.verbosity})},e1=function(t){Ln(this,ns,t),Ln(this,mi,new il("main","worker",t)),me(this,mi).on("ready",()=>{}),Ki(this,pn,Nh).call(this)},n1=function(){if(me(he,Da)||me(he,Nr,Lh)){Ki(this,pn,Bc).call(this);return}let{workerSrc:t}=he;try{he._isSameOrigin(window.location,t)||(t=he._createCDNWrapper(new URL(t,window.location).href));const i=new Worker(t,{type:"module"}),a=new il("main","worker",i),r=()=>{c.abort(),a.destroy(),i.terminate(),this.destroyed?me(this,zs).reject(new Error("Worker was destroyed")):Ki(this,pn,Bc).call(this)},c=new AbortController;i.addEventListener("error",()=>{me(this,Ra)||r()},{signal:c.signal}),a.on("test",h=>{if(c.abort(),this.destroyed||!h){r();return}Ln(this,mi,a),Ln(this,ns,i),Ln(this,Ra,i),Ki(this,pn,Nh).call(this)}),a.on("ready",h=>{if(c.abort(),this.destroyed){r();return}try{u()}catch{Ki(this,pn,Bc).call(this)}});const u=()=>{const h=new Uint8Array;a.send("test",h,[h.buffer])};u();return}catch{Eu("The worker has been disabled.")}Ki(this,pn,Bc).call(this)},Bc=function(){me(he,Da)||(wt("Setting up fake worker."),Ln(he,Da,!0)),he._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){me(this,zs).reject(new Error("Worker was destroyed"));return}const i=new UM;Ln(this,ns,i);const a=`fake${t1(he,Pu)._++}`,r=new il(a+"_worker",a,i);t.setup(r,i),Ln(this,mi,new il(a,a+"_worker",i)),Ki(this,pn,Nh).call(this)}).catch(t=>{me(this,zs).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Nr=new WeakSet,Lh=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},Qi(he,Nr),Qi(he,Pu,0),Qi(he,Da,!1),Qi(he,Ma,new WeakMap),dn&&(Ln(he,Da,!0),Dr.workerSrc||="./pdf.worker.mjs"),he._isSameOrigin=(t,i)=>{const a=URL.parse(t);if(!a?.origin||a.origin==="null")return!1;const r=new URL(i,a);return a.origin===r.origin},he._createCDNWrapper=t=>{const i=`await import("${t}");`;return URL.createObjectURL(new Blob([i],{type:"text/javascript"}))},he.fromPort=t=>{if(TM("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return he.create(t)};let ll=he;class xO{#t=new Map;#e=new Map;#n=new Map;#i=new Map;#a=null;constructor(t,i,a,r,c,u){this.messageHandler=t,this.loadingTask=i,this.commonObjs=new x0,this.fontLoader=new OM({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=c.canvasFactory,this.filterFactory=c.filterFactory,this.cMapReaderFactory=c.cMapReaderFactory,this.standardFontDataFactory=c.standardFontDataFactory,this.wasmFactory=c.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=a,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=u,this.setupMessageHandler()}#s(t,i=null){const a=this.#t.get(t);if(a)return a;const r=this.messageHandler.sendWithPromise(t,i);return this.#t.set(t,r),r}get annotationStorage(){return zt(this,"annotationStorage",new Yf)}getRenderingIntent(t,i=Is.ENABLE,a=null,r=!1,c=!1){let u=In.DISPLAY,h=qf;switch(t){case"any":u=In.ANY;break;case"display":break;case"print":u=In.PRINT;break;default:wt(`getRenderingIntent - invalid intent: ${t}`)}const p=u&In.PRINT&&a instanceof n0?a:this.annotationStorage;switch(i){case Is.DISABLE:u+=In.ANNOTATIONS_DISABLE;break;case Is.ENABLE:break;case Is.ENABLE_FORMS:u+=In.ANNOTATIONS_FORMS;break;case Is.ENABLE_STORAGE:u+=In.ANNOTATIONS_STORAGE,h=p.serializable;break;default:wt(`getRenderingIntent - invalid annotationMode: ${i}`)}r&&(u+=In.IS_EDITING),c&&(u+=In.OPLIST);const{ids:m,hash:g}=p.modifiedIds,y=[u,h.hash,g];return{renderingIntent:u,cacheKey:y.join("_"),annotationStorageSerializable:h,modifiedIds:m}}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 t=[];for(const a of this.#e.values())t.push(a._destroy());this.#e.clear(),this.#n.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),fn.cleanup(),this._networkStream?.cancelAllRequests(new Ps("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:i}=this;t.on("GetReader",(a,r)=>{Me(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=c=>{this._lastProgress={loaded:c.loaded,total:c.total}},r.onPull=()=>{this._fullReader.read().then(function({value:c,done:u}){if(u){r.close();return}Me(c instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{r.error(c)})},r.onCancel=c=>{this._fullReader.cancel(c),r.ready.catch(u=>{if(!this.destroyed)throw u})}}),t.on("ReaderHeadersReady",async a=>{await this._fullReader.headersReady;const{isStreamingSupported:r,isRangeSupported:c,contentLength:u}=this._fullReader;return(!r||!c)&&(this._lastProgress&&i.onProgress?.(this._lastProgress),this._fullReader.onProgress=h=>{i.onProgress?.({loaded:h.loaded,total:h.total})}),{isStreamingSupported:r,isRangeSupported:c,contentLength:u}}),t.on("GetRangeReader",(a,r)=>{Me(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const c=this._networkStream.getRangeReader(a.begin,a.end);if(!c){r.close();return}r.onPull=()=>{c.read().then(function({value:u,done:h}){if(h){r.close();return}Me(u instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(u),1,[u])}).catch(u=>{r.error(u)})},r.onCancel=u=>{c.cancel(u),r.ready.catch(h=>{if(!this.destroyed)throw h})}}),t.on("GetDoc",({pdfInfo:a})=>{this._numPages=a.numPages,this._htmlForXfa=a.htmlForXfa,delete a.htmlForXfa,i._capability.resolve(new wO(a,this))}),t.on("DocException",a=>{i._capability.reject(_n(a))}),t.on("PasswordRequest",a=>{this.#a=Promise.withResolvers();try{if(!i.onPassword)throw _n(a);const r=c=>{c instanceof Error?this.#a.reject(c):this.#a.resolve({password:c})};i.onPassword(r,a.code)}catch(r){this.#a.reject(r)}return this.#a.promise}),t.on("DataLoaded",a=>{i.onProgress?.({loaded:a.length,total:a.length}),this.downloadInfoCapability.resolve(a)}),t.on("StartRenderPage",a=>{if(this.destroyed)return;this.#e.get(a.pageIndex)._startRenderPage(a.transparency,a.cacheKey)}),t.on("commonobj",([a,r,c])=>{if(this.destroyed||this.commonObjs.has(a))return null;switch(r){case"Font":if("error"in c){const m=c.error;wt(`Error during font loading: ${m}`),this.commonObjs.resolve(a,m);break}const u=this._params.pdfBug&&globalThis.FontInspector?.enabled?(m,g)=>globalThis.FontInspector.fontAdded(m,g):null,h=new kM(c,u);this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:a})).finally(()=>{!h.fontExtraProperties&&h.data&&(h.data=null),this.commonObjs.resolve(a,h)});break;case"CopyLocalImage":const{imageRef:p}=c;Me(p,"The imageRef must be defined.");for(const m of this.#e.values())for(const[,g]of m.objs)if(g?.ref===p)return g.dataLen?(this.commonObjs.resolve(a,structuredClone(g)),g.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(a,c);break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),t.on("obj",([a,r,c,u])=>{if(this.destroyed)return;const h=this.#e.get(r);if(!h.objs.has(a)){if(h._intentStates.size===0){u?.bitmap?.close();return}switch(c){case"Image":case"Pattern":h.objs.resolve(a,u);break;default:throw new Error(`Got unknown object type ${c}`)}}}),t.on("DocProgress",a=>{this.destroyed||i.onProgress?.({loaded:a.loaded,total:a.total})}),t.on("FetchBinaryData",async a=>{if(this.destroyed)throw new Error("Worker was destroyed.");const r=this[a.type];if(!r)throw new Error(`${a.type} not initialized, see the \`useWorkerFetch\` parameter.`);return r.fetch(a)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&wt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},i).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=t-1,a=this.#n.get(i);if(a)return a;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(c=>{if(this.destroyed)throw new Error("Transport destroyed");c.refStr&&this.#i.set(c.refStr,t);const u=new CO(i,c,this,this._params.pdfBug);return this.#e.set(i,u),u});return this.#n.set(i,r),r}getPageIndex(t){return Xf(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:i})}getFieldObjects(){return this.#s("GetFieldObjects")}hasJSActions(){return this.#s("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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.#s("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#s("GetOptionalContentConfig").then(i=>new aO(i,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",i=this.#t.get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,null).then(r=>({info:r[0],metadata:r[1]?new iO(r[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(t,a),a}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of this.#e.values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),fn.cleanup()}}cachedPageNumber(t){if(!Xf(t))return null;const i=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#i.get(i)??null}}class RO{#t=null;onContinue=null;onError=null;constructor(t){this.#t=t}get promise(){return this.#t.capability.promise}cancel(t=0){this.#t.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#t.operatorList;if(!t)return!1;const{annotationCanvasMap:i}=this.#t;return t.form||t.canvas&&i?.size>0}}class Or{#t=null;static#e=new WeakSet;constructor({callback:t,params:i,objs:a,commonObjs:r,annotationCanvasMap:c,operatorList:u,pageIndex:h,canvasFactory:p,filterFactory:m,useRequestAnimationFrame:g=!1,pdfBug:y=!1,pageColors:b=null,enableHWA:S=!1}){this.callback=t,this.params=i,this.objs=a,this.commonObjs=r,this.annotationCanvasMap=c,this.operatorListIdx=null,this.operatorList=u,this._pageIndex=h,this.canvasFactory=p,this.filterFactory=m,this._pdfBug=y,this.pageColors=b,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=g===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new RO(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=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=S}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:i}){if(this.cancelled)return;if(this._canvas){if(Or.#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.");Or.#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{viewport:a,transform:r,background:c}=this.params,u=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Rr(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:a,transparency:t,background:c}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,i=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),Or.#e.delete(this._canvas),t||=new Bf(`Rendering cancelled, page ${this._pageIndex+1}`,i),this.callback(t),this.task.onError?.(t)}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?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}):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(),Or.#e.delete(this._canvas),this.callback())))}}const DO="5.4.54",MO="295fb3ec4";class Qn{#t=null;#e=null;#n;#i=null;#a=!1;#s=!1;#r=null;#o;#u=null;#c=null;static#h=null;static get _keyboardManager(){return zt(this,"_keyboardManager",new nl([[["Escape","mac+Escape"],Qn.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Qn.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Qn.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Qn.prototype._moveToPrevious],[["Home","mac+Home"],Qn.prototype._moveToBeginning],[["End","mac+End"],Qn.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:i=null}){t?(this.#s=!1,this.#r=t):this.#s=!0,this.#c=t?._uiManager||i,this.#o=this.#c._eventBus,this.#n=t?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",Qn.#h||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#t=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#r&&(t.ariaControls=`${this.#r.id}_colorpicker_dropdown`);const i=this.#c._signal;t.addEventListener("click",this.#f.bind(this),{signal:i}),t.addEventListener("keydown",this.#g.bind(this),{signal:i});const a=this.#e=document.createElement("span");return a.className="swatch",a.ariaHidden="true",a.style.backgroundColor=this.#n,t.append(a),t}renderMainDropdown(){const t=this.#i=this.#l();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#l(){const t=document.createElement("div"),i=this.#c._signal;t.addEventListener("contextmenu",Xn,{signal:i}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#r&&(t.id=`${this.#r.id}_colorpicker_dropdown`);for(const[a,r]of this.#c.highlightColors){const c=document.createElement("button");c.tabIndex="0",c.role="option",c.setAttribute("data-color",r),c.title=a,c.setAttribute("data-l10n-id",Qn.#h[a]);const u=document.createElement("span");c.append(u),u.className="swatch",u.style.backgroundColor=r,c.ariaSelected=r===this.#n,c.addEventListener("click",this.#p.bind(this,r),{signal:i}),t.append(c)}return t.addEventListener("keydown",this.#g.bind(this),{signal:i}),t}#p(t,i){i.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:$t.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}_colorSelectFromKeyboard(t){if(t.target===this.#t){this.#f(t);return}const i=t.target.getAttribute("data-color");i&&this.#p(i,t)}_moveToNext(t){if(!this.#m){this.#f(t);return}if(t.target===this.#t){this.#i.firstChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===this.#i?.firstChild||t.target===this.#t){this.#m&&this._hideDropdownFromKeyboard();return}this.#m||this.#f(t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!this.#m){this.#f(t);return}this.#i.firstChild?.focus()}_moveToEnd(t){if(!this.#m){this.#f(t);return}this.#i.lastChild?.focus()}#g(t){Qn._keyboardManager.exec(this,t)}#f(t){if(this.#m){this.hideDropdown();return}if(this.#a=t.detail===0,this.#u||(this.#u=new AbortController,window.addEventListener("pointerdown",this.#d.bind(this),{signal:this.#c.combinedSignal(this.#u)})),this.#t.ariaExpanded="true",this.#i){this.#i.classList.remove("hidden");return}const i=this.#i=this.#l();this.#t.append(i)}#d(t){this.#i?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#i?.classList.add("hidden"),this.#t.ariaExpanded="false",this.#u?.abort(),this.#u=null}get#m(){return this.#i&&!this.#i.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#s){if(!this.#m){this.#r?.unselect();return}this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#a})}}updateColor(t){if(this.#e&&(this.#e.style.backgroundColor=t),!this.#i)return;const i=this.#c.highlightColors.values();for(const a of this.#i.children)a.ariaSelected=i.next().value===t.toUpperCase()}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#i?.remove(),this.#i=null}}class cl{#t=null;#e=null;#n=null;static#i=null;constructor(t){this.#e=t,this.#n=t._uiManager,cl.#i||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#t)return this.#t;const{editorType:t,colorType:i,colorValue:a}=this.#e,r=this.#t=document.createElement("input");return r.type="color",r.value=a||"#000000",r.className="basicColorPicker",r.tabIndex=0,r.setAttribute("data-l10n-id",cl.#i[t]),r.addEventListener("input",()=>{this.#n.updateParams(i,r.value)},{signal:this.#n._signal}),r}update(t){this.#t&&(this.#t.value=t)}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}function O0(l){return Math.floor(Math.max(0,Math.min(1,l))*255).toString(16).padStart(2,"0")}function ul(l){return Math.max(0,Math.min(255,255*l))}class k0{static CMYK_G([t,i,a,r]){return["G",1-Math.min(1,.3*t+.59*a+.11*i+r)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=ul(t),[t,t,t]}static G_HTML([t]){const i=O0(t);return`#${i}${i}${i}`}static RGB_G([t,i,a]){return["G",.3*t+.59*i+.11*a]}static RGB_rgb(t){return t.map(ul)}static RGB_HTML(t){return`#${t.map(O0).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,i,a,r]){return["RGB",1-Math.min(1,t+r),1-Math.min(1,a+r),1-Math.min(1,i+r)]}static CMYK_rgb([t,i,a,r]){return[ul(1-Math.min(1,t+r)),ul(1-Math.min(1,a+r)),ul(1-Math.min(1,i+r))]}static CMYK_HTML(t){const i=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([t,i,a]){const r=1-t,c=1-i,u=1-a,h=Math.min(r,c,u);return["CMYK",r,c,u,h]}}class OO{create(t,i,a=!1){if(t<=0||i<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),a||(r.setAttribute("width",`${t}px`),r.setAttribute("height",`${i}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${t} ${i}`),r}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){ne("Abstract method `_createSVG` called.")}}class ku extends OO{_createSVG(t){return document.createElementNS(ts,t)}}class N0{static setupStorage(t,i,a,r,c){const u=r.getValue(i,{value:null});switch(a.name){case"textarea":if(u.value!==null&&(t.textContent=u.value),c==="print")break;t.addEventListener("input",h=>{r.setValue(i,{value:h.target.value})});break;case"input":if(a.attributes.type==="radio"||a.attributes.type==="checkbox"){if(u.value===a.attributes.xfaOn?t.setAttribute("checked",!0):u.value===a.attributes.xfaOff&&t.removeAttribute("checked"),c==="print")break;t.addEventListener("change",h=>{r.setValue(i,{value:h.target.checked?h.target.getAttribute("xfaOn"):h.target.getAttribute("xfaOff")})})}else{if(u.value!==null&&t.setAttribute("value",u.value),c==="print")break;t.addEventListener("input",h=>{r.setValue(i,{value:h.target.value})})}break;case"select":if(u.value!==null){t.setAttribute("value",u.value);for(const h of a.children)h.attributes.value===u.value?h.attributes.selected=!0:h.attributes.hasOwnProperty("selected")&&delete h.attributes.selected}t.addEventListener("input",h=>{const p=h.target.options,m=p.selectedIndex===-1?"":p[p.selectedIndex].value;r.setValue(i,{value:m})});break}}static setAttributes({html:t,element:i,storage:a=null,intent:r,linkService:c}){const{attributes:u}=i,h=t instanceof HTMLAnchorElement;u.type==="radio"&&(u.name=`${u.name}-${r}`);for(const[p,m]of Object.entries(u))if(m!=null)switch(p){case"class":m.length&&t.setAttribute(p,m.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",m);break;case"style":Object.assign(t.style,m);break;case"textContent":t.textContent=m;break;default:(!h||p!=="href"&&p!=="newWindow")&&t.setAttribute(p,m)}h&&c.addLinkAttributes(t,u.href,u.newWindow),a&&u.dataId&&this.setupStorage(t,u.dataId,i,a)}static render(t){const i=t.annotationStorage,a=t.linkService,r=t.xfaHtml,c=t.intent||"display",u=document.createElement(r.name);r.attributes&&this.setAttributes({html:u,element:r,intent:c,linkService:a});const h=c!=="richText",p=t.div;if(p.append(u),t.viewport){const y=`matrix(${t.viewport.transform.join(",")})`;p.style.transform=y}h&&p.setAttribute("class","xfaLayer xfaFont");const m=[];if(r.children.length===0){if(r.value){const y=document.createTextNode(r.value);u.append(y),h&&ol.shouldBuildText(r.name)&&m.push(y)}return{textDivs:m}}const g=[[r,-1,u]];for(;g.length>0;){const[y,b,S]=g.at(-1);if(b+1===y.children.length){g.pop();continue}const A=y.children[++g.at(-1)[1]];if(A===null)continue;const{name:_}=A;if(_==="#text"){const C=document.createTextNode(A.value);m.push(C),S.append(C);continue}const R=A?.attributes?.xmlns?document.createElementNS(A.attributes.xmlns,_):document.createElement(_);if(S.append(R),A.attributes&&this.setAttributes({html:R,element:A,storage:i,intent:c,linkService:a}),A.children?.length>0)g.push([A,-1,R]);else if(A.value){const C=document.createTextNode(A.value);h&&ol.shouldBuildText(_)&&m.push(C),R.append(C)}}for(const y of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))y.setAttribute("readOnly",!0);return{textDivs:m}}static update(t){const i=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=i,t.div.hidden=!1}}const kO=9,wa=new WeakSet,NO=new Date().getTimezoneOffset()*60*1e3;class L0{static create(t){switch(t.data.annotationType){case De.LINK:return new sp(t);case De.TEXT:return new LO(t);case De.WIDGET:switch(t.data.fieldType){case"Tx":return new IO(t);case"Btn":return t.data.radioButton?new I0(t):t.data.checkBox?new UO(t):new zO(t);case"Ch":return new HO(t);case"Sig":return new PO(t)}return new Ca(t);case De.POPUP:return new ap(t);case De.FREETEXT:return new P0(t);case De.LINE:return new FO(t);case De.SQUARE:return new jO(t);case De.CIRCLE:return new $O(t);case De.POLYLINE:return new U0(t);case De.CARET:return new VO(t);case De.INK:return new rp(t);case De.POLYGON:return new GO(t);case De.HIGHLIGHT:return new z0(t);case De.UNDERLINE:return new qO(t);case De.SQUIGGLY:return new YO(t);case De.STRIKEOUT:return new XO(t);case De.STAMP:return new H0(t);case De.FILEATTACHMENT:return new WO(t);default:return new _e(t)}}}class _e{#t=null;#e=!1;#n=null;constructor(t,{isRenderable:i=!1,ignoreBorder:a=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=i,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,i&&(this.container=this._createContainer(a)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:i}){return!!(t?.str||i?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return _e._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;t.rect&&(this.#t||={rect:this.data.rect.slice(0)});const{rect:i,popup:a}=t;i&&this.#i(i);let r=this.#n?.popup||this.popup;!r&&a?.text&&(this._createPopup(a),r=this.#n.popup),r&&(r.updateEdited(t),a?.deleted&&(r.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#t&&(this.#i(this.#t.rect),this.#n?.popup.resetEdited(),this.#t=null)}#i(t){const{container:{style:i},data:{rect:a,rotation:r},parent:{viewport:{rawDims:{pageWidth:c,pageHeight:u,pageX:h,pageY:p}}}}=this;a?.splice(0,4,...t),i.left=`${100*(t[0]-h)/c}%`,i.top=`${100*(u-t[3]+p)/u}%`,r===0?(i.width=`${100*(t[2]-t[0])/c}%`,i.height=`${100*(t[3]-t[1])/u}%`):this.setRotation(r)}_createContainer(t){const{data:i,parent:{page:a,viewport:r}}=this,c=document.createElement("section");c.setAttribute("data-annotation-id",i.id),!(this instanceof Ca)&&!(this instanceof sp)&&(c.tabIndex=0);const{style:u}=c;if(u.zIndex=this.parent.zIndex++,i.alternativeText&&(c.title=i.alternativeText),i.noRotate&&c.classList.add("norotate"),!i.rect||this instanceof ap){const{rotation:_}=i;return!i.hasOwnCanvas&&_!==0&&this.setRotation(_,c),c}const{width:h,height:p}=this;if(!t&&i.borderStyle.width>0){u.borderWidth=`${i.borderStyle.width}px`;const _=i.borderStyle.horizontalCornerRadius,R=i.borderStyle.verticalCornerRadius;if(_>0||R>0){const N=`calc(${_}px * var(--total-scale-factor)) / calc(${R}px * var(--total-scale-factor))`;u.borderRadius=N}else if(this instanceof I0){const N=`calc(${h}px * var(--total-scale-factor)) / calc(${p}px * var(--total-scale-factor))`;u.borderRadius=N}switch(i.borderStyle.style){case wr.SOLID:u.borderStyle="solid";break;case wr.DASHED:u.borderStyle="dashed";break;case wr.BEVELED:wt("Unimplemented border style: beveled");break;case wr.INSET:wt("Unimplemented border style: inset");break;case wr.UNDERLINE:u.borderBottomStyle="solid";break}const C=i.borderColor||null;C?(this.#e=!0,u.borderColor=mt.makeHexColor(C[0]|0,C[1]|0,C[2]|0)):u.borderWidth=0}const m=mt.normalizeRect([i.rect[0],a.view[3]-i.rect[1]+a.view[1],i.rect[2],a.view[3]-i.rect[3]+a.view[1]]),{pageWidth:g,pageHeight:y,pageX:b,pageY:S}=r.rawDims;u.left=`${100*(m[0]-b)/g}%`,u.top=`${100*(m[1]-S)/y}%`;const{rotation:A}=i;return i.hasOwnCanvas||A===0?(u.width=`${100*h/g}%`,u.height=`${100*p/y}%`):this.setRotation(A,c),c}setRotation(t,i=this.container){if(!this.data.rect)return;const{pageWidth:a,pageHeight:r}=this.parent.viewport.rawDims;let{width:c,height:u}=this;t%180!==0&&([c,u]=[u,c]),i.style.width=`${100*c/a}%`,i.style.height=`${100*u/r}%`,i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(i,a,r)=>{const c=r.detail[i],u=c[0],h=c.slice(1);r.target.style[a]=k0[`${u}_HTML`](h),this.annotationStorage.setValue(this.data.id,{[a]:k0[`${u}_rgb`](h)})};return zt(this,"_commonActions",{display:i=>{const{display:a}=i.detail,r=a%2===1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:a===1||a===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:a}=i.detail;this.container.style.visibility=a?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:a,noView:a})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{t("bgColor","backgroundColor",i)},fillColor:i=>{t("fillColor","backgroundColor",i)},fgColor:i=>{t("fgColor","color",i)},textColor:i=>{t("textColor","color",i)},borderColor:i=>{t("borderColor","borderColor",i)},strokeColor:i=>{t("strokeColor","borderColor",i)},rotation:i=>{const a=i.detail.rotation;this.setRotation(a),this.annotationStorage.setValue(this.data.id,{rotation:a})}})}_dispatchEventFromSandbox(t,i){const a=this._commonActions;for(const r of Object.keys(i.detail))(t[r]||a[r])?.(i)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const a=this._commonActions;for(const[r,c]of Object.entries(i)){const u=a[r];if(u){const h={detail:{[r]:c},target:t};u(h),delete i[r]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[i,a,r,c]=this.data.rect.map(_=>Math.fround(_));if(t.length===8){const[_,R,C,N]=t.subarray(2,6);if(r===_&&c===R&&i===C&&a===N)return}const{style:u}=this.container;let h;if(this.#e){const{borderColor:_,borderWidth:R}=u;u.borderWidth=0,h=["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="${_}" stroke-width="${R}">`],this.container.classList.add("hasBorder")}const p=r-i,m=c-a,{svgFactory:g}=this,y=g.createElement("svg");y.classList.add("quadrilateralsContainer"),y.setAttribute("width",0),y.setAttribute("height",0),y.role="none";const b=g.createElement("defs");y.append(b);const S=g.createElement("clipPath"),A=`clippath_${this.data.id}`;S.setAttribute("id",A),S.setAttribute("clipPathUnits","objectBoundingBox"),b.append(S);for(let _=2,R=t.length;_<R;_+=8){const C=t[_],N=t[_+1],O=t[_+2],U=t[_+3],I=g.createElement("rect"),j=(O-i)/p,F=(c-N)/m,J=(C-O)/p,X=(N-U)/m;I.setAttribute("x",j),I.setAttribute("y",F),I.setAttribute("width",J),I.setAttribute("height",X),S.append(I),h?.push(`<rect vector-effect="non-scaling-stroke" x="${j}" y="${F}" width="${J}" height="${X}"/>`)}this.#e&&(h.push("</g></svg>')"),u.backgroundImage=h.join("")),this.container.append(y),this.container.style.clipPath=`url(#${A})`}_createPopup(t=null){const{data:i}=this;let a,r;t?(a={str:t.text},r=t.date):(a=i.contentsObj,r=i.modificationDate);const c=this.#n=new ap({data:{color:i.color,titleObj:i.titleObj,modificationDate:r,contentsObj:a,richText:i.richText,parentRect:i.rect,borderStyle:0,id:`popup_${i.id}`,rotation:i.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent.div.append(c.render())}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}render(){ne("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,i=null){const a=[];if(this._fieldObjects){const r=this._fieldObjects[t];if(r)for(const{page:c,id:u,exportValues:h}of r){if(c===-1||u===i)continue;const p=typeof h=="string"?h:null,m=document.querySelector(`[data-element-id="${u}"]`);if(m&&!wa.has(m)){wt(`_getElementsByName - element not allowed: ${u}`);continue}a.push({id:u,exportValue:p,domElement:m})}return a}for(const r of document.getElementsByName(t)){const{exportValue:c}=r,u=r.getAttribute("data-element-id");u!==i&&wa.has(r)&&a.push({id:u,exportValue:c,domElement:r})}return a}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 t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const i of t)i.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:i,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class sp extends _e{constructor(t,i=null){super(t,{isRenderable:!0,ignoreBorder:!!i?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:i}=this,a=document.createElement("a");a.setAttribute("data-element-id",t.id);let r=!1;return t.url?(i.addLinkAttributes(a,t.url,t.newWindow),r=!0):t.action?(this._bindNamedAction(a,t.action,t.overlaidText),r=!0):t.attachment?(this.#e(a,t.attachment,t.overlaidText,t.attachmentDest),r=!0):t.setOCGState?(this.#n(a,t.setOCGState,t.overlaidText),r=!0):t.dest?(this._bindLink(a,t.dest,t.overlaidText),r=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(a,t),r=!0),t.resetForm?(this._bindResetFormAction(a,t.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(a,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(a),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(t,i,a=""){t.href=this.linkService.getDestinationHash(i),t.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&this.#t(),a&&(t.title=a)}_bindNamedAction(t,i,a=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(i),!1),a&&(t.title=a),this.#t()}#e(t,i,a="",r=null){t.href=this.linkService.getAnchorUrl(""),i.description?t.title=i.description:a&&(t.title=a),t.onclick=()=>(this.downloadManager?.openOrDownloadData(i.content,i.filename,r),!1),this.#t()}#n(t,i,a=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(i),!1),a&&(t.title=a),this.#t()}_bindJSAction(t,i){t.href=this.linkService.getAnchorUrl("");const a=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(i.actions)){const c=a.get(r);c&&(t[c]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:r}}),!1))}i.overlaidText&&(t.title=i.overlaidText),t.onclick||(t.onclick=()=>!1),this.#t()}_bindResetFormAction(t,i){const a=t.onclick;if(a||(t.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){wt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),a||(t.onclick=()=>!1);return}t.onclick=()=>{a?.();const{fields:r,refs:c,include:u}=i,h=[];if(r.length!==0||c.length!==0){const g=new Set(c);for(const y of r){const b=this._fieldObjects[y]||[];for(const{id:S}of b)g.add(S)}for(const y of Object.values(this._fieldObjects))for(const b of y)g.has(b.id)===u&&h.push(b)}else for(const g of Object.values(this._fieldObjects))h.push(...g);const p=this.annotationStorage,m=[];for(const g of h){const{id:y}=g;switch(m.push(y),g.type){case"text":{const S=g.defaultValue||"";p.setValue(y,{value:S});break}case"checkbox":case"radiobutton":{const S=g.defaultValue===g.exportValues;p.setValue(y,{value:S});break}case"combobox":case"listbox":{const S=g.defaultValue||"";p.setValue(y,{value:S});break}default:continue}const b=document.querySelector(`[data-element-id="${y}"]`);if(b){if(!wa.has(b)){wt(`_bindResetFormAction - element not allowed: ${y}`);continue}}else continue;b.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:m,name:"ResetForm"}}),!1}}}class LO extends _e{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Ca extends _e{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return qe.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,i,a,r,c){a.includes("mouse")?t.addEventListener(a,u=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:c(u),shift:u.shiftKey,modifier:this._getKeyModifier(u)}})}):t.addEventListener(a,u=>{if(a==="blur"){if(!i.focused||!u.relatedTarget)return;i.focused=!1}else if(a==="focus"){if(i.focused)return;i.focused=!0}c&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:c(u)}})})}_setEventListeners(t,i,a,r){for(const[c,u]of a)(u==="Action"||this.data.actions?.[u])&&((u==="Focus"||u==="Blur")&&(i||={focused:!1}),this._setEventListener(t,i,c,u,r),u==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,i,"blur","Blur",null):u==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,i,"focus","Focus",null))}_setBackgroundColor(t){const i=this.data.backgroundColor||null;t.style.backgroundColor=i===null?"transparent":mt.makeHexColor(i[0],i[1],i[2])}_setTextStyle(t){const i=["left","center","right"],{fontColor:a}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||kO,c=t.style;let u;const h=2,p=m=>Math.round(10*m)/10;if(this.data.multiLine){const m=Math.abs(this.data.rect[3]-this.data.rect[1]-h),g=Math.round(m/(Lf*r))||1,y=m/g;u=Math.min(r,p(y/Lf))}else{const m=Math.abs(this.data.rect[3]-this.data.rect[1]-h);u=Math.min(r,p(m/Lf))}c.fontSize=`calc(${u}px * var(--total-scale-factor))`,c.color=mt.makeHexColor(a[0],a[1],a[2]),this.data.textAlignment!==null&&(c.textAlign=i[this.data.textAlignment])}_setRequired(t,i){i?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",i)}}class IO extends Ca{constructor(t){const i=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:i})}setPropertyOnSiblings(t,i,a,r){const c=this.annotationStorage;for(const u of this._getElementsByName(t.name,t.id))u.domElement&&(u.domElement[i]=a),c.setValue(u.id,{[r]:a})}render(){const t=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let a=null;if(this.renderForms){const r=t.getValue(i,{value:this.data.fieldValue});let c=r.value||"";const u=t.getValue(i,{charLimit:this.data.maxLen}).charLimit;u&&c.length>u&&(c=c.slice(0,u));let h=r.formattedValue||this.data.textContent?.join(`
298
+ `)||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const p={userValue:c,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(a=document.createElement("textarea"),a.textContent=h??c,this.data.doNotScroll&&(a.style.overflowY="hidden")):(a=document.createElement("input"),a.type=this.data.password?"password":"text",a.setAttribute("value",h??c),this.data.doNotScroll&&(a.style.overflowX="hidden")),this.data.hasOwnCanvas&&(a.hidden=!0),wa.add(a),a.setAttribute("data-element-id",i),a.disabled=this.data.readOnly,a.name=this.data.fieldName,a.tabIndex=0;const{datetimeFormat:m,datetimeType:g,timeStep:y}=this.data,b=!!g&&this.enableScripting;m&&(a.title=m),this._setRequired(a,this.data.required),u&&(a.maxLength=u),a.addEventListener("input",A=>{t.setValue(i,{value:A.target.value}),this.setPropertyOnSiblings(a,"value",A.target.value,"value"),p.formattedValue=null}),a.addEventListener("resetform",A=>{const _=this.data.defaultFieldValue??"";a.value=p.userValue=_,p.formattedValue=null});let S=A=>{const{formattedValue:_}=p;_!=null&&(A.target.value=_),A.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){a.addEventListener("focus",_=>{if(p.focused)return;const{target:R}=_;if(b&&(R.type=g,y&&(R.step=y)),p.userValue){const C=p.userValue;if(b)if(g==="time"){const N=new Date(C),O=[N.getHours(),N.getMinutes(),N.getSeconds()];R.value=O.map(U=>U.toString().padStart(2,"0")).join(":")}else R.value=new Date(C-NO).toISOString().split(g==="date"?"T":".",1)[0];else R.value=C}p.lastCommittedValue=R.value,p.commitKey=1,this.data.actions?.Focus||(p.focused=!0)}),a.addEventListener("updatefromsandbox",_=>{this.showElementAndHideCanvas(_.target);const R={value(C){p.userValue=C.detail.value??"",b||t.setValue(i,{value:p.userValue.toString()}),C.target.value=p.userValue},formattedValue(C){const{formattedValue:N}=C.detail;p.formattedValue=N,N!=null&&C.target!==document.activeElement&&(C.target.value=N);const O={formattedValue:N};b&&(O.value=N),t.setValue(i,O)},selRange(C){C.target.setSelectionRange(...C.detail.selRange)},charLimit:C=>{const{charLimit:N}=C.detail,{target:O}=C;if(N===0){O.removeAttribute("maxLength");return}O.setAttribute("maxLength",N);let U=p.userValue;!U||U.length<=N||(U=U.slice(0,N),O.value=p.userValue=U,t.setValue(i,{value:U}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:U,willCommit:!0,commitKey:1,selStart:O.selectionStart,selEnd:O.selectionEnd}}))}};this._dispatchEventFromSandbox(R,_)}),a.addEventListener("keydown",_=>{p.commitKey=1;let R=-1;if(_.key==="Escape"?R=0:_.key==="Enter"&&!this.data.multiLine?R=2:_.key==="Tab"&&(p.commitKey=3),R===-1)return;const{value:C}=_.target;p.lastCommittedValue!==C&&(p.lastCommittedValue=C,p.userValue=C,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:C,willCommit:!0,commitKey:R,selStart:_.target.selectionStart,selEnd:_.target.selectionEnd}}))});const A=S;S=null,a.addEventListener("blur",_=>{if(!p.focused||!_.relatedTarget)return;this.data.actions?.Blur||(p.focused=!1);const{target:R}=_;let{value:C}=R;if(b){if(C&&g==="time"){const N=C.split(":").map(O=>parseInt(O,10));C=new Date(2e3,0,1,N[0],N[1],N[2]||0).valueOf(),R.step=""}else C=new Date(C).valueOf();R.type="text"}p.userValue=C,p.lastCommittedValue!==C&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:C,willCommit:!0,commitKey:p.commitKey,selStart:_.target.selectionStart,selEnd:_.target.selectionEnd}}),A(_)}),this.data.actions?.Keystroke&&a.addEventListener("beforeinput",_=>{p.lastCommittedValue=null;const{data:R,target:C}=_,{value:N,selectionStart:O,selectionEnd:U}=C;let I=O,j=U;switch(_.inputType){case"deleteWordBackward":{const F=N.substring(0,O).match(/\w*[^\w]*$/);F&&(I-=F[0].length);break}case"deleteWordForward":{const F=N.substring(O).match(/^[^\w]*\w*/);F&&(j+=F[0].length);break}case"deleteContentBackward":O===U&&(I-=1);break;case"deleteContentForward":O===U&&(j+=1);break}_.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:N,change:R||"",willCommit:!1,selStart:I,selEnd:j}})}),this._setEventListeners(a,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],_=>_.target.value)}if(S&&a.addEventListener("blur",S),this.data.comb){const _=(this.data.rect[2]-this.data.rect[0])/u;a.classList.add("comb"),a.style.letterSpacing=`calc(${_}px * var(--total-scale-factor) - 1ch)`}}else a=document.createElement("div"),a.textContent=this.data.fieldValue,a.style.verticalAlign="middle",a.style.display="table-cell",this.data.hasOwnCanvas&&(a.hidden=!0);return this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class PO extends Ca{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class UO extends Ca{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,i=this.data,a=i.id;let r=t.getValue(a,{value:i.exportValue===i.fieldValue}).value;typeof r=="string"&&(r=r!=="Off",t.setValue(a,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const c=document.createElement("input");return wa.add(c),c.setAttribute("data-element-id",a),c.disabled=i.readOnly,this._setRequired(c,this.data.required),c.type="checkbox",c.name=i.fieldName,r&&c.setAttribute("checked",!0),c.setAttribute("exportValue",i.exportValue),c.tabIndex=0,c.addEventListener("change",u=>{const{name:h,checked:p}=u.target;for(const m of this._getElementsByName(h,a)){const g=p&&m.exportValue===i.exportValue;m.domElement&&(m.domElement.checked=g),t.setValue(m.id,{value:g})}t.setValue(a,{value:p})}),c.addEventListener("resetform",u=>{const h=i.defaultFieldValue||"Off";u.target.checked=h===i.exportValue}),this.enableScripting&&this.hasJSActions&&(c.addEventListener("updatefromsandbox",u=>{const h={value(p){p.target.checked=p.detail.value!=="Off",t.setValue(a,{value:p.target.checked})}};this._dispatchEventFromSandbox(h,u)}),this._setEventListeners(c,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)),this._setBackgroundColor(c),this._setDefaultPropertiesFromJS(c),this.container.append(c),this.container}}class I0 extends Ca{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,i=this.data,a=i.id;let r=t.getValue(a,{value:i.fieldValue===i.buttonValue}).value;if(typeof r=="string"&&(r=r!==i.buttonValue,t.setValue(a,{value:r})),r)for(const u of this._getElementsByName(i.fieldName,a))t.setValue(u.id,{value:!1});const c=document.createElement("input");if(wa.add(c),c.setAttribute("data-element-id",a),c.disabled=i.readOnly,this._setRequired(c,this.data.required),c.type="radio",c.name=i.fieldName,r&&c.setAttribute("checked",!0),c.tabIndex=0,c.addEventListener("change",u=>{const{name:h,checked:p}=u.target;for(const m of this._getElementsByName(h,a))t.setValue(m.id,{value:!1});t.setValue(a,{value:p})}),c.addEventListener("resetform",u=>{const h=i.defaultFieldValue;u.target.checked=h!=null&&h===i.buttonValue}),this.enableScripting&&this.hasJSActions){const u=i.buttonValue;c.addEventListener("updatefromsandbox",h=>{const p={value:m=>{const g=u===m.detail.value;for(const y of this._getElementsByName(m.target.name)){const b=g&&y.id===a;y.domElement&&(y.domElement.checked=b),t.setValue(y.id,{value:b})}}};this._dispatchEventFromSandbox(p,h)}),this._setEventListeners(c,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],h=>h.target.checked)}return this._setBackgroundColor(c),this._setDefaultPropertiesFromJS(c),this.container.append(c),this.container}}class zO extends sp{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const i=t.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",a=>{this._dispatchEventFromSandbox({},a)})),t}}class HO extends Ca{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,i=this.data.id,a=t.getValue(i,{value:this.data.fieldValue}),r=document.createElement("select");wa.add(r),r.setAttribute("data-element-id",i),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let c=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",g=>{const y=this.data.defaultFieldValue;for(const b of r.options)b.selected=b.value===y});for(const g of this.data.options){const y=document.createElement("option");y.textContent=g.displayValue,y.value=g.exportValue,a.value.includes(g.exportValue)&&(y.setAttribute("selected",!0),c=!1),r.append(y)}let u=null;if(c){const g=document.createElement("option");g.value=" ",g.setAttribute("hidden",!0),g.setAttribute("selected",!0),r.prepend(g),u=()=>{g.remove(),r.removeEventListener("input",u),u=null},r.addEventListener("input",u)}const h=g=>{const y=g?"value":"textContent",{options:b,multiple:S}=r;return S?Array.prototype.filter.call(b,A=>A.selected).map(A=>A[y]):b.selectedIndex===-1?null:b[b.selectedIndex][y]};let p=h(!1);const m=g=>{const y=g.target.options;return Array.prototype.map.call(y,b=>({displayValue:b.textContent,exportValue:b.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",g=>{const y={value(b){u?.();const S=b.detail.value,A=new Set(Array.isArray(S)?S:[S]);for(const _ of r.options)_.selected=A.has(_.value);t.setValue(i,{value:h(!0)}),p=h(!1)},multipleSelection(b){r.multiple=!0},remove(b){const S=r.options,A=b.detail.remove;S[A].selected=!1,r.remove(A),S.length>0&&Array.prototype.findIndex.call(S,R=>R.selected)===-1&&(S[0].selected=!0),t.setValue(i,{value:h(!0),items:m(b)}),p=h(!1)},clear(b){for(;r.length!==0;)r.remove(0);t.setValue(i,{value:null,items:[]}),p=h(!1)},insert(b){const{index:S,displayValue:A,exportValue:_}=b.detail.insert,R=r.children[S],C=document.createElement("option");C.textContent=A,C.value=_,R?R.before(C):r.append(C),t.setValue(i,{value:h(!0),items:m(b)}),p=h(!1)},items(b){const{items:S}=b.detail;for(;r.length!==0;)r.remove(0);for(const A of S){const{displayValue:_,exportValue:R}=A,C=document.createElement("option");C.textContent=_,C.value=R,r.append(C)}r.options.length>0&&(r.options[0].selected=!0),t.setValue(i,{value:h(!0),items:m(b)}),p=h(!1)},indices(b){const S=new Set(b.detail.indices);for(const A of b.target.options)A.selected=S.has(A.index);t.setValue(i,{value:h(!0)}),p=h(!1)},editable(b){b.target.disabled=!b.detail.editable}};this._dispatchEventFromSandbox(y,g)}),r.addEventListener("input",g=>{const y=h(!0),b=h(!1);t.setValue(i,{value:y}),g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:p,change:b,changeEx:y,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"]],g=>g.target.value)):r.addEventListener("input",function(g){t.setValue(i,{value:h(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class ap extends _e{constructor(t){const{data:i,elements:a}=t;super(t,{isRenderable:_e._hasPopupData(i)}),this.elements=a,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const i=this.popup=new BO({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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}),a=[];for(const r of this.elements)r.popup=i,r.container.ariaHasPopup="dialog",a.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",a.map(r=>`${Hf}${r}`).join(",")),this.container}}class BO{#t=this.#M.bind(this);#e=this.#k.bind(this);#n=this.#C.bind(this);#i=this.#x.bind(this);#a=null;#s=null;#r=null;#o=null;#u=null;#c=null;#h=null;#l=!1;#p=null;#g=null;#f=null;#d=null;#m=null;#v=null;#y=null;#E=!1;constructor({container:t,color:i,elements:a,titleObj:r,modificationDate:c,contentsObj:u,richText:h,parent:p,rect:m,parentRect:g,open:y}){this.#s=t,this.#v=r,this.#r=u,this.#m=h,this.#c=p,this.#a=i,this.#d=m,this.#h=g,this.#u=a,this.#o=jf.toDateObject(c),this.trigger=a.flatMap(b=>b.getElementsToTriggerPopup()),this.#A(),this.#s.hidden=!0,y&&this.#x()}#A(){if(this.#g)return;this.#g=new AbortController;const{signal:t}=this.#g;for(const i of this.trigger)i.addEventListener("click",this.#i,{signal:t}),i.addEventListener("mouseenter",this.#n,{signal:t}),i.addEventListener("mouseleave",this.#e,{signal:t}),i.classList.add("popupTriggerArea");for(const i of this.#u)i.container?.addEventListener("keydown",this.#t,{signal:t})}render(){if(this.#p)return;const t=this.#p=document.createElement("div");if(t.className="popup",this.#a){const r=t.style.outlineColor=mt.makeHexColor(...this.#a);t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}const i=document.createElement("span");if(i.className="header",this.#v?.str){const r=document.createElement("span");r.className="title",i.append(r),{dir:r.dir,str:r.textContent}=this.#v}if(t.append(i),this.#o){const r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#o.valueOf()})),r.dateTime=this.#o.toISOString(),i.append(r)}const a=this.#b;if(a)N0.render({xfaHtml:a,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const r=this._formatContents(this.#r);t.append(r)}this.#s.append(t)}get#b(){const t=this.#m,i=this.#r;return t?.str&&(!i?.str||i.str===t.str)&&this.#m.html||null}get#T(){return this.#b?.attributes?.style?.fontSize||0}get#D(){return this.#b?.attributes?.style?.color||null}#_(t){const i=[],a={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},r={style:{color:this.#D,fontSize:this.#T?`calc(${this.#T}px * var(--total-scale-factor))`:""}};for(const c of t.split(`
299
+ `))i.push({name:"span",value:c,attributes:r});return a}_formatContents({str:t,dir:i}){const a=document.createElement("p");a.classList.add("popupContent"),a.dir=i;const r=t.split(/(?:\r\n?|\n)/);for(let c=0,u=r.length;c<u;++c){const h=r[c];a.append(document.createTextNode(h)),c<u-1&&a.append(document.createElement("br"))}return a}#M(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#l)&&this.#x()}updateEdited({rect:t,popup:i,deleted:a}){if(a||i?.deleted){this.remove();return}this.#A(),this.#y||={contentsObj:this.#r,richText:this.#m},t&&(this.#f=null),i&&(this.#m=this.#_(i.text),this.#o=jf.toDateObject(i.date),this.#r=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#y&&({contentsObj:this.#r,richText:this.#m}=this.#y,this.#y=null,this.#p?.remove(),this.#p=null,this.#f=null)}remove(){this.#g?.abort(),this.#g=null,this.#p?.remove(),this.#p=null,this.#E=!1,this.#l=!1;for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#R(){if(this.#f!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:r,pageY:c}}}=this.#c;let u=!!this.#h,h=u?this.#h:this.#d;for(const A of this.#u)if(!h||mt.intersect(A.data.rect,h)!==null){h=A.data.rect,u=!0;break}const p=mt.normalizeRect([h[0],t[3]-h[1]+t[1],h[2],t[3]-h[3]+t[1]]),g=u?h[2]-h[0]+5:0,y=p[0]+g,b=p[1];this.#f=[100*(y-r)/i,100*(b-c)/a];const{style:S}=this.#s;S.left=`${this.#f[0]}%`,S.top=`${this.#f[1]}%`}#x(){this.#l=!this.#l,this.#l?(this.#C(),this.#s.addEventListener("click",this.#i),this.#s.addEventListener("keydown",this.#t)):(this.#k(),this.#s.removeEventListener("click",this.#i),this.#s.removeEventListener("keydown",this.#t))}#C(){this.#p||this.render(),this.isVisible?this.#l&&this.#s.classList.add("focused"):(this.#R(),this.#s.hidden=!1,this.#s.style.zIndex=parseInt(this.#s.style.zIndex)+1e3)}#k(){this.#s.classList.remove("focused"),!(this.#l||!this.isVisible)&&(this.#s.hidden=!0,this.#s.style.zIndex=parseInt(this.#s.style.zIndex)-1e3)}forceHide(){this.#E=this.isVisible,this.#E&&(this.#s.hidden=!0)}maybeShow(){this.#A(),this.#E&&(this.#p||this.#C(),this.#E=!1,this.#s.hidden=!1)}get isVisible(){return this.#s.hidden===!1}}class P0 extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Tt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const i of this.textContent){const a=document.createElement("span");a.textContent=i,t.append(a)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class FO extends _e{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:i,height:a}=this,r=this.svgFactory.create(i,a,!0),c=this.#t=this.svgFactory.createElement("svg:line");return c.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),c.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),c.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),c.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),c.setAttribute("stroke-width",t.borderStyle.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),r.append(c),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class jO extends _e{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:i,height:a}=this,r=this.svgFactory.create(i,a,!0),c=t.borderStyle.width,u=this.#t=this.svgFactory.createElement("svg:rect");return u.setAttribute("x",c/2),u.setAttribute("y",c/2),u.setAttribute("width",i-c),u.setAttribute("height",a-c),u.setAttribute("stroke-width",c||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),r.append(u),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class $O extends _e{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:i,height:a}=this,r=this.svgFactory.create(i,a,!0),c=t.borderStyle.width,u=this.#t=this.svgFactory.createElement("svg:ellipse");return u.setAttribute("cx",i/2),u.setAttribute("cy",a/2),u.setAttribute("rx",i/2-c/2),u.setAttribute("ry",a/2-c/2),u.setAttribute("stroke-width",c||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),r.append(u),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class U0 extends _e{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:i,borderStyle:a,popupRef:r},width:c,height:u}=this;if(!i)return this.container;const h=this.svgFactory.create(c,u,!0);let p=[];for(let g=0,y=i.length;g<y;g+=2){const b=i[g]-t[0],S=t[3]-i[g+1];p.push(`${b},${S}`)}p=p.join(" ");const m=this.#t=this.svgFactory.createElement(this.svgElementName);return m.setAttribute("points",p),m.setAttribute("stroke-width",a.width||1),m.setAttribute("stroke","transparent"),m.setAttribute("fill","transparent"),h.append(m),this.container.append(h),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class GO extends U0{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class VO extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class rp extends _e{#t=null;#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Tt.HIGHLIGHT:Tt.INK}#n(t,i){switch(t){case 90:return{transform:`rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:`rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:`rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:`translate(${-i[0]},${i[3]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:i,inkLists:a,borderStyle:r,popupRef:c}}=this,{transform:u,width:h,height:p}=this.#n(i,t),m=this.svgFactory.create(h,p,!0),g=this.#t=this.svgFactory.createElement("svg:g");m.append(g),g.setAttribute("stroke-width",r.width||1),g.setAttribute("stroke-linecap","round"),g.setAttribute("stroke-linejoin","round"),g.setAttribute("stroke-miterlimit",10),g.setAttribute("stroke","transparent"),g.setAttribute("fill","transparent"),g.setAttribute("transform",u);for(let y=0,b=a.length;y<b;y++){const S=this.svgFactory.createElement(this.svgElementName);this.#e.push(S),S.setAttribute("points",a[y].join(",")),g.append(S)}return!c&&this.hasPopupData&&this._createPopup(),this.container.append(m),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:i,points:a,rect:r}=t,c=this.#t;if(i>=0&&c.setAttribute("stroke-width",i||1),a)for(let u=0,h=this.#e.length;u<h;u++)this.#e[u].setAttribute("points",a[u].join(","));if(r){const{transform:u,width:h,height:p}=this.#n(this.data.rotation,r);c.parentElement.setAttribute("viewBox",`0 0 ${h} ${p}`),c.setAttribute("transform",u)}}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class z0 extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Tt.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const a=document.createElement("mark");a.classList.add("overlaidText"),a.textContent=t,this.container.append(a)}return this.container}}class qO extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const a=document.createElement("u");a.classList.add("overlaidText"),a.textContent=t,this.container.append(a)}return this.container}}class YO extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const a=document.createElement("u");a.classList.add("overlaidText"),a.textContent=t,this.container.append(a)}return this.container}}class XO extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const a=document.createElement("s");a.classList.add("overlaidText"),a.textContent=t,this.container.append(a)}return this.container}}class H0 extends _e{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Tt.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class WO extends _e{#t=null;constructor(t){super(t,{isRenderable:!0});const{file:i}=this.data;this.filename=i.filename,this.content=i.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:i}=this;let a;i.hasAppearance||i.fillAlpha===0?a=document.createElement("div"):(a=document.createElement("img"),a.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(a.style=`filter: opacity(${Math.round(i.fillAlpha*100)}%);`)),a.addEventListener("dblclick",this.#e.bind(this)),this.#t=a;const{isMac:r}=qe.platform;return t.addEventListener("keydown",c=>{c.key==="Enter"&&(r?c.metaKey:c.ctrlKey)&&this.#e()}),!i.popupRef&&this.hasPopupData?this._createPopup():a.classList.add("popupTriggerArea"),t.append(a),t}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class op{#t=null;#e=null;#n=new Map;#i=null;constructor({div:t,accessibilityManager:i,annotationCanvasMap:a,annotationEditorUIManager:r,page:c,viewport:u,structTreeLayer:h}){this.div=t,this.#t=i,this.#e=a,this.#i=h||null,this.page=c,this.viewport=u,this.zIndex=0,this._annotationEditorUIManager=r}hasEditableAnnotations(){return this.#n.size>0}async#a(t,i,a){const r=t.firstChild||t,c=r.id=`${Hf}${i}`,u=await this.#i?.getAriaAttributes(c);if(u)for(const[h,p]of u)r.setAttribute(h,p);a?a.at(-1).container.after(t):(this.div.append(t),this.#t?.moveElementInDOM(this.div,t,r,!1))}async render(t){const{annotations:i}=t,a=this.div;Ta(a,this.viewport);const r=new Map,c={data:null,layer:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new ku,annotationStorage:t.annotationStorage||new Yf,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const u of i){if(u.noHTML)continue;const h=u.annotationType===De.POPUP;if(h){const g=r.get(u.id);if(!g)continue;c.elements=g}else if(u.rect[2]===u.rect[0]||u.rect[3]===u.rect[1])continue;c.data=u;const p=L0.create(c);if(!p.isRenderable)continue;if(!h&&u.popupRef){const g=r.get(u.popupRef);g?g.push(p):r.set(u.popupRef,[p])}const m=p.render();u.hidden&&(m.style.visibility="hidden"),await this.#a(m,u.id,c.elements),p._isEditable&&(this.#n.set(p.data.id,p),this._annotationEditorUIManager?.renderAnnotationElement(p))}this.#s()}async addLinkAnnotations(t,i){const a={data:null,layer:this.div,linkService:i,svgFactory:new ku,parent:this};for(const r of t){r.borderStyle||=op._defaultBorderStyle,a.data=r;const c=L0.create(a);if(!c.isRenderable)continue;const u=c.render();await this.#a(u,r.id,null)}}update({viewport:t}){const i=this.div;this.viewport=t,Ta(i,{rotation:t.rotation}),this.#s(),i.hidden=!1}#s(){if(!this.#e)return;const t=this.div;for(const[i,a]of this.#e){const r=t.querySelector(`[data-annotation-id="${i}"]`);if(!r)continue;a.className="annotationContent";const{firstChild:c}=r;c?c.nodeName==="CANVAS"?c.replaceWith(a):c.classList.contains("annotationContent")?c.after(a):c.before(a):r.append(a);const u=this.#n.get(i);u&&(u._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(i,r.id,a),u._hasNoCanvas=!1):u.canvas=a)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(t){return this.#n.get(t)}static get _defaultBorderStyle(){return zt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:wr.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const Nu=/\r\n?|\n/g;class Ue extends gt{#t;#e="";#n=`${this.id}-editor`;#i=null;#a;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Ue.prototype,i=c=>c.isEmpty(),a=Us.TRANSLATE_SMALL,r=Us.TRANSLATE_BIG;return zt(this,"_keyboardManager",new nl([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-a,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-r,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[a,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[r,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-a],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:i}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,a],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,r],checker:i}]]))}static _type="freetext";static _editorType=Tt.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#t=t.color||Ue._defaultColor||gt._defaultLineColor,this.#a=t.fontSize||Ue._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,i){gt.initialize(t,i);const a=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(a.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,i){switch(t){case $t.FREETEXT_SIZE:Ue._defaultFontSize=i;break;case $t.FREETEXT_COLOR:Ue._defaultColor=i;break}}updateParams(t,i){switch(t){case $t.FREETEXT_SIZE:this.#s(i);break;case $t.FREETEXT_COLOR:this.#r(i);break}}static get defaultPropertiesToUpdate(){return[[$t.FREETEXT_SIZE,Ue._defaultFontSize],[$t.FREETEXT_COLOR,Ue._defaultColor||gt._defaultLineColor]]}get propertiesToUpdate(){return[[$t.FREETEXT_SIZE,this.#a],[$t.FREETEXT_COLOR,this.#t]]}get toolbarButtons(){return this._colorPicker||=new cl(this),[["colorPicker",this._colorPicker]]}get colorType(){return $t.FREETEXT_COLOR}get colorValue(){return this.#t}#s(t){const i=r=>{this.editorDiv.style.fontSize=`calc(${r}px * var(--total-scale-factor))`,this.translate(0,-(r-this.#a)*this.parentScale),this.#a=r,this.#u()},a=this.#a;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#r(t){const i=r=>{this.#t=this.editorDiv.style.color=r,this._colorPicker?.update(r)},a=this.#t;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,i){this._uiManager.translateSelectedEditors(t,i,!0)}getInitialTranslation(){const t=this.parentScale;return[-Ue._internalPadding*t,-(Ue._internalPadding+this.#a)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#i=new AbortController;const t=this._uiManager.combinedSignal(this.#i);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#n),this._isDraggable=!0,this.#i?.abort(),this.#i=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&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 t=[];this.editorDiv.normalize();let i=null;for(const a of this.editorDiv.childNodes)i?.nodeType===Node.TEXT_NODE&&a.nodeName==="BR"||(t.push(Ue.#c(a)),i=a);return t.join(`
300
+ `)}#u(){const[t,i]=this.parentDimensions;let a;if(this.isAttachedToDOM)a=this.div.getBoundingClientRect();else{const{currentLayer:r,div:c}=this,u=c.style.display,h=c.classList.contains("hidden");c.classList.remove("hidden"),c.style.display="hidden",r.div.append(this.div),a=c.getBoundingClientRect(),c.remove(),c.style.display=u,c.classList.toggle("hidden",h)}this.rotation%180===this.parentRotation%180?(this.width=a.width/t,this.height=a.height/i):(this.width=a.height/t,this.height=a.width/i),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#e,i=this.#e=this.#o().trimEnd();if(t===i)return;const a=r=>{if(this.#e=r,!r){this.remove();return}this.#h(),this._uiManager.rebuild(this),this.#u()};this.addCommands({cmd:()=>{a(i)},undo:()=>{a(t)},mustExec:!1}),this.#u()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Ue._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,i;(this._isCopy||this.annotationElementId)&&(t=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#n),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:a}=this.editorDiv;if(a.fontSize=`calc(${this.#a}px * var(--total-scale-factor))`,a.color=this.#t,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[r,c]=this.parentDimensions;if(this.annotationElementId){const{position:u}=this._initialData;let[h,p]=this.getInitialTranslation();[h,p]=this.pageTranslationToScreen(h,p);const[m,g]=this.pageDimensions,[y,b]=this.pageTranslation;let S,A;switch(this.rotation){case 0:S=t+(u[0]-y)/m,A=i+this.height-(u[1]-b)/g;break;case 90:S=t+(u[0]-y)/m,A=i-(u[1]-b)/g,[h,p]=[p,-h];break;case 180:S=t-this.width+(u[0]-y)/m,A=i-(u[1]-b)/g,[h,p]=[-h,-p];break;case 270:S=t+(u[0]-y-this.height*g)/m,A=i+(u[1]-b-this.width*m)/g,[h,p]=[-p,h];break}this.setAt(S*r,A*c,h,p)}else this._moveAfterPaste(t,i);this.#h(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(Nu,"")}editorDivPaste(t){const i=t.clipboardData||window.clipboardData,{types:a}=i;if(a.length===1&&a[0]==="text/plain")return;t.preventDefault();const r=Ue.#p(i.getData("text")||"").replaceAll(Nu,`
301
+ `);if(!r)return;const c=window.getSelection();if(!c.rangeCount)return;this.editorDiv.normalize(),c.deleteFromDocument();const u=c.getRangeAt(0);if(!r.includes(`
302
+ `)){u.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),c.collapseToStart();return}const{startContainer:h,startOffset:p}=u,m=[],g=[];if(h.nodeType===Node.TEXT_NODE){const S=h.parentElement;if(g.push(h.nodeValue.slice(p).replaceAll(Nu,"")),S!==this.editorDiv){let A=m;for(const _ of this.editorDiv.childNodes){if(_===S){A=g;continue}A.push(Ue.#c(_))}}m.push(h.nodeValue.slice(0,p).replaceAll(Nu,""))}else if(h===this.editorDiv){let S=m,A=0;for(const _ of this.editorDiv.childNodes)A++===p&&(S=g),S.push(Ue.#c(_))}this.#e=`${m.join(`
303
+ `)}${r}${g.join(`
304
+ `)}`,this.#h();const y=new Range;let b=Math.sumPrecise(m.map(S=>S.length));for(const{firstChild:S}of this.editorDiv.childNodes)if(S.nodeType===Node.TEXT_NODE){const A=S.nodeValue.length;if(b<=A){y.setStart(S,b),y.setEnd(S,b);break}b-=A}c.removeAllRanges(),c.addRange(y)}#h(){if(this.editorDiv.replaceChildren(),!!this.#e)for(const t of this.#e.split(`
305
+ `)){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(i)}}#l(){return this.#e.replaceAll(" "," ")}static#p(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(t,i,a){let r=null;if(t instanceof P0){const{data:{defaultAppearanceData:{fontSize:u,fontColor:h},rect:p,rotation:m,id:g,popupRef:y,contentsObj:b},textContent:S,textPosition:A,parent:{page:{pageNumber:_}}}=t;if(!S||S.length===0)return null;r=t={annotationType:Tt.FREETEXT,color:Array.from(h),fontSize:u,value:S.join(`
306
+ `),position:A,pageIndex:_-1,rect:p.slice(0),rotation:m,annotationElementId:g,id:g,deleted:!1,popupRef:y,comment:b?.str||null}}const c=await super.deserialize(t,i,a);return c.#a=t.fontSize,c.#t=mt.makeHexColor(...t.color),c.#e=Ue.#p(t.value),c._initialData=r,t.comment&&c.setCommentData(t.comment),c}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Ue._internalPadding*this.parentScale,a=this.getRect(i,i),r=gt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#t),c={annotationType:Tt.FREETEXT,color:r,fontSize:this.#a,value:this.#l(),pageIndex:this.pageIndex,rect:a,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(c),t?(c.isCopy=!0,c):this.annotationElementId&&!this.#g(c)?null:(c.id=this.annotationElementId,c)}#g(t){const{value:i,fontSize:a,color:r,pageIndex:c}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==i||t.fontSize!==a||t.color.some((u,h)=>u!==r[h])||t.pageIndex!==c}renderAnnotationElement(t){const i=super.renderAnnotationElement(t),{style:a}=i;a.fontSize=`calc(${this.#a}px * var(--total-scale-factor))`,a.color=this.#t,i.replaceChildren();for(const u of this.#e.split(`
307
+ `)){const h=document.createElement("div");h.append(u?document.createTextNode(u):document.createElement("br")),i.append(h)}const r=Ue._internalPadding*this.parentScale,c={rect:this.getRect(r,r)};return c.popup=this.hasEditedComment?this.comment:{text:this.#e},t.updateEdited(c),i}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class ot{static PRECISION=1e-4;toSVGPath(){ne("Abstract method `toSVGPath` must be implemented.")}get box(){ne("Abstract getter `box` must be implemented.")}serialize(t,i){ne("Abstract method `serialize` must be implemented.")}static _rescale(t,i,a,r,c,u){u||=new Float32Array(t.length);for(let h=0,p=t.length;h<p;h+=2)u[h]=i+t[h]*r,u[h+1]=a+t[h+1]*c;return u}static _rescaleAndSwap(t,i,a,r,c,u){u||=new Float32Array(t.length);for(let h=0,p=t.length;h<p;h+=2)u[h]=i+t[h+1]*r,u[h+1]=a+t[h]*c;return u}static _translate(t,i,a,r){r||=new Float32Array(t.length);for(let c=0,u=t.length;c<u;c+=2)r[c]=i+t[c],r[c+1]=a+t[c+1];return r}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,i,a,r,c){switch(c){case 90:return[1-i/a,t/r];case 180:return[1-t/a,1-i/r];case 270:return[i/a,1-t/r];default:return[t/a,i/r]}}static _normalizePagePoint(t,i,a){switch(a){case 90:return[1-i,t];case 180:return[1-t,1-i];case 270:return[i,1-t];default:return[t,i]}}static createBezierPoints(t,i,a,r,c,u){return[(t+5*a)/6,(i+5*r)/6,(5*a+c)/6,(5*r+u)/6,(a+c)/2,(r+u)/2]}}class xa{#t;#e=[];#n;#i;#a=[];#s=new Float32Array(18);#r;#o;#u;#c;#h;#l;#p=[];static#g=8;static#f=2;static#d=xa.#g+xa.#f;constructor({x:t,y:i},a,r,c,u,h=0){this.#t=a,this.#l=c*r,this.#i=u,this.#s.set([NaN,NaN,NaN,NaN,t,i],6),this.#n=h,this.#c=xa.#g*r,this.#u=xa.#d*r,this.#h=r,this.#p.push(t,i)}isEmpty(){return isNaN(this.#s[8])}#m(){const t=this.#s.subarray(4,6),i=this.#s.subarray(16,18),[a,r,c,u]=this.#t;return[(this.#r+(t[0]-i[0])/2-a)/c,(this.#o+(t[1]-i[1])/2-r)/u,(this.#r+(i[0]-t[0])/2-a)/c,(this.#o+(i[1]-t[1])/2-r)/u]}add({x:t,y:i}){this.#r=t,this.#o=i;const[a,r,c,u]=this.#t;let[h,p,m,g]=this.#s.subarray(8,12);const y=t-m,b=i-g,S=Math.hypot(y,b);if(S<this.#u)return!1;const A=S-this.#c,_=A/S,R=_*y,C=_*b;let N=h,O=p;h=m,p=g,m+=R,g+=C,this.#p?.push(t,i);const U=-C/A,I=R/A,j=U*this.#l,F=I*this.#l;return this.#s.set(this.#s.subarray(2,8),0),this.#s.set([m+j,g+F],4),this.#s.set(this.#s.subarray(14,18),12),this.#s.set([m-j,g-F],16),isNaN(this.#s[6])?(this.#a.length===0&&(this.#s.set([h+j,p+F],2),this.#a.push(NaN,NaN,NaN,NaN,(h+j-a)/c,(p+F-r)/u),this.#s.set([h-j,p-F],14),this.#e.push(NaN,NaN,NaN,NaN,(h-j-a)/c,(p-F-r)/u)),this.#s.set([N,O,h,p,m,g],6),!this.isEmpty()):(this.#s.set([N,O,h,p,m,g],6),Math.abs(Math.atan2(O-p,N-h)-Math.atan2(C,R))<Math.PI/2?([h,p,m,g]=this.#s.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((h+m)/2-a)/c,((p+g)/2-r)/u),[h,p,N,O]=this.#s.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((N+h)/2-a)/c,((O+p)/2-r)/u),!0):([N,O,h,p,m,g]=this.#s.subarray(0,6),this.#a.push(((N+5*h)/6-a)/c,((O+5*p)/6-r)/u,((5*h+m)/6-a)/c,((5*p+g)/6-r)/u,((h+m)/2-a)/c,((p+g)/2-r)/u),[m,g,h,p,N,O]=this.#s.subarray(12,18),this.#e.push(((N+5*h)/6-a)/c,((O+5*p)/6-r)/u,((5*h+m)/6-a)/c,((5*p+g)/6-r)/u,((h+m)/2-a)/c,((p+g)/2-r)/u),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#a,i=this.#e;if(isNaN(this.#s[6])&&!this.isEmpty())return this.#v();const a=[];a.push(`M${t[4]} ${t[5]}`);for(let r=6;r<t.length;r+=6)isNaN(t[r])?a.push(`L${t[r+4]} ${t[r+5]}`):a.push(`C${t[r]} ${t[r+1]} ${t[r+2]} ${t[r+3]} ${t[r+4]} ${t[r+5]}`);this.#E(a);for(let r=i.length-6;r>=6;r-=6)isNaN(i[r])?a.push(`L${i[r+4]} ${i[r+5]}`):a.push(`C${i[r]} ${i[r+1]} ${i[r+2]} ${i[r+3]} ${i[r+4]} ${i[r+5]}`);return this.#y(a),a.join(" ")}#v(){const[t,i,a,r]=this.#t,[c,u,h,p]=this.#m();return`M${(this.#s[2]-t)/a} ${(this.#s[3]-i)/r} L${(this.#s[4]-t)/a} ${(this.#s[5]-i)/r} L${c} ${u} L${h} ${p} L${(this.#s[16]-t)/a} ${(this.#s[17]-i)/r} L${(this.#s[14]-t)/a} ${(this.#s[15]-i)/r} Z`}#y(t){const i=this.#e;t.push(`L${i[4]} ${i[5]} Z`)}#E(t){const[i,a,r,c]=this.#t,u=this.#s.subarray(4,6),h=this.#s.subarray(16,18),[p,m,g,y]=this.#m();t.push(`L${(u[0]-i)/r} ${(u[1]-a)/c} L${p} ${m} L${g} ${y} L${(h[0]-i)/r} ${(h[1]-a)/c}`)}newFreeDrawOutline(t,i,a,r,c,u){return new B0(t,i,a,r,c,u)}getOutlines(){const t=this.#a,i=this.#e,a=this.#s,[r,c,u,h]=this.#t,p=new Float32Array((this.#p?.length??0)+2);for(let y=0,b=p.length-2;y<b;y+=2)p[y]=(this.#p[y]-r)/u,p[y+1]=(this.#p[y+1]-c)/h;if(p[p.length-2]=(this.#r-r)/u,p[p.length-1]=(this.#o-c)/h,isNaN(a[6])&&!this.isEmpty())return this.#A(p);const m=new Float32Array(this.#a.length+24+this.#e.length);let g=t.length;for(let y=0;y<g;y+=2){if(isNaN(t[y])){m[y]=m[y+1]=NaN;continue}m[y]=t[y],m[y+1]=t[y+1]}g=this.#T(m,g);for(let y=i.length-6;y>=6;y-=6)for(let b=0;b<6;b+=2){if(isNaN(i[y+b])){m[g]=m[g+1]=NaN,g+=2;continue}m[g]=i[y+b],m[g+1]=i[y+b+1],g+=2}return this.#b(m,g),this.newFreeDrawOutline(m,p,this.#t,this.#h,this.#n,this.#i)}#A(t){const i=this.#s,[a,r,c,u]=this.#t,[h,p,m,g]=this.#m(),y=new Float32Array(36);return y.set([NaN,NaN,NaN,NaN,(i[2]-a)/c,(i[3]-r)/u,NaN,NaN,NaN,NaN,(i[4]-a)/c,(i[5]-r)/u,NaN,NaN,NaN,NaN,h,p,NaN,NaN,NaN,NaN,m,g,NaN,NaN,NaN,NaN,(i[16]-a)/c,(i[17]-r)/u,NaN,NaN,NaN,NaN,(i[14]-a)/c,(i[15]-r)/u],0),this.newFreeDrawOutline(y,t,this.#t,this.#h,this.#n,this.#i)}#b(t,i){const a=this.#e;return t.set([NaN,NaN,NaN,NaN,a[4],a[5]],i),i+=6}#T(t,i){const a=this.#s.subarray(4,6),r=this.#s.subarray(16,18),[c,u,h,p]=this.#t,[m,g,y,b]=this.#m();return t.set([NaN,NaN,NaN,NaN,(a[0]-c)/h,(a[1]-u)/p,NaN,NaN,NaN,NaN,m,g,NaN,NaN,NaN,NaN,y,b,NaN,NaN,NaN,NaN,(r[0]-c)/h,(r[1]-u)/p],i),i+=24}}class B0 extends ot{#t;#e=new Float32Array(4);#n;#i;#a;#s;#r;constructor(t,i,a,r,c,u){super(),this.#r=t,this.#a=i,this.#t=a,this.#s=r,this.#n=c,this.#i=u,this.lastPoint=[NaN,NaN],this.#o(u);const[h,p,m,g]=this.#e;for(let y=0,b=t.length;y<b;y+=2)t[y]=(t[y]-h)/m,t[y+1]=(t[y+1]-p)/g;for(let y=0,b=i.length;y<b;y+=2)i[y]=(i[y]-h)/m,i[y+1]=(i[y+1]-p)/g}toSVGPath(){const t=[`M${this.#r[4]} ${this.#r[5]}`];for(let i=6,a=this.#r.length;i<a;i+=6){if(isNaN(this.#r[i])){t.push(`L${this.#r[i+4]} ${this.#r[i+5]}`);continue}t.push(`C${this.#r[i]} ${this.#r[i+1]} ${this.#r[i+2]} ${this.#r[i+3]} ${this.#r[i+4]} ${this.#r[i+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,i,a,r],c){const u=a-t,h=r-i;let p,m;switch(c){case 0:p=ot._rescale(this.#r,t,r,u,-h),m=ot._rescale(this.#a,t,r,u,-h);break;case 90:p=ot._rescaleAndSwap(this.#r,t,i,u,h),m=ot._rescaleAndSwap(this.#a,t,i,u,h);break;case 180:p=ot._rescale(this.#r,a,i,-u,h),m=ot._rescale(this.#a,a,i,-u,h);break;case 270:p=ot._rescaleAndSwap(this.#r,a,r,-u,-h),m=ot._rescaleAndSwap(this.#a,a,r,-u,-h);break}return{outline:Array.from(p),points:[Array.from(m)]}}#o(t){const i=this.#r;let a=i[4],r=i[5];const c=[a,r,a,r];let u=a,h=r;const p=t?Math.max:Math.min;for(let g=6,y=i.length;g<y;g+=6){const b=i[g+4],S=i[g+5];if(isNaN(i[g]))mt.pointBoundingBox(b,S,c),h<S?(u=b,h=S):h===S&&(u=p(u,b));else{const A=[1/0,1/0,-1/0,-1/0];mt.bezierBoundingBox(a,r,...i.slice(g,g+6),A),mt.rectBoundingBox(...A,c),h<A[3]?(u=A[2],h=A[3]):h===A[3]&&(u=p(u,A[2]))}a=b,r=S}const m=this.#e;m[0]=c[0]-this.#n,m[1]=c[1]-this.#n,m[2]=c[2]-c[0]+2*this.#n,m[3]=c[3]-c[1]+2*this.#n,this.lastPoint=[u,h]}get box(){return this.#e}newOutliner(t,i,a,r,c,u=0){return new xa(t,i,a,r,c,u)}getNewOutline(t,i){const[a,r,c,u]=this.#e,[h,p,m,g]=this.#t,y=c*m,b=u*g,S=a*m+h,A=r*g+p,_=this.newOutliner({x:this.#a[0]*y+S,y:this.#a[1]*b+A},this.#t,this.#s,t,this.#i,i??this.#n);for(let R=2;R<this.#a.length;R+=2)_.add({x:this.#a[R]*y+S,y:this.#a[R+1]*b+A});return _.getOutlines()}}class lp{#t;#e;#n=[];#i=[];constructor(t,i=0,a=0,r=!0){const c=[1/0,1/0,-1/0,-1/0],u=10**-4;for(const{x:S,y:A,width:_,height:R}of t){const C=Math.floor((S-i)/u)*u,N=Math.ceil((S+_+i)/u)*u,O=Math.floor((A-i)/u)*u,U=Math.ceil((A+R+i)/u)*u,I=[C,O,U,!0],j=[N,O,U,!1];this.#n.push(I,j),mt.rectBoundingBox(C,O,N,U,c)}const h=c[2]-c[0]+2*a,p=c[3]-c[1]+2*a,m=c[0]-a,g=c[1]-a,y=this.#n.at(r?-1:-2),b=[y[0],y[2]];for(const S of this.#n){const[A,_,R]=S;S[0]=(A-m)/h,S[1]=(_-g)/p,S[2]=(R-g)/p}this.#t=new Float32Array([m,g,h,p]),this.#e=b}getOutlines(){this.#n.sort((i,a)=>i[0]-a[0]||i[1]-a[1]||i[2]-a[2]);const t=[];for(const i of this.#n)i[3]?(t.push(...this.#u(i)),this.#r(i)):(this.#o(i),t.push(...this.#u(i)));return this.#a(t)}#a(t){const i=[],a=new Set;for(const u of t){const[h,p,m]=u;i.push([h,p,u],[h,m,u])}i.sort((u,h)=>u[1]-h[1]||u[0]-h[0]);for(let u=0,h=i.length;u<h;u+=2){const p=i[u][2],m=i[u+1][2];p.push(m),m.push(p),a.add(p),a.add(m)}const r=[];let c;for(;a.size>0;){const u=a.values().next().value;let[h,p,m,g,y]=u;a.delete(u);let b=h,S=p;for(c=[h,m],r.push(c);;){let A;if(a.has(g))A=g;else if(a.has(y))A=y;else break;a.delete(A),[h,p,m,g,y]=A,b!==h&&(c.push(b,S,h,S===p?p:m),b=h),S=S===p?m:p}c.push(b,S)}return new QO(r,this.#t,this.#e)}#s(t){const i=this.#i;let a=0,r=i.length-1;for(;a<=r;){const c=a+r>>1,u=i[c][0];if(u===t)return c;u<t?a=c+1:r=c-1}return r+1}#r([,t,i]){const a=this.#s(t);this.#i.splice(a,0,[t,i])}#o([,t,i]){const a=this.#s(t);for(let r=a;r<this.#i.length;r++){const[c,u]=this.#i[r];if(c!==t)break;if(c===t&&u===i){this.#i.splice(r,1);return}}for(let r=a-1;r>=0;r--){const[c,u]=this.#i[r];if(c!==t)break;if(c===t&&u===i){this.#i.splice(r,1);return}}}#u(t){const[i,a,r]=t,c=[[i,a,r]],u=this.#s(r);for(let h=0;h<u;h++){const[p,m]=this.#i[h];for(let g=0,y=c.length;g<y;g++){const[,b,S]=c[g];if(!(m<=b||S<=p)){if(b>=p){if(S>m)c[g][1]=m;else{if(y===1)return[];c.splice(g,1),g--,y--}continue}c[g][2]=p,S>m&&c.push([i,m,S])}}}return c}}class QO extends ot{#t;#e;constructor(t,i,a){super(),this.#e=t,this.#t=i,this.lastPoint=a}toSVGPath(){const t=[];for(const i of this.#e){let[a,r]=i;t.push(`M${a} ${r}`);for(let c=2;c<i.length;c+=2){const u=i[c],h=i[c+1];u===a?(t.push(`V${h}`),r=h):h===r&&(t.push(`H${u}`),a=u)}t.push("Z")}return t.join(" ")}serialize([t,i,a,r],c){const u=[],h=a-t,p=r-i;for(const m of this.#e){const g=new Array(m.length);for(let y=0;y<m.length;y+=2)g[y]=t+m[y]*h,g[y+1]=r-m[y+1]*p;u.push(g)}return u}get box(){return this.#t}get classNamesForOutlining(){return["highlightOutline"]}}class cp extends xa{newFreeDrawOutline(t,i,a,r,c,u){return new KO(t,i,a,r,c,u)}}class KO extends B0{newOutliner(t,i,a,r,c,u=0){return new cp(t,i,a,r,c,u)}}class Te extends gt{#t=null;#e=0;#n;#i=null;#a=null;#s=null;#r=null;#o=0;#u=null;#c=null;#h=null;#l=!1;#p=null;#g;#f=null;#d="";#m;#v="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Tt.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=Te.prototype;return zt(this,"_keyboardManager",new nl([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||Te._defaultColor,this.#m=t.thickness||Te._defaultThickness,this.#g=t.opacity||Te._defaultOpacity,this.#n=t.boxes||null,this.#v=t.methodOfCreation||"",this.#d=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#l=!0,this.#E(t),this.#_()):this.#n&&(this.#t=t.anchorNode,this.#e=t.anchorOffset,this.#r=t.focusNode,this.#o=t.focusOffset,this.#y(),this.#_(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#l?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#m,methodOfCreation:this.#v}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#y(){const t=new lp(this.#n,.001);this.#c=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#c.box;const i=new lp(this.#n,.0025,.001,this._uiManager.direction==="ltr");this.#s=i.getOutlines();const{lastPoint:a}=this.#s;this.#p=[(a[0]-this.x)/this.width,(a[1]-this.y)/this.height]}#E({highlightOutlines:t,highlightId:i,clipPathId:a}){this.#c=t;const r=1.5;if(this.#s=t.getNewOutline(this.#m/2+r,.0025),i>=0)this.#h=i,this.#i=a,this.parent.drawLayer.finalizeDraw(i,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#f=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#s.box,path:{d:this.#s.toSVGPath()}},!0);else if(this.parent){const g=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#h,{bbox:Te.#M(this.#c.box,(g-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#f,{bbox:Te.#M(this.#s.box,g),path:{d:this.#s.toSVGPath()}})}const[c,u,h,p]=t.box;switch(this.rotation){case 0:this.x=c,this.y=u,this.width=h,this.height=p;break;case 90:{const[g,y]=this.parentDimensions;this.x=u,this.y=1-c,this.width=h*y/g,this.height=p*g/y;break}case 180:this.x=1-c,this.y=1-u,this.width=h,this.height=p;break;case 270:{const[g,y]=this.parentDimensions;this.x=1-u,this.y=c,this.width=h*y/g,this.height=p*g/y;break}}const{lastPoint:m}=this.#s;this.#p=[(m[0]-c)/h,(m[1]-u)/p]}static initialize(t,i){gt.initialize(t,i),Te._defaultColor||=i.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,i){switch(t){case $t.HIGHLIGHT_COLOR:Te._defaultColor=i;break;case $t.HIGHLIGHT_THICKNESS:Te._defaultThickness=i;break}}translateInPage(t,i){}get toolbarPosition(){return this.#p}updateParams(t,i){switch(t){case $t.HIGHLIGHT_COLOR:this.#A(i);break;case $t.HIGHLIGHT_THICKNESS:this.#b(i);break}}static get defaultPropertiesToUpdate(){return[[$t.HIGHLIGHT_COLOR,Te._defaultColor],[$t.HIGHLIGHT_THICKNESS,Te._defaultThickness]]}get propertiesToUpdate(){return[[$t.HIGHLIGHT_COLOR,this.color||Te._defaultColor],[$t.HIGHLIGHT_THICKNESS,this.#m||Te._defaultThickness],[$t.HIGHLIGHT_FREE,this.#l]]}#A(t){const i=(c,u)=>{this.color=c,this.#g=u,this.parent?.drawLayer.updateProperties(this.#h,{root:{fill:c,"fill-opacity":u}}),this.#a?.updateColor(c)},a=this.color,r=this.#g;this.addCommands({cmd:i.bind(this,t,Te._defaultOpacity),undo:i.bind(this,a,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}#b(t){const i=this.#m,a=r=>{this.#m=r,this.#T(r)};this.addCommands({cmd:a.bind(this,t),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:$t.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#a=new Qn({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#C())}getBaseTranslation(){return[0,0]}getRect(t,i){return super.getRect(t,i,this.#C())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#D(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#_(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?this.#D():t&&(this.#_(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),i&&this.select()}#T(t){if(!this.#l)return;this.#E({highlightOutlines:this.#c.getNewOutline(t/2)}),this.fixAndSetPosition();const[i,a]=this.parentDimensions;this.setDims(this.width*i,this.height*a)}#D(){this.#h===null||!this.parent||(this.parent.drawLayer.remove(this.#h),this.#h=null,this.parent.drawLayer.remove(this.#f),this.#f=null)}#_(t=this.parent){this.#h===null&&({id:this.#h,clipPathId:this.#i}=t.drawLayer.draw({bbox:this.#c.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#g},rootClass:{highlight:!0,free:this.#l},path:{d:this.#c.toSVGPath()}},!1,!0),this.#f=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#l},bbox:this.#s.box,path:{d:this.#s.toSVGPath()}},this.#l),this.#u&&(this.#u.style.clipPath=this.#i))}static#M([t,i,a,r],c){switch(c){case 90:return[1-i-r,t,r,a];case 180:return[1-t-a,1-i-r,a,r];case 270:return[i,1-t-a,r,a]}return[t,i,a,r]}rotate(t){const{drawLayer:i}=this.parent;let a;this.#l?(t=(t-this.rotation+360)%360,a=Te.#M(this.#c.box,t)):a=Te.#M([this.x,this.y,this.width,this.height],t),i.updateProperties(this.#h,{bbox:a,root:{"data-main-rotation":t}}),i.updateProperties(this.#f,{bbox:Te.#M(this.#s.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#d&&(t.setAttribute("aria-label",this.#d),t.setAttribute("role","mark")),this.#l?t.classList.add("free"):this.div.addEventListener("keydown",this.#R.bind(this),{signal:this._uiManager._signal});const i=this.#u=document.createElement("div");t.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=this.#i;const[a,r]=this.parentDimensions;return this.setDims(this.width*a,this.height*r),Jv(this,this.#u,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!1}})}#R(t){Te._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#x(!0);break;case 1:case 3:this.#x(!1);break}}#x(t){if(!this.#t)return;const i=window.getSelection();t?i.setPosition(this.#t,this.#e):i.setPosition(this.#r,this.#o)}select(){super.select(),this.#f&&this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#f&&(this.parent?.drawLayer.updateProperties(this.#f,{rootClass:{selected:!1}}),this.#l||this.#x(!1))}get _mustFixPosition(){return!this.#l}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#h,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#f,{rootClass:{hidden:!t}}))}#C(){return this.#l?this.rotation:0}#k(){if(this.#l)return null;const[t,i]=this.pageDimensions,[a,r]=this.pageTranslation,c=this.#n,u=new Float32Array(c.length*8);let h=0;for(const{x:p,y:m,width:g,height:y}of c){const b=p*t+a,S=(1-m)*i+r;u[h]=u[h+4]=b,u[h+1]=u[h+3]=S,u[h+2]=u[h+6]=b+g*t,u[h+5]=u[h+7]=S-y*i,h+=8}return u}#U(t){return this.#c.serialize(t,this.#C())}static startHighlighting(t,i,{target:a,x:r,y:c}){const{x:u,y:h,width:p,height:m}=a.getBoundingClientRect(),g=new AbortController,y=t.combinedSignal(g),b=S=>{g.abort(),this.#F(t,S)};window.addEventListener("blur",b,{signal:y}),window.addEventListener("pointerup",b,{signal:y}),window.addEventListener("pointerdown",Oe,{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",Xn,{signal:y}),a.addEventListener("pointermove",this.#N.bind(this,t),{signal:y}),this._freeHighlight=new cp({x:r,y:c},[u,h,p,m],t.scale,this._defaultThickness/2,i,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#N(t,i){this._freeHighlight.add(i)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#F(t,i){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,i,a){let r=null;if(t instanceof z0){const{data:{quadPoints:A,rect:_,rotation:R,id:C,color:N,opacity:O,popupRef:U,contentsObj:I},parent:{page:{pageNumber:j}}}=t;r=t={annotationType:Tt.HIGHLIGHT,color:Array.from(N),opacity:O,quadPoints:A,boxes:null,pageIndex:j-1,rect:_.slice(0),rotation:R,annotationElementId:C,id:C,deleted:!1,popupRef:U,comment:I?.str||null}}else if(t instanceof rp){const{data:{inkLists:A,rect:_,rotation:R,id:C,color:N,borderStyle:{rawWidth:O},popupRef:U,contentsObj:I},parent:{page:{pageNumber:j}}}=t;r=t={annotationType:Tt.HIGHLIGHT,color:Array.from(N),thickness:O,inkLists:A,boxes:null,pageIndex:j-1,rect:_.slice(0),rotation:R,annotationElementId:C,id:C,deleted:!1,popupRef:U,comment:I?.str||null}}const{color:c,quadPoints:u,inkLists:h,opacity:p}=t,m=await super.deserialize(t,i,a);m.color=mt.makeHexColor(...c),m.#g=p||1,h&&(m.#m=t.thickness),m._initialData=r,t.comment&&m.setCommentData(t.comment);const[g,y]=m.pageDimensions,[b,S]=m.pageTranslation;if(u){const A=m.#n=[];for(let _=0;_<u.length;_+=8)A.push({x:(u[_]-b)/g,y:1-(u[_+1]-S)/y,width:(u[_+2]-u[_])/g,height:(u[_+1]-u[_+5])/y});m.#y(),m.#_(),m.rotate(m.rotation)}else if(h){m.#l=!0;const A=h[0],_={x:A[0]-b,y:y-(A[1]-S)},R=new cp(_,[0,0,g,y],1,m.#m/2,!0,.001);for(let O=0,U=A.length;O<U;O+=2)_.x=A[O]-b,_.y=y-(A[O+1]-S),R.add(_);const{id:C,clipPathId:N}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:m.color,"fill-opacity":m._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:R.toSVGPath()}},!0,!0);m.#E({highlightOutlines:R.getOutlines(),highlightId:C,clipPathId:N}),m.#_(),m.rotate(m.parentRotation)}return m}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),a=gt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),r={annotationType:Tt.HIGHLIGHT,color:a,opacity:this.#g,thickness:this.#m,quadPoints:this.#k(),outlines:this.#U(i),pageIndex:this.pageIndex,rect:i,rotation:this.#C(),structTreeParentId:this._structTreeParentId};return this.addComment(r),this.annotationElementId&&!this.#w(r)?null:(r.id=this.annotationElementId,r)}#w(t){const{color:i}=this._initialData;return this.hasEditedComment||t.color.some((a,r)=>a!==i[r])}renderAnnotationElement(t){const i={rect:this.getRect(0,0)};return this.hasEditedComment&&(i.popup=this.comment),t.updateEdited(i),null}static canCreateNewEmptyEditor(){return!1}}class F0{#t=Object.create(null);updateProperty(t,i){this[t]=i,this.updateSVGProperty(t,i)}updateProperties(t){if(t)for(const[i,a]of Object.entries(t))i.startsWith("_")||this.updateProperty(i,a)}updateSVGProperty(t,i){this.#t[t]=i}toSVGProperties(){const t=this.#t;return this.#t=Object.create(null),{root:t}}reset(){this.#t=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){ne("Not implemented")}}class vt extends gt{#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#i=null;static#a=null;static#s=NaN;static#r=null;static#o=null;static#u=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#e=t.mustBeCommitted||!1,this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(this.#c(t),this.#p())}#c({drawOutlines:t,drawId:i,drawingOptions:a}){this.#t=t,this._drawingOptions||=a,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,t.defaultProperties)):this._drawId=this.#h(t,this.parent),this.#d(t.box)}#h(t,i){const{id:a}=i.drawLayer.draw(vt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return a}static _mergeSVGProperties(t,i){const a=new Set(Object.keys(t));for(const[r,c]of Object.entries(i))a.has(r)?Object.assign(t[r],c):t[r]=c;return t}static getDefaultDrawingOptions(t){ne("Not implemented")}static get typesMap(){ne("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,i){const a=this.typesMap.get(t);a&&this._defaultDrawingOptions.updateProperty(a,i),this._currentParent&&(vt.#n.updateProperty(a,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,i){const a=this.constructor.typesMap.get(t);a&&this._updateProperty(t,a,i)}static get defaultPropertiesToUpdate(){const t=[],i=this._defaultDrawingOptions;for(const[a,r]of this.typesMap)t.push([a,i[r]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:i}=this;for(const[a,r]of this.constructor.typesMap)t.push([a,i[r]]);return t}_updateProperty(t,i,a){const r=this._drawingOptions,c=r[i],u=h=>{r.updateProperty(i,h);const p=this.#t.updateProperty(i,h);p&&this.#d(p),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),t===this.colorType&&this._colorPicker?.update(h)};this.addCommands({cmd:u.bind(this,a),undo:u.bind(this,c),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,vt._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#f()),{bbox:this.#m()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,vt._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#f()),{bbox:this.#m()}))}_onTranslating(t,i){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#m()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,vt._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#f(),this.parentDimensions),{bbox:this.#m()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#e&&(this.#e=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#l(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#p(),this.#d(this.#t.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let i=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#l()):t&&(this._uiManager.addShouldRescale(this),this.#p(t),i=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),i&&this.select()}#l(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#p(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#h(this.#t,t)}}#g([t,i,a,r]){const{parentDimensions:[c,u],rotation:h}=this;switch(h){case 90:return[i,1-t,a*(u/c),r*(c/u)];case 180:return[1-t,1-i,a,r];case 270:return[1-i,t,a*(u/c),r*(c/u)];default:return[t,i,a,r]}}#f(){const{x:t,y:i,width:a,height:r,parentDimensions:[c,u],rotation:h}=this;switch(h){case 90:return[1-i,t,a*(c/u),r*(u/c)];case 180:return[1-t,1-i,a,r];case 270:return[i,1-t,a*(c/u),r*(u/c)];default:return[t,i,a,r]}}#d(t){if([this.x,this.y,this.width,this.height]=this.#g(t),this.div){this.fixAndSetPosition();const[i,a]=this.parentDimensions;this.setDims(this.width*i,this.height*a)}this._onResized()}#m(){const{x:t,y:i,width:a,height:r,rotation:c,parentRotation:u,parentDimensions:[h,p]}=this;switch((c*4+u)/90){case 1:return[1-i-r,t,r,a];case 2:return[1-t-a,1-i-r,a,r];case 3:return[i,1-t-a,r,a];case 4:return[t,i-a*(h/p),r*(p/h),a*(h/p)];case 5:return[1-i,t,a*(h/p),r*(p/h)];case 6:return[1-t-r*(p/h),1-i,r*(p/h),a*(h/p)];case 7:return[i-a*(h/p),1-t-r*(p/h),a*(h/p),r*(p/h)];case 8:return[t-a,i-r,a,r];case 9:return[1-i,t-a,r,a];case 10:return[1-t,1-i,a,r];case 11:return[i-r,1-t,r,a];case 12:return[t-r*(p/h),i,r*(p/h),a*(h/p)];case 13:return[1-i-a*(h/p),t-r*(p/h),a*(h/p),r*(p/h)];case 14:return[1-t,1-i-a*(h/p),r*(p/h),a*(h/p)];case 15:return[i,1-t,a*(h/p),r*(p/h)];default:return[t,i,a,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,vt._mergeSVGProperties({bbox:this.#m()},this.#t.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,i;this._isCopy&&(t=this.x,i=this.y);const a=super.render();a.classList.add("draw");const r=document.createElement("div");a.append(r),r.setAttribute("aria-hidden","true"),r.className="internal";const[c,u]=this.parentDimensions;return this.setDims(this.width*c,this.height*u),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,i),a}static createDrawerInstance(t,i,a,r,c){ne("Not implemented")}static startDrawing(t,i,a,r){const{target:c,offsetX:u,offsetY:h,pointerId:p,pointerType:m}=r;if(vt.#r&&vt.#r!==m)return;const{viewport:{rotation:g}}=t,{width:y,height:b}=c.getBoundingClientRect(),S=vt.#i=new AbortController,A=t.combinedSignal(S);if(vt.#s||=p,vt.#r??=m,window.addEventListener("pointerup",_=>{vt.#s===_.pointerId?this._endDraw(_):vt.#o?.delete(_.pointerId)},{signal:A}),window.addEventListener("pointercancel",_=>{vt.#s===_.pointerId?this._currentParent.endDrawingSession():vt.#o?.delete(_.pointerId)},{signal:A}),window.addEventListener("pointerdown",_=>{vt.#r===_.pointerType&&((vt.#o||=new Set).add(_.pointerId),vt.#n.isCancellable()&&(vt.#n.removeLastElement(),vt.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:A}),window.addEventListener("contextmenu",Xn,{signal:A}),c.addEventListener("pointermove",this._drawMove.bind(this),{signal:A}),c.addEventListener("touchmove",_=>{_.timeStamp===vt.#u&&Oe(_)},{signal:A}),t.toggleDrawing(),i._editorUndoBar?.hide(),vt.#n){t.drawLayer.updateProperties(this._currentDrawId,vt.#n.startNew(u,h,y,b,g));return}i.updateUIForDefaultProperties(this),vt.#n=this.createDrawerInstance(u,h,y,b,g),vt.#a=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(vt.#a.toSVGProperties(),vt.#n.defaultSVGProperties),!0,!1)}static _drawMove(t){if(vt.#u=-1,!vt.#n)return;const{offsetX:i,offsetY:a,pointerId:r}=t;if(vt.#s===r){if(vt.#o?.size>=1){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,vt.#n.add(i,a)),vt.#u=t.timeStamp,Oe(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,vt.#n=null,vt.#a=null,vt.#r=null,vt.#u=NaN),vt.#i&&(vt.#i.abort(),vt.#i=null,vt.#s=NaN,vt.#o=null)}static _endDraw(t){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),t?.target===i.div&&i.drawLayer.updateProperties(this._currentDrawId,vt.#n.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const a=vt.#n,r=this._currentDrawId,c=a.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(r,a.setLastElement(c))},undo:()=>{i.drawLayer.updateProperties(r,a.removeLastElement())},mustExec:!1,type:$t.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack($t.DRAW_STEP),!vt.#n.isEmpty()){const{pageDimensions:[a,r],scale:c}=i,u=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:vt.#n.getOutlines(a*c,r*c,c,this._INNER_MARGIN),drawingOptions:vt.#a,mustBeCommitted:!t});return this._cleanup(!0),u}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,i,a,r,c,u){ne("Not implemented")}static async deserialize(t,i,a){const{rawDims:{pageWidth:r,pageHeight:c,pageX:u,pageY:h}}=i.viewport,p=this.deserializeDraw(u,h,r,c,this._INNER_MARGIN,t),m=await super.deserialize(t,i,a);return m.createDrawingOptions(t),m.#c({drawOutlines:p}),m.#p(),m.onScaleChanging(),m.rotate(),m}serializeDraw(t){const[i,a]=this.pageTranslation,[r,c]=this.pageDimensions;return this.#t.serialize([i,a,r,c],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class ZO{#t=new Float64Array(6);#e;#n;#i;#a;#s;#r="";#o=0;#u=new dl;#c;#h;constructor(t,i,a,r,c,u){this.#c=a,this.#h=r,this.#i=c,this.#a=u,[t,i]=this.#l(t,i);const h=this.#e=[NaN,NaN,NaN,NaN,t,i];this.#s=[t,i],this.#n=[{line:h,points:this.#s}],this.#t.set(h,0)}updateProperty(t,i){t==="stroke-width"&&(this.#a=i)}#l(t,i){return ot._normalizePoint(t,i,this.#c,this.#h,this.#i)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#s.length<=10}add(t,i){[t,i]=this.#l(t,i);const[a,r,c,u]=this.#t.subarray(2,6),h=t-c,p=i-u;return Math.hypot(this.#c*h,this.#h*p)<=2?null:(this.#s.push(t,i),isNaN(a)?(this.#t.set([c,u,t,i],2),this.#e.push(NaN,NaN,NaN,NaN,t,i),{path:{d:this.toSVGPath()}}):(isNaN(this.#t[0])&&this.#e.splice(6,6),this.#t.set([a,r,c,u,t,i],0),this.#e.push(...ot.createBezierPoints(a,r,c,u,t,i)),{path:{d:this.toSVGPath()}}))}end(t,i){const a=this.add(t,i);return a||(this.#s.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,i,a,r,c){this.#c=a,this.#h=r,this.#i=c,[t,i]=this.#l(t,i);const u=this.#e=[NaN,NaN,NaN,NaN,t,i];this.#s=[t,i];const h=this.#n.at(-1);return h&&(h.line=new Float32Array(h.line),h.points=new Float32Array(h.points)),this.#n.push({line:u,points:this.#s}),this.#t.set(u,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(t){return this.#n?(this.#n.push(t),this.#e=t.line,this.#s=t.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#u.setLastElement(t)}removeLastElement(){if(!this.#n)return this.#u.removeLastElement();this.#n.pop(),this.#r="";for(let t=0,i=this.#n.length;t<i;t++){const{line:a,points:r}=this.#n[t];this.#e=a,this.#s=r,this.#o=0,this.toSVGPath()}return{path:{d:this.#r}}}toSVGPath(){const t=ot.svgRound(this.#e[4]),i=ot.svgRound(this.#e[5]);if(this.#s.length===2)return this.#r=`${this.#r} M ${t} ${i} Z`,this.#r;if(this.#s.length<=6){const r=this.#r.lastIndexOf("M");this.#r=`${this.#r.slice(0,r)} M ${t} ${i}`,this.#o=6}if(this.#s.length===4){const r=ot.svgRound(this.#e[10]),c=ot.svgRound(this.#e[11]);return this.#r=`${this.#r} L ${r} ${c}`,this.#o=12,this.#r}const a=[];this.#o===0&&(a.push(`M ${t} ${i}`),this.#o=6);for(let r=this.#o,c=this.#e.length;r<c;r+=6){const[u,h,p,m,g,y]=this.#e.slice(r,r+6).map(ot.svgRound);a.push(`C${u} ${h} ${p} ${m} ${g} ${y}`)}return this.#r+=a.join(" "),this.#o=this.#e.length,this.#r}getOutlines(t,i,a,r){const c=this.#n.at(-1);return c.line=new Float32Array(c.line),c.points=new Float32Array(c.points),this.#u.build(this.#n,t,i,a,this.#i,this.#a,r),this.#t=null,this.#e=null,this.#n=null,this.#r=null,this.#u}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class dl extends ot{#t;#e=0;#n;#i;#a;#s;#r;#o;#u;build(t,i,a,r,c,u,h){this.#a=i,this.#s=a,this.#r=r,this.#o=c,this.#u=u,this.#n=h??0,this.#i=t,this.#l()}get thickness(){return this.#u}setLastElement(t){return this.#i.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#i.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:i}of this.#i){if(t.push(`M${ot.svgRound(i[4])} ${ot.svgRound(i[5])}`),i.length===6){t.push("Z");continue}if(i.length===12&&isNaN(i[6])){t.push(`L${ot.svgRound(i[10])} ${ot.svgRound(i[11])}`);continue}for(let a=6,r=i.length;a<r;a+=6){const[c,u,h,p,m,g]=i.subarray(a,a+6).map(ot.svgRound);t.push(`C${c} ${u} ${h} ${p} ${m} ${g}`)}}return t.join("")}serialize([t,i,a,r],c){const u=[],h=[],[p,m,g,y]=this.#h();let b,S,A,_,R,C,N,O,U;switch(this.#o){case 0:U=ot._rescale,b=t,S=i+r,A=a,_=-r,R=t+p*a,C=i+(1-m-y)*r,N=t+(p+g)*a,O=i+(1-m)*r;break;case 90:U=ot._rescaleAndSwap,b=t,S=i,A=a,_=r,R=t+m*a,C=i+p*r,N=t+(m+y)*a,O=i+(p+g)*r;break;case 180:U=ot._rescale,b=t+a,S=i,A=-a,_=r,R=t+(1-p-g)*a,C=i+m*r,N=t+(1-p)*a,O=i+(m+y)*r;break;case 270:U=ot._rescaleAndSwap,b=t+a,S=i+r,A=-a,_=-r,R=t+(1-m-y)*a,C=i+(1-p-g)*r,N=t+(1-m)*a,O=i+(1-p)*r;break}for(const{line:I,points:j}of this.#i)u.push(U(I,b,S,A,_,c?new Array(I.length):null)),h.push(U(j,b,S,A,_,c?new Array(j.length):null));return{lines:u,points:h,rect:[R,C,N,O]}}static deserialize(t,i,a,r,c,{paths:{lines:u,points:h},rotation:p,thickness:m}){const g=[];let y,b,S,A,_;switch(p){case 0:_=ot._rescale,y=-t/a,b=i/r+1,S=1/a,A=-1/r;break;case 90:_=ot._rescaleAndSwap,y=-i/r,b=-t/a,S=1/r,A=1/a;break;case 180:_=ot._rescale,y=t/a+1,b=-i/r,S=-1/a,A=1/r;break;case 270:_=ot._rescaleAndSwap,y=i/r+1,b=t/a+1,S=-1/r,A=-1/a;break}if(!u){u=[];for(const C of h){const N=C.length;if(N===2){u.push(new Float32Array([NaN,NaN,NaN,NaN,C[0],C[1]]));continue}if(N===4){u.push(new Float32Array([NaN,NaN,NaN,NaN,C[0],C[1],NaN,NaN,NaN,NaN,C[2],C[3]]));continue}const O=new Float32Array(3*(N-2));u.push(O);let[U,I,j,F]=C.subarray(0,4);O.set([NaN,NaN,NaN,NaN,U,I],0);for(let J=4;J<N;J+=2){const X=C[J],at=C[J+1];O.set(ot.createBezierPoints(U,I,j,F,X,at),(J-2)*3),[U,I,j,F]=[j,F,X,at]}}}for(let C=0,N=u.length;C<N;C++)g.push({line:_(u[C].map(O=>O??NaN),y,b,S,A),points:_(h[C].map(O=>O??NaN),y,b,S,A)});const R=new this.prototype.constructor;return R.build(g,a,r,1,p,m,c),R}#c(t=this.#u){const i=this.#n+t/2*this.#r;return this.#o%180===0?[i/this.#a,i/this.#s]:[i/this.#s,i/this.#a]}#h(){const[t,i,a,r]=this.#t,[c,u]=this.#c(0);return[t+c,i+u,a-2*c,r-2*u]}#l(){const t=this.#t=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:r}of this.#i){if(r.length<=12){for(let h=4,p=r.length;h<p;h+=6)mt.pointBoundingBox(r[h],r[h+1],t);continue}let c=r[4],u=r[5];for(let h=6,p=r.length;h<p;h+=6){const[m,g,y,b,S,A]=r.subarray(h,h+6);mt.bezierBoundingBox(c,u,m,g,y,b,S,A,t),c=S,u=A}}const[i,a]=this.#c();t[0]=hn(t[0]-i,0,1),t[1]=hn(t[1]-a,0,1),t[2]=hn(t[2]+i,0,1),t[3]=hn(t[3]+a,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#t}updateProperty(t,i){return t==="stroke-width"?this.#p(i):null}#p(t){const[i,a]=this.#c();this.#u=t;const[r,c]=this.#c(),[u,h]=[r-i,c-a],p=this.#t;return p[0]-=u,p[1]-=h,p[2]+=2*u,p[3]+=2*h,p}updateParentDimensions([t,i],a){const[r,c]=this.#c();this.#a=t,this.#s=i,this.#r=a;const[u,h]=this.#c(),p=u-r,m=h-c,g=this.#t;return g[0]-=p,g[1]-=m,g[2]+=2*p,g[3]+=2*m,g}updateRotation(t){return this.#e=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#t.map(ot.svgRound).join(" ")}get defaultProperties(){const[t,i]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ot.svgRound(t)} ${ot.svgRound(i)}`}}}get rotationTransform(){const[,,t,i]=this.#t;let a=0,r=0,c=0,u=0,h=0,p=0;switch(this.#e){case 90:r=i/t,c=-t/i,h=t;break;case 180:a=-1,u=-1,h=t,p=i;break;case 270:r=-i/t,c=t/i,p=i;break;default:return""}return`matrix(${a} ${r} ${c} ${u} ${ot.svgRound(h)} ${ot.svgRound(p)})`}getPathResizingSVGProperties([t,i,a,r]){const[c,u]=this.#c(),[h,p,m,g]=this.#t;if(Math.abs(m-c)<=ot.PRECISION||Math.abs(g-u)<=ot.PRECISION){const _=t+a/2-(h+m/2),R=i+r/2-(p+g/2);return{path:{"transform-origin":`${ot.svgRound(t)} ${ot.svgRound(i)}`,transform:`${this.rotationTransform} translate(${_} ${R})`}}}const y=(a-2*c)/(m-2*c),b=(r-2*u)/(g-2*u),S=m/a,A=g/r;return{path:{"transform-origin":`${ot.svgRound(h)} ${ot.svgRound(p)}`,transform:`${this.rotationTransform} scale(${S} ${A}) translate(${ot.svgRound(c)} ${ot.svgRound(u)}) scale(${y} ${b}) translate(${ot.svgRound(-c)} ${ot.svgRound(-u)})`}}}getPathResizedSVGProperties([t,i,a,r]){const[c,u]=this.#c(),h=this.#t,[p,m,g,y]=h;if(h[0]=t,h[1]=i,h[2]=a,h[3]=r,Math.abs(g-c)<=ot.PRECISION||Math.abs(y-u)<=ot.PRECISION){const R=t+a/2-(p+g/2),C=i+r/2-(m+y/2);for(const{line:N,points:O}of this.#i)ot._translate(N,R,C,N),ot._translate(O,R,C,O);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ot.svgRound(t)} ${ot.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const b=(a-2*c)/(g-2*c),S=(r-2*u)/(y-2*u),A=-b*(p+c)+t+c,_=-S*(m+u)+i+u;if(b!==1||S!==1||A!==0||_!==0)for(const{line:R,points:C}of this.#i)ot._rescale(R,A,_,b,S,R),ot._rescale(C,A,_,b,S,C);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ot.svgRound(t)} ${ot.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,i],a){const[r,c]=a,u=this.#t,h=t-u[0],p=i-u[1];if(this.#a===r&&this.#s===c)for(const{line:m,points:g}of this.#i)ot._translate(m,h,p,m),ot._translate(g,h,p,g);else{const m=this.#a/r,g=this.#s/c;this.#a=r,this.#s=c;for(const{line:y,points:b}of this.#i)ot._rescale(y,h,p,m,g,y),ot._rescale(b,h,p,m,g,b);u[2]*=m,u[3]*=g}return u[0]=t,u[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${ot.svgRound(t)} ${ot.svgRound(i)}`}}}get defaultSVGProperties(){const t=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${ot.svgRound(t[0])} ${ot.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class Lu extends F0{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:gt._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,i){t==="stroke-width"&&(i??=this["stroke-width"],i*=this._viewParameters.realScale),super.updateSVGProperty(t,i)}clone(){const t=new Lu(this._viewParameters);return t.updateAll(this),t}}class up extends vt{static _type="ink";static _editorType=Tt.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,i){gt.initialize(t,i),this._defaultDrawingOptions=new Lu(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return zt(this,"typesMap",new Map([[$t.INK_THICKNESS,"stroke-width"],[$t.INK_COLOR,"stroke"],[$t.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,i,a,r,c){return new ZO(t,i,a,r,c,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,i,a,r,c,u){return dl.deserialize(t,i,a,r,c,u)}static async deserialize(t,i,a){let r=null;if(t instanceof rp){const{data:{inkLists:u,rect:h,rotation:p,id:m,color:g,opacity:y,borderStyle:{rawWidth:b},popupRef:S,contentsObj:A},parent:{page:{pageNumber:_}}}=t;r=t={annotationType:Tt.INK,color:Array.from(g),thickness:b,opacity:y,paths:{points:u},boxes:null,pageIndex:_-1,rect:h.slice(0),rotation:p,annotationElementId:m,id:m,deleted:!1,popupRef:S,comment:A?.str||null}}const c=await super.deserialize(t,i,a);return c._initialData=r,t.comment&&c.setCommentData(t.comment),c}get toolbarButtons(){return this._colorPicker||=new cl(this),[["colorPicker",this._colorPicker]]}get colorType(){return $t.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:i,parent:a}=this;i.updateSVGProperty("stroke-width"),a.drawLayer.updateProperties(t,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:i,opacity:a}){this._drawingOptions=up.getDefaultDrawingOptions({stroke:mt.makeHexColor(...t),"stroke-width":i,"stroke-opacity":a})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:a,rect:r}=this.serializeDraw(t),{_drawingOptions:{stroke:c,"stroke-opacity":u,"stroke-width":h}}=this,p={annotationType:Tt.INK,color:gt._colorManager.convert(c),opacity:u,thickness:h,paths:{lines:i,points:a},pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(p),t?(p.isCopy=!0,p):this.annotationElementId&&!this.#t(p)?null:(p.id=this.annotationElementId,p)}#t(t){const{color:i,thickness:a,opacity:r,pageIndex:c}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((u,h)=>u!==i[h])||t.thickness!==a||t.opacity!==r||t.pageIndex!==c}renderAnnotationElement(t){const{points:i,rect:a}=this.serializeDraw(!1),r={rect:a,thickness:this._drawingOptions["stroke-width"],points:i};return this.hasEditedComment&&(r.popup=this.comment),t.updateEdited(r),null}}class dp extends dl{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Iu=8,hl=3;class kr{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(t,i,a,r){return a-=t,r-=i,a===0?r>0?0:4:a===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#i(t,i,a,r,c,u,h){const p=this.#e(a,r,c,u);for(let m=0;m<8;m++){const g=(-m+p-h+16)%8,y=this.#n[2*g],b=this.#n[2*g+1];if(t[(a+y)*i+(r+b)]!==0)return g}return-1}static#a(t,i,a,r,c,u,h){const p=this.#e(a,r,c,u);for(let m=0;m<8;m++){const g=(m+p+h+16)%8,y=this.#n[2*g],b=this.#n[2*g+1];if(t[(a+y)*i+(r+b)]!==0)return g}return-1}static#s(t,i,a,r){const c=t.length,u=new Int32Array(c);for(let g=0;g<c;g++)u[g]=t[g]<=r?1:0;for(let g=1;g<a-1;g++)u[g*i]=u[g*i+i-1]=0;for(let g=0;g<i;g++)u[g]=u[i*a-1-g]=0;let h=1,p;const m=[];for(let g=1;g<a-1;g++){p=1;for(let y=1;y<i-1;y++){const b=g*i+y,S=u[b];if(S===0)continue;let A=g,_=y;if(S===1&&u[b-1]===0)h+=1,_-=1;else if(S>=1&&u[b+1]===0)h+=1,_+=1,S>1&&(p=S);else{S!==1&&(p=Math.abs(S));continue}const R=[y,g],C=_===y+1,N={isHole:C,points:R,id:h,parent:0};m.push(N);let O;for(const K of m)if(K.id===p){O=K;break}O?O.isHole?N.parent=C?O.parent:p:N.parent=C?p:O.parent:N.parent=C?p:0;const U=this.#i(u,i,g,y,A,_,0);if(U===-1){u[b]=-h,u[b]!==1&&(p=Math.abs(u[b]));continue}let I=this.#n[2*U],j=this.#n[2*U+1];const F=g+I,J=y+j;A=F,_=J;let X=g,at=y;for(;;){const K=this.#a(u,i,X,at,A,_,1);I=this.#n[2*K],j=this.#n[2*K+1];const lt=X+I,St=at+j;R.push(St,lt);const yt=X*i+at;if(u[yt+1]===0?u[yt]=-h:u[yt]===1&&(u[yt]=h),lt===g&&St===y&&X===F&&at===J){u[b]!==1&&(p=Math.abs(u[b]));break}else A=X,_=at,X=lt,at=St}}}return m}static#r(t,i,a,r){if(a-i<=4){for(let F=i;F<a-2;F+=2)r.push(t[F],t[F+1]);return}const c=t[i],u=t[i+1],h=t[a-4]-c,p=t[a-3]-u,m=Math.hypot(h,p),g=h/m,y=p/m,b=g*u-y*c,S=p/h,A=1/m,_=Math.atan(S),R=Math.cos(_),C=Math.sin(_),N=A*(Math.abs(R)+Math.abs(C)),O=A*(1-N+N**2),U=Math.max(Math.atan(Math.abs(C+R)*O),Math.atan(Math.abs(C-R)*O));let I=0,j=i;for(let F=i+2;F<a-2;F+=2){const J=Math.abs(b-g*t[F+1]+y*t[F]);J>I&&(j=F,I=J)}I>(m*U)**2?(this.#r(t,i,j+2,r),this.#r(t,j,a,r)):r.push(c,u)}static#o(t){const i=[],a=t.length;return this.#r(t,0,a,i),i.push(t[a-2],t[a-1]),i.length<=4?null:i}static#u(t,i,a,r,c,u){const h=new Float32Array(u**2),p=-2*r**2,m=u>>1;for(let _=0;_<u;_++){const R=(_-m)**2;for(let C=0;C<u;C++)h[_*u+C]=Math.exp((R+(C-m)**2)/p)}const g=new Float32Array(256),y=-2*c**2;for(let _=0;_<256;_++)g[_]=Math.exp(_**2/y);const b=t.length,S=new Uint8Array(b),A=new Uint32Array(256);for(let _=0;_<a;_++)for(let R=0;R<i;R++){const C=_*i+R,N=t[C];let O=0,U=0;for(let j=0;j<u;j++){const F=_+j-m;if(!(F<0||F>=a))for(let J=0;J<u;J++){const X=R+J-m;if(X<0||X>=i)continue;const at=t[F*i+X],K=h[j*u+J]*g[Math.abs(at-N)];O+=at*K,U+=K}}const I=S[C]=Math.round(O/U);A[I]++}return[S,A]}static#c(t){const i=new Uint32Array(256);for(const a of t)i[a]++;return i}static#h(t){const i=t.length,a=new Uint8ClampedArray(i>>2);let r=-1/0,c=1/0;for(let h=0,p=a.length;h<p;h++){const m=a[h]=t[h<<2];r=Math.max(r,m),c=Math.min(c,m)}const u=255/(r-c);for(let h=0,p=a.length;h<p;h++)a[h]=(a[h]-c)*u;return a}static#l(t){let i,a=-1/0,r=-1/0;const c=t.findIndex(p=>p!==0);let u=c,h=c;for(i=c;i<256;i++){const p=t[i];p>a&&(i-u>r&&(r=i-u,h=i-1),a=p,u=i)}for(i=h-1;i>=0&&!(t[i]>t[i+1]);i--);return i}static#p(t){const i=t,{width:a,height:r}=t,{maxDim:c}=this.#t;let u=a,h=r;if(a>c||r>c){let b=a,S=r,A=Math.log2(Math.max(a,r)/c);const _=Math.floor(A);A=A===_?_-1:_;for(let C=0;C<A;C++){u=Math.ceil(b/2),h=Math.ceil(S/2);const N=new OffscreenCanvas(u,h);N.getContext("2d").drawImage(t,0,0,b,S,0,0,u,h),b=u,S=h,t!==i&&t.close(),t=N.transferToImageBitmap()}const R=Math.min(c/u,c/h);u=Math.round(u*R),h=Math.round(h*R)}const m=new OffscreenCanvas(u,h).getContext("2d",{willReadFrequently:!0});m.fillStyle="white",m.fillRect(0,0,u,h),m.filter="grayscale(1)",m.drawImage(t,0,0,t.width,t.height,0,0,u,h);const g=m.getImageData(0,0,u,h).data;return[this.#h(g),u,h]}static extractContoursFromText(t,{fontFamily:i,fontStyle:a,fontWeight:r},c,u,h,p){let m=new OffscreenCanvas(1,1),g=m.getContext("2d",{alpha:!1});const y=200,b=g.font=`${a} ${r} ${y}px ${i}`,{actualBoundingBoxLeft:S,actualBoundingBoxRight:A,actualBoundingBoxAscent:_,actualBoundingBoxDescent:R,fontBoundingBoxAscent:C,fontBoundingBoxDescent:N,width:O}=g.measureText(t),U=1.5,I=Math.ceil(Math.max(Math.abs(S)+Math.abs(A)||0,O)*U),j=Math.ceil(Math.max(Math.abs(_)+Math.abs(R)||y,Math.abs(C)+Math.abs(N)||y)*U);m=new OffscreenCanvas(I,j),g=m.getContext("2d",{alpha:!0,willReadFrequently:!0}),g.font=b,g.filter="grayscale(1)",g.fillStyle="white",g.fillRect(0,0,I,j),g.fillStyle="black",g.fillText(t,I*(U-1)/2,j*(3-U)/2);const F=this.#h(g.getImageData(0,0,I,j).data),J=this.#c(F),X=this.#l(J),at=this.#s(F,I,j,X);return this.processDrawnLines({lines:{curves:at,width:I,height:j},pageWidth:c,pageHeight:u,rotation:h,innerMargin:p,mustSmooth:!0,areContours:!0})}static process(t,i,a,r,c){const[u,h,p]=this.#p(t),[m,g]=this.#u(u,h,p,Math.hypot(h,p)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),y=this.#l(g),b=this.#s(m,h,p,y);return this.processDrawnLines({lines:{curves:b,width:h,height:p},pageWidth:i,pageHeight:a,rotation:r,innerMargin:c,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:i,pageHeight:a,rotation:r,innerMargin:c,mustSmooth:u,areContours:h}){r%180!==0&&([i,a]=[a,i]);const{curves:p,width:m,height:g}=t,y=t.thickness??0,b=[],S=Math.min(i/m,a/g),A=S/i,_=S/a,R=[];for(const{points:N}of p){const O=u?this.#o(N):N;if(!O)continue;R.push(O);const U=O.length,I=new Float32Array(U),j=new Float32Array(3*(U===2?2:U-2));if(b.push({line:j,points:I}),U===2){I[0]=O[0]*A,I[1]=O[1]*_,j.set([NaN,NaN,NaN,NaN,I[0],I[1]],0);continue}let[F,J,X,at]=O;F*=A,J*=_,X*=A,at*=_,I.set([F,J,X,at],0),j.set([NaN,NaN,NaN,NaN,F,J],0);for(let K=4;K<U;K+=2){const lt=I[K]=O[K]*A,St=I[K+1]=O[K+1]*_;j.set(ot.createBezierPoints(F,J,X,at,lt,St),(K-2)*3),[F,J,X,at]=[X,at,lt,St]}}if(b.length===0)return null;const C=h?new dp:new dl;return C.build(b,i,a,1,r,h?0:y,c),{outline:C,newCurves:R,areContours:h,thickness:y,width:m,height:g}}static async compressSignature({outlines:t,areContours:i,thickness:a,width:r,height:c}){let u=1/0,h=-1/0,p=0;for(const O of t){p+=O.length;for(let U=2,I=O.length;U<I;U++){const j=O[U]-O[U-2];u=Math.min(u,j),h=Math.max(h,j)}}let m;u>=-128&&h<=127?m=Int8Array:u>=-32768&&h<=32767?m=Int16Array:m=Int32Array;const g=t.length,y=Iu+hl*g,b=new Uint32Array(y);let S=0;b[S++]=y*Uint32Array.BYTES_PER_ELEMENT+(p-2*g)*m.BYTES_PER_ELEMENT,b[S++]=0,b[S++]=r,b[S++]=c,b[S++]=i?0:1,b[S++]=Math.max(0,Math.floor(a??0)),b[S++]=g,b[S++]=m.BYTES_PER_ELEMENT;for(const O of t)b[S++]=O.length-2,b[S++]=O[0],b[S++]=O[1];const A=new CompressionStream("deflate-raw"),_=A.writable.getWriter();await _.ready,_.write(b);const R=m.prototype.constructor;for(const O of t){const U=new R(O.length-2);for(let I=2,j=O.length;I<j;I++)U[I-2]=O[I]-O[I-2];_.write(U)}_.close();const C=await new Response(A.readable).arrayBuffer(),N=new Uint8Array(C);return Kv(N)}static async decompressSignature(t){try{const i=EM(t),{readable:a,writable:r}=new DecompressionStream("deflate-raw"),c=r.getWriter();await c.ready,c.write(i).then(async()=>{await c.ready,await c.close()}).catch(()=>{});let u=null,h=0;for await(const O of a)u||=new Uint8Array(new Uint32Array(O.buffer,0,4)[0]),u.set(O,h),h+=O.length;const p=new Uint32Array(u.buffer,0,u.length>>2),m=p[1];if(m!==0)throw new Error(`Invalid version: ${m}`);const g=p[2],y=p[3],b=p[4]===0,S=p[5],A=p[6],_=p[7],R=[],C=(Iu+hl*A)*Uint32Array.BYTES_PER_ELEMENT;let N;switch(_){case Int8Array.BYTES_PER_ELEMENT:N=new Int8Array(u.buffer,C);break;case Int16Array.BYTES_PER_ELEMENT:N=new Int16Array(u.buffer,C);break;case Int32Array.BYTES_PER_ELEMENT:N=new Int32Array(u.buffer,C);break}h=0;for(let O=0;O<A;O++){const U=p[hl*O+Iu],I=new Float32Array(U+2);R.push(I);for(let j=0;j<hl-1;j++)I[j]=p[hl*O+Iu+j+1];for(let j=0;j<U;j++)I[j+2]=I[j]+N[h++]}return{areContours:b,thickness:S,outlines:R,width:g,height:y}}catch(i){return wt(`decompressSignature: ${i}`),null}}}class hp extends F0{constructor(){super(),super.updateProperties({fill:gt._defaultLineColor,"stroke-width":0})}clone(){const t=new hp;return t.updateAll(this),t}}class fp extends Lu{constructor(t){super(t),super.updateProperties({stroke:gt._defaultLineColor,"stroke-width":1})}clone(){const t=new fp(this._viewParameters);return t.updateAll(this),t}}class ki extends vt{#t=!1;#e=null;#n=null;#i=null;static _type="signature";static _editorType=Tt.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#n=t.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,i){gt.initialize(t,i),this._defaultDrawingOptions=new hp,this._defaultDrawnSignatureOptions=new fp(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return zt(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#e}}static computeTelemetryFinalData(t){const i=t.get("hasDescription");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,i;const{_isCopy:a}=this;if(a&&(this._isCopy=!1,t=this.x,i=this.y),super.render(),this._drawId===null)if(this.#n){const{lines:r,mustSmooth:c,areContours:u,description:h,uuid:p,heightInPage:m}=this.#n,{rawDims:{pageWidth:g,pageHeight:y},rotation:b}=this.parent.viewport,S=kr.processDrawnLines({lines:r,pageWidth:g,pageHeight:y,rotation:b,innerMargin:ki._INNER_MARGIN,mustSmooth:c,areContours:u});this.addSignature(S,m,h,p)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#e||""}));return a&&(this._isCopy=!0,this._moveAfterPaste(t,i)),this.div}setUuid(t){this.#i=t,this.addEditToolbar()}getUuid(){return this.#i}get description(){return this.#e}set description(t){this.#e=t,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(i=>{i?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:i,thickness:a,width:r,height:c}=this.#n,u=Math.max(r,c),h=kr.processDrawnLines({lines:{curves:t.map(p=>({points:p})),thickness:a,width:r,height:c},pageWidth:u,pageHeight:u,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i});return{areContours:i,outline:h.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,i,a,r){const{x:c,y:u}=this,{outline:h}=this.#n=t;this.#t=h instanceof dp,this.description=a;let p;this.#t?p=ki.getDefaultDrawingOptions():(p=ki._defaultDrawnSignatureOptions.clone(),p.updateProperties({"stroke-width":h.thickness})),this._addOutlines({drawOutlines:h,drawingOptions:p});const[m,g]=this.parentDimensions,[,y]=this.pageDimensions;let b=i/y;b=b>=1?.5:b,this.width*=b/this.height,this.width>=1&&(b*=.9/this.width,this.width=.9),this.height=b,this.setDims(m*this.width,g*this.height),this.x=c,this.y=u,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(r),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!r,hasDescription:!!a}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:i,pageHeight:a},rotation:r}=this.parent.viewport;return kr.process(t,i,a,r,ki._INNER_MARGIN)}getFromText(t,i){const{rawDims:{pageWidth:a,pageHeight:r},rotation:c}=this.parent.viewport;return kr.extractContoursFromText(t,i,a,r,c,ki._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:i,pageHeight:a},rotation:r}=this.parent.viewport;return kr.processDrawnLines({lines:t,pageWidth:i,pageHeight:a,rotation:r,innerMargin:ki._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:i}){t?this._drawingOptions=ki.getDefaultDrawingOptions():(this._drawingOptions=ki._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:i,points:a,rect:r}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":c}}=this,u={annotationType:Tt.SIGNATURE,isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:c,pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(u),t?(u.paths={lines:i,points:a},u.uuid=this.#i,u.isCopy=!0):u.lines=i,this.#e&&(u.accessibilityData={type:"Figure",alt:this.#e}),u}static deserializeDraw(t,i,a,r,c,u){return u.areContours?dp.deserialize(t,i,a,r,c,u):dl.deserialize(t,i,a,r,c,u)}static async deserialize(t,i,a){const r=await super.deserialize(t,i,a);return r.#t=t.areContours,r.description=t.accessibilityData?.alt||"",r.#i=t.uuid,r}}class JO extends gt{#t=null;#e=null;#n=null;#i=null;#a=null;#s="";#r=null;#o=!1;#u=null;#c=!1;#h=!1;static _type="stamp";static _editorType=Tt.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#i=t.bitmapUrl,this.#a=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,i){gt.initialize(t,i)}static isHandlingMimeForPasting(t){return $f.includes(t)}static paste(t,i){i.pasteEditor({mode:Tt.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const i=t.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}#l(t,i=!1){if(!t){this.remove();return}this.#t=t.bitmap,i||(this.#e=t.id,this.#c=t.isSvg),t.file&&(this.#s=t.file.name),this.#f()}#p(){if(this.#n=null,this._uiManager.enableWaiting(!1),!!this.#r){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:a}=this._uiManager;if(!a)throw new Error("No ML.");if(!await a.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:r,width:c,height:u}=t||this.copyCanvas(null,null,!0).imageData,h=await a.guess({name:"altText",request:{data:r,width:c,height:u,channels:r.length/(c*u)}});if(!h)throw new Error("No response from the AI service.");if(h.error)throw new Error("Error from the AI service.");if(h.cancel)return null;if(!h.output)throw new Error("No valid response from the AI service.");const p=h.output;return await this.setGuessedAltText(p),i&&!this.hasAltTextData()&&(this.altTextData={alt:p,decorative:!1}),p}#g(){if(this.#e){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#e).then(a=>this.#l(a,!0)).finally(()=>this.#p());return}if(this.#i){const a=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(a).then(r=>this.#l(r)).finally(()=>this.#p());return}if(this.#a){const a=this.#a;this.#a=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(a).then(r=>this.#l(r)).finally(()=>this.#p());return}const t=document.createElement("input");t.type="file",t.accept=$f.join(",");const i=this._uiManager._signal;this.#n=new Promise(a=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const r=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#l(r)}a()},{signal:i}),t.addEventListener("cancel",()=>{this.remove(),a()},{signal:i})}).finally(()=>this.#p()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#r?.remove(),this.#r=null,this.#u&&(clearTimeout(this.#u),this.#u=null)),super.remove()}rebuild(){if(!this.parent){this.#e&&this.#g();return}super.rebuild(),this.div!==null&&(this.#e&&this.#r===null&&this.#g(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#n||this.#t||this.#i||this.#a||this.#e||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,i;return this._isCopy&&(t=this.x,i=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#t?this.#f():this.#g()),this._isCopy&&this._moveAfterPaste(t,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,i){const{id:a,bitmap:r}=this._uiManager.imageManager.getFromCanvas(t,i);i.remove(),a&&this._uiManager.imageManager.isValidId(a)&&(this.#e=a,r&&(this.#t=r),this.#o=!1,this.#f())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#u!==null&&clearTimeout(this.#u);const t=200;this.#u=setTimeout(()=>{this.#u=null,this.#m()},t)}#f(){const{div:t}=this;let{width:i,height:a}=this.#t;const[r,c]=this.pageDimensions,u=.75;if(this.width)i=this.width*r,a=this.height*c;else if(i>u*r||a>u*c){const g=Math.min(u*r/i,u*c/a);i*=g,a*=g}const[h,p]=this.parentDimensions;this.setDims(i*h/r,a*p/c),this._uiManager.enableWaiting(!1);const m=this.#r=document.createElement("canvas");m.setAttribute("role","img"),this.addContainer(m),this.width=i/r,this.height=a/c,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),this.#m(),this.#h||(this.parent.addUndoableEditor(this),this.#h=!0),this._reportTelemetry({action:"inserted_image"}),this.#s&&this.div.setAttribute("aria-description",this.#s),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(t,i,a=!1){t||(t=224);const{width:r,height:c}=this.#t,u=new Di;let h=this.#t,p=r,m=c,g=null;if(i){if(r>i||c>i){const j=Math.min(i/r,i/c);p=Math.floor(r*j),m=Math.floor(c*j)}g=document.createElement("canvas");const b=g.width=Math.ceil(p*u.sx),S=g.height=Math.ceil(m*u.sy);this.#c||(h=this.#d(b,S));const A=g.getContext("2d");A.filter=this._uiManager.hcmFilter;let _="white",R="#cfcfd8";this._uiManager.hcmFilter!=="none"?R="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(_="#8f8f9d",R="#42414d");const C=15,N=C*u.sx,O=C*u.sy,U=new OffscreenCanvas(N*2,O*2),I=U.getContext("2d");I.fillStyle=_,I.fillRect(0,0,N*2,O*2),I.fillStyle=R,I.fillRect(0,0,N,O),I.fillRect(N,O,N,O),A.fillStyle=A.createPattern(U,"repeat"),A.fillRect(0,0,b,S),A.drawImage(h,0,0,h.width,h.height,0,0,b,S)}let y=null;if(a){let b,S;if(u.symmetric&&h.width<t&&h.height<t)b=h.width,S=h.height;else if(h=this.#t,r>t||c>t){const R=Math.min(t/r,t/c);b=Math.floor(r*R),S=Math.floor(c*R),this.#c||(h=this.#d(b,S))}const _=new OffscreenCanvas(b,S).getContext("2d",{willReadFrequently:!0});_.drawImage(h,0,0,h.width,h.height,0,0,b,S),y={width:b,height:S,data:_.getImageData(0,0,b,S).data}}return{canvas:g,width:p,height:m,imageData:y}}#d(t,i){const{width:a,height:r}=this.#t;let c=a,u=r,h=this.#t;for(;c>2*t||u>2*i;){const p=c,m=u;c>2*t&&(c=c>=16384?Math.floor(c/2)-1:Math.ceil(c/2)),u>2*i&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2));const g=new OffscreenCanvas(c,u);g.getContext("2d").drawImage(h,0,0,p,m,0,0,c,u),h=g.transferToImageBitmap()}return h}#m(){const[t,i]=this.parentDimensions,{width:a,height:r}=this,c=new Di,u=Math.ceil(a*t*c.sx),h=Math.ceil(r*i*c.sy),p=this.#r;if(!p||p.width===u&&p.height===h)return;p.width=u,p.height=h;const m=this.#c?this.#t:this.#d(u,h),g=p.getContext("2d");g.filter=this._uiManager.hcmFilter,g.drawImage(m,0,0,m.width,m.height,0,0,u,h)}#v(t){if(t){if(this.#c){const r=this._uiManager.imageManager.getSvgUrl(this.#e);if(r)return r}const i=document.createElement("canvas");return{width:i.width,height:i.height}=this.#t,i.getContext("2d").drawImage(this.#t,0,0),i.toDataURL()}if(this.#c){const[i,a]=this.pageDimensions,r=Math.round(this.width*i*Cr.PDF_TO_CSS_UNITS),c=Math.round(this.height*a*Cr.PDF_TO_CSS_UNITS),u=new OffscreenCanvas(r,c);return u.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,r,c),u.transferToImageBitmap()}return structuredClone(this.#t)}static async deserialize(t,i,a){let r=null,c=!1;if(t instanceof H0){const{data:{rect:_,rotation:R,id:C,structParent:N,popupRef:O,contentsObj:U},container:I,parent:{page:{pageNumber:j}},canvas:F}=t;let J,X;F?(delete t.canvas,{id:J,bitmap:X}=a.imageManager.getFromCanvas(I.id,F),F.remove()):(c=!0,t._hasNoCanvas=!0);const at=(await i._structTree.getAriaAttributes(`${Hf}${C}`))?.get("aria-label")||"";r=t={annotationType:Tt.STAMP,bitmapId:J,bitmap:X,pageIndex:j-1,rect:_.slice(0),rotation:R,annotationElementId:C,id:C,deleted:!1,accessibilityData:{decorative:!1,altText:at},isSvg:!1,structParent:N,popupRef:O,comment:U?.str||null}}const u=await super.deserialize(t,i,a),{rect:h,bitmap:p,bitmapUrl:m,bitmapId:g,isSvg:y,accessibilityData:b}=t;c?(a.addMissingCanvas(t.id,u),u.#o=!0):g&&a.imageManager.isValidId(g)?(u.#e=g,p&&(u.#t=p)):u.#i=m,u.#c=y;const[S,A]=u.pageDimensions;return u.width=(h[2]-h[0])/S,u.height=(h[3]-h[1])/A,b&&(u.altTextData=b),u._initialData=r,t.comment&&u.setCommentData(t.comment),u.#h=!!r,u}serialize(t=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const a={annotationType:Tt.STAMP,bitmapId:this.#e,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(this.addComment(a),t)return a.bitmapUrl=this.#v(!0),a.accessibilityData=this.serializeAltText(!0),a.isCopy=!0,a;const{decorative:r,altText:c}=this.serializeAltText(!1);if(!r&&c&&(a.accessibilityData={type:"Figure",alt:c}),this.annotationElementId){const h=this.#y(a);if(h.isSame)return null;h.isSameAltText?delete a.accessibilityData:a.accessibilityData.structParent=this._initialData.structParent??-1}if(a.id=this.annotationElementId,i===null)return a;i.stamps||=new Map;const u=this.#c?(a.rect[2]-a.rect[0])*(a.rect[3]-a.rect[1]):null;if(!i.stamps.has(this.#e))i.stamps.set(this.#e,{area:u,serialized:a}),a.bitmap=this.#v(!1);else if(this.#c){const h=i.stamps.get(this.#e);u>h.area&&(h.area=u,h.serialized.bitmap.close(),h.serialized.bitmap=this.#v(!1))}return a}#y(t){const{pageIndex:i,accessibilityData:{altText:a}}=this._initialData,r=t.pageIndex===i,c=(t.accessibilityData?.alt||"")===a;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&c,isSameAltText:c}}renderAnnotationElement(t){const i={rect:this.getRect(0,0)};return this.hasEditedComment&&(i.popup=this.comment),t.updateEdited(i),null}}class es{#t;#e=!1;#n=null;#i=null;#a=null;#s=new Map;#r=!1;#o=!1;#u=!1;#c=null;#h=null;#l=null;#p=null;#g=null;#f=-1;#d;static _initialized=!1;static#m=new Map([Ue,up,JO,Te,ki].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:i,div:a,structTreeLayer:r,accessibilityManager:c,annotationLayer:u,drawLayer:h,textLayer:p,viewport:m,l10n:g}){const y=[...es.#m.values()];if(!es._initialized){es._initialized=!0;for(const b of y)b.initialize(g,t)}t.registerEditorTypes(y),this.#d=t,this.pageIndex=i,this.div=a,this.#t=c,this.#n=u,this.viewport=m,this.#l=p,this.drawLayer=h,this._structTree=r,this.#d.addLayer(this)}get isEmpty(){return this.#s.size===0}get isInvisible(){return this.isEmpty&&this.#d.getMode()===Tt.NONE}updateToolbar(t){this.#d.updateToolbar(t)}updateMode(t=this.#d.getMode()){switch(this.#b(),t){case Tt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Tt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Tt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const a of es.#m.values())i.toggle(`${a._type}Editing`,t===a._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#l?.div}setEditingState(t){this.#d.setEditingState(t)}addCommands(t){this.#d.addCommands(t)}cleanUndoStack(t){this.#d.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#n?.div.classList.toggle("disabled",!t)}async enable(){this.#u=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.#g?.abort(),this.#g=null;const t=new Set;for(const a of this.#s.values())a.enableEditing(),a.show(!0),a.annotationElementId&&(this.#d.removeChangedExistingAnnotation(a),t.add(a.annotationElementId));if(!this.#n){this.#u=!1;return}const i=this.#n.getEditableAnnotations();for(const a of i){if(a.hide(),this.#d.isDeletedAnnotationElement(a.data.id)||t.has(a.data.id))continue;const r=await this.deserialize(a);r&&(this.addOrRebuild(r),r.enableEditing())}this.#u=!1}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.#l&&!this.#g){this.#g=new AbortController;const r=this.#d.combinedSignal(this.#g);this.#l.div.addEventListener("pointerdown",c=>{const{clientX:h,clientY:p,timeStamp:m}=c,g=this.#f;if(m-g>500){this.#f=m;return}this.#f=-1;const{classList:y}=this.div;y.toggle("getElements",!0);const b=document.elementsFromPoint(h,p);if(y.toggle("getElements",!1),!this.div.contains(b[0]))return;let S;const A=new RegExp(`^${Gv}[0-9]+$`);for(const R of b)if(A.test(R.id)){S=R.id;break}if(!S)return;const _=this.#s.get(S);_?.annotationElementId===null&&(c.stopPropagation(),c.preventDefault(),_.dblclick())},{signal:r,capture:!0})}const t=new Map,i=new Map;for(const r of this.#s.values())if(r.disableEditing(),!!r.annotationElementId){if(r.serialize()!==null){t.set(r.annotationElementId,r);continue}else i.set(r.annotationElementId,r);this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()}if(this.#n){const r=this.#n.getEditableAnnotations();for(const c of r){const{id:u}=c.data;if(this.#d.isDeletedAnnotationElement(u)){c.updateEdited({deleted:!0});continue}let h=i.get(u);if(h){h.resetAnnotationElement(c),h.show(!1),c.show();continue}h=t.get(u),h&&(this.#d.addChangedExistingAnnotation(h),h.renderAnnotationElement(c)&&h.show(!1)),c.show()}}this.#b(),this.isEmpty&&(this.div.hidden=!0);const{classList:a}=this.div;for(const r of es.#m.values())a.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#o=!1}getEditableAnnotation(t){return this.#n?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#d.getActive()!==t&&this.#d.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#l?.div&&!this.#p){this.#p=new AbortController;const t=this.#d.combinedSignal(this.#p);this.#l.div.addEventListener("pointerdown",this.#v.bind(this),{signal:t}),this.#l.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#l?.div&&this.#p&&(this.#p.abort(),this.#p=null,this.#l.div.classList.remove("highlighting"))}#v(t){this.#d.unselectAll();const{target:i}=t;if(i===this.#l.div||(i.getAttribute("role")==="img"||i.classList.contains("endOfContent"))&&this.#l.div.contains(i)){const{isMac:a}=qe.platform;if(t.button!==0||t.ctrlKey&&a)return;this.#d.showAllEditors("highlight",!0,!0),this.#l.div.classList.add("free"),this.toggleDrawing(),Te.startHighlighting(this,this.#d.direction==="ltr",{target:this.#l.div,x:t.x,y:t.y}),this.#l.div.addEventListener("pointerup",()=>{this.#l.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#d._signal}),t.preventDefault()}}enableClick(){if(this.#i)return;this.#i=new AbortController;const t=this.#d.combinedSignal(this.#i);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const i=this.pointerup.bind(this);this.div.addEventListener("pointerup",i,{signal:t}),this.div.addEventListener("pointercancel",i,{signal:t})}disableClick(){this.#i?.abort(),this.#i=null}attach(t){this.#s.set(t.id,t);const{annotationElementId:i}=t;i&&this.#d.isDeletedAnnotationElement(i)&&this.#d.removeDeletedAnnotationElement(t)}detach(t){this.#s.delete(t.id),this.#t?.removePointerInTextLayer(t.contentDiv),!this.#o&&t.annotationElementId&&this.#d.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#d.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#d.addDeletedAnnotationElement(t.annotationElementId),gt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),this.#d.addEditor(t),this.attach(t),!t.isAttachedToDOM){const i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#u),this.#d.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!this.#a&&(t._focusEventsAllowed=!1,this.#a=setTimeout(()=>{this.#a=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#d._signal}),i.focus())},0)),t._structTreeParentId=this.#t?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const i=()=>t._uiManager.rebuild(t),a=()=>{t.remove()};this.addCommands({cmd:i,undo:a,mustExec:!1})}getNextId(){return this.#d.getId()}get#y(){return es.#m.get(this.#d.getMode())}combinedSignal(t){return this.#d.combinedSignal(t)}#E(t){const i=this.#y;return i?new i.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(t,i){this.updateToolbar(t),await this.#d.updateMode(t.mode);const{offsetX:a,offsetY:r}=this.#A(),c=this.getNextId(),u=this.#E({parent:this,id:c,x:a,y:r,uiManager:this.#d,isCentered:!0,...i});u&&this.add(u)}async deserialize(t){return await es.#m.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#d)||null}createAndAddNewEditor(t,i,a={}){const r=this.getNextId(),c=this.#E({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#d,isCentered:i,...a});return c&&this.add(c),c}#A(){const{x:t,y:i,width:a,height:r}=this.div.getBoundingClientRect(),c=Math.max(0,t),u=Math.max(0,i),h=Math.min(window.innerWidth,t+a),p=Math.min(window.innerHeight,i+r),m=(c+h)/2-t,g=(u+p)/2-i,[y,b]=this.viewport.rotation%180===0?[m,g]:[g,m];return{offsetX:y,offsetY:b}}addNewEditor(t={}){this.createAndAddNewEditor(this.#A(),!0,t)}setSelected(t){this.#d.setSelected(t)}toggleSelected(t){this.#d.toggleSelected(t)}unselect(t){this.#d.unselect(t)}pointerup(t){const{isMac:i}=qe.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div||!this.#r||(this.#r=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#e){this.#e=!0;return}const a=this.#d.getMode();if(a===Tt.STAMP||a===Tt.SIGNATURE){this.#d.unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(this.#d.getMode()===Tt.HIGHLIGHT&&this.enableTextSelection(),this.#r){this.#r=!1;return}const{isMac:i}=qe.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div)return;if(this.#r=!0,this.#y?.isDrawer){this.startDrawingSession(t);return}const a=this.#d.getActive();this.#e=!a||a.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#c){this.#y.startDrawing(this,this.#d,!1,t);return}this.#d.setCurrentDrawingSession(this),this.#c=new AbortController;const i=this.#d.combinedSignal(this.#c);this.div.addEventListener("blur",({relatedTarget:a})=>{a&&!this.div.contains(a)&&(this.#h=null,this.commitOrRemove())},{signal:i}),this.#y.startDrawing(this,this.#d,!1,t)}pause(t){if(t){const{activeElement:i}=document;this.div.contains(i)&&(this.#h=i);return}this.#h&&setTimeout(()=>{this.#h?.focus(),this.#h=null},0)}endDrawingSession(t=!1){return this.#c?(this.#d.setCurrentDrawingSession(null),this.#c.abort(),this.#c=null,this.#h=null,this.#y.endDrawing(t)):null}findNewParent(t,i,a){const r=this.#d.findParent(i,a);return r===null||r===this?!1:(r.changeParent(t),!0)}commitOrRemove(){return this.#c?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#c&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#d.getActive()?.parent===this&&(this.#d.commitOrRemove(),this.#d.setActiveEditor(null)),this.#a&&(clearTimeout(this.#a),this.#a=null);for(const t of this.#s.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#s.clear(),this.#d.removeLayer(this)}#b(){for(const t of this.#s.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,Ta(this.div,t);for(const i of this.#d.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update({viewport:t}){this.#d.commitOrRemove(),this.#b();const i=this.viewport.rotation,a=t.rotation;if(this.viewport=t,Ta(this.div,{rotation:a}),i!==a)for(const r of this.#s.values())r.rotate(a)}get pageDimensions(){const{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return this.#d.viewParameters.realScale}}class Xe{#t=null;#e=new Map;#n=new Map;static#i=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(!this.#t){this.#t=t;return}if(this.#t!==t){if(this.#e.size>0)for(const i of this.#e.values())i.remove(),t.append(i);this.#t=t}}static get _svgFactory(){return zt(this,"_svgFactory",new ku)}static#a(t,[i,a,r,c]){const{style:u}=t;u.top=`${100*a}%`,u.left=`${100*i}%`,u.width=`${100*r}%`,u.height=`${100*c}%`}#s(){const t=Xe._svgFactory.create(1,1,!0);return this.#t.append(t),t.setAttribute("aria-hidden",!0),t}#r(t,i){const a=Xe._svgFactory.createElement("clipPath");t.append(a);const r=`clip_${i}`;a.setAttribute("id",r),a.setAttribute("clipPathUnits","objectBoundingBox");const c=Xe._svgFactory.createElement("use");return a.append(c),c.setAttribute("href",`#${i}`),c.classList.add("clip"),r}#o(t,i){for(const[a,r]of Object.entries(i))r===null?t.removeAttribute(a):t.setAttribute(a,r)}draw(t,i=!1,a=!1){const r=Xe.#i++,c=this.#s(),u=Xe._svgFactory.createElement("defs");c.append(u);const h=Xe._svgFactory.createElement("path");u.append(h);const p=`path_p${this.pageIndex}_${r}`;h.setAttribute("id",p),h.setAttribute("vector-effect","non-scaling-stroke"),i&&this.#n.set(r,h);const m=a?this.#r(u,p):null,g=Xe._svgFactory.createElement("use");return c.append(g),g.setAttribute("href",`#${p}`),this.updateProperties(c,t),this.#e.set(r,c),{id:r,clipPathId:`url(#${m})`}}drawOutline(t,i){const a=Xe.#i++,r=this.#s(),c=Xe._svgFactory.createElement("defs");r.append(c);const u=Xe._svgFactory.createElement("path");c.append(u);const h=`path_p${this.pageIndex}_${a}`;u.setAttribute("id",h),u.setAttribute("vector-effect","non-scaling-stroke");let p;if(i){const y=Xe._svgFactory.createElement("mask");c.append(y),p=`mask_p${this.pageIndex}_${a}`,y.setAttribute("id",p),y.setAttribute("maskUnits","objectBoundingBox");const b=Xe._svgFactory.createElement("rect");y.append(b),b.setAttribute("width","1"),b.setAttribute("height","1"),b.setAttribute("fill","white");const S=Xe._svgFactory.createElement("use");y.append(S),S.setAttribute("href",`#${h}`),S.setAttribute("stroke","none"),S.setAttribute("fill","black"),S.setAttribute("fill-rule","nonzero"),S.classList.add("mask")}const m=Xe._svgFactory.createElement("use");r.append(m),m.setAttribute("href",`#${h}`),p&&m.setAttribute("mask",`url(#${p})`);const g=m.cloneNode();return r.append(g),m.classList.add("mainOutline"),g.classList.add("secondaryOutline"),this.updateProperties(r,t),this.#e.set(a,r),a}finalizeDraw(t,i){this.#n.delete(t),this.updateProperties(t,i)}updateProperties(t,i){if(!i)return;const{root:a,bbox:r,rootClass:c,path:u}=i,h=typeof t=="number"?this.#e.get(t):t;if(h){if(a&&this.#o(h,a),r&&Xe.#a(h,r),c){const{classList:p}=h;for(const[m,g]of Object.entries(c))p.toggle(m,g)}if(u){const m=h.firstChild.firstChild;this.#o(m,u)}}}updateParent(t,i){if(i===this)return;const a=this.#e.get(t);a&&(i.#t.append(a),this.#e.delete(t),i.#e.set(t,a))}remove(t){this.#n.delete(t),this.#t!==null&&(this.#e.get(t).remove(),this.#e.delete(t))}destroy(){this.#t=null;for(const t of this.#e.values())t.remove();this.#e.clear(),this.#n.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:lp},globalThis.pdfjsLib={AbortException:Ps,AnnotationEditorLayer:es,AnnotationEditorParamsType:$t,AnnotationEditorType:Tt,AnnotationEditorUIManager:Us,AnnotationLayer:op,AnnotationMode:Is,AnnotationType:De,build:MO,ColorPicker:Qn,createValidAbsoluteUrl:Vv,DOMSVGFactory:ku,DrawLayer:Xe,FeatureTest:qe,fetchData:Zo,getDocument:D0,getFilenameFromUrl:AM,getPdfFilenameFromUrl:_M,getRGB:Tu,getUuid:Qv,getXfaPageViewport:wM,GlobalWorkerOptions:Dr,ImageKind:gu,InvalidPDFException:Pf,isDataScheme:_u,isPdfFile:Ff,isValidExplicitDest:PM,MathClamp:hn,noContextMenu:Xn,normalizeUnicode:vM,OPS:bu,OutputScale:Di,PasswordResponses:uM,PDFDataRangeTransport:M0,PDFDateString:jf,PDFWorker:ll,PermissionFlag:cM,PixelsPerInch:Cr,RenderingCancelledException:Bf,ResponseException:Au,setLayerDimensions:Ta,shadow:zt,SignatureExtractor:kr,stopEvent:Oe,SupportedImageMimeTypes:$f,TextLayer:fn,TouchManager:Cu,updateUrlHash:qv,Util:mt,VerbosityLevel:yu,version:DO,XfaLayer:N0},typeof Promise.withResolvers>"u"&&(Promise.withResolvers=function(){let l,t;return{promise:new Promise((a,r)=>{l=a,t=r}),resolve:l,reject:t}}),Dr.workerSrc="/pdf.worker.js";class tk{extractProcessId(){try{const t=window.location.href;let i=t.match(/\/processo\/(\d+)\//);if(i&&i[1])return L.detail(`ID do processo extraído da URL: ${i[1]}`),i[1];if(i=t.match(/\/pjekz\/processo\/(\d+)\//),i&&i[1])return L.detail(`ID do processo extraído da URL (pjekz): ${i[1]}`),i[1];const a=new URLSearchParams(window.location.search),r=["idProcesso","processoId","id","processo"];for(const c of r){const u=a.get(c);if(u&&/^\d+$/.test(u))return L.detail(`ID do processo extraído do parâmetro ${c}: ${u}`),u}return L.warn("ID do processo não encontrado na URL"),null}catch(t){return L.error("Erro ao extrair ID do processo:",t),null}}extractDocumentId(){try{const i=window.location.href.match(/\/documento\/(\d+)\//);if(i&&i[1])return L.detail(`ID do documento extraído da URL: ${i[1]}`),i[1];const a=new URLSearchParams(window.location.search),r=["idDocumento","documentoId","docId"];for(const u of r){const h=a.get(u);if(h&&/^\d+$/.test(h))return L.detail(`ID do documento extraído do parâmetro ${u}: ${h}`),h}const c=document.querySelector("mat-card-title");if(c){const u=c.textContent.match(/Id\s+([a-zA-Z0-9]+)/);if(u&&/^\d+$/.test(u[1]))return L.detail(`ID do documento extraído do título: ${u[1]}`),u[1]}return L.warn("ID do documento não encontrado"),null}catch(t){return L.error("Erro ao extrair ID do documento:",t),null}}buildContentUrl(t,i,a="pdf"){if(!t||!i)return L.warn("IDs do processo ou documento não fornecidos para construir URL"),null;const r=window.location.origin;if(a==="txt"){const c=`${r}/pje-comum-api/api/processos/id/${t}/documentos/id/${i}/conteudo`;return L.detail(`URL do TXT construída: ${c}`),c}else if(a==="pdf"){L.detail(`Construindo URL para PDF: processoId=${t}, documentId=${i}`);const c=`${r}/pje-comum-api/api/processos/id/${t}/documentos/id/${i}/conteudo?incluirCapa=false&incluirAssinatura=true`;return L.detail(`URL do PDF construída: ${c}`),c}else return L.warn(`Tipo de conteúdo desconhecido: ${a}`),null}buildFullProcessUrl(t){if(!t)return L.warn("ID do processo não fornecido para construir URL completa"),null;const a=`${window.location.origin}/pje-comum-api/api/processos/id/${t}/documentos/agrupados?processoCompleto=true`;return L.detail(`URL completa do processo construída: ${a}`),a}async download(t){if(!t)throw new Error("URL do PDF não fornecida");L.info(`Baixando PDF de: ${t}`);const i=await fetch(t,{method:"GET",credentials:"same-origin",headers:{Accept:"application/pdf, application/json"}});if(!i.ok)throw new Error(`Erro HTTP ${i.status}: ${i.statusText}`);const a=i.headers.get("Content-Type")||null;if(!a)throw new Error("Cabeçalho Content-Type não encontrado na resposta");if(!a.startsWith("application/pdf")&&!a.startsWith("application/json"))throw new Error(`Tipo de conteúdo inesperado: ${a}`);if(L.info(`Tipo de conteúdo recebido: ${a}`),a.startsWith("application/json")){const r=await i.text();if(L.info(`JSON recebido, tamanho: ${r.length} caracteres`),r.length===0)throw new Error("Resposta JSON está vazia");return{content:r,mimeType:"application/json"}}if(a.startsWith("application/pdf")){const r=await i.arrayBuffer();if(r.byteLength===0)throw new Error("PDF baixado está vazio");return L.info(`PDF baixado com sucesso, tamanho: ${r.byteLength} bytes`),{content:r,mimeType:"application/pdf"}}return null}findPdfElements(){const t=['pje-historico-scroll-documento object[id^="obj"]','object[id^="obj"][type="application/pdf"]',"iframe#iframeVisualizacao","iframe.documento-frame",'iframe[src*="documento"]','iframe[src*="conteudo"]','div.visualizador-documento object[type="application/pdf"]','div.viewer-documento object[type="application/pdf"]','iframe[src*=".pdf"], embed[src*=".pdf"], object[type="application/pdf"]'];for(const i of t){const a=document.querySelector(i);if(a)return L.detail(`PDF viewer encontrado com seletor: ${i}`),a}return null}findPdfLinks(){return document.querySelector('a[href*="/documento/"][href*="/conteudo"], a[href*="baixar"], a[href*="download"]')}captureTextContent(){const t=[".documento-conteudo",".rich-panel-body",".viewer-documento .conteudo","mat-card-content",".documento-texto",".conteudo-documento",'[class*="documento"] [class*="conteudo"]',".visualizador-documento",'div[class*="text"] div[class*="content"]'];for(const i of t){const a=document.querySelector(i);if(a){const r=a.innerText||a.textContent||"";if(r&&r.trim().length>50)return L.detail(`Conteúdo textual encontrado com seletor: ${i}`),{type:"txt",data:r.trim().replace(/\n\s*\n\s*\n/g,`
308
+
309
+ `),mimeType:"text/plain",size:r.length}}}return L.warn("Nenhum conteúdo textual encontrado"),null}async extractTextFromPdf(t){try{L.info("Iniciando extração de texto do PDF...");const i=await t.arrayBuffer(),r=await D0({data:i,useSystemFonts:!0,verbosity:0}).promise,c=[];L.info(`PDF carregado com ${r.numPages} páginas`);for(let h=1;h<=r.numPages;h++)try{const g=(await(await r.getPage(h)).getTextContent()).items.map(y=>y.str).join(" ");g.trim()&&c.push(`
310
+ --- Página ${h} ---
311
+ ${g}
312
+ `),h%10===0&&L.info(`Extraído texto de ${h}/${r.numPages} páginas`)}catch(p){L.warn(`Erro ao extrair texto da página ${h}:`,p),c.push(`
313
+ --- Página ${h} (erro na extração) ---
314
+ `)}const u=c.join(`
315
+ `);return L.info(`Extração concluída. Texto extraído: ${u.length} caracteres`),u}catch(i){throw L.error("Erro ao extrair texto do PDF:",i),new Error(`Falha na extração de texto: ${i}`)}}formatFileSize(t){return t>=1024*1024?`${(t/(1024*1024)).toFixed(2)} MB`:`${(t/1024).toFixed(2)} KB`}extractProcessNumber(){const t=document.querySelector("pje-descricao-processo");if(t){const i=t.querySelector('a[aria-label*="Detalhes do Processo"] span');if(i&&i.textContent){const a=i.textContent.trim();if(a)return L.detail(`Número do processo extraído (pje-descricao-processo): ${a}`),a}}return L.warn("Número do processo não encontrado"),null}captureTextFromJsonBase64(t){const i=JSON.parse(t),a=i?.conteudoBase64;if(!i||!a)return L.warn("Conteúdo Base64 não encontrado na resposta da API"),null;const r=atob(a),u=new DOMParser().parseFromString(r,"text/html");L.info("Conteúdo do documento HTML capturado com sucesso",u);const h=this.extractTextFromParsedDocument(u);return h?(L.info("Texto extraído com sucesso do documento"),h):(L.warn("Nenhum texto significativo encontrado no documento"),"")}extractTextFromParsedDocument(t){try{const i=["main .corpo","div.corpo",".corpo","main","body"];for(const c of i){const u=t.querySelector(c);if(u){let h=u.innerText||u.textContent||"";if(h=h.replace(/\n\s*\n/g,`
316
+ `).replace(/\s+/g," ").trim(),h&&h.length>100)return L.detail(`Conteúdo extraído com seletor: ${c}`),h}}const a=t.querySelectorAll("p, div.topico, li");if(a.length>0){const c=[];if(a.forEach(u=>{const h=(u.textContent||"").trim();h&&h.length>10&&c.push(h)}),c.length>0){const u=c.join(`
317
+ `).trim();if(u.length>100)return L.detail("Conteúdo extraído de parágrafos estruturais"),u}}const r=t.body?.textContent?.trim();return r&&r.length>50?(L.detail("Conteúdo extraído do body completo"),r.replace(/\n\s*\n/g,`
318
+ `).replace(/\s+/g," ").trim()):(L.warn("Nenhum conteúdo textual significativo encontrado"),null)}catch(i){return L.error("Erro ao extrair texto do documento parseado:",i),null}}}class ek{pjeManager;lastDocId=null;checkTimeout=null;observer=null;ID_NOT_FOUND="id-not-found";NUM_ID_NOT_FOUND="num-id-not-found";TITLE_NOT_FOUND="Documento PJe";constructor(t){this.pjeManager=t||new pp,setTimeout(()=>{this.observeDocuments()},500)}handleMessage(t){t.data.type===Ae.EXTRACT_VISIBLE_DOCUMENT&&(L.info("Mensagem de extração de documento recebida"),this.extractDocumentAndSendResponse(t.data.id))}observeDocuments(){this.observer=new MutationObserver(t=>{t.forEach(i=>{i.type==="childList"&&(this.checkTimeout&&clearTimeout(this.checkTimeout),this.checkTimeout=setTimeout(()=>{this.checkForDocuments()},500))})}),this.observer.observe(document.body,{childList:!0,subtree:!0}),L.detail("Observador de documentos iniciado")}async checkForDocuments(){try{const t=['object[type="application/pdf"]','iframe[src*=".pdf"]','embed[src*=".pdf"]',".documento-conteudo",".rich-panel-body",".mat-card-content.conteudo-html"];let i=!1;for(const a of t)if(document.querySelector(a)){i=!0;break}if(i){const a=this.extractDocumentInfo(),r=a.id||this.ID_NOT_FOUND;r!==this.lastDocId&&(this.lastDocId=r,L.info("Novo documento detectado:",a),this.notifyDocumentDetected())}else this.lastDocId&&(this.lastDocId=null,L.info("Documento removido ou não encontrado."),this.notifyDocumentRemoved())}catch(t){L.error("Erro ao verificar documentos:",t)}}notifyDocumentDetected(){L.detail("Notificando documento detectado."),this.pjeManager.sendSuccessMessage(Ae.AUTO_CAPTURE_DETECTION)}notifyDocumentRemoved(){L.detail("Notificando documento removido."),this.pjeManager.sendSuccessMessage(Ae.AUTO_CAPTURE_CLEANUP)}async extractDocumentAndSendResponse(t){try{L.info("Iniciando captura automática do documento...");const i=await this.extractDocument();i?(L.info("Documento capturado com sucesso:",i),this.pjeManager.sendSuccessMessage(Ae.SINGLE_DOCUMENT_EXTRACTED,i,t),L.info("Documento enviado com sucesso:",i.id)):L.warn("Nenhum documento encontrado para captura.")}catch(i){L.error("Erro ao capturar documento:",i),this.pjeManager.sendError(Ae.EXTRACTION_ERROR,String(i),t)}}async extractDocument(){const t=this.extractDocumentInfo(),i=await this.captureDocumentContent(t);if(i&&i.data)return L.info("Documento capturado"),{id:t.id||t.numericId||this.ID_NOT_FOUND,title:t.id==="minuta"?"Minuta":t.id||this.TITLE_NOT_FOUND,subtitle:t.name||void 0,type:i.type,mimeType:i.type==="pdf"?"application/pdf":"text/plain",size:i.data instanceof Blob?i.data.size:i.data.length,content:i.data instanceof Blob?i.data:new Blob([i.data],{type:"text/plain"}),extractedAt:new Date,isAutoCapture:!0};const a=this.pjeManager.pjeUtils.findPdfLinks();if(a&&this.isValidPdfUrl(a.href)){L.info("Fallback 2: PDF link direto encontrado, tentando baixar de",a.href);const u=await this.pjeManager.pjeUtils.download(a.href);if(!u)return L.warn("Falha ao baixar PDF do link direto."),null;const h=u;if(h.mimeType==="application/pdf"&&h.content instanceof ArrayBuffer)return L.info("PDF baixado com sucesso do link direto."),{id:t.id||t.numericId||this.ID_NOT_FOUND,title:t.id||this.TITLE_NOT_FOUND,subtitle:t.name||void 0,type:"pdf",mimeType:"application/pdf",size:h.content.byteLength,content:new Blob([h.content],{type:"application/pdf"}),extractedAt:new Date,isAutoCapture:!0}}const r=this.pjeManager.pjeUtils.extractProcessId(),c=this.pjeManager.pjeUtils.extractDocumentId();if(r&&c){const u=this.pjeManager.pjeUtils.buildContentUrl(r,c);L.info("Fallback 3: Tentando capturar documento pela URL ",u);const h=await this.pjeManager.pjeUtils.download(u);if(!h)return L.info("Falha ao baixar documento pela URL."),null;const p=h;if(p.mimeType==="application/pdf"&&p.content instanceof ArrayBuffer)return L.info("Documento capturado com sucesso pela URL."),{id:t.id||t.numericId||this.ID_NOT_FOUND,title:t.id||this.TITLE_NOT_FOUND,subtitle:t.name||void 0,type:"pdf",mimeType:"application/pdf",size:p.content.byteLength,content:new Blob([p.content],{type:"application/pdf"}),extractedAt:new Date,isAutoCapture:!0};if(p.mimeType==="application/json"&&typeof p.content=="string"){const m=this.pjeManager.pjeUtils.captureTextFromJsonBase64(p.content);if(m)return L.info("Conteúdo capturado como TXT da URL."),{id:t.id||t.numericId||this.ID_NOT_FOUND,title:t.id||this.TITLE_NOT_FOUND,subtitle:t.name||void 0,type:"txt",mimeType:"text/plain",size:m.length,content:new Blob([m],{type:"text/plain"}),extractedAt:new Date,isAutoCapture:!0}}}return L.info("Nenhum conteúdo de documento foi capturado."),null}isValidPdfUrl(t){if(!t)return!1;if(t.startsWith("blob:"))return L.detail("URL de blob rejeitada:",t),!1;if(t.includes("/viewer.html"))return L.detail("URL de viewer HTML rejeitada:",t),!1;const a=["/api/processos/","/documento/","/conteudo",".pdf"].some(r=>t.includes(r));return L.detail(`URL ${t} ${a?"aceita":"rejeitada"}`),a}extractDocumentInfo(){let t=this.ID_NOT_FOUND,i=this.NUM_ID_NOT_FOUND,a=this.TITLE_NOT_FOUND,r=!1;try{const c=document.querySelector("mat-card-title");if(c){const u=c.textContent;if(a=u.trim(),u.toLowerCase().startsWith("minuta")){r=!0;const h=u.indexOf("-");h!==-1&&h<u.length-1&&(a=u.substring(h+1).trim()),t=this.findDocumentIdInTimeline(),L.detail(`Documento tipo Minuta detectado: ${a}`)}else{const h=[/Id\s+([a-zA-Z0-9]+)/i,/ID:\s*([a-zA-Z0-9]+)/i,/Documento\s+([a-zA-Z0-9]+)/i,/Doc\.\s*([a-zA-Z0-9]+)/i];for(const p of h){const m=u.match(p);if(m&&m[1]){t=m[1],L.detail(`ID alfanumérico extraído do título: ${t}`);break}}}}if(t!==this.ID_NOT_FOUND&&!r&&(i=this.findNumericIdInTimeline(t,a),i!==this.NUM_ID_NOT_FOUND&&L.detail(`ID numérico encontrado na timeline: ${i}`)),a===this.TITLE_NOT_FOUND||!a.trim()){const u=[".documento-titulo",".rich-panel-header","h3",".titulo-documento",'[data-testid="document-title"]',".document-title"];for(const h of u){const p=document.querySelector(h);if(p&&p.textContent.trim()){a=p.textContent.trim(),L.detail(`Nome extraído de ${h}: ${a}`);break}}}L.detail("Informações extraídas:",{documentId:t,numericDocumentId:i,documentName:a,isMinuta:r})}catch(c){L.info("Erro ao extrair informações do documento:",c)}return a.includes(t)&&(a=a.replace(t,"").trim(),a.startsWith("Id -")&&(a=a.replace("Id -","").trim())),{id:t,numericId:i,name:a||this.TITLE_NOT_FOUND,isMinuta:r}}findDocumentIdInTimeline(){try{const t=document.querySelector('[aria-label="Documento não assinado"]');if(t){let r=t;for(;r&&r.parentElement;){r=r.parentElement;const c=r.querySelector('mat-card[id^="doc_"]');if(c&&c.id){const u=c.id.match(/^doc_([a-zA-Z0-9]+)$/);if(u&&u[1])return L.detail(`ID alfanumérico do documento encontrado via aria-label: ${u[1]}`),u[1]}if(r.id&&r.id.startsWith("doc_")){const u=r.id.match(/^doc_(\d+)$/);if(u&&u[1]){const h=this.findAlphanumericIdForNumeric(u[1]);return h!==this.ID_NOT_FOUND?(L.detail(`ID alfanumérico encontrado para numérico ${u[1]}: ${h}`),h):(L.detail(`ID numérico do documento encontrado via aria-label: ${u[1]}`),u[1])}}}}const i=document.querySelectorAll('li.tl-item-container[id^="doc_"], div[id^="doc_"]');for(const r of i){const c=r.textContent||(r instanceof HTMLElement?r.innerText:"")||"";if(L.detail(`Texto encontrado na timeline: ${c}`),c.includes("Documento não assinado")||c.toLowerCase().includes("minuta")||r.querySelector('[aria-label="Documento não assinado"]')){const h=r.querySelector('mat-card[id^="doc_"]');if(h&&h.id){const m=h.id.match(/^doc_([a-zA-Z0-9]+)$/);if(m&&m[1])return L.detail(`ID alfanumérico do documento encontrado na timeline: ${m[1]}`),m[1]}const p=r.id.match(/^doc_(\d+)$/);if(p&&p[1]){const m=this.findAlphanumericIdForNumeric(p[1]);return m!==this.ID_NOT_FOUND?(L.detail(`ID alfanumérico encontrado para numérico ${p[1]}: ${m}`),m):(L.detail(`ID numérico do documento encontrado na timeline: ${p[1]}`),p[1])}}}const a=document.querySelectorAll(".fa-unlock, .documento-nao-assinado");for(const r of a){let c=r;for(;c&&c.parentElement;){c=c.parentElement;const u=c.querySelector('mat-card[id^="doc_"]');if(u&&u.id){const h=u.id.match(/^doc_([a-zA-Z0-9]+)$/);if(h&&h[1])return L.detail(`ID alfanumérico encontrado via ícone não assinado: ${h[1]}`),h[1]}if(c.id&&c.id.startsWith("doc_")){const h=c.id.match(/^doc_(\d+)$/);if(h&&h[1]){const p=this.findAlphanumericIdForNumeric(h[1]);return p!==this.ID_NOT_FOUND?p:(L.detail(`ID numérico encontrado via ícone não assinado: ${h[1]}`),h[1])}}}}}catch(t){L.info("Erro ao buscar ID do documento na timeline:",t)}return this.ID_NOT_FOUND}findAlphanumericIdForNumeric(t){try{const i=document.getElementById(`doc_${t}`);if(i){const r=i.querySelector('mat-card[id^="doc_"]');if(r&&r.id){const c=r.id.match(/^doc_([a-zA-Z0-9]+)$/);if(c&&c[1])return c[1]}}const a=document.querySelectorAll(`a[href*="/documento/${t}/"]`);for(const r of a){let c=r;for(;c&&c.parentElement;){const u=c.querySelector('mat-card[id^="doc_"]')||c.closest('mat-card[id^="doc_"]');if(u&&u.id){const h=u.id.match(/^doc_([a-zA-Z0-9]+)$/);if(h&&h[1])return h[1]}c=c.parentElement}}return this.ID_NOT_FOUND}catch(i){return L.info("Erro ao buscar ID alfanumérico para numérico:",i),this.ID_NOT_FOUND}}findNumericIdInTimeline(t,i){try{const a=document.querySelectorAll('li.tl-item-container[id^="doc_"], div[id^="doc_"]');for(const c of a)if((c.textContent||(c instanceof HTMLElement?c.innerText:"")||"").includes(t||i)){const h=c.id.match(/^doc_(\d+)$/);if(h&&h[1])return L.detail(`ID numérico ${h[1]} encontrado para ID alfanumérico ${t}`),h[1]}const r=document.querySelectorAll('a[href*="/documento/"]');for(const c of r)if((c.textContent||(c instanceof HTMLElement?c.innerText:"")||"").includes(t)){const p=c.href.match(/\/documento\/(\d+)\//);if(p&&p[1])return L.detail(`ID numérico ${p[1]} encontrado em link para ID alfanumérico ${t}`),p[1]}return L.info(`ID numérico não encontrado para ID alfanumérico: ${t}`),this.NUM_ID_NOT_FOUND}catch(a){return L.info("Erro ao buscar ID numérico na timeline:",a),this.NUM_ID_NOT_FOUND}}async captureDocumentContent(t){try{const i=this.pjeManager.pjeUtils.extractProcessId(),a=t.numericId,r=t.isMinuta;if(L.info("Tentando capturar documento:",t),i&&a&&a!==this.NUM_ID_NOT_FOUND&&!r){const c=this.pjeManager.pjeUtils.buildContentUrl(i,a);L.info("Tentando baixar PDF da API construída:",c);try{const u=await this.pjeManager.pjeUtils.download(c);u||L.warn("Falha ao baixar PDF da API construída.");const h=u;if(h.mimeType==="application/pdf"){if(L.info("PDF baixado com sucesso da API construída."),h.content instanceof ArrayBuffer)return{data:new Blob([h.content],{type:"application/pdf"}),type:"pdf"}}else if(h.mimeType==="application/json"&&(L.warn("API retornou JSON, tentando capturar como TXT."),typeof h.content=="string")){const p=this.pjeManager.pjeUtils.captureTextFromJsonBase64(h.content);if(p)return L.info("Conteúdo capturado como TXT da API."),{data:p,type:"txt"}}}catch(u){L.warn("Falha ao baixar da API construída:",String(u))}}else{if(L.info("ID numérico não encontrado, tentando capturar como TXT."),r){L.info("Documento é uma Minuta, capturando como TXT.");const c=await this.captureContentAsText();if(c&&c.data)return L.info("Conteúdo capturado como TXT."),{data:c.data,type:"txt"}}L.warn("ID numérico inválido ou não encontrado e não é Minuta, não será possível capturar arquivo PDF ou TXT.")}L.warn("Nenhum documento PDF ou TXT capturado, retornando erro.")}catch(i){return L.error("Erro ao capturar documento:",i),null}}async captureContentAsText(){try{L.info("Tentando capturar conteúdo como TXT...");const t=[".documento-conteudo",".rich-panel-body",".viewer-documento .conteudo","mat-card-content",".documento-texto",".conteudo-documento",'[class*="documento"] [class*="conteudo"]',".visualizador-documento",'div[class*="text"] div[class*="content"]'];let i="";for(const a of t){const r=document.querySelector(a);if(r&&(L.detail(`Conteúdo textual encontrado com seletor: ${a}`),i=r.innerText||r.textContent||"",i&&i.trim().length>50))break}if(!i||i.trim().length<50){const a=document.querySelector("mat-card");a&&(L.detail("Capturando conteúdo de mat-card geral."),i=a.innerText||a.textContent||"")}if(!i||i.trim().length<10)throw new Error("Nenhum conteúdo textual significativo encontrado.");return i=i.trim(),i=i.replace(/\n\s*\n\s*\n/g,`
319
+
320
+ `),L.info(`Conteúdo TXT capturado: ${i.length} caracteres.`),{data:i}}catch(t){return L.error("Erro ao capturar conteúdo como TXT:",t),null}}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.checkTimeout&&(clearTimeout(this.checkTimeout),this.checkTimeout=null)}}class nk{pjeManager;constructor(t){this.pjeManager=t}handleMessage(t){const i=t.data;i.type===Ae.EXTRACT_SELECTED_DOCUMENTS&&(L.info("Mensagem de extração de documentos selecionados recebida"),this.extractAndSendSelectedDocuments(i.id))}async getSelectedDocuments(){L.info("PJe: Buscando documentos selecionados na timeline...");const t=[],i=this.pjeManager.pjeUtils.extractProcessId();if(!i)return L.warn("PJe: ID do processo não encontrado."),t;try{const a=document.querySelectorAll('mat-checkbox.mat-checkbox-checked input[type="checkbox"], input[type="checkbox"][aria-checked="true"]');if(L.info(`PJe: Encontrados ${a.length} checkboxes marcados`),a.length===0)return t;for(const r of a){const c=this.findDocumentContainer(r);if(c){L.info(`PJe: Processando container com ID: ${c.id}`);const u=await this.extractDocumentFromContainer(c,i);u&&(t.push(u),L.info(`PJe: Documento extraído: ${u.title}`))}}return t}catch(a){return L.error("PJe: Erro ao buscar documentos selecionados:",a),[]}}findDocumentContainer(t){let i=t,a=0;const r=10;for(;i&&a<r;)if(a++,i=i.parentElement,i){const c=i.classList.contains("tl-item-container")&&i.id&&i.id.startsWith("doc_"),u=i.classList.contains("tl-item-anexo")&&i.id&&i.id.startsWith("doc_");if(c||u){const h=u?"ANEXO":"DOCUMENTO";return L.info(`PJe: Container ${h} encontrado: ${i.id}`),i}}return L.warn("PJe: Container de documento/anexo não encontrado para checkbox"),null}async extractDocumentFromContainer(t,i){try{const a=t.id.match(/^doc_([a-zA-Z0-9]+)$/);if(!a||!a[1])return L.warn(`PJe: ID de documento/anexo inválido no container: ${t.id}`),null;const r=a[1],c=t.classList.contains("tl-item-anexo");let u=`${c?"Anexo":"Documento"} ${r}`,h=!1,p=r,m=r;if(c){const C=t.querySelector('a[href*="/documento/"]');if(C&&C.href){const N=C.href.match(/\/documento\/(\d+)\/conteudo/);if(N&&N[1])m=N[1],L.info(`PJe: ID numérico extraído do link do anexo: ${m}`);else return L.warn(`PJe: Não foi possível extrair ID numérico do link do anexo: ${C.href}`),null}else return L.warn(`PJe: Link de download não encontrado para anexo ${r}`),null}const g=c?[t.querySelector("a.tl-documento[aria-label]"),t.querySelector("a.tl-documento"),t.querySelector(".tl-subitem-detalhe")]:[t.querySelector("a.tl-documento"),t.querySelector('a[aria-label*="Título:"]'),t.querySelector("span:not(.sr-only)")];for(const C of g)if(C){let N=null;const O=C.getAttribute("aria-label");if(O&&!c){const U=O.match(/Título:\s*(.*)/);U&&U[1]&&(N=U[1].trim());const I=O.match(/- Id:\s*([a-zA-Z0-9]+)/);I&&I[1]?(p=I[1].trim(),h=!1):h=!0}if(N||(N=C.textContent||C.innerText),N&&N.trim()&&!N.includes("sr-only")){const U=N.match(/\(([^)]+)\)/);u=U?U[1]:N.trim(),L.info(`PJe: Nome do ${c?"anexo":"documento"} extraído: ${u}`);break}}let y=null,b="pdf",S="application/pdf",A=null;if(h&&!c){L.info("PJe: Documento Minuta detectado, capturando como TXT sem navegação");const C=await this.captureDocumentAsText(i,m);C&&(y=C,b="txt",S="text/plain",L.info(`PJe: Minuta capturada como TXT, tamanho: ${C.length} caracteres`))}else if(A=this.pjeManager.pjeUtils.buildContentUrl(i,m,"pdf"),A)try{const C=await this.pjeManager.pjeUtils.download(A);if(!C)return L.warn(`PJe: PDF não baixado corretamente de ${A}`),null;if(L.info(`PJe: PDF baixado com sucesso de ${A}`),C.content instanceof ArrayBuffer&&C.mimeType==="application/pdf")y=new Blob([C.content],{type:"application/pdf"}),b="pdf",S="application/pdf",L.info(`PJe: PDF baixado com sucesso, tamanho: ${y.size} bytes`);else throw new Error(`Tipo de conteúdo inesperado ao baixar PDF: ${C.mimeType}`)}catch(C){L.warn(`PJe: Erro ao baixar PDF ${m}, tentando capturar como TXT:`,C);const N=await this.captureDocumentAsText(i,m);N&&(y=N,b="txt",S="text/plain",L.info(`PJe: Conteúdo TXT capturado, tamanho: ${N.length} caracteres`))}else{L.warn(`PJe: URL do PDF não pode ser construída para ${m}, tentando capturar como TXT`);const C=await this.captureDocumentAsText(i,m);C&&(y=C,b="txt",S="text/plain",L.info(`PJe: Conteúdo TXT capturado, tamanho: ${C.length} caracteres`))}if(!y)return L.warn(`PJe: Não foi possível capturar conteúdo para ${c?"anexo":"documento"} ${m}`),null;const _=typeof y=="string"?y.length:y.size||void 0,R={id:p||m||crypto.randomUUID().substring(0,6),title:p||(c?"Anexo":"Minuta"),subtitle:u||void 0,type:b,mimeType:S,size:_,url:A||void 0,extractedAt:new Date,content:y,isAutoCapture:!1};return L.info(`PJe: ${c?"Anexo":"Documento"} processado como ${b.toUpperCase()}: ${u} (ID: ${R.id}, ID Numérico: ${m})`),R}catch(a){return L.error("PJe: Erro ao extrair documento/anexo do container:",a),null}}async captureDocumentAsText(t,i){try{const a=this.pjeManager.pjeUtils.buildContentUrl(t,i,"txt");if(!a)return L.warn(`PJe: URL de captura de texto não pode ser construída para ${i}`),null;L.info(`PJe: Capturando conteúdo textual do documento via API: ${a}`);const r=await fetch(a,{credentials:"include",headers:{Accept:"application/json"}});if(!r.ok)return L.error("Erro ao buscar documento via API:",r.statusText),null;const c=await r.text(),u=this.pjeManager.pjeUtils.captureTextFromJsonBase64(c);return u?(L.info(`Texto extraído com sucesso do documento ${i}`),u):(L.warn(`Nenhum texto significativo encontrado no documento ${i}`),null)}catch(a){return L.error("Erro ao capturar documento como texto:",a),null}}async extractAndSendSelectedDocuments(t){try{L.info("Iniciando extração de documentos selecionados...");const i=await this.getSelectedDocuments();if(i.length===0){this.pjeManager.sendError(Ae.EXTRACTION_ERROR,"Nenhum documento selecionado encontrado",t);return}L.info(`${i.length} documentos selecionados encontrados`),this.pjeManager.sendSuccessMessage(Ae.MULTIPLE_DOCUMENTS_EXTRACTED,i,t),L.info("Documentos selecionados enviados com sucesso")}catch(i){L.error("Erro ao extrair documentos selecionados:",i),this.pjeManager.sendError(Ae.EXTRACTION_ERROR,`Erro ao extrair documentos selecionados: ${i.message}`,t)}}destroy(){}}class ik{pjeManager;extractionTimeout=null;TIMEOUT=6e4;MAX_PDF_SIZE=Xt.max_pdf_size*1024*1024;isExtracting=!1;constructor(t){this.pjeManager=t||new pp}async handleMessage(t){const i=t.data;if(i.type===Ae.EXTRACT_FULL_PROCESS){if(L.info("Mensagem de extração de processo completo recebida"),this.isExtracting){L.info("Extração já em andamento, ignorando nova solicitação");return}this.isExtracting=!0,this.clearTimeout();let a=!1;this.extractionTimeout=setTimeout(()=>{a=!0,L.warn("Tempo limite de extração de processo completo atingido, abortando..."),this.pjeManager.sendError(Ae.EXTRACTION_ERROR,"Tempo limite de extração de processo completo atingido. Tente novamente mais tarde.",i.id)},this.TIMEOUT);try{const r=await this.extractFullProcess();!a&&this.isExtracting&&(this.clearTimeout(),this.isExtracting=!1,this.sendExtractionResult(r,i.id),L.info("Processo completo extraído com sucesso:",r))}catch(r){L.error("Erro ao extrair processo completo:",r),!a&&this.isExtracting&&(this.clearTimeout(),this.isExtracting=!1,this.pjeManager.sendError(Ae.EXTRACTION_ERROR,`Erro durante extração: ${r}`,i.id))}}}clearTimeout(){this.extractionTimeout&&(clearTimeout(this.extractionTimeout),this.extractionTimeout=null,L.detail("Timeout de extração limpo"))}async extractFullProcess(){L.info("Iniciando extração do processo completo...");try{const t=this.pjeManager.pjeUtils.extractProcessId();if(!t)return L.warn("ID do processo não encontrado, abortando extração."),null;L.info("ID do processo encontrado:",t);const i=this.pjeManager.pjeUtils.buildFullProcessUrl(t),a=this.pjeManager.pjeUtils.extractProcessNumber();if(L.info("Número do processo extraído:",a),L.info("URL do processo completo:",i),!i)return L.warn("URL do processo completo não encontrada, abortando extração."),null;const r=await this.capturePdfFromUrl(i);if(r){const c=r.size||0;if(L.info(`PDF baixado com tamanho: ${this.pjeManager.pjeUtils.formatFileSize(c)}`),c>this.MAX_PDF_SIZE){L.info(`PDF maior que ${this.MAX_PDF_SIZE}MB, extraindo texto...`);try{const h=await this.pjeManager.pjeUtils.extractTextFromPdf(r),p=new Blob([h],{type:"text/plain"});return{id:t,title:"Processo",subtitle:a||void 0,type:"txt",mimeType:"text/plain",size:p.size,url:i,extractedAt:new Date,content:p,isAutoCapture:!1}}catch(h){L.error("Erro na extração de texto do Processo Completo, retornando PDF original:",h)}}return{id:t,title:"Processo",subtitle:a||void 0,type:"pdf",mimeType:"application/pdf",size:c,url:i,extractedAt:new Date,content:r,isAutoCapture:!1}}return null}catch(t){throw L.error("Erro na extração do processo completo:",t),t}}sendExtractionResult(t,i){if(!t){L.warn("Nenhum dado de documento capturado."),this.pjeManager.sendError(Ae.EXTRACTION_ERROR,"Nenhum dado de documento capturado durante a extração do processo completo",i);return}L.info("Enviando resultado da extração do processo completo:",t),this.pjeManager.sendSuccessMessage(Ae.SINGLE_DOCUMENT_EXTRACTED,t,i)}async capturePdfFromUrl(t){if(!t)return L.warn("URL de PDF nula"),null;try{const i=await this.pjeManager.pjeUtils.download(t);if(!i)return L.warn("Falha ao baixar PDF do link direto."),null;const a=i;if(a.mimeType!=="application/pdf")throw new Error(`Tipo MIME inesperado: ${a.mimeType}`);if(!a.content||a.content.byteLength===0)throw new Error("PDF baixado está vazio");return new Blob([a.content],{type:"application/pdf"})}catch(i){return L.error("Erro ao capturar PDF da URL:",i),null}}destroy(){this.reset()}reset(){this.clearTimeout(),this.isExtracting=!1,L.detail("Estado de extração resetado")}}class pp extends lM{instances;pjeUtils;constructor(){super(kf.EXTENSION),this.instances=new Map,this.pjeUtils=new tk,this.initializeModules(),this.setupMessageListeners()}initializeModules(){const t=new ek(this),i=new nk(this),a=new ik(this);this.instances.set("currentDocument",t),this.instances.set("selectedDocuments",i),this.instances.set("fullProcess",a),L.info("PJeManager: Módulos inicializados")}setupMessageListeners(){this.onMessage(Ae.EXTRACT_VISIBLE_DOCUMENT,(t,i)=>{const a=this.instances.get("currentDocument");a&&a.handleMessage(i)}),this.onMessage(Ae.EXTRACT_SELECTED_DOCUMENTS,(t,i)=>{const a=this.instances.get("selectedDocuments");a&&a.handleMessage(i)}),this.onMessage(Ae.EXTRACT_FULL_PROCESS,(t,i)=>{const a=this.instances.get("fullProcess");a&&a.handleMessage(i)}),L.info("Listeners de mensagem registrados")}destroy(){this.instances.forEach(t=>t.destroy()),this.instances.clear(),L.info("PJeManager destruído")}}function sk(l){iM({dsn:"https://e791541eab7648b79f52682c23847181@o4509921655521280.ingest.us.sentry.io/4509928058978304",sendDefaultPii:!0,environment:l,beforeSend(t){return t.exception?.values?.[0]?.value?.includes("Extension context invalidated")?null:t}})}class ak{config=null;ui=null;pjeManager=null;initialized=!1;lastCheckedUrl=null;showUi={mapped:!1,unmapped:!1};constructor(){this.config=Xt}async start(){try{sk(this.config?.env||"unk"),this.config=Xt,L.info("Corisco iniciado",this.config),await this.checkUrlAndToggleState(),setInterval(()=>this.checkUrlAndToggleState(),500)}catch(t){L.error("Erro ao inicializar Corisco:",t)}}async checkUrlAndToggleState(t=!1){const i=window.location.href;if(i===this.lastCheckedUrl&&!t)return;if(this.lastCheckedUrl=i,!this.isHostAllowed()){L.info(`Host não permitido (${i}). Destruindo componentes se inicializados.`),this.destroy();return}const a=$y(i);if(a&&this.showUi.mapped){L.info(`URL mapeada (${i}) e extensão habilitada. Inicializando...`),await this.initializeComponents();return}else if(!a&&this.showUi.unmapped){L.info(`URL não mapeada (${i}) e extensão habilitada. Inicializando...`),await this.initializeComponents();return}else{L.info(`URL (${i}) não atende aos critérios. Destruindo componentes se inicializados.`),this.destroy();return}}async initializeComponents(){this.initialized||(this.ui=new aM,await this.ui.init(),this.pjeManager=new pp,this.initialized=!0,L.info("Componentes da extensão inicializados com sucesso"))}destroy(){this.initialized&&(this.ui?.destroy(),this.pjeManager?.destroy(),this.initialized=!1)}isInitialized(){return L.info("Verificando estado de inicialização, retornando:",this.initialized),this.initialized}getVersion(){return L.info("Obtendo versão da aplicação, retornando:",this.config?.app.version||"unk"),this.config?.app.version||"unk"}getEnv(){return L.info("Obtendo ambiente da aplicação, retornando:",this.config?.env||"unk"),this.config?.env||"unk"}isHostAllowed(){const t=window.location.href;return L.info(`Verificando se o host é permitido: ${t}`),Fc(t)}isHostUrlMapped(){const t=window.location.href;return L.info(`Verificando se a URL está mapeada: ${t}`),$y(t)}async toggleShowUi(t,i){this.showUi[t]=i,L.info(`Configuração atualizada: Mostrar UI para '${t}' = ${i}`),await this.checkUrlAndToggleState(!0)}}const mp=new ak;return typeof window<"u"&&(window.Corisco=mp),typeof globalThis<"u"&&(globalThis.Corisco=mp),mp});